vala r1412 - in trunk: . gobject



Author: juergbi
Date: Fri May 23 19:25:16 2008
New Revision: 1412
URL: http://svn.gnome.org/viewvc/vala?rev=1412&view=rev

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

	* gobject/valaccodeclassbinding.vala:

	Support [DBus (visible = false)] for methods, properties, and
	signals, based on patch by Ali Sabil, fixes bug 532254


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

Modified: trunk/gobject/valaccodeclassbinding.vala
==============================================================================
--- trunk/gobject/valaccodeclassbinding.vala	(original)
+++ trunk/gobject/valaccodeclassbinding.vala	Fri May 23 19:25:16 2008
@@ -743,6 +743,17 @@
 		return new CCodeExpressionStatement (cwarn);
 	}
 
+	bool is_dbus_visible (CodeNode node) {
+		var dbus_attribute = node.get_attribute ("DBus");
+		if (dbus_attribute != null
+		    && dbus_attribute.has_argument ("visible")
+		    && !dbus_attribute.get_bool ("visible")) {
+			return false;
+		}
+
+		return true;
+	}
+
 	void register_dbus_info () {
 		var dbus = cl.get_attribute ("DBus");
 		if (dbus == null) {
@@ -768,6 +779,9 @@
 			    || m.overrides || m.access != SymbolAccessibility.PUBLIC) {
 				continue;
 			}
+			if (!is_dbus_visible (m)) {
+				continue;
+			}
 
 			var parameters = new Gee.ArrayList<FormalParameter> ();
 			foreach (FormalParameter param in m.get_parameters ()) {
@@ -860,6 +874,9 @@
 			if (sig.access != SymbolAccessibility.PUBLIC) {
 				continue;
 			}
+			if (!is_dbus_visible (sig)) {
+				continue;
+			}
 
 			dbus_signals.append (dbus_iface_name);
 			dbus_signals.append ("\\0");
@@ -874,6 +891,9 @@
 			if (prop.access != SymbolAccessibility.PUBLIC) {
 				continue;
 			}
+			if (!is_dbus_visible (prop)) {
+				continue;
+			}
 
 			dbus_props.append (dbus_iface_name);
 			dbus_props.append ("\\0");



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