### ----------------------------------------------------
### -- Gnome::Gdk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gdk3/Events.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 4
 bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See B<Gnome::Gdk3::ModifierType>.
=item GdkScrollDirection $.direction: the direction to scroll to (one of C<GDK_SCROLL_UP>, C<GDK_SCROLL_DOWN>, C<GDK_SCROLL_LEFT>, C<GDK_SCROLL_RIGHT> or C<GDK_SCROLL_SMOOTH>).
=item N-GObject $.device: the master device that the event originated from. Use C<gdk_event_get_source_device()> to get the slave device.
=item C<Num()> $.x_root: the x coordinate of the pointer relative to the root of the screen.
=item C<Num()> $.y_root: the y coordinate of the pointer relative to the root of the screen.
=item C<Num()> $.delta_x: the x coordinate of the scroll delta
=item C<Num()> $.delta_y: the y coordinate of the scroll delta


=end pod

#TT:0:N-GdkEventScroll:
class N-GdkEventScroll is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has guint32 $.time;
  has gdouble $.x;
  has gdouble $.y;
  has guint $.state;
  has GEnum $.direction;
  has N-GObject $.device;
  has gdouble $.x_root;
  has gdouble $.y_root;
  has gdouble $.delta_x;
  has gdouble $.delta_y;
  has guint $.is_stop;

  submethod BUILD (
    Int:D :$type, Int() :$time, Num() :$x, Num() :$y,
    UInt() :$state, Int() :$direction, Num() :$x_root, Num() :$y_root
  ) {
    $!type = $type.value;
    $!send_event = 1;
    $!time = $time // time;

    $!x = $x // 0e0;
    $!y = $y // 0e0;
    $!state = $state // 0;
    $!direction = $direction // 0;
    $!x_root = $x_root // 0e0;
    $!y_root = $y_root  // 0e0;
  }

  submethod TWEAK ( N-GObject() :$window, N-GObject() :$device ) {
    $!window := $window if ?$window;
    $!device := $device if ?$device;
  }

  method COERCE ( $no --> N-GdkEventScroll ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventScroll, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventKey

Describes a key press or key release event.

=item C<GdkEventType> $.type: the type of the event (C<GDK_KEY_PRESS> or C<GDK_KEY_RELEASE>).
=item C<N-GObject> $.window: the window which received the event.
=item C<Int> $.send_event: C<True> if the event was sent explicitly.
=item C<UInt> $.time: the time of the event in milliseconds.
=item C<UInt> $.state: (type GdkModifierType): a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See B<Gnome::Gdk3::ModifierType>.
=item C<UInt> $.keyval: the key that was pressed or released. See the `gdk/gdkkeysyms.h` header file for a complete list of GDK key codes.
=item C<Int> $.length: the length of I<string>.
=comment item C<Str> $.string: a string containing an approximation of the text that would result from this keypress. The only correct way to handle text input of text is using input methods (see B<Gnome::Gdk3::IMContext>), C<B<I<so this field is deprecated and should never be used>>>. (C<gdk_unicode_to_keyval()> provides a non-deprecated way of getting an approximate translation for a key.) The string is encoded in the encoding of the current locale (Note: this for backwards compatibility: strings in GTK+ and GDK are typically in UTF-8.) and NUL-terminated. In some cases, the translation of the key code will be a single NUL byte, in which case looking at I<length> is necessary to distinguish it from the an empty translation.
=item C<UInt> $.hardware_keycode: the raw code of the key that was pressed or released.
=item C<UInt> $.group: the keyboard group.
=item C<Bool> is_modifier: a flag that indicates if I<hardware_keycode> is mapped to a modifier. Since 2.10

=end pod

#TT:1:N-GdkEventKey:
class N-GdkEventKey is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has guint32 $.time;
  has guint $.state;
  has guint $.keyval;
  has gint $.length = 0;             # string deprecated
  has gchar-ptr $.string;            # deprecated
  has guint16 $.hardware_keycode;
  has guint8 $.group;
  has guint $.is_modifier;

  submethod BUILD (
    Int:D :$type, Int() :$time, UInt() :$keyval,
    UInt() :$hardware_keycode, UInt() :$group,
    Bool() :$is_modifier
  ) {
    $!type = $type.value;
    $!send_event = 1;
    $!time = $time // time;

    $!keyval = $keyval // 0;
    $!hardware_keycode = $hardware_keycode // 0;
    $!group = $group // 0;
    $!is_modifier = $is_modifier ?? 1 !! 0;
  }

  submethod TWEAK ( N-GObject() :$window ) {
    $!window := $window if ?$window;
  }

  method COERCE ( $no --> N-GdkEventKey ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventKey, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventCrossing

Generated when the pointer enters or leaves a window.


=item GdkEventType $.type: the type of the event (C<GDK_ENTER_NOTIFY> or C<GDK_LEAVE_NOTIFY>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item N-GObject $.subwindow: the window that was entered or left.
=item UInt $.time: the time of the event in milliseconds.
=item C<Num()> $.x: the x coordinate of the pointer relative to the window.
=item C<Num()> $.y: the y coordinate of the pointer relative to the window.
=item C<Num()> $.x_root: the x coordinate of the pointer relative to the root of the screen.
=item C<Num()> $.y_root: the y coordinate of the pointer relative to the root of the screen.
=item GdkCrossingMode $.mode: the crossing mode (C<GDK_CROSSING_NORMAL>, C<GDK_CROSSING_GRAB>, C<GDK_CROSSING_UNGRAB>, C<GDK_CROSSING_GTK_GRAB>, C<GDK_CROSSING_GTK_UNGRAB> or C<GDK_CROSSING_STATE_CHANGED>).  C<GDK_CROSSING_GTK_GRAB>, C<GDK_CROSSING_GTK_UNGRAB>, and C<GDK_CROSSING_STATE_CHANGED> were added in 2.14 and are always synthesized, never native.
=item GdkNotifyType $.detail: the kind of crossing that happened (C<GDK_NOTIFY_INFERIOR>, C<GDK_NOTIFY_ANCESTOR>, C<GDK_NOTIFY_VIRTUAL>, C<GDK_NOTIFY_NONLINEAR> or C<GDK_NOTIFY_NONLINEAR_VIRTUAL>).
=item Bool $.focus: C<True> if I<window> is the focus window or an inferior.
=item UInt $.state: (type GdkModifierType): a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See B<Gnome::Gdk3::ModifierType>.


=end pod

#TT:0:N-GdkEventCrossing:
class N-GdkEventCrossing is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has N-GObject $.subwindow;
  has guint32 $.time;
  has gdouble $.x;
  has gdouble $.y;
  has gdouble $.x_root;
  has gdouble $.y_root;
  has GEnum $.mode;
  has GEnum $.detail;
  has gboolean $.focus;
  has guint $.state;

  method COERCE ( $no --> N-GdkEventCrossing ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventCrossing, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventFocus

Describes a change of keyboard focus.


=item GdkEventType $.type: the type of the event (C<GDK_FOCUS_CHANGE>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item C<Int()> $.in: C<True> if the window has gained the keyboard focus, C<False> if it has lost the focus.


=end pod

#TT:0:N-GdkEventFocus:
class N-GdkEventFocus is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has gint16 $.in;

  method COERCE ( $no --> N-GdkEventFocus ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventFocus, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventConfigure

Generated when a window size or position has changed.


=item GdkEventType $.type: the type of the event (C<GDK_CONFIGURE>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item C<Int()> $.x: the new x coordinate of the window, relative to its parent.
=item C<Int()> $.y: the new y coordinate of the window, relative to its parent.
=item C<Int()> $.width: the new width of the window.
=item C<Int()> $.height: the new height of the window.


=end pod

#TT:0:N-GdkEventConfigure:
class N-GdkEventConfigure is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has gint $.x;
  has gint $.y;
  has gint $.width;
  has gint $.height;

  method COERCE ( $no --> N-GdkEventConfigure ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventConfigure, $no)
  }
}

#`{{
#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventProperty

Describes a property change on a window.

=item GdkEventType $.type: the type of the event (C<GDK_PROPERTY_NOTIFY>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item GdkAtom $.atom: the property that was changed.
=item UInt $.time: the time of the event in milliseconds.
=item UInt $.state: (type GdkPropertyState): whether the property was changed (C<GDK_PROPERTY_NEW_VALUE>) or deleted (C<GDK_PROPERTY_DELETE>).


=end pod

#TT:0:N-GdkEventProperty:
class N-GdkEventProperty is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has GdkAtom $.atom;
  has guint32 $.time;
  has guint $.state;
}
}}

#`{{
#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventSelection

Generated when a selection is requested or ownership of a selection
is taken over by another client application.


=item GdkEventType $.type: the type of the event (C<GDK_SELECTION_CLEAR>, C<GDK_SELECTION_NOTIFY> or C<GDK_SELECTION_REQUEST>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item GdkAtom $.selection: the selection.
=item GdkAtom $.target: the target to which the selection should be converted.
=item GdkAtom $.property: the property in which to place the result of the conversion.
=item UInt $.time: the time of the event in milliseconds.
=item N-GObject $.requestor: the window on which to place I<property> or C<undefined> if none.


=end pod

#TT:0:N-GdkEventSelection:
class N-GdkEventSelection is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has GdkAtom $.selection;
  has GdkAtom $.target;
  has GdkAtom $.property;
  has guint32 $.time;
  has N-GObject $.requestor;
}
}}

#`{{
#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventOwnerChange

Generated when the owner of a selection changes. On X11, this
information is only available if the X server supports the XFIXES
extension.



=item GdkEventType $.type: the type of the event (C<GDK_OWNER_CHANGE>).
=item N-GObject $.window: the window which received the event
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item N-GObject $.owner: the new owner of the selection, or C<undefined> if there is none
=item GdkOwnerChange $.reason: the reason for the ownership change as a B<Gnome::Gdk3::OwnerChange> value
=item GdkAtom $.selection: the atom identifying the selection
=item UInt $.time: the timestamp of the event
=item UInt $.selection_time: the time at which the selection ownership was taken over


=end pod

#TT:0:N-GdkEventOwnerChange:
class N-GdkEventOwnerChange is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has N-GObject $.owner;
  has GEnum $.reason;
  has GdkAtom $.selection;
  has guint32 $.time;
  has guint32 $.selection_time;
}
}}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventProximity

