summaryrefslogtreecommitdiff
path: root/src/bin/ipc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ipc.c')
-rw-r--r--src/bin/ipc.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/bin/ipc.c b/src/bin/ipc.c
index c9b9ee7..c848e4f 100644
--- a/src/bin/ipc.c
+++ b/src/bin/ipc.c
@@ -1,6 +1,7 @@
1#include "private.h" 1#include "private.h"
2 2
3#include <Ecore.h> 3#include <Ecore.h>
4#include <Ecore_Con.h>
4#include <Ecore_Ipc.h> 5#include <Ecore_Ipc.h>
5#include <Eet.h> 6#include <Eet.h>
6#include "ipc.h" 7#include "ipc.h"
@@ -93,6 +94,8 @@ ipc_init(void)
93 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 94 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
94 "name", name, EET_T_STRING); 95 "name", name, EET_T_STRING);
95 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 96 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
97 "theme", theme, EET_T_STRING);
98 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
96 "role", role, EET_T_STRING); 99 "role", role, EET_T_STRING);
97 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 100 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
98 "title", title, EET_T_STRING); 101 "title", title, EET_T_STRING);
@@ -128,6 +131,16 @@ ipc_init(void)
128 "hold", hold, EET_T_INT); 131 "hold", hold, EET_T_INT);
129 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, 132 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
130 "nowm", nowm, EET_T_INT); 133 "nowm", nowm, EET_T_INT);
134 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
135 "xterm_256color", xterm_256color, EET_T_INT);
136 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
137 "active_links", active_links, EET_T_INT);
138 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
139 "video_mute", active_links, EET_T_INT);
140 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
141 "cursor_blink", active_links, EET_T_INT);
142 EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance,
143 "visual_bell", active_links, EET_T_INT);
131} 144}
132 145
133Eina_Bool 146Eina_Bool
@@ -171,6 +184,19 @@ ipc_instance_new_func_set(void (*func) (Ipc_Instance *inst))
171 func_new_inst = func; 184 func_new_inst = func;
172} 185}
173 186
187void
188ipc_instance_conn_free(void)
189{
190 char *hash = _ipc_hash_get();
191 char *address = ecore_con_local_path_new(EINA_FALSE,
192 hash,
193 0);
194 errno = 0;
195 unlink(address);
196 ERR("unlinking: '%s': %s", address, strerror(errno));
197 free(address);
198}
199
174Eina_Bool 200Eina_Bool
175ipc_instance_add(Ipc_Instance *inst) 201ipc_instance_add(Ipc_Instance *inst)
176{ 202{
@@ -178,7 +204,7 @@ ipc_instance_add(Ipc_Instance *inst)
178 void *data; 204 void *data;
179 char *hash = _ipc_hash_get(); 205 char *hash = _ipc_hash_get();
180 Ecore_Ipc_Server *ipcsrv; 206 Ecore_Ipc_Server *ipcsrv;
181 207
182 if (!hash) return EINA_FALSE; 208 if (!hash) return EINA_FALSE;
183 data = eet_data_descriptor_encode(new_inst_edd, inst, &size); 209 data = eet_data_descriptor_encode(new_inst_edd, inst, &size);
184 if (!data) 210 if (!data)
@@ -186,6 +212,7 @@ ipc_instance_add(Ipc_Instance *inst)
186 free(hash); 212 free(hash);
187 return EINA_FALSE; 213 return EINA_FALSE;
188 } 214 }
215
189 ipcsrv = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, hash, 0, NULL); 216 ipcsrv = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, hash, 0, NULL);
190 if (ipcsrv) 217 if (ipcsrv)
191 { 218 {
@@ -196,6 +223,10 @@ ipc_instance_add(Ipc_Instance *inst)
196 ecore_ipc_server_del(ipcsrv); 223 ecore_ipc_server_del(ipcsrv);
197 return EINA_TRUE; 224 return EINA_TRUE;
198 } 225 }
226 else
227 {
228 DBG("connect failed");
229 }
199 free(data); 230 free(data);
200 free(hash); 231 free(hash);
201 return EINA_FALSE; 232 return EINA_FALSE;