forked from enlightenment/enlightenment
Start "virtualizing" the color classes to a "long name" that can be
translated. SVN revision: 26326
This commit is contained in:
parent
557b1690e0
commit
fa25ccae4d
|
@ -1,6 +1,7 @@
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
|
|
||||||
typedef struct _CFColor_Class CFColor_Class;
|
typedef struct _CFColor_Class CFColor_Class;
|
||||||
|
typedef struct _CFColor_Hash CFColor_Hash;
|
||||||
|
|
||||||
static void *_create_data (E_Config_Dialog *cfd);
|
static void *_create_data (E_Config_Dialog *cfd);
|
||||||
static void _free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
static void _free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
|
@ -11,6 +12,12 @@ static Evas_Object *_adv_create_widgets (E_Config_Dialog *cfd, Evas *evas, E_C
|
||||||
|
|
||||||
static void _load_color_classes (Evas_Object *obj, E_Config_Dialog_Data *cfdata);
|
static void _load_color_classes (Evas_Object *obj, E_Config_Dialog_Data *cfdata);
|
||||||
|
|
||||||
|
struct _CFColor_Hash
|
||||||
|
{
|
||||||
|
const char *key;
|
||||||
|
const char *name;
|
||||||
|
};
|
||||||
|
|
||||||
struct _CFColor_Class
|
struct _CFColor_Class
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
|
@ -25,6 +32,13 @@ struct _E_Config_Dialog_Data
|
||||||
Evas_List *classes;
|
Evas_List *classes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const CFColor_Hash _color_hash[] =
|
||||||
|
{
|
||||||
|
{"button_text_enabled", N_("Button Text Enabled")},
|
||||||
|
{"button_text_disabled", N_("Button Text Disabled")},
|
||||||
|
{NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
EAPI E_Config_Dialog *
|
EAPI E_Config_Dialog *
|
||||||
e_int_config_color_classes(E_Container *con)
|
e_int_config_color_classes(E_Container *con)
|
||||||
{
|
{
|
||||||
|
@ -50,9 +64,41 @@ static void
|
||||||
_fill_data(E_Config_Dialog_Data *cfdata)
|
_fill_data(E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
Evas_Hash *color_hash;
|
||||||
|
|
||||||
cfdata->cur_class = NULL;
|
cfdata->cur_class = NULL;
|
||||||
cfdata->state = 0;
|
cfdata->state = 0;
|
||||||
|
|
||||||
|
for (l = edje_color_class_list(); l; l = l->next)
|
||||||
|
{
|
||||||
|
Evas_Object *icon;
|
||||||
|
E_Color_Class *cc;
|
||||||
|
CFColor_Class *cfc;
|
||||||
|
char *name;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
name = (char *)l->data;
|
||||||
|
if (!name) continue;
|
||||||
|
|
||||||
|
cfc = E_NEW(CFColor_Class, 1);
|
||||||
|
while (_color_hash[i].key)
|
||||||
|
{
|
||||||
|
if (!strcmp(_color_hash[i].key, name))
|
||||||
|
{
|
||||||
|
cfc->name = evas_stringshare_add(_color_hash[i].name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (!cfc->name)
|
||||||
|
cfc->name = evas_stringshare_add(name);
|
||||||
|
|
||||||
|
cfc->enabled = 0;
|
||||||
|
cc = e_color_class_find(name);
|
||||||
|
if (cc)
|
||||||
|
cfc->enabled = 1;
|
||||||
|
cfdata->classes = evas_list_append(cfdata->classes, cfc);
|
||||||
|
}
|
||||||
|
|
||||||
cfdata->color1 = calloc(1, sizeof(E_Color));
|
cfdata->color1 = calloc(1, sizeof(E_Color));
|
||||||
cfdata->color1->a = 255;
|
cfdata->color1->a = 255;
|
||||||
|
@ -75,25 +121,6 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
||||||
e_color_update_rgb(cfdata->color1);
|
e_color_update_rgb(cfdata->color1);
|
||||||
e_color_update_rgb(cfdata->color2);
|
e_color_update_rgb(cfdata->color2);
|
||||||
e_color_update_rgb(cfdata->color3);
|
e_color_update_rgb(cfdata->color3);
|
||||||
|
|
||||||
for (l = edje_color_class_list(); l; l = l->next)
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
Evas_Object *icon;
|
|
||||||
E_Color_Class *cc;
|
|
||||||
CFColor_Class *cfc;
|
|
||||||
|
|
||||||
name = (char *)l->data;
|
|
||||||
if (!name) continue;
|
|
||||||
|
|
||||||
cfc = E_NEW(CFColor_Class, 1);
|
|
||||||
cfc->name = evas_stringshare_add(name);
|
|
||||||
cfc->enabled = 0;
|
|
||||||
cc = e_color_class_find(name);
|
|
||||||
if (cc)
|
|
||||||
cfc->enabled = 1;
|
|
||||||
cfdata->classes = evas_list_append(cfdata->classes, cfc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
|
Loading…
Reference in New Issue