package Gdk_Event_Type_Properties is new Generic_Internal_Discrete_Property (Gdk_Event_Type);
package Gdk_Event_Mask_Properties is new Generic_Internal_Discrete_Property (Gdk_Event_Mask);
package Gdk_Visibility_State_Properties is new Generic_Internal_Discrete_Property (Gdk_Visibility_State);
package Gdk_Scroll_Direction_Properties is new Generic_Internal_Discrete_Property (Gdk_Scroll_Direction);
package Gdk_Notify_Type_Properties is new Generic_Internal_Discrete_Property (Gdk_Notify_Type);
package Gdk_Crossing_Mode_Properties is new Generic_Internal_Discrete_Property (Gdk_Crossing_Mode);
package Gdk_Property_State_Properties is new Generic_Internal_Discrete_Property (Gdk_Property_State);
package Gdk_Window_State_Properties is new Generic_Internal_Discrete_Property (Gdk_Window_State);
package Gdk_Setting_Action_Properties is new Generic_Internal_Discrete_Property (Gdk_Setting_Action);
package Gdk_Owner_Change_Properties is new Generic_Internal_Discrete_Property (Gdk_Owner_Change);
type Gdk_Event_Type is ( Nothing, Delete, Destroy, Expose, Motion_Notify, Button_Press, Gdk_2button_Press, Gdk_3button_Press, Button_Release, Key_Press, Key_Release, Enter_Notify, Leave_Notify, Focus_Change, Configure, Map, Unmap, Property_Notify, Selection_Clear, Selection_Request, Selection_Notify, Proximity_In, Proximity_Out, Drag_Enter, Drag_Leave, Drag_Motion, Drag_Status, Drop_Start, Drop_Finished, Client_Event, Visibility_Notify, Scroll, Window_State, Setting, Owner_Change, Grab_Broken, Damage, Touch_Begin, Touch_Update, Touch_End, Touch_Cancel);
type Gdk_Visibility_State is ( Visibility_Unobscured, Visibility_Partial, Visibility_Fully_Obscured);
type Gdk_Scroll_Direction is ( Scroll_Up, Scroll_Down, Scroll_Left, Scroll_Right, Scroll_Smooth);
type Gdk_Notify_Type is ( Notify_Ancestor, Notify_Virtual, Notify_Inferior, Notify_Nonlinear, Notify_Nonlinear_Virtual, Notify_Unknown);
type Gdk_Crossing_Mode is ( Crossing_Normal, Crossing_Grab, Crossing_Ungrab, Crossing_Gtk_Grab, Crossing_Gtk_Ungrab, Crossing_State_Changed, Crossing_Touch_Begin, Crossing_Touch_End, Crossing_Device_Switch);
type Gdk_Setting_Action is ( Setting_Action_New, Setting_Action_Changed, Setting_Action_Deleted);
type Gdk_Owner_Change is ( Owner_Change_New_Owner, Owner_Change_Destroy, Owner_Change_Close);
type Gdk_Event_Any is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; end record;
type Gdk_Event_Button is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Time : Guint32; X : Gdouble; Y : Gdouble; Axes : access Gdouble; State : Gdk.Types.Gdk_Modifier_Type; Button : Guint; Device : System.Address; X_Root : Gdouble; Y_Root : Gdouble; end record;
type Gdk_Event_Expose is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Area : Gdk.Rectangle.Gdk_Rectangle; Region : Cairo.Region.Cairo_Region; Count : Gint; end record;
type Gdk_Event_Visibility is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; State : Gdk_Visibility_State; end record;
type Gdk_Event_Motion is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Time : Guint32; X : Gdouble; Y : Gdouble; Axes : access Gdouble; State : Gdk.Types.Gdk_Modifier_Type; Is_Hint : Gint16; Device : System.Address; X_Root : Gdouble; Y_Root : Gdouble; end record;
type Gdk_Event_Scroll is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Time : Guint32; X : Gdouble; Y : Gdouble; State : Gdk.Types.Gdk_Modifier_Type; Direction : Gdk_Scroll_Direction; Device : System.Address; X_Root : Gdouble; Y_Root : Gdouble; Delta_X : Gdouble; Delta_Y : Gdouble; end record;
type Gdk_Event_Key is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Time : Guint32; State : Gdk.Types.Gdk_Modifier_Type; Keyval : Gdk.Types.Gdk_Key_Type; Length : Gint; String : Interfaces.C.Strings.chars_ptr; Hardware_Keycode : Guint16; Group : Guint8; Is_Modifier : Guint; end record;
type Gdk_Event_Crossing is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Subwindow : Gdk.Gdk_Window; Time : Guint32; X : Gdouble; Y : Gdouble; X_Root : Gdouble; Y_Root : Gdouble; Mode : Gdk_Crossing_Mode; Detail : Gdk_Notify_Type; Focus : Boolean; State : Gdk.Types.Gdk_Modifier_Type; end record;
type Gdk_Event_Focus is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Gtk_In : Gint16; end record;
type Gdk_Event_Configure is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; X : Gint; Y : Gint; Width : Gint; Height : Gint; end record;
type Gdk_Event_Property is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Atom : Gdk.Types.Gdk_Atom; Time : Guint32; State : Gdk_Property_State; end record;
type Gdk_Event_Selection is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Selection : Gdk.Types.Gdk_Atom; Target : Gdk.Types.Gdk_Atom; Property : Gdk.Types.Gdk_Atom; Time : Guint32; Requestor : Gdk.Gdk_Window; end record;
type Gdk_Event_Owner_Change is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Owner : Gdk.Gdk_Window; Reason : Gdk_Owner_Change; Selection : Gdk.Types.Gdk_Atom; Time : Guint32; Selection_Time : Guint32; end record;
type Gdk_Event_Proximity is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Time : Guint32; Device : System.Address; end record;
type Gdk_Event_DND is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Context : System.Address; Time : Guint32; X_Root : Gshort; Y_Root : Gshort; end record;
type Gdk_Event_Window_State is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Changed_Mask : Gdk_Window_State; New_Window_State : Gdk_Window_State; end record;
type Gdk_Event_Setting is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Action : Gdk_Setting_Action; Name : Interfaces.C.Strings.chars_ptr; end record;
type Gdk_Event_Touch is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Time : Guint32; X : Gdouble; Y : Gdouble; Axes : access Gdouble; State : Gdk.Types.Gdk_Modifier_Type; Sequence : System.Address; Emulating_Pointer : Boolean; Device : System.Address; X_Root : Gdouble; Y_Root : Gdouble; end record;
type Gdk_Event_Sequence is new Glib.C_Proxy;
type Gdk_Event_Grab_Broken is record The_Type : Gdk_Event_Type; Window : Gdk.Gdk_Window; Send_Event : Gint8; Keyboard : Boolean; Implicit : Boolean; Grab_Window : Gdk.Gdk_Window; end record;
type Gdk_Event_Record (The_Type : Gdk_Event_Type := Gdk.Event.Nothing) is record case The_Type is when Gdk.Event.Nothing | Gdk.Event.Delete | Gdk.Event.Destroy | Gdk.Event.Map | Gdk.Event.Unmap | Gdk.Event.Client_Event => Any : Gdk_Event_Any; when Gdk.Event.Expose | Gdk.Event.Damage => Expose : Gdk_Event_Expose; when Gdk.Event.Visibility_Notify => Visibility : Gdk_Event_Visibility; when Gdk.Event.Motion_Notify => Motion : Gdk_Event_Motion; when Gdk.Event.Button_Press | Gdk.Event.Gdk_2button_Press | Gdk.Event.Gdk_3button_Press | Gdk.Event.Button_Release => Button : Gdk_Event_Button; when Gdk.Event.Touch_Begin | Gdk.Event.Touch_Update | Gdk.Event.Touch_End | Gdk.Event.Touch_Cancel => Touch : Gdk_Event_Touch; when Gdk.Event.Scroll => Scroll : Gdk_Event_Scroll; when Gdk.Event.Key_Press | Gdk.Event.Key_Release => Key : Gdk_Event_Key; when Gdk.Event.Enter_Notify | Gdk.Event.Leave_Notify => Crossing : Gdk_Event_Crossing; when Gdk.Event.Focus_Change => Focus_Change : Gdk_Event_Focus; when Gdk.Event.Configure => Configure : Gdk_Event_Configure; when Gdk.Event.Property_Notify => Property : Gdk_Event_Property; when Gdk.Event.Selection_Clear | Gdk.Event.Selection_Request | Gdk.Event.Selection_Notify => Selection : Gdk_Event_Selection; when Gdk.Event.Owner_Change => Owner_Change : Gdk_Event_Owner_Change; when Gdk.Event.Proximity_In | Gdk.Event.Proximity_Out => Proximity : Gdk_Event_Proximity; when Gdk.Event.Drag_Enter | Gdk.Event.Drag_Leave | Gdk.Event.Drag_Motion | Gdk.Event.Drag_Status | Gdk.Event.Drop_Start | Gdk.Event.Drop_Finished => Dnd : Gdk_Event_DND; when Gdk.Event.Window_State => Window_State : Gdk_Event_Window_State; when Gdk.Event.Setting => Setting : Gdk_Event_Setting; when Gdk.Event.Grab_Broken => Grab_Broken : Gdk_Event_Grab_Broken; end case; end record;
type Gdk_Event is access all Gdk_Event_Record;
type Gdk_Event_Func is access procedure (Event : Gdk_Event);
type Property_Gdk_Event_Type is new Gdk_Event_Type_Properties.Property;
type Property_Gdk_Event_Mask is new Gdk_Event_Mask_Properties.Property;
type Property_Gdk_Visibility_State is new Gdk_Visibility_State_Properties.Property;
type Property_Gdk_Scroll_Direction is new Gdk_Scroll_Direction_Properties.Property;
type Property_Gdk_Notify_Type is new Gdk_Notify_Type_Properties.Property;
type Property_Gdk_Crossing_Mode is new Gdk_Crossing_Mode_Properties.Property;
type Property_Gdk_Property_State is new Gdk_Property_State_Properties.Property;
type Property_Gdk_Window_State is new Gdk_Window_State_Properties.Property;
type Property_Gdk_Setting_Action is new Gdk_Setting_Action_Properties.Property;
type Property_Gdk_Owner_Change is new Gdk_Owner_Change_Properties.Property;
Exposure_Mask : constant Gdk_Event_Mask := 2;
Pointer_Motion_Mask : constant Gdk_Event_Mask := 4;
Pointer_Motion_Hint_Mask : constant Gdk_Event_Mask := 8;
Button_Motion_Mask : constant Gdk_Event_Mask := 16;
Button1_Motion_Mask : constant Gdk_Event_Mask := 32;
Button2_Motion_Mask : constant Gdk_Event_Mask := 64;
Button3_Motion_Mask : constant Gdk_Event_Mask := 128;
Button_Press_Mask : constant Gdk_Event_Mask := 256;
Button_Release_Mask : constant Gdk_Event_Mask := 512;
Key_Press_Mask : constant Gdk_Event_Mask := 1024;
Key_Release_Mask : constant Gdk_Event_Mask := 2048;
Enter_Notify_Mask : constant Gdk_Event_Mask := 4096;
Leave_Notify_Mask : constant Gdk_Event_Mask := 8192;
Focus_Change_Mask : constant Gdk_Event_Mask := 16384;
Structure_Mask : constant Gdk_Event_Mask := 32768;
Property_Change_Mask : constant Gdk_Event_Mask := 65536;
Visibility_Notify_Mask : constant Gdk_Event_Mask := 131072;
Proximity_In_Mask : constant Gdk_Event_Mask := 262144;
Proximity_Out_Mask : constant Gdk_Event_Mask := 524288;
Substructure_Mask : constant Gdk_Event_Mask := 1048576;
Scroll_Mask : constant Gdk_Event_Mask := 2097152;
Touch_Mask : constant Gdk_Event_Mask := 4194304;
Smooth_Scroll_Mask : constant Gdk_Event_Mask := 8388608;
All_Events_Mask : constant Gdk_Event_Mask := 16777214;
Window_State_Withdrawn : constant Gdk_Window_State := 1;
Window_State_Iconified : constant Gdk_Window_State := 2;
Window_State_Maximized : constant Gdk_Window_State := 4;
Window_State_Sticky : constant Gdk_Window_State := 8;
Window_State_Fullscreen : constant Gdk_Window_State := 16;
Window_State_Above : constant Gdk_Window_State := 32;
Window_State_Below : constant Gdk_Window_State := 64;
Window_State_Focused : constant Gdk_Window_State := 128;
Double_Button_Press : constant Gdk_Event_Type := Gdk_2button_Press;
Triple_Button_Press : constant Gdk_Event_Type := Gdk_3button_Press;
function From_Object_Free
( | B | : access Gdk_Event_Any) return Gdk_Event_Any; |
function From_Object_Free
( | B | : access Gdk_Event_Button) return Gdk_Event_Button; |
function From_Object_Free
( | B | : access Gdk_Event_Expose) return Gdk_Event_Expose; |
function From_Object_Free
( | B | : access Gdk_Event_Visibility) return Gdk_Event_Visibility; |
function From_Object_Free
( | B | : access Gdk_Event_Motion) return Gdk_Event_Motion; |
function From_Object_Free
( | B | : access Gdk_Event_Scroll) return Gdk_Event_Scroll; |
function From_Object_Free
( | B | : access Gdk_Event_Key) return Gdk_Event_Key; |
function From_Object_Free
( | B | : access Gdk_Event_Crossing) return Gdk_Event_Crossing; |
function From_Object_Free
( | B | : access Gdk_Event_Focus) return Gdk_Event_Focus; |
function From_Object_Free
( | B | : access Gdk_Event_Configure) return Gdk_Event_Configure; |
function From_Object_Free
( | B | : access Gdk_Event_Property) return Gdk_Event_Property; |
function From_Object_Free
( | B | : access Gdk_Event_Selection) return Gdk_Event_Selection; |
function From_Object_Free
( | B | : access Gdk_Event_Owner_Change) return Gdk_Event_Owner_Change; |
function From_Object_Free
( | B | : access Gdk_Event_Proximity) return Gdk_Event_Proximity; |
function From_Object_Free
( | B | : access Gdk_Event_DND) return Gdk_Event_DND; |
function From_Object_Free
( | B | : access Gdk_Event_Window_State) return Gdk_Event_Window_State; |
function From_Object_Free
( | B | : access Gdk_Event_Setting) return Gdk_Event_Setting; |
function From_Object_Free
( | B | : access Gdk_Event_Touch) return Gdk_Event_Touch; |
function From_Object_Free
( | B | : access Gdk_Event_Sequence) return Gdk_Event_Sequence; |
function From_Object_Free
( | B | : access Gdk_Event_Grab_Broken) return Gdk_Event_Grab_Broken; |
function From_Object_Free
( | B | : access Gdk_Event_Record) return Gdk_Event_Record; |
procedure Gdk_New
( | Event | : out Gdk_Event; |
The_Type | : Gdk_Event_Type); |
function Gdk_Event_New
( | The_Type | : Gdk_Event_Type) return Gdk_Event; |
function Get_Type return Glib.GType;
function Get_Center
( | Event | : Gdk_Event; |
Event2 | : Gdk_Event; | |
X | : access Gdouble; | |
Y | : access Gdouble) return Boolean; |
procedure Free
( | Event | : Gdk_Event); |
procedure Get_Axis
( | Event | : Gdk_Event; |
Axis_Use | : Gdk_Axis_Use; | |
Value | : out Gdouble); |
function Get_Event_Sequence
( | Event | : Gdk_Event) return System.Address; |
procedure Get_Scroll_Direction
( | Event | : Gdk_Event; |
Direction | : out Gdk_Scroll_Direction); |
procedure Put
( | Event | : Gdk_Event); |
function Triggers_Context_Menu
( | Event | : Gdk_Event) return Boolean; |
function Get_State
( | Event | : Gdk_Event) return Gdk.Types.Gdk_Modifier_Type; |
function Get_Key_Val
( | Event | : Gdk_Event) return Gdk.Types.Gdk_Key_Type; |
function Get_Event_Type
( | Event | : Gdk_Event) return Gdk_Event_Type; |
function Get_Window
( | Event | : Gdk_Event) return Gdk.Gdk_Window; |
procedure Handler_Set
( | Func | : Gdk_Event_Func; |
Notify | : Glib.G_Destroy_Notify_Address); |
function From_Address
( | C | : System.Address) return Gdk_Event; |
function To_Address
( | C | : Gdk_Event) return System.Address; |
function Get_Event
( | Value | : Glib.Values.GValue) return Gdk_Event; |
function To_Event
( | Event | : access Gdk_Event_Button) return Gdk_Event; |
function To_Event
( | Event | : access Gdk_Event_Key) return Gdk_Event; |
function Get return Gdk_Event;
function Peek return Gdk_Event;
procedure Request_Motions
( | Event | : Gdk_Event_Motion); |
function Events_Pending return Boolean;
The Gdk.Event.Gdk_Event struct contains a union of all of the event structs, and allows access to the data fields in a number of ways.
The event type is always the first field in all of the event structs, and can always be accessed with the following code, no matter what type of event it is: GdkEvent *event; GdkEventType type; type = event->type; To access other fields of the event structs, the pointer to the event can be cast to the appropriate event struct pointer, or the union member name can be used. For example if the event type is Gdk.Event.Button_Press then the x coordinate of the button press can be accessed with: GdkEvent *event; gdouble x; x = ((GdkEventButton*)event)->x; or: GdkEvent *event; gdouble x; x = event->button.x;