Package ch.bailu.gtk.gdk
Class Event
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gdk.Event
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
ButtonEvent
,CrossingEvent
,DeleteEvent
,DNDEvent
,FocusEvent
,GrabBrokenEvent
,KeyEvent
,MotionEvent
,PadEvent
,ProximityEvent
,ScrollEvent
,TouchEvent
,TouchpadEvent
`GdkEvent`s are immutable data structures, created by GDK to
represent windowing system events.
In GTK applications the events are handled automatically by toplevel
widgets and passed on to the event controllers of appropriate widgets,
so using `GdkEvent` and its related API is rarely needed.
represent windowing system events.
In GTK applications the events are handled automatically by toplevel
widgets and passed on to the event controllers of appropriate widgets,
so using `GdkEvent` and its related API is rarely needed.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassHandler
Returns the device of an event.Returns a `GdkDeviceTool` representing the tool that
caused the event.Retrieves the display associated to the @event.Retuns the event sequence to which the event belongs.int
Retrieves the type of the event.static int
int
Returns the modifier state field of an event.static long
static TypeSystem.TypeSize
boolean
Returns whether this event is an 'emulated' pointer event.getSeat()
Returns the seat that originated the event.Extracts the surface associated with an event.int
getTime()
Returns the timestamp of @event.static long
static TypeSystem.TypeSize
ref()
Increase the ref count of @event.boolean
Returns whether a `GdkEvent` should trigger a context menu,
according to platform conventions.void
unref()
Decrease the ref count of @event.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
Event
-
-
Method Details
-
getClassHandler
-
getDevice
Returns the device of an event.- Returns:
- a `GdkDevice`
-
getDeviceTool
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].- Returns:
- The current device tool
-
getDisplay
Retrieves the display associated to the @event.- Returns:
- a `GdkDisplay`
-
getEventSequence
Retuns 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.- Returns:
- the event sequence that the event belongs to
-
getEventType
public int getEventType()Retrieves the type of the event.- Returns:
- a `GdkEvent`Type
-
getModifierState
public int getModifierState()Returns the modifier state field of an event.- Returns:
- the modifier state of @event
-
getPointerEmulated
public boolean getPointerEmulated()Returns whether this event is an 'emulated' pointer event.
Emulated pointer events typically originate from a touch events.- Returns:
- %TRUE if this event is emulated
-
getSeat
Returns the seat that originated the event.- Returns:
- a `GdkSeat`.
-
getSurface
Extracts the surface associated with an event.- Returns:
- The `GdkSurface` associated with the event
-
getTime
public int getTime()Returns the timestamp of @event.
Not all events have timestamps. In that case, this function
returns %GDK_CURRENT_TIME.- Returns:
- timestamp field from @event
-
ref
Increase the ref count of @event.- Returns:
- @event
-
triggersContextMenu
public boolean triggersContextMenu()Returns whether a `GdkEvent` should trigger a context menu,
according to platform conventions.
The right mouse button typically triggers context menus.
This function should always be used instead of simply checking for
event->button == %GDK_BUTTON_SECONDARY.- Returns:
- %TRUE if the event should trigger a context menu.
-
unref
public void unref()Decrease the ref count of @event.
If the last reference is dropped, the structure is freed. -
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-