summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO4
-rw-r--r--src/bin/Makefile.am5
-rw-r--r--src/bin/e.h6
-rw-r--r--src/bin/e_includes.h1
-rw-r--r--src/bin/e_ipc.c75
-rw-r--r--src/bin/e_ipc.h35
-rw-r--r--src/bin/e_ipc_codec.c76
-rw-r--r--src/bin/e_ipc_codec.h32
8 files changed, 225 insertions, 9 deletions
diff --git a/TODO b/TODO
index f28a9d4..dfbb08f 100644
--- a/TODO
+++ b/TODO
@@ -56,8 +56,8 @@ Also look at all the .c files - they have their own localized TODO lists
56These are in no particular order: 56These are in no particular order:
57 57
58* break out desks x/y size config so you can have a different desktop size 58* break out desks x/y size config so you can have a different desktop size
59 per zone 59 per zone - right now there is a signle global (use this later as the default
60* simplify adding config options to ipc 60 for new/unconfigured zones)
61* language packs: need to have a tool to load/setup a language pack (which 61* language packs: need to have a tool to load/setup a language pack (which
62 means .mo compiled files from a .po, an optional font and a config file that 62 means .mo compiled files from a .po, an optional font and a config file that
63 specifies the locale and font) and then install the font(s) either as a user 63 specifies the locale and font) and then install the font(s) either as a user
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index a8d7e61..0eea572 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -51,7 +51,8 @@ e_dnd.h \
51e_bindings.h \ 51e_bindings.h \
52e_moveresize.h \ 52e_moveresize.h \
53e_actions.h \ 53e_actions.h \
54e_popup.h 54e_popup.h \
55e_ipc_codec.h
55 56
56enlightenment_SOURCES = \ 57enlightenment_SOURCES = \
57e_main.c \ 58e_main.c \
@@ -96,12 +97,14 @@ e_bindings.c \
96e_moveresize.c \ 97e_moveresize.c \
97e_actions.c \ 98e_actions.c \
98e_popup.c \ 99e_popup.c \
100e_ipc_codec.c \
99$(ENLIGHTENMENTHEADERS) 101$(ENLIGHTENMENTHEADERS)
100 102
101enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@ 103enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@
102 104
103enlightenment_remote_SOURCES = \ 105enlightenment_remote_SOURCES = \
104e.h \ 106e.h \
107e_ipc_codec.c \
105e_remote_main.c 108e_remote_main.c
106 109
107enlightenment_remote_LDFLAGS = @e_libs@ @dlopen_libs@ 110enlightenment_remote_LDFLAGS = @e_libs@ @dlopen_libs@
diff --git a/src/bin/e.h b/src/bin/e.h
index 5c0fa7d..315cab7 100644
--- a/src/bin/e.h
+++ b/src/bin/e.h
@@ -4,6 +4,8 @@
4#ifndef E_H 4#ifndef E_H
5#define E_H 5#define E_H
6 6
7#include "config.h"
8
7#include <stdio.h> 9#include <stdio.h>
8#include <stdlib.h> 10#include <stdlib.h>
9#include <unistd.h> 11#include <unistd.h>
@@ -28,10 +30,6 @@
28#include <Eet.h> 30#include <Eet.h>
29#include <Edje.h> 31#include <Edje.h>
30 32
31#ifdef HAVE_CONFIG_H
32#include <config.h>
33#endif
34
35#if HAVE___ATTRIBUTE__ 33#if HAVE___ATTRIBUTE__
36#define __UNUSED__ __attribute__((unused)) 34#define __UNUSED__ __attribute__((unused))
37#else 35#else
diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h
index 0f4b905..cacadff 100644
--- a/src/bin/e_includes.h
+++ b/src/bin/e_includes.h
@@ -41,4 +41,5 @@
41#include "e_moveresize.h" 41#include "e_moveresize.h"
42#include "e_actions.h" 42#include "e_actions.h"
43#include "e_popup.h" 43#include "e_popup.h"
44#include "e_ipc_codec.h"
44#include "e_test.h" 45#include "e_test.h"
diff --git a/src/bin/e_ipc.c b/src/bin/e_ipc.c
index 982e38f..dcc3a95 100644
--- a/src/bin/e_ipc.c
+++ b/src/bin/e_ipc.c
@@ -9,6 +9,9 @@ static char *_e_ipc_str_list_get(Evas_List *strs, int *bytes);
9static char *_e_ipc_simple_str_dec(char *data, int bytes); 9static char *_e_ipc_simple_str_dec(char *data, int bytes);
10static char **_e_ipc_multi_str_dec(char *data, int bytes, int str_count); 10static char **_e_ipc_multi_str_dec(char *data, int bytes, int str_count);
11 11
12static int _e_ipc_double_dec(char *data, int bytes, double *dest);
13static int _e_ipc_int_dec(char *data, int bytes, int *dest);
14
12/* encode functions, Should these be global? */ 15/* encode functions, Should these be global? */
13ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_module_list_enc); 16ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_module_list_enc);
14ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_font_available_list_enc); 17ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_font_available_list_enc);
@@ -40,12 +43,15 @@ e_ipc_init(void)
40 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD, _e_ipc_cb_client_add, NULL); 43 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD, _e_ipc_cb_client_add, NULL);
41 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL, _e_ipc_cb_client_del, NULL); 44 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL, _e_ipc_cb_client_del, NULL);
42 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA, _e_ipc_cb_client_data, NULL); 45 ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA, _e_ipc_cb_client_data, NULL);
46
47 e_ipc_codec_init();
43 return 1; 48 return 1;
44} 49}
45 50
46void 51void
47e_ipc_shutdown(void) 52e_ipc_shutdown(void)
48{ 53{
54 e_ipc_codec_shutdown();
49 if (_e_ipc_server) 55 if (_e_ipc_server)
50 { 56 {
51 ecore_ipc_server_del(_e_ipc_server); 57 ecore_ipc_server_del(_e_ipc_server);
@@ -582,6 +588,71 @@ _e_ipc_cb_client_data(void *data __UNUSED__, int type __UNUSED__, void *event)
582 } 588 }
583 } 589 }
584 break; 590 break;
591 case E_IPC_OP_MENUS_SCROLL_SPEED_SET:
592 if (e_ipc_codec_double_dec(e->data, e->size,
593 &(e_config->menus_scroll_speed)))
594 {
595 E_CONFIG_LIMIT(e_config->menus_scroll_speed, 1.0, 20000.0);
596 e_config_save_queue();
597 }
598 break;
599 case E_IPC_OP_MENUS_SCROLL_SPEED_GET:
600 {
601 void *data;
602 int bytes;
603
604 if ((data = e_ipc_codec_double_enc(e_config->menus_scroll_speed,
605 &bytes)))
606 {
607 ecore_ipc_client_send(e->client,
608 E_IPC_DOMAIN_REPLY,
609 E_IPC_OP_MENUS_SCROLL_SPEED_GET_REPLY,
610 0/*ref*/, 0/*ref_to*/, 0/*response*/,
611 data, bytes);
612 free(data);
613 }
614 }
615 break;
616 case E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_SET:
617 break;
618 case E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_GET:
619 break;
620 case E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_SET:
621 break;
622 case E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_GET:
623 break;
624 case E_IPC_OP_BORDER_SHADE_ANIMATE_SET:
625 break;
626 case E_IPC_OP_BORDER_SHADE_ANIMATE_GET:
627 break;
628 case E_IPC_OP_BORDER_SHADE_TRANSITION_SET:
629 break;
630 case E_IPC_OP_BORDER_SHADE_TRANSITION_GET:
631 break;
632 case E_IPC_OP_BORDER_SHADE_SPEED_SET:
633 break;
634 case E_IPC_OP_BORDER_SHADE_SPEED_GET:
635 break;
636 case E_IPC_OP_FRAMERATE_SET:
637 break;
638 case E_IPC_OP_FRAMERATE_GET:
639 break;
640 case E_IPC_OP_IMAGE_CACHE_SET:
641 break;
642 case E_IPC_OP_IMAGE_CACHE_GET:
643 break;
644 case E_IPC_OP_FONT_CAHCE_SET:
645 break;
646 case E_IPC_OP_FONT_CACHE_GET:
647 break;
648 case E_IPC_OP_USE_EDGE_FLIP_SET:
649 break;
650 case E_IPC_OP_USE_EDGE_FLIP_GET:
651 break;
652 case E_IPC_OP_EDGE_FLIP_TIMEOUT_SET:
653 break;
654 case E_IPC_OP_EDGE_FLIP_TIMEOUT_GET:
655 break;
585 default: 656 default:
586 break; 657 break;
587 } 658 }
@@ -668,7 +739,6 @@ _e_ipc_simple_str_dec(char *data, int bytes)
668 str = malloc(bytes + 1); 739 str = malloc(bytes + 1);
669 str[bytes] = 0; 740 str[bytes] = 0;
670 memcpy(str, data, bytes); 741 memcpy(str, data, bytes);
671
672 return str; 742 return str;
673} 743}
674 744
@@ -700,7 +770,8 @@ _e_ipc_multi_str_dec(char *data, int bytes, int str_count)
700 770
701 return str_array; 771 return str_array;
702} 772}
703 773
774/* FIXME: just use eet for this - saves a lot of hassle */
704 775
705/* list/struct encoding functions */ 776/* list/struct encoding functions */
706ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_module_list_enc) 777ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_module_list_enc)
diff --git a/src/bin/e_ipc.h b/src/bin/e_ipc.h
index 3f0d1c0..5aa9254 100644
--- a/src/bin/e_ipc.h
+++ b/src/bin/e_ipc.h
@@ -59,6 +59,41 @@ 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,
64 E_IPC_OP_MENUS_SCROLL_SPEED_GET,
65 E_IPC_OP_MENUS_SCROLL_SPEED_GET_REPLY,
66 E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_SET,
67 E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_GET,
68 E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_GET_REPLY,
69 E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_SET,
70 E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_GET,
71 E_IPC_OP_MENUS_CLICK_DRAG_TIMEOUT_GET_REPLY,
72 E_IPC_OP_BORDER_SHADE_ANIMATE_SET,
73 E_IPC_OP_BORDER_SHADE_ANIMATE_GET,
74 E_IPC_OP_BORDER_SHADE_ANIMATE_GET_REPLY,
75 E_IPC_OP_BORDER_SHADE_TRANSITION_SET,
76 E_IPC_OP_BORDER_SHADE_TRANSITION_GET,
77 E_IPC_OP_BORDER_SHADE_TRANSITION_GET_REPLY,
78 E_IPC_OP_BORDER_SHADE_SPEED_SET,
79 E_IPC_OP_BORDER_SHADE_SPEED_GET,
80 E_IPC_OP_BORDER_SHADE_SPEED_GET_REPLY,
81 E_IPC_OP_FRAMERATE_SET,
82 E_IPC_OP_FRAMERATE_GET,
83 E_IPC_OP_FRAMERATE_GET_REPLY,
84 E_IPC_OP_IMAGE_CACHE_SET,
85 E_IPC_OP_IMAGE_CACHE_GET,
86 E_IPC_OP_IMAGE_CACHE_GET_REPLY,
87 E_IPC_OP_FONT_CAHCE_SET,
88 E_IPC_OP_FONT_CACHE_GET,
89 E_IPC_OP_FONT_CACHE_GET_REPLY,
90 E_IPC_OP_USE_EDGE_FLIP_SET,
91 E_IPC_OP_USE_EDGE_FLIP_GET,
92 E_IPC_OP_USE_EDGE_FLIP_GET_REPLY,
93 E_IPC_OP_EDGE_FLIP_TIMEOUT_SET,
94 E_IPC_OP_EDGE_FLIP_TIMEOUT_GET,
95 E_IPC_OP_EDGE_FLIP_TIMEOUT_GET_REPLY,
96
62 E_IPC_OP_LAST 97 E_IPC_OP_LAST
63} E_Ipc_Op; 98} E_Ipc_Op;
64 99
diff --git a/src/bin/e_ipc_codec.c b/src/bin/e_ipc_codec.c
new file mode 100644
index 0000000..4c88d51
--- /dev/null
+++ b/src/bin/e_ipc_codec.c
@@ -0,0 +1,76 @@
1#include "e.h"
2
3/* local subsystem functions */
4
5/* encode functions, Should these be global? */
6
7/* local subsystem globals */
8static Eet_Data_Descriptor *_e_ipc_int_edd = NULL;
9static Eet_Data_Descriptor *_e_ipc_double_edd = NULL;
10
11/* externally accessible functions */
12int
13e_ipc_codec_init(void)
14{
15 _e_ipc_int_edd = E_CONFIG_DD_NEW("int", E_Ipc_Int);
16 E_CONFIG_VAL(_e_ipc_int_edd, E_Ipc_Int, val, INT);
17
18 _e_ipc_double_edd = E_CONFIG_DD_NEW("double", E_Ipc_Double);
19 E_CONFIG_VAL(_e_ipc_double_edd, E_Ipc_Double, val, DOUBLE);
20
21 return 1;
22}
23
24void
25e_ipc_codec_shutdown(void)
26{
27 E_CONFIG_DD_FREE(_e_ipc_int_edd);
28 E_CONFIG_DD_FREE(_e_ipc_double_edd);
29}
30
31int
32e_ipc_codec_int_dec(char *data, int bytes, int *dest)
33{
34 E_Ipc_Int *dat;
35
36 if (!data) return 0;
37 dat = eet_data_descriptor_decode(_e_ipc_int_edd, data, bytes);
38 if (!dat) return 0;
39 if (dest) *dest = dat->val;
40 free(dat);
41 return 1;
42}
43
44void *
45e_ipc_codec_int_enc(int val, int *size_ret)
46{
47 E_Ipc_Int dat;
48
49 dat.val = val;
50 return eet_data_descriptor_encode(_e_ipc_int_edd, &dat, size_ret);
51}
52
53int
54e_ipc_codec_double_dec(char *data, int bytes, double *dest)
55{
56 E_Ipc_Double *dat;
57
58 if (!data) return 0;
59 dat = eet_data_descriptor_decode(_e_ipc_double_edd, data, bytes);
60 if (!dat) return 0;
61 if (dest) *dest = dat->val;
62 free(dat);
63 return 1;
64}
65
66void *
67e_ipc_codec_double_enc(double val, int *size_ret)
68{
69 E_Ipc_Double dat;
70
71 dat.val = val;
72 return eet_data_descriptor_encode(_e_ipc_double_edd, &dat, size_ret);
73}
74
75/* local subsystem globals */
76
diff --git a/src/bin/e_ipc_codec.h b/src/bin/e_ipc_codec.h
new file mode 100644
index 0000000..694816c
--- /dev/null
+++ b/src/bin/e_ipc_codec.h
@@ -0,0 +1,32 @@
1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */
4#ifdef E_TYPEDEFS
5
6typedef struct _E_Ipc_Int E_Ipc_Int;
7typedef struct _E_Ipc_Double E_Ipc_Double;
8
9#else
10#ifndef E_IPC_CODEC_H
11#define E_IPC_CODEC_H
12
13struct _E_Ipc_Int
14{
15 int val;
16};
17
18struct _E_Ipc_Double
19{
20 double val;
21};
22
23EAPI int e_ipc_codec_init(void);
24EAPI void e_ipc_codec_shutdown(void);
25
26EAPI int e_ipc_codec_int_dec(char *data, int bytes, int *dest);
27EAPI void *e_ipc_codec_int_enc(int val, int *size_ret);
28EAPI int e_ipc_codec_double_dec(char *data, int bytes, double *dest);
29EAPI void *e_ipc_codec_double_enc(double val, int *size_ret);
30
31#endif
32#endif