@c -*-texinfo-*-
@c This is part of the GNU G-Golf Reference Manual.
@c Copyright (C) 2020 Free Software Foundation, Inc.
@c See the file g-golf.texi for copying conditions.


@c @defindex tl


@node Event Structures
@subsection Event Structures

G-Golf Gdk Events Structures low level API.@*
Events Structures — Data structures specific to each type of event


@subheading Class

@indentedblock
@table @code
@item @ref{<gdk-event-key>}
@item @ref{<gdk-event-button>}
@item @ref{<gdk-event-motion>}
@item @ref{<gdk-event-crossing>}
@end table
@end indentedblock


@subheading Procedures and Methods

@indentedblock
@table @code

@item @ref{make-gdk-event}

@item @ref{gdk-event-key:window}
@c @item @ref{gdk-event-key:send-event}
@item @ref{gdk-event-key:time}
@item @ref{gdk-event-key:state}
@item @ref{gdk-event-key:keyval}
@item @ref{gdk-event-key:keyname}
@c @item @ref{gdk-event-key:length}
@c @item @ref{gdk-event-key:string}
@item @ref{gdk-event-key:hardware-keycode}
@c @item @ref{gdk-event-key:group}
@c @item @ref{gdk-event-key:is-modifier}

@item @ref{gdk-event-button:time}
@item @ref{gdk-event-button:state}
@item @ref{gdk-event-button:button}
@item @ref{gdk-event-button:click-count}
@item @ref{gdk-event-button:coords}
@item @ref{gdk-event-button:x}
@item @ref{gdk-event-button:y}
@item @ref{gdk-event-button:root-coords}
@item @ref{gdk-event-button:x-root}
@item @ref{gdk-event-button:y-root}

@item @ref{gdk-event-motion:time}
@item @ref{gdk-event-motion:state}
@item @ref{gdk-event-motion:x}
@item @ref{gdk-event-motion:y}
@item @ref{gdk-event-motion:root-coords}
@item @ref{gdk-event-motion:x-root}
@item @ref{gdk-event-motion:y-root}

@item @ref{gdk-event-crossing:window}
@c ;;gdk-event-crossing:send-event
@c ;;gdk-event-crossing:subwindow
@item @ref{gdk-event-crossing:time}
@item @ref{gdk-event-crossing:coords}
@item @ref{gdk-event-crossing:x}
@item @ref{gdk-event-crossing:y}
@item @ref{gdk-event-crossing:root-coords}
@item @ref{gdk-event-crossing:x-root}
@item @ref{gdk-event-crossing:y-root}
@c ;;gdk-event-crossing:mode
@c ;;gdk-event-crossing:notify-type
@c ;;gdk-event-crossing:focus
@item @ref{gdk-event-crossing:state}


@end table
@end indentedblock


@c @subheading Types and Values

@c @indentedblock
@c @table @code
@c @item @ref{%gdk-event-key-struct}
@c @end table
@c @end indentedblock


@c @subheading Struct Hierarchy

@c @indentedblock
@c GIBaseInfo           	       		@*
@c @ @ +--- GIRegisteredTypeInfo  		@*
@c @ @ @ @ @ @ @ @ @ @ @  +--- GIEnumInfo
@c @end indentedblock


@subheading Description

The event structures contain data specific to each type of event in
@code{GDK}.


@subheading Classes

@anchor{<gdk-event-key>}
@deftp Class <gdk-event-key> (@ref{<gdk-event>})

Describes a key press or key release event.
@end deftp


@anchor{<gdk-event-button>}
@deftp Class <gdk-event-button> (@ref{<gdk-event>})

Describes a button-press, button-release, 2button-press,
2button-release, 3button-press and 3button-release event.
@end deftp


@anchor{<gdk-event-motion>}
@deftp Class <gdk-event-motion> (@ref{<gdk-event>})

Describes a motion-notify event.
@end deftp


@anchor{<gdk-event-crossing>}
@deftp Class <gdk-event-crossing> (@ref{<gdk-event>})

Generated when the pointer enters or leaves a window.
@end deftp


@subheading Procedures and Methods

Note: in this section, the @var{event} argument is [must be] a pointer to
a @code{GdkEvent}.


@anchor{make-gdk-event}
@deffn Procedure make-gdk-event event

Returns an instance.

Creates and returns an instance of the gdk event subclass for @var{event},
according to its event type.
@end deffn


