update to 1.10.4
[profile/ivi/clutter.git] / clutter / clutter-click-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  * Inspired by the StClickable class in GNOME Shell, written by:
25  *   Colin Walters <walters@verbum.org>
26  */
27
28 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
29 #error "Only <clutter/clutter.h> can be included directly."
30 #endif
31
32 #ifndef __CLUTTER_CLICK_ACTION_H__
33 #define __CLUTTER_CLICK_ACTION_H__
34
35 #include <clutter/clutter-action.h>
36 #include <clutter/clutter-event.h>
37
38 G_BEGIN_DECLS
39
40 #define CLUTTER_TYPE_CLICK_ACTION               (clutter_click_action_get_type ())
41 #define CLUTTER_CLICK_ACTION(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CLICK_ACTION, ClutterClickAction))
42 #define CLUTTER_IS_CLICK_ACTION(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CLICK_ACTION))
43 #define CLUTTER_CLICK_ACTION_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_CLICK_ACTION, ClutterClickActionClass))
44 #define CLUTTER_IS_CLICK_ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_CLICK_ACTION))
45 #define CLUTTER_CLICK_ACTION_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_CLICK_ACTION, ClutterClickActionClass))
46
47 typedef struct _ClutterClickAction              ClutterClickAction;
48 typedef struct _ClutterClickActionPrivate       ClutterClickActionPrivate;
49 typedef struct _ClutterClickActionClass         ClutterClickActionClass;
50
51 /**
52  * ClutterClickAction:
53  *
54  * The <structname>ClutterClickAction</structname> structure contains
55  * only private data and should be accessed using the provided API
56  *
57  * Since: 1.4
58  */
59 struct _ClutterClickAction
60 {
61   /*< private >*/
62   ClutterAction parent_instance;
63
64   ClutterClickActionPrivate *priv;
65 };
66
67 /**
68  * ClutterClickActionClass:
69  * @clicked: class handler for the #ClutterClickAction::clicked signal
70  * @long_press: class handler for the #ClutterClickAction::long-press signal
71  *
72  * The <structname>ClutterClickActionClass</structname> structure
73  * contains only private data
74  *
75  * Since: 1.4
76  */
77 struct _ClutterClickActionClass
78 {
79   /*< private >*/
80   ClutterActionClass parent_class;
81
82   /*< public >*/
83   void     (* clicked)    (ClutterClickAction    *action,
84                            ClutterActor          *actor);
85
86   gboolean (* long_press) (ClutterClickAction    *action,
87                            ClutterActor          *actor,
88                            ClutterLongPressState  state);
89
90   /*< private >*/
91   void (* _clutter_click_action1) (void);
92   void (* _clutter_click_action2) (void);
93   void (* _clutter_click_action3) (void);
94   void (* _clutter_click_action4) (void);
95   void (* _clutter_click_action5) (void);
96   void (* _clutter_click_action6) (void);
97   void (* _clutter_click_action7) (void);
98 };
99
100 GType clutter_click_action_get_type (void) G_GNUC_CONST;
101
102 ClutterAction *        clutter_click_action_new        (void);
103
104 guint                  clutter_click_action_get_button (ClutterClickAction *action);
105 ClutterModifierType    clutter_click_action_get_state  (ClutterClickAction *action);
106 void                   clutter_click_action_get_coords (ClutterClickAction *action,
107                                                         gfloat             *press_x,
108                                                         gfloat             *press_y);
109
110 void                   clutter_click_action_release    (ClutterClickAction *action);
111
112 G_END_DECLS
113
114 #endif /* __CLUTTER_CLICK_ACTION_H__ */