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 SVN revision: 19731devs/princeamd/enlightenment-0.17-elive
parent
fb883ef939
commit
28ded42f0d
12 changed files with 462 additions and 2 deletions
@ -0,0 +1,107 @@ |
||||
#include "e.h" |
||||
|
||||
|
||||
EAPI int |
||||
e_color_class_init(void) |
||||
{ |
||||
Evas_List *l; |
||||
|
||||
for (l = e_config->color_classes; l; l = l->next) |
||||
{ |
||||
E_Color_Class *cc; |
||||
|
||||
cc = l->data; |
||||
if (!cc) continue; |
||||
|
||||
printf("INIT CC: %s, %d %d %d %d\n", cc->name, cc->r, cc->g, cc->b, cc->a); |
||||
edje_color_class_set(cc->name, |
||||
cc->r, cc->g, cc->b, cc->a, |
||||
cc->r2, cc->g2, cc->b2, cc->a2, |
||||
cc->r3, cc->g3, cc->b3, cc->a3); |
||||
|
||||
} |
||||
return 1; |
||||
} |
||||
|
||||
EAPI int |
||||
e_color_class_shutdown(void) |
||||
{ |
||||
return 1; |
||||
} |
||||
|
||||
EAPI void |
||||
e_color_class_set(const char *color_class, int r, int g, int b, int a, int r2, int b2, int g2, int a2, int r3, int g3, int b3, int a3) |
||||
{ |
||||
E_Color_Class *cc = NULL; |
||||
Evas_List *l; |
||||
int found = 0; |
||||
|
||||
cc = e_color_class_find(color_class); |
||||
if (!cc) |
||||
{ |
||||
cc = E_NEW(E_Color_Class, 1); |
||||
e_config->color_classes = evas_list_append(e_config->color_classes, cc); |
||||
cc->name = evas_stringshare_add(color_class); |
||||
} |
||||
|
||||
if (r != -1) cc->r = E_CLAMP(r, 0, 255); |
||||
if (g != -1) cc->g = E_CLAMP(g, 0, 255); |
||||
if (b != -1) cc->b = E_CLAMP(b, 0, 255); |
||||
if (a != -1) cc->a = E_CLAMP(a, 0, 255); |
||||
if (r != -1) cc->r2 = E_CLAMP(r2, 0, 255); |
||||
if (g != -1) cc->g2 = E_CLAMP(g2, 0, 255); |
||||
if (b != -1) cc->b2 = E_CLAMP(b2, 0, 255); |
||||
if (a != -1) cc->a2 = E_CLAMP(a2, 0, 255); |
||||
if (r != -1) cc->r3 = E_CLAMP(r3, 0, 255); |
||||
if (g != -1) cc->g3 = E_CLAMP(g3, 0, 255); |
||||
if (b != -1) cc->b3 = E_CLAMP(b3, 0, 255); |
||||
if (a != -1) cc->a3 = E_CLAMP(a3, 0, 255); |
||||
|
||||
edje_color_class_set(cc->name, |
||||
cc->r, cc->g, cc->b, cc->a, |
||||
cc->r2, cc->g2, cc->b2, cc->a2, |
||||
cc->r3, cc->g3, cc->b3, cc->a3); |
||||
} |
||||
|
||||
EAPI void |
||||
e_color_class_del(const char *name) |
||||
{ |
||||
E_Color_Class *cc = NULL; |
||||
|
||||
cc = e_color_class_find(name); |
||||
if (cc) |
||||
{ |
||||
e_config->color_classes = evas_list_remove(e_config->color_classes, cc); |
||||
/* FIXME: add edje_color_class_del() and use that) */ |
||||
edje_color_class_set(cc->name, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255); |
||||
evas_stringshare_del(cc->name); |
||||
E_FREE(cc); |
||||
} |
||||
} |
||||
|
||||
EAPI E_Color_Class * |
||||
e_color_class_find(const char *name) |
||||
{ |
||||
Evas_List *l; |
||||
E_Color_Class *cc = NULL; |
||||
|
||||
for(l = e_config->color_classes; l; l = l->next) |
||||
{ |
||||
cc = l->data; |
||||
if (!cc) continue; |
||||
|
||||
if (!strcmp(cc->name, name)) |
||||
{ |
||||
return cc; |
||||
break; |
||||
} |
||||
} |
||||
return NULL; |
||||
} |
||||
|
||||
|
||||
EAPI Evas_List * |
||||
e_color_class_list(void) |
||||
{ |
||||
return e_config->color_classes; |
||||
} |
@ -0,0 +1,33 @@ |
||||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 |
||||
*/ |
||||
|
||||
#ifdef E_TYPEDEFS |
||||
|
||||
typedef struct _E_Color_Class E_Color_Class; |
||||
|
||||
#else |
||||
#ifndef E_COLOR_CLASSES_H |
||||
#define E_COLOR_CLASSES_H |
||||
|
||||
struct _E_Color_Class |
||||
{ |
||||
char *name; |
||||
int r, g, b, a; |
||||
int r2, g2, b2, a2; |
||||
int r3, g3, b3, a3; |
||||
}; |
||||
|
||||
EAPI int e_color_class_init(void); |
||||
EAPI int e_color_class_shutdown(void); |
||||
EAPI void e_color_class_set(const char *color_class, |
||||
int r, int g, int b, int a, |
||||
int r2, int b2, int g2, int a2, |
||||
int r3, int g3, int b3, int a3); |
||||
EAPI E_Color_Class *e_color_class_find(const char *name); |
||||
EAPI void e_color_class_del(const char *name); |
||||
|
||||
EAPI Evas_List *e_color_class_list(void); |
||||
|
||||
#endif |
||||
#endif |
Loading…
Reference in new issue