introspection-friendly ClutterEvent accessors

ClutterEvent is not really gobject-introspection friendly because
of the whole discriminated union thing. In particular, if you get
a ClutterEvent in a signal handler, you probably can't access the
event-type-specific fields, and you probably can't call methods
like clutter_key_event_symbol() either, because you can't cast the
ClutterEvent to a ClutterKeyEvent.

The cleanest solution is to turn every accessor into ClutterEvent
methods, accepting a ClutterEvent* and internally checking the event
type.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1585
This commit is contained in:
Emmanuele Bassi
2009-06-06 15:27:37 +01:00
parent 04dc4106e5
commit 41e85f3073
11 changed files with 240 additions and 116 deletions

View File

@@ -925,6 +925,7 @@ clutter_event_get_state
clutter_event_get_time
clutter_event_get_source
clutter_event_get_stage
clutter_event_get_flags
<SUBSECTION>
clutter_event_get
@@ -933,14 +934,21 @@ clutter_event_put
clutter_events_pending
<SUBSECTION>
clutter_button_event_button
clutter_event_get_button
clutter_event_get_click_count
<SUBSECTION>
clutter_key_event_symbol
clutter_key_event_code
clutter_key_event_unicode
clutter_event_get_key_symbol
clutter_event_get_key_code
clutter_event_get_key_unicode
clutter_keysym_to_unicode
<SUBSECTION>
clutter_event_get_related
<SUBSECTION>
clutter_event_get_scroll_direction
<SUBSECTION>
clutter_event_get_device_id
clutter_get_input_device_for_id