![]() |
![]() |
Gdk::Display 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 Gdk::Screen objects currently instantiated by the application. It is also used to grab and release the keyboard and the mouse pointer.
Public Member Functions | |
void | add_client_message_filter (Glib::ustring& message_type, GdkFilterFunc func, gpointer data) |
Adds a filter to be called when X ClientMessage events are received. | |
void | beep () |
Emits a short beep on display. | |
void | close () |
Closes the connection to the windowing system for the given display, and cleans up associated resources. | |
void | flush () |
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. | |
Glib::RefPtr<const Device> | get_core_pointer () const |
Returns the core pointer device for the given display. | |
Glib::RefPtr<Device> | get_core_pointer () |
Returns the core pointer device for the given display. | |
guint | get_default_cursor_size () const |
Returns the default size to use for cursors on display . | |
Glib::RefPtr<const Window> | get_default_group () const |
Returns the default group leader window for all toplevel windows on display . | |
Glib::RefPtr<Window> | get_default_group () |
Returns the default group leader window for all toplevel windows on display . | |
Glib::RefPtr<const Screen> | get_default_screen () const |
Get the default Gdk::Screen for display . | |
Glib::RefPtr<Screen> | get_default_screen () |
Get the default Gdk::Screen for display . | |
guint32 | get_drag_protocol (guint32 xid, GdkDragProtocol& protocol) |
Finds out the DND protocol supported by a window. | |
const GdkEvent* | get_event () const |
Gets the next Gdk::Event to be processed for display , fetching events from the windowing system if necessary. | |
GdkEvent* | get_event () |
Gets the next Gdk::Event to be processed for display , fetching events from the windowing system if necessary. | |
const GdkKeymap* | get_keymap () const |
GdkKeymap* | get_keymap () |
void | get_maximal_cursor_size (guint& width, guint& height) |
Gets the maximal size to use for cursors on display . | |
int | get_n_screens () const |
Gets the number of screen managed by the display . | |
Glib::ustring | get_name () const |
Gets the name of the display. | |
void | get_pointer (int& x, int& y, ModifierType& mask) |
Gets the current location of the pointer and the current modifier mask for a given display. | |
void | get_pointer (Glib::RefPtr<Screen>& screen, int& x, int& y, ModifierType& mask) |
Gets the current location of the pointer and the current modifier mask for a given display. | |
Glib::RefPtr<const Screen> | get_screen (int screen_num) const |
Returns a screen object for one of the screens of the display. | |
Glib::RefPtr<Screen> | get_screen (int screen_num) |
Returns a screen object for one of the screens of the display. | |
Glib::RefPtr<Window> | get_selection_owner (const Glib::ustring& selection) |
Glib::RefPtr<const Window> | get_window_at_pointer () const |
Obtains the window underneath the mouse pointer. | |
Glib::RefPtr<Window> | get_window_at_pointer () |
Obtains the window underneath the mouse pointer. | |
Glib::RefPtr<const Window> | get_window_at_pointer (int& win_x, int& win_y) const |
Obtains the window underneath the mouse pointer, returning the location of that window in win_x , win_y for screen . | |
Glib::RefPtr<Window> | get_window_at_pointer (int& win_x, int& win_y) |
Obtains the window underneath the mouse pointer, returning the location of that window in win_x , win_y for screen . | |
const GdkDisplay* | gobj () const |
Provides access to the underlying C GObject. | |
GdkDisplay* | gobj () |
Provides access to the underlying C GObject. | |
GdkDisplay* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
void | keyboard_ungrab (guint32 timestamp) |
Release any keyboard grab. | |
Glib::ListHandle< Glib::RefPtr< const Device > > | list_devices () const |
Returns the list of available input devices attached to display . | |
Glib::ListHandle< Glib::RefPtr< Device > > | list_devices () |
Returns the list of available input devices attached to display . | |
Glib::RefPtr<const Pixmap> | lookup_pixmap (NativeWindow anid) const |
Looks up the Gdk::Pixmap that wraps the given native pixmap handle. | |
Glib::RefPtr<Pixmap> | lookup_pixmap (NativeWindow anid) |
Looks up the Gdk::Pixmap that wraps the given native pixmap handle. | |
GdkEvent* | peek_event () const |
Gets a copy of the first Gdk::Event in the display 's event queue, without removing the event from the queue. | |
GdkEvent* | peek_event () |
Gets a copy of the first Gdk::Event in the display 's event queue, without removing the event from the queue. | |
bool | pointer_is_grabbed () const |
Test if the pointer is grabbed. | |
void | pointer_ungrab (guint32 timestamp) |
Release any pointer grab. | |
void | put_event (GdkEvent* event) |
Appends a copy of the given event onto the front of the event queue for display . | |
bool | request_selection_notification (const Glib::ustring& selection) |
Request Gdk::EventOwnerChange events for ownership changes of the selection named by the given atom. | |
void | selection_send_notify (guint32 requestor, Glib::ustring& selection, Glib::ustring& target, Glib::ustring& property, guint32 time_) |
void | set_double_click_distance (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). | |
void | set_double_click_time (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). | |
GdkDisplayPointerHooks* | set_pointer_hooks (const GdkDisplayPointerHooks* new_hooks) |
This function allows for hooking into the operation of getting the current location of the pointer on a particular display. | |
bool | set_selection_owner (const Glib::RefPtr<Window>& owner, Glib::ustring& selection, guint32 time_, bool send_event) |
Glib::SignalProxy1< void, bool > | signal_closed () |
The closed signal is emitted when the connection to the windowing system for this display is closed. | |
void | store_clipboard (const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_, const Glib::StringArrayHandle& targets) |
void | store_clipboard (const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_) |
bool | supports_clipboard_persistence () const |
Returns whether the speicifed display supports clipboard persistance; i.e. if it's possible to store the clipboard data after an application has quit. | |
bool | supports_cursor_alpha () const |
Returns true if cursors can use an 8bit alpha channel on display . | |
bool | supports_cursor_color () const |
Returns true if multicolored cursors are supported on display . | |
bool | supports_selection_notification () const |
Returns whether Gdk::EventOwnerChange events will be sent when the owner of a selection changes. | |
void | sync () |
Flushes any requests queued for the windowing system and waits until all requests have been handled. | |
GdkDisplayPointerHooks* | unset_pointer_hooks () |
void | warp_pointer (const Glib::RefPtr<Screen>& screen, int x, int y) |
Warps the pointer of display to the point x , y on the screen screen , unless the pointer is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. | |
virtual | ~Display () |
Static Public Member Functions | |
static Glib::RefPtr<Display> | get_default () |
Gets the default Gdk::Display. | |
static Glib::RefPtr<Display> | open (const Glib::ustring& display_name) |
Opens a display. | |
static Glib::RefPtr<Display> | open_default_libgtk_only () |
Opens the default display specified by command line arguments or environment variables, sets it as the default display, and returns it. | |
Protected Member Functions | |
Display () | |
virtual void | on_closed (bool is_error) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gdk::Display> | wrap (GdkDisplay* object, bool take_copy=false) |
|
|
|
|
|
Adds a filter to be called when X ClientMessage events are received.
|
|
Emits a short beep on display.
|
|
Closes the connection to the windowing system for the given display, and cleans up associated resources.
|
|
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.
|
|
Returns the core pointer device for the given display.
|
|
Returns the core pointer device for the given display.
|
|
Gets the default Gdk::Display. This is a convenience function for: gdk_display_manager_get_default_display (manager_get())
|
|
Returns the default size to use for cursors on display .
|
|
Returns the default group leader window for all toplevel windows on display . This window is implicitly created by GDK. See gdk_window_set_group().
|
|
Returns the default group leader window for all toplevel windows on display . This window is implicitly created by GDK. See gdk_window_set_group().
|
|
Get the default Gdk::Screen for display .
|
|
Get the default Gdk::Screen for display .
|
|
Finds out the DND protocol supported by a window.
|
|
Gets the next Gdk::Event to be processed for display , fetching events from the windowing system if necessary.
|
|
Gets the next Gdk::Event to be processed for display , fetching events from the windowing system if necessary.
|
|
|
|
|
|
Gets the maximal size to use for cursors on display .
|
|
Gets the number of screen managed by the display .
|
|
Gets the name of the display.
|
|
Gets the current location of the pointer and the current modifier mask for a given display.
|
|
Gets the current location of the pointer and the current modifier mask for a given display.
|
|
Returns a screen object for one of the screens of the display.
|
|
Returns a screen object for one of the screens of the display.
|
|
|
|
Obtains the window underneath the mouse pointer. Returns a null RefPtr if the window under the mouse pointer is not known to GDK (for example, belongs to another application).
|
|
Obtains the window underneath the mouse pointer. Returns a null RefPtr if the window under the mouse pointer is not known to GDK (for example, belongs to another application).
|
|
Obtains the window underneath the mouse pointer, returning the location of that window in win_x , win_y for screen .
Returns
|
|
Obtains the window underneath the mouse pointer, returning the location of that window in win_x , win_y for screen .
Returns
|
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
|
Release any keyboard grab.
|
|
Returns the list of available input devices attached to display . The list is statically allocated and should not be freed.
|
|
Returns the list of available input devices attached to display . The list is statically allocated and should not be freed.
|
|
Looks up the Gdk::Pixmap that wraps the given native pixmap handle. For example in the X backend, a native pixmap handle is an Xlib <type>XID</type>.
|
|
Looks up the Gdk::Pixmap that wraps the given native pixmap handle. For example in the X backend, a native pixmap handle is an Xlib <type>XID</type>.
|
|
|
|
Opens a display.
|
|
Opens the default display specified by command line arguments or environment variables, sets it as the default display, and returns it. gdk_parse_args must have been called first. If the default display has previously been set, simply returns that. An internal function that should not be used by applications.
|
|
Gets a copy of the first Gdk::Event in the display 's event queue, without removing the event from the queue. (Note that this function will not get more events from the windowing system. It only checks the events that have already been moved to the GDK event queue.)
|
|
Gets a copy of the first Gdk::Event in the display 's event queue, without removing the event from the queue. (Note that this function will not get more events from the windowing system. It only checks the events that have already been moved to the GDK event queue.)
|
|
Test if the pointer is grabbed.
|
|
Release any pointer grab.
|
|
Appends a copy of the given event onto the front of the event queue for display .
|
|
Request Gdk::EventOwnerChange events for ownership changes of the selection named by the given atom.
|
|
|
|
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 set_double_click_time(). Applications should not set this, it is a global user-configured setting.
|
|
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.
|
|
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. newin2p2
|
|
|
|
The closed signal is emitted when the connection to the windowing system for this display is closed.
|
|
|
|
|
|
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.
|
|
Returns Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).
|
|
Returns Otherwise, cursors have only a forground and a background color.
|
|
Returns whether Gdk::EventOwnerChange events will be sent when the owner of a selection changes.
|
|
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 sync() before gdk_error_trap_pop() makes sure that any errors generated from earlier requests are handled before the error trap is removed. This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.
|
|
|
|
Warps the pointer of display to the point x , y on the screen screen , unless the pointer is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping the pointer creates events as if the user had moved the mouse instantaneously to the destination. 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 Gtk::ColorSelectionDialog.
|
|
|