diff options
author | Ted Gould <ted@gould.cx> | 2010-10-14 13:42:38 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-10-14 13:42:38 -0500 |
commit | 2cc94b5a4b7016d8bf01eec34b6ff7e771d8e682 (patch) | |
tree | d741a134b3446128fb78d2f4758ea5fa46bb8faf /libdbusmenu-glib | |
parent | 1f98fff4723354444fe41fe3492b4a1681fdef14 (diff) | |
download | libdbusmenu-2cc94b5a4b7016d8bf01eec34b6ff7e771d8e682.tar.gz libdbusmenu-2cc94b5a4b7016d8bf01eec34b6ff7e771d8e682.tar.bz2 libdbusmenu-2cc94b5a4b7016d8bf01eec34b6ff7e771d8e682.zip |
Setting up a method table for the dbus interface
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/server.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 7a1b98e..ddf242f 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -98,6 +98,21 @@ enum { LAST_ERROR }; +/* Method Table */ +typedef void (*MethodTableFunc) (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * invocation); + +typedef struct _method_table_t method_table_t; +struct _method_table_t { + const gchar * interned_name; + MethodTableFunc func; +}; + +enum { + METHOD_GET_LAYOUT = 0, + /* Counter, do not remove! */ + METHOD_COUNT +}; + /* Prototype */ static void dbusmenu_server_class_init (DbusmenuServerClass *class); static void dbusmenu_server_init (DbusmenuServer *self); @@ -155,6 +170,7 @@ static const GDBusInterfaceVTable dbusmenu_interface_table = { get_property: bus_get_prop, set_property: NULL /* No properties that can be set */ }; +static method_table_t dbusmenu_method_table[METHOD_COUNT]; G_DEFINE_TYPE (DbusmenuServer, dbusmenu_server, G_TYPE_OBJECT); @@ -272,6 +288,10 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) } } + /* Building our Method table :( */ + dbusmenu_method_table[METHOD_GET_LAYOUT].interned_name = g_intern_static_string("GetLayout"); + dbusmenu_method_table[METHOD_GET_LAYOUT].func = NULL; + return; } |