Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_ipc.c e_ipc_handlers.h e_remote_main.c
Log Message:
bugs , issues, patches.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- e_ipc.c 13 Jun 2005 19:56:27 -0000 1.46
+++ e_ipc.c 23 Jun 2005 03:29:37 -0000 1.47
@@ -78,143 +78,6 @@
#undef TYPE
/* here to steal from to port over to the new e_ipc_handlers.h */
#if 0
- case E_IPC_OP_FONT_FALLBACK_APPEND:
- {
- char *font_name = NULL;
-
- if (e_ipc_codec_str_dec(e->data, e->size, &font_name))
- {
- e_font_fallback_append(font_name);
- free(font_name);
- e_config_save_queue();
- }
- }
- break;
- case E_IPC_OP_FONT_FALLBACK_PREPEND:
- {
- char *font_name = NULL;
-
- if (e_ipc_codec_str_dec(e->data, e->size, &font_name))
- {
- e_font_fallback_prepend(font_name);
- free(font_name);
- e_config_save_queue();
- }
- }
- break;
- case E_IPC_OP_FONT_FALLBACK_LIST:
- {
- E_Font_Fallback *ff;
- Evas_List *dat = NULL, *l;
- void *data;
- int bytes;
-
- for (l = e_font_available_list(); l; l = l->next)
- {
- ff = l->data;
- dat = evas_list_append(dat, ff->name);
- }
- data = e_ipc_codec_str_list_enc(dat, &bytes);
- ecore_ipc_client_send(e->client,
- E_IPC_DOMAIN_REPLY,
- E_IPC_OP_FONT_FALLBACK_LIST_REPLY,
- 0/*ref*/, 0/*ref_to*/, 0/*response*/,
- data, bytes);
- free(data);
- evas_list_free(dat);
- }
- break;
- case E_IPC_OP_FONT_FALLBACK_REMOVE:
- {
- char *font_name = NULL;
-
- if (e_ipc_codec_str_dec(e->data, e->size, &font_name))
- {
- e_font_fallback_remove(font_name);
- free(font_name);
- e_config_save_queue();
- }
- }
- break;
- case E_IPC_OP_FONT_DEFAULT_SET:
- {
- E_Ipc_2Str_Int *v = NULL;
-
- if (e_ipc_codec_2str_int_dec(e->data, e->size, &v))
- {
- e_font_default_set(v->str1, v->str2, v->val);
- free(v->str1);
- free(v->str2);
- free(v);
- e_config_save_queue();
- }
- }
- break;
- case E_IPC_OP_FONT_DEFAULT_GET:
- {
- E_Font_Default *efd;
- char *tclass = NULL;
- void *data;
- int bytes;
-
- if (e_ipc_codec_str_dec(e->data, e->size, &tclass))
- {
- efd = e_font_default_get(tclass);
- data = e_ipc_codec_2str_int_enc(efd->text_class, efd->font,
efd->size, &bytes);
- ecore_ipc_client_send(e->client,
- E_IPC_DOMAIN_REPLY,
- E_IPC_OP_FONT_DEFAULT_GET_REPLY,
- 0/*ref*/, 0/*ref_to*/, 0/*response*/,
- data, bytes);
- free(data);
- free(tclass);
- }
- }
- break;
- case E_IPC_OP_FONT_DEFAULT_REMOVE:
- {
- char *tclass = NULL;
-
- if (e_ipc_codec_str_dec(e->data, e->size, &tclass))
- {
- e_font_default_remove(tclass);
- free(tclass);
- e_config_save_queue();
- }
- }
- break;
- case E_IPC_OP_FONT_DEFAULT_LIST:
- {
- E_Ipc_2Str_Int *v;
- E_Font_Default *efd;
- Evas_List *dat = NULL, *l;
- void *data;
- int bytes;
-
- for (l = e_font_default_list(); l; l = l->next)
- {
- efd = l->data;
- v = calloc(1, sizeof(E_Ipc_2Str_Int));
- v->str1 = efd->text_class;
- v->str2 = efd->font;
- v->val = efd->size;
- dat = evas_list_append(dat, v);
- }
- data = e_ipc_codec_2str_int_list_enc(dat, &bytes);
- ecore_ipc_client_send(e->client,
- E_IPC_DOMAIN_REPLY,
- E_IPC_OP_FONT_DEFAULT_LIST_REPLY,
- 0/*ref*/, 0/*ref_to*/, 0/*response*/,
- data, bytes);
- while (dat)
- {
- v = dat->data;
- free(v);
- dat = evas_list_remove_list(dat, dat);
- }
- free(data);
- }
- break;
case E_IPC_OP_BINDING_MOUSE_LIST:
{
Evas_List *bindings;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- e_ipc_handlers.h 19 Jun 2005 17:13:37 -0000 1.40
+++ e_ipc_handlers.h 23 Jun 2005 03:29:37 -0000 1.41
@@ -15,8 +15,14 @@
#ifndef E_IPC_HANDLERS_H
# define E_IPC_HANDLERS_H
+/*
+ * add a new ooption for enlightenment_remote
+ * OP(opt, num_params, description, num_expected_replies, HDL)
+ */
# define OP(__a, __b, __c, __d, __e) \
{__a, __b, __c, __d, __e},
+
+
# define STRING(__str, HDL) \
case HDL: \
if (e->data) { \
@@ -38,11 +44,32 @@
__str1 = __2str->str1; \
__str2 = __2str->str2;
# define END_STRING2(__2str) \
+ free(__2str->str1); \
+ free(__2str->str2); \
free(__2str); \
} \
} \
break;
+# define STRING2_INT(__str1, __str2, __int, __2str_int, HDL) \
+case HDL: \
+if (e->data) { \
+ char *__str1 = NULL, *__str2 = NULL; \
+ int __int; \
+ E_Ipc_2Str_Int *__2str_int = NULL; \
+ __2str_int = calloc(1, sizeof(E_Ipc_2Str_Int)); \
+ if (e_ipc_codec_2str_int_dec(e->data, e->size, &(__2str_int))) { \
+ __str1 = __2str_int->str1; \
+ __str2 = __2str_int->str2; \
+ __int = __2str_int->val;
+# define END_STRING2_INT(__2str_int) \
+ free(__2str_int->str1); \
+ free(__2str_int->str2); \
+ free(__2str_int); \
+ } \
+} \
+break;
+
# define START_DOUBLE(__dbl, HDL) \
case HDL: \
if (e->data) { \
@@ -103,6 +130,16 @@
} \
break;
+# define REQ_2STRING_INT(__str1, __str2, __int, HDL) \
+case HDL: { void *data; int bytes; \
+ data = e_ipc_codec_2str_int_enc(__str1, __str2, __int, &bytes); \
+ if (data) { \
+ ecore_ipc_server_send(e->server, E_IPC_DOMAIN_REQUEST, HDL, 0, 0, 0,
data, bytes); \
+ free(data); \
+ } \
+} \
+break;
+
# define REQ_DOUBLE(__dbl, HDL) \
case HDL: { void *data; int bytes; \
data = e_ipc_codec_double_enc(__dbl, &bytes); \
@@ -175,7 +212,7 @@
case HDL: { \
Evas_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = e_module_list(); l; l = l->next) { \
+ for (l = __list; l; l = l->next) { \
__typ1 *__v1; \
E_Ipc_Str_Int *__v2; \
__v1 = l->data; \
@@ -189,6 +226,42 @@
} \
break;
+# define STRING2_INT_LIST(__v, HDL) \
+ case HDL: { \
+ Evas_List *dat = NULL, *l; \
+ if (e_ipc_codec_2str_int_list_dec(e->data, e->size, &dat)) { \
+ for (l = dat; l; l = l->next) { \
+ E_Ipc_2Str_Int *__v; \
+ __v = l->data;
+#define END_STRING2_INT_LIST(__v) \
+ free(__v->str1); \
+ free(__v->str2); \
+ free(__v); \
+ } \
+ evas_list_free(dat); \
+ } \
+ reply_count++; \
+ } \
+ break;
+
+#define SEND_STRING2_INT_LIST(__list, __typ1, __v1, __v2, HDL) \
+ case HDL: { \
+ Evas_List *dat = NULL, *l; \
+ void *data; int bytes; \
+ for (l = __list; l; l = l->next) { \
+ __typ1 *__v1; \
+ E_Ipc_2Str_Int *__v2; \
+ __v1 = l->data; \
+ __v2 = calloc(1, sizeof(E_Ipc_2Str_Int));
+#define END_SEND_STRING2_INT_LIST(__v1, __op) \
+ dat = evas_list_append(dat, __v1); \
+ } \
+ data = e_ipc_codec_2str_int_list_enc(dat, &bytes); \
+ SEND_DATA(__op); \
+ FREE_LIST(dat); \
+ } \
+ break;
+
#define SEND_STRING(__str, __op, HDL) \
case HDL: { void *data; int bytes; \
data = e_ipc_codec_str_enc(__str, &bytes); \
@@ -543,6 +616,7 @@
#if (TYPE == E_REMOTE_OPTIONS)
OP("-font-apply", 0, "Apply font settings changes", 0, HDL)
#elif (TYPE == E_REMOTE_OUT)
+ REQ_NULL(HDL);
#elif (TYPE == E_WM_IN)
GENERIC(HDL);
e_font_apply();
@@ -553,6 +627,192 @@
#undef HDL
/****************************************************************************/
+#define HDL E_IPC_OP_FONT_FALLBACK_APPEND
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP( "-font-fallback-append",
+ 1 /*num_params*/,
+ "Append OPT1 to the fontset",
+ 0 /*num_expected_replies*/,
+ HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+ STRING(s, HDL);
+ e_font_fallback_append(s);
+ SAVE;
+ END_STRING(s);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_FALLBACK_PREPEND
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP( "-font-fallback-prepend",
+ 1 /*num_params*/,
+ "Prepend OPT1 to the fontset",
+ 0 /*num_expected_replies*/,
+ HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+ STRING(s, HDL);
+ e_font_fallback_prepend(s);
+ SAVE;
+ END_STRING(s);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_FALLBACK_LIST
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-font-fallback-list", 0, "List the fallback fonts in order", 1, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_NULL(HDL);
+#elif (TYPE == E_WM_IN)
+ GENERIC(HDL);
+
+ LIST_DATA();
+ E_Font_Fallback *ff;
+ FOR(e_config->font_fallbacks) { ff = l->data;
+ dat = evas_list_append(dat, ff->name);
+ }
+ ENCODE(dat, e_ipc_codec_str_list_enc);
+ SEND_DATA(E_IPC_OP_FONT_FALLBACK_LIST_REPLY);
+ evas_list_free(dat);
+
+ END_GENERIC();
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_FALLBACK_LIST_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+ GENERIC(HDL);
+ LIST();
+ DECODE(e_ipc_codec_str_list_dec) {
+ FOR(dat) {
+ printf("REPLY: \"%s\"\n", (char *)(l->data));
+ }
+ FREE_LIST(dat);
+ }
+ END_GENERIC();
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_FALLBACK_REMOVE
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-font-fallback-remove", 1, "Remove OPT1 from the fontset", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+ STRING(s, HDL);
+ e_font_fallback_remove(s);
+ SAVE;
+ END_STRING(s);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_DEFAULT_SET
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-font-default-set", 3, "Set textclass (OPT1) font (OPT2) and size
(OPT3)", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_2STRING_INT(params[0], params[1], atoi(params[2]), HDL)
+#elif (TYPE == E_WM_IN)
+ STRING2_INT(text_class, font_name, font_size, e_2str_int, HDL);
+ e_font_default_set(text_class, font_name, font_size);
+ SAVE;
+ END_STRING2_INT(e_2str_int);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_DEFAULT_GET
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-font-default-get", 1, "List the default font associated with OPT1", 1,
HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+ STRING(text_class, HDL);
+ E_Font_Default *efd;
+ void *data;
+ int bytes;
+
+ efd = e_font_default_get(text_class);
+ data = e_ipc_codec_2str_int_enc(efd->text_class, efd->font, efd->size,
&bytes);
+ SEND_DATA(E_IPC_OP_FONT_DEFAULT_GET_REPLY);
+
+ END_STRING(text_class);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_DEFAULT_GET_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+ STRING2_INT(text_class, font_name, font_size, e_2str_int, HDL);
+ printf("REPLY: DEFAULT TEXT_CLASS=\"%s\" NAME=\"%s\" SIZE=%d\n",
+ text_class, font_name, font_size);
+ END_STRING2_INT(e_2str_int);
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_DEFAULT_REMOVE
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-font-default-remove", 1, "Remove the default text class OPT1", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+ STRING(text_class, HDL);
+ e_font_default_remove(text_class);
+ SAVE;
+ END_STRING(text_class);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_DEFAULT_LIST
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-font-default-list", 0, "List all configured text classes", 1, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_NULL(HDL);
+#elif (TYPE == E_WM_IN)
+ SEND_STRING2_INT_LIST(e_font_default_list(), E_Font_Default, efd, v, HDL);
+ v->str1 = efd->text_class;
+ v->str2 = efd->font;
+ v->val = efd->size;
+ END_SEND_STRING2_INT_LIST(v, E_IPC_OP_FONT_DEFAULT_LIST_REPLY);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_FONT_DEFAULT_LIST_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+ STRING2_INT_LIST(v, HDL);
+ printf("REPLY: DEFAULT TEXT_CLASS=\"%s\" NAME=\"%s\" SIZE=%d\n", v->str1,
v->str2, v->val);
+ END_STRING2_INT_LIST(v);
+#endif
+#undef HDL
+
+/****************************************************************************/
#define HDL E_IPC_OP_FONT_FALLBACK_CLEAR
#if (TYPE == E_REMOTE_OPTIONS)
OP("-font-fallback-clear", 0, "Clear list of fallback fonts", 0, HDL)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_remote_main.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- e_remote_main.c 13 Jun 2005 19:56:28 -0000 1.47
+++ e_remote_main.c 23 Jun 2005 03:29:37 -0000 1.48
@@ -566,14 +566,6 @@
E_IPC_Opt_Handler handlers[] =
{
- OSTR("-font-fallback-remove", "Remove OPT1 from the fontset",
E_IPC_OP_FONT_FALLBACK_REMOVE, 0),
- OSTR("-font-fallback-prepend", "Prepend OPT1 to the fontset",
E_IPC_OP_FONT_FALLBACK_PREPEND, 0),
- OSTR("-font-fallback-append", "Append OPT1 to the fontset",
E_IPC_OP_FONT_FALLBACK_APPEND, 0),
- OREQ("-font-fallback-list", "List the fallback fonts in order",
E_IPC_OP_FONT_FALLBACK_LIST, 1),
- OSTR("-font-default-get", "List the default font associated with OPT1",
E_IPC_OP_FONT_DEFAULT_GET, 1),
- OSTR("-font-default-remove", "Remove the default text class OPT1",
E_IPC_OP_FONT_DEFAULT_REMOVE, 0),
- OREQ("-font-default-list", "List all configured text classes",
E_IPC_OP_FONT_DEFAULT_LIST, 1),
- OMUL("-font-default-set", "Set textclass (OPT1) font (OPT2) and size
(OPT3)", E_IPC_OP_FONT_DEFAULT_SET, 0, 3),
OREQ("-binding-mouse-list", "List all mouse bindings",
E_IPC_OP_BINDING_MOUSE_LIST, 1),
OFNC("-binding-mouse-add", "Add an existing mouse binding. OPT1 = Context,
OPT2 = button, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 =
action parameters", 6, _e_opt_binding_mouse_add, 0),
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),
@@ -862,54 +854,6 @@
printf("REPLY: BEGIN\n");
switch (e->minor)
{
- case E_IPC_OP_FONT_FALLBACK_LIST_REPLY:
- if (e->data)
- {
- Evas_List *fallbacks;
- E_Font_Fallback *eff;
-
- fallbacks = _e_ipc_font_fallback_list_dec(e->data, e->size);
- while (fallbacks)
- {
- eff = fallbacks->data;
- printf("REPLY: FALLBACK NAME=\"%s\"\n", eff->name);
- fallbacks = evas_list_remove_list(fallbacks, fallbacks);
- E_FREE(eff);
- }
- }
- else
- printf("REPLY: FALLBACK NONE\n");
- break;
- case E_IPC_OP_FONT_DEFAULT_GET_REPLY:
- if (e->data)
- {
- E_Font_Default efd;
- _e_ipc_font_default_dec(e->data, e->size, &efd);
- printf("REPLY: DEFAULT TEXT_CLASS=\"%s\" NAME=\"%s\" SIZE=%d\n",
- efd.text_class, efd.font, efd.size);
- }
- else
- printf("REPLY: DEFAULT NONE\n");
- break;
- case E_IPC_OP_FONT_DEFAULT_LIST_REPLY:
- if (e->data)
- {
- Evas_List *defaults;
- E_Font_Default *efd;
-
- defaults = _e_ipc_font_default_list_dec(e->data, e->size);
- while (defaults)
- {
- efd = defaults->data;
- printf("REPLY: DEFAULT TEXT_CLASS=\"%s\" NAME=\"%s\"
SIZE=%d\n",
- efd->text_class, efd->font, efd->size);
- defaults = evas_list_remove_list(defaults, defaults);
- E_FREE(efd);
- }
- }
- else
- printf("REPLY: DEFAULT NONE\n");
- break;
case E_IPC_OP_BINDING_MOUSE_LIST_REPLY:
if (e->data)
{
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs