aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/eldbus/eldbus_freedesktop.c
blob: f0a79bdd2d7554316b2865cd6b8807f3f24e4ca7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "eldbus_private.h"
#include "eldbus_private_types.h"
#include <dbus/dbus.h>

EAPI Eldbus_Pending *
eldbus_name_request(Eldbus_Connection *conn, const char *name, unsigned int flags, Eldbus_Message_Cb cb, const void *cb_data)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
   EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);

   return eldbus_proxy_call(conn->fdo_proxy, "RequestName", cb,
                           cb_data, -1, "su", name, flags);
}

EAPI Eldbus_Pending *
eldbus_name_release(Eldbus_Connection *conn, const char *name, Eldbus_Message_Cb cb, const void *cb_data)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
   EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);

   return eldbus_proxy_call(conn->fdo_proxy, "ReleaseName", cb,
                           cb_data, -1, "s", name);
}

EAPI Eldbus_Pending *
eldbus_name_owner_get(Eldbus_Connection *conn, const char *name, Eldbus_Message_Cb cb, const void *cb_data)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
   EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);

   return eldbus_proxy_call(conn->fdo_proxy, "GetNameOwner", cb,
                           cb_data, -1, "s", name);
}

EAPI Eldbus_Pending *
eldbus_name_owner_has(Eldbus_Connection *conn, const char *name, Eldbus_Message_Cb cb, const void *cb_data)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
   EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);

   return eldbus_proxy_call(conn->fdo_proxy, "NameHasOwner", cb,
                           cb_data, -1, "s", name);
}

EAPI Eldbus_Pending *
eldbus_names_list(Eldbus_Connection *conn, Eldbus_Message_Cb cb, const void *cb_data)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);

   return eldbus_proxy_call(conn->fdo_proxy, "ListNames", cb,
                           cb_data, -1, "");
}

EAPI Eldbus_Pending *
eldbus_names_activatable_list(Eldbus_Connection *conn, Eldbus_Message_Cb cb, const void *cb_data)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);

   return eldbus_proxy_call(conn->fdo_proxy, "ListActivatableNames", cb,
                           cb_data, -1, "");
}

EAPI Eldbus_Pending *
eldbus_name_start(Eldbus_Connection *conn, const char *name, unsigned int flags, Eldbus_Message_Cb cb, const void *cb_data)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
   EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);

   return eldbus_proxy_call(conn->fdo_proxy, "StartServiceByName", cb,
                           cb_data, -1, "su", name, flags);
}

EAPI Eldbus_Pending *
eldbus_object_managed_objects_get(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data)
{
   Eldbus_Message *msg;
   Eldbus_Pending *p;
   msg = eldbus_object_method_call_new(obj, ELDBUS_FDO_INTERFACE_OBJECT_MANAGER,
                                      "GetManagedObjects");
   p = eldbus_object_send(obj, msg, cb, data, -1);
   return p;
}

EAPI Eldbus_Signal_Handler *
eldbus_object_manager_interfaces_added(Eldbus_Object *obj, Eldbus_Signal_Cb cb, const void *cb_data)
{
   return eldbus_object_signal_handler_add(obj, ELDBUS_FDO_INTERFACE_OBJECT_MANAGER,
                                           "InterfacesAdded", cb, cb_data);
}

EAPI Eldbus_Signal_Handler *
eldbus_object_manager_interfaces_removed(Eldbus_Object *obj, Eldbus_Signal_Cb cb, const void *cb_data)
{
   return eldbus_object_signal_handler_add(obj, ELDBUS_FDO_INTERFACE_OBJECT_MANAGER,
                                           "InterfacesRemoved", cb, cb_data);
}

EAPI Eldbus_Pending *
eldbus_hello(Eldbus_Connection *conn, Eldbus_Message_Cb cb, const void *cb_data)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);

   return eldbus_proxy_call(conn->fdo_proxy, "Hello", cb, cb_data, -1, "");
}