Proximity events are generated when using GDK’s wrapper for the
XInput extension. The XInput extension is an add-on for standard X
that allows you to use nonstandard devices such as graphics tablets.
A proximity event indicates that the stylus has moved in or out of
contact with the tablet, or perhaps that the user’s finger has moved
in or out of contact with a touch screen.

This event type will be used pretty rarely. It only is important for
XInput aware programs that are drawing their own cursor.


=item GdkEventType $.type: the type of the event (C<GDK_PROXIMITY_IN> or C<GDK_PROXIMITY_OUT>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item UInt $.time: the time of the event in milliseconds.
=item N-GObject $.device: the master device that the event originated from. Use C<gdk_event_get_source_device()> to get the slave device.


=end pod

#TT:0:N-GdkEventProximity:
class N-GdkEventProximity is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has guint32 $.time;
  has N-GObject $.device;

  method COERCE ( $no --> N-GdkEventProximity ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventProximity, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventSetting

Generated when a setting is modified.


=item GdkEventType $.type: the type of the event (C<GDK_SETTING>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item GdkSettingAction $.action: what happened to the setting (C<GDK_SETTING_ACTION_NEW>, C<GDK_SETTING_ACTION_CHANGED> or C<GDK_SETTING_ACTION_DELETED>).
=item Str $.name: the name of the setting.


=end pod

#TT:0:N-GdkEventSetting:
class N-GdkEventSetting is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has GEnum $.action;
  has gchar-ptr $.name;

  method COERCE ( $no --> N-GdkEventSetting ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventSetting, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventWindowState

Generated when the state of a toplevel window changes.


=item GdkEventType $.type: the type of the event (C<GDK_WINDOW_STATE>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item GdkWindowState $.changed_mask: mask specifying what flags have changed.
=item GdkWindowState $.new_window_state: the new window state, a combination of B<Gnome::Gdk3::WindowState> bits.


=end pod

#TT:0:N-GdkEventWindowState:
class N-GdkEventWindowState is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has GEnum $.changed_mask;
  has GEnum $.new_window_state;

  method COERCE ( $no --> N-GdkEventWindowState ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventWindowState, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventGrabBroken

Generated when a pointer or keyboard grab is broken. On X11, this happens
when the grab window becomes unviewable (i.e. it or one of its ancestors
is unmapped), or if the same application grabs the pointer or keyboard
again. Note that implicit grabs (which are initiated by button presses)
can also cause B<Gnome::Gdk3::EventGrabBroken> events.



=item GdkEventType $.type: the type of the event (C<GDK_GRAB_BROKEN>)
=item N-GObject $.window: the window which received the event, i.e. the window that previously owned the grab
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item Bool $.keyboard: C<True> if a keyboard grab was broken, C<False> if a pointer grab was broken
=item Bool $.implicit: C<True> if the broken grab was implicit
=item N-GObject $.grab_window: If this event is caused by another grab in the same application, I<grab_window> contains the new grab window. Otherwise I<grab_window> is C<undefined>.


=end pod

#TT:0:N-GdkEventGrabBroken:
class N-GdkEventGrabBroken is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has gboolean $.keyboard;
  has gboolean $.implicit;
  has N-GObject $.grab_window;

  method COERCE ( $no --> N-GdkEventGrabBroken ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventGrabBroken, $no)
  }
}

#`{{
#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventDND

Generated during DND operations.


=item GdkEventType $.type: the type of the event (C<GDK_DRAG_ENTER>, C<GDK_DRAG_LEAVE>, C<GDK_DRAG_MOTION>, C<GDK_DRAG_STATUS>, C<GDK_DROP_START> or C<GDK_DROP_FINISHED>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item GdkDragContext $.context: the B<Gnome::Gdk3::DragContext> for the current DND operation.
=item UInt $.time: the time of the event in milliseconds.
=item C<Int()> $.x_root: the x coordinate of the pointer relative to the root of the screen, only set for C<GDK_DRAG_MOTION> and C<GDK_DROP_START>.
=item C<Int()> $.y_root: the y coordinate of the pointer relative to the root of the screen, only set for C<GDK_DRAG_MOTION> and C<GDK_DROP_START>.


=end pod

#TT:0:N-GdkEventDND:
class N-GdkEventDND is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has GdkDragContext $.context;
  has guint32 $.time;
  has gshort $.x_root;
  has gshort $.y_root;
}
}}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventTouchpadSwipe

Generated during touchpad swipe gestures.


=item GdkEventType $.type: the type of the event (C<GDK_TOUCHPAD_SWIPE>)
=item N-GObject $.window: the window which received the event
=item C<Int()> $.send_event: C<True> if the event was sent explicitly
=item C<Int()> $.phase: the current phase of the gesture
=item C<Int()> $.n_fingers: The number of fingers triggering the swipe
=item UInt $.time: the time of the event in milliseconds
=item C<Num()> $.x: The X coordinate of the pointer
=item C<Num()> $.y: The Y coordinate of the pointer
=item C<Num()> $.dx: Movement delta in the X axis of the swipe focal point
=item C<Num()> $.dy: Movement delta in the Y axis of the swipe focal point
=item C<Num()> $.x_root: The X coordinate of the pointer, relative to the root of the screen.
=item C<Num()> $.y_root: The Y coordinate of the pointer, relative to the root of the screen.
=item UInt $.state: (type GdkModifierType): a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See B<Gnome::Gdk3::ModifierType>.


=end pod

#TT:0:N-GdkEventTouchpadSwipe:
class N-GdkEventTouchpadSwipe is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has gint8 $.phase;
  has gint8 $.n_fingers;
  has guint32 $.time;
  has gdouble $.x;
  has gdouble $.y;
  has gdouble $.dx;
  has gdouble $.dy;
  has gdouble $.x_root;
  has gdouble $.y_root;
  has guint $.state;

  method COERCE ( $no --> N-GdkEventTouchpadSwipe ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventTouchpadSwipe, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventTouchpadPinch

Generated during touchpad swipe gestures.


=item GdkEventType $.type: the type of the event (C<GDK_TOUCHPAD_PINCH>)
=item N-GObject $.window: the window which received the event
=item C<Int()> $.send_event: C<True> if the event was sent explicitly
=item C<Int()> $.phase: the current phase of the gesture
=item C<Int()> $.n_fingers: The number of fingers triggering the pinch
=item UInt $.time: the time of the event in milliseconds
=item C<Num()> $.x: The X coordinate of the pointer
=item C<Num()> $.y: The Y coordinate of the pointer
=item C<Num()> $.dx: Movement delta in the X axis of the swipe focal point
=item C<Num()> $.dy: Movement delta in the Y axis of the swipe focal point
=item C<Num()> $.angle_delta: The angle change in radians, negative angles denote counter-clockwise movements
=item C<Num()> $.scale: The current scale, relative to that at the time of the corresponding C<GDK_TOUCHPAD_GESTURE_PHASE_BEGIN> event
=item C<Num()> $.x_root: The X coordinate of the pointer, relative to the root of the screen.
=item C<Num()> $.y_root: The Y coordinate of the pointer, relative to the root of the screen.
=item UInt $.state: (type GdkModifierType): a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See B<Gnome::Gdk3::ModifierType>.


=end pod

#TT:0:N-GdkEventTouchpadPinch:
class N-GdkEventTouchpadPinch is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has gint8 $.phase;
  has gint8 $.n_fingers;
  has guint32 $.time;
  has gdouble $.x;
  has gdouble $.y;
  has gdouble $.dx;
  has gdouble $.dy;
  has gdouble $.angle_delta;
  has gdouble $.scale;
  has gdouble $.x_root;
  has gdouble $.y_root;
  has guint $.state;

  method COERCE ( $no --> N-GdkEventTouchpadPinch ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventTouchpadPinch, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventPadButton

Generated during C<GDK_SOURCE_TABLET_PAD> button presses and releases.



=item GdkEventType $.type: the type of the event (C<GDK_PAD_BUTTON_PRESS> or C<GDK_PAD_BUTTON_RELEASE>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item UInt $.time: the time of the event in milliseconds.
=item UInt $.group: the pad group the button belongs to. A C<GDK_SOURCE_TABLET_PAD> device may have one or more groups containing a set of buttons/rings/strips each.
=item UInt $.button: The pad button that was pressed.
=item UInt $.mode: The current mode of I<group>. Different groups in a C<GDK_SOURCE_TABLET_PAD> device may have different current modes.


=end pod

#TT:0:N-GdkEventPadButton:
class N-GdkEventPadButton is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has guint32 $.time;
  has guint $.group;
  has guint $.button;
  has guint $.mode;

  method COERCE ( $no --> N-GdkEventPadButton ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventPadButton, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventPadAxis

Generated during C<GDK_SOURCE_TABLET_PAD> interaction with tactile sensors.



=item GdkEventType $.type: the type of the event (C<GDK_PAD_RING> or C<GDK_PAD_STRIP>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item UInt $.time: the time of the event in milliseconds.
=item UInt $.group: the pad group the ring/strip belongs to. A C<GDK_SOURCE_TABLET_PAD> device may have one or more groups containing a set of buttons/rings/strips each.
=item UInt $.index: number of strip/ring that was interacted. This number is 0-indexed.
=item UInt $.mode: The current mode of I<group>. Different groups in a C<GDK_SOURCE_TABLET_PAD> device may have different current modes.
=item C<Num()> $.value: The current value for the given axis.


=end pod

#TT:0:N-GdkEventPadAxis:
class N-GdkEventPadAxis is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has guint32 $.time;
  has guint $.group;
  has guint $.index;
  has guint $.mode;
  has gdouble $.value;

  method COERCE ( $no --> N-GdkEventPadAxis ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventPadAxis, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEventPadGroupMode

Generated during C<GDK_SOURCE_TABLET_PAD> mode switches in a group.



=item GdkEventType $.type: the type of the event (C<GDK_PAD_GROUP_MODE>).
=item N-GObject $.window: the window which received the event.
=item C<Int()> $.send_event: C<True> if the event was sent explicitly.
=item UInt $.time: the time of the event in milliseconds.
=item UInt $.group: the pad group that is switching mode. A C<GDK_SOURCE_TABLET_PAD> device may have one or more groups containing a set of buttons/rings/strips each.
=item UInt $.mode: The new mode of I<group>. Different groups in a C<GDK_SOURCE_TABLET_PAD> device may have different current modes.


=end pod

#TT:0:N-GdkEventPadGroupMode:
class N-GdkEventPadGroupMode is export is repr('CStruct') {
  has GEnum $.type;
  has N-GObject $.window;
  has gint8 $.send_event;
  has guint32 $.time;
  has guint $.group;
  has guint $.mode;

  method COERCE ( $no --> N-GdkEventPadGroupMode ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEventPadGroupMode, $no)
  }
}

#-------------------------------------------------------------------------------
=begin pod
=head2 class N-GdkEvent

A C<N-GdkEvent> contains a union of all of the event types, 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 types, and can always be accessed with the following code, no matter what type of event it is:

  method my-handler ( N-GdkEvent $event ) {
    if $event.type ~~ GDK_BUTTON_PRESS {
      my N-GdkEventButton $event-button := $event-button;
      ...
    }

    elsif $event.type ~~ GDK_KEY_RELEASE {
      my N-GdkEventKey $event-key := $event-key;
      ...
    }
  }

The event structures contain data specific to each type of event in GDK. The type is a union of all structures explained above.

=end pod

#TT:2:N-GdkEvent:*
class N-GdkEvent is repr('CUnion') is export {
  HAS N-GdkEventAny $.event-any;              # Deprecate
  HAS N-GdkEventAny $.any;
#  HAS N-GdkEventExpose $.expose;
#  HAS N-GdkEventVisibility $.visibility;     # Gdk deprecated since 3.12
  HAS N-GdkEventMotion $.event-motion;        # Deprecate
  HAS N-GdkEventMotion $.motion;
  HAS N-GdkEventButton $.event-button;        # Deprecate
  HAS N-GdkEventButton $.button;
#  HAS N-GdkEventTouch $.touch;
  HAS N-GdkEventScroll $.event-scroll;        # Deprecate
  HAS N-GdkEventScroll $.scroll;
  HAS N-GdkEventKey $.event-key;              # Deprecate
  HAS N-GdkEventKey $.key;
  HAS N-GdkEventCrossing $.event-crossing;    # Deprecate
  HAS N-GdkEventCrossing $.crossing;
  HAS N-GdkEventFocus $.event-focus;          # Deprecate
  HAS N-GdkEventFocus $.focus;
  HAS N-GdkEventConfigure $.event-configure;  # Deprecate
  HAS N-GdkEventConfigure $.configure;
#  HAS N-GdkEventProperty $.property;
#  HAS N-GdkEventSelection $.selection;
#  HAS N-GdkEventOwnerChange $.owner_change;
  HAS N-GdkEventProximity $.proximity;
#  HAS N-GdkEventDND $.dnd;
  HAS N-GdkEventWindowState $.window_state;
  HAS N-GdkEventSetting $.setting;
  HAS N-GdkEventGrabBroken $.grab_broken;
  HAS N-GdkEventTouchpadSwipe $.touchpad_swipe;
  HAS N-GdkEventTouchpadPinch $.touchpad_pinch;
  HAS N-GdkEventPadButton $.pad_button;
  HAS N-GdkEventPadAxis $.pad_axis;
  HAS N-GdkEventPadGroupMode $.pad_group_mode;

  method COERCE ( $no --> N-GdkEvent ) {
    note "Coercing from {$no.^name} to ", self.^name if $Gnome::N::x-debug;
    nativecast( N-GdkEvent, $no)
  }
}

my constant GdkEvent is export = N-GdkEvent;

=begin pod
=head3 struct N-GdkEventExpose B<I<this event structure is not yet implemented>>
=head3 struct N-GdkEventTouch B<I<this event structure is not yet implemented>>
=head3 struct N-GdkEventSelection B<I<this event structure is not yet implemented>>
=head3 struct N-GdkEventProperty B<I<this event structure is not yet implemented>>
=head3 struct N-GdkEventOwnerChange B<I<this event structure is not yet implemented>>
=head3 struct N-GdkEventDND B<I<this event structure is not yet implemented>>

Fields C<$.event-any>, C<$.event-motion>, C<$.event-button>, C<$.event-scroll>, C<$.event-key>, C<$.event-crossing>, C<$.event-focus> and C<$.event-configure> are deprecated (version 0.19.2) and replaced by C<$.any>, C<m$.motion>, C<$.button>, C<$.scroll>, C<$.key>, C<$.crossing>, C<$.focus> and C<$.configure> resp. (Fields are removed in version 0.22.0 and higher)
=end pod

#`{{
#-------------------------------------------------------------------------------
my Array $map-type-to-field is export = [
  GDK_NOTHING = '';
  GDK_DELETE = '';
  GDK_DESTROY = '';
  GDK_EXPOSE = '';
  GDK_MOTION_NOTIFY = 'motion',
  GDK_BUTTON_PRESS = 'button',
  GDK_2BUTTON_PRESS = 'button',
  GDK_DOUBLE_BUTTON_PRESS = 'button',
  GDK_3BUTTON_PRESS = 'button',
  GDK_TRIPLE_BUTTON_PRESS = 'button',
  GDK_BUTTON_RELEASE = 'button',
  GDK_KEY_PRESS = 'key',
  GDK_KEY_RELEASE = 'key',
  GDK_ENTER_NOTIFY = '';
  GDK_LEAVE_NOTIFY = '';
  GDK_FOCUS_CHANGE = '';
  GDK_CONFIGURE = 'configure',
  GDK_MAP = '';
  GDK_UNMAP = '';
  GDK_PROPERTY_NOTIFY = '';
  GDK_SELECTION_CLEAR = '';
  GDK_SELECTION_REQUEST = '';
  GDK_SELECTION_NOTIFY = '';
  GDK_PROXIMITY_IN = '';
  GDK_PROXIMITY_OUT = '';
  GDK_DRAG_ENTER = '';
  GDK_DRAG_LEAVE = '';
  GDK_DRAG_MOTION = '';
  GDK_DRAG_STATUS = '';
  GDK_DROP_START = '';
  GDK_DROP_FINISHED = '';
  GDK_CLIENT_EVENT = '';
  GDK_VISIBILITY_NOTIFY = 'visibility',
  GDK_SCROLL = '';
  GDK_WINDOW_STATE = '';
  GDK_SETTING