vala r1347 - in trunk: . gobject



Author: juergbi
Date: Thu May  8 20:57:21 2008
New Revision: 1347
URL: http://svn.gnome.org/viewvc/vala?rev=1347&view=rev

Log:
2008-05-08  Juerg Billeter  <j bitron ch>

	* gobject/valaccodeclassbinding.vala:

	Support properties in D-Bus services,
	based on patch by Yu Feng, fixes bug 531132


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodeclassbinding.vala

Modified: trunk/gobject/valaccodeclassbinding.vala
==============================================================================
--- trunk/gobject/valaccodeclassbinding.vala	(original)
+++ trunk/gobject/valaccodeclassbinding.vala	Thu May  8 20:57:21 2008
@@ -859,6 +859,20 @@
 		}
 		dbus_signals.append_c('"');
 
+		var dbus_props = new StringBuilder();
+		dbus_props.append_c ('"');
+		foreach (Property prop in cl.get_properties ()) {
+			if (prop.access != SymbolAccessibility.PUBLIC) {
+				continue;
+			}
+
+			dbus_props.append (dbus_iface_name);
+			dbus_props.append ("\\0");
+			dbus_props.append (prop.name);
+			dbus_props.append ("\\0");
+		}
+		dbus_props.append_c ('"');
+
 		var dbus_methods_decl = new CCodeDeclaration ("const DBusGMethodInfo");
 		dbus_methods_decl.modifiers = CCodeModifiers.STATIC;
 		dbus_methods_decl.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s_dbus_methods[]".printf (cl.get_lower_case_cname ()), new CCodeConstant (dbus_methods.str)));
@@ -866,7 +880,7 @@
 
 		var dbus_object_info = new CCodeDeclaration ("const DBusGObjectInfo");
 		dbus_object_info.modifiers = CCodeModifiers.STATIC;
-		dbus_object_info.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s_dbus_object_info".printf (cl.get_lower_case_cname ()), new CCodeConstant ("{ 0, %s_dbus_methods, %d, %s, %s, \"\\0\" }".printf (cl.get_lower_case_cname (), method_count, blob.str, dbus_signals.str))));
+		dbus_object_info.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s_dbus_object_info".printf (cl.get_lower_case_cname ()), new CCodeConstant ("{ 0, %s_dbus_methods, %d, %s, %s, %s }".printf (cl.get_lower_case_cname (), method_count, blob.str, dbus_signals.str, dbus_props.str))));
 		codegen.class_init_fragment.append (dbus_object_info);
 
 		var install_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_object_type_install_info"));



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