diff options
| author | Ross Burton <ross@openedhand.com> | 2005-10-25 08:54:57 +0000 | 
|---|---|---|
| committer | Ross Burton <ross@openedhand.com> | 2005-10-25 08:54:57 +0000 | 
| commit | 4e2b0d94ecc4eaeeff9db119e349d8d9754a75b8 (patch) | |
| tree | 2f6e2131ae9abd9025f930fdeafdd11b30d11acb | |
| parent | ef47e01f7593c4844f927752c0462dae7722ff9e (diff) | |
Add a NoReply annotation
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rw-r--r-- | doc/dbus-specification.xml | 5 | ||||
| -rw-r--r-- | glib/dbus-binding-tool-glib.c | 53 | ||||
| -rw-r--r-- | glib/dbus-binding-tool-glib.h | 3 | 
4 files changed, 53 insertions, 17 deletions
| @@ -1,3 +1,12 @@ +2005-10-25  Ross Burton  <ross@openedhand.com> + +	* doc/dbus-specification.xml: +	Document the NoReply annotation. + +	* glib/dbus-binding-tool-glib.h: +	* glib/dbus-binding-tool-glib.c: +	Respect the NoReply annotation. +  2005-10-24  Robert McQueen <robot101@debian.org>  	* python/dbus_bindings.pyx (String, MessageIter): make D-Bus strings diff --git a/doc/dbus-specification.xml b/doc/dbus-specification.xml index 0194ff42..a30e1013 100644 --- a/doc/dbus-specification.xml +++ b/doc/dbus-specification.xml @@ -2454,6 +2454,11 @@  	     <entry>(string)</entry>  	     <entry>The C symbol; may be used for methods and interfaces</entry>  	   </row> +	   <row> +	     <entry>org.freedesktop.DBus.Method.NoReply</entry> +	     <entry>true,false</entry> +	     <entry>If set, don't expect a reply to the method call; defaults to false.</entry> +	   </row>  	 </tbody>         </tgroup>       </informaltable> diff --git a/glib/dbus-binding-tool-glib.c b/glib/dbus-binding-tool-glib.c index 7ad62f5a..1d480975 100644 --- a/glib/dbus-binding-tool-glib.c +++ b/glib/dbus-binding-tool-glib.c @@ -1446,11 +1446,14 @@ generate_client_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error        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 @@ generate_client_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error  	  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);  	} diff --git a/glib/dbus-binding-tool-glib.h b/glib/dbus-binding-tool-glib.h index bbb54f72..83f00a2d 100644 --- a/glib/dbus-binding-tool-glib.h +++ b/glib/dbus-binding-tool-glib.h @@ -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 @@ G_BEGIN_DECLS  #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); | 
