Commit 425b9886 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Start of integration of Erwann Chenede's multihead work from the

Thu Apr 25 16:51:40 2002  Owen Taylor  <otaylor@redhat.com>

        Start of integration of Erwann Chenede's multihead work
        from the gtk-multihead branch.

        * gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch]
        gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch]
        New classes representing a set of screens with attached
        input devices and a single contiguous area, respectively.

        * gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c:
        gdk/x11/gdkprivate-x11.h: Make the initialization interface
        simple _gdk_windowing_init() and do the rest in
        gdk_open_display() calls.

        * gdk/gdk.[ch]: Add gdk_parse_args() which can be used
        to do the display-independent part of initialization
        instead of gdk_init_[check].

        * gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h
        gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h:
        Add multihead variants (_for_display(), for_screen()) of functions
        getting information specific to a particular screen screen or
        display.

        * gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions
        like gdk_rgb_get_colormap() that used to get/list global
        objects.

        * gdk/x11/gdkx.h: Add functions for converting GdkScreen
        and GdkDisplay into the X equivalents.

        * gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords()
        not in the headers and unused.

        * configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}:
        Remove gxid support ... has not been tested for a long time...
        "xfree" support is more portable to non XFree86.

        * gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be
        used to turn off functions that are inherently non-multihead
        safe.

        * gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions
        are used in non-multihead-safe ways.

        * gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK
        multihead safe.
