Enlightenment CVS committal Author : rephorm Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: Makefile.am e.h e_config.c e_config.h e_includes.h e_ipc_codec.c e_ipc_codec.h e_ipc_handlers.h e_ipc_handlers_list.h e_main.c Added Files: e_color_class.c e_color_class.h Log Message: Initial Color Class support in e17 only ipc at the moment (enlightenment_remote) no real theme support yet either. also, -color-class-del does not have the intended effect yet. need to add color_ class_del() to edje first =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v retrieving revision 1.93 retrieving revision 1.94 diff -u -3 -r1.93 -r1.94 --- Makefile.am 4 Jan 2006 22:20:51 -0000 1.93 +++ Makefile.am 12 Jan 2006 02:12:21 -0000 1.94 @@ -129,7 +129,8 @@ e_deskpreview.h \ e_exebuf.h \ e_int_config_modules.h \ -e_exehist.h +e_exehist.h \ +e_color_class.h enlightenment_src = \ e_user.c \ @@ -240,6 +241,7 @@ e_exebuf.c \ e_int_config_modules.c \ e_exehist.c \ +e_color_class.c \ $(ENLIGHTENMENTHEADERS) enlightenment_SOURCES = \ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -3 -r1.41 -r1.42 --- e.h 10 Jan 2006 07:38:12 -0000 1.41 +++ e.h 12 Jan 2006 02:12:21 -0000 1.42 @@ -101,6 +101,8 @@ #define E_NEW_BIG(s, n) (s *)malloc(n * sizeof(s)) #define E_FREE(p) { if (p) {free(p); p = NULL;} } +#define E_CLAMP(x, min, max) (x < min ? min : (x > max ? max : x)) + #define E_REMOTE_OPTIONS 1 #define E_REMOTE_OUT 2 #define E_WM_IN 3 =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.136 retrieving revision 1.137 diff -u -3 -r1.136 -r1.137 --- e_config.c 8 Jan 2006 12:32:16 -0000 1.136 +++ e_config.c 12 Jan 2006 02:12:21 -0000 1.137 @@ -34,6 +34,8 @@ static E_Config_DD *_e_config_desktop_bg_edd = NULL; static E_Config_DD *_e_config_desktop_name_edd = NULL; static E_Config_DD *_e_config_remember_edd = NULL; +static E_Config_DD *_e_config_color_class_edd = NULL; + /* externally accessible functions */ EAPI int @@ -242,6 +244,25 @@ E_CONFIG_VAL(D, T, prop.head, INT); E_CONFIG_VAL(D, T, prop.command, STR); + _e_config_color_class_edd = E_CONFIG_DD_NEW("E_Color_Class", E_Color_Class); +#undef T +#undef D +#define T E_Color_Class +#define D _e_config_color_class_edd + E_CONFIG_VAL(D, T, name, STR); + E_CONFIG_VAL(D, T, r, INT); + E_CONFIG_VAL(D, T, g, INT); + E_CONFIG_VAL(D, T, b, INT); + E_CONFIG_VAL(D, T, a, INT); + E_CONFIG_VAL(D, T, r2, INT); + E_CONFIG_VAL(D, T, g2, INT); + E_CONFIG_VAL(D, T, b2, INT); + E_CONFIG_VAL(D, T, a2, INT); + E_CONFIG_VAL(D, T, r3, INT); + E_CONFIG_VAL(D, T, g3, INT); + E_CONFIG_VAL(D, T, b3, INT); + E_CONFIG_VAL(D, T, a3, INT); + _e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config); #undef T #undef D @@ -379,6 +400,7 @@ E_CONFIG_VAL(D, T, exebuf_pos_min_h, INT); E_CONFIG_VAL(D, T, exebuf_pos_max_w, INT); E_CONFIG_VAL(D, T, exebuf_pos_max_h, INT); + E_CONFIG_LIST(D, T, color_classes, _e_config_color_class_edd); e_config = e_config_domain_load("e", _e_config_edd); if (e_config) { @@ -2065,6 +2087,15 @@ E_FREE(rem); } + while (e_config->color_classes) + { + E_Color_Class *cc; + cc = e_config->color_classes->data; + e_config->color_classes = evas_list_remove_list(e_config->color_classes, e_config->color_classes); + + if (cc->name) evas_stringshare_del(cc->name); + E_FREE(cc); + } if (e_config->desktop_default_background) evas_stringshare_del(e_config->desktop_default_background); if (e_config->desktop_default_name) evas_stringshare_del(e_config->desktop_default_name); if (e_config->language) evas_stringshare_del(e_config->language); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v retrieving revision 1.74 retrieving revision 1.75 diff -u -3 -r1.74 -r1.75 --- e_config.h 8 Jan 2006 12:32:16 -0000 1.74 +++ e_config.h 12 Jan 2006 02:12:21 -0000 1.75 @@ -199,6 +199,7 @@ int exebuf_pos_min_h; int exebuf_pos_max_w; int exebuf_pos_max_h; + Evas_List *color_classes; }; struct _E_Config_Module =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_includes.h,v retrieving revision 1.77 retrieving revision 1.78 diff -u -3 -r1.77 -r1.78 --- e_includes.h 4 Jan 2006 22:20:51 -0000 1.77 +++ e_includes.h 12 Jan 2006 02:12:21 -0000 1.78 @@ -110,3 +110,4 @@ #include "e_exebuf.h" #include "e_int_config_modules.h" #include "e_exehist.h" +#include "e_color_class.h" =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_codec.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- e_ipc_codec.c 7 Jan 2006 10:39:45 -0000 1.12 +++ e_ipc_codec.c 12 Jan 2006 02:12:21 -0000 1.13 @@ -24,6 +24,8 @@ static Eet_Data_Descriptor *_e_ipc_3int_4str_list_edd = NULL; static Eet_Data_Descriptor *_e_ipc_3int_3str_edd = NULL; static Eet_Data_Descriptor *_e_ipc_3int_3str_list_edd = NULL; +static Eet_Data_Descriptor *_e_ipc_str_4int_edd = NULL; +static Eet_Data_Descriptor *_e_ipc_str_4int_list_edd = NULL; #define E_IPC_DD_NEW(str, typ) \ eet_data_descriptor_new(str, sizeof(typ), \ @@ -122,6 +124,17 @@ _e_ipc_3int_3str_list_edd = E_IPC_DD_NEW("3int_3str_list", E_Ipc_List); E_CONFIG_LIST(_e_ipc_3int_3str_list_edd, E_Ipc_List, list, _e_ipc_3int_3str_edd); + + _e_ipc_str_4int_edd = E_IPC_DD_NEW("str_4int", E_Ipc_Str_4Int); + E_CONFIG_VAL(_e_ipc_str_4int_edd, E_Ipc_Str_4Int, str, STR); + E_CONFIG_VAL(_e_ipc_str_4int_edd, E_Ipc_Str_4Int, val1, INT); + E_CONFIG_VAL(_e_ipc_str_4int_edd, E_Ipc_Str_4Int, val2, INT); + E_CONFIG_VAL(_e_ipc_str_4int_edd, E_Ipc_Str_4Int, val3, INT); + E_CONFIG_VAL(_e_ipc_str_4int_edd, E_Ipc_Str_4Int, val4, INT); + + _e_ipc_str_4int_list_edd = E_IPC_DD_NEW("str_4int_list", E_Ipc_List); + E_CONFIG_LIST(_e_ipc_str_4int_list_edd, E_Ipc_List, list, _e_ipc_str_4int_edd); + return 1; } @@ -607,5 +620,53 @@ dat.list = list; return eet_data_descriptor_encode(_e_ipc_3int_3str_list_edd, &dat, size_ret); } + +EAPI int +e_ipc_codec_str_4int_dec(char *data, int bytes, E_Ipc_Str_4Int **dest) +{ + E_Ipc_Str_4Int *dat; + + if (!data) return 0; + dat = eet_data_descriptor_decode(_e_ipc_str_4int_edd, data, bytes); + if (!dat) return 0; + if (dest) *dest = dat; + return 1; +} + +EAPI void * +e_ipc_codec_str_4int_enc(char *str1, int val1, int val2, int val3, int val4, int *size_ret) +{ + E_Ipc_Str_4Int dat; + + dat.str = str1; + dat.val1 = val1; + dat.val2 = val2; + dat.val3 = val3; + dat.val4 = val4; + + return eet_data_descriptor_encode(_e_ipc_str_4int_edd, &dat, size_ret); +} + +EAPI int +e_ipc_codec_str_4int_list_dec(char *data, int bytes, Evas_List **dest) +{ + E_Ipc_List *dat; + + if (!data) return 0; + dat = eet_data_descriptor_decode(_e_ipc_str_4int_list_edd, data, bytes); + if (!dat) return 0; + if (dest) *dest = dat->list; + free(dat); + return 1; +} + +EAPI void * +e_ipc_codec_str_4int_list_enc(Evas_List *list, int *size_ret) +{ + E_Ipc_List dat; + dat.list = list; + return eet_data_descriptor_encode(_e_ipc_str_4int_list_edd, &dat, size_ret); +} + /* local subsystem globals */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_codec.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- e_ipc_codec.h 22 Sep 2005 20:20:33 -0000 1.8 +++ e_ipc_codec.h 12 Jan 2006 02:12:21 -0000 1.9 @@ -17,6 +17,7 @@ typedef struct _E_Ipc_5Int_2Str E_Ipc_5Int_2Str; typedef struct _E_Ipc_3Int_4Str E_Ipc_3Int_4Str; typedef struct _E_Ipc_3Int_3Str E_Ipc_3Int_3Str; +typedef struct _E_Ipc_Str_4Int E_Ipc_Str_4Int; #else #ifndef E_IPC_CODEC_H @@ -88,6 +89,12 @@ char *str1, *str2, *str3; }; +struct _E_Ipc_Str_4Int +{ + char *str; + int val1, val2, val3, val4; +}; + EAPI int e_ipc_codec_init(void); EAPI void e_ipc_codec_shutdown(void); @@ -137,6 +144,8 @@ EAPI void *e_ipc_codec_3int_3str_enc(int val1, int val2, int val3, char *str1, char *str2, char *str3, int *size_ret); EAPI int e_ipc_codec_3int_3str_list_dec(char *data, int bytes, Evas_List **dest); EAPI void *e_ipc_codec_3int_3str_list_enc(Evas_List *list, int *size_ret); +EAPI int e_ipc_codec_str_4int_dec(char *data, int bytes, E_Ipc_Str_4Int **dest); +EAPI void *e_ipc_codec_str_4int_enc(char *str1, int val1, int val2, int val3, int val4, int *size_ret); #endif #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v retrieving revision 1.115 retrieving revision 1.116 diff -u -3 -r1.115 -r1.116 --- e_ipc_handlers.h 27 Dec 2005 17:16:57 -0000 1.115 +++ e_ipc_handlers.h 12 Jan 2006 02:12:21 -0000 1.116 @@ -180,6 +180,27 @@ } \ break; +# define STRING_4INT(__str, __int1, __int2, __int3, __int4, __str_4int, HDL) \ +case HDL: \ +if (e->data) { \ + char *__str = NULL; \ + int __int1, __int2, __int3, __int4; \ + E_Ipc_Str_4Int *__str_4int = NULL; \ + __str_4int = calloc(1, sizeof(E_Ipc_Str_4Int)); \ + if (e_ipc_codec_str_4int_dec(e->data, e->size, &(__str_4int))) { \ + __str = __str_4int->str; \ + __int1 = __str_4int->val1; \ + __int2 = __str_4int->val2; \ + __int3 = __str_4int->val3; \ + __int4 = __str_4int->val4; +# define END_STRING_4INT(__str_4int) \ + free(__str_4int->str); \ + free(__str_4int); \ + } \ +} \ +break; + + /** * Get event data for libe processing */ @@ -285,6 +306,16 @@ } \ break; +# define REQ_STRING_4INT(__str, __int1, __int2, __int3, __int4, HDL) \ +case HDL: { void *data; int bytes; \ + data = e_ipc_codec_str_4int_enc(__str, __int1, __int2, __int3, __int4, &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); \ @@ -621,6 +652,50 @@ } \ break; +# define STRING_INT4_LIST(__v, HDL) \ + case HDL: { \ + Evas_List *dat = NULL, *l; \ + if (e_ipc_codec_str_4int_list_dec(e->data, e->size, &dat)) { \ + for (l = dat; l; l = l->next) { \ + E_Ipc_Str_4Int *__v; \ + __v = l->data; +#define END_STRING_INT4_LIST(__v) \ + free(__v->str); \ + free(__v); \ + } \ + evas_list_free(dat); \ + } \ + } \ + break; + +/** + * SEND_STRING_INT4_LIST: + * Start to encode a list of objects to prepare them for sending via + * ipc. The object __v1 will be of type __typ1 and __v2 will be of type + * E_Ipc_Str_4Int. + * + * Use END_SEND_STRING_INT4_LIST to terminate the encode iteration and + * send that data. The list will be freed. + */ +#define SEND_STRING_INT4_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_Str_4Int *__v2; \ + __v1 = l->data; \ + __v2 = calloc(1, sizeof(E_Ipc_Str_4Int)); +#define END_SEND_STRING_INT4_LIST(__v1, __op) \ + dat = evas_list_append(dat, __v1); \ + } \ + data = e_ipc_codec_str_4int_list_enc(dat, &bytes); \ + SEND_DATA(__op); \ + FREE_LIST(dat); \ + } \ + break; + + /** * STRING2_INT_LIST: * Decode event data which is a list of E_Ipc_2Str_Int objects and iterate @@ -7114,3 +7189,125 @@ #endif #undef HDL /****************************************************************************/ +#define HDL E_IPC_OP_COLOR_CLASS_COLOR_SET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-color-class-color-set", 5, "Set color_class (OPT1) r, g, b, a (OPT2-5)", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_STRING_4INT(params[0], atoi(params[1]), atoi(params[2]), atoi(params[3]), atoi(params[4]), HDL) +#elif (TYPE == E_WM_IN) + STRING_4INT(color_class, r, g, b, a, e_str_4int, HDL); + e_color_class_set(color_class, r, g, b, a, -1, -1, -1, -1, -1, -1, -1, -1); + SAVE; + END_STRING_4INT(e_str_4int); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL +/****************************************************************************/ +#define HDL E_IPC_OP_COLOR_CLASS_COLOR2_SET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-color-class-color-set2", 5, "Set color_class (OPT1) color2 r, g, b, a (OPT2-5)", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_STRING_4INT(params[0], atoi(params[1]), atoi(params[2]), atoi(params[3]), atoi(params[4]), HDL) +#elif (TYPE == E_WM_IN) + STRING_4INT(color_class, r, g, b, a, e_str_4int, HDL); + e_color_class_set(color_class, -1, -1, -1, -1, r, g, b, a, -1, -1, -1, -1); + SAVE; + END_STRING_4INT(e_str_4int); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL +/****************************************************************************/ +#define HDL E_IPC_OP_COLOR_CLASS_COLOR3_SET +#if (TYPE == E_REMOTE_OPTIONS) + OP("-color-class-color-set3", 5, "Set color_class (OPT1) color3 r, g, b, a (OPT2-5)", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_STRING_4INT(params[0], atoi(params[1]), atoi(params[2]), atoi(params[3]), atoi(params[4]), HDL) +#elif (TYPE == E_WM_IN) + STRING_4INT(color_class, r, g, b, a, e_str_4int, HDL); + e_color_class_set(color_class, -1, -1, -1, -1, -1, -1, -1, -1, r, g, b, a); + SAVE; + END_STRING_4INT(e_str_4int); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL +/****************************************************************************/ +#define HDL E_IPC_OP_COLOR_CLASS_COLOR_LIST +#if (TYPE == E_REMOTE_OPTIONS) + OP("-color-class-color-list", 0, "List color values for all set color classes", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_STRING_INT4_LIST(e_color_class_list(), E_Color_Class, cc, v, HDL); + v->str = cc->name; + v->val1 = cc->r; + v->val2 = cc->g; + v->val3 = cc->b; + v->val4 = cc->a; + END_SEND_STRING_INT4_LIST(v, E_IPC_OP_COLOR_CLASS_COLOR_LIST_REPLY); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL +/****************************************************************************/ +#define HDL E_IPC_OP_COLOR_CLASS_COLOR2_LIST +#if (TYPE == E_REMOTE_OPTIONS) + OP("-color-class-color2-list", 0, "List color2 values for all set color classes", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_STRING_INT4_LIST(e_color_class_list(), E_Color_Class, cc, v, HDL); + v->str = cc->name; + v->val1 = cc->r2; + v->val2 = cc->g2; + v->val3 = cc->b2; + v->val4 = cc->a2; + END_SEND_STRING_INT4_LIST(v, E_IPC_OP_COLOR_CLASS_COLOR_LIST_REPLY); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL +/****************************************************************************/ +#define HDL E_IPC_OP_COLOR_CLASS_COLOR3_LIST +#if (TYPE == E_REMOTE_OPTIONS) + OP("-color-class-color3-list", 0, "List color3 values for all set color classes", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_STRING_INT4_LIST(e_color_class_list(), E_Color_Class, cc, v, HDL); + v->str = cc->name; + v->val1 = cc->r3; + v->val2 = cc->g3; + v->val3 = cc->b3; + v->val4 = cc->a3; + END_SEND_STRING_INT4_LIST(v, E_IPC_OP_COLOR_CLASS_COLOR_LIST_REPLY); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL +/****************************************************************************/ +#define HDL E_IPC_OP_COLOR_CLASS_DEL +#if (TYPE == E_REMOTE_OPTIONS) + OP("-color-class-del", 1, "Delete color class named OPT1", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_STRING(params[0], HDL); +#elif (TYPE == E_WM_IN) + STRING(s, HDL); + e_color_class_del(s); + END_STRING(s); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_COLOR_CLASS_COLOR_LIST_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) + STRING_INT4_LIST(v, HDL); + if (v->str) printf("REPLY: \"%s\" (RGBA) %i %i %i %i\n", v->str, v->val1, v->val2, v->val3, v->val4); + else printf("REPLY: \"\" (RGBA) %i %i %i %i\n", v->val1, v->val2, v->val3, v->val4); + END_STRING_INT_LIST(v); +#elif (TYPE == E_LIB_IN) + /* FIXME implement */ +#endif +#undef HDL + +/****************************************************************************/ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -3 -r1.40 -r1.41 --- e_ipc_handlers_list.h 6 Dec 2005 22:50:41 -0000 1.40 +++ e_ipc_handlers_list.h 12 Jan 2006 02:12:21 -0000 1.41 @@ -353,4 +353,13 @@ #define E_IPC_OP_CACHE_FLUSH_INTERVAL_GET 331 #define E_IPC_OP_CACHE_FLUSH_INTERVAL_GET_REPLY 332 -#define E_IPC_EAP_EDIT_START 333 +#define E_IPC_EAP_EDIT_START 333 + +#define E_IPC_OP_COLOR_CLASS_COLOR_SET 334 +#define E_IPC_OP_COLOR_CLASS_COLOR2_SET 335 +#define E_IPC_OP_COLOR_CLASS_COLOR3_SET 336 +#define E_IPC_OP_COLOR_CLASS_COLOR_LIST 337 +#define E_IPC_OP_COLOR_CLASS_COLOR2_LIST 338 +#define E_IPC_OP_COLOR_CLASS_COLOR3_LIST 339 +#define E_IPC_OP_COLOR_CLASS_COLOR_LIST_REPLY 340 +#define E_IPC_OP_COLOR_CLASS_DEL 341 =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v retrieving revision 1.143 retrieving revision 1.144 diff -u -3 -r1.143 -r1.144 --- e_main.c 10 Jan 2006 04:23:43 -0000 1.143 +++ e_main.c 12 Jan 2006 02:12:21 -0000 1.144 @@ -545,6 +545,13 @@ _e_main_shutdown(-1); } _e_main_shutdown_push(e_winlist_shutdown); + /* setup color_class */ + if (!e_color_class_init()) + { + e_error_message_show(_("Enlightenment cannot set up its color class system.")); + _e_main_shutdown(-1); + } + _e_main_shutdown_push(e_color_class_shutdown); if (ipc_failed) e_error_dialog_show(_("Enlightenment IPC setup error!"), ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs