2006-04-01 01:59:40 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
|
|
|
#include "e.h"
|
|
|
|
|
2006-04-12 07:45:10 -07:00
|
|
|
#define ILIST_ICON_WITH_DEFINED_FONT "enlightenment/e"
|
|
|
|
#define ILIST_ICON_WITHOUT_DEFINED_FONT ""
|
|
|
|
|
2006-04-01 01:59:40 -08:00
|
|
|
typedef struct _E_Text_Class_Pair E_Text_Class_Pair;
|
|
|
|
typedef struct _CFText_Class CFText_Class;
|
|
|
|
|
|
|
|
static void *_create_data(E_Config_Dialog *cfd);
|
|
|
|
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
|
|
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
|
|
|
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
|
|
|
|
2006-04-04 07:00:19 -07:00
|
|
|
static void _ilist_font_cb_change(void *data, Evas_Object *obj);
|
|
|
|
static void _enabled_font_cb_change(void *data, Evas_Object *obj);
|
2006-04-01 01:59:40 -08:00
|
|
|
|
2006-04-04 07:00:19 -07:00
|
|
|
static void _enabled_fallback_cb_change(void *data, Evas_Object *obj);
|
2006-04-01 01:59:40 -08:00
|
|
|
|
|
|
|
struct _E_Text_Class_Pair
|
|
|
|
{
|
|
|
|
const char *class_name;
|
|
|
|
const char *class_description;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _CFText_Class
|
|
|
|
{
|
|
|
|
const char *class_name;
|
|
|
|
const char *class_description;
|
|
|
|
const char *font;
|
|
|
|
double size;
|
|
|
|
unsigned char enabled : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
const E_Text_Class_Pair text_class_predefined_names[ ] = {
|
2006-04-23 22:51:04 -07:00
|
|
|
{ NULL, "Window Manager"},
|
2006-04-02 00:19:17 -08:00
|
|
|
{ "title_bar", "Title Bar"},
|
|
|
|
{ "menu_item", "Menu Item"},
|
|
|
|
{ "tb_plain", "Textblock Plain"},
|
|
|
|
{ "tb_light", "Textblock Light"},
|
|
|
|
{ "tb_big", "Textblock Big"},
|
|
|
|
{ "move_text", "Move Text"},
|
|
|
|
{ "resize_text", "Resize Text"},
|
|
|
|
{ "winlist_title", "Winlist Title"},
|
|
|
|
{ "configure", "Configure Heading"},
|
|
|
|
{ "about_title", "About Title"},
|
|
|
|
{ "about_version", "About Version"},
|
|
|
|
{ "button_text", "About Text"},
|
|
|
|
{ "desklock_title", "Desklock Title"},
|
|
|
|
{ "desklock_passwd", "Desklock Password"},
|
|
|
|
{ "dialog_error", "Dialog Error"},
|
|
|
|
{ "exebuf_command", "Exebuf Command"},
|
2006-04-24 09:08:20 -07:00
|
|
|
{ "init_title", "Splash Title"},
|
|
|
|
{ "init_text", "Splash Text"},
|
|
|
|
{ "init_version", "Splash Version"},
|
2006-04-23 08:30:47 -07:00
|
|
|
|
2006-04-23 22:51:04 -07:00
|
|
|
{ NULL, "Widget"},
|
2006-04-23 08:30:47 -07:00
|
|
|
{ "frame", "Frame"},
|
|
|
|
{ "label", "Label"},
|
|
|
|
{ "button", "Buttons"},
|
|
|
|
{ "slider", "Slider"},
|
|
|
|
{ "radio_button", "Radio Buttons"},
|
|
|
|
{ "check_button", "Check Buttons"},
|
|
|
|
{ "tlist", "Text List Item"},
|
|
|
|
{ "ilist_item", "List Item"},
|
|
|
|
{ "ilist_header", "List Header"},
|
|
|
|
|
2006-04-23 22:51:04 -07:00
|
|
|
{ NULL, "EFM"},
|
|
|
|
{ "fileman_typebuf", "Typebuf"},
|
|
|
|
{ "fileman_icon", "Icon"},
|
2006-04-23 08:30:47 -07:00
|
|
|
|
2006-04-23 22:51:04 -07:00
|
|
|
{ NULL, "Module"},
|
2006-04-23 08:30:47 -07:00
|
|
|
{ "module_small", "Small"},
|
|
|
|
{ "module_normal", "Normal"},
|
|
|
|
{ "module_large", "Large"},
|
|
|
|
{ "module_small_s", "Small Styled"},
|
|
|
|
{ "module_normal_s", "Normal Styled"},
|
|
|
|
{ "module_large_s", "Large Styled"},
|
|
|
|
|
|
|
|
{ NULL, NULL}
|
2006-04-01 01:59:40 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _E_Config_Dialog_Data
|
|
|
|
{
|
|
|
|
E_Config_Dialog *cfd;
|
2006-04-12 17:01:15 -07:00
|
|
|
Evas *evas;
|
2006-04-01 01:59:40 -08:00
|
|
|
|
|
|
|
/* Text Classes */
|
|
|
|
Evas_List *text_classes;
|
|
|
|
/* Current data */
|
|
|
|
char *cur_font;
|
|
|
|
double cur_size;
|
|
|
|
int cur_enabled;
|
|
|
|
int cur_index;
|
|
|
|
|
|
|
|
/* Font Fallbacks */
|
2006-04-04 07:00:19 -07:00
|
|
|
int cur_fallbacks_enabled;
|
2006-04-01 01:59:40 -08:00
|
|
|
|
|
|
|
/* Font Hinting */
|
|
|
|
int hinting;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
2006-04-04 07:00:19 -07:00
|
|
|
/* Font Classes */
|
2006-04-01 01:59:40 -08:00
|
|
|
Evas_Object *class_list;
|
|
|
|
|
|
|
|
Evas_Object *font;
|
|
|
|
Evas_Object *size;
|
|
|
|
Evas_Object *enabled;
|
2006-04-04 07:00:19 -07:00
|
|
|
|
|
|
|
/* Font Fallbacks */
|
|
|
|
Evas_Object *fallback_list; /* Selecting a list entry starts edit*/
|
2006-04-01 01:59:40 -08:00
|
|
|
}
|
|
|
|
gui;
|
|
|
|
};
|
|
|
|
|
|
|
|
EAPI E_Config_Dialog *
|
|
|
|
e_int_config_fonts(E_Container *con)
|
|
|
|
{
|
|
|
|
E_Config_Dialog *cfd;
|
|
|
|
E_Config_Dialog_View *v;
|
|
|
|
|
|
|
|
v = E_NEW(E_Config_Dialog_View, 1);
|
|
|
|
|
|
|
|
v->create_cfdata = _create_data;
|
|
|
|
v->free_cfdata = _free_data;
|
|
|
|
v->basic.create_widgets = _basic_create_widgets;
|
|
|
|
v->basic.apply_cfdata = _basic_apply_data;
|
|
|
|
|
|
|
|
cfd = e_config_dialog_new(con, _("Font Settings"), NULL, 0, v, NULL);
|
|
|
|
return cfd;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_fill_data(E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
2006-04-04 07:00:19 -07:00
|
|
|
Evas_List *font_list;
|
2006-04-01 01:59:40 -08:00
|
|
|
Evas_List *next;
|
|
|
|
E_Font_Default *efd;
|
|
|
|
CFText_Class *tc;
|
|
|
|
int i;
|
|
|
|
|
2006-04-04 07:00:19 -07:00
|
|
|
font_list = e_font_default_list();
|
2006-04-01 01:59:40 -08:00
|
|
|
|
|
|
|
/* Fill out the font list */
|
2006-04-23 08:30:47 -07:00
|
|
|
for (i = 0; text_class_predefined_names[i].class_description; i++ )
|
2006-04-01 01:59:40 -08:00
|
|
|
{
|
2006-04-23 08:30:47 -07:00
|
|
|
tc = E_NEW(CFText_Class, 1);
|
2006-04-01 01:59:40 -08:00
|
|
|
tc->class_name = text_class_predefined_names[i].class_name;
|
|
|
|
tc->class_description = _(text_class_predefined_names[i].class_description);
|
|
|
|
tc->font = NULL;
|
|
|
|
tc->size = 0;
|
|
|
|
tc->enabled = 0;
|
2006-04-23 08:30:47 -07:00
|
|
|
|
|
|
|
if (text_class_predefined_names[i].class_name)
|
2006-04-01 01:59:40 -08:00
|
|
|
{
|
2006-04-23 08:30:47 -07:00
|
|
|
for (next = font_list; next ; next = next->next)
|
2006-04-01 01:59:40 -08:00
|
|
|
{
|
2006-04-23 08:30:47 -07:00
|
|
|
efd = next->data;
|
|
|
|
|
|
|
|
if (!strcmp(tc->class_name, efd->text_class))
|
|
|
|
{
|
|
|
|
if (efd->font)
|
|
|
|
tc->font = evas_stringshare_add(efd->font);
|
|
|
|
else
|
|
|
|
tc->font = evas_stringshare_add("");
|
|
|
|
|
|
|
|
tc->size = efd->size;
|
|
|
|
tc->enabled = 1;
|
|
|
|
}
|
2006-04-01 01:59:40 -08:00
|
|
|
}
|
2006-04-23 08:30:47 -07:00
|
|
|
|
|
|
|
if (!tc->enabled)
|
2006-04-01 01:59:40 -08:00
|
|
|
{
|
2006-04-23 08:30:47 -07:00
|
|
|
efd = e_font_default_get(tc->class_name);
|
|
|
|
if (efd)
|
|
|
|
{
|
|
|
|
if (efd->font)
|
|
|
|
tc->font = evas_stringshare_add(efd->font);
|
|
|
|
else
|
|
|
|
tc->font = evas_stringshare_add("");
|
|
|
|
|
|
|
|
tc->size = efd->size;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
tc->font = evas_stringshare_add("");
|
|
|
|
}
|
2006-04-01 01:59:40 -08:00
|
|
|
}
|
|
|
|
}
|
2006-04-23 08:30:47 -07:00
|
|
|
|
2006-04-01 01:59:40 -08:00
|
|
|
/* Append the class */
|
|
|
|
cfdata->text_classes = evas_list_append(cfdata->text_classes, tc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Fill Hinting */
|
|
|
|
cfdata->hinting = e_config->font_hinting;
|
|
|
|
|
2006-04-04 07:00:19 -07:00
|
|
|
/* Font fallbacks configured in widgets */
|
|
|
|
|
2006-04-01 01:59:40 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *
|
|
|
|
_create_data(E_Config_Dialog *cfd)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
|
|
|
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
|
|
|
cfdata->cfd = cfd;
|
|
|
|
_fill_data(cfdata);
|
|
|
|
return cfdata;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
Evas_List *l;
|
|
|
|
|
|
|
|
while ((l = cfdata->text_classes))
|
|
|
|
{
|
|
|
|
CFText_Class *tc;
|
|
|
|
|
|
|
|
tc = l->data;
|
|
|
|
cfdata->text_classes = evas_list_remove_list(cfdata->text_classes, l);
|
2006-04-23 08:30:47 -07:00
|
|
|
if (tc->font) evas_stringshare_del(tc->font);
|
2006-04-01 01:59:40 -08:00
|
|
|
E_FREE(tc);
|
|
|
|
}
|
2006-04-04 07:00:19 -07:00
|
|
|
|
2006-04-23 08:30:47 -07:00
|
|
|
E_FREE(cfdata->cur_font);
|
2006-04-01 01:59:40 -08:00
|
|
|
free(cfdata);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
2006-04-04 07:00:19 -07:00
|
|
|
int i;
|
2006-04-01 01:59:40 -08:00
|
|
|
Evas_List *next;
|
|
|
|
CFText_Class *tc;
|
|
|
|
|
|
|
|
/* Save current data */
|
|
|
|
if (cfdata->cur_index >= 0)
|
|
|
|
{
|
|
|
|
tc = evas_list_nth(cfdata->text_classes, cfdata->cur_index);
|
|
|
|
tc->enabled = cfdata->cur_enabled;
|
|
|
|
tc->size = cfdata->cur_size;
|
|
|
|
if (cfdata->cur_font)
|
|
|
|
tc->font = evas_stringshare_add(cfdata->cur_font);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (next = cfdata->text_classes; next; next = next->next)
|
|
|
|
{
|
|
|
|
tc = next->data;
|
|
|
|
|
2006-04-23 08:30:47 -07:00
|
|
|
if (!tc->class_name) continue;
|
|
|
|
|
2006-04-01 01:59:40 -08:00
|
|
|
if (tc->enabled && tc->font)
|
|
|
|
{
|
|
|
|
e_font_default_set(tc->class_name, tc->font, tc->size);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
e_font_default_remove(tc->class_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-04 07:00:19 -07:00
|
|
|
/* Fallbacks configure */
|
|
|
|
e_font_fallback_clear();
|
|
|
|
|
|
|
|
if (cfdata->cur_fallbacks_enabled)
|
|
|
|
{
|
2006-04-06 05:07:45 -07:00
|
|
|
for (i = 0; i < e_widget_config_list_count(cfdata->gui.fallback_list); i++)
|
2006-04-04 07:00:19 -07:00
|
|
|
{
|
|
|
|
const char *fallback;
|
2006-04-06 05:07:45 -07:00
|
|
|
fallback = e_widget_config_list_nth_get(cfdata->gui.fallback_list, i);
|
2006-04-04 07:00:19 -07:00
|
|
|
if (fallback != NULL && strlen(fallback) > 0)
|
|
|
|
e_font_fallback_append(fallback);
|
|
|
|
}
|
|
|
|
}
|
2006-04-01 01:59:40 -08:00
|
|
|
e_font_apply();
|
|
|
|
|
|
|
|
/* Apply Hinting */
|
|
|
|
e_config->font_hinting = cfdata->hinting;
|
|
|
|
e_config_save_queue();
|
|
|
|
e_canvas_rehint();
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
Evas_Object *o, *of, *ob;
|
|
|
|
E_Radio_Group *rg;
|
2006-04-23 08:30:47 -07:00
|
|
|
Evas_List *next;
|
2006-04-01 01:59:40 -08:00
|
|
|
int option_enable;
|
|
|
|
|
|
|
|
cfdata->cur_index = -1;
|
2006-04-12 17:01:15 -07:00
|
|
|
cfdata->evas = evas;
|
2006-04-01 01:59:40 -08:00
|
|
|
o = e_widget_list_add(evas, 0, 0);
|
|
|
|
|
|
|
|
/* Create Font Class Widgets */
|
|
|
|
of = e_widget_frametable_add(evas, _("Font Class Configuration"), 0);
|
|
|
|
cfdata->gui.class_list = e_widget_ilist_add(evas, 16, 16, NULL);
|
|
|
|
e_widget_min_size_set(cfdata->gui.class_list, 100, 100);
|
2006-04-04 07:00:19 -07:00
|
|
|
e_widget_on_change_hook_set(cfdata->gui.class_list, _ilist_font_cb_change, cfdata);
|
2006-04-01 01:59:40 -08:00
|
|
|
|
|
|
|
/* Fill In Ilist */
|
2006-04-23 08:30:47 -07:00
|
|
|
for (next = cfdata->text_classes; next; next = next->next)
|
2006-04-01 01:59:40 -08:00
|
|
|
{
|
|
|
|
CFText_Class *tc;
|
|
|
|
Evas_Object *ic;
|
|
|
|
|
2006-04-23 08:30:47 -07:00
|
|
|
tc = next->data;
|
2006-04-01 01:59:40 -08:00
|
|
|
if (tc)
|
|
|
|
{
|
2006-04-23 08:30:47 -07:00
|
|
|
if (tc->class_name)
|
2006-04-12 17:01:15 -07:00
|
|
|
{
|
2006-04-23 08:30:47 -07:00
|
|
|
if (tc->enabled)
|
|
|
|
{
|
|
|
|
ic = edje_object_add(evas);
|
|
|
|
e_util_edje_icon_set(ic, ILIST_ICON_WITH_DEFINED_FONT);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ic = NULL;
|
|
|
|
}
|
|
|
|
e_widget_ilist_append(cfdata->gui.class_list, ic, tc->class_description, NULL, NULL, NULL);
|
2006-04-12 17:01:15 -07:00
|
|
|
}
|
2006-04-01 01:59:40 -08:00
|
|
|
else
|
2006-04-12 17:01:15 -07:00
|
|
|
{
|
2006-04-23 08:30:47 -07:00
|
|
|
e_widget_ilist_header_append(cfdata->gui.class_list, NULL, tc->class_description);
|
2006-04-12 17:01:15 -07:00
|
|
|
}
|
2006-04-01 01:59:40 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
e_widget_ilist_go(cfdata->gui.class_list);
|
|
|
|
e_widget_frametable_object_append( of,
|
|
|
|
cfdata->gui.class_list,
|
|
|
|
0, /* Col Start*/
|
|
|
|
0, /* Row Start */
|
|
|
|
1, /* Col Span*/
|
|
|
|
5, /* Row Span*/
|
|
|
|
1, 1, 1, 1);
|
|
|
|
|
|
|
|
ob = e_widget_label_add(evas, _("Font"));
|
|
|
|
e_widget_frametable_object_append( of,
|
|
|
|
ob,
|
|
|
|
1, 0, 1, 1,
|
|
|
|
1, 1, 1, 1);
|
|
|
|
|
|
|
|
cfdata->gui.font = e_widget_entry_add(evas, &(cfdata->cur_font));
|
|
|
|
e_widget_disabled_set(cfdata->gui.font, 1);
|
|
|
|
e_widget_min_size_set(cfdata->gui.font, 100, 25);
|
|
|
|
e_widget_frametable_object_append(of, cfdata->gui.font,
|
|
|
|
2, 0, 1, 1,
|
|
|
|
1, 1, 1, 1);
|
|
|
|
|
|
|
|
ob = e_widget_label_add(evas, _("Font Size"));
|
|
|
|
e_widget_frametable_object_append( of,
|
|
|
|
ob,
|
|
|
|
1, 1, 1, 1,
|
|
|
|
1, 1, 1, 1);
|
|
|
|
|
|
|
|
cfdata->gui.size = e_widget_slider_add(evas, 1, 0, _("%2.1f pixels"), 5.0, 25.0, 0.5, 0, &(cfdata->cur_size), NULL, 25);
|
|
|
|
e_widget_disabled_set(cfdata->gui.size, 1);
|
|
|
|
e_widget_min_size_set(cfdata->gui.size, 180, 25);
|
|
|
|
e_widget_frametable_object_append(of, cfdata->gui.size,
|
|
|
|
2, 1, 1, 1,
|
|
|
|
1, 1, 1, 1);
|
|
|
|
|
|
|
|
cfdata->gui.enabled = e_widget_check_add(evas, _("Enable Font Class"), &(cfdata->cur_enabled));
|
|
|
|
e_widget_disabled_set(cfdata->gui.enabled, 1);
|
|
|
|
e_widget_frametable_object_append(of, cfdata->gui.enabled,
|
|
|
|
1, 3, 2, 1,
|
|
|
|
1, 1, 1, 1);
|
2006-04-04 07:00:19 -07:00
|
|
|
e_widget_on_change_hook_set(cfdata->gui.enabled, _enabled_font_cb_change, cfdata);
|
2006-04-01 01:59:40 -08:00
|
|
|
|
|
|
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
|
|
|
|
|
|
|
/* Create Hinting Widgets */
|
2006-04-02 00:19:17 -08:00
|
|
|
of = e_widget_framelist_add(evas, _("Hinting"), 0);
|
2006-04-01 01:59:40 -08:00
|
|
|
e_widget_framelist_content_align_set(of, 0.5, 0.5);
|
|
|
|
rg = e_widget_radio_group_new(&(cfdata->hinting));
|
|
|
|
|
|
|
|
option_enable = evas_font_hinting_can_hint(evas, EVAS_FONT_HINTING_BYTECODE);
|
2006-04-02 00:19:17 -08:00
|
|
|
ob = e_widget_radio_add(evas, _("Bytecode"), 0, rg);
|
2006-04-01 01:59:40 -08:00
|
|
|
e_widget_disabled_set(ob, !option_enable);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
|
|
|
|
option_enable = evas_font_hinting_can_hint(evas, EVAS_FONT_HINTING_AUTO);
|
2006-04-02 00:19:17 -08:00
|
|
|
ob = e_widget_radio_add(evas, _("Automatic"), 1, rg);
|
2006-04-01 01:59:40 -08:00
|
|
|
e_widget_disabled_set(ob, !option_enable);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
|
|
|
|
|
|
|
option_enable = evas_font_hinting_can_hint(evas, EVAS_FONT_HINTING_NONE);
|
2006-04-02 00:19:17 -08:00
|
|
|
ob = e_widget_radio_add(evas, _("None"), 2, rg);
|
2006-04-01 01:59:40 -08:00
|
|
|
e_widget_disabled_set(ob, !option_enable);
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
2006-04-04 07:00:19 -07:00
|
|
|
|
|
|
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
|
|
|
|
|
|
|
/* Create Fallbacks Widgets */
|
2006-04-06 05:07:45 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Font Fallbacks"), 0);
|
|
|
|
e_widget_framelist_content_align_set(of, 0.5, 0.5);
|
2006-04-04 07:00:19 -07:00
|
|
|
|
2006-04-09 04:55:18 -07:00
|
|
|
ob = e_widget_config_list_add(evas, e_widget_entry_add, _("Fallback Name"), 1);
|
2006-04-06 05:07:45 -07:00
|
|
|
cfdata->gui.fallback_list = ob;
|
|
|
|
e_widget_framelist_object_append(of, ob);
|
2006-04-04 07:00:19 -07:00
|
|
|
|
|
|
|
/* Fill In Ilist */
|
2006-04-06 05:07:45 -07:00
|
|
|
option_enable = 0;
|
2006-04-23 08:30:47 -07:00
|
|
|
for (next = e_font_fallback_list(); next; next = next->next)
|
2006-04-04 07:00:19 -07:00
|
|
|
{
|
|
|
|
E_Font_Fallback *eff;
|
|
|
|
|
2006-04-23 08:30:47 -07:00
|
|
|
eff = next->data;
|
2006-04-06 05:07:45 -07:00
|
|
|
e_widget_config_list_append(ob, eff->name);
|
|
|
|
option_enable = 1;
|
2006-04-04 07:00:19 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
ob = e_widget_check_add(evas, _("Enable Fallbacks"), &(cfdata->cur_fallbacks_enabled));
|
2006-04-06 05:07:45 -07:00
|
|
|
e_widget_config_list_object_append( cfdata->gui.fallback_list,
|
|
|
|
ob,
|
2006-04-04 07:00:19 -07:00
|
|
|
0, 3, 1, 1,
|
|
|
|
1, 1, 1, 1);
|
2006-04-06 05:07:45 -07:00
|
|
|
e_widget_on_change_hook_set(ob, _enabled_fallback_cb_change, cfdata);
|
2006-04-04 07:00:19 -07:00
|
|
|
e_widget_check_checked_set(ob, option_enable);
|
2006-04-06 05:07:45 -07:00
|
|
|
e_widget_change(ob);
|
2006-04-04 07:00:19 -07:00
|
|
|
|
2006-04-01 01:59:40 -08:00
|
|
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
2006-04-06 05:07:45 -07:00
|
|
|
|
2006-04-01 01:59:40 -08:00
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
2006-04-04 07:00:19 -07:00
|
|
|
/* Private Font Class Functions */
|
|
|
|
|
2006-04-01 01:59:40 -08:00
|
|
|
static void
|
2006-04-04 07:00:19 -07:00
|
|
|
_ilist_font_cb_change(void *data, Evas_Object *obj)
|
2006-04-01 01:59:40 -08:00
|
|
|
{
|
|
|
|
int indx;
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
CFText_Class *tc;
|
|
|
|
|
|
|
|
cfdata = data;
|
|
|
|
if (!cfdata) return;
|
|
|
|
|
|
|
|
/* Save old data */
|
|
|
|
if (cfdata->cur_index >= 0)
|
|
|
|
{
|
|
|
|
tc = evas_list_nth(cfdata->text_classes, cfdata->cur_index);
|
|
|
|
tc->enabled = cfdata->cur_enabled;
|
|
|
|
tc->size = cfdata->cur_size;
|
|
|
|
if (cfdata->cur_font)
|
|
|
|
tc->font = evas_stringshare_add(cfdata->cur_font);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Fillout form with new data */
|
|
|
|
indx = e_widget_ilist_selected_get(cfdata->gui.class_list);
|
|
|
|
tc = evas_list_nth(cfdata->text_classes, indx);
|
|
|
|
cfdata->cur_index = indx;
|
|
|
|
|
|
|
|
e_widget_disabled_set(cfdata->gui.enabled, 0);
|
|
|
|
e_widget_disabled_set(cfdata->gui.font, !tc->enabled);
|
|
|
|
e_widget_disabled_set(cfdata->gui.size, !tc->enabled);
|
|
|
|
|
|
|
|
e_widget_check_checked_set(cfdata->gui.enabled, tc->enabled);
|
|
|
|
e_widget_entry_text_set(cfdata->gui.font, tc->font);
|
|
|
|
e_widget_slider_value_double_set(cfdata->gui.size, tc->size);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-04 07:00:19 -07:00
|
|
|
_enabled_font_cb_change(void *data, Evas_Object *obj)
|
2006-04-01 01:59:40 -08:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
2006-04-12 17:01:15 -07:00
|
|
|
Evas_Object *icon;
|
|
|
|
int n;
|
|
|
|
|
2006-04-01 01:59:40 -08:00
|
|
|
cfdata = data;
|
|
|
|
if (!cfdata) return;
|
|
|
|
|
2006-04-12 17:01:15 -07:00
|
|
|
n = e_widget_ilist_selected_get(cfdata->gui.class_list);
|
2006-04-01 01:59:40 -08:00
|
|
|
if (cfdata->cur_enabled)
|
|
|
|
{
|
|
|
|
e_widget_disabled_set(cfdata->gui.font, 0);
|
|
|
|
e_widget_disabled_set(cfdata->gui.size, 0);
|
2006-04-12 17:01:15 -07:00
|
|
|
icon = edje_object_add(cfdata->evas);
|
|
|
|
e_util_edje_icon_set(icon, ILIST_ICON_WITH_DEFINED_FONT);
|
2006-04-01 01:59:40 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
e_widget_disabled_set(cfdata->gui.font, 1);
|
|
|
|
e_widget_disabled_set(cfdata->gui.size, 1);
|
2006-04-12 17:01:15 -07:00
|
|
|
icon = NULL;
|
2006-04-01 01:59:40 -08:00
|
|
|
}
|
2006-04-12 17:01:15 -07:00
|
|
|
e_widget_ilist_nth_icon_set(cfdata->gui.class_list, n, icon);
|
2006-04-01 01:59:40 -08:00
|
|
|
}
|
2006-04-04 07:00:19 -07:00
|
|
|
|
|
|
|
/* Private Font Fallback Functions */
|
|
|
|
static void _enabled_fallback_cb_change(void *data, Evas_Object *obj)
|
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
|
|
|
|
cfdata = data;
|
|
|
|
if (!cfdata) return;
|
2006-04-06 05:07:45 -07:00
|
|
|
|
|
|
|
e_widget_disabled_set(cfdata->gui.fallback_list, !cfdata->cur_fallbacks_enabled);
|
2006-04-04 07:00:19 -07:00
|
|
|
}
|
|
|
|
|