Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-binding-pool.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2008  Intel Corporation.
7  *
8  * Authored By: Emmanuele Bassi <ebassi@linux.intel.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22  */
23
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
26 #endif
27
28 #ifndef __CLUTTER_BINDING_POOL_H__
29 #define __CLUTTER_BINDING_POOL_H__
30
31 #include <glib-object.h>
32 #include <clutter/clutter-event.h>
33
34 G_BEGIN_DECLS
35
36 #define CLUTTER_TYPE_BINDING_POOL       (clutter_binding_pool_get_type ())
37 #define CLUTTER_BINDING_POOL(obj)       (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BINDING_POOL, ClutterBindingPool))
38 #define CLUTTER_IS_BINDING_POOL(obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BINDING_POOL))
39
40 /**
41  * ClutterBindingPool:
42  *
43  * Container of key bindings. The #ClutterBindingPool struct is
44  * private.
45  *
46  * Since: 1.0
47  */
48 typedef struct _ClutterBindingPool      ClutterBindingPool;
49 typedef struct _ClutterBindingPoolClass ClutterBindingPoolClass;
50
51 /**
52  * ClutterBindingActionFunc:
53  * @gobject: a #GObject
54  * @action_name: the name of the action
55  * @key_val: the key symbol
56  * @modifiers: bitmask of the modifier flags
57  *
58  * The prototype for the callback function registered with
59  * clutter_binding_pool_install_action() and invoked by
60  * clutter_binding_pool_activate().
61  *
62  * Return value: the function should return %TRUE if the key
63  *   binding has been handled, and return %FALSE otherwise
64  *
65  * Since: 1.0
66  */
67 typedef gboolean (* ClutterBindingActionFunc) (GObject             *gobject,
68                                                const gchar         *action_name,
69                                                guint                key_val,
70                                                ClutterModifierType  modifiers);
71
72 GType clutter_binding_pool_get_type (void) G_GNUC_CONST;
73
74 ClutterBindingPool *  clutter_binding_pool_new              (const gchar         *name);
75 ClutterBindingPool *  clutter_binding_pool_get_for_class    (gpointer             klass);
76 ClutterBindingPool *  clutter_binding_pool_find             (const gchar         *name);
77
78 void                  clutter_binding_pool_install_action   (ClutterBindingPool  *pool,
79                                                              const gchar         *action_name,
80                                                              guint                key_val,
81                                                              ClutterModifierType  modifiers,
82                                                              GCallback            callback,
83                                                              gpointer             data,
84                                                              GDestroyNotify       notify);
85 void                  clutter_binding_pool_install_closure  (ClutterBindingPool  *pool,
86                                                              const gchar         *action_name,
87                                                              guint                key_val,
88                                                              ClutterModifierType  modifiers,
89                                                              GClosure            *closure);
90 void                  clutter_binding_pool_override_action  (ClutterBindingPool  *pool,
91                                                              guint                key_val,
92                                                              ClutterModifierType  modifiers,
93                                                              GCallback            callback,
94                                                              gpointer             data,
95                                                              GDestroyNotify       notify);
96 void                  clutter_binding_pool_override_closure (ClutterBindingPool  *pool,
97                                                              guint                key_val,
98                                                              ClutterModifierType  modifiers,
99                                                              GClosure            *closure);
100
101 const gchar *         clutter_binding_pool_find_action      (ClutterBindingPool  *pool,
102                                                              guint                key_val,
103                                                              ClutterModifierType  modifiers);
104 void                  clutter_binding_pool_remove_action    (ClutterBindingPool  *pool,
105                                                              guint                key_val,
106                                                              ClutterModifierType  modifiers);
107
108 gboolean              clutter_binding_pool_activate         (ClutterBindingPool  *pool,
109                                                              guint                key_val,
110                                                              ClutterModifierType  modifiers,
111                                                              GObject             *gobject);
112
113 void                  clutter_binding_pool_block_action     (ClutterBindingPool  *pool,
114                                                              const gchar         *action_name);
115 void                  clutter_binding_pool_unblock_action   (ClutterBindingPool  *pool,
116                                                              const gchar         *action_name);
117
118 G_END_DECLS
119
120 #endif /* __CLUTTER_BINDING_POOL_H__ */