8 #include <communicator.h>
10 #include <user_request.h>
12 #include "generated-code.h"
16 static void _free_hook(UserRequest *ur)
18 const struct tcore_user_info *ui;
20 ui = tcore_user_request_ref_user_info(ur);
28 char *dbus_plugin_get_plugin_name_by_object_path(const char *object_path)
33 if (!g_str_has_prefix(object_path, MY_DBUS_PATH)) {
37 return (char *)object_path + strlen(MY_DBUS_PATH) + 1;
40 UserRequest *dbus_plugin_macro_user_request_new(struct custom_data *ctx, void *object, GDBusMethodInvocation *invocation)
42 UserRequest *ur = NULL;
44 struct tcore_user_info ui = { 0, };
45 struct dbus_request_info *dbus_info;
47 plugin_name = GET_PLUGIN_NAME(invocation);
48 dbg("plugin_name = [%s]", plugin_name);
50 ur = tcore_user_request_new(ctx->comm, plugin_name);
52 dbus_info = calloc(sizeof(struct dbus_request_info), 1);
53 dbus_info->interface_object = object;
54 dbus_info->invocation = invocation;
56 ui.user_data = dbus_info;
58 tcore_user_request_set_user_info(ur, &ui);
59 tcore_user_request_set_free_hook(ur, _free_hook);