summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-05-13 17:21:04 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-05-13 17:21:04 +0000
commit825a55bec4a0de91bd92e57abe0243157020df62 (patch)
tree614ae59ef93009ab948df38ef6a9dc2b93f3a2aa /src
parent3f92e26079e5dc9ca917da3b51eafba191ec205a (diff)
ipc bitchass! :)
SVN revision: 14756
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_config.c26
-rw-r--r--src/bin/e_ipc.c2
-rw-r--r--src/bin/e_ipc.h8
-rw-r--r--src/bin/e_remote_main.c198
4 files changed, 204 insertions, 30 deletions
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 325f129..b2774c7 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -102,20 +102,20 @@ e_config_init(void)
102 /**/ /* == already configurable via ipc */ 102 /**/ /* == already configurable via ipc */
103 E_CONFIG_VAL(D, T, config_version, INT); /**/ 103 E_CONFIG_VAL(D, T, config_version, INT); /**/
104 E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/ 104 E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/
105 E_CONFIG_VAL(D, T, menus_scroll_speed, DOUBLE); 105 E_CONFIG_VAL(D, T, menus_scroll_speed, DOUBLE); /**/
106 E_CONFIG_VAL(D, T, menus_fast_mouse_move_threshhold, DOUBLE); 106 E_CONFIG_VAL(D, T, menus_fast_mouse_move_threshhold, DOUBLE); /**/
107 E_CONFIG_VAL(D, T, menus_click_drag_timeout, DOUBLE); 107 E_CONFIG_VAL(D, T, menus_click_drag_timeout, DOUBLE); /**/
108 E_CONFIG_VAL(D, T, border_shade_animate, INT); 108 E_CONFIG_VAL(D, T, border_shade_animate, INT); /**/
109 E_CONFIG_VAL(D, T, border_shade_transition, INT); 109 E_CONFIG_VAL(D, T, border_shade_transition, INT); /**/
110 E_CONFIG_VAL(D, T, border_shade_speed, DOUBLE); 110 E_CONFIG_VAL(D, T, border_shade_speed, DOUBLE); /**/
111 E_CONFIG_VAL(D, T, framerate, DOUBLE); 111 E_CONFIG_VAL(D, T, framerate, DOUBLE); /**/
112 E_CONFIG_VAL(D, T, image_cache, INT); 112 E_CONFIG_VAL(D, T, image_cache, INT); /**/
113 E_CONFIG_VAL(D, T, font_cache, INT); 113 E_CONFIG_VAL(D, T, font_cache, INT); /**/
114 E_CONFIG_VAL(D, T, zone_desks_x_count, INT); 114 E_CONFIG_VAL(D, T, zone_desks_x_count, INT); /**/
115 E_CONFIG_VAL(D, T, zone_desks_y_count, INT); 115 E_CONFIG_VAL(D, T, zone_desks_y_count, INT); /**/
116 E_CONFIG_VAL(D, T, use_virtual_roots, INT); /* should not make this a config option (for now) */ 116 E_CONFIG_VAL(D, T, use_virtual_roots, INT); /* should not make this a config option (for now) */
117 E_CONFIG_VAL(D, T, use_edge_flip, INT); 117 E_CONFIG_VAL(D, T, use_edge_flip, INT); /**/
118 E_CONFIG_VAL(D, T, edge_flip_timeout, DOUBLE); 118 E_CONFIG_VAL(D, T, edge_flip_timeout, DOUBLE); /**/
119 E_CONFIG_VAL(D, T, language, STR); /**/ 119 E_CONFIG_VAL(D, T, language, STR); /**/
120 E_CONFIG_LIST(D, T, modules, _e_config_module_edd); /**/ 120 E_CONFIG_LIST(D, T, modules, _e_config_module_edd); /**/
121 E_CONFIG_LIST(D, T, font_fallbacks, _e_config_font_fallback_edd); /**/ 121 E_CONFIG_LIST(D, T, font_fallbacks, _e_config_font_fallback_edd); /**/
diff --git a/src/bin/e_ipc.c b/src/bin/e_ipc.c
index 90697b9..769805d 100644
--- a/src/bin/e_ipc.c
+++ b/src/bin/e_ipc.c
@@ -695,7 +695,7 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
695 e_config->image_cache, 695 e_config->image_cache,
696 E_IPC_OP_IMAGE_CACHE_GET_REPLY); 696 E_IPC_OP_IMAGE_CACHE_GET_REPLY);
697 break; 697 break;
698 case E_IPC_OP_FONT_CAHCE_SET: 698 case E_IPC_OP_FONT_CACHE_SET:
699 if (e_ipc_codec_int_dec(e->data, e->size, 699 if (e_ipc_codec_int_dec(e->data, e->size,
700 &(e_config->font_cache))) 700 &(e_config->font_cache)))
701 { 701 {
diff --git a/src/bin/e_ipc.h b/src/bin/e_ipc.h
index 831a0b8..009cfcd 100644
--- a/src/bin/e_ipc.h
+++ b/src/bin/e_ipc.h
@@ -59,7 +59,6 @@ typedef enum _E_Ipc_Op
59 E_IPC_OP_BINDING_KEY_LIST_REPLY, 59 E_IPC_OP_BINDING_KEY_LIST_REPLY,
60 E_IPC_OP_BINDING_KEY_ADD, 60 E_IPC_OP_BINDING_KEY_ADD,
61 E_IPC_OP_BINDING_KEY_DEL, 61 E_IPC_OP_BINDING_KEY_DEL,
62
63 E_IPC_OP_MENUS_SCROLL_SPEED_SET, 62 E_IPC_OP_MENUS_SCROLL_SPEED_SET,
64 E_IPC_OP_MENUS_SCROLL_SPEED_GET, 63 E_IPC_OP_MENUS_SCROLL_SPEED_GET,
65 E_IPC_OP_MENUS_SCROLL_SPEED_GET_REPLY, 64 E_IPC_OP_MENUS_SCROLL_SPEED_GET_REPLY,
@@ -84,7 +83,7 @@ typedef enum _E_Ipc_Op
84 E_IPC_OP_IMAGE_CACHE_SET, 83 E_IPC_OP_IMAGE_CACHE_SET,
85 E_IPC_OP_IMAGE_CACHE_GET, 84 E_IPC_OP_IMAGE_CACHE_GET,
86 E_IPC_OP_IMAGE_CACHE_GET_REPLY, 85 E_IPC_OP_IMAGE_CACHE_GET_REPLY,
87 E_IPC_OP_FONT_CAHCE_SET, 86 E_IPC_OP_FONT_CACHE_SET,
88 E_IPC_OP_FONT_CACHE_GET, 87 E_IPC_OP_FONT_CACHE_GET,
89 E_IPC_OP_FONT_CACHE_GET_REPLY, 88 E_IPC_OP_FONT_CACHE_GET_REPLY,
90 E_IPC_OP_USE_EDGE_FLIP_SET, 89 E_IPC_OP_USE_EDGE_FLIP_SET,
@@ -96,8 +95,11 @@ typedef enum _E_Ipc_Op
96 E_IPC_OP_DESKS_SET, 95 E_IPC_OP_DESKS_SET,
97 E_IPC_OP_DESKS_GET, 96 E_IPC_OP_DESKS_GET,
98 E_IPC_OP_DESKS_GET_REPLY, 97 E_IPC_OP_DESKS_GET_REPLY,
99
100 E_IPC_OP_LAST 98 E_IPC_OP_LAST
99 /* FIXME: add ipc: */
100 /* get list of actions */
101 /* get list of paths */
102 /* add/del extra paths */
101} E_Ipc_Op; 103} E_Ipc_Op;
102 104
103#else 105#else
diff --git a/src/bin/e_remote_main.c b/src/bin/e_remote_main.c
index 32b8b6b..e7899c8 100644
--- a/src/bin/e_remote_main.c
+++ b/src/bin/e_remote_main.c
@@ -237,15 +237,21 @@ _e_opt_binding_key_del(char **params)
237 free(data); 237 free(data);
238} 238}
239 239
240#define SIMPLE_REQ 0 240#define SIMPLE_REQ 0
241#define SIMPLE_STR_REQ 1 241#define SIMPLE_STR_REQ 1
242#define FULL_FUNC 2 242#define FULL_FUNC 2
243#define MULTI_STR_REQ 3 243#define MULTI_STR_REQ 3
244#define SIMPLE_INT_REQ 4
245#define SIMPLE_DBL_REQ 5
246#define SIMPLE_2INT_REQ 6
244 247
245#define OREQ(opt, desc, ipc, rep) {opt, desc, 0, rep, SIMPLE_REQ, ipc, NULL} 248#define OREQ(opt, desc, ipc, rep) {opt, desc, 0, rep, SIMPLE_REQ, ipc, NULL}
246#define OSTR(opt, desc, ipc, rep) {opt, desc, 1, rep, SIMPLE_STR_REQ, ipc, NULL} 249#define OSTR(opt, desc, ipc, rep) {opt, desc, 1, rep, SIMPLE_STR_REQ, ipc, NULL}
247#define OFNC(opt, desc, param, fn, rep) {opt, desc, param, rep, FULL_FUNC, 0, fn} 250#define OFNC(opt, desc, param, fn, rep) {opt, desc, param, rep, FULL_FUNC, 0, fn}
248#define OMUL(opt, desc, ipc, rep, argc) {opt, desc, argc, rep, MULTI_STR_REQ, ipc, NULL} 251#define OMUL(opt, desc, ipc, rep, argc) {opt, desc, argc, rep, MULTI_STR_REQ, ipc, NULL}
252#define OINT(opt, desc, ipc, rep) {opt, desc, 1, rep, SIMPLE_INT_REQ, ipc, NULL}
253#define ODBL(opt, desc, ipc, rep) {opt, desc, 1, rep, SIMPLE_DBL_REQ, ipc, NULL}
254#define O2INT(opt, desc, ipc, rep) {opt, desc, 2, rep, SIMPLE_2INT_REQ, ipc, NULL}
249 255
250E_IPC_Opt_Handler handlers[] = 256E_IPC_Opt_Handler handlers[] =
251{ 257{
@@ -279,7 +285,31 @@ E_IPC_Opt_Handler handlers[] =
279 OFNC("-binding-mouse-del", "Delete an existing mouse binding. OPT1 = Context, OPT2 = button, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_mouse_del, 0), 285 OFNC("-binding-mouse-del", "Delete an existing mouse binding. OPT1 = Context, OPT2 = button, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_mouse_del, 0),
280 OREQ("-binding-key-list", "List all key bindings", E_IPC_OP_BINDING_KEY_LIST, 1), 286 OREQ("-binding-key-list", "List all key bindings", E_IPC_OP_BINDING_KEY_LIST, 1),
281 OFNC("-binding-key-add", "Add or replace 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), 287 OFNC("-binding-key-add", "Add or replace 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),
282 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) 288 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),
289 ODBL("-menus-scroll-speed-set", "Set the scroll speed of menus (pixels/sec)", E_IPC_OP_MENUS_SCROLL_SPEED_SET, 0),
290 OREQ("-menus-scroll-speed-get", "Get the scroll speed of menus (pixels/sec)", E_IPC_OP_MENUS_SCROLL_SPEED_GET, 1),
291 ODBL("-menus-fast-move-threshhold-set", "Set the mouse speed in pixels per second that is considered a 'fast move'", E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_SET, 0),
292 OREQ("-menus-fast-move-threshhold-get", "Get the mouse speed (pixels/sec) that is considered a fast move", E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_GET, 1),
293 ODBL("-menus-click-drag-timeout-set", "Set the time (in seconds) between a mouse press and release that will keep the menu up anyway", E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_SET, 0),
294 OREQ("-menus-click-drag-timeout-get", "Get the above value", E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_GET, 1),
295 OINT("-border-shade-animate-set", "Set the shading animation flag (0/1)", E_IPC_OP_BORDER_SHADE_ANIMATE_SET, 0),
296 OREQ("-border-shade-animate-get", "Get the shading animation flag", E_IPC_OP_BORDER_SHADE_ANIMATE_GET, 1),
297 OINT("-border-shade-transition-set", "Set the shading animation algorithm (0, 1, 2 or 3)", E_IPC_OP_BORDER_SHADE_TRANSITION_SET, 0),
298 OREQ("-border-shade-transition-get", "Get the above value", E_IPC_OP_BORDER_SHADE_TRANSITION_GET, 1),
299 ODBL("-border-shade-speed-set", "Set the shading speed (pixels/sec)", E_IPC_OP_BORDER_SHADE_SPEED_SET, 0),
300 OREQ("-border-shade-speed-get", "Get the shading speed", E_IPC_OP_BORDER_SHADE_SPEED_GET, 1),
301 ODBL("-framerate-set", "Set the animation framerate (fps)", E_IPC_OP_FRAMERATE_SET, 0),
302 OREQ("-framerate-get", "Get the animation framerate", E_IPC_OP_FRAMERATE_GET, 1),
303 OINT("-image-cache-set", "Set the speculative image cache size (Kb)", E_IPC_OP_IMAGE_CACHE_SET, 0),
304 OREQ("-image-cache-get", "Get the image cache size", E_IPC_OP_IMAGE_CACHE_GET, 1),
305 OINT("-font-cache-set", "Get the speculative font cache size (Kb)", E_IPC_OP_FONT_CACHE_SET, 0),
306 OREQ("-font-cache-get", "Set the font cache size", E_IPC_OP_FONT_CACHE_GET, 1),
307 OINT("-edge-flip-set", "Set the edge flip flag (0/1)", E_IPC_OP_USE_EDGE_FLIP_SET, 0),
308 OREQ("-edge-flip-get", "Get the edge flip flag", E_IPC_OP_USE_EDGE_FLIP_GET, 1),
309 ODBL("-edge-flip_timeout-set", "Set the edge flip timeout (sec)", E_IPC_OP_EDGE_FLIP_TIMEOUT_SET, 0),
310 OREQ("-edge-flip_timeout-get", "Get the edge flip timeout", E_IPC_OP_EDGE_FLIP_TIMEOUT_GET, 1),
311 O2INT("-desks-set", "Get the number of virtual desktops (X x Y. OPT1 = X, OPT2 = Y)", E_IPC_OP_DESKS_SET, 0),
312 OREQ("-desks-get", "Set the number of virtual desktops", E_IPC_OP_DESKS_GET, 1)
283}; 313};
284 314
285/* externally accessible functions */ 315/* externally accessible functions */
@@ -468,18 +498,20 @@ _e_ipc_cb_server_add(void *data, int type, void *event)
468 case MULTI_STR_REQ: 498 case MULTI_STR_REQ:
469 /* pack up the data "<str>0<str>0" */ 499 /* pack up the data "<str>0<str>0" */
470 data_size = 0; 500 data_size = 0;
471 for(k = 0; k < handler->num_params; k++) { 501 for (k = 0; k < handler->num_params; k++)
472 data_size += strlen(argv[ i + 1 + k ]); 502 {
473 data_size++; /* NULL Pad */ 503 data_size += strlen(argv[ i + 1 + k ]);
474 } 504 data_size++; /* NULL Pad */
505 }
475 v = malloc(data_size); 506 v = malloc(data_size);
476 p = v; 507 p = v;
477 for(k = 0; k < handler->num_params; k++) { 508 for (k = 0; k < handler->num_params; k++)
509 {
478 strcpy(p, argv[ i + 1 + k]); 510 strcpy(p, argv[ i + 1 + k]);
479 p += strlen(argv[ i + 1 + k]); 511 p += strlen(argv[ i + 1 + k]);
480 *p = 0; 512 *p = 0;
481 p++; 513 p++;
482 } 514 }
483 ecore_ipc_server_send(_e_ipc_server, 515 ecore_ipc_server_send(_e_ipc_server,
484 E_IPC_DOMAIN_REQUEST, 516 E_IPC_DOMAIN_REQUEST,
485 handler->simple_request_id, 517 handler->simple_request_id,
@@ -491,6 +523,37 @@ _e_ipc_cb_server_add(void *data, int type, void *event)
491 case FULL_FUNC: 523 case FULL_FUNC:
492 handler->func(argv + i + 1); 524 handler->func(argv + i + 1);
493 break; 525 break;
526 case SIMPLE_INT_REQ:
527 v = e_ipc_codec_int_enc(atoi(argv[i + 1]),
528 &data_size);
529 ecore_ipc_server_send(_e_ipc_server,
530 E_IPC_DOMAIN_REQUEST,
531 handler->simple_request_id,
532 0/*ref*/, 0/*ref_to*/, 0/*response*/,
533 v, data_size);
534 free(v);
535 break;
536 case SIMPLE_DBL_REQ:
537 v = e_ipc_codec_double_enc(atof(argv[i + 1]),
538 &data_size);
539 ecore_ipc_server_send(_e_ipc_server,
540 E_IPC_DOMAIN_REQUEST,
541 handler->simple_request_id,
542 0/*ref*/, 0/*ref_to*/, 0/*response*/,
543 v, data_size);
544 free(v);
545 break;
546 case SIMPLE_2INT_REQ:
547 v = e_ipc_codec_2int_enc(atoi(argv[i + 1]),
548 atoi(argv[i + 2]),
549 &data_size);
550 ecore_ipc_server_send(_e_ipc_server,
551 E_IPC_DOMAIN_REQUEST,
552 handler->simple_request_id,
553 0/*ref*/, 0/*ref_to*/, 0/*response*/,
554 v, data_size);
555 free(v);
556 break;
494 default: 557 default:
495 break; 558 break;
496 } 559 }
@@ -725,6 +788,115 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
725 else 788 else
726 printf("REPLY: AVAILABLE NONE\n"); 789 printf("REPLY: AVAILABLE NONE\n");
727 break; 790 break;
791 case E_IPC_OP_MENUS_SCROLL_SPEED_GET_REPLY:
792 if (e->data)
793 {
794 double val;
795
796 if (e_ipc_codec_double_dec(e->data, e->size, &val))
797 printf("REPLY: %3.3f\n", val);
798 }
799 break;
800 case E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_GET_REPLY:
801 if (e->data)
802 {
803 double val;
804
805 if (e_ipc_codec_double_dec(e->data, e->size, &val))
806 printf("REPLY: %3.3f\n", val);
807 }
808 break;
809 case E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_GET_REPLY:
810 if (e->data)
811 {
812 double val;
813
814 if (e_ipc_codec_double_dec(e->data, e->size, &val))
815 printf("REPLY: %3.3f\n", val);
816 }
817 break;
818 case E_IPC_OP_BORDER_SHADE_ANIMATE_GET_REPLY:
819 if (e->data)
820 {
821 int val;
822
823 if (e_ipc_codec_int_dec(e->data, e->size, &val))
824 printf("REPLY: %i\n", val);
825 }
826 break;
827 case E_IPC_OP_BORDER_SHADE_TRANSITION_GET_REPLY:
828 if (e->data)
829 {
830 int val;
831
832 if (e_ipc_codec_int_dec(e->data, e->size, &val))
833 printf("REPLY: %i\n", val);
834 }
835 break;
836 case E_IPC_OP_BORDER_SHADE_SPEED_GET_REPLY:
837 if (e->data)
838 {
839 double val;
840
841 if (e_ipc_codec_double_dec(e->data, e->size, &val))
842 printf("REPLY: %3.3f\n", val);
843 }
844 break;
845 case E_IPC_OP_FRAMERATE_GET_REPLY:
846 if (e->data)
847 {
848 double val;
849
850 if (e_ipc_codec_double_dec(e->data, e->size, &val))
851 printf("REPLY: %3.3f\n", val);
852 }
853 break;
854 case E_IPC_OP_IMAGE_CACHE_GET_REPLY:
855 if (e->data)
856 {
857 int val;
858
859 if (e_ipc_codec_int_dec(e->data, e->size, &val))
860 printf("REPLY: %i\n", val);
861 }
862 break;
863 case E_IPC_OP_FONT_CACHE_GET_REPLY:
864 if (e->data)
865 {
866 int val;
867
868 if (e_ipc_codec_int_dec(e->data, e->size, &val))
869 printf("REPLY: %i\n", val);
870 }
871 break;
872 case E_IPC_OP_USE_EDGE_FLIP_GET_REPLY:
873 if (e->data)
874 {
875 int val;
876
877 if (e_ipc_codec_int_dec(e->data, e->size, &val))
878 printf("REPLY: %i\n", val);
879 }
880 break;
881 case E_IPC_OP_EDGE_FLIP_TIMEOUT_GET_REPLY:
882 if (e->data)
883 {
884 double val;
885
886 if (e_ipc_codec_double_dec(e->data, e->size, &val))
887 printf("REPLY: %3.3f\n", val);
888 }
889 break;
890 case E_IPC_OP_DESKS_GET_REPLY:
891 if (e->data)
892 {
893 int val1;
894 int val2;
895
896 if (e_ipc_codec_2int_dec(e->data, e->size, &val1, &val2))
897 printf("REPLY: %i %i\n", val1, val2);
898 }
899 break;
728 default: 900 default:
729 break; 901 break;
730 } 902 }