Class: Gdk::Display
- Inherits:
-
Object
- Object
- Gdk::Display
- Defined in:
- (unknown)
Overview
Gdk::Display objects purpose are two fold:
-
To manage and provide information about input devices (pointers and keyboards)
-
To manage and provide information about the available Gdk::Screens
GdkDisplay objects are the GDK representation of an 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 instantiated by the application. It is also used to access the keyboard(s) and mouse pointer(s) of the display.
Most of the input device handling has been factored out into the separate Gdk::DeviceManager object. Every display has a device manager, which you can obtain using gdk_display_get_device_manager().
Instance Method Summary collapse
-
#app_launch_context ⇒ Gdk::AppLaunchContext
Returns a Gdk::AppLaunchContext suitable for launching applications on the given display.
-
#beep ⇒ nil
Emits a short beep on display.
-
#close ⇒ nil
Closes the connection to the windowing system for the given display, and cleans up associated resources.
-
#default_cursor_size ⇒ Integer
Returns the default size to use for cursors on display.
-
#default_group ⇒ Gdk::Window
Returns the default group leader window for all toplevel windows on display.
-
#default_screen ⇒ Gdk::Screen
Get the default Gdk::Screen for display.
-
#default_seat ⇒ Gdk::Seat
Returns the default Gdk::Seat for this display.
-
#device_is_grabbed(device) ⇒ TrueClass
Returns true if there is an ongoing grab on device for display.
-
#device_manager ⇒ Gdk::DeviceManager
Returns the Gdk::DeviceManager associated to display.
-
#double_click_distance=(distance) ⇒ nil
Sets the double click distance (two clicks within this distance count as a double click and result in a #GDK_2BUTTON_PRESS event).
-
#double_click_time=(msec) ⇒ nil
Sets the double click time (two clicks within this time interval count as a double click and result in a #GDK_2BUTTON_PRESS event).
-
#event ⇒ Gdk::Event
Gets the next Gdk::Event to be processed for display, fetching events from the windowing system if necessary.
-
#flush ⇒ nil
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 explicitly.
-
#get_maximal_cursor_size(width, height) ⇒ nil
Gets the maximal size to use for cursors on display.
-
#get_monitor(monitor_num) ⇒ Gdk::Monitor
Gets a monitor associated with this display.
-
#get_monitor_at_point(x, y) ⇒ Gdk::Monitor
Gets the monitor in which the point (x, y) is located, or a nearby monitor if the point is not in any monitor.
-
#get_monitor_at_window(window) ⇒ Gdk::Monitor
Gets the monitor in which the largest area of window resides, or a monitor close to window if it is outside of all monitors.
-
#get_pointer(screen, x, y, mask) ⇒ nil
Gets the current location of the pointer and the current modifier mask for a given display.
-
#get_screen(screen_num) ⇒ Gdk::Screen
Returns a screen object for one of the screens of the display.
-
#get_window_at_pointer(win_x, win_y) ⇒ Gdk::Window
Obtains the window underneath the mouse pointer, returning the location of the pointer in that window in win_x, win_y for screen.
-
#has_pending ⇒ TrueClass
Returns whether the display has events that are waiting to be processed.
-
#is_closed ⇒ TrueClass
Finds out if the display has been closed.
-
#keyboard_ungrab(time_) ⇒ nil
Release any keyboard grab.
-
#list_devices ⇒ GLib::List
Returns the list of available input devices attached to display.
-
#list_seats ⇒ GLib::List
Returns the list of seats known to display.
-
#n_monitors ⇒ Integer
Gets the number of monitors that belong to display.
-
#n_screens ⇒ Integer
Gets the number of screen managed by the display.
-
#name ⇒ String
Gets the name of the display.
-
#notify_startup_complete(startup_id) ⇒ nil
Indicates to the GUI environment that the application has finished loading, using a given identifier.
-
#peek_event ⇒ Gdk::Event
Gets a copy of the first Gdk::Event in the display’s event queue, without removing the event from the queue.
-
#pointer_is_grabbed ⇒ TrueClass
Test if the pointer is grabbed.
-
#pointer_ungrab(time_) ⇒ nil
Release any pointer grab.
-
#primary_monitor ⇒ Gdk::Monitor
Gets the primary monitor for the display.
-
#put_event(event) ⇒ nil
Appends a copy of the given event onto the front of the event queue for display.
-
#request_selection_notification(selection) ⇒ TrueClass
Request Gdk::EventOwnerChange events for ownership changes of the selection named by the given atom.
-
#store_clipboard(clipboard_window, time_, targets, n_targets) ⇒ nil
Issues a request to the clipboard manager to store the clipboard data.
-
#supports_clipboard_persistence ⇒ TrueClass
Returns whether the speicifed display supports clipboard persistance; i.e.
-
#supports_composite ⇒ TrueClass
Returns true if gdk_window_set_composited() can be used to redirect drawing on the window using compositing.
-
#supports_cursor_alpha ⇒ TrueClass
Returns true if cursors can use an 8bit alpha channel on display.
-
#supports_cursor_color ⇒ TrueClass
Returns true if multicolored cursors are supported on display.
-
#supports_input_shapes ⇒ TrueClass
Returns true if gdk_window_input_shape_combine_mask() can be used to modify the input shape of windows on display.
-
#supports_selection_notification ⇒ TrueClass
Returns whether Gdk::EventOwnerChange events will be sent when the owner of a selection changes.
-
#supports_shapes ⇒ TrueClass
Returns true if gdk_window_shape_combine_mask() can be used to create shaped windows on display.
-
#sync ⇒ nil
Flushes any requests queued for the windowing system and waits until all requests have been handled.
-
#warp_pointer(screen, x, y) ⇒ nil
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.
Instance Method Details
#app_launch_context ⇒ Gdk::AppLaunchContext
Returns a Gdk::AppLaunchContext suitable for launching applications on the given display.
#beep ⇒ nil
Emits a short beep on display
#close ⇒ nil
Closes the connection to the windowing system for the given display, and cleans up associated resources.
#default_cursor_size ⇒ Integer
Returns the default size to use for cursors on display.
#default_group ⇒ Gdk::Window
Returns the default group leader window for all toplevel windows on display. This window is implicitly created by GDK. See gdk_window_set_group(). for display
#default_screen ⇒ Gdk::Screen
Get the default Gdk::Screen for display.
#default_seat ⇒ Gdk::Seat
Returns the default Gdk::Seat for this display.
#device_is_grabbed(device) ⇒ TrueClass
Returns true if there is an ongoing grab on device for display.
#device_manager ⇒ Gdk::DeviceManager
Returns the Gdk::DeviceManager associated to display.
#double_click_distance=(distance) ⇒ nil
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 gdk_display_set_double_click_time(). Applications should not set this, it is a global user-configured setting.
#double_click_time=(msec) ⇒ nil
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.
#event ⇒ Gdk::Event
Gets the next Gdk::Event to be processed for display, fetching events from the windowing system if necessary. if no events are pending. The returned Gdk::Event should be freed with gdk_event_free().
#flush ⇒ nil
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 explicitly. 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.
#get_maximal_cursor_size(width, height) ⇒ nil
Gets the maximal size to use for cursors on display.
#get_monitor(monitor_num) ⇒ Gdk::Monitor
Gets a monitor associated with this display.
#get_monitor_at_point(x, y) ⇒ Gdk::Monitor
Gets the monitor in which the point (x, y) is located, or a nearby monitor if the point is not in any monitor.
#get_monitor_at_window(window) ⇒ Gdk::Monitor
Gets the monitor in which the largest area of window resides, or a monitor close to window if it is outside of all monitors.
#get_pointer(screen, x, y, mask) ⇒ nil
Gets the current location of the pointer and the current modifier mask for a given display.
#get_screen(screen_num) ⇒ Gdk::Screen
Returns a screen object for one of the screens of the display.
#get_window_at_pointer(win_x, win_y) ⇒ Gdk::Window
Obtains the window underneath the mouse pointer, returning the location of the pointer in that window in win_x, win_y for screen. Returns nil if the window under the mouse pointer is not known to GDK (for example, belongs to another application).
#has_pending ⇒ TrueClass
Returns whether the display has events that are waiting to be processed.
#is_closed ⇒ TrueClass
Finds out if the display has been closed.
#keyboard_ungrab(time_) ⇒ nil
Release any keyboard grab
#list_devices ⇒ GLib::List
Returns the list of available input devices attached to display. The list is statically allocated and should not be freed.
#list_seats ⇒ GLib::List
Returns the list of seats known to display.
#n_monitors ⇒ Integer
Gets the number of monitors that belong to display.
The returned number is valid until the next emission of the Gdk::Display::monitor-added or #GdkDisplay::monitor-removed signal.
#n_screens ⇒ Integer
Gets the number of screen managed by the display.
#name ⇒ String
Gets the name of the display. by GDK and should not be modified or freed.
#notify_startup_complete(startup_id) ⇒ nil
Indicates to the GUI environment that the application has finished loading, using a given identifier.
GTK+ will call this function automatically for Gtk::Window with custom startup-notification identifier unless gtk_window_set_auto_startup_notification() is called to disable that feature.
#peek_event ⇒ Gdk::Event
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.) queue, or nil if no events are in the queue. The returned Gdk::Event should be freed with gdk_event_free().
#pointer_is_grabbed ⇒ TrueClass
Test if the pointer is grabbed.
#pointer_ungrab(time_) ⇒ nil
Release any pointer grab.
#primary_monitor ⇒ Gdk::Monitor
Gets the primary monitor for the display.
The primary monitor is considered the monitor where the “main desktop” lives. While normal application windows typically allow the window manager to place the windows, specialized desktop applications such as panels should place themselves on the primary monitor.
#put_event(event) ⇒ nil
Appends a copy of the given event onto the front of the event queue for display.
#request_selection_notification(selection) ⇒ TrueClass
Request Gdk::EventOwnerChange events for ownership changes of the selection named by the given atom.
#store_clipboard(clipboard_window, time_, targets, n_targets) ⇒ nil
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](www.freedesktop.org/Standards/clipboard-manager-spec).
#supports_clipboard_persistence ⇒ TrueClass
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.
#supports_composite ⇒ TrueClass
Returns true if gdk_window_set_composited() can be used to redirect drawing on the window using compositing.
Currently this only works on X11 with XComposite and XDamage extensions available.
#supports_cursor_alpha ⇒ TrueClass
Returns true if cursors can use an 8bit alpha channel on display. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).
#supports_cursor_color ⇒ TrueClass
Returns true if multicolored cursors are supported on display. Otherwise, cursors have only a forground and a background color.
#supports_input_shapes ⇒ TrueClass
Returns true if gdk_window_input_shape_combine_mask() can be used to modify the input shape of windows on display.
#supports_selection_notification ⇒ TrueClass
Returns whether Gdk::EventOwnerChange events will be sent when the owner of a selection changes.
#supports_shapes ⇒ TrueClass
Returns true if gdk_window_shape_combine_mask() can be used to create shaped windows on display.
#sync ⇒ nil
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 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.
#warp_pointer(screen, x, y) ⇒ nil
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.