Libraries:Gtk:Gdk:Event
Types
T
Constants
Nil : T
Functions
Copy(event @ Gtk.Gdk.Event.T) : Gtk.Gdk.Event.T
Copies a GdkEvent, copying or incrementing the reference count of the resources associated with it (e.g. Gtk.Gdk.Window.T's and strings).
Free(event @ Gtk.Gdk.Event.T) : Std.Object.T
Frees a GdkEvent, freeing or decrementing any resources associated with it. Note that this function should only be called with events returned from functions such as Peek, Get, GetGraphicsExpose and Copy and New.
event | a GdkEvent. |
Get() : Gtk.Gdk.Event.T
Checks all open displays for a GdkEvent to process,to be processed on, fetching events from the windowing system if necessary. See Gtk.Gdk.Display.GetEvent.
Returns | the next GdkEvent to be processed, or NULL if no events are pending. The returned GdkEvent should be freed with Free. |
GetAxis(event @ Gtk.Gdk.Event.T, axis_use @ Gtk.Gdk.AxisUse.T, value @ Std.Object.T) : Std.Symbol.T
Extract the axis value for a particular axis use from an event structure.
event | a GdkEvent |
axis_use | the axis use to look for |
value | location to store the value found. [out] |
Returns | TRUE if the specified axis was found, otherwise FALSE |
GetCoords(event @ Gtk.Gdk.Event.T, x_win @ Std.Object.T, y_win @ Std.Object.T) : Std.Symbol.T
Extract the event window relative x/y coordinates from an event.
event | a GdkEvent |
x_win | location to put event window x coordinate. [out] |
y_win | location to put event window y coordinate. [out] |
Returns | TRUE if the event delivered event window coordinates |
GetGraphicsExpose(window @ Gtk.Gdk.Window.T) : Gtk.Gdk.Event.T
Warning
GetGraphicsExpose has been deprecated since version 2.18 and should not be used in newly-written code.
GetRootCoords(event @ Gtk.Gdk.Event.T, x_root @ Std.Object.T, y_root @ Std.Object.T) : Std.Symbol.T
Extract the root window relative x/y coordinates from an event.
event | a GdkEvent |
x_root | location to put root window x coordinate. [out] |
y_root | location to put root window y coordinate. [out] |
Returns | TRUE if the event delivered root window coordinates |
GetScreen(event @ Gtk.Gdk.Event.T) : Gtk.Gdk.Screen.T
Returns the screen for the event. The screen is typically the screen for event->any.window, but for events such as mouse events, it is the screen where the pointer was when the event occurs - that is, the screen which has the root window to which event->motion.x_root and event->motion.y_root are relative.
event | a GdkEvent |
Returns | the screen for the event |
GetState(event @ Gtk.Gdk.Event.T, state @ Std.Object.T) : Std.Symbol.T
If the event contains a "state" field, puts that field in state. Otherwise stores an empty state (0). Returns TRUE if there was a state field in the event. event may be NULL, in which case it's treated as if the event had no state field.
event | a GdkEvent or NULL |
state | return location for state. [out] |
Returns | TRUE if there was a state field in the event |
GetTime(event @ Gtk.Gdk.Event.T) : Std.Integer.SmallT
Returns the time stamp from event, if there is one; otherwise returns GDK_CURRENT_TIME. If event is NULL, returns GDK_CURRENT_TIME.
event | a GdkEvent |
Returns | time stamp field from event |
GetType() : Gtk.GObject.Type.T
HandlerSet(func @ Std.Function.T, data @ Std.Address.T, notify @ Std.Function.T) : Std.Object.T
Sets the function to call to handle all events from GDK.
Note that GTK+ uses this to install its own event handler, so it is usually not useful for GTK+ applications. (Although an application can call this function then call gtk_main_do_event() to pass events to GTK+.)
func | the function to call to handle events from GDK. |
data | user data to pass to the function. |
notify | the function to call when the handler function is removed, i.e. when HandlerSet is called with another event handler. |
New(type @ Gtk.Gdk.EventType.T) : Gtk.Gdk.Event.T
Creates a new event of the given type. All fields are set to 0.
type | a Gtk.Gdk.EventType.T |
Returns | a newly-allocated GdkEvent. The returned GdkEvent should be freed with Free. |
Peek() : Gtk.Gdk.Event.T
If there is an event waiting in the event queue of some open display, returns a copy of it. See Gtk.Gdk.Display.PeekEvent.
Returns | a copy of the first GdkEvent on some event queue, or NULL if no events are in any queues. The returned GdkEvent should be freed with Free. |
Put(event @ Gtk.Gdk.Event.T) : Std.Object.T
Appends a copy of the given event onto the front of the event queue for event->any.window's display, or the default event queue if event->any.window is NULL. See Gtk.Gdk.Display.PutEvent.
event | a GdkEvent. |
RequestMotions(event @ Gtk.Gdk.EventMotion.T) : Std.Object.T
Request more motion notifies if event is a motion notify hint event. This function should be used instead of Gtk.Gdk.Window.GetPointer to request further motion notifies, because it also works for extension events where motion notifies are provided for devices other than the core pointer. Coordinate extraction, processing and requesting more motion events from a Gtk.Gdk.EventType.MotionNotify event usually works like this:
1 2 3 4 5 6 7 |
{ /* motion_event handler */ x = motion_event->x; y = motion_event->y; /* handle (x,y) motion */ gdk_event_request_motions (motion_event); /* handles is_hint events */ } |
SendClientMessage(event @ Gtk.Gdk.Event.T, winid @ Std.Integer.SmallT) : Std.Symbol.T
Sends an X ClientMessage event to a given window (which must be on the default Gtk.Gdk.Display.T.) This could be used for communicating between different applications, though the amount of data is limited to 20 bytes.
event | the GdkEvent to send, which should be a Gtk.Gdk.EventClient.T. |
winid | the window to send the X ClientMessage event to. |
Returns | non-zero on success. |
SendClientMessageForDisplay(display @ Gtk.Gdk.Display.T, event @ Gtk.Gdk.Event.T, winid @ Std.Integer.SmallT) : Std.Symbol.T
On X11, sends an X ClientMessage event to a given window. On Windows, sends a message registered with the name GDK_WIN32_CLIENT_MESSAGE.
This could be used for communicating between different applications, though the amount of data is limited to 20 bytes on X11, and to just four bytes on Windows.
display | the Gtk.Gdk.Display.T for the window where the message is to be sent. |
event | the GdkEvent to send, which should be a Gtk.Gdk.EventClient.T. |
winid | the window to send the client message to. |
Returns | non-zero on success. |
SendClientmessageToall(event @ Gtk.Gdk.Event.T) : Std.Object.T
Sends an X ClientMessage event to all toplevel windows on the default Gtk.Gdk.Screen.T.
Toplevel windows are determined by checking for the WM_STATE property, as described in the Inter-Client Communication Conventions Manual (ICCCM). If no windows are found with the WM_STATE property set, the message is sent to all children of the root window.
event | the GdkEvent to send, which should be a Gtk.Gdk.EventClient.T. |
SetScreen(event @ Gtk.Gdk.Event.T, screen @ Gtk.Gdk.Screen.T) : Std.Object.T
Sets the screen for event to screen. The event must have been allocated by GTK+, for instance, by Copy.
event | a GdkEvent |
screen | a Gtk.Gdk.Screen.T |