Libraries:Gtk:Gdk:Display
Types
T
Inherits from:T objects purpose are two fold:
-
To grab/ungrab keyboard focus and mouse pointer
-
To manage and provide information about the Gtk.Gdk.Screen.T(s) available for this T
T 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 Gtk.Gdk.Screen.T objects currently instanciated by the application. It is also used to grab and release the keyboard and the mouse pointer.
Constants
Nil : T
Functions
GetDefault() : Gtk.Gdk.Display.T
Gets the default T. This is a convenience function for gdk_display_manager_get_default_display (gdk_display_manager_get()).
GetType() : Gtk.GObject.Type.T
Open(display_name @ Std.String.T) : Gtk.Gdk.Display.T
Opens a display.
display_name | the name of the display to open |
Returns | a T, or NULL if the display could not be opened. |
OpenDefaultLibgtkOnly() : Gtk.Gdk.Display.T
Methods
:AddClientMessageFilter(self @ T, message_type @ Gtk.Gdk.Atom.T, func @ Std.Function.T, data @ Std.Address.T) : Std.Object.T
Adds a filter to be called when X ClientMessage events are received. See Gtk.Gdk.Window.AddFilter if you are interested in filtering other types of events.
display | a T for which this message filter applies |
message_type | the type of ClientMessage events to receive. This will be checked against the message_type field of the XClientMessage event struct. |
func | the function to call to process the event. |
data | user data to pass to func. |
:Beep(self @ T) : Std.Object.T
:ButtonClickTime(self @ T, index @ Std.Integer.T) : Std.Integer.SmallT
:ButtonNumber(self @ T, index @ Std.Integer.T) : Std.Integer.SmallT
:ButtonWindow(self @ T, index @ Std.Integer.T) : Gtk.Gdk.Window.T
:ButtonX(self @ T, index @ Std.Integer.T) : Std.Integer.SmallT
:ButtonY(self @ T, index @ Std.Integer.T) : Std.Integer.SmallT
:Close(self @ T) : Std.Object.T
Closes the connection to the windowing system for the given display, and cleans up associated resources.
display | a T |
:Flush(self @ T) : Std.Object.T
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.
display | a T |
:GetCorePointer(self @ T) : Gtk.Gdk.Device.T
:GetDefaultCursorSize(self @ T) : Std.Integer.SmallT
Returns the default size to use for cursors on display.
display | a T |
Returns | the default cursor size. |
:GetDefaultGroup(self @ T) : Gtk.Gdk.Window.T
Returns the default group leader window for all toplevel windows on display. This window is implicitly created by GDK. See Gtk.Gdk.Window.SetGroup.
display | a T |
Returns | The default group leader window for display |
:GetDefaultScreen(self @ T) : Gtk.Gdk.Screen.T
Get the default Gtk.Gdk.Screen.T for display.
display | a T |
Returns | the default Gtk.Gdk.Screen.T object for display |
:GetEvent(self @ T) : Gtk.Gdk.Event.T
Gets the next GdkEvent to be processed for display, fetching events from the windowing system if necessary.
display | a T |
Returns | the next GdkEvent to be processed, or NULL if no events are pending. The returned GdkEvent should be freed with Gtk.Gdk.Event.Free. |
:GetMaximalCursorSize(self @ T, width @ Std.Object.T, height @ Std.Object.T) : Std.Object.T
Gets the maximal size to use for cursors on display.
display | a T |
width | the return location for the maximal cursor width |
height | the return location for the maximal cursor height |
:GetNScreens(self @ T) : Std.Integer.SmallT
:GetName(self @ T) : Std.String.T
Gets the name of the display.
display | a T |
Returns | a string representing the display name. This string is owned by GDK and should not be modified or freed. |
:GetPointer(self @ T, screen @ Std.Object.T, x @ Std.Object.T, y @ Std.Object.T, mask @ Std.Object.T) : Std.Object.T
Gets the current location of the pointer and the current modifier mask for a given display.
display | a T |
screen | location to store the screen that the cursor is on, or NULL. [out][allow-none] |
x | location to store root window X coordinate of pointer, or NULL. [out][allow-none] |
y | location to store root window Y coordinate of pointer, or NULL. [out][allow-none] |
mask | location to store current modifier mask, or NULL. [out][allow-none] |
:GetScreen(self @ T, screen_num @ Std.Integer.SmallT) : Gtk.Gdk.Screen.T
Returns a screen object for one of the screens of the display.
display | a T |
screen_num | the screen number |
Returns | the Gtk.Gdk.Screen.T object |
:GetWindowAtPointer(self @ T, win_x @ Std.Object.T, win_y @ Std.Object.T) : Gtk.Gdk.Window.T
Obtains the window underneath the mouse pointer, returning the location of the pointer in that window in win_x, win_y for screen. Returns NULL if the window under the mouse pointer is not known to GDK (for example, belongs to another application).
display | a T |
win_x | return location for x coordinate of the pointer location relative to the window origin, or NULL. [out][allow-none] |
win_y | return location for y coordinate of the pointer location relative & to the window origin, or NULL. [out][allow-none] |
Returns | the window under the mouse pointer, or NULL. [transfer none] |
:IsClosed(self @ T) : Std.Symbol.T
:KeyboardUngrab(self @ T, time_ @ Std.Integer.SmallT) : Std.Object.T
:ListDevices(self @ T) : Std.Object.T
Returns the list of available input devices attached to display. The list is statically allocated and should not be freed.
display | a T |
Returns | a list of Gtk.Gdk.Device.T |
:PeekEvent(self @ T) : Gtk.Gdk.Event.T
Gets a copy of the first GdkEvent 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.)
display | a T |
Returns | a copy of the first GdkEvent on the event queue, or NULL if no events are in the queue. The returned GdkEvent should be freed with Gtk.Gdk.Event.Free. |
:PointerIsGrabbed(self @ T) : Std.Symbol.T
:PointerUngrab(self @ T, time_ @ Std.Integer.SmallT) : Std.Object.T
:PutEvent(self @ T, event @ Gtk.Gdk.Event.T) : Std.Object.T
Appends a copy of the given event onto the front of the event queue for display.
:RequestSelectionNotification(self @ T, selection @ Gtk.Gdk.Atom.T) : Std.Symbol.T
Request Gtk.Gdk.EventOwnerChange.T events for ownership changes of the selection named by the given atom.
display | a T |
selection | the Gtk.Gdk.Atom.T naming the selection for which ownership change notification is requested |
Returns | whether Gtk.Gdk.EventOwnerChange.T events will be sent. |
:SetDoubleClickDistance(self @ T, distance @ Std.Integer.SmallT) : Std.Object.T
Sets the double click distance (two clicks within this distance count as a double click and result in a Gtk.Gdk.EventType.TwoButtonPress event). See also SetDoubleClickTime. Applications should not set this, it is a global user-configured setting.
display | a T |
distance | distance in pixels |
:SetDoubleClickTime(self @ T, msec @ Std.Integer.SmallT) : Std.Object.T
Sets the double click time (two clicks within this time interval count as a double click and result in a Gtk.Gdk.EventType.TwoButtonPress event). Applications should not set this, it is a global user-configured setting.
display | a T |
msec | double click time in milliseconds (thousandths of a second) |
:SetPointerHooks(self @ T, new_hooks @ Gtk.Gdk.DisplayPointerHooks.T) : Gtk.Gdk.DisplayPointerHooks.T
Warning
SetPointerHooks has been deprecated since version 2.24 and should not be used in newly-written code. This function will go away in GTK 3 for lack of use cases.
:StoreClipboard(self @ T, clipboard_window @ Gtk.Gdk.Window.T, time_ @ Std.Integer.SmallT, targets @ Gtk.Gdk.Atom.T, n_targets @ Std.Integer.SmallT) : Std.Object.T
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.
display | a T |
clipboard_window | a Gtk.Gdk.Window.T belonging to the clipboard owner |
time_ | a timestamp |
targets | an array of targets that should be saved, or NULL if all available targets should be saved. |
n_targets | length of the targets array |
:SupportsClipboardPersistence(self @ T) : Std.Symbol.T
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.
display | a T |
Returns | TRUE if the display supports clipboard persistance. |
:SupportsComposite(self @ T) : Std.Symbol.T
Returns TRUE if Gtk.Gdk.Window.SetComposited can be used to redirect drawing on the window using compositing.
Currently this only works on X11 with XComposite and XDamage extensions available.
display | a T |
Returns | TRUE if windows may be composited. |
:SupportsCursorAlpha(self @ T) : Std.Symbol.T
Returns TRUE if cursors can use an 8bit alpha channel on display. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).
display | a T |
Returns | whether cursors can have alpha channels. |
:SupportsCursorColor(self @ T) : Std.Symbol.T
Returns TRUE if multicolored cursors are supported on display. Otherwise, cursors have only a forground and a background color.
display | a T |
Returns | whether cursors can have multiple colors. |
:SupportsInputShapes(self @ T) : Std.Symbol.T
Returns TRUE if Gtk.Gdk.Window.InputShapeCombineMask can be used to modify the input shape of windows on display.
display | a T |
Returns | TRUE if windows with modified input shape are supported |
:SupportsSelectionNotification(self @ T) : Std.Symbol.T
Returns whether Gtk.Gdk.EventOwnerChange.T events will be sent when the owner of a selection changes.
display | a T |
Returns | whether Gtk.Gdk.EventOwnerChange.T events will be sent. |
:SupportsShapes(self @ T) : Std.Symbol.T
Returns TRUE if Gtk.Gdk.Window.ShapeCombineMask can be used to create shaped windows on display.
display | a T |
Returns | TRUE if shaped windows are supported |
:Sync(self @ T) : Std.Object.T
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 Gtk.Gdk.Error.TrapPop 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.
display | a T |
:WarpPointer(self @ T, screen @ Gtk.Gdk.Screen.T, x @ Std.Integer.SmallT, y @ Std.Integer.SmallT) : Std.Object.T
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 GtkColorSelectionDialog.
display | a T |
screen | the screen of display to warp the pointer to |
x | the x coordinate of the destination |
y | the y coordinate of the destination |