Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-drag-action.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2010  Intel Corporation.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * Author:
22  *   Emmanuele Bassi <ebassi@linux.intel.com>
23  */
24
25 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
26 #error "Only <clutter/clutter.h> can be included directly."
27 #endif
28
29 #ifndef __CLUTTER_DRAG_ACTION_H__
30 #define __CLUTTER_DRAG_ACTION_H__
31
32 #include <clutter/clutter-action.h>
33 #include <clutter/clutter-event.h>
34
35 G_BEGIN_DECLS
36
37 #define CLUTTER_TYPE_DRAG_ACTION                (clutter_drag_action_get_type ())
38 #define CLUTTER_DRAG_ACTION(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DRAG_ACTION, ClutterDragAction))
39 #define CLUTTER_IS_DRAG_ACTION(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DRAG_ACTION))
40 #define CLUTTER_DRAG_ACTION_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DRAG_ACTION, ClutterDragActionClass))
41 #define CLUTTER_IS_DRAG_ACTION_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DRAG_ACTION))
42 #define CLUTTER_DRAG_ACTION_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DRAG_ACTION, ClutterDragActionClass))
43
44 typedef struct _ClutterDragAction               ClutterDragAction;
45 typedef struct _ClutterDragActionPrivate        ClutterDragActionPrivate;
46 typedef struct _ClutterDragActionClass          ClutterDragActionClass;
47
48 /**
49  * ClutterDragAction:
50  *
51  * The <structname>ClutterDragAction</structname> structure contains only
52  * private data and should be accessed using the provided API
53  *
54  * Since: 1.4
55  */
56 struct _ClutterDragAction
57 {
58   /*< private >*/
59   ClutterAction parent_instance;
60
61   ClutterDragActionPrivate *priv;
62 };
63
64 /**
65  * ClutterDragActionClass:
66  * @drag_begin: class handler of the #ClutterDragAction::drag-begin signal
67  * @drag_motion: class handler of the #ClutterDragAction::drag-motion signal
68  * @drag_end: class handler of the #ClutterDragAction::drag-end signal
69  *
70  * The <structname>ClutterDragActionClass</structname> structure contains
71  * only private data
72  *
73  * Since: 1.4
74  */
75 struct _ClutterDragActionClass
76 {
77   /*< private >*/
78   ClutterActionClass parent_class;
79
80   /*< public >*/
81   void (* drag_begin)  (ClutterDragAction   *action,
82                         ClutterActor        *actor,
83                         gfloat               event_x,
84                         gfloat               event_y,
85                         ClutterModifierType  modifiers);
86   void (* drag_motion) (ClutterDragAction   *action,
87                         ClutterActor        *actor,
88                         gfloat               delta_x,
89                         gfloat               delta_y);
90   void (* drag_end)    (ClutterDragAction   *action,
91                         ClutterActor        *actor,
92                         gfloat               event_x,
93                         gfloat               event_y,
94                         ClutterModifierType  modifiers);
95
96   /*< private >*/
97   void (* _clutter_drag_action1) (void);
98   void (* _clutter_drag_action2) (void);
99   void (* _clutter_drag_action3) (void);
100   void (* _clutter_drag_action4) (void);
101   void (* _clutter_drag_action5) (void);
102 };
103
104 GType clutter_drag_action_get_type (void) G_GNUC_CONST;
105
106 ClutterAction * clutter_drag_action_new                   (void);
107
108 void            clutter_drag_action_set_drag_threshold (ClutterDragAction *action,
109                                                         gint               x_threshold,
110                                                         gint               y_threshold);
111 void            clutter_drag_action_get_drag_threshold (ClutterDragAction *action,
112                                                         guint             *x_threshold,
113                                                         guint             *y_threshold);
114 void            clutter_drag_action_set_drag_handle    (ClutterDragAction *action,
115                                                         ClutterActor      *handle);
116 ClutterActor *  clutter_drag_action_get_drag_handle    (ClutterDragAction *action);
117 void            clutter_drag_action_set_drag_axis      (ClutterDragAction *action,
118                                                         ClutterDragAxis    axis);
119 ClutterDragAxis clutter_drag_action_get_drag_axis      (ClutterDragAction *action);
120
121 void            clutter_drag_action_get_press_coords   (ClutterDragAction *action,
122                                                         gfloat            *press_x,
123                                                         gfloat            *press_y);
124 void            clutter_drag_action_get_motion_coords  (ClutterDragAction *action,
125                                                         gfloat            *motion_x,
126                                                         gfloat            *motion_y);
127
128 G_END_DECLS
129
130 #endif /* __CLUTTER_DRAG_ACTION_H__ */