2002-04-25 22:29:14 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
|
|
|
* gdkdisplay-x11.c
|
|
|
|
*
|
New API to handle the clipboard manager.
2004-10-25 Anders Carlsson <andersca@imendio.com>
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c:
(gdk_display_supports_clipboard_persistence),
(gdk_display_store_clipboard):
New API to handle the clipboard manager.
* gtk/gtk.symbols:
* gtk/gtkclipboard.c: (gtk_clipboard_class_init),
(gtk_clipboard_finalize), (selection_clear_event_cb),
(clipboard_unset), (gtk_clipboard_set_text),
(gtk_clipboard_request_targets), (gtk_clipboard_wait_for_targets),
(clipboard_peek), (gtk_clipboard_owner_change),
(gtk_clipboard_wait_is_target_available),
(gtk_clipboard_store_timeout), (gtk_clipboard_set_can_store),
(gtk_clipboard_selection_notify), (gtk_clipboard_store),
(_gtk_clipboard_store_all):
* gtk/gtkclipboard.h:
Add API for clipboard persistence and implement it, also add
gtk_clipboard_wait_is_target_available.
* gtk/gtkmain.c: (gtk_main):
Call _gtk_clipboard_store_all before exiting.
2004-10-25 18:53:30 +00:00
|
|
|
* Copyright 2001 Sun Microsystems Inc.
|
|
|
|
* Copyright (C) 2004 Nokia Corporation
|
2002-04-25 22:29:14 +00:00
|
|
|
*
|
|
|
|
* Erwann Chenede <erwann.chenede@sun.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2003-01-09 02:38:13 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2005-01-25 04:02:55 +00:00
|
|
|
#include <errno.h>
|
2002-04-25 22:29:14 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include "gdkx.h"
|
|
|
|
#include "gdkdisplay.h"
|
|
|
|
#include "gdkdisplay-x11.h"
|
|
|
|
#include "gdkscreen.h"
|
|
|
|
#include "gdkscreen-x11.h"
|
|
|
|
#include "gdkinternals.h"
|
|
|
|
#include "gdkinputprivate.h"
|
|
|
|
#include "xsettings-client.h"
|
2005-03-16 03:17:27 +00:00
|
|
|
#include "gdkalias.h"
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
#include <X11/Xatom.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_XKB
|
|
|
|
#include <X11/XKBlib.h>
|
|
|
|
#endif
|
|
|
|
|
2004-05-18 20:56:54 +00:00
|
|
|
#ifdef HAVE_XFIXES
|
|
|
|
#include <X11/extensions/Xfixes.h>
|
|
|
|
#endif
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
static void gdk_display_x11_class_init (GdkDisplayX11Class *class);
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
static void gdk_display_x11_dispose (GObject *object);
|
2002-04-25 22:29:14 +00:00
|
|
|
static void gdk_display_x11_finalize (GObject *object);
|
|
|
|
|
2003-04-18 20:53:37 +00:00
|
|
|
#ifdef HAVE_X11R6
|
2002-05-20 19:04:33 +00:00
|
|
|
static void gdk_internal_connection_watch (Display *display,
|
|
|
|
XPointer arg,
|
|
|
|
gint fd,
|
|
|
|
gboolean opening,
|
|
|
|
XPointer *watch_data);
|
2003-04-18 20:53:37 +00:00
|
|
|
#endif /* HAVE_X11R6 */
|
2002-05-20 19:04:33 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
static gpointer parent_class = NULL;
|
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
/* Note that we never *directly* use WM_LOCALE_NAME, WM_PROTOCOLS,
|
|
|
|
* but including them here has the side-effect of getting them
|
|
|
|
* into the internal Xlib cache
|
|
|
|
*/
|
|
|
|
static const char *const precache_atoms[] = {
|
|
|
|
"UTF8_STRING",
|
|
|
|
"WM_CLIENT_LEADER",
|
|
|
|
"WM_DELETE_WINDOW",
|
|
|
|
"WM_LOCALE_NAME",
|
|
|
|
"WM_PROTOCOLS",
|
|
|
|
"WM_TAKE_FOCUS",
|
|
|
|
"_NET_WM_DESKTOP",
|
|
|
|
"_NET_WM_ICON",
|
|
|
|
"_NET_WM_ICON_NAME",
|
|
|
|
"_NET_WM_NAME",
|
|
|
|
"_NET_WM_PID",
|
|
|
|
"_NET_WM_PING",
|
|
|
|
"_NET_WM_STATE",
|
|
|
|
"_NET_WM_STATE_STICKY",
|
|
|
|
"_NET_WM_STATE_MAXIMIZED_VERT",
|
|
|
|
"_NET_WM_STATE_MAXIMIZED_HORZ",
|
|
|
|
"_NET_WM_STATE_FULLSCREEN",
|
2004-07-11 13:26:57 +00:00
|
|
|
"_NET_WM_SYNC_REQUEST",
|
|
|
|
"_NET_WM_SYNC_REQUEST_COUNTER",
|
2003-07-05 01:54:05 +00:00
|
|
|
"_NET_WM_WINDOW_TYPE",
|
|
|
|
"_NET_WM_WINDOW_TYPE_NORMAL",
|
2004-04-18 14:33:07 +00:00
|
|
|
"_NET_WM_USER_TIME",
|
2005-01-19 19:53:12 +00:00
|
|
|
"_NET_VIRTUAL_ROOTS"
|
2003-07-05 01:54:05 +00:00
|
|
|
};
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
GType
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
_gdk_display_x11_get_type (void)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
|
|
|
static GType object_type = 0;
|
|
|
|
|
|
|
|
if (!object_type)
|
|
|
|
{
|
|
|
|
static const GTypeInfo object_info =
|
|
|
|
{
|
|
|
|
sizeof (GdkDisplayX11Class),
|
|
|
|
(GBaseInitFunc) NULL,
|
2003-04-18 19:18:27 +00:00
|
|
|
(GBaseFinalizeFunc) NULL,
|
2002-04-25 22:29:14 +00:00
|
|
|
(GClassInitFunc) gdk_display_x11_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GdkDisplayX11),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
object_type = g_type_register_static (GDK_TYPE_DISPLAY,
|
2005-08-31 15:14:26 +00:00
|
|
|
g_intern_static_string ("GdkDisplayX11"),
|
2002-04-25 22:29:14 +00:00
|
|
|
&object_info, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
return object_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_display_x11_class_init (GdkDisplayX11Class * class)
|
|
|
|
{
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
|
|
|
|
|
|
|
object_class->dispose = gdk_display_x11_dispose;
|
|
|
|
object_class->finalize = gdk_display_x11_finalize;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
parent_class = g_type_class_peek_parent (class);
|
|
|
|
}
|
|
|
|
|
Make gtk argument parsing use goption. Add gtk_get_option_group and
2004-09-05 Anders Carlsson <andersca@gnome.org>
* gdk/gdk.c: (gdk_arg_class_cb), (gdk_arg_name_cb),
(gdk_add_option_entries_libgtk_only), (gdk_pre_parse_libgtk_only),
(gdk_parse_args):
* gdk/gdk.h:
* gdk/gdkinternals.h:
* gdk/linux-fb/gdkmain-fb.c: (_gdk_windowing_init):
* gdk/win32/gdkmain-win32.c: (_gdk_windowing_init):
* gdk/x11/gdkdisplay-x11.c: (gdk_display_open):
* gdk/x11/gdkmain-x11.c: (_gdk_windowing_init):
* gtk/gtkmain.c: (gtk_arg_debug_cb), (gtk_arg_no_debug_cb),
(gtk_arg_module_cb), (gtk_arg_warnings_cb),
(do_pre_parse_initialization), (do_post_parse_initialization),
(pre_parse_hook), (post_parse_hook), (gtk_get_option_group),
(gtk_init_with_args), (gtk_parse_args):
* gtk/gtkmain.h:
Make gtk argument parsing use goption. Add gtk_get_option_group and
gtk_init_with_args.
* tests/testtreemodel.c: (main):
Use gtk_init_with_args.
2004-09-05 15:09:55 +00:00
|
|
|
|
2002-05-02 22:28:50 +00:00
|
|
|
/**
|
2002-06-20 23:59:27 +00:00
|
|
|
* gdk_display_open:
|
2002-05-02 22:28:50 +00:00
|
|
|
* @display_name: the name of the display to open
|
|
|
|
* @returns: a #GdkDisplay, or %NULL if the display
|
|
|
|
* could not be opened.
|
|
|
|
*
|
|
|
|
* Opens a display.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-05-02 22:28:50 +00:00
|
|
|
*/
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *
|
2002-06-20 23:59:27 +00:00
|
|
|
gdk_display_open (const gchar *display_name)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
2002-04-30 18:32:08 +00:00
|
|
|
Display *xdisplay;
|
2002-04-25 22:29:14 +00:00
|
|
|
GdkDisplay *display;
|
|
|
|
GdkDisplayX11 *display_x11;
|
2003-12-09 23:12:53 +00:00
|
|
|
GdkWindowAttr attr;
|
2002-04-25 22:29:14 +00:00
|
|
|
gint argc;
|
Make gtk argument parsing use goption. Add gtk_get_option_group and
2004-09-05 Anders Carlsson <andersca@gnome.org>
* gdk/gdk.c: (gdk_arg_class_cb), (gdk_arg_name_cb),
(gdk_add_option_entries_libgtk_only), (gdk_pre_parse_libgtk_only),
(gdk_parse_args):
* gdk/gdk.h:
* gdk/gdkinternals.h:
* gdk/linux-fb/gdkmain-fb.c: (_gdk_windowing_init):
* gdk/win32/gdkmain-win32.c: (_gdk_windowing_init):
* gdk/x11/gdkdisplay-x11.c: (gdk_display_open):
* gdk/x11/gdkmain-x11.c: (_gdk_windowing_init):
* gtk/gtkmain.c: (gtk_arg_debug_cb), (gtk_arg_no_debug_cb),
(gtk_arg_module_cb), (gtk_arg_warnings_cb),
(do_pre_parse_initialization), (do_post_parse_initialization),
(pre_parse_hook), (post_parse_hook), (gtk_get_option_group),
(gtk_init_with_args), (gtk_parse_args):
* gtk/gtkmain.h:
Make gtk argument parsing use goption. Add gtk_get_option_group and
gtk_init_with_args.
* tests/testtreemodel.c: (main):
Use gtk_init_with_args.
2004-09-05 15:09:55 +00:00
|
|
|
gchar *argv[1];
|
2002-09-30 19:38:12 +00:00
|
|
|
const char *sm_client_id;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
XClassHint *class_hint;
|
|
|
|
gulong pid;
|
|
|
|
gint i;
|
2004-07-09 22:42:19 +00:00
|
|
|
#ifdef HAVE_XFIXES
|
2004-05-18 20:56:54 +00:00
|
|
|
gint ignore;
|
2004-07-09 22:42:19 +00:00
|
|
|
#endif
|
2002-04-30 18:32:08 +00:00
|
|
|
|
|
|
|
xdisplay = XOpenDisplay (display_name);
|
|
|
|
if (!xdisplay)
|
|
|
|
return NULL;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
display = g_object_new (GDK_TYPE_DISPLAY_X11, NULL);
|
|
|
|
display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
|
2003-04-07 23:47:59 +00:00
|
|
|
display_x11->use_xshm = TRUE;
|
2002-04-30 18:32:08 +00:00
|
|
|
display_x11->xdisplay = xdisplay;
|
2002-05-20 19:04:33 +00:00
|
|
|
|
2003-04-18 20:53:37 +00:00
|
|
|
#ifdef HAVE_X11R6
|
2002-05-20 19:04:33 +00:00
|
|
|
/* Set up handlers for Xlib internal connections */
|
|
|
|
XAddConnectionWatch (xdisplay, gdk_internal_connection_watch, NULL);
|
2003-04-18 20:53:37 +00:00
|
|
|
#endif /* HAVE_X11R6 */
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-05-03 19:03:03 +00:00
|
|
|
/* initialize the display's screens */
|
|
|
|
display_x11->screens = g_new (GdkScreen *, ScreenCount (display_x11->xdisplay));
|
2002-04-25 22:29:14 +00:00
|
|
|
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
|
2002-05-03 19:03:03 +00:00
|
|
|
display_x11->screens[i] = _gdk_x11_screen_new (display, i);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2002-08-01 23:43:13 +00:00
|
|
|
/* We need to initialize events after we have the screen
|
|
|
|
* structures in places
|
|
|
|
*/
|
|
|
|
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
|
|
|
|
_gdk_x11_events_init_screen (display_x11->screens[i]);
|
|
|
|
|
2002-05-03 19:03:03 +00:00
|
|
|
/*set the default screen */
|
|
|
|
display_x11->default_screen = display_x11->screens[DefaultScreen (display_x11->xdisplay)];
|
2003-12-09 23:12:53 +00:00
|
|
|
|
|
|
|
attr.window_type = GDK_WINDOW_TOPLEVEL;
|
|
|
|
attr.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
attr.x = 10;
|
|
|
|
attr.y = 10;
|
|
|
|
attr.width = 10;
|
|
|
|
attr.height = 10;
|
|
|
|
attr.event_mask = 0;
|
|
|
|
|
|
|
|
display_x11->leader_gdk_window = gdk_window_new (GDK_SCREEN_X11 (display_x11->default_screen)->root_window,
|
|
|
|
&attr, GDK_WA_X | GDK_WA_Y);
|
2004-10-18 21:02:37 +00:00
|
|
|
(_gdk_x11_window_get_toplevel (display_x11->leader_gdk_window))->is_leader = TRUE;
|
|
|
|
|
2003-12-09 23:12:53 +00:00
|
|
|
display_x11->leader_window = GDK_WINDOW_XID (display_x11->leader_gdk_window);
|
|
|
|
|
2002-11-08 22:29:33 +00:00
|
|
|
display_x11->leader_window_title_set = FALSE;
|
2002-11-02 05:37:04 +00:00
|
|
|
|
2003-04-18 20:21:44 +00:00
|
|
|
display_x11->have_render = GDK_UNKNOWN;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2004-05-18 20:56:54 +00:00
|
|
|
#ifdef HAVE_XFIXES
|
|
|
|
if (XFixesQueryExtension (display_x11->xdisplay,
|
|
|
|
&display_x11->xfixes_event_base,
|
|
|
|
&ignore))
|
|
|
|
{
|
|
|
|
display_x11->have_xfixes = TRUE;
|
|
|
|
|
|
|
|
gdk_x11_register_standard_event_type (display,
|
|
|
|
display_x11->xfixes_event_base,
|
|
|
|
XFixesNumberEvents);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
display_x11->have_xfixes = FALSE;
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
if (_gdk_synchronize)
|
|
|
|
XSynchronize (display_x11->xdisplay, True);
|
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
_gdk_x11_precache_atoms (display, precache_atoms, G_N_ELEMENTS (precache_atoms));
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
class_hint = XAllocClassHint();
|
|
|
|
class_hint->res_name = g_get_prgname ();
|
|
|
|
|
|
|
|
class_hint->res_class = (char *)gdk_get_program_class ();
|
Make gtk argument parsing use goption. Add gtk_get_option_group and
2004-09-05 Anders Carlsson <andersca@gnome.org>
* gdk/gdk.c: (gdk_arg_class_cb), (gdk_arg_name_cb),
(gdk_add_option_entries_libgtk_only), (gdk_pre_parse_libgtk_only),
(gdk_parse_args):
* gdk/gdk.h:
* gdk/gdkinternals.h:
* gdk/linux-fb/gdkmain-fb.c: (_gdk_windowing_init):
* gdk/win32/gdkmain-win32.c: (_gdk_windowing_init):
* gdk/x11/gdkdisplay-x11.c: (gdk_display_open):
* gdk/x11/gdkmain-x11.c: (_gdk_windowing_init):
* gtk/gtkmain.c: (gtk_arg_debug_cb), (gtk_arg_no_debug_cb),
(gtk_arg_module_cb), (gtk_arg_warnings_cb),
(do_pre_parse_initialization), (do_post_parse_initialization),
(pre_parse_hook), (post_parse_hook), (gtk_get_option_group),
(gtk_init_with_args), (gtk_parse_args):
* gtk/gtkmain.h:
Make gtk argument parsing use goption. Add gtk_get_option_group and
gtk_init_with_args.
* tests/testtreemodel.c: (main):
Use gtk_init_with_args.
2004-09-05 15:09:55 +00:00
|
|
|
|
|
|
|
/* XmbSetWMProperties sets the RESOURCE_NAME environment variable
|
|
|
|
* from argv[0], so we just synthesize an argument array here.
|
|
|
|
*/
|
|
|
|
argc = 1;
|
|
|
|
argv[0] = g_get_prgname ();
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
XmbSetWMProperties (display_x11->xdisplay,
|
|
|
|
display_x11->leader_window,
|
|
|
|
NULL, NULL, argv, argc, NULL, NULL,
|
|
|
|
class_hint);
|
|
|
|
XFree (class_hint);
|
|
|
|
|
2002-09-30 19:38:12 +00:00
|
|
|
sm_client_id = _gdk_get_sm_client_id ();
|
|
|
|
if (sm_client_id)
|
|
|
|
_gdk_windowing_display_set_sm_client_id (display, sm_client_id);
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
pid = getpid ();
|
|
|
|
XChangeProperty (display_x11->xdisplay,
|
|
|
|
display_x11->leader_window,
|
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PID"),
|
|
|
|
XA_CARDINAL, 32, PropModeReplace, (guchar *) & pid, 1);
|
2004-04-18 14:33:07 +00:00
|
|
|
|
|
|
|
/* We don't yet know a valid time. */
|
|
|
|
display_x11->user_time = 0;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_XKB
|
|
|
|
{
|
|
|
|
gint xkb_major = XkbMajorVersion;
|
|
|
|
gint xkb_minor = XkbMinorVersion;
|
|
|
|
if (XkbLibraryVersion (&xkb_major, &xkb_minor))
|
|
|
|
{
|
|
|
|
xkb_major = XkbMajorVersion;
|
|
|
|
xkb_minor = XkbMinorVersion;
|
|
|
|
|
|
|
|
if (XkbQueryExtension (display_x11->xdisplay,
|
|
|
|
NULL, &display_x11->xkb_event_type, NULL,
|
|
|
|
&xkb_major, &xkb_minor))
|
|
|
|
{
|
|
|
|
Bool detectable_autorepeat_supported;
|
|
|
|
|
|
|
|
display_x11->use_xkb = TRUE;
|
|
|
|
|
|
|
|
XkbSelectEvents (display_x11->xdisplay,
|
|
|
|
XkbUseCoreKbd,
|
2003-04-18 18:51:20 +00:00
|
|
|
XkbNewKeyboardNotifyMask | XkbMapNotifyMask | XkbStateNotifyMask,
|
|
|
|
XkbNewKeyboardNotifyMask | XkbMapNotifyMask | XkbStateNotifyMask);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2005-09-20 05:28:34 +00:00
|
|
|
/* keep this in sync with _gdk_keymap_state_changed() */
|
|
|
|
XkbSelectEventDetails (display_x11->xdisplay,
|
|
|
|
XkbUseCoreKbd, XkbStateNotify,
|
|
|
|
XkbGroupLockMask, XkbGroupLockMask);
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
XkbSetDetectableAutoRepeat (display_x11->xdisplay,
|
|
|
|
True,
|
|
|
|
&detectable_autorepeat_supported);
|
|
|
|
|
|
|
|
GDK_NOTE (MISC, g_message ("Detectable autorepeat %s.",
|
|
|
|
detectable_autorepeat_supported ?
|
|
|
|
"supported" : "not supported"));
|
|
|
|
|
|
|
|
display_x11->have_xkb_autorepeat = detectable_autorepeat_supported;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-07-11 13:26:57 +00:00
|
|
|
display_x11->use_sync = FALSE;
|
|
|
|
#ifdef HAVE_XSYNC
|
|
|
|
{
|
|
|
|
int major, minor;
|
|
|
|
int error_base, event_base;
|
|
|
|
|
|
|
|
if (XSyncQueryExtension (display_x11->xdisplay,
|
|
|
|
&event_base, &error_base) &&
|
|
|
|
XSyncInitialize (display_x11->xdisplay,
|
|
|
|
&major, &minor))
|
|
|
|
display_x11->use_sync = TRUE;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
_gdk_windowing_image_init (display);
|
|
|
|
_gdk_events_init (display);
|
|
|
|
_gdk_input_init (display);
|
|
|
|
_gdk_dnd_init (display);
|
|
|
|
|
2002-06-20 23:29:19 +00:00
|
|
|
g_signal_emit_by_name (gdk_display_manager_get(),
|
|
|
|
"display_opened", display);
|
2002-06-20 19:59:30 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
return display;
|
|
|
|
}
|
|
|
|
|
2003-04-18 20:53:37 +00:00
|
|
|
#ifdef HAVE_X11R6
|
2002-05-20 19:04:33 +00:00
|
|
|
/*
|
|
|
|
* XLib internal connection handling
|
|
|
|
*/
|
|
|
|
typedef struct _GdkInternalConnection GdkInternalConnection;
|
|
|
|
|
|
|
|
struct _GdkInternalConnection
|
|
|
|
{
|
|
|
|
gint fd;
|
|
|
|
GSource *source;
|
|
|
|
Display *display;
|
|
|
|
};
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
process_internal_connection (GIOChannel *gioc,
|
|
|
|
GIOCondition cond,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GdkInternalConnection *connection = (GdkInternalConnection *)data;
|
|
|
|
|
|
|
|
GDK_THREADS_ENTER ();
|
|
|
|
|
|
|
|
XProcessInternalConnection ((Display*)connection->display, connection->fd);
|
|
|
|
|
|
|
|
GDK_THREADS_LEAVE ();
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GdkInternalConnection *
|
|
|
|
gdk_add_connection_handler (Display *display,
|
|
|
|
guint fd)
|
|
|
|
{
|
|
|
|
GIOChannel *io_channel;
|
|
|
|
GdkInternalConnection *connection;
|
|
|
|
|
|
|
|
connection = g_new (GdkInternalConnection, 1);
|
|
|
|
|
|
|
|
connection->fd = fd;
|
|
|
|
connection->display = display;
|
|
|
|
|
|
|
|
io_channel = g_io_channel_unix_new (fd);
|
|
|
|
|
|
|
|
connection->source = g_io_create_watch (io_channel, G_IO_IN);
|
|
|
|
g_source_set_callback (connection->source,
|
|
|
|
(GSourceFunc)process_internal_connection, connection, NULL);
|
|
|
|
g_source_attach (connection->source, NULL);
|
|
|
|
|
|
|
|
g_io_channel_unref (io_channel);
|
|
|
|
|
|
|
|
return connection;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_remove_connection_handler (GdkInternalConnection *connection)
|
|
|
|
{
|
|
|
|
g_source_destroy (connection->source);
|
|
|
|
g_free (connection);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gdk_internal_connection_watch (Display *display,
|
|
|
|
XPointer arg,
|
|
|
|
gint fd,
|
|
|
|
gboolean opening,
|
|
|
|
XPointer *watch_data)
|
|
|
|
{
|
|
|
|
if (opening)
|
|
|
|
*watch_data = (XPointer)gdk_add_connection_handler (display, fd);
|
|
|
|
else
|
2002-05-21 20:51:15 +00:00
|
|
|
gdk_remove_connection_handler ((GdkInternalConnection *)*watch_data);
|
2002-05-20 19:04:33 +00:00
|
|
|
}
|
2003-04-18 20:53:37 +00:00
|
|
|
#endif /* HAVE_X11R6 */
|
2002-05-20 19:04:33 +00:00
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
/**
|
|
|
|
* gdk_display_get_name:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Gets the name of the display.
|
|
|
|
*
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
* Returns: a string representing the display name. This string is owned
|
|
|
|
* by GDK and should not be modified or freed.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
*/
|
|
|
|
G_CONST_RETURN gchar *
|
|
|
|
gdk_display_get_name (GdkDisplay * display)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
return (gchar *) DisplayString (GDK_DISPLAY_X11 (display)->xdisplay);
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
/**
|
|
|
|
* gdk_display_get_n_screens:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Gets the number of screen managed by the @display.
|
|
|
|
*
|
|
|
|
* Returns: number of screens.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gdk_display_get_n_screens (GdkDisplay * display)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
return ScreenCount (GDK_DISPLAY_X11 (display)->xdisplay);
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
/**
|
|
|
|
* gdk_display_get_screen:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
* @screen_num: the screen number
|
|
|
|
*
|
|
|
|
* Returns a screen object for one of the screens of the display.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
* Returns: the #GdkScreen object
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
*/
|
|
|
|
GdkScreen *
|
|
|
|
gdk_display_get_screen (GdkDisplay * display, gint screen_num)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
g_return_val_if_fail (ScreenCount (GDK_DISPLAY_X11 (display)->xdisplay) > screen_num, NULL);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
return GDK_DISPLAY_X11 (display)->screens[screen_num];
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
/**
|
|
|
|
* gdk_display_get_default_screen:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Get the default #GdkScreen for @display.
|
|
|
|
*
|
|
|
|
* Returns: the default #GdkScreen object for @display
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
*/
|
|
|
|
GdkScreen *
|
|
|
|
gdk_display_get_default_screen (GdkDisplay * display)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
Changes multihead reorganizing code for win32 support, mostly from a patch
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor@redhat.com>
Changes multihead reorganizing code for win32 support,
mostly from a patch by Hans Breuer.
* gdk/gdkcolor.c gdk/x11/gdkcolor-x11.c gdk/gdkcursor.c
gdk/x11/gdkcursor-x11.c gdk/gdkevents.c gdk/x11/gdkevents-x11.c
gdk/gdkfont.c gdk/x11/gdkfont-x11.c gdk/gdkkeys.c
gdk/x11/gdkkeys-x11.c gdk/gdkimage.c gdk/x11/gdkimage-x11.c
gdk/gdkscreen.c gdk/x11/gdkmain-x11.c
gdk/gdkdisplay.c gdk/gdkevents-x11.c gdk/gdkpango.c
gdk/x11/gdkpango-x11.c gdk/gdkselection.c
gdk/x11/gdkselection-x11.c gdk/gdkwindow.c
gdk/x11/gdkwindow-x11.c gdk/gdkvisual.c gdk/x11/gdkvisual-x11.c:
Move port-independent singlehead wrapper functions into
port-independent part of GDK. (#80009)
* gdk/win32/gdkcolor-win32.c gdk/win32/gdkcursor-win32.c
gdk/win32/gdkevents-win32.c gdk/win32/gdkfont-win32.c
gdk/win32/gdkimage-win32.c gdk/win32/gdkkeys-win32.c
gdk/win32/gdkmain-win32.c gdk/win32/gdkproperty-win32.c
gdk/win32/gdkselection-win32.c gdk/win32/gkwindow-win32.c:
Turn singlehead functions into "multihead" functions that ignore
their GdkDisplay or GdkScreen arguments.
* gdk/win32/gdkdrawable-win32.c gdk/win32/gdkevents-win32.c
gdk/win32/gdkinput-win32.c gdk/win32/gdkprivate-win32.h:
Misc multihead-compatibility changes.
* gtk/gtk.def gdk/gdk.def: Update for multihead functions.
* gdk/gdkcolormap.h gdk/gdkvisual.h gdk/x11/gdkcolormap-x11.c
gdk/x11/gdkvisual-x11.c: Remove the screen fields
from the public parts of the colormap/visual structures, add accessors
instead.
* gdk/gdkpixbuf-render.c gdk/gdkpixmap.c gdk/gdkrgb.c
gdk/x11/gdkcolormap-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkimage-x11.c gdk/x11/gdkprivate-x11.h gtk/gtkgc.c
gtk/gtkstyle.c gtk/gtkwidget.c: Use accessors to get the screen
for colormaps, visuals; move the fields into the private
structures for the x11 backend.
* gdk/gdkdisplay.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/gdkscreen.[ch] gdk/x11/gdkscreen-x11.c:
Remove virtualization of screen and display functions.
(#79990, patch from Erwann Chenede)
* gdk/win32/gdkdisplay-x11.c gdk/win32/gdkscreen-win32.c
gdk/win32/{Makefile.am, makefile.msc, makefile.mingw}:
New files containing stub implementations of Display,
Screen functions.
* gdk/x11/gdkscreen-x11.[ch] gdk/x11/gdkdisplay-x11.[ch]
gdk/x11/gdkx.h: Clean up function exports and what
headers they are in. (#79954)
* gdk/x11/gdkx.h: Fix macro that was referring to a non-existant
screen->screen_num. (In the patch for #79972, Erwann Chenede)
* gdk/gdkscreen.c gdk/gdkwindow.c gdk/x11/gdkinternals.h
gdk/x11/gdkscreen-x11.c: Fix gdk_screen_get_window_at_pointer()
to use window hooks. (#79972, patch partly from Erwann Chenede)
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkevents-x11.c: Fix
some warnings.
2002-06-06 00:26:42 +00:00
|
|
|
return GDK_DISPLAY_X11 (display)->default_screen;
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
_gdk_x11_display_is_root_window (GdkDisplay *display,
|
|
|
|
Window xroot_window)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11;
|
2002-05-03 19:03:03 +00:00
|
|
|
gint i;
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
|
|
|
|
|
|
|
display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
|
2002-05-03 19:03:03 +00:00
|
|
|
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
|
2002-04-25 22:29:14 +00:00
|
|
|
{
|
2002-05-03 19:03:03 +00:00
|
|
|
if (GDK_SCREEN_XROOTWIN (display_x11->screens[i]) == xroot_window)
|
|
|
|
return TRUE;
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2005-06-27 18:37:41 +00:00
|
|
|
#define XSERVER_TIME_IS_LATER(time1, time2) \
|
|
|
|
( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) || \
|
|
|
|
(( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \
|
|
|
|
)
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
/**
|
|
|
|
* gdk_display_pointer_ungrab:
|
2002-11-28 00:33:17 +00:00
|
|
|
* @display: a #GdkDisplay.
|
2002-11-08 19:41:50 +00:00
|
|
|
* @time_: a timestap (e.g. GDK_CURRENT_TIME).
|
2002-04-25 22:29:14 +00:00
|
|
|
*
|
|
|
|
* Release any pointer grab.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-04-25 22:29:14 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_display_pointer_ungrab (GdkDisplay *display,
|
|
|
|
guint32 time)
|
|
|
|
{
|
2003-04-21 19:11:45 +00:00
|
|
|
Display *xdisplay;
|
2005-06-27 18:37:41 +00:00
|
|
|
GdkDisplayX11 *display_x11;
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
2003-04-21 19:11:45 +00:00
|
|
|
|
2005-06-27 18:37:41 +00:00
|
|
|
display_x11 = GDK_DISPLAY_X11 (display);
|
2003-04-21 19:11:45 +00:00
|
|
|
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
|
|
_gdk_input_ungrab_pointer (display, time);
|
2003-04-21 19:11:45 +00:00
|
|
|
XUngrabPointer (xdisplay, time);
|
|
|
|
XFlush (xdisplay);
|
2005-06-27 18:37:41 +00:00
|
|
|
|
|
|
|
if (time == GDK_CURRENT_TIME ||
|
|
|
|
display_x11->pointer_xgrab_time == GDK_CURRENT_TIME ||
|
|
|
|
!XSERVER_TIME_IS_LATER (display_x11->pointer_xgrab_time, time))
|
|
|
|
display_x11->pointer_xgrab_window = NULL;
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2002-11-28 00:33:17 +00:00
|
|
|
* gdk_display_pointer_is_grabbed:
|
|
|
|
* @display: a #GdkDisplay
|
2002-04-25 22:29:14 +00:00
|
|
|
*
|
|
|
|
* Test if the pointer is grabbed.
|
|
|
|
*
|
2002-11-28 00:33:17 +00:00
|
|
|
* Returns: %TRUE if an active X pointer grab is in effect
|
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-04-25 22:29:14 +00:00
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gdk_display_pointer_is_grabbed (GdkDisplay * display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), TRUE);
|
|
|
|
|
2005-06-30 03:35:30 +00:00
|
|
|
return (GDK_DISPLAY_X11 (display)->pointer_xgrab_window != NULL &&
|
|
|
|
!GDK_DISPLAY_X11 (display)->pointer_xgrab_implicit);
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_keyboard_ungrab:
|
2002-11-28 00:33:17 +00:00
|
|
|
* @display: a #GdkDisplay.
|
|
|
|
* @time_: a timestap (e.g #GDK_CURRENT_TIME).
|
2002-04-25 22:29:14 +00:00
|
|
|
*
|
|
|
|
* Release any keyboard grab
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-04-25 22:29:14 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_display_keyboard_ungrab (GdkDisplay *display,
|
|
|
|
guint32 time)
|
|
|
|
{
|
2003-04-21 19:11:45 +00:00
|
|
|
Display *xdisplay;
|
2005-06-27 18:37:41 +00:00
|
|
|
GdkDisplayX11 *display_x11;
|
2003-04-21 19:11:45 +00:00
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
2003-04-21 19:11:45 +00:00
|
|
|
|
2005-06-27 18:37:41 +00:00
|
|
|
display_x11 = GDK_DISPLAY_X11 (display);
|
2003-04-21 19:11:45 +00:00
|
|
|
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
|
|
|
|
|
|
|
XUngrabKeyboard (xdisplay, time);
|
|
|
|
XFlush (xdisplay);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
2005-06-27 18:37:41 +00:00
|
|
|
if (time == GDK_CURRENT_TIME ||
|
|
|
|
display_x11->keyboard_xgrab_time == GDK_CURRENT_TIME ||
|
|
|
|
!XSERVER_TIME_IS_LATER (display_x11->keyboard_xgrab_time, time))
|
|
|
|
display_x11->keyboard_xgrab_window = NULL;
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_beep:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Emits a short beep on @display
|
|
|
|
*
|
2002-11-28 00:33:17 +00:00
|
|
|
* Since: 2.2
|
2002-04-25 22:29:14 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_display_beep (GdkDisplay * display)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
|
|
|
|
|
|
|
XBell (GDK_DISPLAY_XDISPLAY (display), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2002-11-28 00:33:17 +00:00
|
|
|
* gdk_display_sync:
|
|
|
|
* @display: a #GdkDisplay
|
2002-04-25 22:29:14 +00:00
|
|
|
*
|
|
|
|
* Flushes any requests queued for the windowing system and waits until all
|
|
|
|
* requests have been handled. This is often used for making sure that the
|
|
|
|
* display is synchronized with the current state of the program. Calling
|
|
|
|
* gdk_display_sync() before gdk_error_trap_pop() makes sure that any errors
|
2002-11-28 00:33:17 +00:00
|
|
|
* generated from earlier requests are handled before the error trap is
|
|
|
|
* removed.
|
2002-04-25 22:29:14 +00:00
|
|
|
*
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
* This is most useful for X11. On windowing systems where requests are
|
|
|
|
* handled synchronously, this function will do nothing.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-04-25 22:29:14 +00:00
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_display_sync (GdkDisplay * display)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
|
|
|
|
|
|
|
XSync (GDK_DISPLAY_XDISPLAY (display), False);
|
|
|
|
}
|
|
|
|
|
2003-07-05 01:54:05 +00:00
|
|
|
/**
|
|
|
|
* gdk_display_flush:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Flushes any requests queued for the windowing system; this happens automatically
|
|
|
|
* when the main loop blocks waiting for new events, but if your application
|
|
|
|
* is drawing without returning control to the main loop, you may need
|
|
|
|
* to call this function explicitely. A common case where this function
|
|
|
|
* needs to be called is when an application is executing drawing commands
|
|
|
|
* from a thread other than the thread where the main loop is running.
|
|
|
|
*
|
|
|
|
* This is most useful for X11. On windowing systems where requests are
|
|
|
|
* handled synchronously, this function will do nothing.
|
|
|
|
*
|
|
|
|
* Since: 2.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_display_flush (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
|
|
|
|
|
|
|
if (!display->closed)
|
|
|
|
XFlush (GDK_DISPLAY_XDISPLAY (display));
|
|
|
|
}
|
|
|
|
|
2003-12-09 23:12:53 +00:00
|
|
|
/**
|
|
|
|
* gdk_display_get_default_group:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Returns the default group leader window for all toplevel windows
|
|
|
|
* on @display. This window is implicitly created by GDK.
|
|
|
|
* See gdk_window_set_group().
|
|
|
|
*
|
|
|
|
* Return value: The default group leader window for @display
|
|
|
|
*
|
|
|
|
* Since: 2.4
|
|
|
|
**/
|
|
|
|
GdkWindow *gdk_display_get_default_group (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
|
|
|
|
|
|
|
|
return GDK_DISPLAY_X11 (display)->leader_gdk_window;
|
|
|
|
}
|
|
|
|
|
2002-10-22 22:11:22 +00:00
|
|
|
/**
|
|
|
|
* gdk_x11_display_grab:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Call XGrabServer() on @display.
|
|
|
|
* To ungrab the display again, use gdk_x11_display_ungrab().
|
|
|
|
*
|
|
|
|
* gdk_x11_display_grab()/gdk_x11_display_ungrab() calls can be nested.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-10-22 22:11:22 +00:00
|
|
|
**/
|
2002-04-25 22:29:14 +00:00
|
|
|
void
|
|
|
|
gdk_x11_display_grab (GdkDisplay * display)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
|
|
|
|
|
|
|
display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
|
|
|
|
if (display_x11->grab_count == 0)
|
|
|
|
XGrabServer (display_x11->xdisplay);
|
|
|
|
display_x11->grab_count++;
|
|
|
|
}
|
|
|
|
|
2002-10-22 22:11:22 +00:00
|
|
|
/**
|
|
|
|
* gdk_x11_display_ungrab:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Ungrab @display after it has been grabbed with
|
|
|
|
* gdk_x11_display_grab().
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-10-22 22:11:22 +00:00
|
|
|
**/
|
2002-04-25 22:29:14 +00:00
|
|
|
void
|
|
|
|
gdk_x11_display_ungrab (GdkDisplay * display)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11;
|
|
|
|
|
|
|
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
|
|
|
|
|
|
|
display_x11 = GDK_DISPLAY_X11 (display);;
|
|
|
|
g_return_if_fail (display_x11->grab_count > 0);
|
|
|
|
|
|
|
|
display_x11->grab_count--;
|
|
|
|
if (display_x11->grab_count == 0)
|
2003-04-07 23:47:59 +00:00
|
|
|
{
|
|
|
|
XUngrabServer (display_x11->xdisplay);
|
|
|
|
XFlush (display_x11->xdisplay);
|
|
|
|
}
|
2002-04-25 22:29:14 +00:00
|
|
|
}
|
|
|
|
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
static void
|
|
|
|
gdk_display_x11_dispose (GObject *object)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11;
|
|
|
|
gint i;
|
|
|
|
|
2002-08-01 23:43:13 +00:00
|
|
|
display_x11 = GDK_DISPLAY_X11 (object);
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
|
|
|
|
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
|
|
|
|
_gdk_screen_close (display_x11->screens[i]);
|
|
|
|
|
2002-08-01 23:43:13 +00:00
|
|
|
g_source_destroy (display_x11->event_source);
|
|
|
|
|
Start implementing display/screen closing scheme; keep a flag for whether
Thu Aug 1 11:26:03 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.[ch] gdk/gdkscreen.[ch] gdkinternals.h:
Start implementing display/screen closing scheme; keep a
flag for whether displays and screens are closed,
call g_object_run_dispose(). Remove public gdk_screen_close().
* gdk/x11/gdkdisplay-x11.c gdk/x11/gdkscreen-x11.c: Add
dispose() methods; move appropriate parts of the finalize
there.
* gdk/x11/gdkcolor-x11.c gdk/x11/gdkimage-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkpango-x11.c
gdk/x11/gdkpixmap-x11.c gdk/x11/gdkproperty-x11.c
gdk/x11/gdkselection-x11.c gdk/x11/gdkwindow-x11.c:
Start of making everything correctly ignore operations
when a display has been closed.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_decorations):
Handle decorations == NULL.
* gdk/x11/gdkcolor-x11.c (gdk_colormap_remove):
Remove unnecessary hash table creation.
* gdk/x11/gdkinput.c gdk/x11/gdkinput-x11.c gdk/win32/gdkinput.c
Fix up gdk_device_get_history - handle events, n_events == NULL,
etc.
* gdk/x11/gdkproperty-x11.c (gdk_property_get):
Handle failure better.
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Handle failure better, handle data == NULL, move docs
here, remove an excess round trip by asking for
all selection data at once.
* gdk/gdkselection.c gdk/win32/{x11,win32}/gdkselection-{x11,win32}.c
gdk/{x11,win32}/gdkmain-{x11,win32}.c gdk/gdkdisplay.c: Move
gdk_text_property_to_text_list(), gdk_string_to_compound_text(),
gdk_display_set_sm_client_id() to display-independent part of GDK.
* gdk/Makefile.am (gdk_c_sources): Sort gdkdisplay/screen.[ch]
into the right place.
2002-08-01 15:28:40 +00:00
|
|
|
XCloseDisplay (display_x11->xdisplay);
|
|
|
|
display_x11->xdisplay = NULL;
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
static void
|
|
|
|
gdk_display_x11_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (object);
|
|
|
|
int i;
|
|
|
|
GList *tmp;
|
|
|
|
/* FIXME need to write GdkKeymap finalize fct
|
|
|
|
g_object_unref (display_x11->keymap);
|
|
|
|
*/
|
|
|
|
/* Free motif Dnd */
|
|
|
|
if (display_x11->motif_target_lists)
|
|
|
|
{
|
|
|
|
for (i = 0; i < display_x11->motif_n_target_lists; i++)
|
|
|
|
g_list_free (display_x11->motif_target_lists[i]);
|
|
|
|
g_free (display_x11->motif_target_lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Atom Hashtable */
|
|
|
|
g_hash_table_destroy (display_x11->atom_from_virtual);
|
|
|
|
g_hash_table_destroy (display_x11->atom_to_virtual);
|
|
|
|
/* Leader Window */
|
|
|
|
XDestroyWindow (display_x11->xdisplay, display_x11->leader_window);
|
|
|
|
/* list of filters for client messages */
|
|
|
|
g_list_free (display_x11->client_filters);
|
2003-07-11 19:57:01 +00:00
|
|
|
/* List of event window extraction functions */
|
|
|
|
g_slist_foreach (display_x11->event_types, (GFunc)g_free, NULL);
|
|
|
|
g_slist_free (display_x11->event_types);
|
2002-04-25 22:29:14 +00:00
|
|
|
/* X ID hashtable */
|
|
|
|
g_hash_table_destroy (display_x11->xid_ht);
|
|
|
|
/* input GdkDevice list */
|
|
|
|
/* FIXME need to write finalize fct */
|
|
|
|
for (tmp = display_x11->input_devices; tmp; tmp = tmp->next)
|
2002-09-25 07:23:55 +00:00
|
|
|
g_object_unref (tmp->data);
|
2002-04-25 22:29:14 +00:00
|
|
|
g_list_free (display_x11->input_devices);
|
|
|
|
/* input GdkWindow list */
|
|
|
|
for (tmp = display_x11->input_windows; tmp; tmp = tmp->next)
|
2002-09-25 07:23:55 +00:00
|
|
|
g_object_unref (tmp->data);
|
2002-04-25 22:29:14 +00:00
|
|
|
g_list_free (display_x11->input_windows);
|
|
|
|
/* Free all GdkScreens */
|
2002-05-03 19:03:03 +00:00
|
|
|
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
|
2002-09-25 07:23:55 +00:00
|
|
|
g_object_unref (display_x11->screens[i]);
|
2002-05-03 19:03:03 +00:00
|
|
|
g_free (display_x11->screens);
|
2002-11-02 05:37:04 +00:00
|
|
|
g_free (display_x11->startup_notification_id);
|
|
|
|
|
2002-04-25 22:29:14 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_x11_lookup_xdisplay:
|
|
|
|
* @xdisplay: a pointer to an X Display
|
|
|
|
*
|
|
|
|
* Find the #GdkDisplay corresponding to @display, if any exists.
|
|
|
|
*
|
|
|
|
* Return value: the #GdkDisplay, if found, otherwise %NULL.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-04-25 22:29:14 +00:00
|
|
|
**/
|
|
|
|
GdkDisplay *
|
|
|
|
gdk_x11_lookup_xdisplay (Display *xdisplay)
|
|
|
|
{
|
|
|
|
GSList *tmp_list;
|
|
|
|
|
|
|
|
for (tmp_list = _gdk_displays; tmp_list; tmp_list = tmp_list->next)
|
|
|
|
{
|
|
|
|
if (GDK_DISPLAY_XDISPLAY (tmp_list->data) == xdisplay)
|
|
|
|
return tmp_list->data;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _gdk_x11_display_screen_for_xrootwin:
|
|
|
|
* @display: a #Display
|
|
|
|
* @xrootwin: window ID for one of of the screen's of the display.
|
|
|
|
*
|
|
|
|
* Given the root window ID of one of the screen's of a #GdkDisplay,
|
|
|
|
* finds the screen.
|
|
|
|
*
|
|
|
|
* Return value: the #GdkScreen corresponding to @xrootwin, or %NULL.
|
|
|
|
**/
|
|
|
|
GdkScreen *
|
|
|
|
_gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
|
|
|
|
Window xrootwin)
|
|
|
|
{
|
|
|
|
gint n_screens, i;
|
|
|
|
|
|
|
|
n_screens = gdk_display_get_n_screens (display);
|
|
|
|
for (i = 0; i < n_screens; i++)
|
|
|
|
{
|
|
|
|
GdkScreen *screen = gdk_display_get_screen (display, i);
|
|
|
|
if (GDK_SCREEN_XROOTWIN (screen) == xrootwin)
|
|
|
|
return screen;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2002-05-02 22:28:50 +00:00
|
|
|
/**
|
|
|
|
* gdk_x11_display_get_xdisplay:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
* @returns: an X display.
|
|
|
|
*
|
|
|
|
* Returns the X display of a #GdkDisplay.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-05-02 22:28:50 +00:00
|
|
|
*/
|
2002-04-25 22:29:14 +00:00
|
|
|
Display *
|
|
|
|
gdk_x11_display_get_xdisplay (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
return GDK_DISPLAY_X11 (display)->xdisplay;
|
|
|
|
}
|
2002-11-02 05:37:04 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
_gdk_windowing_set_default_display (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
const gchar *startup_id;
|
|
|
|
|
|
|
|
if (display)
|
|
|
|
gdk_display = GDK_DISPLAY_XDISPLAY (display);
|
|
|
|
else
|
|
|
|
gdk_display = NULL;
|
|
|
|
|
|
|
|
g_free (display_x11->startup_notification_id);
|
|
|
|
display_x11->startup_notification_id = NULL;
|
|
|
|
|
|
|
|
startup_id = g_getenv ("DESKTOP_STARTUP_ID");
|
|
|
|
if (startup_id && *startup_id != '\0')
|
|
|
|
{
|
2005-01-25 04:02:55 +00:00
|
|
|
gchar *time_str;
|
|
|
|
|
2002-11-02 05:37:04 +00:00
|
|
|
if (!g_utf8_validate (startup_id, -1, NULL))
|
|
|
|
g_warning ("DESKTOP_STARTUP_ID contains invalid UTF-8");
|
|
|
|
else
|
|
|
|
display_x11->startup_notification_id = g_strdup (startup_id);
|
2005-01-25 04:02:55 +00:00
|
|
|
|
|
|
|
/* Find the launch time from the startup_id, if it's there. Newer spec
|
|
|
|
* states that the startup_id is of the form <unique>_TIME<timestamp>
|
|
|
|
*/
|
|
|
|
time_str = g_strrstr (startup_id, "_TIME");
|
|
|
|
if (time_str != NULL)
|
|
|
|
{
|
|
|
|
gulong retval;
|
|
|
|
gchar *end;
|
|
|
|
errno = 0;
|
|
|
|
|
|
|
|
/* Skip past the "_TIME" part */
|
|
|
|
time_str += 5;
|
|
|
|
|
|
|
|
retval = strtoul (time_str, &end, 0);
|
|
|
|
if (end != time_str && errno == 0)
|
|
|
|
display_x11->user_time = retval;
|
|
|
|
}
|
2002-11-02 05:37:04 +00:00
|
|
|
|
|
|
|
/* Clear the environment variable so it won't be inherited by
|
2003-08-02 21:35:44 +00:00
|
|
|
* child processes and confuse things.
|
2002-11-02 05:37:04 +00:00
|
|
|
*/
|
2003-08-02 21:35:44 +00:00
|
|
|
g_unsetenv ("DESKTOP_STARTUP_ID");
|
2002-11-02 05:37:04 +00:00
|
|
|
|
|
|
|
/* Set the startup id on the leader window so it
|
|
|
|
* applies to all windows we create on this display
|
|
|
|
*/
|
|
|
|
XChangeProperty (display_x11->xdisplay,
|
|
|
|
display_x11->leader_window,
|
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID"),
|
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8,
|
|
|
|
PropModeReplace,
|
2005-09-11 05:40:51 +00:00
|
|
|
(guchar *)startup_id, strlen (startup_id));
|
2002-11-02 05:37:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-05-10 20:51:19 +00:00
|
|
|
static char*
|
2002-11-02 05:37:04 +00:00
|
|
|
escape_for_xmessage (const char *str)
|
|
|
|
{
|
|
|
|
GString *retval;
|
|
|
|
const char *p;
|
|
|
|
|
2003-05-27 21:21:00 +00:00
|
|
|
retval = g_string_new (NULL);
|
2002-11-02 05:37:04 +00:00
|
|
|
|
|
|
|
p = str;
|
|
|
|
while (*p)
|
|
|
|
{
|
|
|
|
switch (*p)
|
|
|
|
{
|
|
|
|
case ' ':
|
|
|
|
case '"':
|
|
|
|
case '\\':
|
|
|
|
g_string_append_c (retval, '\\');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_string_append_c (retval, *p);
|
|
|
|
++p;
|
|
|
|
}
|
|
|
|
|
|
|
|
return g_string_free (retval, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
broadcast_xmessage (GdkDisplay *display,
|
|
|
|
const char *message_type,
|
|
|
|
const char *message_type_begin,
|
|
|
|
const char *message)
|
|
|
|
{
|
|
|
|
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
|
|
|
GdkScreen *screen = gdk_display_get_default_screen (display);
|
|
|
|
GdkWindow *root_window = gdk_screen_get_root_window (screen);
|
|
|
|
Window xroot_window = GDK_WINDOW_XID (root_window);
|
|
|
|
|
|
|
|
Atom type_atom;
|
|
|
|
Atom type_atom_begin;
|
|
|
|
Window xwindow;
|
|
|
|
|
|
|
|
{
|
|
|
|
XSetWindowAttributes attrs;
|
|
|
|
|
|
|
|
attrs.override_redirect = True;
|
|
|
|
attrs.event_mask = PropertyChangeMask | StructureNotifyMask;
|
|
|
|
|
|
|
|
xwindow =
|
|
|
|
XCreateWindow (xdisplay,
|
|
|
|
xroot_window,
|
|
|
|
-100, -100, 1, 1,
|
|
|
|
0,
|
|
|
|
CopyFromParent,
|
|
|
|
CopyFromParent,
|
2004-10-28 15:00:05 +00:00
|
|
|
(Visual *)CopyFromParent,
|
2002-11-02 05:37:04 +00:00
|
|
|
CWOverrideRedirect | CWEventMask,
|
|
|
|
&attrs);
|
|
|
|
}
|
|
|
|
|
|
|
|
type_atom = gdk_x11_get_xatom_by_name_for_display (display,
|
|
|
|
message_type);
|
|
|
|
type_atom_begin = gdk_x11_get_xatom_by_name_for_display (display,
|
|
|
|
message_type_begin);
|
|
|
|
|
|
|
|
{
|
|
|
|
XEvent xevent;
|
|
|
|
const char *src;
|
|
|
|
const char *src_end;
|
|
|
|
char *dest;
|
|
|
|
char *dest_end;
|
|
|
|
|
|
|
|
xevent.xclient.type = ClientMessage;
|
|
|
|
xevent.xclient.message_type = type_atom_begin;
|
|
|
|
xevent.xclient.display =xdisplay;
|
|
|
|
xevent.xclient.window = xwindow;
|
|
|
|
xevent.xclient.format = 8;
|
|
|
|
|
|
|
|
src = message;
|
|
|
|
src_end = message + strlen (message) + 1; /* +1 to include nul byte */
|
|
|
|
|
|
|
|
while (src != src_end)
|
|
|
|
{
|
|
|
|
dest = &xevent.xclient.data.b[0];
|
|
|
|
dest_end = dest + 20;
|
|
|
|
|
|
|
|
while (dest != dest_end &&
|
|
|
|
src != src_end)
|
|
|
|
{
|
|
|
|
*dest = *src;
|
|
|
|
++dest;
|
|
|
|
++src;
|
|
|
|
}
|
2003-05-20 21:01:08 +00:00
|
|
|
|
|
|
|
while (dest != dest_end)
|
|
|
|
{
|
|
|
|
*dest = 0;
|
|
|
|
++dest;
|
|
|
|
}
|
2002-11-02 05:37:04 +00:00
|
|
|
|
|
|
|
XSendEvent (xdisplay,
|
|
|
|
xroot_window,
|
|
|
|
False,
|
|
|
|
PropertyChangeMask,
|
|
|
|
&xevent);
|
|
|
|
|
|
|
|
xevent.xclient.message_type = type_atom;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
XDestroyWindow (xdisplay, xwindow);
|
|
|
|
XFlush (xdisplay);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_notify_startup_complete:
|
|
|
|
*
|
|
|
|
* Indicates to the GUI environment that the application has finished
|
|
|
|
* loading. If the applications opens windows, this function is
|
|
|
|
* normally called after opening the application's initial set of
|
|
|
|
* windows.
|
|
|
|
*
|
|
|
|
* GTK+ will call this function automatically after opening the first
|
2002-11-28 00:33:17 +00:00
|
|
|
* #GtkWindow unless gtk_window_set_auto_startup_notification() is called
|
|
|
|
* to disable that feature.
|
|
|
|
*
|
|
|
|
* Since: 2.2
|
2002-11-02 05:37:04 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gdk_notify_startup_complete (void)
|
|
|
|
{
|
|
|
|
GdkDisplay *display;
|
|
|
|
GdkDisplayX11 *display_x11;
|
|
|
|
gchar *escaped_id;
|
|
|
|
gchar *message;
|
|
|
|
|
|
|
|
display = gdk_display_get_default ();
|
|
|
|
if (!display)
|
|
|
|
return;
|
|
|
|
|
|
|
|
display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
|
|
|
|
if (display_x11->startup_notification_id == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
escaped_id = escape_for_xmessage (display_x11->startup_notification_id);
|
|
|
|
message = g_strdup_printf ("remove: ID=%s", escaped_id);
|
|
|
|
g_free (escaped_id);
|
|
|
|
|
|
|
|
broadcast_xmessage (display,
|
|
|
|
"_NET_STARTUP_INFO",
|
|
|
|
"_NET_STARTUP_INFO_BEGIN",
|
|
|
|
message);
|
|
|
|
|
|
|
|
g_free (message);
|
|
|
|
}
|
2004-05-18 20:56:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_supports_selection_notification:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Returns whether #GdkEventOwnerChange events will be
|
|
|
|
* sent when the owner of a selection changes.
|
|
|
|
*
|
|
|
|
* Return value: whether #GdkEventOwnerChange events will
|
|
|
|
* be sent.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gdk_display_supports_selection_notification (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
|
|
|
|
return display_x11->have_xfixes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_request_selection_notification:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
* @selection: the #GdkAtom naming the selection for which
|
|
|
|
* ownership change notification is requested
|
|
|
|
*
|
|
|
|
* Request #GdkEventOwnerChange events for ownership changes
|
|
|
|
* of the selection named by the given atom.
|
|
|
|
*
|
|
|
|
* Return value: whether #GdkEventOwnerChange events will
|
|
|
|
* be sent.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
gboolean gdk_display_request_selection_notification (GdkDisplay *display,
|
|
|
|
GdkAtom selection)
|
|
|
|
|
|
|
|
{
|
|
|
|
#ifdef HAVE_XFIXES
|
|
|
|
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
Atom atom;
|
|
|
|
|
|
|
|
if (display_x11->have_xfixes)
|
|
|
|
{
|
|
|
|
atom = gdk_x11_atom_to_xatom_for_display (display,
|
|
|
|
selection);
|
|
|
|
XFixesSelectSelectionInput (display_x11->xdisplay,
|
|
|
|
display_x11->leader_window,
|
|
|
|
atom,
|
|
|
|
XFixesSetSelectionOwnerNotifyMask |
|
|
|
|
XFixesSelectionWindowDestroyNotifyMask |
|
|
|
|
XFixesSelectionClientCloseNotifyMask);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
return FALSE;
|
|
|
|
}
|
New API to handle the clipboard manager.
2004-10-25 Anders Carlsson <andersca@imendio.com>
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c:
(gdk_display_supports_clipboard_persistence),
(gdk_display_store_clipboard):
New API to handle the clipboard manager.
* gtk/gtk.symbols:
* gtk/gtkclipboard.c: (gtk_clipboard_class_init),
(gtk_clipboard_finalize), (selection_clear_event_cb),
(clipboard_unset), (gtk_clipboard_set_text),
(gtk_clipboard_request_targets), (gtk_clipboard_wait_for_targets),
(clipboard_peek), (gtk_clipboard_owner_change),
(gtk_clipboard_wait_is_target_available),
(gtk_clipboard_store_timeout), (gtk_clipboard_set_can_store),
(gtk_clipboard_selection_notify), (gtk_clipboard_store),
(_gtk_clipboard_store_all):
* gtk/gtkclipboard.h:
Add API for clipboard persistence and implement it, also add
gtk_clipboard_wait_is_target_available.
* gtk/gtkmain.c: (gtk_main):
Call _gtk_clipboard_store_all before exiting.
2004-10-25 18:53:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_supports_clipboard_persistence
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Returns whether the speicifed display supports clipboard
|
2004-10-26 17:35:41 +00:00
|
|
|
* persistance; i.e. if it's possible to store the clipboard data after an
|
New API to handle the clipboard manager.
2004-10-25 Anders Carlsson <andersca@imendio.com>
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c:
(gdk_display_supports_clipboard_persistence),
(gdk_display_store_clipboard):
New API to handle the clipboard manager.
* gtk/gtk.symbols:
* gtk/gtkclipboard.c: (gtk_clipboard_class_init),
(gtk_clipboard_finalize), (selection_clear_event_cb),
(clipboard_unset), (gtk_clipboard_set_text),
(gtk_clipboard_request_targets), (gtk_clipboard_wait_for_targets),
(clipboard_peek), (gtk_clipboard_owner_change),
(gtk_clipboard_wait_is_target_available),
(gtk_clipboard_store_timeout), (gtk_clipboard_set_can_store),
(gtk_clipboard_selection_notify), (gtk_clipboard_store),
(_gtk_clipboard_store_all):
* gtk/gtkclipboard.h:
Add API for clipboard persistence and implement it, also add
gtk_clipboard_wait_is_target_available.
* gtk/gtkmain.c: (gtk_main):
Call _gtk_clipboard_store_all before exiting.
2004-10-25 18:53:30 +00:00
|
|
|
* application has quit. On X11 this checks if a clipboard daemon is
|
|
|
|
* running.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the display supports clipboard persistance.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gdk_display_supports_clipboard_persistence (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
/* It might make sense to cache this */
|
|
|
|
return XGetSelectionOwner (GDK_DISPLAY_X11 (display)->xdisplay,
|
|
|
|
gdk_x11_get_xatom_by_name_for_display (display, "CLIPBOARD_MANAGER")) != None;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_display_store_clipboard
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
* @clipboard_window: a #GdkWindow belonging to the clipboard owner
|
2004-10-26 17:35:41 +00:00
|
|
|
* @time_: a timestamp
|
|
|
|
* @targets: an array of targets that should be saved, or %NULL
|
New API to handle the clipboard manager.
2004-10-25 Anders Carlsson <andersca@imendio.com>
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c:
(gdk_display_supports_clipboard_persistence),
(gdk_display_store_clipboard):
New API to handle the clipboard manager.
* gtk/gtk.symbols:
* gtk/gtkclipboard.c: (gtk_clipboard_class_init),
(gtk_clipboard_finalize), (selection_clear_event_cb),
(clipboard_unset), (gtk_clipboard_set_text),
(gtk_clipboard_request_targets), (gtk_clipboard_wait_for_targets),
(clipboard_peek), (gtk_clipboard_owner_change),
(gtk_clipboard_wait_is_target_available),
(gtk_clipboard_store_timeout), (gtk_clipboard_set_can_store),
(gtk_clipboard_selection_notify), (gtk_clipboard_store),
(_gtk_clipboard_store_all):
* gtk/gtkclipboard.h:
Add API for clipboard persistence and implement it, also add
gtk_clipboard_wait_is_target_available.
* gtk/gtkmain.c: (gtk_main):
Call _gtk_clipboard_store_all before exiting.
2004-10-25 18:53:30 +00:00
|
|
|
* if all available targets should be saved.
|
2004-10-26 17:35:41 +00:00
|
|
|
* @n_targets: length of the @targets array
|
New API to handle the clipboard manager.
2004-10-25 Anders Carlsson <andersca@imendio.com>
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c:
(gdk_display_supports_clipboard_persistence),
(gdk_display_store_clipboard):
New API to handle the clipboard manager.
* gtk/gtk.symbols:
* gtk/gtkclipboard.c: (gtk_clipboard_class_init),
(gtk_clipboard_finalize), (selection_clear_event_cb),
(clipboard_unset), (gtk_clipboard_set_text),
(gtk_clipboard_request_targets), (gtk_clipboard_wait_for_targets),
(clipboard_peek), (gtk_clipboard_owner_change),
(gtk_clipboard_wait_is_target_available),
(gtk_clipboard_store_timeout), (gtk_clipboard_set_can_store),
(gtk_clipboard_selection_notify), (gtk_clipboard_store),
(_gtk_clipboard_store_all):
* gtk/gtkclipboard.h:
Add API for clipboard persistence and implement it, also add
gtk_clipboard_wait_is_target_available.
* gtk/gtkmain.c: (gtk_main):
Call _gtk_clipboard_store_all before exiting.
2004-10-25 18:53:30 +00:00
|
|
|
*
|
2005-02-01 18:15:09 +00:00
|
|
|
* Issues a request to the clipboard manager to store the
|
New API to handle the clipboard manager.
2004-10-25 Anders Carlsson <andersca@imendio.com>
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c:
(gdk_display_supports_clipboard_persistence),
(gdk_display_store_clipboard):
New API to handle the clipboard manager.
* gtk/gtk.symbols:
* gtk/gtkclipboard.c: (gtk_clipboard_class_init),
(gtk_clipboard_finalize), (selection_clear_event_cb),
(clipboard_unset), (gtk_clipboard_set_text),
(gtk_clipboard_request_targets), (gtk_clipboard_wait_for_targets),
(clipboard_peek), (gtk_clipboard_owner_change),
(gtk_clipboard_wait_is_target_available),
(gtk_clipboard_store_timeout), (gtk_clipboard_set_can_store),
(gtk_clipboard_selection_notify), (gtk_clipboard_store),
(_gtk_clipboard_store_all):
* gtk/gtkclipboard.h:
Add API for clipboard persistence and implement it, also add
gtk_clipboard_wait_is_target_available.
* gtk/gtkmain.c: (gtk_main):
Call _gtk_clipboard_store_all before exiting.
2004-10-25 18:53:30 +00:00
|
|
|
* clipboard data. On X11, this is a special program that works
|
|
|
|
* according to the freedesktop clipboard specification, available at
|
|
|
|
* <ulink url="http://www.freedesktop.org/Standards/clipboard-manager-spec">
|
2004-10-26 17:35:41 +00:00
|
|
|
* http://www.freedesktop.org/Standards/clipboard-manager-spec</ulink>.
|
New API to handle the clipboard manager.
2004-10-25 Anders Carlsson <andersca@imendio.com>
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c:
(gdk_display_supports_clipboard_persistence),
(gdk_display_store_clipboard):
New API to handle the clipboard manager.
* gtk/gtk.symbols:
* gtk/gtkclipboard.c: (gtk_clipboard_class_init),
(gtk_clipboard_finalize), (selection_clear_event_cb),
(clipboard_unset), (gtk_clipboard_set_text),
(gtk_clipboard_request_targets), (gtk_clipboard_wait_for_targets),
(clipboard_peek), (gtk_clipboard_owner_change),
(gtk_clipboard_wait_is_target_available),
(gtk_clipboard_store_timeout), (gtk_clipboard_set_can_store),
(gtk_clipboard_selection_notify), (gtk_clipboard_store),
(_gtk_clipboard_store_all):
* gtk/gtkclipboard.h:
Add API for clipboard persistence and implement it, also add
gtk_clipboard_wait_is_target_available.
* gtk/gtkmain.c: (gtk_main):
Call _gtk_clipboard_store_all before exiting.
2004-10-25 18:53:30 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gdk_display_store_clipboard (GdkDisplay *display,
|
|
|
|
GdkWindow *clipboard_window,
|
|
|
|
guint32 time_,
|
|
|
|
GdkAtom *targets,
|
|
|
|
gint n_targets)
|
|
|
|
{
|
|
|
|
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
|
|
|
|
Atom clipboard_manager, save_targets;
|
|
|
|
|
|
|
|
clipboard_manager = gdk_x11_get_xatom_by_name_for_display (display, "CLIPBOARD_MANAGER");
|
|
|
|
save_targets = gdk_x11_get_xatom_by_name_for_display (display, "SAVE_TARGETS");
|
|
|
|
|
|
|
|
gdk_error_trap_push ();
|
|
|
|
|
|
|
|
if (XGetSelectionOwner (display_x11->xdisplay, clipboard_manager) != None)
|
|
|
|
{
|
|
|
|
Atom property_name = None;
|
|
|
|
Atom *xatoms;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (n_targets > 0)
|
|
|
|
{
|
|
|
|
property_name = gdk_x11_atom_to_xatom_for_display (display, _gdk_selection_property);
|
|
|
|
|
|
|
|
xatoms = g_new (Atom, n_targets);
|
|
|
|
for (i = 0; i < n_targets; i++)
|
|
|
|
xatoms[i] = gdk_x11_atom_to_xatom_for_display (display, targets[i]);
|
|
|
|
|
|
|
|
XChangeProperty (display_x11->xdisplay, GDK_WINDOW_XID (clipboard_window),
|
|
|
|
property_name, XA_ATOM,
|
|
|
|
32, PropModeReplace, (guchar *)xatoms, n_targets);
|
|
|
|
g_free (xatoms);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
XConvertSelection (display_x11->xdisplay,
|
|
|
|
clipboard_manager, save_targets, property_name,
|
|
|
|
GDK_WINDOW_XID (clipboard_window), time_);
|
|
|
|
|
|
|
|
}
|
|
|
|
gdk_error_trap_pop ();
|
|
|
|
|
|
|
|
}
|
2005-01-19 14:37:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_x11_display_get_user_time:
|
|
|
|
* @display: a #GdkDisplay
|
|
|
|
*
|
|
|
|
* Returns the timestamp of the last user interaction on
|
|
|
|
* @display. The timestamp is taken from events caused
|
|
|
|
* by user interaction such as key presses or pointer
|
|
|
|
* movements. See gdk_x11_window_set_user_time().
|
|
|
|
*
|
|
|
|
* Returns: the timestamp of the last user interaction
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
guint32
|
|
|
|
gdk_x11_display_get_user_time (GdkDisplay *display)
|
|
|
|
{
|
|
|
|
return GDK_DISPLAY_X11 (display)->user_time;
|
|
|
|
}
|
2005-03-16 03:17:27 +00:00
|
|
|
|
|
|
|
#define __GDK_DISPLAY_X11_C__
|
|
|
|
#include "gdkaliasdef.c"
|