EventRef
public struct EventRef : EventProtocol
The EventRef type acts as a lightweight Swift reference to an underlying GdkEvent instance.
It exposes methods that can operate on this data type through EventProtocol conformance.
Use EventRef only as an unowned reference to an existing GdkEvent instance.
A 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: (C Language Example):
GdkEvent *event;
GdkEventType type;
type = event->type;
To access other fields of the event, the pointer to the event
can be cast to the appropriate event type, or the union member
name can be used. For example if the event type is GDK_BUTTON_PRESS
then the x coordinate of the button press can be accessed with:
(C Language Example):
GdkEvent *event;
gdouble x;
x = ((GdkEventButton*)event)->x;
or: (C Language Example):
GdkEvent *event;
gdouble x;
x = event->button.x;
-
Untyped pointer to the underlying `GdkEvent` instance.For type-safe access, use the generated, typed pointer
event_ptrproperty instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GdkEvent>) -
Designated initialiser from a constant pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GdkEvent>) -
Conditional initialiser from an optional pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkEvent>?) -
Conditional initialiser from an optional, non-mutable pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GdkEvent>?) -
Conditional initialiser from an optional
gpointerDeclaration
Swift
@inlinable init!(gpointer g: gpointer?) -
Conditional initialiser from an optional, non-mutable
gconstpointerDeclaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?) -
Reference intialiser for a related type that implements
EventProtocolDeclaration
Swift
@inlinable init<T>(_ other: T) where T : EventProtocol -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
EventProtocol.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
EventProtocol.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
EventProtocol.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
EventProtocol.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
EventProtocol.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer) -
Creates a new event of the given type. All fields are set to 0.
Declaration
Swift
@inlinable init(type: GdkEventType) -
Checks all open displays for a
GdkEventto process,to be processed on, fetching events from the windowing system if necessary. Seegdk_display_get_event().Declaration
Swift
@inlinable static func get() -> EventRef! -
If there is an event waiting in the event queue of some open display, returns a copy of it. See
gdk_display_peek_event().Declaration
Swift
@inlinable static func peek() -> EventRef!
View on GitHub
Install in Dash
EventRef Structure Reference