Top |
#define GDK_ROOT_PARENT() (gdk_get_default_root_window ())
GDK_ROOT_PARENT
is deprecated and should not be used in newly-written code.
#define GDK_WINDOW_XDISPLAY(win) (GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (win))->xdisplay)
#define GDK_WINDOW_XID(win) (GDK_DRAWABLE_IMPL_X11(((GdkWindowObject *)win)->impl)->xid)
#define GDK_PIXMAP_XDISPLAY(pix) (GDK_SCREEN_X11 (GDK_PIXMAP_SCREEN (pix))->xdisplay)
#define GDK_PIXMAP_XID(pix) (GDK_DRAWABLE_IMPL_X11(((GdkPixmapObject *)pix)->impl)->xid)
#define GDK_DRAWABLE_XDISPLAY(win) (GDK_IS_WINDOW (win) ? GDK_WINDOW_XDISPLAY (win) : GDK_PIXMAP_XDISPLAY (win))
#define GDK_DRAWABLE_XID(win) (GDK_IS_WINDOW (win) ? GDK_WINDOW_XID (win) : GDK_PIXMAP_XID (win))
#define GDK_COLORMAP_XCOLORMAP(cmap) (gdk_x11_colormap_get_xcolormap (cmap))
#define GDK_FONT_XDISPLAY(font) (gdk_x11_font_get_xdisplay (font))
GDK_FONT_XDISPLAY
is deprecated and should not be used in newly-written code.
#define GDK_FONT_XFONT(font) (gdk_x11_font_get_xfont (font))
GDK_FONT_XFONT
is deprecated and should not be used in newly-written code.
#define GDK_GC_GET_XGC(gc) (GDK_GC_X11(gc)->dirty_mask ? _gdk_x11_gc_flush (gc) : ((GdkGCX11 *)(gc))->xgc)
GdkVisual *
gdkx_visual_get (VisualID xvisualid
);
gdkx_visual_get
has been deprecated since version 2.24 and should not be used in newly-written code.
Use gdk_x11_screen_lookup_visual()
instead
Returns a GdkVisual corresponding to a X visual.
GdkColormap *
gdkx_colormap_get (Colormap xcolormap
);
gdkx_colormap_get
is deprecated and should not be used in newly-written code.
Returns a GdkColormap corresponding to a X colormap; this function only works if the colormap is already known to GTK+ (a colormap created by GTK+ or the default colormap for the screen), since GTK+
Always use gdk_x11_colormap_foreign_new()
instead.
the existing GdkColormap object if it was
already known to GTK+, otherwise warns and return
NULL
.
GdkPixmap *
gdk_pixmap_foreign_new (GdkNativeWindow anid
);
Wraps a native window for the default display in a GdkPixmap. This may fail if the pixmap has been destroyed.
For example in the X backend, a native pixmap handle is an Xlib
XID. the newly-created GdkPixmap wrapper for the
native pixmap or NULL
if the pixmap has been destroyed.
GdkPixmap * gdk_pixmap_foreign_new_for_display (GdkDisplay *display
,GdkNativeWindow anid
);
Wraps a native pixmap in a GdkPixmap. This may fail if the pixmap has been destroyed.
For example in the X backend, a native pixmap handle is an Xlib
XID. the newly-created GdkPixmap wrapper for the
native pixmap or NULL
if the pixmap has been destroyed.
Since: 2.2
GdkPixmap * gdk_pixmap_foreign_new_for_screen (GdkScreen *screen
,GdkNativeWindow anid
,gint width
,gint height
,gint depth
);
Wraps a native pixmap in a GdkPixmap. This may fail if the pixmap has been destroyed.
For example in the X backend, a native pixmap handle is an Xlib
XID.This function is an alternative to gdk_pixmap_foreign_new_for_display()
for cases where the dimensions of the pixmap are known. For the X
backend, this avoids a roundtrip to the server.
screen |
||
anid |
a native pixmap handle |
|
width |
the width of the pixmap identified by |
|
height |
the height of the pixmap identified by |
|
depth |
the depth of the pixmap identified by |
the newly-created GdkPixmap wrapper for the
native pixmap or NULL
if the pixmap has been destroyed.
Since: 2.10
GdkWindow *
gdk_window_foreign_new (GdkNativeWindow anid
);
gdk_window_foreign_new
is deprecated and should not be used in newly-written code.
Wraps a native window for the default display in a GdkWindow. This may fail if the window has been destroyed.
For example in the X backend, a native window handle is an Xlib
XID. the newly-created GdkWindow wrapper for the
native window or NULL
if the window has been destroyed.
GdkWindow * gdk_window_foreign_new_for_display (GdkDisplay *display
,GdkNativeWindow anid
);
gdk_window_foreign_new_for_display
has been deprecated since version 2.24 and should not be used in newly-written code.
Use gdk_x11_window_foreign_new_for_display()
or
equivalent backend-specific API instead
Wraps a native window in a GdkWindow. This may fail if the window has been destroyed. If the window was already known to GDK, a new reference to the existing GdkWindow is returned.
For example in the X backend, a native window handle is an Xlib
XID. a GdkWindow wrapper for the native window or
NULL
if the window has been destroyed. The wrapper will be
newly created, if one doesn't exist already.
Since: 2.2
gpointer
gdk_xid_table_lookup (XID xid
);
gdk_xid_table_lookup
has been deprecated since version 2.24 and should not be used in newly-written code.
This function will be removed in GTK+ 3.0. GTK+
only stores windows in its X id table nowadays, so use
gdk_x11_window_lookup_for_display()
instead.
Returns the Gdk object associated with the given X id for the default display.
gpointer gdk_xid_table_lookup_for_display (GdkDisplay *display
,XID xid
);
gdk_xid_table_lookup_for_display
has been deprecated since version 2.24 and should not be used in newly-written code.
This function will be removed in GTK+ 3.0. GTK+
only stores windows in its X id table nowadays, so use
gdk_x11_window_lookup_for_display()
instead.
Returns the GDK object associated with the given X id.
the associated Gdk object, which may be a GdkPixmap,
a GdkWindow or a GdkFont or NULL
if no object is associated
with the X id.
Since: 2.2
GdkWindow *
gdk_window_lookup (GdkNativeWindow anid
);
gdk_window_lookup
has been deprecated since version 2.24 and should not be used in newly-written code.
Use gdk_x11_window_lookup_for_display()
or equivalent
backend-specific functionality instead
Looks up the GdkWindow that wraps the given native window handle.
For example in the X backend, a native window handle is an Xlib
XID.GdkWindow * gdk_window_lookup_for_display (GdkDisplay *display
,GdkNativeWindow anid
);
gdk_window_lookup_for_display
has been deprecated since version 2.24 and should not be used in newly-written code.
Use gdk_x11_window_lookup_for_display()
instead
Looks up the GdkWindow that wraps the given native window handle.
For example in the X backend, a native window handle is an Xlib
XID.Since: 2.2
GdkPixmap *
gdk_pixmap_lookup (GdkNativeWindow anid
);
Looks up the GdkPixmap that wraps the given native pixmap handle.
For example in the X backend, a native pixmap handle is an Xlib
XID.GdkPixmap * gdk_pixmap_lookup_for_display (GdkDisplay *display
,GdkNativeWindow anid
);
Looks up the GdkPixmap that wraps the given native pixmap handle.
For example in the X backend, a native pixmap handle is an Xlib
XID.Since: 2.2
#define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
gdk_font_lookup
is deprecated and should not be used in newly-written code.
#define gdk_font_lookup_for_display(display, xid) ((GdkFont*) gdk_xid_table_lookup_for_display (display, ((xid)|XID_FONT_BIT)))
gdk_font_lookup_for_display
is deprecated and should not be used in newly-written code.
GdkDisplay *
gdk_x11_lookup_xdisplay (Display *xdisplay
);
Find the GdkDisplay corresponding to display
, if any exists.
Since: 2.2
guint32
gdk_x11_get_server_time (GdkWindow *window
);
Routine to get the current X server time stamp.
window |
a GdkWindow, used for communication with the server. The window must have GDK_PROPERTY_CHANGE_MASK in its events mask or a hang will result. |
gboolean
gdk_net_wm_supports (GdkAtom property
);
gdk_net_wm_supports
has been deprecated since version 2.24 and should not be used in newly-written code.
Use gdk_x11_screen_supports_net_wm_hint()
instead
This function is specific to the X11 backend of GDK, and indicates
whether the window manager for the default screen supports a certain
hint from the Extended Window Manager Hints Specification. See
gdk_x11_screen_supports_net_wm_hint()
for complete details.
gboolean gdk_x11_screen_supports_net_wm_hint (GdkScreen *screen
,GdkAtom property
);
This function is specific to the X11 backend of GDK, and indicates whether the window manager supports a certain hint from the Extended Window Manager Hints Specification. You can find this specification on
http://www.freedesktop.org.When using this function, keep in mind that the window manager
can change over time; so you shouldn't use this function in
a way that impacts persistent application state. A common bug
is that your application can start up before the window manager
does when the user logs in, and before the window manager starts
gdk_x11_screen_supports_net_wm_hint()
will return FALSE
for every property.
You can monitor the window_manager_changed signal on GdkScreen to detect
a window manager change.
Since: 2.2
const char *
gdk_x11_screen_get_window_manager_name
(GdkScreen *screen
);
Returns the name of the window manager for screen
.
the name of the window manager screen screen
, or
"unknown" if the window manager is unknown. The string is owned by GDK
and should not be freed.
Since: 2.2
XID gdk_x11_screen_get_monitor_output (GdkScreen *screen
,gint monitor_num
);
Gets the XID of the specified output/monitor. If the X server does not support version 1.2 of the RANDR extension, 0 is returned.
screen |
||
monitor_num |
number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) |
Since: 2.14
GdkVisual * gdk_x11_screen_lookup_visual (GdkScreen *screen
,VisualID xvisualid
);
Looks up the GdkVisual for a particular screen and X Visual ID.
the GdkVisual (owned by the screen
object), or NULL
if the visual ID wasn't found.
[transfer none]
Since: 2.2
void gdk_x11_window_set_user_time (GdkWindow *window
,guint32 timestamp
);
The application can use this call to update the _NET_WM_USER_TIME property on a toplevel window. This property stores an Xserver time which represents the time of the last user input event received for this window. This property may be used by the window manager to alter the focus, stacking, and/or placement behavior of windows when they are mapped depending on whether the new window was created by a user action or is a "pop-up" window activated by a timer or some other event.
Note that this property is automatically updated by GDK, so this function should only be used by applications which handle input events bypassing GDK.
window |
A toplevel GdkWindow |
|
timestamp |
An XServer timestamp to which the property should be set |
Since: 2.6
void
gdk_x11_window_move_to_current_desktop
(GdkWindow *window
);
Moves the window to the correct workspace when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints. Will not do anything if the window is already on all workspaces.
Since: 2.8
guint32
gdk_x11_display_get_user_time (GdkDisplay *display
);
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()
.
Since: 2.8
GdkColormap * gdk_x11_colormap_foreign_new (GdkVisual *visual
,Colormap xcolormap
);
If xcolormap refers to a colormap previously known to GTK+, returns a new reference to the existing GdkColormap object, otherwise creates a new GdkColormap object and returns that
the GdkColormap object for xcolormap
.
Free with g_object_unref()
. Note that for colormap created
with gdk_x11_colormap_foreign_new()
, unref'ing the last
reference to the object will only free the GdkColoramp
object and not call XFreeColormap()
Since: 2.2
Colormap
gdk_x11_colormap_get_xcolormap (GdkColormap *colormap
);
Returns the X colormap belonging to a GdkColormap.
Display *
gdk_x11_colormap_get_xdisplay (GdkColormap *colormap
);
Returns the display of a GdkColormap.
Cursor
gdk_x11_cursor_get_xcursor (GdkCursor *cursor
);
Returns the X cursor belonging to a GdkCursor.
Display *
gdk_x11_cursor_get_xdisplay (GdkCursor *cursor
);
Returns the display of a GdkCursor.
void gdk_x11_display_broadcast_startup_message (GdkDisplay *display
,const char *message_type
,...
);
Sends a startup notification message of type message_type
to
display
.
This is a convenience function for use by code that implements the freedesktop startup notification specification. Applications should not normally need to call it directly. See the Startup Notification Protocol specification for definitions of the message types and keys that can be used.
display |
||
message_type |
startup notification message type ("new", "change", or "remove") |
|
... |
a list of key/value pairs (as strings), terminated by a
|
Since: 2.12
const gchar *
gdk_x11_display_get_startup_notification_id
(GdkDisplay *display
);
Gets the startup notification ID for a display.
Since: 2.12
Display *
gdk_x11_display_get_xdisplay (GdkDisplay *display
);
Returns the X display of a GdkDisplay.
Since: 2.2
void
gdk_x11_display_grab (GdkDisplay *display
);
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.
Since: 2.2
void
gdk_x11_display_ungrab (GdkDisplay *display
);
Ungrab display
after it has been grabbed with
gdk_x11_display_grab()
.
Since: 2.2
void gdk_x11_display_set_cursor_theme (GdkDisplay *display
,const gchar *theme
,const gint size
);
Sets the cursor theme from which the images for cursor should be taken.
If the windowing system supports it, existing cursors created
with gdk_cursor_new()
, gdk_cursor_new_for_display()
and
gdk_cursor_new_for_name()
are updated to reflect the theme
change. Custom cursors constructed with gdk_cursor_new_from_pixmap()
or gdk_cursor_new_from_pixbuf()
will have to be handled
by the application (GTK+ applications can learn about
cursor theme changes by listening for change notification
for the corresponding GtkSetting).
display |
||
theme |
the name of the cursor theme to use, or |
|
size |
the cursor size to use, or 0 to keep the previous size |
Since: 2.8
void gdk_x11_register_standard_event_type (GdkDisplay *display
,gint event_base
,gint n_events
);
Registers interest in receiving extension events with type codes
between event_base
and event_base + n_events - 1
.
The registered events must have the window field in the same place
as core X events (this is not the case for e.g. XKB extension events).
If an event type is registered, events of this type will go through
global and window-specific filters (see gdk_window_add_filter()
).
Unregistered events will only go through global filters.
GDK may register the events of some X extensions on its own.
This function should only be needed in unusual circumstances, e.g. when filtering XInput extension events on the root window.
display |
||
event_base |
first event type code to register |
|
n_events |
number of event type codes to register |
Since: 2.4
Display *
gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable
);
Returns the display of a GdkDrawable.
XID
gdk_x11_drawable_get_xid (GdkDrawable *drawable
);
Returns the X resource (window or pixmap) belonging to a GdkDrawable.
const char *
gdk_x11_font_get_name (GdkFont *font
);
gdk_x11_font_get_name
is deprecated and should not be used in newly-written code.
Return the X Logical Font Description (for font->type == GDK_FONT_FONT) or comma separated list of XLFDs (for font->type == GDK_FONT_FONTSET) that was used to load the font. If the same font was loaded via multiple names, which name is returned is undefined.
Display *
gdk_x11_font_get_xdisplay (GdkFont *font
);
gdk_x11_font_get_xdisplay
is deprecated and should not be used in newly-written code.
Returns the display of a GdkFont.
gpointer
gdk_x11_font_get_xfont (GdkFont *font
);
gdk_x11_font_get_xfont
is deprecated and should not be used in newly-written code.
Returns the X font belonging to a GdkFont.
Display *
gdk_x11_gc_get_xdisplay (GdkGC *gc
);
gdk_x11_gc_get_xdisplay
has been deprecated since version 2.22 and should not be used in newly-written code.
Returns the display of a GdkGC.
GC
gdk_x11_gc_get_xgc (GdkGC *gc
);
gdk_x11_gc_get_xgc
has been deprecated since version 2.22 and should not be used in newly-written code.
Returns the X GC of a GdkGC.
Window
gdk_x11_get_default_root_xwindow (void
);
Gets the root window of the default screen
(see gdk_x11_get_default_screen()
).
gint
gdk_x11_get_default_screen (void
);
Gets the default GTK+ screen number.
returns the screen number specified by
the --display command line option or the DISPLAY environment
variable when gdk_init()
calls XOpenDisplay()
.
Display *
gdk_x11_get_default_xdisplay (void
);
Gets the default GTK+ display.
void
gdk_x11_grab_server (void
);
Call gdk_x11_display_grab()
on the default display.
To ungrab the server again, use gdk_x11_ungrab_server()
.
gdk_x11_grab_server()/gdk_x11_ungrab_server()
calls can be nested.
Display *
gdk_x11_image_get_xdisplay (GdkImage *image
);
Returns the display of a GdkImage.
XImage *
gdk_x11_image_get_ximage (GdkImage *image
);
Returns the X image belonging to a GdkImage.
int
gdk_x11_screen_get_screen_number (GdkScreen *screen
);
Returns the index of a GdkScreen.
Since: 2.2
Screen *
gdk_x11_screen_get_xscreen (GdkScreen *screen
);
Returns the screen of a GdkScreen.
Since: 2.2
void
gdk_x11_ungrab_server (void
);
Ungrab the default display after it has been grabbed with
gdk_x11_grab_server()
.
Visual *
gdk_x11_visual_get_xvisual (GdkVisual *visual
);
Returns the X visual belonging to a GdkVisual.
Atom
gdk_x11_atom_to_xatom (GdkAtom atom
);
Converts from a GdkAtom to the X atom for the default GDK display with the same string value.
Atom gdk_x11_atom_to_xatom_for_display (GdkDisplay *display
,GdkAtom atom
);
Converts from a GdkAtom to the X atom for a GdkDisplay
with the same string value. The special value GDK_NONE
is converted to None
.
Since: 2.2
GdkAtom
gdk_x11_xatom_to_atom (Atom xatom
);
Convert from an X atom for the default display to the corresponding GdkAtom.
GdkAtom gdk_x11_xatom_to_atom_for_display (GdkDisplay *display
,Atom xatom
);
Convert from an X atom for a GdkDisplay to the corresponding GdkAtom.
Since: 2.2
Atom
gdk_x11_get_xatom_by_name (const gchar *atom_name
);
Returns the X atom for GDK's default display corresponding to atom_name
.
This function caches the result, so if called repeatedly it is much
faster than XInternAtom()
, which is a round trip to the server each time.
Atom gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display
,const gchar *atom_name
);
Returns the X atom for a GdkDisplay corresponding to atom_name
.
This function caches the result, so if called repeatedly it is much
faster than XInternAtom()
, which is a round trip to the server each time.
Since: 2.2
const gchar *
gdk_x11_get_xatom_name (Atom xatom
);
Returns the name of an X atom for GDK's default display. This
function is meant mainly for debugging, so for convenience, unlike
and XAtomName()
gdk_atom_name()
, the result
doesn't need to be freed. Also, this function will never return NULL
,
even if xatom
is invalid.
const gchar * gdk_x11_get_xatom_name_for_display (GdkDisplay *display
,Atom xatom
);
Returns the name of an X atom for its display. This
function is meant mainly for debugging, so for convenience, unlike
XAtomName()
and gdk_atom_name()
, the result doesn't need to
be freed.
Since: 2.2
void
gdk_x11_set_sm_client_id (const gchar *sm_client_id
);
Sets the SM_CLIENT_ID
property on the application's leader window so that
the window manager can save the application's state using the X11R6 ICCCM
session management protocol.
See the X Session Management Library documentation for more information on session management and the Inter-Client Communication Conventions Manual
sm_client_id |
the client id assigned by the session manager when the
connection was opened, or |
Since: 2.24
GdkWindow * gdk_x11_window_foreign_new_for_display (GdkDisplay *display
,Window window
);
Wraps a native window in a GdkWindow.
This may fail if the window has been destroyed. If the window was already known to GDK, a new reference to the existing GdkWindow is returned.
a GdkWindow wrapper for the native window or
NULL
if the window has been destroyed. The wrapper will be
newly created, if one doesn't exist already.
Since: 2.24
GdkWindow * gdk_x11_window_lookup_for_display (GdkDisplay *display
,Window window
);
Looks up the GdkWindow that wraps the given native window handle.
Since: 2.24