[gnome-mag/bonobo-less] Add debug to propery getters and setters. set TargetSize prop on the python test



commit 078d2b2e6abfbdac5189162a6a58128bc3da9887
Author: Fernando Herrera <fherrera onirica com>
Date:   Mon Jul 5 23:01:24 2010 +0200

    Add debug to propery getters and setters. set TargetSize prop on the python test

 magnifier/magnifier.c   |    5 +++++
 magnifier/zoom-region.c |   11 ++++++++++-
 test/dbus-mag-test.py   |   17 ++++++++++++++---
 3 files changed, 29 insertions(+), 4 deletions(-)
---
diff --git a/magnifier/magnifier.c b/magnifier/magnifier.c
index b4d177c..4c3f34d 100644
--- a/magnifier/magnifier.c
+++ b/magnifier/magnifier.c
@@ -1024,6 +1024,8 @@ get_property_cb (GDBusConnection *connection,
 	} else if (g_strcmp0 (property_name, "CrosswireColor") == 0) {
 		retval = g_variant_new_uint32 (magnifier->crosswire_color);
 	}
+    	DBG(g_message ("Get prop\n\tpath %s, interface %s, property name %s\n\t\tValue: %s", 
+                       object_path, interface_name, property_name, g_variant_print (retval, TRUE)));
 
 	return retval;
 }
@@ -1111,6 +1113,9 @@ set_property_cb (GDBusConnection *connection,
 			      NULL);
 	}
 
+    	DBG(g_message ("Set prop\n\tpath %s, interface %s, property name %s\n\t\tValue: %s", 
+                       object_path, interface_name, property_name, g_variant_print (value, TRUE)));
+
 	return TRUE;
 }
 
diff --git a/magnifier/zoom-region.c b/magnifier/zoom-region.c
index 0d28f5c..ea28a0b 100644
--- a/magnifier/zoom-region.c
+++ b/magnifier/zoom-region.c
@@ -171,7 +171,7 @@ reset_timing_stats()
 
 /** DEBUG STUFF **/
 
-#define DEBUG
+#undef DEBUG
 #ifdef DEBUG
 #define DEBUG_RECT(a, b) _debug_announce_rect (a, b)
 #else
@@ -2583,6 +2583,9 @@ method_call_cb (GDBusConnection       *connection,
 	g_assert (zoom_region->alive);
 #endif
 
+
+	DBG(g_message ("Method call\n\tpath %s, interface %s, method name %s\n\t\tValue: %s",
+                       object_path, interface_name, method_name, g_variant_print (parameters, TRUE)));
 	if (g_strcmp0 (method_name, "setMagFactor") == 0) {
 		gdouble  mag_factor_x, mag_factor_y;
 		gboolean retval;
@@ -2825,6 +2828,9 @@ get_property_cb (GDBusConnection *connection,
 		retval = g_variant_new_boolean (zoom_region->exit_magnifier);
 	}
 
+	DBG(g_message ("Get prop\n\tpath %s, interface %s, property name %s\n\t\tValue: %s",
+                       object_path, interface_name, property_name, g_variant_print (retval, TRUE)));
+
 	return retval;
 }
 
@@ -2928,6 +2934,9 @@ set_property_cb (GDBusConnection *connection,
 			      NULL);
 	}
 
+	DBG(g_message ("Set prop\n\tpath %s, interface %s, property name %s\n\t\tValue: %s",
+                       object_path, interface_name, property_name, g_variant_print (value, TRUE)));
+
 	return TRUE;
 }
 
diff --git a/test/dbus-mag-test.py b/test/dbus-mag-test.py
index 194baa9..9a79bdb 100755
--- a/test/dbus-mag-test.py
+++ b/test/dbus-mag-test.py
@@ -22,6 +22,7 @@
 import dbus
 import time
 import sys
+import gtk.gdk
 bus = dbus.SessionBus()
 
 print "Getting magnifier dbus object..."
@@ -52,9 +53,19 @@ print "... system mouse cursor should now be visible, again."
 print "";
 response = raw_input("Press return to continue ...");
 
+# Set the TargetSize
+screen = gtk.gdk.screen_get_default ()
+width = screen.get_width()
+height = screen.get_height()
+x = width / 2
+y = 0
+
+magProps = dbus.Interface( _magProxy, dbus_interface = 'org.freedesktop.DBus.Properties')
+magProps.Set('org.gnome.Magnifier', 'TargetSize', [x, y, width - x, height])
+
 # Create a region
-roi = [10, 10, 300, 150];
-position = [300, 300, 300, 150];
+roi = [0, 0, 300, 300];
+position = [300, 300, 600, 600];
 
 print "Creating a zoom region of ", roi, ", and at ", position
 zoomRegionPath = magProxy.createZoomRegion (4, 4, roi, position);
@@ -69,7 +80,7 @@ else:
 print "";
 
 roi = [200, 100, 300, 200];
-position = [800, 800, 900, 900];
+position = [800, 800, 1000, 900];
 print "Creating another zoom region of ", roi, " , and at ", position
 zoomRegionPath = magProxy.createZoomRegion (2.5, 2.5, roi, position);
 magProxy.addZoomRegion(zoomRegionPath);



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