From 8d38a2e2c5dc95de992c4d856ec1b0c0948bca3e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 29 Aug 2003 01:05:00 +0000 Subject: 2003-08-28 Havoc Pennington purge DBusObjectID * dbus/dbus-connection.c: port to no ObjectID, create a DBusObjectTree, rename ObjectTree to ObjectPath in public API * dbus/dbus-connection.h (struct DBusObjectTreeVTable): delete everything except UnregisterFunction and MessageFunction * dbus/dbus-marshal.c: port away from DBusObjectID, add DBUS_TYPE_OBJECT_PATH * dbus/dbus-object-registry.[hc], dbus/dbus-object.[hc], dbus/dbus-objectid.[hc]: remove these, we are moving to path-based object IDs --- dbus/dbus-connection.h | 59 ++++++++++++++++---------------------------------- 1 file changed, 19 insertions(+), 40 deletions(-) (limited to 'dbus/dbus-connection.h') diff --git a/dbus/dbus-connection.h b/dbus/dbus-connection.h index 7204c8ed..12ad0682 100644 --- a/dbus/dbus-connection.h +++ b/dbus/dbus-connection.h @@ -1,7 +1,7 @@ /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-connection.h DBusConnection object * - * Copyright (C) 2002 Red Hat Inc. + * Copyright (C) 2002, 2003 Red Hat Inc. * * Licensed under the Academic Free License version 1.2 * @@ -29,7 +29,7 @@ #include #include -#include +#include DBUS_BEGIN_DECLS; @@ -38,6 +38,8 @@ typedef struct DBusTimeout DBusTimeout; typedef struct DBusMessageHandler DBusMessageHandler; typedef struct DBusPreallocatedSend DBusPreallocatedSend; typedef struct DBusPendingCall DBusPendingCall; +typedef struct DBusConnection DBusConnection; +typedef struct DBusObjectPathVTable DBusObjectPathVTable; typedef enum { @@ -57,6 +59,13 @@ typedef enum DBUS_DISPATCH_NEED_MEMORY /**< More memory is needed to continue. */ } DBusDispatchStatus; +typedef enum +{ + DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect */ + DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect */ + DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory to return another result */ +} DBusHandlerResult; + typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch, void *data); typedef void (* DBusWatchToggledFunction) (DBusWatch *watch, @@ -159,16 +168,6 @@ dbus_bool_t dbus_connection_add_filter (DBusConnection *connection, void dbus_connection_remove_filter (DBusConnection *connection, DBusMessageHandler *handler); -/* Objects */ -dbus_bool_t dbus_connection_register_object (DBusConnection *connection, - const char **interfaces, - const DBusObjectVTable *vtable, - void *object_impl, - DBusObjectID *object_id); -void dbus_connection_unregister_object (DBusConnection *connection, - const DBusObjectID *object_id); - - /* Other */ dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p); void dbus_connection_free_data_slot (dbus_int32_t *slot_p); @@ -200,37 +199,17 @@ void dbus_connection_send_preallocated (DBusConnection /* Object tree functionality */ -typedef struct DBusObjectTreeVTable DBusObjectTreeVTable; - -typedef void (* DBusObjectTreeUnregisterFunction) (DBusConnection *connection, +typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection, const char **path, void *user_data); -typedef DBusHandlerResult (* DBusObjectTreeMessageFunction) (DBusConnection *connection, +typedef DBusHandlerResult (* DBusObjectPathMessageFunction) (DBusConnection *connection, DBusMessage *message, void *user_data); -typedef dbus_bool_t (* DBusObjectTreeSubdirsFunction) (DBusConnection *connection, - const char **path, - char ***subdirs, - int *n_subdirs, - void *user_data); -typedef dbus_bool_t (* DBusObjectTreeObjectsFunction) (DBusConnection *connection, - const char **path, - DBusObjectID **object_ids, - int *n_object_ids, - void *user_data); -typedef dbus_bool_t (* DBusObjectTreeMethodsFunction) (DBusConnection *connection, - const char **path, - DBusObjectID **object_ids, - int *n_object_ids, - void *user_data); -struct DBusObjectTreeVTable +struct DBusObjectPathVTable { - DBusObjectTreeUnregisterFunction unregister_function; - DBusObjectTreeMessageFunction message_function; - DBusObjectTreeSubdirsFunction subdirs_function; - DBusObjectTreeObjectsFunction objects_function; - DBusObjectTreeMethodsFunction methods_function; + DBusObjectPathUnregisterFunction unregister_function; + DBusObjectPathMessageFunction message_function; void (* dbus_internal_pad1) (void *); void (* dbus_internal_pad2) (void *); @@ -238,11 +217,11 @@ struct DBusObjectTreeVTable void (* dbus_internal_pad4) (void *); }; -dbus_bool_t dbus_connection_register_object_tree (DBusConnection *connection, +dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection, const char **path, - const DBusObjectTreeVTable *vtable, + const DBusObjectPathVTable *vtable, void *user_data); -void dbus_connection_unregister_object_tree (DBusConnection *connection, +void dbus_connection_unregister_object_path (DBusConnection *connection, const char **path); -- cgit