Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-input-device.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright © 2009, 2010, 2011  Intel Corp.
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: Emmanuele Bassi <ebassi@linux.intel.com>
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_INPUT_DEVICE_H__
29 #define __CLUTTER_INPUT_DEVICE_H__
30
31 #include <clutter/clutter-types.h>
32
33 G_BEGIN_DECLS
34
35 #define CLUTTER_TYPE_INPUT_DEVICE               (clutter_input_device_get_type ())
36 #define CLUTTER_INPUT_DEVICE(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_INPUT_DEVICE, ClutterInputDevice))
37 #define CLUTTER_IS_INPUT_DEVICE(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_INPUT_DEVICE))
38 #define CLUTTER_INPUT_DEVICE_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_INPUT_DEVICE, ClutterInputDeviceClass))
39 #define CLUTTER_IS_INPUT_DEVICE_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_INPUT_DEVICE))
40 #define CLUTTER_INPUT_DEVICE_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_INPUT_DEVICE, ClutterInputDeviceClass))
41
42 /**
43  * ClutterInputDevice:
44  *
45  * Generic representation of an input device. The actual contents of this
46  * structure depend on the backend used.
47  */
48 typedef struct _ClutterInputDevice      ClutterInputDevice;
49 typedef struct _ClutterInputDeviceClass ClutterInputDeviceClass;
50
51 GType clutter_input_device_get_type (void) G_GNUC_CONST;
52
53 ClutterInputDeviceType  clutter_input_device_get_device_type    (ClutterInputDevice  *device);
54 gint                    clutter_input_device_get_device_id      (ClutterInputDevice  *device);
55 void                    clutter_input_device_get_device_coords  (ClutterInputDevice  *device,
56                                                                  gint                *x,
57                                                                  gint                *y);
58 ClutterActor *          clutter_input_device_get_pointer_actor  (ClutterInputDevice  *device);
59 ClutterStage *          clutter_input_device_get_pointer_stage  (ClutterInputDevice  *device);
60 const gchar *           clutter_input_device_get_device_name    (ClutterInputDevice  *device);
61 ClutterInputMode        clutter_input_device_get_device_mode    (ClutterInputDevice  *device);
62 gboolean                clutter_input_device_get_has_cursor     (ClutterInputDevice  *device);
63 void                    clutter_input_device_set_enabled        (ClutterInputDevice  *device,
64                                                                  gboolean             enabled);
65 gboolean                clutter_input_device_get_enabled        (ClutterInputDevice  *device);
66
67 guint                   clutter_input_device_get_n_axes         (ClutterInputDevice  *device);
68 ClutterInputAxis        clutter_input_device_get_axis           (ClutterInputDevice  *device,
69                                                                  guint                index_);
70 gboolean                clutter_input_device_get_axis_value     (ClutterInputDevice  *device,
71                                                                  gdouble             *axes,
72                                                                  ClutterInputAxis     axis,
73                                                                  gdouble             *value);
74
75 guint                   clutter_input_device_get_n_keys         (ClutterInputDevice  *device);
76 void                    clutter_input_device_set_key            (ClutterInputDevice  *device,
77                                                                  guint                index_,
78                                                                  guint                keyval,
79                                                                  ClutterModifierType  modifiers);
80 gboolean                clutter_input_device_get_key            (ClutterInputDevice  *device,
81                                                                  guint                index_,
82                                                                  guint               *keyval,
83                                                                  ClutterModifierType *modifiers);
84
85 ClutterInputDevice *    clutter_input_device_get_associated_device (ClutterInputDevice *device);
86 GList *                 clutter_input_device_get_slave_devices  (ClutterInputDevice  *device);
87
88 void                    clutter_input_device_update_from_event  (ClutterInputDevice  *device,
89                                                                  ClutterEvent        *event,
90                                                                  gboolean             update_stage);
91
92 CLUTTER_AVAILABLE_IN_1_10
93 void                    clutter_input_device_grab               (ClutterInputDevice  *device,
94                                                                  ClutterActor        *actor);
95 CLUTTER_AVAILABLE_IN_1_10
96 void                    clutter_input_device_ungrab             (ClutterInputDevice  *device);
97 CLUTTER_AVAILABLE_IN_1_10
98 ClutterActor *          clutter_input_device_get_grabbed_actor  (ClutterInputDevice  *device);
99
100 gboolean                clutter_input_device_keycode_to_evdev   (ClutterInputDevice *device,
101                                                                  guint               hardware_keycode,
102                                                                  guint              *evdev_keycode);
103
104 G_END_DECLS
105
106 #endif /* __CLUTTER_INPUT_DEVICE_H__ */