@anchor{gdk-event-key:window}
@c @anchor{gdk-event-key:send-event}
@anchor{gdk-event-key:time}
@anchor{gdk-event-key:state}
@anchor{gdk-event-key:keyval}
@anchor{gdk-event-key:keyname}
@c @anchor{gdk-event-key:length}
@c @anchor{gdk-event-key:string}
@anchor{gdk-event-key:hardware-keycode}
@c @anchor{gdk-event-key:group}
@c @anchor{gdk-event-key:is-modifier}
@deffn Method gdk-event-key:window (inst <gdk-event-key>)
@c @deffnx Method gdk-event-key:send-event (inst <gdk-event-key>)
@deffnx Method gdk-event-key:time (inst <gdk-event-key>)
@deffnx Method gdk-event-key:state (inst <gdk-event-key>)
@deffnx Method gdk-event-key:keyval (inst <gdk-event-key>)
@deffnx Method gdk-event-key:keyname (inst <gdk-event-key>)
@c @deffnx Method gdk-event-key:length (inst <gdk-event-key>)
@c @deffnx Method gdk-event-key:string (inst <gdk-event-key>)
@deffnx Method gdk-event-key:hardware-keycode (inst <gdk-event-key>)
@c @deffnx Method gdk-event-key:group (inst <gdk-event-key>)
@c @deffnx Method gdk-event-key:is-modifier (inst <gdk-event-key>)

Respectively returns the scheme representation of the content of the
@var{inst} event key element, refered to by its name - the part of the
method name that follows the semi-colon, which are:


@indentedblock
@table @code
@item @emph{window}

A pointer to the  @var{GdkWindow} that received the event.

@c @item @emph{send-event}
@c #t if the event was sent explicitly.

@item @emph{time}

The time of the event in milliseconds.

@item @emph{state}

