]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdkdevice.h
x11: Consolidate root window event setting in one place
[~andy/gtk] / gdk / gdkdevice.h
index 2c797a9fc820343f870b019429ddecd756c6b30f..c620905a60e5003632f35ecb548e4031ee0cbb6a 100644 (file)
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef __GDK_DEVICE_H__
+#define __GDK_DEVICE_H__
+
 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
 #error "Only <gdk/gdk.h> can be included directly."
 #endif
 
-#ifndef __GDK_DEVICE_H__
-#define __GDK_DEVICE_H__
-
 #include <gdk/gdktypes.h>
 
 
@@ -33,27 +31,8 @@ G_BEGIN_DECLS
 #define GDK_DEVICE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE, GdkDevice))
 #define GDK_IS_DEVICE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE))
 
-typedef struct _GdkDevice GdkDevice;
-typedef struct _GdkDevicePrivate GdkDevicePrivate;
 typedef struct _GdkTimeCoord GdkTimeCoord;
 
-/**
- * GdkExtensionMode:
- * @GDK_EXTENSION_EVENTS_NONE: no extension events are desired.
- * @GDK_EXTENSION_EVENTS_ALL: all extension events are desired.
- * @GDK_EXTENSION_EVENTS_CURSOR: extension events are desired only if a cursor
- *                               will be displayed for the device.
- *
- * An enumeration used to specify which extension events
- * are desired for a particular widget.
- */
-typedef enum
-{
-  GDK_EXTENSION_EVENTS_NONE,
-  GDK_EXTENSION_EVENTS_ALL,
-  GDK_EXTENSION_EVENTS_CURSOR
-} GdkExtensionMode;
-
 /**
  * GdkInputSource:
  * @GDK_SOURCE_MOUSE: the device is a mouse. (This will be reported for the core
@@ -63,6 +42,10 @@ typedef enum
  *                     of a stylus on a graphics tablet.
  * @GDK_SOURCE_CURSOR: the device is a graphics tablet "puck" or similar device.
  * @GDK_SOURCE_KEYBOARD: the device is a keyboard.
+ * @GDK_SOURCE_TOUCHSCREEN: the device is a direct-input touch device, such
+ *     as a touchscreen or tablet. This device type has been added in 3.4.
+ * @GDK_SOURCE_TOUCHPAD: the device is an indirect touch device, such
+ *     as a touchpad. This device type has been added in 3.4.
  *
  * An enumeration describing the type of an input device in general terms.
  */
@@ -72,7 +55,9 @@ typedef enum
   GDK_SOURCE_PEN,
   GDK_SOURCE_ERASER,
   GDK_SOURCE_CURSOR,
-  GDK_SOURCE_KEYBOARD
+  GDK_SOURCE_KEYBOARD,
+  GDK_SOURCE_TOUCHSCREEN,
+  GDK_SOURCE_TOUCHPAD
 } GdkInputSource;
 
 /**
@@ -101,7 +86,7 @@ typedef enum
  * @GDK_AXIS_Y: the axis is used as the y axis.
  * @GDK_AXIS_PRESSURE: the axis is used for pressure information.
  * @GDK_AXIS_XTILT: the axis is used for x tilt information.
- * @GDK_AXIS_YTILT: the axis is used for x tilt information.
+ * @GDK_AXIS_YTILT: the axis is used for y tilt information.
  * @GDK_AXIS_WHEEL: the axis is used for wheel information.
  * @GDK_AXIS_LAST: a constant equal to the numerically highest axis value.
  *
@@ -156,27 +141,17 @@ struct _GdkTimeCoord
   gdouble axes[GDK_MAX_TIMECOORD_AXES];
 };
 
-struct _GdkDevice
-{
-  GObject parent_instance;
-
-  /*< private >*/
-  GdkDevicePrivate *priv;
-};
-
-GType gdk_device_get_type (void) G_GNUC_CONST;
+GType                 gdk_device_get_type       (void) G_GNUC_CONST;
 
