|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
#include "private.h" |
|
|
|
|
|
|
|
|
|
#include <Ecore.h> |
|
|
|
|
#include <Ecore_Con.h> |
|
|
|
|
#include <Ecore_Ipc.h> |
|
|
|
|
#include <Eet.h> |
|
|
|
|
#include "ipc.h" |
|
|
|
@ -92,6 +93,8 @@ ipc_init(void) |
|
|
|
|
"background", background, EET_T_STRING); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"name", name, EET_T_STRING); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"theme", theme, EET_T_STRING); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"role", role, EET_T_STRING); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
@ -128,6 +131,16 @@ ipc_init(void) |
|
|
|
|
"hold", hold, EET_T_INT); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"nowm", nowm, EET_T_INT); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"xterm_256color", xterm_256color, EET_T_INT); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"active_links", active_links, EET_T_INT); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"video_mute", active_links, EET_T_INT); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"cursor_blink", active_links, EET_T_INT); |
|
|
|
|
EET_DATA_DESCRIPTOR_ADD_BASIC(new_inst_edd, Ipc_Instance, |
|
|
|
|
"visual_bell", active_links, EET_T_INT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Eina_Bool |
|
|
|
@ -171,6 +184,19 @@ ipc_instance_new_func_set(void (*func) (Ipc_Instance *inst)) |
|
|
|
|
func_new_inst = func; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
ipc_instance_conn_free(void) |
|
|
|
|
{ |
|
|
|
|
char *hash = _ipc_hash_get(); |
|
|
|
|
char *address = ecore_con_local_path_new(EINA_FALSE, |
|
|
|
|
hash, |
|
|
|
|
0); |
|
|
|
|
errno = 0; |
|
|
|
|
unlink(address); |
|
|
|
|
ERR("unlinking: '%s': %s", address, strerror(errno)); |
|
|
|
|
free(address); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Eina_Bool |
|
|
|
|
ipc_instance_add(Ipc_Instance *inst) |
|
|
|
|
{ |
|
|
|
@ -178,7 +204,7 @@ ipc_instance_add(Ipc_Instance *inst) |
|
|
|
|
void *data; |
|
|
|
|
char *hash = _ipc_hash_get(); |
|
|
|
|
Ecore_Ipc_Server *ipcsrv; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!hash) return EINA_FALSE; |
|
|
|
|
data = eet_data_descriptor_encode(new_inst_edd, inst, &size); |
|
|
|
|
if (!data) |
|
|
|
@ -186,6 +212,7 @@ ipc_instance_add(Ipc_Instance *inst) |
|
|
|
|
free(hash); |
|
|
|
|
return EINA_FALSE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ipcsrv = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, hash, 0, NULL); |
|
|
|
|
if (ipcsrv) |
|
|
|
|
{ |
|
|
|
@ -196,6 +223,10 @@ ipc_instance_add(Ipc_Instance *inst) |
|
|
|
|
ecore_ipc_server_del(ipcsrv); |
|
|
|
|
return EINA_TRUE; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
DBG("connect failed"); |
|
|
|
|
} |
|
|
|
|
free(data); |
|
|
|
|
free(hash); |
|
|
|
|
return EINA_FALSE; |
|
|
|
|