function As_Button_Event
(Self : Gdk_Event'Class) return Gdk.Event.Button_Event.Gdk_Button_Event
function As_Crossing_Event
(Self : Gdk_Event'Class) return Gdk.Event.Crossing_Event.Gdk_Crossing_Event
function As_Delete_Event
(Self : Gdk_Event'Class) return Gdk.Event.Delete_Event.Gdk_Delete_Event
function As_DND_Event
(Self : Gdk_Event'Class) return Gdk.Event.DND_Event.Gdk_DND_Event
function As_Focus_Event
(Self : Gdk_Event'Class) return Gdk.Event.Focus_Event.Gdk_Focus_Event
function As_Grab_Broken_Event
(Self : Gdk_Event'Class)
return Gdk.Event.Grab_Broken_Event.Gdk_Grab_Broken_Event
function As_Key_Event
(Self : Gdk_Event'Class) return Gdk.Event.Key_Event.Gdk_Key_Event
function As_Motion_Event
(Self : Gdk_Event'Class) return Gdk.Event.Motion_Event.Gdk_Motion_Event
function As_Pad_Event
(Self : Gdk_Event'Class) return Gdk.Event.Pad_Event.Gdk_Pad_Event
function As_Proximity_Event
(Self : Gdk_Event'Class)
return Gdk.Event.Proximity_Event.Gdk_Proximity_Event
function As_Scroll_Event
(Self : Gdk_Event'Class) return Gdk.Event.Scroll_Event.Gdk_Scroll_Event
function As_Touch_Event
(Self : Gdk_Event'Class) return Gdk.Event.Touch_Event.Gdk_Touch_Event
function As_Touchpad_Event
(Self : Gdk_Event'Class) return Gdk.Event.Touchpad_Event.Gdk_Touchpad_Event
function From_Object (Object : System.Address) return Gdk_Event
Create an Ada handle from a raw C pointer. Always acquires a reference with gdk_event_ref.
raw GdkEvent* pointer.
a reference-counted Gdk_Event handle.
type Gdk_Event is tagged private;
Opaque reference-counted wrapper around GdkEvent*.
type Gdk_Event_Sequence is new Glib.C_Proxy;
Opaque identity token for a sequence of related touch events. Unlike Gdk_Event it is not reference counted and is never owned: it is only ever compared against other sequences, so that the events of one finger can be told apart from another's.
type Gdk_Event_Type is
(Delete,
Motion_Notify,
Button_Press,
Button_Release,
Key_Press,
Key_Release,
Enter_Notify,
Leave_Notify,
…,
Event_Last);
Specifies the type of the event.
function Get_Angle
(Event_1 : Gdk_Event'Class;
Event_2 : Gdk_Event'Class;
Angle : out Glib.Gdouble) return Boolean
Returns the relative angle from @event1 to @event2.
The relative angle is the angle between the X axis and the line through both events' positions. The rotation direction for positive angles is from the positive X axis towards the positive Y axis.
This assumes that both events have X/Y information. If not, this function returns %FALSE.
first GdkEvent.
second GdkEvent.
return location for the relative angle between both events.
%TRUE if the angle could be calculated.
function Get_Axis
(Self : Gdk_Event'Class;
Axis_Use : Glib.Gint;
Value : out Glib.Gdouble) return Boolean
Extract the axis value for a particular axis use from an event structure.
To find out which axes are used, use [method@Gdk.DeviceTool.get_axes] on the device tool returned by [method@Gdk.Event.get_device_tool].
a GdkEvent.
the axis use to look for.
location to store the value found.
%TRUE if the specified axis was found, otherwise %FALSE.
function Get_Center
(Event_1 : Gdk_Event'Class;
Event_2 : Gdk_Event'Class;
X : out Glib.Gdouble;
Y : out Glib.Gdouble) return Boolean
Returns the point halfway between the events' positions.
This assumes that both events have X/Y information. If not, this function returns %FALSE.
first GdkEvent.
second GdkEvent.
return location for the X coordinate of the center.
return location for the Y coordinate of the center.
%TRUE if the center could be calculated.
function Get_Device (Self : Gdk_Event'Class) return Gdk.Device.Gdk_Device
Returns the device of an event.
a GdkEvent.
a GdkDevice.
function Get_Device_Tool
(Self : Gdk_Event'Class) return Gdk.Device_Tool.Gdk_Device_Tool
Returns a GdkDeviceTool representing the tool that caused the event.
If the was not generated by a device that supports different tools (such as a tablet), this function will return %NULL.
Note: the GdkDeviceTool will be constant during the application lifetime, if settings must be stored persistently across runs, see [method@Gdk.DeviceTool.get_serial].
a GdkEvent.
The current device tool.
function Get_Display (Self : Gdk_Event'Class) return Gdk.Display.Gdk_Display
Retrieves the display associated to the @event.
a GdkEvent.
a GdkDisplay.
function Get_Distance
(Event_1 : Gdk_Event'Class;
Event_2 : Gdk_Event'Class;
Distance : out Glib.Gdouble) return Boolean
Returns the distance between the event locations.
This assumes that both events have X/Y information. If not, this function returns %FALSE.
first GdkEvent.
second GdkEvent.
return location for the distance.
%TRUE if the distance could be calculated.
function Get_Event_Sequence
(Self : Gdk_Event'Class) return Gdk_Event_Sequence
Returns the event sequence to which the event belongs.
Related touch events are connected in a sequence. Other events typically don't have event sequence information.
a GdkEvent.
the event sequence that the event belongs to.
function Get_Event_Type (Self : Gdk_Event'Class) return Gdk_Event_Type
Retrieves the type of the event.
a GdkEvent.
a GdkEventType.
function Get_Modifier_State
(Self : Gdk_Event'Class) return Gdk.Enums.Gdk_Modifier_Type
Returns the modifier state field of an event.
a GdkEvent.
the modifier state of @event.
function Get_Object (Self : Gdk_Event'Class) return System.Address
Returns the underlying GdkEvent* pointer.
a Gdk_Event wrapper.
the wrapped GdkEvent* pointer.
function Get_Pointer_Emulated (Self : Gdk_Event'Class) return Boolean
Returns whether this event is an 'emulated' pointer event.
Emulated pointer events typically originate from a touch events.
a GdkEvent.
%TRUE if this event is emulated.
function Get_Position
(Self : Gdk_Event'Class;
X : out Glib.Gdouble;
Y : out Glib.Gdouble) return Boolean
Extract the event surface relative x/y coordinates from an event.
This position is in surface coordinates.
a GdkEvent.
location to put event surface x coordinate.
location to put event surface y coordinate.
whether the positions were set.
function Get_Seat (Self : Gdk_Event'Class) return Gdk.Gdk_Seat
Returns the seat that originated the event.
a GdkEvent.
a GdkSeat.
function Get_Surface (Self : Gdk_Event'Class) return Gdk.Surface.Gdk_Surface
Extracts the surface associated with an event.
a GdkEvent.
The GdkSurface associated with the event.
function Get_Time (Self : Gdk_Event'Class) return Glib.Guint32
Returns the timestamp of @event.
Not all events have timestamps. In that case, this function returns %GDK_CURRENT_TIME.
a GdkEvent.
timestamp field from @event.
function Get_Type return Glib.GType
Returns the GType for GdkEvent.
the GType for GdkEvent.
function Is_Button_Event (Self : Gdk_Event'Class) return Boolean
function Is_Crossing_Event (Self : Gdk_Event'Class) return Boolean
function Is_Delete_Event (Self : Gdk_Event'Class) return Boolean
function Is_DND_Event (Self : Gdk_Event'Class) return Boolean
function Is_Focus_Event (Self : Gdk_Event'Class) return Boolean
function Is_Grab_Broken_Event (Self : Gdk_Event'Class) return Boolean
function Is_Key_Event (Self : Gdk_Event'Class) return Boolean
function Is_Motion_Event (Self : Gdk_Event'Class) return Boolean
function Is_Null (Self : Gdk_Event'Class) return Boolean
Returns True if Self does not wrap a GdkEvent*.
a Gdk_Event wrapper.
True if the wrapped pointer is null.
function Is_Pad_Event (Self : Gdk_Event'Class) return Boolean
function Is_Proximity_Event (Self : Gdk_Event'Class) return Boolean
function Is_Scroll_Event (Self : Gdk_Event'Class) return Boolean
function Is_Touch_Event (Self : Gdk_Event'Class) return Boolean
function Is_Touchpad_Event (Self : Gdk_Event'Class) return Boolean
procedure Set_Object
(Self : in out Gdk_Event'Class;
Object : System.Address)
Assign a raw C pointer to Self. Releases any previous pointer in Self. Always acquires a reference on Object.
destination wrapper that receives the new pointer.
raw GdkEvent* pointer to assign.
function Triggers_Context_Menu (Self : Gdk_Event'Class) return Boolean
Returns whether a GdkEvent should trigger a context menu, according to platform conventions.
The right mouse button typically triggers context menus. On macOS, Control+left mouse button also triggers.
This function should always be used instead of simply checking for
event->button == GDK_BUTTON_SECONDARY
a GdkEvent, currently only button events are meaningful values.
%TRUE if the event should trigger a context menu.