parent e39e9212
Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com>
Start of integration of Erwann Chenede's multihead work
from the gtk-multihead branch.
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch]
gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch]
New classes representing a set of screens with attached
input devices and a single contiguous area, respectively.
* gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c:
gdk/x11/gdkprivate-x11.h: Make the initialization interface
simple _gdk_windowing_init() and do the rest in
gdk_open_display() calls.
* gdk/gdk.[ch]: Add gdk_parse_args() which can be used
to do the display-independent part of initialization
instead of gdk_init_[check].
* gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h
gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h:
Add multihead variants (_for_display(), for_screen()) of functions
getting information specific to a particular screen screen or
display.
* gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions
like gdk_rgb_get_colormap() that used to get/list global
objects.
* gdk/x11/gdkx.h: Add functions for converting GdkScreen
and GdkDisplay into the X equivalents.
* gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords()
not in the headers and unused.
* configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}:
Remove gxid support ... has not been tested for a long time...
"xfree" support is more portable to non XFree86.
* gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be
used to turn off functions that are inherently non-multihead
safe.
* gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions
are used in non-multihead-safe ways.
* gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK
multihead safe.
Thu Apr 25 23:49:01 2002 Kristian Rietveld <kris@gtk.org>
Fixes #74206.
......
Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com>
Start of integration of Erwann Chenede's multihead work
from the gtk-multihead branch.
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch]
gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch]
New classes representing a set of screens with attached
input devices and a single contiguous area, respectively.
* gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c:
gdk/x11/gdkprivate-x11.h: Make the initialization interface
simple _gdk_windowing_init() and do the rest in
gdk_open_display() calls.
* gdk/gdk.[ch]: Add gdk_parse_args() which can be used
to do the display-independent part of initialization
instead of gdk_init_[check].
* gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h
gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h:
Add multihead variants (_for_display(), for_screen()) of functions
getting information specific to a particular screen screen or
display.
* gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions
like gdk_rgb_get_colormap() that used to get/list global
objects.
* gdk/x11/gdkx.h: Add functions for converting GdkScreen
and GdkDisplay into the X equivalents.
* gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords()
not in the headers and unused.
* configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}:
Remove gxid support ... has not been tested for a long time...
"xfree" support is more portable to non XFree86.
* gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be
used to turn off functions that are inherently non-multihead
safe.
* gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions
are used in non-multihead-safe ways.
* gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK
multihead safe.
Thu Apr 25 23:49:01 2002 Kristian Rietveld <kris@gtk.org>
Fixes #74206.
......
Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com>
Start of integration of Erwann Chenede's multihead work
from the gtk-multihead branch.
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch]
gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch]
New classes representing a set of screens with attached
input devices and a single contiguous area, respectively.
* gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c:
gdk/x11/gdkprivate-x11.h: Make the initialization interface
simple _gdk_windowing_init() and do the rest in
gdk_open_display() calls.
* gdk/gdk.[ch]: Add gdk_parse_args() which can be used
to do the display-independent part of initialization
instead of gdk_init_[check].
* gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h
gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h:
Add multihead variants (_for_display(), for_screen()) of functions
getting information specific to a particular screen screen or
display.
* gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions
like gdk_rgb_get_colormap() that used to get/list global
objects.
* gdk/x11/gdkx.h: Add functions for converting GdkScreen
and GdkDisplay into the X equivalents.
* gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords()
not in the headers and unused.
* configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}:
Remove gxid support ... has not been tested for a long time...
"xfree" support is more portable to non XFree86.
* gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be
used to turn off functions that are inherently non-multihead
safe.
* gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions
are used in non-multihead-safe ways.
* gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK
multihead safe.
Thu Apr 25 23:49:01 2002 Kristian Rietveld <kris@gtk.org>
Fixes #74206.
......
Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com>
Start of integration of Erwann Chenede's multihead work
from the gtk-multihead branch.
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch]
gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch]
New classes representing a set of screens with attached
input devices and a single contiguous area, respectively.
* gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c:
gdk/x11/gdkprivate-x11.h: Make the initialization interface
simple _gdk_windowing_init() and do the rest in
gdk_open_display() calls.
* gdk/gdk.[ch]: Add gdk_parse_args() which can be used
to do the display-independent part of initialization
instead of gdk_init_[check].
* gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h
gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h:
Add multihead variants (_for_display(), for_screen()) of functions
getting information specific to a particular screen screen or
display.
* gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions
like gdk_rgb_get_colormap() that used to get/list global
objects.
* gdk/x11/gdkx.h: Add functions for converting GdkScreen
and GdkDisplay into the X equivalents.
* gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords()
not in the headers and unused.
* configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}:
Remove gxid support ... has not been tested for a long time...
"xfree" support is more portable to non XFree86.
* gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be
used to turn off functions that are inherently non-multihead
safe.
* gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions
are used in non-multihead-safe ways.
* gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK
multihead safe.
Thu Apr 25 23:49:01 2002 Kristian Rietveld <kris@gtk.org>
Fixes #74206.
......
Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com>
Start of integration of Erwann Chenede's multihead work
from the gtk-multihead branch.
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch]
gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch]
New classes representing a set of screens with attached
input devices and a single contiguous area, respectively.
* gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c:
gdk/x11/gdkprivate-x11.h: Make the initialization interface
simple _gdk_windowing_init() and do the rest in
gdk_open_display() calls.
* gdk/gdk.[ch]: Add gdk_parse_args() which can be used
to do the display-independent part of initialization
instead of gdk_init_[check].
* gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h
gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h:
Add multihead variants (_for_display(), for_screen()) of functions
getting information specific to a particular screen screen or
display.
* gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions
like gdk_rgb_get_colormap() that used to get/list global
objects.
* gdk/x11/gdkx.h: Add functions for converting GdkScreen
and GdkDisplay into the X equivalents.
* gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords()
not in the headers and unused.
* configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}:
Remove gxid support ... has not been tested for a long time...
"xfree" support is more portable to non XFree86.
* gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be
used to turn off functions that are inherently non-multihead
safe.
* gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions
are used in non-multihead-safe ways.
* gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK
multihead safe.
Thu Apr 25 23:49:01 2002 Kristian Rietveld <kris@gtk.org>
Fixes #74206.
......
Thu Apr 25 16:51:40 2002 Owen Taylor <otaylor@redhat.com>
Start of integration of Erwann Chenede's multihead work
from the gtk-multihead branch.
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch]
gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkscreen-x11.[ch]
New classes representing a set of screens with attached
input devices and a single contiguous area, respectively.
* gdk/gdk.[ch] gdk/gdkinternals.h gdk/x11/gdkmain-x11.c:
gdk/x11/gdkprivate-x11.h: Make the initialization interface
simple _gdk_windowing_init() and do the rest in
gdk_open_display() calls.
* gdk/gdk.[ch]: Add gdk_parse_args() which can be used
to do the display-independent part of initialization
instead of gdk_init_[check].
* gdk/gdkcursor.h gdk/gdkfont.h gdk/gdkkeys.h gdk/gdkpixmap.h
gdk/gdkproperty.h gdk/gdkselection.h gdk/gdkwindow.h:
Add multihead variants (_for_display(), for_screen()) of functions
getting information specific to a particular screen screen or
display.
* gdk/gdkscreen.[ch]: Add gdk_screen__* variants of functions
like gdk_rgb_get_colormap() that used to get/list global
objects.
* gdk/x11/gdkx.h: Add functions for converting GdkScreen
and GdkDisplay into the X equivalents.
* gdk/x11/gdkwindow-x11.c: Removed gdk_window_xid_at_coords()
not in the headers and unused.
* configure.in gdk/x11/{gxid.c,gxid_lib.[ch],gdkinput-gxi.c}:
Remove gxid support ... has not been tested for a long time...
"xfree" support is more portable to non XFree86.
* gdk/**.h: Add a GDK_MULTIHEAD_SAFE define that can be
used to turn off functions that are inherently non-multihead
safe.
* gdk/**.c: add GDK_NOTE(multihead, ...) calls when functions
are used in non-multihead-safe ways.
* gdk/*.c gdk/x11/*.c: Changes to make the internals of GDK
multihead safe.
Thu Apr 25 23:49:01 2002 Kristian Rietveld <kris@gtk.org>
Fixes #74206.
......
......@@ -175,7 +175,7 @@ AC_ARG_ENABLE(xkb, [ --enable-xkb support XKB [default=maybe]],
, enable_xkb="maybe")
AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes)
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
AC_ARG_WITH(xinput, [ --with-xinput=[no/yes] support XInput ])
AC_ARG_WITH(wintab, [ --with-wintab=DIRECTORY use Wintab API with win32 backend])
AC_ARG_WITH(ie55, [ --with-ie55=DIRECTORY IE5.5 libs and headers (for Active IMM)])
......@@ -1084,18 +1084,13 @@ if test "x$gdktarget" = "xx11"; then
# set up things for XInput
if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
AC_DEFINE(XINPUT_GXI)
xinput_progs=gxid
x_extra_libs="-lXi $x_extra_libs"
elif test "x$with_xinput" = "xxfree"; then
if test "x$with_xinput" = "xxfree" || test "x$with_xinput" = "xyes"; then
AC_DEFINE(XINPUT_XFREE)
x_extra_libs="-lXi $x_extra_libs"
else
AC_DEFINE(XINPUT_NONE)
fi
AM_CONDITIONAL(XINPUT_GXI, test x$with_xinput = xgxi)
AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
if test "x$enable_shm" = "xyes"; then
......
......@@ -101,10 +101,9 @@ Creates a new colormap for the given visual.
<!-- ##### FUNCTION gdk_colormap_get_system ##### -->
<para>
Returns the system's default colormap.
</para>
@Returns: the default colormap.
@Returns:
<!-- ##### FUNCTION gdk_colormap_get_system_size ##### -->
......
......@@ -79,24 +79,9 @@ locale.
<!-- ##### FUNCTION gdk_set_sm_client_id ##### -->
<para>
Sets the <literal>SM_CLIENT_ID</literal> property on the application's leader window so that
the window manager can save the application's state using the X11R6 ICCCM
session management protocol.
</para>
<para>
The leader window is automatically created by GDK and never shown. It's only
use is for session management. The <literal>WM_CLIENT_LEADER</literal> property is automatically
set on all X windows created by the application to point to the leader window.
</para>
<para>
See the X Session Management Library documentation for more information on
session management and the Inter-Client Communication Conventions Manual
(ICCCM) for information on the <literal>WM_CLIENT_LEADER</literal> property.
(Both documents are part of the X Window System distribution.)
</para>
@sm_client_id: the client id assigned by the session manager when the
connection was opened, or %NULL to remove the property.
@sm_client_id:
<!-- ##### FUNCTION gdk_exit ##### -->
......
......@@ -120,18 +120,14 @@ image is freed.</para></warning>
<!-- ##### FUNCTION gdk_image_get ##### -->
<para>
Gets part of a #GdkWindow and stores it in a new #GdkImage.
</para>
@drawable:
@x: the left edge of the rectangle to copy from @window.
@y: the top edge of the rectangle to copy from @window.
@width: the width of the area to copy, in pixels.
@height: the height of the area to copy, in pixels.
@Returns: a new #GdkImage with a copy of the given area of @window.
<!-- # Unused Parameters # -->
@window: the #GdkWindow to copy from.
@x:
@y:
@width:
@height:
@Returns:
<!-- ##### FUNCTION gdk_image_ref ##### -->
<para>
......
......@@ -90,6 +90,7 @@ in the keymap and see what keyval it corresponds to.
</para>
@parent_instance:
@display:
<!-- ##### STRUCT GdkKeymapKey ##### -->
<para>
......
......@@ -245,9 +245,6 @@ either @region or @rect.
<!-- ##### FUNCTION gdk_region_intersect ##### -->
<para>
Sets the area of @source1 to the intersection of the areas of @source1
and @source2. The resulting area is the set of pixels contained in
both @source1 and @source2.
</para>
@source1: a #GdkRegion
......@@ -278,13 +275,10 @@ area is the set of pixels contained in @source1 but not in @source2.
<!-- ##### FUNCTION gdk_region_xor ##### -->
<para>
Sets the area of @source1 to the exclusive-OR of the areas of @source1
and @source2. The resulting area is the set of pixels contained in one
or the other of the two sources but not in both.
</para>
@source1: a #GdkRegion
@source2: a #GdkRegion
@source1:
@source2:
<!-- ##### STRUCT GdkSpan ##### -->
......
......@@ -407,14 +407,9 @@ private colormap.
<!-- ##### FUNCTION gdk_rgb_get_visual ##### -->
<para>
Gets a "preferred visual" chosen by GdkRGB. In previous versions of
GDK, this was the only visual GdkRGB could use for rendering. In
current versions, it's simply the visual GdkRGB would have chosen as
the optimal one in those previous versions. GdkRGB can now render to
drawables with any visual.
</para>
@Returns: The #GdkVisual chosen by GdkRGB.
@Returns:
<!-- ##### FUNCTION gdk_rgb_get_colormap ##### -->
......
......@@ -108,6 +108,7 @@ pixel_from_rgb (GdkVisual *visual,
<structfield>blue_prec</structfield> give an alternate presentation
of the information in <structfield>blue_mask</structfield>.
@blue_prec: See above.
@screen:
<!-- ##### ENUM GdkVisualType ##### -->
<para>
......
......@@ -245,6 +245,7 @@ the @window_at_pointer function in #GdkPointerHooks. It will be used
when GDK gets multihead support.
</para>
@parent_instance:
<!-- ##### FUNCTION gdk_window_new ##### -->
<para>
......
......@@ -59,8 +59,10 @@ Returns the X window belonging to a #GdkWindow.
Returns the display of a #GdkPixmap.
</para>
@win: a #GdkPixmap.
@pix:
@Returns: an Xlib <type>Display*</type>.
<!-- # Unused Parameters # -->
@win: a #GdkPixmap.
<!-- ##### MACRO GDK_PIXMAP_XID ##### -->
......@@ -68,8 +70,10 @@ Returns the display of a #GdkPixmap.
Returns the X pixmap belonging to a #GdkPixmap.
</para>
@win: a #GdkPixmap.
@pix:
@Returns: the Xlib <type>XPixmap</type> of @win.
<!-- # Unused Parameters # -->
@win: a #GdkPixmap.
<!-- ##### MACRO GDK_DRAWABLE_XDISPLAY ##### -->
......
......@@ -110,6 +110,8 @@ gdk_public_h_sources = @STRIP_BEGIN@ \
gdktypes.h \
gdkvisual.h \
gdkwindow.h \
gdkdisplay.h \
gdkscreen.h \
@STRIP_END@
gdk_headers = @STRIP_BEGIN@ \
......@@ -142,6 +144,8 @@ gdk_c_sources = @STRIP_BEGIN@ \
gdkregion-generic.c \
gdkregion-generic.h \
gdkwindow.c \
gdkdisplay.c \
gdkscreen.c \
@STRIP_END@
#
......
......@@ -51,6 +51,8 @@ static int gdk_initialized = 0; /* 1 if the library is initialized,
*/
static gchar *gdk_progclass = NULL;
static gint gdk_argc = 0;
static gchar **gdk_argv = NULL;
#ifdef G_ENABLE_DEBUG
static const GDebugKey gdk_debug_keys[] = {
......@@ -66,6 +68,7 @@ static const GDebugKey gdk_debug_keys[] = {
{"image", GDK_DEBUG_IMAGE},
{"input", GDK_DEBUG_INPUT},
{"cursor", GDK_DEBUG_CURSOR},
{"multihead", GDK_DEBUG_MULTIHEAD},
};
static const int gdk_ndebug_keys = G_N_ELEMENTS (gdk_debug_keys);
......@@ -233,8 +236,10 @@ gdk_arg_name_cb (const char *key, const char *value, gpointer user_data)
}
static GdkArgDesc gdk_args[] = {
{ "class" , GDK_ARG_CALLBACK, NULL, gdk_arg_class_cb },
{ "name", GDK_ARG_CALLBACK, NULL, gdk_arg_name_cb },
{ "class" , GDK_ARG_CALLBACK, NULL, gdk_arg_class_cb },
{ "name", GDK_ARG_CALLBACK, NULL, gdk_arg_name_cb },
{ "display", GDK_ARG_STRING, &_gdk_display_name, (GdkArgFunc)NULL },
#ifdef G_ENABLE_DEBUG
{ "gdk-debug", GDK_ARG_CALLBACK, NULL, gdk_arg_debug_cb },
{ "gdk-no-debug", GDK_ARG_CALLBACK, NULL, gdk_arg_no_debug_cb },
......@@ -242,49 +247,53 @@ static GdkArgDesc gdk_args[] = {
{ NULL }
};
/*
*--------------------------------------------------------------
* gdk_init_check
*
* Initialize the library for use.
*
* Arguments:
* "argc" is the number of arguments.
* "argv" is an array of strings.
*
* Results:
* "argc" and "argv" are modified to reflect any arguments
* which were not handled. (Such arguments should either
* be handled by the application or dismissed). If initialization
* fails, returns FALSE, otherwise TRUE.
/**
* _gdk_get_command_line_args:
* @argv: location to store argv pointer
* @argc: location
*
* Retrieve the command line arguments passed to gdk_init().
* The returned argv pointer points to static storage ; no
* copy is made.
**/
void
_gdk_get_command_line_args (int *argc,
char ***argv)
{
*argc = gdk_argc;
*argv = gdk_argv;
}
/**
* gdk_parse_args:
* @argc: the number of command line arguments.
* @argv: the array of command line arguments.
*
* Parse command line arguments, and store for future
* use by calls to gdk_open_display().
*
* Side effects:
* The library is initialized.
* Any arguments used by GDK are removed from the array and @argc and @argv are
* updated accordingly.
*
*--------------------------------------------------------------
*/
gboolean
gdk_init_check (int *argc,
* You shouldn't call this function explicitely if you are using
* gtk_init(), gtk_init_check(), gdk_init(), or gdk_init_check().
**/
void
gdk_parse_args (int *argc,
char ***argv)
{
gchar **argv_orig = NULL;
gint argc_orig = 0;
GdkArgContext *arg_context;
gboolean result;
int i;
if (gdk_initialized)
return TRUE;
gint i;
if (argc && argv)
{
argc_orig = *argc;
gdk_argc = *argc;
argv_orig = g_malloc ((argc_orig + 1) * sizeof (char*));
for (i = 0; i < argc_orig; i++)
argv_orig[i] = g_strdup ((*argv)[i]);
argv_orig[argc_orig] = NULL;
gdk_argv = g_malloc ((gdk_argc + 1) * sizeof (char*));
for (i = 0; i < gdk_argc; i++)
gdk_argv[i] = g_strdup ((*argv)[i]);
gdk_argv[gdk_argc] = NULL;
if (*argc > 0)
{
......@@ -301,13 +310,13 @@ gdk_init_check (int *argc,
{
g_set_prgname ("<unknown>");
}
/* We set the fallback program class here, rather than lazily in
* gdk_get_program_class, since we don't want -name to override it.
*/
gdk_progclass = g_strdup (g_get_prgname ());
if (gdk_progclass[0])
gdk_progclass[0] = g_ascii_toupper (gdk_progclass[0]);
gdk_progclass[0] = g_ascii_toupper (gdk_progclass[0]);
#ifdef G_ENABLE_DEBUG
{
......@@ -328,26 +337,70 @@ gdk_init_check (int *argc,
GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
g_type_init ();
result = _gdk_windowing_init_check (argc_orig, argv_orig);
for (i = 0; i < argc_orig; i++)
g_free(argv_orig[i]);
g_free(argv_orig);
/* Do any setup particular to the windowing system
*/
_gdk_windowing_init ();
}
/**
* gdk_get_display_arg_name:
*
* Gets the display name specified in the command line arguments passed
* to gdk_init() or gdk_parse_args(), if any.
*
* Returns: the display name, if specified explicitely, otherwise %NULL
*/
gchar *
gdk_get_display_arg_name (void)
{
return _gdk_display_name;
}
if (!result)
return FALSE;
/*
*--------------------------------------------------------------
* gdk_init_check
*
* Initialize the library for use.
*
* Arguments:
* "argc" is the number of arguments.
* "argv" is an array of strings.
*
* Results:
* "argc" and "argv" are modified to reflect any arguments
* which were not handled. (Such arguments should either
* be handled by the application or dismissed). If initialization
* fails, returns FALSE, otherwise TRUE.
*
* Side effects:
* The library is initialized.
*
*--------------------------------------------------------------
*/
gboolean
gdk_init_check (int *argc,
char ***argv)
{
GdkDisplay *display;
_gdk_visual_init ();
_gdk_windowing_window_init ();
_gdk_windowing_image_init ();
_gdk_events_init ();
_gdk_input_init ();
_gdk_dnd_init ();
if (gdk_initialized)
return TRUE;
gdk_parse_args (argc, argv);