dbus/glib/dbus-gutils.h
Colin Walters 2b97fb81a5 2005-02-27 Colin Walters <walters@verbum.org>
* glib/dbus-gidl.c (property_info_get_type, arg_info_get_type):
	Change return value to const char * instead of int so we can do
	full signatures.
	(struct PropertyInfo, struct ArgInfo): Store char *.
	(property_info_new, arg_info_new): Update parameters, strdup.
	(property_info_unref, arg_info_unref): Free.

	* glib/dbus-gidl.h: Update prototypes.

	* glib/dbus-gparser.c (basic_type_from_string): Delete.
	(validate_signature): New function, just validates signature and
	sets GError.
	(parse_property, parse_arg): Invoke validate_signature.  Store
	signature instead of just type code.

	* glib/dbus-gvalue.c (base_type_from_signature): New utility
	function to return a primary type for a signature, dropping
	information about types in container types.
	(dbus_gvalue_genmarshal_name_from_type)
	(dbus_gvalue_binding_type_from_type)
	(dbus_gvalue_ctype_from_type): Update to take full signature
	 instead of type code.
	(dbus_gtype_to_dbus_type): Moved here from glib/dbus-gobject.c.

	* glib/dbus-gvalue.h: Update prototypes for above.

	* glib/dbus-gobject.c (gtype_to_dbus_type): Moved to
	glib/dbus-gvalue.c as dbus_gtype_to_dbus_type.
	(introspect_properties, introspect_signals, write_interface):
	Update to handle signatures, and remove usage of
	_dbus_gutils_type_to_string.
	(handle_introspect): Print out type codes instead of e.g. "string"
	in hardcoded introspection XML; also use x_AS_STRING constants
	instead of hardcoding in string.

	* glib/dbus-glib-tool.c (pretty_print): Handle signature change
	to string.  Remove usage of _dbus_gutils_type_to_string.

	* glib/dbus-gutils.c (_dbus_gutils_type_to_string): Delete.

	* glib/dbus-gutils.h (_dbus_gutils_type_to_string): Update for
	deletion.

	* glib/dbus-binding-tool-glib.c (compute_marshaller)
	(compute_marshaller_name, generate_glue): Handle signature change
	to string.
	(write_formal_parameters, write_args_for_direction): Ditto, and
	remove FIXME.

	* tools/dbus-tree-view.c (type_to_string): Delete.
	(info_set_func_text): Update to print full signatures.

	* test/glib/test-service-glib.xml: Change types to new
	introspection format.
2005-02-27 17:38:12 +00:00

57 lines
2.1 KiB
C

/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-gutils.h Utils shared between convenience lib and installed lib
*
* Copyright (C) 2003 Red Hat, Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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,
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef DBUS_GLIB_UTILS_H
#define DBUS_GLIB_UTILS_H
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include <dbus/dbus.h>
#include <glib-object.h>
G_BEGIN_DECLS
char **_dbus_gutils_split_path (const char *path);
char *_dbus_gutils_wincaps_to_uscore (const char *uscore);
/* These munge the pointer to enforce that a plain cast won't work,
* accessor functions must be used; i.e. to ensure the ABI
* reflects our encapsulation.
*/
#define _DBUS_POINTER_SHIFT(p) ((void*) (((char*)p) + sizeof (void*)))
#define _DBUS_POINTER_UNSHIFT(p) ((void*) (((char*)p) - sizeof (void*)))
#define DBUS_CONNECTION_FROM_G_CONNECTION(x) ((DBusConnection*) _DBUS_POINTER_UNSHIFT(x))
#define DBUS_MESSAGE_FROM_G_MESSAGE(x) ((DBusMessage*) _DBUS_POINTER_UNSHIFT(x))
#define DBUS_PENDING_CALL_FROM_G_PENDING_CALL(x) ((DBusPendingCall*) _DBUS_POINTER_UNSHIFT(x))
#define DBUS_G_CONNECTION_FROM_CONNECTION(x) ((DBusGConnection*) _DBUS_POINTER_SHIFT(x))
#define DBUS_G_MESSAGE_FROM_MESSAGE(x) ((DBusGMessage*) _DBUS_POINTER_SHIFT(x))
#define DBUS_G_PENDING_CALL_FROM_PENDING_CALL(x) ((DBusGPendingCall*) _DBUS_POINTER_SHIFT(x))
G_END_DECLS
#endif /* DBUS_GLIB_UTILS_H */
#endif /* DOXYGEN_SHOULD_SKIP_THIS */