summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/e_ipc.c41
-rw-r--r--src/bin/e_ipc_handlers.h96
-rw-r--r--src/bin/e_remote_main.c12
3 files changed, 96 insertions, 53 deletions
diff --git a/src/bin/e_ipc.c b/src/bin/e_ipc.c
index b9529b1..a1772db 100644
--- a/src/bin/e_ipc.c
+++ b/src/bin/e_ipc.c
@@ -344,47 +344,6 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
344 } 344 }
345 } 345 }
346 break; 346 break;
347 case E_IPC_OP_DESKS_SET:
348 if (e_ipc_codec_2int_dec(e->data, e->size,
349 &(e_config->zone_desks_x_count),
350 &(e_config->zone_desks_y_count)))
351 {
352 Evas_List *l;
353
354 E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64);
355 E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64);
356 for (l = e_manager_list(); l; l = l->next)
357 {
358 E_Manager *man;
359 Evas_List *l2;
360
361 man = l->data;
362 for (l2 = man->containers; l2; l2 = l2->next)
363 {
364 E_Container *con;
365 Evas_List *l3;
366
367 con = l2->data;
368 for (l3 = con->zones; l3; l3 = l3->next)
369 {
370 E_Zone *zone;
371
372 zone = l3->data;
373 e_zone_desk_count_set(zone,
374 e_config->zone_desks_x_count,
375 e_config->zone_desks_y_count);
376 }
377 }
378 }
379 e_config_save_queue();
380 }
381 break;
382 case E_IPC_OP_DESKS_GET:
383 _e_ipc_reply_2int_send(e->client,
384 e_config->zone_desks_x_count,
385 e_config->zone_desks_y_count,
386 E_IPC_OP_DESKS_GET_REPLY);
387 break;
388#endif 347#endif
389 default: 348 default:
390 break; 349 break;
diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h
index c892dc4..aa5f917 100644
--- a/src/bin/e_ipc_handlers.h
+++ b/src/bin/e_ipc_handlers.h
@@ -63,6 +63,17 @@ if (e->data) { \
63} \ 63} \
64break; 64break;
65 65
66# define START_2INT(__int1, __int2, HDL) \
67case HDL: \
68if (e->data) { \
69 int __int1 = 0; \
70 int __int2 = 0; \
71 if (e_ipc_codec_2int_dec(e->data, e->size, &(__int1), &(__int2))) {
72# define END_2INT \
73 } \
74} \
75break;
76
66# define RESPONSE(__res, __store, HDL) \ 77# define RESPONSE(__res, __store, HDL) \
67 __store *__res = calloc(1, sizeof(__store)); \ 78 __store *__res = calloc(1, sizeof(__store)); \
68 if (e->data) { 79 if (e->data) {
@@ -118,6 +129,16 @@ break;
118 REQ_INT_START(HDL) \ 129 REQ_INT_START(HDL) \
119 REQ_INT_END(__int, HDL) 130 REQ_INT_END(__int, HDL)
120 131
132# define REQ_2INT(__int1, __int2, HDL) \
133case HDL: { void *data; int bytes; \
134 data = e_ipc_codec_2int_enc(__int1, __int2, &bytes); \
135 if (data) { \
136 ecore_ipc_server_send(e->server, E_IPC_DOMAIN_REQUEST, HDL, 0, 0, 0, data, bytes); \
137 free(data); \
138 } \
139} \
140break;
141
121# define REQ_NULL(HDL) \ 142# define REQ_NULL(HDL) \
122case HDL: \ 143case HDL: \
123 ecore_ipc_server_send(e->server, E_IPC_DOMAIN_REQUEST, HDL, 0, 0, 0, NULL, 0); \ 144 ecore_ipc_server_send(e->server, E_IPC_DOMAIN_REQUEST, HDL, 0, 0, 0, NULL, 0); \
@@ -198,6 +219,16 @@ case HDL: { void *data; int bytes; \
198} \ 219} \
199break; 220break;
200 221
222# define SEND_2INT(__int1, __int2,__op, HDL) \
223case HDL: { void *data; int bytes; \
224 data = e_ipc_codec_2int_enc(__int1, __int2, &bytes); \
225 if (data) { \
226 ecore_ipc_client_send(e->client, E_IPC_DOMAIN_REPLY, __op, 0, 0, 0, data, bytes); \
227 free(data); \
228 } \
229} \
230break;
231
201#define LIST_DATA() \ 232#define LIST_DATA() \
202 Evas_List *dat = NULL, *l; \ 233 Evas_List *dat = NULL, *l; \
203 void *data; int bytes; 234 void *data; int bytes;
@@ -1314,6 +1345,71 @@ break;
1314#endif 1345#endif
1315#undef HDL 1346#undef HDL
1316 1347
1348/****************************************************************************/
1349#define HDL E_IPC_OP_DESKS_SET
1350#if (TYPE == E_REMOTE_OPTIONS)
1351 OP("-desks-set", 1, "Set the number of virtual desktops (X x Y. OPT1 = X, OPT2 = Y)", 0, HDL)
1352#elif (TYPE == E_REMOTE_OUT)
1353 REQ_2INT(atoi(params[0]), atoi(params[1]), HDL);
1354#elif (TYPE == E_WM_IN)
1355 START_2INT(val1, val2, HDL);
1356 e_config->zone_desks_x_count = val1;
1357 e_config->zone_desks_y_count = val2;
1358 E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64)
1359 E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64)
1360 {
1361 Evas_List *l;
1362 for (l = e_manager_list(); l; l = l->next)
1363 {
1364 E_Manager *man;
1365 Evas_List *l2;
1366 man = l->data;
1367 for (l2 = man->containers; l2; l2 = l2->next)
1368 {
1369 E_Container *con;
1370 Evas_List *l3;
1371 con = l2->data;
1372 for (l3 = con->zones; l3; l3 = l3->next)
1373 {
1374 E_Zone *zone;
1375 zone = l3->data;
1376 e_zone_desk_count_set(zone,
1377 e_config->zone_desks_x_count,
1378 e_config->zone_desks_y_count);
1379 }
1380 }
1381 }
1382 }
1383 SAVE;
1384 END_2INT;
1385#elif (TYPE == E_REMOTE_IN)
1386#endif
1387#undef HDL
1388
1389/****************************************************************************/
1390#define HDL E_IPC_OP_DESKS_GET
1391#if (TYPE == E_REMOTE_OPTIONS)
1392 OP("-desks-get", 0, "Get the number of virtual desktops", 1, HDL)
1393#elif (TYPE == E_REMOTE_OUT)
1394 REQ_NULL(HDL)
1395#elif (TYPE == E_WM_IN)
1396 SEND_2INT(e_config->zone_desks_x_count, e_config->zone_desks_y_count, E_IPC_OP_DESKS_GET_REPLY, HDL);
1397#elif (TYPE == E_REMOTE_IN)
1398#endif
1399#undef HDL
1400
1401/****************************************************************************/
1402#define HDL E_IPC_OP_DESKS_GET_REPLY
1403#if (TYPE == E_REMOTE_OPTIONS)
1404#elif (TYPE == E_REMOTE_OUT)
1405#elif (TYPE == E_WM_IN)
1406#elif (TYPE == E_REMOTE_IN)
1407 START_2INT(val1, val2, HDL)
1408 printf("REPLY: %i %i\n", val1, val2);
1409 END_2INT;
1410#endif
1411#undef HDL
1412
1317#if 0 1413#if 0
1318} 1414}
1319#endif 1415#endif
diff --git a/src/bin/e_remote_main.c b/src/bin/e_remote_main.c
index 1bd832c..cd0c5f8 100644
--- a/src/bin/e_remote_main.c
+++ b/src/bin/e_remote_main.c
@@ -580,8 +580,6 @@ E_IPC_Opt_Handler handlers[] =
580 OREQ("-binding-key-list", "List all key bindings", E_IPC_OP_BINDING_KEY_LIST, 1), 580 OREQ("-binding-key-list", "List all key bindings", E_IPC_OP_BINDING_KEY_LIST, 1),
581 OFNC("-binding-key-add", "Add an existing key binding. OPT1 = Context, OPT2 = key, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_key_add, 0), 581 OFNC("-binding-key-add", "Add an existing key binding. OPT1 = Context, OPT2 = key, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_key_add, 0),
582 OFNC("-binding-key-del", "Delete an existing key binding. OPT1 = Context, OPT2 = key, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_key_del, 0), 582 OFNC("-binding-key-del", "Delete an existing key binding. OPT1 = Context, OPT2 = key, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_key_del, 0),
583 O2INT("-desks-set", "Set the number of virtual desktops (X x Y. OPT1 = X, OPT2 = Y)", E_IPC_OP_DESKS_SET, 0),
584 OREQ("-desks-get", "Get the number of virtual desktops", E_IPC_OP_DESKS_GET, 1),
585}; 583};
586 584
587/* externally accessible functions */ 585/* externally accessible functions */
@@ -962,16 +960,6 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
962 else 960 else
963 printf("REPLY: AVAILABLE NONE\n"); 961 printf("REPLY: AVAILABLE NONE\n");
964 break; 962 break;
965 case E_IPC_OP_DESKS_GET_REPLY:
966 if (e->data)
967 {
968 int val1;
969 int val2;
970
971 if (e_ipc_codec_2int_dec(e->data, e->size, &val1, &val2))
972 printf("REPLY: %i %i\n", val1, val2);
973 }
974 break;
975 default: 963 default:
976 break; 964 break;
977 } 965 }