[gtk+/events-refactor: 1082/1085] Compile again with xinput support enabled.



commit 32ee1fa82f5d905f231ad3309498e348c114d659
Author: Carlos Garnacho <carlos gnome org>
Date:   Fri Sep 25 01:15:07 2009 +0200

    Compile again with xinput support enabled.
    
    The events refactor broke build when xinput is enabled, actual XInput support
    is still broken.

 gdk/gdk.symbols           |   15 +++++++++++++--
 gdk/gdkdevice.c           |   25 -------------------------
 gdk/x11/Makefile.am       |    4 +++-
 gdk/x11/gdkinput-none.c   |   11 -----------
 gdk/x11/gdkinput-x11.c    |   14 ++++++++++++++
 gdk/x11/gdkinput-xfree.c  |    8 --------
 gdk/x11/gdkinputprivate.h |    2 --
 7 files changed, 30 insertions(+), 49 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 0755427..04ad233 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -387,13 +387,24 @@ gdk_device_manager_get_type G_GNUC_CONST
 gdk_device_free_history
 gdk_device_get_axis
 gdk_device_get_history
-gdk_device_get_state
 gdk_device_get_type G_GNUC_CONST
 gdk_device_set_axis_use
 gdk_device_set_key
-gdk_device_set_mode
 gdk_device_set_source
 #endif
+
+#if IN_FILE(__GDK_INPUT_NONE_C__)
+gdk_device_get_state
+gdk_device_set_mode
+#endif
+
+#if IN_FILE(__GDK_INPUT_XFREE_C__)
+gdk_device_set_mode
+#endif
+
+#if IN_FILE(__GDK_INPUT_X11_C__)
+gdk_device_get_state
+#endif
 #endif
 
 #if IN_HEADER(__GDK_INPUT_H__)
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 19564b2..6cba30e 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -207,19 +207,6 @@ gdk_device_get_property (GObject    *object,
     }
 }
 
-void
-gdk_device_get_state (GdkDevice       *device,
-                      GdkWindow       *window,
-                      gdouble         *axes,
-                      GdkModifierType *mask)
-{
-  g_return_if_fail (GDK_IS_DEVICE (device));
-  g_return_if_fail (GDK_IS_WINDOW (window));
-
-  if (GDK_DEVICE_GET_CLASS (device)->get_state)
-    GDK_DEVICE_GET_CLASS (device)->get_state (device, window, axes, mask);
-}
-
 gboolean
 gdk_device_get_history (GdkDevice      *device,
                         GdkWindow      *window,
@@ -260,18 +247,6 @@ gdk_device_set_source (GdkDevice      *device,
   device->source = source;
 }
 
-gboolean
-gdk_device_set_mode (GdkDevice    *device,
-                     GdkInputMode  mode)
-{
-  g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
-
-  device->mode = mode;
-  g_object_notify (G_OBJECT (device), "input-mode");
-
-  return TRUE;
-}
-
 void
 gdk_device_set_key (GdkDevice      *device,
 		    guint           index,
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index b6f7771..3dbcbb3 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -23,6 +23,8 @@ libgdk_x11_la_SOURCES =    	\
 	gdkasync.h		\
 	gdkcolor-x11.c	   	\
 	gdkcursor-x11.c	   	\
+	gdkdevice-core.c	\
+	gdkdevicemanager-core.c \
 	gdkdevicemanager-x11.c	\
 	gdkdisplay-x11.c	\
 	gdkdisplay-x11.h	\
@@ -64,7 +66,7 @@ libgdk_x11_la_SOURCES =    	\
 if XINPUT_XFREE
 libgdk_x11_la_SOURCES += gdkinput-x11.c gdkinput-xfree.c
 else
-libgdk_x11_la_SOURCES += gdkdevicemanager-core.c gdkdevice-core.c
+libgdk_x11_la_SOURCES += gdkinput-none.c
 endif
 
 
diff --git a/gdk/x11/gdkinput-none.c b/gdk/x11/gdkinput-none.c
index 4d21bef..1b392d2 100644
--- a/gdk/x11/gdkinput-none.c
+++ b/gdk/x11/gdkinput-none.c
@@ -29,17 +29,6 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-void
-_gdk_input_init (GdkDisplay *display)
-{
-  GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
-  
-  _gdk_init_input_core (display);
-  
-  display_x11->input_devices = g_list_append (NULL, display->core_pointer);
-  display->ignore_core_events = FALSE;
-}
-
 void 
 gdk_device_get_state (GdkDevice       *device,
 		      GdkWindow       *window,
diff --git a/gdk/x11/gdkinput-x11.c b/gdk/x11/gdkinput-x11.c
index c0b71e7..fffc0c8 100644
--- a/gdk/x11/gdkinput-x11.c
+++ b/gdk/x11/gdkinput-x11.c
@@ -729,6 +729,20 @@ _gdk_input_common_other_event (GdkEvent         *event,
   return FALSE;			/* wasn't one of our event types */
 }
 
+static GdkTimeCoord **
+_gdk_device_allocate_history (GdkDevice *device,
+			      gint       n_events)
+{
+  GdkTimeCoord **result = g_new (GdkTimeCoord *, n_events);
+  gint i;
+
+  for (i=0; i<n_events; i++)
+    result[i] = g_malloc (sizeof (GdkTimeCoord) -
+			  sizeof (double) * (GDK_MAX_TIMECOORD_AXES - device->num_axes));
+
+  return result;
+}
+
 gboolean
 _gdk_device_get_history (GdkDevice         *device,
 			 GdkWindow         *window,
diff --git a/gdk/x11/gdkinput-xfree.c b/gdk/x11/gdkinput-xfree.c
index 50bb94b..e89b3a4 100644
--- a/gdk/x11/gdkinput-xfree.c
+++ b/gdk/x11/gdkinput-xfree.c
@@ -33,14 +33,6 @@
 
 static void gdk_input_check_proximity (GdkDisplay *display);
 
-void
-_gdk_input_init(GdkDisplay *display)
-{
-  _gdk_init_input_core (display);
-  display->ignore_core_events = FALSE;
-  _gdk_input_common_init (display, FALSE);
-}
-
 gboolean
 gdk_device_set_mode (GdkDevice      *device,
 		     GdkInputMode    mode)
diff --git a/gdk/x11/gdkinputprivate.h b/gdk/x11/gdkinputprivate.h
index 0a7443b..71b806f 100644
--- a/gdk/x11/gdkinputprivate.h
+++ b/gdk/x11/gdkinputprivate.h
@@ -130,8 +130,6 @@ struct _GdkInputWindow
 
 GdkInputWindow *_gdk_input_window_find       (GdkWindow *window);
 void            _gdk_input_window_destroy    (GdkWindow *window);
-GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
-					      gint       n_events);
 void            _gdk_init_input_core         (GdkDisplay *display);
 
 /* The following functions are provided by each implementation



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]