diff options
author | Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> | 2011-03-09 10:06:44 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2011-06-10 14:02:17 +0100 |
commit | ba72235b66ee956977ad6e5c7a8510f9f23a3517 (patch) | |
tree | 3f7c9fd32152d5fcdc19c767ee804e849c2181eb /clutter/clutter-gesture-action.h | |
parent | 501208758808c9dd05f754d46e883766c4c1264b (diff) | |
download | clutter-ba72235b66ee956977ad6e5c7a8510f9f23a3517.tar.gz |
Add ClutterSwipeAction and ClutterGestureAction
To allow actors to handle gestures in a more organized way.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2585
Diffstat (limited to 'clutter/clutter-gesture-action.h')
-rw-r--r-- | clutter/clutter-gesture-action.h | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/clutter/clutter-gesture-action.h b/clutter/clutter-gesture-action.h new file mode 100644 index 000000000..e1f3efaa2 --- /dev/null +++ b/clutter/clutter-gesture-action.h @@ -0,0 +1,120 @@ +/* + * Clutter. + * + * An OpenGL based 'interactive canvas' library. + * + * Copyright (C) 2010 Intel Corporation. + * Copyright (C) 2011 Robert Bosch Car Multimedia GmbH. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + * Author: + * Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> + */ + +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only <clutter/clutter.h> can be included directly." +#endif + +#ifndef __CLUTTER_GESTURE_ACTION_H__ +#define __CLUTTER_GESTURE_ACTION_H__ + +#include <clutter/clutter-action.h> + +G_BEGIN_DECLS + +#define CLUTTER_TYPE_GESTURE_ACTION (clutter_gesture_action_get_type ()) +#define CLUTTER_GESTURE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureAction)) +#define CLUTTER_IS_GESTURE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_GESTURE_ACTION)) +#define CLUTTER_GESTURE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureActionClass)) +#define CLUTTER_IS_GESTURE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_GESTURE_ACTION)) +#define CLUTTER_GESTURE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureActionClass)) + +typedef struct _ClutterGestureAction ClutterGestureAction; +typedef struct _ClutterGestureActionPrivate ClutterGestureActionPrivate; +typedef struct _ClutterGestureActionClass ClutterGestureActionClass; + +/** + * ClutterGestureAction: + * + * The <structname>ClutterGestureAction</structname> structure contains + * only private data and should be accessed using the provided API + * + * Since: 1.8 + */ +struct _ClutterGestureAction +{ + /*< private >*/ + ClutterAction parent_instance; + + ClutterGestureActionPrivate *priv; +}; + +/** + * ClutterGestureActionClass: + * @gesture_begin: class handler for the #ClutterGestureAction::gesture-begin signal + * + * Since: 1.8 + */ +struct _ClutterGestureActionClass +{ + /*< private >*/ + ClutterActionClass parent_class; + + /*< public >*/ + gboolean (* gesture_begin) (ClutterGestureAction *action, + ClutterActor *actor); + gboolean (* gesture_progress) (ClutterGestureAction *action, + ClutterActor *actor); + void (* gesture_end) (ClutterGestureAction *action, + ClutterActor *actor); + void (* gesture_cancel) (ClutterGestureAction *action, + ClutterActor *actor); + + /*< private >*/ + void (* _clutter_gesture_action1) (void); + void (* _clutter_gesture_action2) (void); + void (* _clutter_gesture_action3) (void); + void (* _clutter_gesture_action4) (void); + void (* _clutter_gesture_action5) (void); + void (* _clutter_gesture_action6) (void); + void (* _clutter_gesture_action7) (void); +}; + +GType clutter_gesture_action_get_type (void) G_GNUC_CONST; + +ClutterAction *clutter_gesture_action_new (void); + +void clutter_gesture_action_get_press_coords (ClutterGestureAction *action, + guint device, + gfloat *press_x, + gfloat *press_y); + +void clutter_gesture_action_get_motion_coords (ClutterGestureAction *action, + guint device, + gfloat *motion_x, + gfloat *motion_y); + +void clutter_gesture_action_get_release_coords (ClutterGestureAction *action, + guint device, + gfloat *release_x, + gfloat *release_y); + +void clutter_gesture_action_set_required_devices (ClutterGestureAction *action, + guint n_required_devices); +guint clutter_gesture_action_get_required_devices (ClutterGestureAction *action); + +G_END_DECLS + +#endif /* __CLUTTER_GESTURE_ACTION_H__ */ |