A list representing the state of the modifier keys (e.g. Control, Shift
and Alt) and the pointer buttons. Please refer to the
@uref{@value{UGDK-ModifierType}, enum GdkModifierType}@footnote{The
@code{GdkModifierType} is obtained by introspection, from the "Gdk"
namespace, when the (g-golf) module is imported (used). You may obtain
its @code{<gi-flag>} instance doing @code{(gi-cache-ref 'flag
'gdk-modifier-type)}, and visualize its content using @code{describe}.}
section of the Gdk Reference Manual for a complete list and description
of all modifier bit-flags.

@item @emph{keyval}

The key value (an unsigned integer) that was pressed or released.

@item @emph{keyname}

The key (symbol) name as returned by calling @code{(gdk-keyval-name
keyval)}.

@c @item @emph{length}
@c The length of @code{string}.

@c @item @emph{string}
@c A string containing an approximation of the text that would result from
@c this keypress.

@item @emph{hardware-keycode}

The raw code of the key that was pressed or released.

@c @item @emph{group}
@c The keyboard group.

@c @item @emph{is-modifier}
@c A flag that indicates if hardware-keycode is mapped to a modifier.
@end table
@end indentedblock
@end deffn


@anchor{gdk-event-button:time}
@anchor{gdk-event-button:state}
@anchor{gdk-event-button:button}
@anchor{gdk-event-button:click-count}
@anchor{gdk-event-button:coords}
@anchor{gdk-event-button:x}
@anchor{gdk-event-button:y}
@anchor{gdk-event-button:root-coords}
@anchor{gdk-event-button:x-root}
@anchor{gdk-event-button:y-root}
@deffn Method gdk-event-button:time (inst <gdk-event-button>)
@deffnx Method gdk-event-button:state (inst <gdk-event-button>)
@deffnx Method gdk-event-button:button (inst <gdk-event-button>)
@deffnx Method gdk-event-button:click-count (inst <gdk-event-button>)
@deffnx Method gdk-event-button:coords (inst <gdk-event-button>)
@deffnx Method gdk-event-button:x (inst <gdk-event-button>)
@deffnx Method gdk-event-button:y (inst <gdk-event-button>)
@deffnx Method gdk-event-button:root-coords (inst <gdk-event-button>)
@deffnx Method gdk-event-button:x-root (inst <gdk-event-button>)
@deffnx Method gdk-event-button:y-root (inst <gdk-event-button>)

Respectively returns the scheme representation of the content of the
@var{inst} event button element, refered to by its name - the part of
the method name that follows the semi-colon, which are:


@indentedblock
@table @code
@item @emph{time}

The time of the event in milliseconds.

@item @emph{state}

A list representing the state of the modifier keys (e.g. Control, Shift
and Alt) and the pointer buttons (see the @ref{gdk-event-key:state}
description for some more information about @code{GdkModifierType}).

@item @emph{button}

The button number of the event.

@item @emph{click-count}

The click-count of the event.

@item @emph{coords}

The list of the x and y window relative coordinates of the event.

@item @emph{x}

The x window relative coordinate of the event.

@item @emph{y}

The y window relative coordinate of the event.

@item @emph{root-coords}

The list of the x and y root window relative coordinates of the event.

@item @emph{x-root}

The x root window relative coordinate of the event.

@item @emph{y-root}

The y root window relative coordinate of the event.

@end table
@end indentedblock
@end deffn


@anchor{gdk-event-motion:time}
@anchor{gdk-event-motion:state}
@anchor{gdk-event-motion:coords}
@anchor{gdk-event-motion:x}
@anchor{gdk-event-motion:y}
@anchor{gdk-event-motion:root-coords}
@anchor{gdk-event-motion:x-root}
@anchor{gdk-event-motion:y-root}
@deffn Method gdk-event-motion:time (inst <gdk-event-motion>)
@deffnx Method gdk-event-motion:state (inst <gdk-event-motion>)
@deffnx Method gdk-event-motion:coords (inst <gdk-event-motion>)
@deffnx Method gdk-event-motion:x (inst <gdk-event-motion>)
@deffnx Method gdk-event-motion:y (inst <gdk-event-motion>)
@deffnx Method gdk-event-motion:root-coords (inst <gdk-event-motion>)
@deffnx Method gdk-event-motion:x-root (inst <gdk-event-motion>)
@deffnx Method gdk-event-motion:y-root (inst <gdk-event-motion>)

Respectively returns the scheme representation of the content of the
@var{inst} event motion element, refered to by its name - the part of
the method name that follows the semi-colon, which are:


@indentedblock
@table @code

@item @emph{time}

The time of the event in milliseconds.

@item @emph{state}

A list representing the state of the modifier keys (e.g. Control, Shift
and Alt) and the pointer buttons (see the @ref{gdk-event-key:state}
description for some more information about @code{GdkModifierType}).

@item @emph{coords}

The list of the x and y window relative coordinates of the event.

@item @emph{x}

The x window relative coordinate of the event.

@item @emph{y}

The y window relative coordinate of the event.

@item @emph{root-coords}

The list of the x and y root window relative coordinates of the event.

@item @emph{x-root}

The x root window relative coordinate of the event.

@item @emph{y-root}

The y root window relative coordinate of the event.

@end table
@end indentedblock
@end deffn


@anchor{gdk-event-crossing:window}
@anchor{gdk-event-crossing:time}
@anchor{gdk-event-crossing:coords}
@anchor{gdk-event-crossing:x}
@anchor{gdk-event-crossing:y}
@anchor{gdk-event-crossing:root-coords}
@anchor{gdk-event-crossing:x-root}
@anchor{gdk-event-crossing:y-root}
@anchor{gdk-event-crossing:state}
@deffn Method gdk-event-crossing:window (inst <gdk-event-crossing>)
@deffnx Method gdk-event-crossing:time (inst <gdk-event-crossing>)
@deffnx Method gdk-event-crossing:coords (inst <gdk-event-crossing>)
@deffnx Method gdk-event-crossing:x (inst <gdk-event-crossing>)
@deffnx Method gdk-event-crossing:y (inst <gdk-event-crossing>)
@deffnx Method gdk-event-crossing:root-coords (inst <gdk-event-crossing>)
@deffnx Method gdk-event-crossing:x-root (inst <gdk-event-crossing>)
@deffnx Method gdk-event-crossing:y-root (inst <gdk-event-crossing>)
@deffnx Method gdk-event-crossing:state (inst <gdk-event-crossing>)

Respectively returns the scheme representation of the content of the
@var{inst} event crossing element, refered to by its name - the part of
the method name that follows the semi-colon, which are:


@indentedblock
@table @code

@item @emph{window}

A pointer to the  @var{GdkWindow} that received the event.

@item @emph{time}

The time of the event in milliseconds.

@item @emph{coords}

The list of the x and y window relative coordinates of the event.

@item @emph{x}

The x window relative coordinate of the event.

@item @emph{y}

The y window relative coordinate of the event.

@item @emph{root-coords}

The list of the x and y root window relative coordinates of the event.

@item @emph{x-root}

The x root window relative coordinate of the event.

@item @emph{y-root}

The y root window relative coordinate of the event.

@item @emph{state}

A list representing the state of the modifier keys (e.g. Control, Shift
and Alt) and the pointer buttons (see the @ref{gdk-event-key:state}
description for some more information about @code{GdkModifierType}).
@end table
@end indentedblock
@end deffn


@c @subheading Types and Values
