4 * An OpenGL based 'interactive canvas' library.
6 * Copyright © 2009, 2010, 2011 Intel Corp.
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.
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.
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/>.
21 * Author: Emmanuele Bassi <ebassi@linux.intel.com>
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
28 #ifndef __CLUTTER_INPUT_DEVICE_H__
29 #define __CLUTTER_INPUT_DEVICE_H__
31 #include <clutter/clutter-types.h>
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))
45 * Generic representation of an input device. The actual contents of this
46 * structure depend on the backend used.
48 typedef struct _ClutterInputDevice ClutterInputDevice;
49 typedef struct _ClutterInputDeviceClass ClutterInputDeviceClass;
51 GType clutter_input_device_get_type (void) G_GNUC_CONST;
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,
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,
65 gboolean clutter_input_device_get_enabled (ClutterInputDevice *device);
67 guint clutter_input_device_get_n_axes (ClutterInputDevice *device);
68 ClutterInputAxis clutter_input_device_get_axis (ClutterInputDevice *device,
70 gboolean clutter_input_device_get_axis_value (ClutterInputDevice *device,
72 ClutterInputAxis axis,
75 guint clutter_input_device_get_n_keys (ClutterInputDevice *device);
76 void clutter_input_device_set_key (ClutterInputDevice *device,
79 ClutterModifierType modifiers);
80 gboolean clutter_input_device_get_key (ClutterInputDevice *device,
83 ClutterModifierType *modifiers);
85 ClutterInputDevice * clutter_input_device_get_associated_device (ClutterInputDevice *device);
86 GList * clutter_input_device_get_slave_devices (ClutterInputDevice *device);
88 void clutter_input_device_update_from_event (ClutterInputDevice *device,
90 gboolean update_stage);
92 CLUTTER_AVAILABLE_IN_1_10
93 void clutter_input_device_grab (ClutterInputDevice *device,
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);
100 gboolean clutter_input_device_keycode_to_evdev (ClutterInputDevice *device,
101 guint hardware_keycode,
102 guint *evdev_keycode);
106 #endif /* __CLUTTER_INPUT_DEVICE_H__ */