-G_CONST_RETURN gchar *gdk_device_get_name       (GdkDevice *device);
+const gchar *         gdk_device_get_name       (GdkDevice *device);
 gboolean              gdk_device_get_has_cursor (GdkDevice *device);
 
 /* Functions to configure a device */
 GdkInputSource gdk_device_get_source    (GdkDevice      *device);
-void           gdk_device_set_source    (GdkDevice      *device,
-                                        GdkInputSource  source);
 
 GdkInputMode   gdk_device_get_mode      (GdkDevice      *device);
 gboolean       gdk_device_set_mode      (GdkDevice      *device,
-                                        GdkInputMode    mode);
+                                         GdkInputMode    mode);
 
 gint           gdk_device_get_n_keys    (GdkDevice       *device);
 gboolean       gdk_device_get_key       (GdkDevice       *device,
@@ -184,9 +159,9 @@ gboolean       gdk_device_get_key       (GdkDevice       *device,
                                          guint           *keyval,
                                          GdkModifierType *modifiers);
 void           gdk_device_set_key       (GdkDevice      *device,
-                                        guint           index_,
-                                        guint           keyval,
-                                        GdkModifierType modifiers);
+                                         guint           index_,
+                                         guint           keyval,
+                                         GdkModifierType modifiers);
 
 GdkAxisUse     gdk_device_get_axis_use  (GdkDevice         *device,
                                          guint              index_);
@@ -196,17 +171,26 @@ void           gdk_device_set_axis_use  (GdkDevice         *device,
 
 
 void     gdk_device_get_state    (GdkDevice         *device,
-                                 GdkWindow         *window,
-                                 gdouble           *axes,
-                                 GdkModifierType   *mask);
+                                  GdkWindow         *window,
+                                  gdouble           *axes,
+                                  GdkModifierType   *mask);
+void     gdk_device_get_position (GdkDevice         *device,
+                                  GdkScreen        **screen,
+                                  gint              *x,
+                                  gint              *y);
+GdkWindow *
+         gdk_device_get_window_at_position
+                                 (GdkDevice         *device,
+                                  gint              *win_x,
+                                  gint              *win_y);
 gboolean gdk_device_get_history  (GdkDevice         *device,
-                                 GdkWindow         *window,
-                                 guint32            start,
-                                 guint32            stop,
-                                 GdkTimeCoord    ***events,
-                                 gint              *n_events);
+                                  GdkWindow         *window,
+                                  guint32            start,
+                                  guint32            stop,
+                                  GdkTimeCoord    ***events,
+                                  gint              *n_events);
 void     gdk_device_free_history (GdkTimeCoord     **events,
-                                 gint               n_events);
+                                  gint               n_events);
 
 gint     gdk_device_get_n_axes     (GdkDevice       *device);
 GList *  gdk_device_list_axes      (GdkDevice       *device);
@@ -216,9 +200,9 @@ gboolean gdk_device_get_axis_value (GdkDevice       *device,
                                     gdouble         *value);
 
 gboolean gdk_device_get_axis     (GdkDevice         *device,
-                                 gdouble           *axes,
-                                 GdkAxisUse         use,
-                                 gdouble           *value);
+                                  gdouble           *axes,
+                                  GdkAxisUse         use,
+                                  gdouble           *value);
 GdkDisplay * gdk_device_get_display (GdkDevice      *device);
 
 GdkDevice  * gdk_device_get_associated_device (GdkDevice     *device);
@@ -237,6 +221,11 @@ GdkGrabStatus gdk_device_grab        (GdkDevice        *device,
 void          gdk_device_ungrab      (GdkDevice        *device,
                                       guint32           time_);
 
+void          gdk_device_warp        (GdkDevice        *device,
+                                      GdkScreen        *screen,
+                                      gint              x,
+                                      gint              y);
+
 gboolean gdk_device_grab_info_libgtk_only (GdkDisplay  *display,
                                            GdkDevice   *device,
                                            GdkWindow  **grab_window,