Top | ![]() |
![]() |
![]() |
![]() |
enum | ClutterModifierType |
enum | ClutterScrollDirection |
enum | ClutterStageState |
enum | ClutterEventType |
union | ClutterEvent |
enum | ClutterEventFlags |
struct | ClutterButtonEvent |
struct | ClutterKeyEvent |
struct | ClutterMotionEvent |
struct | ClutterScrollEvent |
struct | ClutterStageStateEvent |
struct | ClutterCrossingEvent |
struct | ClutterTouchEvent |
ClutterEventSequence |
Windowing events handled by Clutter.
The events usually come from the windowing backend, but can also be synthesized by Clutter itself or by the application code.
#define CLUTTER_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
Priority for event handling.
Since 0.4
#define CLUTTER_EVENT_PROPAGATE (FALSE)
Continues the propagation of an event; this macro should be used in event-related signals.
Since 1.10
#define CLUTTER_EVENT_STOP (TRUE)
Stops the propagattion of an event; this macro should be used in event-related signals.
Since 1.10
ClutterEvent *
clutter_event_new (ClutterEventType type
);
Creates a new ClutterEvent of the specified type.
void
clutter_event_free (ClutterEvent *event
);
Frees all resources used by event
.
ClutterEventType
clutter_event_type (const ClutterEvent *event
);
Retrieves the type of the event.
void clutter_event_set_coords (ClutterEvent *event
,gfloat x
,gfloat y
);
Sets the coordinates of the event
.
Since 1.8
void clutter_event_get_coords (const ClutterEvent *event
,gfloat *x
,gfloat *y
);
Retrieves the coordinates of event
and puts them into x
and y
.
event |
||
x |
return location for the X coordinate, or |
[out] |
y |
return location for the Y coordinate, or |
[out] |
Since 0.4
void clutter_event_set_state (ClutterEvent *event
,ClutterModifierType state
);
Sets the modifier state of the event.
Since 1.8
ClutterModifierType
clutter_event_get_state (const ClutterEvent *event
);
Retrieves the modifier state of the event.
Since 0.4
void clutter_event_set_time (ClutterEvent *event
,guint32 time_
);
Sets the time of the event.
Since 1.8
guint32
clutter_event_get_time (const ClutterEvent *event
);
Retrieves the time of the event.
Since 0.4
void clutter_event_set_source (ClutterEvent *event
,ClutterActor *actor
);
Sets the source ClutterActor of event
.
Since 1.8
ClutterActor *
clutter_event_get_source (const ClutterEvent *event
);
Retrieves the source ClutterActor the event originated from, or NULL if the event has no source.
Since 0.6
void clutter_event_set_stage (ClutterEvent *event
,ClutterStage *stage
);
Sets the source ClutterStage of the event.
Since 1.8
ClutterStage *
clutter_event_get_stage (const ClutterEvent *event
);
Retrieves the source ClutterStage the event originated for, or
NULL
if the event has no stage.
Since 0.8
void clutter_event_set_flags (ClutterEvent *event
,ClutterEventFlags flags
);
Sets the ClutterEventFlags of event
Since 1.8
ClutterEventFlags
clutter_event_get_flags (const ClutterEvent *event
);
Retrieves the ClutterEventFlags of event
Since 1.0
gdouble * clutter_event_get_axes (const ClutterEvent *event
,guint *n_axes
);
Retrieves the array of axes values attached to the event.
Since 1.6
ClutterEventSequence *
clutter_event_get_event_sequence (const ClutterEvent *event
);
Retrieves the ClutterEventSequence of event
.
event |
a ClutterEvent of type |
Since 1.10
ClutterEvent *
clutter_event_get (void
);
Pops an event off the event queue. Applications should not need to call this.
Since 0.4
ClutterEvent *
clutter_event_peek (void
);
Returns a pointer to the first event from the event queue but does not remove it.
Since 0.4
void
clutter_event_put (const ClutterEvent *event
);
Puts a copy of the event on the back of the event queue. The event will
have the CLUTTER_EVENT_FLAG_SYNTHETIC
flag set. If the source is set
event signals will be emitted for this source and capture/bubbling for
its ancestors. If the source is not set it will be generated by picking
or use the actor that currently has keyboard focus
Since 0.6
gboolean
clutter_events_pending (void
);
Checks if events are pending in the event queue.
Since 0.4
#define CLUTTER_BUTTON_PRIMARY (1)
The primary button of a pointer device.
This is typically the left mouse button in a right-handed mouse configuration.
Since 1.10
#define CLUTTER_BUTTON_MIDDLE (2)
The middle button of a pointer device.
Since 1.10
#define CLUTTER_BUTTON_SECONDARY (3)
The secondary button of a pointer device.
This is typically the right mouse button in a right-handed mouse configuration.
Since 1.10
void clutter_event_set_button (ClutterEvent *event
,guint32 button
);
Sets the button number of event
event |
a ClutterEvent or type |
|
button |
the button number |
Since 1.8
guint32
clutter_event_get_button (const ClutterEvent *event
);
Retrieves the button number of event
Since 1.0
guint
clutter_event_get_click_count (const ClutterEvent *event
);
Retrieves the number of clicks of event
Since 1.0
void clutter_event_set_key_symbol (ClutterEvent *event
,guint key_sym
);
Sets the key symbol of event
.
event |
a ClutterEvent of type |
|
key_sym |
the key symbol representing the key |
Since 1.8
guint
clutter_event_get_key_symbol (const ClutterEvent *event
);
Retrieves the key symbol of event
Since 1.0
void clutter_event_set_key_code (ClutterEvent *event
,guint16 key_code
);
Sets the keycode of the event
.
event |
a ClutterEvent of type |
|
key_code |
the keycode representing the key |
Since 1.8
guint16
clutter_event_get_key_code (const ClutterEvent *event
);
Retrieves the keycode of the key that caused event
Since 1.0
void clutter_event_set_key_unicode (ClutterEvent *event
,guint32 key_unicode
);
Sets the Unicode value of event
.
event |
a ClutterEvent of type |
|
key_unicode |
the Unicode value representing the key |
Since 1.8
guint32
clutter_event_get_key_unicode (const ClutterEvent *event
);
Retrieves the unicode value for the key that caused keyev
.
guint32
clutter_keysym_to_unicode (guint keyval
);
Converts keyval
from a Clutter key symbol to the corresponding
ISO10646 (Unicode) character.
guint
clutter_unicode_to_keysym (guint32 wc
);
Convert from a ISO10646 character to a key symbol.
the corresponding Clutter key symbol, if one exists. or, if there is no corresponding symbol, wc | 0x01000000
Since 1.10
void clutter_event_set_related (ClutterEvent *event
,ClutterActor *actor
);
Sets the related actor of a crossing event
event |
a ClutterEvent of type |
|
actor |
a ClutterActor or |
[allow-none] |
Since 1.8
ClutterActor *
clutter_event_get_related (const ClutterEvent *event
);
Retrieves the related actor of a crossing event.
Since 1.0
void clutter_event_set_scroll_direction (ClutterEvent *event
,ClutterScrollDirection direction
);
Sets the direction of the scrolling of event
Since 1.8
ClutterScrollDirection
clutter_event_get_scroll_direction (const ClutterEvent *event
);
Retrieves the direction of the scrolling of event
Since 1.0
void clutter_event_get_scroll_delta (const ClutterEvent *event
,gdouble *dx
,gdouble *dy
);
Retrieves the precise scrolling information of event
.
The event
has to have a ClutterScrollEvent.direction value
of CLUTTER_SCROLL_SMOOTH
.
event |
a ClutterEvent of type |
|
dx |
return location for the delta on the horizontal axis. |
[out] |
dy |
return location for the delta on the vertical axis. |
[out] |
Since 1.10
void clutter_event_set_scroll_delta (ClutterEvent *event
,gdouble dx
,gdouble dy
);
Sets the precise scrolling information of event
.
event |
a ClutterEvent of type |
|
dx |
delta on the horizontal axis |
|
dy |
delta on the vertical axis |
Since 1.10
void clutter_event_set_device (ClutterEvent *event
,ClutterInputDevice *device
);
Sets the device for event
.
Since 1.6
ClutterInputDevice *
clutter_event_get_device (const ClutterEvent *event
);
Retrieves the ClutterInputDevice for the event.
The ClutterInputDevice structure is completely opaque and should be cast to the platform-specific implementation.
the ClutterInputDevice or NULL
. The
returned device is owned by the ClutterEvent and it should not
be unreferenced.
[transfer none]
Since 1.0
void clutter_event_set_source_device (ClutterEvent *event
,ClutterInputDevice *device
);
Sets the source ClutterInputDevice for event
.
The ClutterEvent must have been created using clutter_event_new()
.
Since 1.8
ClutterInputDevice *
clutter_event_get_source_device (const ClutterEvent *event
);
Retrieves the hardware device that originated the event.
If you need the virtual device, use clutter_event_get_device()
.
If no hardware device originated this event, this function will
return the same device as clutter_event_get_device()
.
Since 1.6
gint
clutter_event_get_device_id (const ClutterEvent *event
);
Retrieves the events device id if set.
ClutterInputDeviceType
clutter_event_get_device_type (const ClutterEvent *event
);
Retrieves the type of the device for event
Since 1.0
guint32
clutter_get_current_event_time (void
);
Retrieves the timestamp of the last event, if there is an event or if the event has a timestamp.
Since 1.0
const ClutterEvent *
clutter_get_current_event (void
);
If an event is currently being processed, return that event. This function is intended to be used to access event state that might not be exposed by higher-level widgets. For example, to get the key modifier state from a Button 'clicked' event.
Since 1.2
Masks applied to a ClutterEvent by modifiers.
Note that Clutter may add internal values to events which include
reserved values such as CLUTTER_MODIFIER_RESERVED_13_MASK
. Your code
should preserve and ignore them. You can use CLUTTER_MODIFIER_MASK
to
remove all reserved values.
Mask applied by the Shift key |
||
Mask applied by the Caps Lock key |
||
Mask applied by the Control key |
||
Mask applied by the first Mod key |
||
Mask applied by the second Mod key |
||
Mask applied by the third Mod key |
||
Mask applied by the fourth Mod key |
||
Mask applied by the fifth Mod key |
||
Mask applied by the first pointer button |
||
Mask applied by the second pointer button |
||
Mask applied by the third pointer button |
||
Mask applied by the fourth pointer button |
||
Mask applied by the fifth pointer button |
||
Mask applied by the Super key |
||
Mask applied by the Hyper key |
||
Mask applied by the Meta key |
||
Mask applied during release |
||
A mask covering all modifier types |
Since 0.4
Direction of a pointer scroll event.
The CLUTTER_SCROLL_SMOOTH
value implies that the ClutterScrollEvent
has precise scrolling delta information.
Since 0.4
Stage state masks, used by the ClutterEvent of type CLUTTER_STAGE_STATE
.
Since 0.4
Types of events.
Empty event |
||
Key press event |
||
Key release event |
||
Pointer motion event |
||
Actor enter event |
||
Actor leave event |
||
Pointer button press event |
||
Pointer button release event |
||
Pointer scroll event |
||
Stage stage change event |
||
Destroy notification event |
||
Client message event |
||
Stage delete event |
||
A new touch event sequence has started; event added in 1.10 |
||
A touch event sequence has been updated; event added in 1.10 |
||
A touch event sequence has finished; event added in 1.10 |
||
A touch event sequence has been canceled; event added in 1.10 |
||
Marks the end of the ClutterEventType enumeration; added in 1.10 |
Since 0.4
struct ClutterButtonEvent { ClutterEventType type; guint32 time; ClutterEventFlags flags; ClutterStage *stage; ClutterActor *source; gfloat x; gfloat y; ClutterModifierType modifier_state; guint32 button; guint click_count; gdouble *axes; /* Future use */ ClutterInputDevice *device; };
Button event.
The event coordinates are relative to the stage that received the
event, and can be transformed into actor-relative coordinates by
using clutter_actor_transform_stage_point()
.
ClutterEventType |
event type |
|
event time |
||
ClutterEventFlags |
event flags |
|
ClutterStage * |
event source stage |
|
ClutterActor * |
event source actor |
|
event X coordinate, relative to the stage |
||
event Y coordinate, relative to the stage |
||
ClutterModifierType |
button modifiers |
|
event button |
||
number of button presses within the default time and radius |
||
reserved for future use |
||
ClutterInputDevice * |
reserved for future use |
Since 0.2
struct ClutterKeyEvent { ClutterEventType type; guint32 time; ClutterEventFlags flags; ClutterStage *stage; ClutterActor *source; ClutterModifierType modifier_state; guint keyval; guint16 hardware_keycode; gunichar unicode_value; ClutterInputDevice *device; };
Key event
ClutterEventType |
event type |
|
event time |
||
ClutterEventFlags |
event flags |
|
ClutterStage * |
event source stage |
|
ClutterActor * |
event source actor |
|
ClutterModifierType |
key modifiers |
|
raw key value |
||
raw hardware key value |
||
Unicode representation |
||
ClutterInputDevice * |
reserved for future use |
Since 0.2
struct ClutterMotionEvent { ClutterEventType type; guint32 time; ClutterEventFlags flags; ClutterStage *stage; ClutterActor *source; gfloat x; gfloat y; ClutterModifierType modifier_state; gdouble *axes; /* Future use */ ClutterInputDevice *device; };
Event for the pointer motion
ClutterEventType |
event type |
|
event time |
||
ClutterEventFlags |
event flags |
|
ClutterStage * |
event source stage |
|
ClutterActor * |
event source actor |
|
event X coordinate |
||
event Y coordinate |
||
ClutterModifierType |
button modifiers |
|
reserved for future use |
||
ClutterInputDevice * |
reserved for future use |
Since 0.2
struct ClutterScrollEvent { ClutterEventType type; guint32 time; ClutterEventFlags flags; ClutterStage *stage; ClutterActor *source; gfloat x; gfloat y; ClutterScrollDirection direction; ClutterModifierType modifier_state; gdouble *axes; /* future use */ ClutterInputDevice *device; };
Scroll wheel (or similar device) event
ClutterEventType |
event type |
|
event time |
||
ClutterEventFlags |
event flags |
|
ClutterStage * |
event source stage |
|
ClutterActor * |
event source actor |
|
event X coordinate |
||
event Y coordinate |
||
ClutterScrollDirection |
direction of the scrolling |
|
ClutterModifierType |
button modifiers |
|
reserved for future use |
||
ClutterInputDevice * |
reserved for future use |
Since 0.2
struct ClutterStageStateEvent { ClutterEventType type; guint32 time; ClutterEventFlags flags; ClutterStage *stage; ClutterActor *source; /* XXX: should probably be the stage itself */ ClutterStageState changed_mask; ClutterStageState new_state; };
Event signalling a change in the ClutterStage state.
ClutterEventType |
event type |
|
event time |
||
ClutterEventFlags |
event flags |
|
ClutterStage * |
event source stage |
|
ClutterActor * |
event source actor (unused) |
|
ClutterStageState |
bitwise OR of the changed flags |
|
ClutterStageState |
bitwise OR of the current state flags |
Since 0.2
struct ClutterCrossingEvent { ClutterEventType type; guint32 time; ClutterEventFlags flags; ClutterStage *stage; ClutterActor *source; gfloat x; gfloat y; ClutterInputDevice *device; ClutterActor *related; };
Event for the movement of the pointer across different actors
ClutterEventType |
event type |
|
event time |
||
ClutterEventFlags |
event flags |
|
ClutterStage * |
event source stage |
|
ClutterActor * |
event source actor |
|
event X coordinate |
||
event Y coordinate |
||
ClutterInputDevice * |
reserved for future use |
|
ClutterActor * |
actor related to the crossing |
Since 0.2
struct ClutterTouchEvent { ClutterEventType type; guint32 time; ClutterEventFlags flags; ClutterStage *stage; ClutterActor *source; gfloat x; gfloat y; ClutterEventSequence *sequence; ClutterModifierType modifier_state; gdouble *axes; /* reserved */ ClutterInputDevice *device; };
Used for touch events.
The type
field will be one of CLUTTER_TOUCH_BEGIN
, CLUTTER_TOUCH_END
,
CLUTTER_TOUCH_UPDATE
, or CLUTTER_TOUCH_CANCEL
.
Touch events are grouped into sequences; each touch sequence will begin
with a CLUTTER_TOUCH_BEGIN
event, progress with CLUTTER_TOUCH_UPDATE
events, and end either with a CLUTTER_TOUCH_END
event or with a
CLUTTER_TOUCH_CANCEL
event.
With multi-touch capable devices there can be multiple event sequence running at the same time.
ClutterEventType |
event type |
|
event time |
||
ClutterEventFlags |
event flags |
|
ClutterStage * |
event source stage |
|
ClutterActor * |
event source actor (unused) |
|
the X coordinate of the pointer, relative to the stage |
||
the Y coordinate of the pointer, relative to the stage |
||
ClutterEventSequence * |
the event sequence that this event belongs to |
|
ClutterModifierType |
a bit-mask representing the state of modifier keys (e.g. Control, Shift, and Alt) and the pointer buttons. See ClutterModifierType. |
[type ClutterModifierType] |
reserved |
||
ClutterInputDevice * |
the device that originated the event |
Since 1.10