mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
clutter: Add clutter_event_get_mode_group()
This event can be used on pad events to find out the group they pertain to.
This commit is contained in:
parent
b71d7058db
commit
fc5af32cdc
@ -2108,3 +2108,24 @@ clutter_event_get_scroll_finish_flags (const ClutterEvent *event)
|
||||
|
||||
return event->scroll.finish_flags;
|
||||
}
|
||||
|
||||
guint
|
||||
clutter_event_get_mode_group (const ClutterEvent *event)
|
||||
{
|
||||
g_return_val_if_fail (event->type == CLUTTER_PAD_BUTTON_PRESS ||
|
||||
event->type == CLUTTER_PAD_BUTTON_RELEASE ||
|
||||
event->type == CLUTTER_PAD_RING ||
|
||||
event->type == CLUTTER_PAD_STRIP, 0);
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PAD_BUTTON_PRESS:
|
||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||
return event->pad_button.group;
|
||||
case CLUTTER_PAD_RING:
|
||||
return event->pad_ring.group;
|
||||
case CLUTTER_PAD_STRIP:
|
||||
return event->pad_strip.group;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -771,6 +771,10 @@ void clutter_event_get_gesture_motion_delta (const Clut
|
||||
ClutterScrollSource clutter_event_get_scroll_source (const ClutterEvent *event);
|
||||
ClutterScrollFinishFlags clutter_event_get_scroll_finish_flags (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_AVAILABLE_IN_ALL
|
||||
guint clutter_event_get_mode_group (const ClutterEvent *event);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_EVENT_H__ */
|
||||
|
Loading…
Reference in New Issue
Block a user