Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-gesture-action.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2010  Intel Corporation.
7  * Copyright (C) 2011  Robert Bosch Car Multimedia GmbH.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21  *
22  * Author:
23  *   Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>
24  */
25
26 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
27 #error "Only <clutter/clutter.h> can be included directly."
28 #endif
29
30 #ifndef __CLUTTER_GESTURE_ACTION_H__
31 #define __CLUTTER_GESTURE_ACTION_H__
32
33 #include <clutter/clutter-action.h>
34
35 G_BEGIN_DECLS
36
37 #define CLUTTER_TYPE_GESTURE_ACTION               (clutter_gesture_action_get_type ())
38 #define CLUTTER_GESTURE_ACTION(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureAction))
39 #define CLUTTER_IS_GESTURE_ACTION(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_GESTURE_ACTION))
40 #define CLUTTER_GESTURE_ACTION_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureActionClass))
41 #define CLUTTER_IS_GESTURE_ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_GESTURE_ACTION))
42 #define CLUTTER_GESTURE_ACTION_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_GESTURE_ACTION, ClutterGestureActionClass))
43
44 typedef struct _ClutterGestureAction              ClutterGestureAction;
45 typedef struct _ClutterGestureActionPrivate       ClutterGestureActionPrivate;
46 typedef struct _ClutterGestureActionClass         ClutterGestureActionClass;
47
48 /**
49  * ClutterGestureAction:
50  *
51  * The <structname>ClutterGestureAction</structname> structure contains
52  * only private data and should be accessed using the provided API
53  *
54  * Since: 1.8
55  */
56 struct _ClutterGestureAction
57 {
58   /*< private >*/
59   ClutterAction parent_instance;
60
61   ClutterGestureActionPrivate *priv;
62 };
63
64 /**
65  * ClutterGestureActionClass:
66  * @gesture_begin: class handler for the #ClutterGestureAction::gesture-begin signal
67  * @gesture_progress: class handler for the #ClutterGestureAction::gesture-progress signal
68  * @gesture_end: class handler for the #ClutterGestureAction::gesture-end signal
69  * @gesture_cancel: class handler for the #ClutterGestureAction::gesture-cancel signal
70  *
71  * The <structname>ClutterGestureClass</structname> structure contains only
72  * private data.
73  *
74  * Since: 1.8
75  */
76 struct _ClutterGestureActionClass
77 {
78   /*< private >*/
79   ClutterActionClass parent_class;
80
81   /*< public >*/
82   gboolean (* gesture_begin)    (ClutterGestureAction  *action,
83                                  ClutterActor          *actor);
84   gboolean (* gesture_progress) (ClutterGestureAction  *action,
85                                  ClutterActor          *actor);
86   void     (* gesture_end)      (ClutterGestureAction  *action,
87                                  ClutterActor          *actor);
88   void     (* gesture_cancel)   (ClutterGestureAction  *action,
89                                  ClutterActor          *actor);
90
91   /*< private >*/
92   void (* _clutter_gesture_action1) (void);
93   void (* _clutter_gesture_action2) (void);
94   void (* _clutter_gesture_action3) (void);
95   void (* _clutter_gesture_action4) (void);
96   void (* _clutter_gesture_action5) (void);
97   void (* _clutter_gesture_action6) (void);
98   void (* _clutter_gesture_action7) (void);
99 };
100
101 GType clutter_gesture_action_get_type (void) G_GNUC_CONST;
102
103 ClutterAction * clutter_gesture_action_new                      (void);
104
105 void            clutter_gesture_action_get_press_coords         (ClutterGestureAction *action,
106                                                                  guint                 device,
107                                                                  gfloat               *press_x,
108                                                                  gfloat               *press_y);
109 void            clutter_gesture_action_get_motion_coords        (ClutterGestureAction *action,
110                                                                  guint                 device,
111                                                                  gfloat               *motion_x,
112                                                                  gfloat               *motion_y);
113 void            clutter_gesture_action_get_release_coords       (ClutterGestureAction *action,
114                                                                  guint                 device,
115                                                                  gfloat               *release_x,
116                                                                  gfloat               *release_y);
117
118 G_END_DECLS
119
120 #endif /* __CLUTTER_GESTURE_ACTION_H__ */