dbus/glib dbus-binding-tool-glib.c, 1.21, 1.22 dbus-binding-tool-glib.h, 1.7, 1.8

Ross Burton ross at freedesktop.org
Tue Oct 25 01:54:59 PDT 2005


Update of /cvs/dbus/dbus/glib
In directory gabe:/tmp/cvs-serv15215/glib

Modified Files:
	dbus-binding-tool-glib.c dbus-binding-tool-glib.h 
Log Message:
Add a NoReply annotation

Index: dbus-binding-tool-glib.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-binding-tool-glib.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- dbus-binding-tool-glib.c	4 Aug 2005 15:49:30 -0000	1.21
+++ dbus-binding-tool-glib.c	25 Oct 2005 08:54:57 -0000	1.22
@@ -1446,11 +1446,14 @@
 
       for (tmp = methods; tmp != NULL; tmp = g_slist_next (tmp))
         {
-          MethodInfo *method;
+	  MethodInfo *method;
 	  char *method_name;
+	  gboolean is_noreply;
 
           method = (MethodInfo *) tmp->data;
 
+	  is_noreply = method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_NOREPLY) != NULL;
+
 	  if (data->ignore_unsupported && !check_supported_parameters (method))
 	    {
 	      g_warning ("Ignoring unsupported signature in method \"%s\" of interface \"%s\"\n",
@@ -1473,22 +1476,40 @@
 	  WRITE_OR_LOSE (", GError **error)\n\n");
 	  
 	  WRITE_OR_LOSE ("{\n");
-	  
-	  if (!write_printf_to_iochannel ("  return dbus_g_proxy_call (proxy, \"%s\", ", channel, error,
-					  method_info_get_name (method)))
-	    goto io_lose;
-
-	  WRITE_OR_LOSE ("error, ");
-
-	  if (!write_args_for_direction (interface, method, channel, ARG_IN, error))
-	    goto io_lose;
 
-	  WRITE_OR_LOSE ("G_TYPE_INVALID, ");
-
-	  if (!write_args_for_direction (interface, method, channel, ARG_OUT, error))
-	    goto io_lose;
-
-	  WRITE_OR_LOSE ("G_TYPE_INVALID);\n}\n\n");
+	  if (is_noreply) {
+	    if (!write_printf_to_iochannel ("  dbus_g_proxy_call_no_reply (proxy, \"%s\", ", channel, error,
+					    method_info_get_name (method)))
+	      goto io_lose;
+	    
+	    if (!write_args_for_direction (interface, method, channel, ARG_IN, error))
+	      goto io_lose;
+	    
+	    WRITE_OR_LOSE ("G_TYPE_INVALID, ");
+	    
+	    if (!write_args_for_direction (interface, method, channel, ARG_OUT, error))
+	      goto io_lose;
+	    
+	    WRITE_OR_LOSE ("G_TYPE_INVALID);\n");
+	    
+	    WRITE_OR_LOSE ("  return TRUE;\n}\n\n");
+	  } else {
+	    if (!write_printf_to_iochannel ("  return dbus_g_proxy_call (proxy, \"%s\", ", channel, error,
+					    method_info_get_name (method)))
+	      goto io_lose;
+	    
+	    WRITE_OR_LOSE ("error, ");
+	    
+	    if (!write_args_for_direction (interface, method, channel, ARG_IN, error))
+	      goto io_lose;
+	    
+	    WRITE_OR_LOSE ("G_TYPE_INVALID, ");
+	    
+	    if (!write_args_for_direction (interface, method, channel, ARG_OUT, error))
+	      goto io_lose;
+	    
+	    WRITE_OR_LOSE ("G_TYPE_INVALID);\n}\n\n");
+	  }
 
 	  write_async_method_client (channel, interface, method, error);
 	}

Index: dbus-binding-tool-glib.h
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-binding-tool-glib.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- dbus-binding-tool-glib.h	10 Jul 2005 22:54:18 -0000	1.7
+++ dbus-binding-tool-glib.h	25 Oct 2005 08:54:57 -0000	1.8
@@ -10,7 +10,7 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it bwill be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
@@ -29,6 +29,7 @@
 #define DBUS_GLIB_ANNOTATION_ASYNC "org.freedesktop.DBus.GLib.Async"
 #define DBUS_GLIB_ANNOTATION_CONST "org.freedesktop.DBus.GLib.Const"
 #define DBUS_GLIB_ANNOTATION_RETURNVAL "org.freedesktop.DBus.GLib.ReturnVal"
+#define DBUS_GLIB_ANNOTATION_NOREPLY "org.freedesktop.DBus.Method.NoReply"
 
 gboolean dbus_binding_tool_output_glib_client (BaseInfo *info, GIOChannel *channel, gboolean ignore_unsupported, GError **error);
 gboolean dbus_binding_tool_output_glib_server (BaseInfo *info, GIOChannel *channel, const char *prefix, GError **error);



More information about the dbus-commit mailing list