summaryrefslogtreecommitdiff
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2013-04-23 11:40:05 -0300
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2013-04-23 12:36:29 -0300
commit4e3804041f8e865e007b2a6a0d45a05f39500c3b (patch)
treea493b9c8f8a610d2667651f3ba81819ed16fbe8c /src/bin/efreet
parent4cf68bf728b5a858ce1c0efac25ded1a49ba8d9d (diff)
Rename edbus->eldbus
git grep -l edbus2 | while read f; do sed -i 's/edbus2/eldbus/g' "$f"; done find . -name '*edbus2*' -exec rename edbus2 eldbus {} \; git grep -l "EDBUS" | while read f; do sed -i 's/EDBUS/ELDBUS/g' "$f"; done git grep -l "EDBus" | while read f; do sed -i 's/EDBus/Eldbus/g' "$f"; done git grep -l "edbus (v2)" | while read f; do sed -i 's/edbus (v2)/eldbus/g' "$f"; done git grep -l "Edbus" | while read f; do sed -i 's/Edbus/Eldbus/g' "$f"; done git grep -l "edbus" | while read f; do sed -i 's/edbus/eldbus/g' "$f"; done find . -name '*edbus*' -exec rename edbus eldbus {} \; find . -name '*EDBus*' -exec rename EDBus Eldbus {} \;
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreetd_dbus.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/bin/efreet/efreetd_dbus.c b/src/bin/efreet/efreetd_dbus.c
index 0b305ea6f4..82a66c179f 100644
--- a/src/bin/efreet/efreetd_dbus.c
+++ b/src/bin/efreet/efreetd_dbus.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4 4
5#include <Ecore.h> 5#include <Ecore.h>
6#include <EDBus.h> 6#include <Eldbus.h>
7 7
8#include "efreetd.h" 8#include "efreetd.h"
9#include "efreetd_cache.h" 9#include "efreetd_cache.h"
@@ -19,8 +19,8 @@ enum
19 EFREET_SIGNAL_DESKTOP_CACHE_UPDATE 19 EFREET_SIGNAL_DESKTOP_CACHE_UPDATE
20}; 20};
21 21
22static EDBus_Connection *conn; 22static Eldbus_Connection *conn;
23static EDBus_Service_Interface *iface; 23static Eldbus_Service_Interface *iface;
24 24
25static Ecore_Timer *_shutdown = NULL; 25static Ecore_Timer *_shutdown = NULL;
26static int clients = 0; 26static int clients = 0;
@@ -33,7 +33,7 @@ do_shutdown(void *data EINA_UNUSED)
33} 33}
34 34
35static void 35static void
36disconnected(void *context EINA_UNUSED, EDBus_Connection *connection EINA_UNUSED, void *event_info EINA_UNUSED) 36disconnected(void *context EINA_UNUSED, Eldbus_Connection *connection EINA_UNUSED, void *event_info EINA_UNUSED)
37{ 37{
38 INF("disconnected"); 38 INF("disconnected");
39 quit(); 39 quit();
@@ -44,7 +44,7 @@ client_name_owner_changed_cb(void *data EINA_UNUSED, const char *bus, const char
44{ 44{
45 if (new_id[0]) 45 if (new_id[0])
46 return; 46 return;
47 edbus_name_owner_changed_callback_del(conn, bus, 47 eldbus_name_owner_changed_callback_del(conn, bus,
48 client_name_owner_changed_cb, NULL); 48 client_name_owner_changed_cb, NULL);
49 clients--; 49 clients--;
50 if (clients <= 0) 50 if (clients <= 0)
@@ -55,13 +55,13 @@ client_name_owner_changed_cb(void *data EINA_UNUSED, const char *bus, const char
55 } 55 }
56} 56}
57 57
58static EDBus_Message * 58static Eldbus_Message *
59do_register(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message) 59do_register(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
60{ 60{
61 EDBus_Message *reply; 61 Eldbus_Message *reply;
62 const char *lang; 62 const char *lang;
63 63
64 if (!edbus_message_arguments_get(message, "s", &lang)) 64 if (!eldbus_message_arguments_get(message, "s", &lang))
65 { 65 {
66 ERR("Error getting arguments."); 66 ERR("Error getting arguments.");
67 return NULL; 67 return NULL;
@@ -72,28 +72,28 @@ do_register(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message
72 if (_shutdown) ecore_timer_del(_shutdown); 72 if (_shutdown) ecore_timer_del(_shutdown);
73 _shutdown = NULL; 73 _shutdown = NULL;
74 74
75 edbus_name_owner_changed_callback_add(conn, 75 eldbus_name_owner_changed_callback_add(conn,
76 edbus_message_sender_get(message), 76 eldbus_message_sender_get(message),
77 client_name_owner_changed_cb, NULL, 77 client_name_owner_changed_cb, NULL,
78 EINA_FALSE); 78 EINA_FALSE);
79 reply = edbus_message_method_return_new(message); 79 reply = eldbus_message_method_return_new(message);
80 edbus_message_arguments_append(reply, "b", cache_desktop_exists()); 80 eldbus_message_arguments_append(reply, "b", cache_desktop_exists());
81 return reply; 81 return reply;
82} 82}
83 83
84static EDBus_Message * 84static Eldbus_Message *
85add_desktop_dirs(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message) 85add_desktop_dirs(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
86{ 86{
87 EDBus_Message_Iter *array = NULL; 87 Eldbus_Message_Iter *array = NULL;
88 const char *dir; 88 const char *dir;
89 89
90 if (!edbus_message_arguments_get(message, "as", &array)) 90 if (!eldbus_message_arguments_get(message, "as", &array))
91 { 91 {
92 ERR("Error getting arguments."); 92 ERR("Error getting arguments.");
93 return NULL; 93 return NULL;
94 } 94 }
95 95
96 while (edbus_message_iter_get_and_next(array, 's', &dir)) 96 while (eldbus_message_iter_get_and_next(array, 's', &dir))
97 { 97 {
98 cache_desktop_dir_add(dir); 98 cache_desktop_dir_add(dir);
99 } 99 }
@@ -101,19 +101,19 @@ add_desktop_dirs(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Mes
101 return NULL; 101 return NULL;
102} 102}
103 103
104static EDBus_Message * 104static Eldbus_Message *
105add_icon_dirs(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message) 105add_icon_dirs(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
106{ 106{
107 EDBus_Message_Iter *array = NULL; 107 Eldbus_Message_Iter *array = NULL;
108 const char *dir; 108 const char *dir;
109 109
110 if (!edbus_message_arguments_get(message, "as", &array)) 110 if (!eldbus_message_arguments_get(message, "as", &array))
111 { 111 {
112 ERR("Error getting arguments."); 112 ERR("Error getting arguments.");
113 return NULL; 113 return NULL;
114 } 114 }
115 115
116 while (edbus_message_iter_get_and_next(array, 's', &dir)) 116 while (eldbus_message_iter_get_and_next(array, 's', &dir))
117 { 117 {
118 cache_icon_dir_add(dir); 118 cache_icon_dir_add(dir);
119 } 119 }
@@ -121,12 +121,12 @@ add_icon_dirs(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Messag
121 return NULL; 121 return NULL;
122} 122}
123 123
124static EDBus_Message * 124static Eldbus_Message *
125build_desktop_cache(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message EINA_UNUSED) 125build_desktop_cache(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message EINA_UNUSED)
126{ 126{
127 const char *lang; 127 const char *lang;
128 128
129 if (!edbus_message_arguments_get(message, "s", &lang)) 129 if (!eldbus_message_arguments_get(message, "s", &lang))
130 { 130 {
131 ERR("Error getting arguments."); 131 ERR("Error getting arguments.");
132 return NULL; 132 return NULL;
@@ -137,19 +137,19 @@ build_desktop_cache(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_
137 return NULL; 137 return NULL;
138} 138}
139 139
140static EDBus_Message * 140static Eldbus_Message *
141add_icon_exts(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message) 141add_icon_exts(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
142{ 142{
143 EDBus_Message_Iter *array = NULL; 143 Eldbus_Message_Iter *array = NULL;
144 const char *ext; 144 const char *ext;
145 145
146 if (!edbus_message_arguments_get(message, "as", &array)) 146 if (!eldbus_message_arguments_get(message, "as", &array))
147 { 147 {
148 ERR("Error getting arguments."); 148 ERR("Error getting arguments.");
149 return NULL; 149 return NULL;
150 } 150 }
151 151
152 while (edbus_message_iter_get_and_next(array, 's', &ext)) 152 while (eldbus_message_iter_get_and_next(array, 's', &ext))
153 { 153 {
154 cache_icon_ext_add(ext); 154 cache_icon_ext_add(ext);
155 } 155 }
@@ -157,60 +157,60 @@ add_icon_exts(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Messag
157 return NULL; 157 return NULL;
158} 158}
159 159
160static const EDBus_Signal signals[] = { 160static const Eldbus_Signal signals[] = {
161 [EFREET_SIGNAL_ICON_CACHE_UPDATE] = {"IconCacheUpdate", EDBUS_ARGS({ "b", "update" }), 0}, 161 [EFREET_SIGNAL_ICON_CACHE_UPDATE] = {"IconCacheUpdate", ELDBUS_ARGS({ "b", "update" }), 0},
162 [EFREET_SIGNAL_DESKTOP_CACHE_UPDATE] = {"DesktopCacheUpdate", EDBUS_ARGS({ "b", "update" }), 0}, 162 [EFREET_SIGNAL_DESKTOP_CACHE_UPDATE] = {"DesktopCacheUpdate", ELDBUS_ARGS({ "b", "update" }), 0},
163 { NULL, NULL, 0 } 163 { NULL, NULL, 0 }
164}; 164};
165 165
166static const EDBus_Method methods[] = { 166static const Eldbus_Method methods[] = {
167 { 167 {
168 "Register", EDBUS_ARGS({"s", "lang info"}), EDBUS_ARGS({"b", "cache exists"}), 168 "Register", ELDBUS_ARGS({"s", "lang info"}), ELDBUS_ARGS({"b", "cache exists"}),
169 do_register, 0 169 do_register, 0
170 }, 170 },
171 { 171 {
172 "AddDesktopDirs", EDBUS_ARGS({"as", "dirs"}), NULL, 172 "AddDesktopDirs", ELDBUS_ARGS({"as", "dirs"}), NULL,
173 add_desktop_dirs, EDBUS_METHOD_FLAG_NOREPLY 173 add_desktop_dirs, ELDBUS_METHOD_FLAG_NOREPLY
174 }, 174 },
175 { 175 {
176 "BuildDesktopCache", EDBUS_ARGS({"s", "lang info"}), NULL, 176 "BuildDesktopCache", ELDBUS_ARGS({"s", "lang info"}), NULL,
177 build_desktop_cache, EDBUS_METHOD_FLAG_NOREPLY 177 build_desktop_cache, ELDBUS_METHOD_FLAG_NOREPLY
178 }, 178 },
179 { 179 {
180 "AddIconDirs", EDBUS_ARGS({"as", "dirs"}), NULL, 180 "AddIconDirs", ELDBUS_ARGS({"as", "dirs"}), NULL,
181 add_icon_dirs, EDBUS_METHOD_FLAG_NOREPLY 181 add_icon_dirs, ELDBUS_METHOD_FLAG_NOREPLY
182 }, 182 },
183 { 183 {
184 "AddIconExts", EDBUS_ARGS({"as", "exts"}), NULL, 184 "AddIconExts", ELDBUS_ARGS({"as", "exts"}), NULL,
185 add_icon_exts, EDBUS_METHOD_FLAG_NOREPLY 185 add_icon_exts, ELDBUS_METHOD_FLAG_NOREPLY
186 }, 186 },
187 { NULL, NULL, NULL, NULL, 0 } 187 { NULL, NULL, NULL, NULL, 0 }
188}; 188};
189 189
190static const EDBus_Service_Interface_Desc desc = { 190static const Eldbus_Service_Interface_Desc desc = {
191 INTERFACE, methods, signals, NULL, NULL, NULL 191 INTERFACE, methods, signals, NULL, NULL, NULL
192}; 192};
193 193
194static void 194static void
195on_name_request(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED) 195on_name_request(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
196{ 196{
197 unsigned int reply; 197 unsigned int reply;
198 198
199 if (edbus_message_error_get(msg, NULL, NULL)) 199 if (eldbus_message_error_get(msg, NULL, NULL))
200 { 200 {
201 ERR("error on on_name_request"); 201 ERR("error on on_name_request");
202 quit(); 202 quit();
203 return; 203 return;
204 } 204 }
205 205
206 if (!edbus_message_arguments_get(msg, "u", &reply)) 206 if (!eldbus_message_arguments_get(msg, "u", &reply))
207 { 207 {
208 ERR("error getting arguments on on_name_request"); 208 ERR("error getting arguments on on_name_request");
209 quit(); 209 quit();
210 return; 210 return;
211 } 211 }
212 212
213 if (reply != EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER) 213 if (reply != ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
214 { 214 {
215 ERR("error name already in use"); 215 ERR("error name already in use");
216 quit(); 216 quit();
@@ -223,40 +223,40 @@ on_name_request(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
223void 223void
224send_signal_icon_cache_update(Eina_Bool update) 224send_signal_icon_cache_update(Eina_Bool update)
225{ 225{
226 edbus_service_signal_emit(iface, EFREET_SIGNAL_ICON_CACHE_UPDATE, update); 226 eldbus_service_signal_emit(iface, EFREET_SIGNAL_ICON_CACHE_UPDATE, update);
227} 227}
228 228
229void 229void
230send_signal_desktop_cache_update(Eina_Bool update) 230send_signal_desktop_cache_update(Eina_Bool update)
231{ 231{
232 edbus_service_signal_emit(iface, EFREET_SIGNAL_DESKTOP_CACHE_UPDATE, update); 232 eldbus_service_signal_emit(iface, EFREET_SIGNAL_DESKTOP_CACHE_UPDATE, update);
233} 233}
234 234
235Eina_Bool 235Eina_Bool
236dbus_init(void) 236dbus_init(void)
237{ 237{
238 if (!edbus_init()) return EINA_FALSE; 238 if (!eldbus_init()) return EINA_FALSE;
239 239
240 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION); 240 conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
241 if (!conn) goto conn_error; 241 if (!conn) goto conn_error;
242 242
243 edbus_connection_event_callback_add(conn, 243 eldbus_connection_event_callback_add(conn,
244 EDBUS_CONNECTION_EVENT_DISCONNECTED, disconnected, NULL); 244 ELDBUS_CONNECTION_EVENT_DISCONNECTED, disconnected, NULL);
245 iface = edbus_service_interface_register(conn, PATH, &desc); 245 iface = eldbus_service_interface_register(conn, PATH, &desc);
246 edbus_name_request(conn, BUS, EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE, 246 eldbus_name_request(conn, BUS, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
247 on_name_request, NULL); 247 on_name_request, NULL);
248 248
249 return EINA_TRUE; 249 return EINA_TRUE;
250conn_error: 250conn_error:
251 edbus_shutdown(); 251 eldbus_shutdown();
252 return EINA_FALSE; 252 return EINA_FALSE;
253} 253}
254 254
255Eina_Bool 255Eina_Bool
256dbus_shutdown(void) 256dbus_shutdown(void)
257{ 257{
258 edbus_connection_unref(conn); 258 eldbus_connection_unref(conn);
259 edbus_shutdown(); 259 eldbus_shutdown();
260 return EINA_TRUE; 260 return EINA_TRUE;
261 261
262} 262}