Synopsis#include <gdk/gdk.h> GdkDisplay; GdkDisplay* gdk_display_open (const gchar *display_name); GdkDisplay* gdk_display_get_default (void); const gchar* gdk_display_get_name (GdkDisplay *display); gint gdk_display_get_n_screens (GdkDisplay *display); GdkScreen* gdk_display_get_screen (GdkDisplay *display, gint screen_num); GdkScreen* gdk_display_get_default_screen (GdkDisplay *display); void gdk_display_pointer_ungrab (GdkDisplay *display, guint32 time_); void gdk_display_keyboard_ungrab (GdkDisplay *display, guint32 time_); gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display); void gdk_display_beep (GdkDisplay *display); void gdk_display_sync (GdkDisplay *display); void gdk_display_flush (GdkDisplay *display); void gdk_display_close (GdkDisplay *display); GList* gdk_display_list_devices (GdkDisplay *display); GdkEvent* gdk_display_get_event (GdkDisplay *display); GdkEvent* gdk_display_peek_event (GdkDisplay *display); void gdk_display_put_event (GdkDisplay *display, const GdkEvent *event); void gdk_display_add_client_message_filter (GdkDisplay *display, GdkAtom message_type, GdkFilterFunc func, gpointer data); void gdk_display_set_double_click_time (GdkDisplay *display, guint msec); void gdk_display_set_double_click_distance (GdkDisplay *display, guint distance); void gdk_display_get_pointer (GdkDisplay *display, GdkScreen **screen, gint *x, gint *y, GdkModifierType *mask); GdkWindow* gdk_display_get_window_at_pointer (GdkDisplay *display, gint *win_x, gint *win_y); GdkDisplayPointerHooks; GdkDisplayPointerHooks* gdk_display_set_pointer_hooks (GdkDisplay *display, const GdkDisplayPointerHooks *new_hooks); void gdk_display_warp_pointer (GdkDisplay *display, GdkScreen *screen, gint x, gint y); gboolean gdk_display_supports_cursor_color (GdkDisplay *display); gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display); guint gdk_display_get_default_cursor_size (GdkDisplay *display); void gdk_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height); GdkWindow* gdk_display_get_default_group (GdkDisplay *display); gboolean gdk_display_supports_selection_notification (GdkDisplay *display); gboolean gdk_display_request_selection_notification (GdkDisplay *display, GdkAtom selection); gboolean gdk_display_supports_clipboard_persistence (GdkDisplay *display); void gdk_display_store_clipboard (GdkDisplay *display, GdkWindow *clipboard_window, guint32 time_, const GdkAtom *targets, gint n_targets); gboolean gdk_display_supports_shapes (GdkDisplay *display); gboolean gdk_display_supports_input_shapes (GdkDisplay *display); gboolean gdk_display_supports_composite (GdkDisplay *display); DescriptionGdkDisplay objects purpose are two fold:
GdkDisplay objects are the GDK representation of the X Display which can be described as a workstation consisting of a keyboard a pointing device (such as a mouse) and one or more screens. It is used to open and keep track of various GdkScreen objects currently instanciated by the application. It is also used to grab and release the keyboard and the mouse pointer. DetailsGdkDisplaytypedef struct _GdkDisplay GdkDisplay; The GdkDisplay struct is the GDK representation of an X display. All its fields are private and should not be accessed directly. Since 2.2 gdk_display_open ()GdkDisplay* gdk_display_open (const gchar *display_name); Opens a display.
Since 2.2 gdk_display_get_default ()GdkDisplay* gdk_display_get_default (void);
Gets the default GdkDisplay. This is a convenience
function for
Since 2.2 gdk_display_get_name ()const gchar* gdk_display_get_name (GdkDisplay *display); Gets the name of the display.
Since 2.2 gdk_display_get_n_screens ()gint gdk_display_get_n_screens (GdkDisplay *display);
Gets the number of screen managed by the
Since 2.2 gdk_display_get_screen ()GdkScreen* gdk_display_get_screen (GdkDisplay *display, gint screen_num); Returns a screen object for one of the screens of the display.
Since 2.2 gdk_display_get_default_screen ()GdkScreen* gdk_display_get_default_screen (GdkDisplay *display);
Get the default GdkScreen for
Since 2.2 gdk_display_pointer_ungrab ()void gdk_display_pointer_ungrab (GdkDisplay *display, guint32 time_); Release any pointer grab.
Since 2.2 gdk_display_keyboard_ungrab ()void gdk_display_keyboard_ungrab (GdkDisplay *display, guint32 time_); Release any keyboard grab
Since 2.2 gdk_display_pointer_is_grabbed ()gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display); Test if the pointer is grabbed.
Since 2.2 gdk_display_beep ()void gdk_display_beep (GdkDisplay *display);
Emits a short beep on
Since 2.2 gdk_display_sync ()void gdk_display_sync (GdkDisplay *display);
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
This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.
Since 2.2 gdk_display_flush ()void gdk_display_flush (GdkDisplay *display); 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 gdk_display_close ()void gdk_display_close (GdkDisplay *display); Closes the connection to the windowing system for the given display, and cleans up associated resources.
Since 2.2 gdk_display_list_devices ()GList* gdk_display_list_devices (GdkDisplay *display);
Returns the list of available input devices attached to
Since 2.2 gdk_display_get_event ()GdkEvent* gdk_display_get_event (GdkDisplay *display);
Gets the next GdkEvent to be processed for
Since 2.2 gdk_display_peek_event ()GdkEvent* gdk_display_peek_event (GdkDisplay *display);
Gets a copy of the first GdkEvent in the
Since 2.2 gdk_display_put_event ()void gdk_display_put_event (GdkDisplay *display, const GdkEvent *event);
Appends a copy of the given event onto the front of the event
queue for
Since 2.2 gdk_display_add_client_message_filter ()void gdk_display_add_client_message_filter (GdkDisplay *display, GdkAtom message_type, GdkFilterFunc func, gpointer data);
Adds a filter to be called when X ClientMessage events are received.
See
Since 2.2 gdk_display_set_double_click_time ()void gdk_display_set_double_click_time (GdkDisplay *display, guint msec); Sets the double click time (two clicks within this time interval count as a double click and result in a GDK_2BUTTON_PRESS event). Applications should not set this, it is a global user-configured setting.
Since 2.2 gdk_display_set_double_click_distance ()void gdk_display_set_double_click_distance (GdkDisplay *display, guint distance);
Sets the double click distance (two clicks within this distance
count as a double click and result in a GDK_2BUTTON_PRESS event).
See also
Since 2.4 gdk_display_get_pointer ()void gdk_display_get_pointer (GdkDisplay *display, GdkScreen **screen, gint *x, gint *y, GdkModifierType *mask); Gets the current location of the pointer and the current modifier mask for a given display.
Since 2.2 gdk_display_get_window_at_pointer ()GdkWindow* gdk_display_get_window_at_pointer (GdkDisplay *display, gint *win_x, gint *win_y);
Obtains the window underneath the mouse pointer, returning the location
of that window in
Since 2.2 GdkDisplayPointerHookstypedef struct { void (*get_pointer) (GdkDisplay *display, GdkScreen **screen, gint *x, gint *y, GdkModifierType *mask); GdkWindow* (*window_get_pointer) (GdkDisplay *display, GdkWindow *window, gint *x, gint *y, GdkModifierType *mask); GdkWindow* (*window_at_pointer) (GdkDisplay *display, gint *win_x, gint *win_y); } GdkDisplayPointerHooks;
A table of pointers to functions for getting quantities related to
the current pointer position. Each GdkDisplay has a table of this type,
which can be set using This is only useful for such low-level tools as an event recorder. Applications should never have any reason to use this facility
Since 2.2 gdk_display_set_pointer_hooks ()GdkDisplayPointerHooks* gdk_display_set_pointer_hooks (GdkDisplay *display, const GdkDisplayPointerHooks *new_hooks); This function allows for hooking into the operation of getting the current location of the pointer on a particular display. This is only useful for such low-level tools as an event recorder. Applications should never have any reason to use this facility.
Since 2.2 gdk_display_warp_pointer ()void gdk_display_warp_pointer (GdkDisplay *display, GdkScreen *screen, gint x, gint y);
Warps the pointer of Note that the pointer should normally be under the control of the user. This function was added to cover some rare use cases like keyboard navigation support for the color picker in the GtkColorSelectionDialog.
Since 2.8 gdk_display_supports_cursor_color ()gboolean gdk_display_supports_cursor_color (GdkDisplay *display);
Returns
Since 2.4 gdk_display_supports_cursor_alpha ()gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display);
Returns
Since 2.4 gdk_display_get_default_cursor_size ()guint gdk_display_get_default_cursor_size (GdkDisplay *display);
Returns the default size to use for cursors on
Since 2.4 gdk_display_get_maximal_cursor_size ()void gdk_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height);
Gets the maximal size to use for cursors on
Since 2.4 gdk_display_get_default_group ()GdkWindow* gdk_display_get_default_group (GdkDisplay *display);
Returns the default group leader window for all toplevel windows
on
Since 2.4 gdk_display_supports_selection_notification ()gboolean gdk_display_supports_selection_notification (GdkDisplay *display); Returns whether GdkEventOwnerChange events will be sent when the owner of a selection changes.
Since 2.6 gdk_display_request_selection_notification ()gboolean gdk_display_request_selection_notification (GdkDisplay *display, GdkAtom selection); Request GdkEventOwnerChange events for ownership changes of the selection named by the given atom.
Since 2.6 gdk_display_supports_clipboard_persistence ()gboolean gdk_display_supports_clipboard_persistence (GdkDisplay *display); Returns whether the speicifed display supports clipboard persistance; i.e. if it's possible to store the clipboard data after an application has quit. On X11 this checks if a clipboard daemon is running.
Since 2.6 gdk_display_store_clipboard ()void gdk_display_store_clipboard (GdkDisplay *display, GdkWindow *clipboard_window, guint32 time_, const GdkAtom *targets, gint n_targets); Issues a request to the clipboard manager to store the clipboard data. On X11, this is a special program that works according to the freedesktop clipboard specification, available at http://www.freedesktop.org/Standards/clipboard-manager-spec.
Since 2.6 gdk_display_supports_shapes ()gboolean gdk_display_supports_shapes (GdkDisplay *display);
Returns
Since 2.10 gdk_display_supports_input_shapes ()gboolean gdk_display_supports_input_shapes (GdkDisplay *display);
Returns
Since 2.10 gdk_display_supports_composite ()gboolean gdk_display_supports_composite (GdkDisplay *display);
Returns Currently this only works on X11 with XComposite and XDamage extensions available.
Since 2.12 Signal DetailsThe
|
|
the object on which the signal is emitted |
|
TRUE if the display was closed due to an error
|
|
user data set when the signal handler was connected. |
Since 2.2