[gnome-settings-daemon] wacom: Use a define for num elements in matrix



commit 524077f233c9c46080cb960264fa0a54623ba68a
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jan 18 23:16:02 2012 +0000

    wacom: Use a define for num elements in matrix

 plugins/wacom/gsd-wacom-device.c  |    4 ++--
 plugins/wacom/gsd-wacom-device.h  |    4 +++-
 plugins/wacom/gsd-wacom-manager.c |    4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 8ee2c71..291ba49 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -548,7 +548,7 @@ find_output (GsdWacomDevice *device)
 }
 
 static void
-calculate_transformation_matrix (const GdkRectangle mapped, const GdkRectangle desktop, float matrix[9])
+calculate_transformation_matrix (const GdkRectangle mapped, const GdkRectangle desktop, float matrix[NUM_ELEMS_MATRIX])
 {
 	float x_scale = (float)mapped.x / desktop.width;
 	float y_scale = (float)mapped.y / desktop.height;
@@ -603,7 +603,7 @@ gsd_wacom_device_get_display_monitor (GsdWacomDevice *device)
 }
 
 gboolean
-gsd_wacom_device_get_display_matrix (GsdWacomDevice *device, float matrix[9])
+gsd_wacom_device_get_display_matrix (GsdWacomDevice *device, float matrix[NUM_ELEMS_MATRIX])
 {
 	int monitor;
 	GdkRectangle display;
diff --git a/plugins/wacom/gsd-wacom-device.h b/plugins/wacom/gsd-wacom-device.h
index fdf58eb..24b268b 100644
--- a/plugins/wacom/gsd-wacom-device.h
+++ b/plugins/wacom/gsd-wacom-device.h
@@ -76,6 +76,8 @@ typedef enum {
 	WACOM_STYLUS_TYPE_STROKE
 } GsdWacomStylusType;
 
+#define NUM_ELEMS_MATRIX 9
+
 GType            gsd_wacom_stylus_get_type       (void);
 GSettings      * gsd_wacom_stylus_get_settings   (GsdWacomStylus *stylus);
 const char     * gsd_wacom_stylus_get_name       (GsdWacomStylus *stylus);
@@ -99,7 +101,7 @@ GType gsd_wacom_device_get_type     (void);
 
 gint     gsd_wacom_device_get_display_monitor (GsdWacomDevice *device);
 gboolean gsd_wacom_device_get_display_matrix  (GsdWacomDevice *device,
-                                               float           matrix[9]);
+                                               float           matrix[NUM_ELEMS_MATRIX]);
 
 GsdWacomDevice * gsd_wacom_device_new              (GdkDevice *device);
 GList          * gsd_wacom_device_list_styli       (GsdWacomDevice *device);
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index d70f7b9..f2c662c 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -211,10 +211,10 @@ static void
 set_display (GsdWacomDevice  *device,
              GVariant        *value)
 {
-        float matrix[9];
+        float matrix[NUM_ELEMS_MATRIX];
         PropertyHelper property = {
                 .name   = "Coordinate Transformation Matrix",
-                .nitems = 9,
+                .nitems = NUM_ELEMS_MATRIX,
                 .format = 32,
                 .type   = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "FLOAT", True),
         };



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