* shortening config category titles.

* remove illume custom config dialog - use normal one
* add toolbar used in config dialog. will be used for more. makes ui more
  compact and flexible.
* make dialog windows optionally ALWAYS be "normal windows".
* config module exports a config gadget now - illume doesnt need it anymore



SVN revision: 37721
This commit is contained in:
Carsten Haitzler 2008-11-21 03:59:30 +00:00
parent f8fc0ae092
commit 5b50a2b89e
46 changed files with 916 additions and 376 deletions

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65833; value "config_version" int: 65834;
value "show_splash" int: 0; value "show_splash" int: 0;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -521,4 +521,5 @@ group "E_Config" struct {
value "show_cursor" uchar: 1; value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1; value "idle_cursor" uchar: 1;
value "default_system_menu" string: ""; value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
} }

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65833; value "config_version" int: 65834;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -613,8 +613,8 @@ group "E_Config" struct {
} }
group "clients" list { group "clients" list {
group "E_Config_Gadcon_Client" struct { group "E_Config_Gadcon_Client" struct {
value "name" string: "illume-cfg"; value "name" string: "configuration";
value "id" string: "illume-cfg"; value "id" string: "configuration";
value "geom.pos" int: 0; value "geom.pos" int: 0;
value "geom.size" int: 32; value "geom.size" int: 32;
value "geom.res" int: 472; value "geom.res" int: 472;
@ -787,4 +787,5 @@ group "E_Config" struct {
value "show_cursor" uchar: 0; value "show_cursor" uchar: 0;
value "idle_cursor" uchar: 0; value "idle_cursor" uchar: 0;
value "default_system_menu" string: ""; value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 1;
} }

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65833; value "config_version" int: 65834;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_background" string: "Light_Gradient.edj"; value "desktop_default_background" string: "Light_Gradient.edj";
@ -1933,4 +1933,6 @@ group "E_Config" struct {
value "scale.use_custom" uchar: 1; value "scale.use_custom" uchar: 1;
value "show_cursor" uchar: 1; value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1; value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
} }

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65833; value "config_version" int: 65834;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_background" string: "Dark_Gradient.edj"; value "desktop_default_background" string: "Dark_Gradient.edj";
@ -1997,4 +1997,6 @@ group "E_Config" struct {
value "scale.use_custom" uchar: 0; value "scale.use_custom" uchar: 0;
value "show_cursor" uchar: 1; value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1; value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
} }

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65833; value "config_version" int: 65834;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -2020,4 +2020,6 @@ group "E_Config" struct {
value "scale.use_custom" uchar: 0; value "scale.use_custom" uchar: 0;
value "show_cursor" uchar: 1; value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1; value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
} }

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65833; value "config_version" int: 65834;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -2020,4 +2020,6 @@ group "E_Config" struct {
value "scale.use_custom" uchar: 0; value "scale.use_custom" uchar: 0;
value "show_cursor" uchar: 1; value "show_cursor" uchar: 1;
value "idle_cursor" uchar: 1; value "idle_cursor" uchar: 1;
value "default_system_menu" string: "";
value "cfgdlg_normal_wins" uchar: 0;
} }

View File

@ -5357,6 +5357,271 @@ collections { /* begin the collection of edje groups that are in this file */
} }
} }
/////////////////////////////////////////////////////////////////////////////
/*** TOOLBAR */
group { name: "e/widgets/toolbar";
images {
image: "bt_dis_base.png" COMP;
image: "bt_dis_hilight.png" COMP;
image: "bt_dis_shine.png" COMP;
image: "icon_left_arrow.png" COMP;
image: "icon_right_arrow.png" COMP;
}
parts {
part { name: "base";
mouse_events: 1;
description { state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 2 2;
}
rel2.offset: -3 -3;
image {
normal: "bt_dis_base.png";
border: 4 4 4 4;
}
}
}
part { name: "clipper";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "base";
offset: 2 2;
}
rel2 {
to: "base";
offset: -3 -3;
}
}
}
part { name: "e.swallow.content";
clip_to: "clipper";
type: SWALLOW;
description {
state: "default" 0.0;
rel1.to: "clipper";
rel2.to: "clipper";
}
}
part { name: "over2";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
image {
normal: "bt_dis_shine.png";
border: 4 4 4 4;
}
}
}
part { name: "over1";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "base";
rel2.to: "base";
rel2.relative: 1.0 0.5;
image {
normal: "bt_dis_hilight.png";
border: 4 4 4 0;
}
}
}
part { name: "left_arrow";
mouse_events: 0;
description { state: "default" 0.0;
image.normal: "icon_left_arrow.png";
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
align: 0.0 0.5;
min: 32 32;
max: 32 32;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
part { name: "right_arrow";
mouse_events: 0;
description { state: "default" 0.0;
image.normal: "icon_right_arrow.png";
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
align: 1.0 0.5;
min: 32 32;
max: 32 32;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
part { name: "event";
type: RECT;
mouse_events: 1;
repeat_events: 1;
description { state: "default" 0.0;
color: 0 0 0 0;
}
}
}
programs {
program { name: "sb_hbar_show";
signal: "e,action,show,hbar";
source: "e";
action: STATE_SET "default" 0.0;
transition: LINEAR 0.5;
target: "left_arrow";
target: "right_arrow";
}
program { name: "sb_hbar_hide";
signal: "e,action,hide,hbar";
source: "e";
action: STATE_SET "hidden" 0.0;
target: "left_arrow";
target: "right_arrow";
transition: LINEAR 0.5;
}
}
}
group { name: "e/widgets/toolbar/item";
images {
image: "toolbar_sel.png" COMP;
}
parts {
part { name: "label2";
type: TEXT;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
align: 0.5 1.0;
fixed: 0 1;
rel1.to: "e.text.label";
rel2.to: "e.text.label";
color: 0 0 0 255;
text {
font: "Sans";
text_source: "e.text.label";
size: 10;
min: 1 1;
align: 0.5 0.5;
text_class: "fileman_icon";
}
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
part { name: "bg";
mouse_events: 0;
description { state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
image {
normal: "toolbar_sel.png";
border: 3 3 0 0;
}
fill.smooth: 0;
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
}
part { name: "e.swallow.icon";
type: SWALLOW;
description { state: "default" 0.0;
align: 0.5 0.5;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
rel1 {
relative: 0.0 0.0;
offset: 2 2;
}
rel2 {
to_y: "e.text.label";
relative: 1.0 0.0;
offset: -3 -1;
}
color: 0 0 0 0;
}
}
part { name: "e.text.label";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
scale: 1;
description { state: "default" 0.0;
align: 0.5 1.0;
fixed: 0 1;
rel1 {
relative: 0.0 1.0;
offset: 0 -1;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
visible: 0;
color: 224 224 224 255;
color3: 0 0 0 32;
text {
font: "Sans:style=Bold";
size: 10;
min: 1 1;
align: 0.5 0.5;
text_class: "fileman_icon";
}
}
description { state: "selected" 0.0;
inherit: "default" 0.0;
visible: 1;
}
}
part { name: "event";
type: RECT;
mouse_events: 1;
ignore_flags: ON_HOLD;
description { state: "default" 0.0;
color: 0 0 0 0;
}
}
}
programs {
program { name: "go_active";
signal: "e,state,selected";
source: "e";
action: STATE_SET "selected" 0.0;
target: "bg";
target: "e.text.label";
target: "label2";
transition: LINEAR 0.2;
}
program { name: "go_passive";
signal: "e,state,unselected";
source: "e";
action: STATE_SET "default" 0.0;
target: "bg";
target: "e.text.label";
target: "label2";
transition: LINEAR 0.1;
}
program { name: "go";
signal: "mouse,up,1";
source: "event";
action: SIGNAL_EMIT "e,action,click" "e";
}
}
}
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/*** MENUS ***/ /*** MENUS ***/
/* this is the background for all menus. it also may optionally display a /* this is the background for all menus. it also may optionally display a
@ -15767,11 +16032,11 @@ collections { /* begin the collection of edje groups that are in this file */
type: SWALLOW; type: SWALLOW;
description { state: "default" 0.0; description { state: "default" 0.0;
align: 0.5 0.5; align: 0.5 0.5;
min: 320 200; min: 100 200;
rel1.offset: 24 5; rel1.offset: 5 5;
rel2 { rel2 {
relative: 1.0 0.0; relative: 1.0 0.0;
offset: -25 -9; offset: -6 -9;
to_y: "e.swallow.button"; to_y: "e.swallow.button";
} }
} }
@ -21705,7 +21970,7 @@ group { name: "e/icons/"NAME ; \
max: SIZE SIZE; \ max: SIZE SIZE; \
parts { \ parts { \
part { name: "icon"; \ part { name: "icon"; \
mouse_events: 0; \ repeat_events: 1; \
description { state: "default" 0.0; \ description { state: "default" 0.0; \
aspect: 1.0 1.0; \ aspect: 1.0 1.0; \
aspect_preference: BOTH; \ aspect_preference: BOTH; \

View File

@ -529,6 +529,7 @@ temp_base.png \
temp_mid.png \ temp_mid.png \
temp_over.png \ temp_over.png \
toolbar_bottom.png \ toolbar_bottom.png \
toolbar_sel.png \
toolbar_top.png \ toolbar_top.png \
topsh.png \ topsh.png \
transition_vswipe.png \ transition_vswipe.png \

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -163,7 +163,8 @@ e_powersave.h \
e_slidesel.h \ e_slidesel.h \
e_slidecore.h \ e_slidecore.h \
e_widget_flist.h \ e_widget_flist.h \
e_scale.h e_scale.h \
e_widget_toolbar.h
enlightenment_src = \ enlightenment_src = \
e_user.c \ e_user.c \
@ -298,6 +299,7 @@ e_slidesel.c \
e_slidecore.c \ e_slidecore.c \
e_widget_flist.c \ e_widget_flist.c \
e_scale.c \ e_scale.c \
e_widget_toolbar.c \
$(ENLIGHTENMENTHEADERS) $(ENLIGHTENMENTHEADERS)
enlightenment_SOURCES = \ enlightenment_SOURCES = \

View File

@ -640,6 +640,8 @@ e_config_init(void)
E_CONFIG_VAL(D, T, default_system_menu, STR); E_CONFIG_VAL(D, T, default_system_menu, STR);
E_CONFIG_VAL(D, T, cfgdlg_normal_wins, UCHAR); /**/
e_config_load(); e_config_load();
e_config_save_queue(); e_config_save_queue();
@ -818,6 +820,10 @@ e_config_load(void)
COPYVAL(desklock_start_locked); COPYVAL(desklock_start_locked);
IFCFGEND; IFCFGEND;
IFCFG(0x012b);
COPYVAL(cfgdlg_normal_wins);
IFCFGEND;
e_config->config_version = E_CONFIG_FILE_VERSION; e_config->config_version = E_CONFIG_FILE_VERSION;
_e_config_free(tcfg); _e_config_free(tcfg);
} }

View File

@ -33,7 +33,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
/* increment this whenever a new set of config values are added but the users /* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in * config doesn't need to be wiped - simply new values need to be put in
*/ */
#define E_CONFIG_FILE_GENERATION 0x012a #define E_CONFIG_FILE_GENERATION 0x012b
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION) #define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
#define E_EVAS_ENGINE_DEFAULT 0 #define E_EVAS_ENGINE_DEFAULT 0
@ -316,6 +316,8 @@ struct _E_Config
unsigned char idle_cursor; // GUI unsigned char idle_cursor; // GUI
const char *default_system_menu; const char *default_system_menu;
unsigned char cfgdlg_normal_wins;
}; };
struct _E_Config_Module struct _E_Config_Module

View File

@ -173,8 +173,10 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "BASIC"); snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "BASIC");
else else
snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "ADVANCED"); snprintf(buf, sizeof(buf), "%s...%s", cfd->class, "ADVANCED");
cfd->dia = e_dialog_new(cfd->con, cfd->name, buf); if ((cfd->view->normal_win) || (e_config->cfgdlg_normal_wins))
if (cfd->view->normal_win) e_win_dialog_set(cfd->dia->win, 0); cfd->dia = e_dialog_normal_win_new(cfd->con, cfd->name, buf);
else
cfd->dia = e_dialog_new(cfd->con, cfd->name, buf);
cfd->dia->data = cfd; cfd->dia->data = cfd;
e_object_del_attach_func_set(E_OBJECT(cfd->dia), _e_config_dialog_cb_dialog_del); e_object_del_attach_func_set(E_OBJECT(cfd->dia), _e_config_dialog_cb_dialog_del);
e_dialog_title_set(cfd->dia, cfd->title); e_dialog_title_set(cfd->dia, cfd->title);

View File

@ -15,8 +15,8 @@ static void _e_dialog_cb_wid_on_focus(void *data, Evas_Object *obj);
/* externally accessible functions */ /* externally accessible functions */
EAPI E_Dialog * static E_Dialog *
e_dialog_new(E_Container *con, const char *name, const char *class) _e_dialog_internal_new(E_Container *con, const char *name, const char *class, int dialog)
{ {
E_Dialog *dia; E_Dialog *dia;
E_Manager *man; E_Manager *man;
@ -42,7 +42,7 @@ e_dialog_new(E_Container *con, const char *name, const char *class)
e_win_delete_callback_set(dia->win, _e_dialog_cb_delete); e_win_delete_callback_set(dia->win, _e_dialog_cb_delete);
e_win_resize_callback_set(dia->win, _e_dialog_cb_resize); e_win_resize_callback_set(dia->win, _e_dialog_cb_resize);
dia->win->data = dia; dia->win->data = dia;
e_win_dialog_set(dia->win, 1); if (dialog) e_win_dialog_set(dia->win, 1);
e_win_name_class_set(dia->win, name, class); e_win_name_class_set(dia->win, name, class);
o = edje_object_add(e_win_evas_get(dia->win)); o = edje_object_add(e_win_evas_get(dia->win));
dia->bg_object = o; dia->bg_object = o;
@ -74,6 +74,18 @@ e_dialog_new(E_Container *con, const char *name, const char *class)
return dia; return dia;
} }
EAPI E_Dialog *
e_dialog_new(E_Container *con, const char *name, const char *class)
{
return _e_dialog_internal_new(con, name, class, 1);
}
EAPI E_Dialog *
e_dialog_normal_win_new(E_Container *con, const char *name, const char *class)
{
return _e_dialog_internal_new(con, name, class, 0);
}
EAPI void EAPI void
e_dialog_button_add(E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data) e_dialog_button_add(E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data)
{ {

View File

@ -30,6 +30,7 @@ struct _E_Dialog
}; };
EAPI E_Dialog *e_dialog_new (E_Container *con, const char *name, const char *class); EAPI E_Dialog *e_dialog_new (E_Container *con, const char *name, const char *class);
EAPI E_Dialog *e_dialog_normal_win_new (E_Container *con, const char *name, const char *class);
EAPI void e_dialog_button_add (E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data); EAPI void e_dialog_button_add (E_Dialog *dia, const char *label, const char *icon, void (*func) (void *data, E_Dialog *dia), void *data);
EAPI int e_dialog_button_focus_num (E_Dialog *dia, int button); EAPI int e_dialog_button_focus_num (E_Dialog *dia, int button);
EAPI int e_dialog_button_disable_num_set (E_Dialog *dia, int button, int disabled); EAPI int e_dialog_button_disable_num_set (E_Dialog *dia, int button, int disabled);

View File

@ -135,3 +135,4 @@
#include "e_widget_flist.h" #include "e_widget_flist.h"
#include "e_fm_op.h" #include "e_fm_op.h"
#include "e_scale.h" #include "e_scale.h"
#include "e_widget_toolbar.h"

View File

@ -51,7 +51,9 @@ struct _E_Smart_Data
void (*max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); void (*max_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
void (*child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); void (*child_size_get) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
} pan_func; } pan_func;
struct {
Evas_Bool forced : 1;
} thumbscroll;
unsigned char hbar_visible : 1; unsigned char hbar_visible : 1;
unsigned char vbar_visible : 1; unsigned char vbar_visible : 1;
@ -349,6 +351,13 @@ e_scrollframe_single_dir_get(Evas_Object *obj)
return sd->one_dir_at_a_time; return sd->one_dir_at_a_time;
} }
EAPI void
e_scrollframe_thumbscroll_force(Evas_Object *obj, Evas_Bool forced)
{
API_ENTRY return;
sd->thumbscroll.forced = forced;
}
/* local subsystem functions */ /* local subsystem functions */
static void static void
_e_smart_edje_drag_v(void *data, Evas_Object *obj, const char *emission, const char *source) _e_smart_edje_drag_v(void *data, Evas_Object *obj, const char *emission, const char *source)
@ -429,7 +438,7 @@ _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
sd = data; sd = data;
ev = event_info; ev = event_info;
if (e_config->thumbscroll_enable) if ((e_config->thumbscroll_enable) || (sd->thumbscroll.forced))
{ {
if (sd->down.momentum_animator) if (sd->down.momentum_animator)
{ {
@ -494,7 +503,7 @@ _e_smart_event_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
sd = data; sd = data;
ev = event_info; ev = event_info;
if (e_config->thumbscroll_enable) if ((e_config->thumbscroll_enable) || (sd->thumbscroll.forced))
{ {
if (ev->button == 1) if (ev->button == 1)
{ {
@ -558,7 +567,7 @@ _e_smart_event_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_inf
sd = data; sd = data;
ev = event_info; ev = event_info;
if (e_config->thumbscroll_enable) if ((e_config->thumbscroll_enable) || (sd->thumbscroll.forced))
{ {
if (sd->down.now) if (sd->down.now)
{ {
@ -673,7 +682,8 @@ _e_smart_scrollbar_read(E_Smart_Data *sd)
x = vx * (double)mx; x = vx * (double)mx;
y = vy * (double)my; y = vy * (double)my;
sd->pan_func.set(sd->pan_obj, x, y); sd->pan_func.set(sd->pan_obj, x, y);
if ((e_config->thumbscroll_enable) && (sd->down.now) && (!sd->down.dragged)) if (((e_config->thumbscroll_enable) || (sd->thumbscroll.forced))
&& (sd->down.now) && (!sd->down.dragged))
sd->down.now = 0; sd->down.now = 0;
} }

View File

@ -32,7 +32,7 @@ EAPI void e_scrollframe_policy_get (Evas_Object *obj, E_Scrollframe
EAPI Evas_Object *e_scrollframe_edje_object_get (Evas_Object *obj); EAPI Evas_Object *e_scrollframe_edje_object_get (Evas_Object *obj);
EAPI void e_scrollframe_single_dir_set (Evas_Object *obj, Evas_Bool single_dir); EAPI void e_scrollframe_single_dir_set (Evas_Object *obj, Evas_Bool single_dir);
EAPI Evas_Bool e_scrollframe_single_dir_get (Evas_Object *obj); EAPI Evas_Bool e_scrollframe_single_dir_get (Evas_Object *obj);
EAPI void e_scrollframe_thumbscroll_force (Evas_Object *obj, Evas_Bool forced);
#endif #endif
#endif #endif

View File

@ -739,6 +739,70 @@ _e_test_internal(E_Container *con)
e_win_resize(dia->win, 400, 400); e_win_resize(dia->win, 400, 400);
} }
#elif 0
static int
_e_test_timer(void *data)
{
E_Container *con;
E_Dialog *dia;
Evas_Object *o, *ic;
Evas_Coord mw, mh;
con = data;
dia = e_dialog_new(con, "E", "_test");
e_dialog_title_set(dia, "A Test Dialog");
o = e_widget_toolbar_add(dia->win->evas, 48, 48);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_hdd.png");
e_widget_toolbar_item_append(o, ic, "HDD", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_cd.png");
e_widget_toolbar_item_append(o, ic, "CD", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_desktop.png");
e_widget_toolbar_item_append(o, ic, "Desktop", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_home.png");
e_widget_toolbar_item_append(o, ic, "Home", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_root.png");
e_widget_toolbar_item_append(o, ic, "Root", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_efm_tmp.png");
e_widget_toolbar_item_append(o, ic, "Temp", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_globe.png");
e_widget_toolbar_item_append(o, ic, "World", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_mixer.png");
e_widget_toolbar_item_append(o, ic, "Mixer", NULL, NULL, NULL);
ic = e_icon_add(dia->win->evas);
e_icon_file_set(ic, "/home/raster/C/e17/data/themes/images/icon_performance.png");
e_widget_toolbar_item_append(o, ic, "Perform", NULL, NULL, NULL);
e_widget_toolbar_scrollable_set(o, 1);
e_widget_toolbar_item_select(o, 1);
/* fixme... more */
e_widget_min_size_get(o, &mw, &mh);
e_dialog_content_set(dia, o, mw, mh);
evas_object_show(o);
/* buttons at the bottom */
e_dialog_button_add(dia, "OK", NULL, NULL, NULL);
e_dialog_resizable_set(dia, 1);
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
e_win_resize(dia->win, 400, 200);
return 0;
}
static void
_e_test_internal(E_Container *con)
{
ecore_timer_add(1.0, _e_test_timer, con);
}
#else #else
static void static void
_e_test_internal(E_Container *con) _e_test_internal(E_Container *con)

361
src/bin/e_widget_toolbar.c Normal file
View File

@ -0,0 +1,361 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
typedef struct _E_Widget_Data E_Widget_Data;
typedef struct _Item Item;
struct _E_Widget_Data
{
Evas_Object *o_base, *o_box, *o_scrollframe0;
int icon_w, icon_h;
Eina_List *items;
Evas_Bool scrollable : 1;
};
struct _Item
{
Evas_Object *o_toolbar, *o_base, *o_icon;
void (*func) (void *data1, void *data2);
const void *data1, *data2;
Evas_Bool selected : 1;
};
static void _e_wid_del_hook(Evas_Object *obj);
static void _e_wid_focus_hook(Evas_Object *obj);
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _e_wid_disable_hook(Evas_Object *obj);
static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _e_wid_cb_key_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void _item_show(Item *it);
/* local subsystem functions */
/* externally accessible functions */
EAPI Evas_Object *
e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h)
{
Evas_Object *obj, *o;
E_Widget_Data *wd;
Evas_Coord mw = 0, mh = 0;
obj = e_widget_add(evas);
e_widget_del_hook_set(obj, _e_wid_del_hook);
e_widget_focus_hook_set(obj, _e_wid_focus_hook);
e_widget_disable_hook_set(obj, _e_wid_disable_hook);
wd = calloc(1, sizeof(E_Widget_Data));
e_widget_data_set(obj, wd);
wd->icon_w = icon_w;
wd->icon_h = icon_h;
o = e_scrollframe_add(evas);
wd->o_base = o;
e_scrollframe_custom_theme_set(o, "base/theme/widgets", "e/widgets/toolbar");
e_scrollframe_single_dir_set(o, 1);
e_scrollframe_policy_set(o, E_SCROLLFRAME_POLICY_AUTO, E_SCROLLFRAME_POLICY_OFF);
e_scrollframe_thumbscroll_force(o, 1);
evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
_e_wid_cb_scrollframe_resize, obj);
evas_object_event_callback_add(e_scrollframe_edje_object_get(wd->o_base),
EVAS_CALLBACK_MOUSE_DOWN,
_e_wid_focus_steal, obj);
evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN,
_e_wid_cb_key_down, obj);
evas_object_show(o);
e_widget_sub_object_add(obj, o);
e_widget_resize_object_set(obj, o);
o = e_box_add(evas);
wd->o_box = o;
e_box_orientation_set(o, 1);
e_box_homogenous_set(o, 1);
e_scrollframe_child_set(wd->o_base, o);
e_widget_sub_object_add(obj, o);
evas_object_show(o);
edje_object_size_min_calc
(e_scrollframe_edje_object_get(wd->o_base), &mw, &mh);
e_widget_min_size_set(obj, mw, mh);
return obj;
}
EAPI void
e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data1, void *data2), const void *data1, const void *data2)
{
E_Widget_Data *wd;
Evas_Object *o;
Item *it;
Evas_Coord mw = 0, mh = 0, vw = 0, vh = 0;
wd = e_widget_data_get(obj);
o = edje_object_add(evas_object_evas_get(obj));
e_theme_edje_object_set(o, "base/theme/widgets",
"e/widgets/toolbar/item");
it = E_NEW(Item, 1);
it->o_toolbar = obj;
it->o_base = o;
it->o_icon = icon;
it->func = func;
it->data1 = data1;
it->data2 = data2;
wd->items = eina_list_append(wd->items, it);
edje_object_signal_callback_add(o, "e,action,click", "e",
_e_wid_signal_cb1, it);
edje_extern_object_min_size_set(icon, wd->icon_w, wd->icon_h);
edje_object_part_swallow(o, "e.swallow.icon", icon);
evas_object_show(icon);
edje_object_part_text_set(o, "e.text.label", label);
edje_object_size_min_calc(o, &mw, &mh);
e_widget_sub_object_add(obj, o);
e_box_pack_end(wd->o_box, o);
evas_object_show(o);
e_box_pack_options_set(o,
1, 1, /* fill */
0, 0, /* expand */
0.5, 0.5, /* align */
mw, mh, /* min */
9999, 9999 /* max */
);
e_box_min_size_get(wd->o_box, &mw, &mh);
evas_object_resize(wd->o_box, mw, mh);
evas_object_resize(wd->o_base, 500, 500);
e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh);
if (wd->scrollable)
e_widget_min_size_set(obj, 500 - vw, mh + (500 - vh));
else
e_widget_min_size_set(obj, mw + (500 - vw), mh + (500 - vh));
}
EAPI void
e_widget_toolbar_item_select(Evas_Object *obj, int num)
{
E_Widget_Data *wd;
Eina_List *l;
Item *it;
int i;
wd = e_widget_data_get(obj);
for (i = 0, l = wd->items; l; l = l->next, i++)
{
it = l->data;
if (i == num)
{
if (!it->selected)
{
it->selected = 1;
edje_object_signal_emit(it->o_base, "e,state,selected", "e");
edje_object_signal_emit(it->o_icon, "e,state,selected", "e");
_item_show(it);
if (it->func) it->func(it->data1, it->data2);
}
}
else
{
if (it->selected)
{
it->selected = 0;
edje_object_signal_emit(it->o_base, "e,state,unselected", "e");
edje_object_signal_emit(it->o_icon, "e,state,unselected", "e");
}
}
}
}
EAPI void
e_widget_toolbar_scrollable_set(Evas_Object *obj, Evas_Bool scrollable)
{
E_Widget_Data *wd;
Evas_Coord mw = 0, mh = 0, vw = 0, vh = 0;
wd = e_widget_data_get(obj);
wd->scrollable = scrollable;
e_box_min_size_get(wd->o_box, &mw, &mh);
evas_object_resize(wd->o_box, mw, mh);
evas_object_resize(wd->o_base, 500, 500);
e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh);
if (wd->scrollable)
e_widget_min_size_set(obj, 500 - vw, mh + (500 - vh));
else
e_widget_min_size_set(obj, mw + (500 - vw), mh + (500 - vh));
}
static void
_e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
while (wd->items)
{
Item *it;
it = wd->items->data;
evas_object_del(it->o_base);
evas_object_del(it->o_icon);
free(it);
wd->items = eina_list_remove_list(wd->items, wd->items);
}
free(wd);
}
static void
_e_wid_disable_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
if (e_widget_disabled_get(obj))
edje_object_signal_emit
(e_scrollframe_edje_object_get(wd->o_base), "e,state,disabled", "e");
else
edje_object_signal_emit
(e_scrollframe_edje_object_get(wd->o_base), "e,state,enabled", "e");
}
static void
_e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source)
{
Item *it, *it2;
E_Widget_Data *wd;
Eina_List *l;
it = data;
if (it->selected) return;
wd = e_widget_data_get(it->o_toolbar);
for (l = wd->items; l; l = l->next)
{
it2 = l->data;
if (it2->selected)
{
it2->selected = 0;
edje_object_signal_emit(it2->o_base, "e,state,unselected", "e");
edje_object_signal_emit(it2->o_icon, "e,state,unselected", "e");
break;
}
}
it->selected = 1;
edje_object_signal_emit(it->o_base, "e,state,selected", "e");
edje_object_signal_emit(it->o_icon, "e,state,selected", "e");
_item_show(it);
if (it->func) it->func(it->data1, it->data2);
}
static void
_e_wid_cb_scrollframe_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
E_Widget_Data *wd;
Evas_Coord mw, mh, vw, vh, w, h;
Eina_List *l;
Item *it;
wd = e_widget_data_get(data);
e_scrollframe_child_viewport_size_get(wd->o_base, &vw, &vh);
e_box_min_size_get(wd->o_box, &mw, &mh);
evas_object_geometry_get(wd->o_box, NULL, NULL, &w, &h);
if (vw >= mw)
{
if (w != vw) evas_object_resize(wd->o_box, vw, h);
}
for (l = wd->items; l; l = l->next)
{
it = l->data;
if (it->selected)
{
_item_show(it);
break;
}
}
}
static void
_e_wid_cb_key_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
Evas_Event_Key_Down *ev;
E_Widget_Data *wd;
Eina_List *l;
Item *it = NULL, *it2 = NULL;
ev = event_info;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
wd = e_widget_data_get(data);
if ((!strcmp(ev->keyname, "Up")) || (!strcmp(ev->keyname, "KP_Up")) ||
(!strcmp(ev->keyname, "Left")) || (!strcmp(ev->keyname, "KP_Left"))
)
{
for (l = wd->items; l; l = l->next)
{
it = l->data;
if (it->selected)
{
if (l->prev) it2 = l->prev->data;
break;
}
}
}
else if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down")) ||
(!strcmp(ev->keyname, "Right")) || (!strcmp(ev->keyname, "KP_Right"))
)
{
for (l = wd->items; l; l = l->next)
{
it = l->data;
if (it->selected)
{
if (l->next) it2 = l->next->data;
break;
}
}
}
if ((it) && (it2))
{
it->selected = 0;
edje_object_signal_emit(it->o_base, "e,state,unselected", "e");
edje_object_signal_emit(it->o_icon, "e,state,unselected", "e");
it2->selected = 1;
edje_object_signal_emit(it2->o_base, "e,state,selected", "e");
edje_object_signal_emit(it2->o_icon, "e,state,selected", "e");
_item_show(it2);
if (it2->func) it->func(it2->data1, it2->data2);
}
}
static void
_e_wid_focus_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
if (e_widget_focus_get(obj))
{
edje_object_signal_emit(wd->o_base, "e,state,focused", "e");
evas_object_focus_set(obj, 1);
}
else
{
edje_object_signal_emit(wd->o_base, "e,state,unfocused", "e");
evas_object_focus_set(obj, 0);
}
}
static void
_e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
e_widget_focus_steal(data);
}
static void
_item_show(Item *it)
{
E_Widget_Data *wd;
Evas_Coord x, y, w, h, bx, by;
wd = e_widget_data_get(it->o_toolbar);
evas_object_geometry_get(wd->o_box, &bx, &by, NULL, NULL);
evas_object_geometry_get(it->o_base, &x, &y, &w, &h);
e_scrollframe_child_region_show(wd->o_base, x - bx, y - by, w, h);
}

View File

@ -0,0 +1,15 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_WIDGET_TOOLBAR_H
#define E_WIDGET_TOOLBAR_H
EAPI Evas_Object *e_widget_toolbar_add(Evas *evas, int icon_w, int icon_h);
EAPI void e_widget_toolbar_item_append(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data1, void *data2), const void *data1, const void *data2);
EAPI void e_widget_toolbar_item_select(Evas_Object *obj, int num);
EAPI void e_widget_toolbar_scrollable_set(Evas_Object *obj, Evas_Bool scrollable);
#endif
#endif

View File

@ -52,7 +52,7 @@ static void _e_configure_cb_del_req(E_Win *win);
static void _e_configure_cb_resize(E_Win *win); static void _e_configure_cb_resize(E_Win *win);
static void _e_configure_cb_close(void *data, void *data2); static void _e_configure_cb_close(void *data, void *data2);
static E_Configure_Category *_e_configure_category_add(E_Configure *eco, const char *label, const char *icon); static E_Configure_Category *_e_configure_category_add(E_Configure *eco, const char *label, const char *icon);
static void _e_configure_category_cb(void *data); static void _e_configure_category_cb(void *data, void *data2);
static void _e_configure_item_add(E_Configure_Category *cat, const char *label, const char *icon, const char *path); static void _e_configure_item_add(E_Configure_Category *cat, const char *label, const char *icon, const char *path);
static void _e_configure_item_cb(void *data); static void _e_configure_item_cb(void *data);
static void _e_configure_focus_cb(void *data, Evas_Object *obj); static void _e_configure_focus_cb(void *data, Evas_Object *obj);
@ -119,9 +119,9 @@ e_configure_show(E_Container *con)
eco->mod_hdl = ecore_event_handler_add(E_EVENT_MODULE_UPDATE, eco->mod_hdl = ecore_event_handler_add(E_EVENT_MODULE_UPDATE,
_e_configure_module_update_cb, eco); _e_configure_module_update_cb, eco);
e_win_title_set(eco->win, _("Enlightenment Configuration")); e_win_title_set(eco->win, _("Configuration"));
e_win_name_class_set(eco->win, "E", "_configure"); e_win_name_class_set(eco->win, "E", "_configure");
e_win_dialog_set(eco->win, 1); e_win_dialog_set(eco->win, 0);
e_win_delete_callback_set(eco->win, _e_configure_cb_del_req); e_win_delete_callback_set(eco->win, _e_configure_cb_del_req);
e_win_resize_callback_set(eco->win, _e_configure_cb_resize); e_win_resize_callback_set(eco->win, _e_configure_cb_resize);
e_win_centered_set(eco->win, 1); e_win_centered_set(eco->win, 1);
@ -130,9 +130,9 @@ e_configure_show(E_Container *con)
e_theme_edje_object_set(eco->edje, "base/theme/configure", e_theme_edje_object_set(eco->edje, "base/theme/configure",
"e/widgets/configure/main"); "e/widgets/configure/main");
edje_object_part_text_set(eco->edje, "e.text.title", edje_object_part_text_set(eco->edje, "e.text.title",
_("Enlightenment Configuration")); _("Configuration"));
eco->o_list = e_widget_list_add(eco->evas, 1, 1); eco->o_list = e_widget_list_add(eco->evas, 0, 0);
edje_object_part_swallow(eco->edje, "e.swallow.content", eco->o_list); edje_object_part_swallow(eco->edje, "e.swallow.content", eco->o_list);
/* Event Obj for keydown */ /* Event Obj for keydown */
@ -146,25 +146,24 @@ e_configure_show(E_Container *con)
mask = 0; mask = 0;
evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0); evas_object_key_grab(o, "KP_Enter", mask, ~mask, 0);
evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_configure_keydown_cb, eco->win); evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, _e_configure_keydown_cb, eco->win);
/* Category List */ /* Category List */
of = e_widget_framelist_add(eco->evas, _("Categories"), 1); eco->cat_list = e_widget_toolbar_add(eco->evas, 32 * e_scale, 32 * e_scale);
eco->cat_list = e_widget_ilist_add(eco->evas, 32 * e_scale, 32 * e_scale, NULL); e_widget_toolbar_scrollable_set(eco->cat_list, 1);
e_widget_ilist_selector_set(eco->cat_list, 1);
/***--- fill ---***/ /***--- fill ---***/
_e_configure_fill_cat_list(eco); _e_configure_fill_cat_list(eco);
e_widget_on_focus_hook_set(eco->cat_list, _e_configure_focus_cb, eco->win); e_widget_on_focus_hook_set(eco->cat_list, _e_configure_focus_cb, eco->win);
e_widget_framelist_object_append(of, eco->cat_list); e_widget_list_object_append(eco->o_list, eco->cat_list, 1, 0, 0.5);
e_widget_list_object_append(eco->o_list, of, 1, 1, 0.5);
/* Item List */ /* Item List */
of = e_widget_framelist_add(eco->evas, _("Items"), 1);
eco->item_list = e_widget_ilist_add(eco->evas, 32 * e_scale, 32 * e_scale, NULL); eco->item_list = e_widget_ilist_add(eco->evas, 32 * e_scale, 32 * e_scale, NULL);
e_widget_ilist_selector_set(eco->item_list, 1); e_widget_ilist_selector_set(eco->item_list, 1);
e_widget_ilist_go(eco->item_list); e_widget_ilist_go(eco->item_list);
e_widget_on_focus_hook_set(eco->item_list, _e_configure_focus_cb, eco->win); e_widget_on_focus_hook_set(eco->item_list, _e_configure_focus_cb, eco->win);
e_widget_framelist_object_append(of, eco->item_list); e_widget_min_size_get(eco->item_list, &mw, &mh);
e_widget_list_object_append(eco->o_list, of, 1, 1, 0.5); if (mw < (200 * e_scale)) mw = 200 * e_scale;
if (mh < (120 * e_scale)) mh = 120 * e_scale;
e_widget_min_size_set(eco->item_list, mw, mh);
e_widget_list_object_append(eco->o_list, eco->item_list, 1, 1, 0.5);
e_widget_min_size_get(eco->o_list, &mw, &mh); e_widget_min_size_get(eco->o_list, &mw, &mh);
edje_extern_object_min_size_set(eco->o_list, mw, mh); edje_extern_object_min_size_set(eco->o_list, mw, mh);
@ -187,14 +186,14 @@ e_configure_show(E_Container *con)
/* Preselect "Appearance" */ /* Preselect "Appearance" */
e_widget_focus_set(eco->cat_list, 1); e_widget_focus_set(eco->cat_list, 1);
e_widget_ilist_selected_set(eco->cat_list, 0); e_widget_toolbar_item_select(eco->cat_list, 0);
if (eco->cats) if (eco->cats)
{ {
E_Configure_Category *cat; E_Configure_Category *cat;
cat = eco->cats->data; cat = eco->cats->data;
_e_configure_category_cb(cat); _e_configure_category_cb(cat, NULL);
} }
_e_configure = eco; _e_configure = eco;
@ -316,12 +315,12 @@ _e_configure_category_add(E_Configure *eco, const char *label, const char *icon)
} }
eco->cats = eina_list_append(eco->cats, cat); eco->cats = eina_list_append(eco->cats, cat);
e_widget_ilist_append(eco->cat_list, o, label, _e_configure_category_cb, cat, NULL); e_widget_toolbar_item_append(eco->cat_list, o, label, _e_configure_category_cb, cat, NULL);
return cat; return cat;
} }
static void static void
_e_configure_category_cb(void *data) _e_configure_category_cb(void *data, void *data2)
{ {
E_Configure_Category *cat; E_Configure_Category *cat;
E_Configure *eco; E_Configure *eco;
@ -487,8 +486,6 @@ _e_configure_fill_cat_list(void *data)
evas_event_freeze(evas_object_evas_get(eco->cat_list)); evas_event_freeze(evas_object_evas_get(eco->cat_list));
edje_freeze(); edje_freeze();
e_widget_ilist_freeze(eco->cat_list);
e_widget_ilist_clear(eco->cat_list);
for (l = e_configure_registry; l; l = l->next) for (l = e_configure_registry; l; l = l->next)
{ {
@ -514,10 +511,8 @@ _e_configure_fill_cat_list(void *data)
} }
} }
e_widget_ilist_go(eco->cat_list);
e_widget_min_size_get(eco->cat_list, &mw, &mh); e_widget_min_size_get(eco->cat_list, &mw, &mh);
e_widget_min_size_set(eco->cat_list, mw, mh); e_widget_min_size_set(eco->cat_list, mw, mh);
e_widget_ilist_thaw(eco->cat_list);
edje_thaw(); edje_thaw();
evas_event_thaw(evas_object_evas_get(eco->cat_list)); evas_event_thaw(evas_object_evas_get(eco->cat_list));
} }

View File

@ -21,7 +21,100 @@ static E_Int_Menu_Augmentation *maug = NULL;
/***************************************************************************/ /***************************************************************************/
/**/ /**/
/* gadget */
/***************************************************************************/
/**/
/* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc);
static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
static char *_gc_label(E_Gadcon_Client_Class *client_class);
static Evas_Object *_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas);
static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
static void _cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info);
/* and actually define the gadcon class that this module provides (just 1) */
static const E_Gadcon_Client_Class _gadcon_class =
{
GADCON_CLIENT_CLASS_VERSION,
"configuration",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
},
E_GADCON_CLIENT_STYLE_PLAIN
};
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
Evas_Object *o;
E_Gadcon_Client *gcc;
o = edje_object_add(gc->evas);
e_util_edje_icon_set(o, "enlightenment/configuration");
evas_object_show(o);
gcc = e_gadcon_client_new(gc, name, id, style, o);
gcc->data = o;
e_gadcon_client_util_menu_attach(gcc);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP,
_cb_mouse_up, NULL);
return gcc;
}
static void
_gc_shutdown(E_Gadcon_Client *gcc)
{
evas_object_del(gcc->o_base);
}
static void
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
{
Evas_Coord mw, mh;
mw = 0, mh = 0;
edje_object_size_min_get(gcc->o_base, &mw, &mh);
if ((mw < 1) || (mh < 1))
edje_object_size_min_calc(gcc->o_base, &mw, &mh);
if (mw < 4) mw = 4;
if (mh < 4) mh = 4;
e_gadcon_client_aspect_set(gcc, mw, mh);
e_gadcon_client_min_size_set(gcc, mw, mh);
}
static char *
_gc_label(E_Gadcon_Client_Class *client_class)
{
return "Configuration";
}
static Evas_Object *
_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas)
{
Evas_Object *o;
char buf[4096];
o = edje_object_add(evas);
snprintf(buf, sizeof(buf), "%s/e-module-conf.edj",
e_module_dir_get(conf_module));
edje_object_file_set(o, buf, "icon");
return o;
}
static const char *
_gc_id_new(E_Gadcon_Client_Class *client_class)
{
return _gadcon_class.name;
}
static void
_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
E_Action *a;
a = e_action_find("configuration");
if ((a) && (a->func.go)) a->func.go(NULL, NULL);
}
/**/ /**/
/***************************************************************************/ /***************************************************************************/
@ -48,6 +141,7 @@ e_modapi_init(E_Module *m)
} }
maug = e_int_menus_menu_augmentation_add("config/0", _e_mod_menu_add, NULL, NULL, NULL); maug = e_int_menus_menu_augmentation_add("config/0", _e_mod_menu_add, NULL, NULL, NULL);
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);
e_gadcon_provider_register(&_gadcon_class);
return m; return m;
} }
@ -55,6 +149,7 @@ EAPI int
e_modapi_shutdown(E_Module *m) e_modapi_shutdown(E_Module *m)
{ {
e_configure_del(); e_configure_del();
e_gadcon_provider_unregister(&_gadcon_class);
/* remove module-supplied menu additions */ /* remove module-supplied menu additions */
if (maug) if (maug)
{ {

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("applications", 20, _("Applications"), NULL, "enlightenment/applications"); e_configure_registry_category_add("applications", 20, _("Apps"), NULL, "enlightenment/applications");
e_configure_registry_item_add("applications/new_application", 10, _("New Application"), NULL, "enlightenment/add_application", e_int_config_apps_add); e_configure_registry_item_add("applications/new_application", 10, _("New Application"), NULL, "enlightenment/add_application", e_int_config_apps_add);
e_configure_registry_item_add("applications/ibar_applications", 20, _("IBar Applications"), NULL, "enlightenment/ibar_applications", e_int_config_apps_ibar); e_configure_registry_item_add("applications/ibar_applications", 20, _("IBar Applications"), NULL, "enlightenment/ibar_applications", e_int_config_apps_ibar);
e_configure_registry_item_add("applications/restart_applications", 30, _("Restart Applications"), NULL, "enlightenment/restart_applications", e_int_config_apps_restart); e_configure_registry_item_add("applications/restart_applications", 30, _("Restart Applications"), NULL, "enlightenment/restart_applications", e_int_config_apps_restart);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/borders", 50, _("Borders"), NULL, "enlightenment/windows", e_int_config_borders); e_configure_registry_item_add("appearance/borders", 50, _("Borders"), NULL, "enlightenment/windows", e_int_config_borders);
e_configure_registry_category_add("internal", -1, _("Internal"), NULL, "enlightenment/internal"); e_configure_registry_category_add("internal", -1, _("Internal"), NULL, "enlightenment/internal");
e_configure_registry_item_add("internal/borders_border", -1, _("Border"), NULL, "enlightenment/windows", e_int_config_borders_border); e_configure_registry_item_add("internal/borders_border", -1, _("Border"), NULL, "enlightenment/windows", e_int_config_borders_border);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/colors", 30, _("Colors"), NULL, "enlightenment/colors", e_int_config_color_classes); e_configure_registry_item_add("appearance/colors", 30, _("Colors"), NULL, "enlightenment/colors", e_int_config_color_classes);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -14,6 +14,7 @@ struct _E_Config_Dialog_Data
int cnfmdlg_disabled; int cnfmdlg_disabled;
int cfgdlg_auto_apply; int cfgdlg_auto_apply;
int cfgdlg_default_mode; int cfgdlg_default_mode;
int cfgdlg_normal_wins;
}; };
EAPI E_Config_Dialog * EAPI E_Config_Dialog *
@ -44,6 +45,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->cnfmdlg_disabled = e_config->cnfmdlg_disabled; cfdata->cnfmdlg_disabled = e_config->cnfmdlg_disabled;
cfdata->cfgdlg_auto_apply = e_config->cfgdlg_auto_apply; cfdata->cfgdlg_auto_apply = e_config->cfgdlg_auto_apply;
cfdata->cfgdlg_default_mode = e_config->cfgdlg_default_mode; cfdata->cfgdlg_default_mode = e_config->cfgdlg_default_mode;
cfdata->cfgdlg_normal_wins = e_config->cfgdlg_normal_wins;
} }
static void * static void *
@ -69,6 +71,7 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
/* Auto Apply is disabled in E for now */ /* Auto Apply is disabled in E for now */
/* (e_config->cfgdlg_auto_apply = cfdata->cfgdlg_auto_apply; */ /* (e_config->cfgdlg_auto_apply = cfdata->cfgdlg_auto_apply; */
e_config->cfgdlg_default_mode = cfdata->cfgdlg_default_mode; e_config->cfgdlg_default_mode = cfdata->cfgdlg_default_mode;
e_config->cfgdlg_normal_wins = cfdata->cfgdlg_normal_wins;
e_config_save_queue(); e_config_save_queue();
return 1; return 1;
} }
@ -85,6 +88,8 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
ob = e_widget_check_add(evas, _("Disable Confirmation Dialogs"), &(cfdata->cnfmdlg_disabled)); ob = e_widget_check_add(evas, _("Disable Confirmation Dialogs"), &(cfdata->cnfmdlg_disabled));
e_widget_framelist_object_append(of, ob); e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Normal Windows"), &(cfdata->cfgdlg_normal_wins));
e_widget_framelist_object_append(of, ob);
// ob = e_widget_check_add(evas, _("Auto-Apply Configuration Changes"), &(cfdata->cfgdlg_auto_apply)); // ob = e_widget_check_add(evas, _("Auto-Apply Configuration Changes"), &(cfdata->cfgdlg_auto_apply));
// e_widget_framelist_object_append(of, ob); // e_widget_framelist_object_append(of, ob);
@ -111,6 +116,7 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
/* (e_config->cfgdlg_auto_apply = cfdata->auto_apply; */ /* (e_config->cfgdlg_auto_apply = cfdata->auto_apply; */
e_config->cfgdlg_default_mode = cfdata->default_mode; e_config->cfgdlg_default_mode = cfdata->default_mode;
e_config->cfgdlg_normal_wins = cfdata->cfgdlg_normal_wins;
e_config_save_queue(); e_config_save_queue();
return 1; return 1;
} }

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/fonts", 40, _("Fonts"), NULL, "enlightenment/fonts", e_int_config_fonts); e_configure_registry_item_add("appearance/fonts", 40, _("Fonts"), NULL, "enlightenment/fonts", e_int_config_fonts);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/icon_theme", 60, _("Icon Theme"), NULL, "enlightenment/icon_theme", e_int_config_icon_themes); e_configure_registry_item_add("appearance/icon_theme", 60, _("Icon Theme"), NULL, "enlightenment/icon_theme", e_int_config_icon_themes);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -31,8 +31,8 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("advanced", 80, _("Advanced"), NULL, "enlightenment/advanced"); e_configure_registry_category_add("keyboard_and_mouse", 80, _("Input"), NULL, "enlightenment/behavior");
e_configure_registry_item_add("advanced/interaction", 11, _("Interaction"), NULL, "enlightenment/configuration", e_int_config_interaction); e_configure_registry_item_add("keyboard_and_mouse/interaction", 11, _("Interaction"), NULL, "enlightenment/configuration", e_int_config_interaction);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);
return m; return m;

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("keyboard_and_mouse", 40, _("Keyboard & Mouse"), NULL, "enlightenment/behavior"); e_configure_registry_category_add("keyboard_and_mouse", 40, _("Input"), NULL, "enlightenment/behavior");
e_configure_registry_item_add("keyboard_and_mouse/key_bindings", 10, _("Key Bindings"), NULL, "enlightenment/keys", e_int_config_keybindings); e_configure_registry_item_add("keyboard_and_mouse/key_bindings", 10, _("Key Bindings"), NULL, "enlightenment/keys", e_int_config_keybindings);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("keyboard_and_mouse", 40, _("Keyboard & Mouse"), NULL, "enlightenment/behavior"); e_configure_registry_category_add("keyboard_and_mouse", 40, _("Input"), NULL, "enlightenment/behavior");
e_configure_registry_item_add("keyboard_and_mouse/mouse_settings", 30, _("Mouse Settings"), NULL, "enlightenment/mouse_clean", e_int_config_mouse); e_configure_registry_item_add("keyboard_and_mouse/mouse_settings", 30, _("Mouse Settings"), NULL, "enlightenment/mouse_clean", e_int_config_mouse);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/mouse_cursor", 70, _("Mouse Cursor"), NULL, "enlightenment/mouse", e_int_config_cursor); e_configure_registry_item_add("appearance/mouse_cursor", 70, _("Mouse Cursor"), NULL, "enlightenment/mouse", e_int_config_cursor);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("keyboard_and_mouse", 40, _("Keyboard & Mouse"), NULL, "enlightenment/behavior"); e_configure_registry_category_add("keyboard_and_mouse", 40, _("Input"), NULL, "enlightenment/behavior");
e_configure_registry_item_add("keyboard_and_mouse/mouse_bindings", 20, _("Mouse Bindings"), NULL, "enlightenment/mouse_clean", e_int_config_mousebindings); e_configure_registry_item_add("keyboard_and_mouse/mouse_bindings", 20, _("Mouse Bindings"), NULL, "enlightenment/mouse_clean", e_int_config_mousebindings);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/scale", 90, _("Scaling"), NULL, "enlightenment/scale", e_int_config_scale); e_configure_registry_item_add("appearance/scale", 90, _("Scaling"), NULL, "enlightenment/scale", e_int_config_scale);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/startup", 90, _("Startup"), NULL, "enlightenment/startup", e_int_config_startup); e_configure_registry_item_add("appearance/startup", 90, _("Startup"), NULL, "enlightenment/startup", e_int_config_startup);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -35,7 +35,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/theme", 20, _("Theme"), NULL, "enlightenment/themes", e_int_config_theme); e_configure_registry_item_add("appearance/theme", 20, _("Theme"), NULL, "enlightenment/themes", e_int_config_theme);
maug = e_int_menus_menu_augmentation_add("config/1", _e_mod_menu_add, NULL, NULL, NULL); maug = e_int_menus_menu_augmentation_add("config/1", _e_mod_menu_add, NULL, NULL, NULL);

View File

@ -31,7 +31,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/transitions", 80, _("Transitions"), NULL, "enlightenment/transitions", e_int_config_transitions); e_configure_registry_item_add("appearance/transitions", 80, _("Transitions"), NULL, "enlightenment/transitions", e_int_config_transitions);
conf_module = m; conf_module = m;
e_module_delayed_set(m, 1); e_module_delayed_set(m, 1);

View File

@ -25,7 +25,7 @@ EAPI E_Module_Api e_modapi =
EAPI void * EAPI void *
e_modapi_init(E_Module *m) e_modapi_init(E_Module *m)
{ {
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/wallpaper", 10, _("Wallpaper"), NULL, "enlightenment/background", e_int_config_wallpaper); e_configure_registry_item_add("appearance/wallpaper", 10, _("Wallpaper"), NULL, "enlightenment/background", e_int_config_wallpaper);
e_configure_registry_category_add("internal", -1, _("Internal"), NULL, "enlightenment/internal"); e_configure_registry_category_add("internal", -1, _("Internal"), NULL, "enlightenment/internal");
e_configure_registry_item_add("internal/wallpaper_desk", -1, _("Wallpaper"), NULL, "enlightenment/windows", e_int_config_wallpaper_desk); e_configure_registry_item_add("internal/wallpaper_desk", -1, _("Wallpaper"), NULL, "enlightenment/windows", e_int_config_wallpaper_desk);

View File

@ -86,7 +86,7 @@ e_modapi_init(E_Module *m)
ds = _ds_init(m); ds = _ds_init(m);
snprintf(buf, sizeof(buf), "%s/e-module-dropshadow.edj", e_module_dir_get(m)); snprintf(buf, sizeof(buf), "%s/e-module-dropshadow.edj", e_module_dir_get(m));
e_configure_registry_category_add("appearance", 10, _("Appearance"), NULL, "enlightenment/appearance"); e_configure_registry_category_add("appearance", 10, _("Look"), NULL, "enlightenment/appearance");
e_configure_registry_item_add("appearance/dropshadow", 150, _("Dropshadow"), NULL, buf, e_int_config_dropshadow_module); e_configure_registry_item_add("appearance/dropshadow", 150, _("Dropshadow"), NULL, buf, e_int_config_dropshadow_module);
dropshadow_mod = m; dropshadow_mod = m;

View File

@ -42,7 +42,7 @@ e_modapi_init(E_Module *m)
eina_stringshare_init(); eina_stringshare_init();
/* Setup Entry in Config Panel */ /* Setup Entry in Config Panel */
e_configure_registry_category_add("fileman", 100, _("File Manager"), e_configure_registry_category_add("fileman", 100, _("Files"),
NULL, "enlightenment/fileman"); NULL, "enlightenment/fileman");
e_configure_registry_item_add("fileman/fileman", 10, _("File Manager"), e_configure_registry_item_add("fileman/fileman", 10, _("File Manager"),
NULL, "enlightenment/fileman", NULL, "enlightenment/fileman",

View File

@ -46,8 +46,6 @@ module_la_SOURCES = e_mod_main.c \
e_busywin.c \ e_busywin.c \
e_cfg.h \ e_cfg.h \
e_cfg.c \ e_cfg.c \
e_mod_gad_cfg.c \
e_mod_gad_cfg.h \
e_winilist.c \ e_winilist.c \
e_winilist.h \ e_winilist.h \
e_simplelock.c \ e_simplelock.c \

View File

@ -1,297 +0,0 @@
#include "e.h"
/***************************************************************************/
typedef struct _Instance Instance;
struct _Instance
{
E_Gadcon_Client *gcc;
Evas_Object *obj;
};
static void _cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info);
/***************************************************************************/
/**/
/* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc);
static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
static char *_gc_label(E_Gadcon_Client_Class *client_class);
static Evas_Object *_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas);
static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
/* and actually define the gadcon class that this module provides (just 1) */
static const E_Gadcon_Client_Class _gadcon_class =
{
GADCON_CLIENT_CLASS_VERSION,
"illume-cfg",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
},
E_GADCON_CLIENT_STYLE_PLAIN
};
static E_Module *mod = NULL;
/**/
/***************************************************************************/
/* called from the module core */
void
_e_mod_gad_cfg_init(E_Module *m)
{
mod = m;
e_gadcon_provider_register(&_gadcon_class);
}
void
_e_mod_gad_cfg_shutdown(void)
{
e_gadcon_provider_unregister(&_gadcon_class);
mod = NULL;
}
/* internal calls */
static Evas_Object *
_theme_obj_new(Evas *e, const char *custom_dir, const char *group)
{
Evas_Object *o;
o = edje_object_add(e);
if (!e_theme_edje_object_set(o, "base/theme/modules/illume", group))
{
if (custom_dir)
{
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/illume.edj", custom_dir);
if (edje_object_file_set(o, buf, group))
{
printf("OK FALLBACK %s\n", buf);
}
}
}
return o;
}
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
Evas_Object *o;
E_Gadcon_Client *gcc;
Instance *inst;
inst = E_NEW(Instance, 1);
o = _theme_obj_new(gc->evas, e_module_dir_get(mod),
"e/modules/illume/gadget/cfg");
evas_object_show(o);
gcc = e_gadcon_client_new(gc, name, id, style, o);
gcc->data = inst;
inst->gcc = gcc;
inst->obj = o;
e_gadcon_client_util_menu_attach(gcc);
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP,
_cb_mouse_up, inst);
return gcc;
}
static void
_gc_shutdown(E_Gadcon_Client *gcc)
{
Instance *inst;
inst = gcc->data;
evas_object_del(inst->obj);
free(inst);
}
static void
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
{
Instance *inst;
Evas_Coord mw, mh;
inst = gcc->data;
mw = 0, mh = 0;
edje_object_size_min_get(inst->obj, &mw, &mh);
if ((mw < 1) || (mh < 1))
edje_object_size_min_calc(inst->obj, &mw, &mh);
if (mw < 4) mw = 4;
if (mh < 4) mh = 4;
e_gadcon_client_aspect_set(gcc, mw, mh);
e_gadcon_client_min_size_set(gcc, mw, mh);
}
static char *
_gc_label(E_Gadcon_Client_Class *client_class)
{
return "Configuration (Illume)";
}
static Evas_Object *
_gc_icon(E_Gadcon_Client_Class *client_class, Evas *evas)
{
/* FIXME: need icon
Evas_Object *o;
char buf[4096];
o = edje_object_add(evas);
snprintf(buf, sizeof(buf), "%s/e-module-clock.edj",
e_module_dir_get(clock_module));
edje_object_file_set(o, buf, "icon");
return o;
*/
return NULL;
}
static const char *
_gc_id_new(E_Gadcon_Client_Class *client_class)
{
return _gadcon_class.name;
}
static void _cfg(void);
static void
_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
Evas_Event_Mouse_Up *ev;
Instance *inst;
ev = event_info;
inst = data;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
_cfg();
}
static void _cb_signal_ok(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _cb_delete(E_Win *win);
static void _cb_resize(E_Win *win);
static void _cb_cfg_item(void *data);
static E_Win *win = NULL;
static Eina_List *cfgstr = NULL;
static Evas_Object *o_cfg;
static void
_cfg(void)
{
E_Zone *zone;
Evas_Object *o, *il;
Eina_List *l, *ll;
if (win)
{
e_win_show(win);
e_win_raise(win);
return;
}
zone = e_util_zone_current_get(e_manager_current_get());
win = e_win_new(zone->container);
e_win_delete_callback_set(win, _cb_delete);
e_win_resize_callback_set(win, _cb_resize);
e_win_name_class_set(win, "E", "configuration");
e_win_title_set(win, "Configuration");
o = _theme_obj_new(e_win_evas_get(win), e_module_dir_get(mod),
"e/modules/illume/config/dialog");
o_cfg = o;
edje_object_part_text_set(o, "e.text.label", "Close");
edje_object_signal_callback_add(o, "e,action,do,ok", "", _cb_signal_ok, win);
evas_object_move(o, 0, 0);
evas_object_show(o);
il = e_widget_ilist_add(e_win_evas_get(win), 64, 64, NULL);
e_widget_ilist_selector_set(il, 1);
evas_event_freeze(evas_object_evas_get(il));
e_widget_ilist_freeze(il);
edje_freeze();
for (l = e_configure_registry; l; l = l->next)
{
E_Configure_Cat *ecat;
ecat = l->data;
if ((ecat->pri >= 0) && (ecat->items))
{
for (ll = ecat->items; ll; ll = ll->next)
{
E_Configure_It *eci;
char buf[1024];
eci = ll->data;
if (eci->pri >= 0)
{
char *s;
Evas_Object *oi;
if (e_util_edje_icon_check(eci->icon))
{
oi = edje_object_add(e_win_evas_get(win));
e_util_edje_icon_set(oi, eci->icon);
}
else
oi = e_util_icon_add(eci->icon, e_win_evas_get(win));
snprintf(buf, sizeof(buf), "%s/%s", ecat->cat, eci->item);
s = evas_stringshare_add(buf);
cfgstr = eina_list_append(cfgstr, s);
e_widget_ilist_append(il, oi, eci->label, _cb_cfg_item,
s, NULL);
}
}
}
}
e_widget_ilist_go(il);
edje_thaw();
e_widget_ilist_thaw(il);
evas_event_thaw(evas_object_evas_get(il));
e_widget_focus_set(il, 1);
evas_object_focus_set(il, 1);
edje_object_part_swallow(o, "e.swallow.content", il);
e_win_show(win);
return;
}
static void
_cb_signal_ok(void *data, Evas_Object *obj, const char *emission, const char *source)
{
e_object_del(E_OBJECT(win));
win = NULL;
while (cfgstr)
{
evas_stringshare_del(cfgstr->data);
cfgstr = eina_list_remove_list(cfgstr, cfgstr);
}
}
static void
_cb_delete(E_Win *w)
{
e_object_del(E_OBJECT(win));
win = NULL;
while (cfgstr)
{
evas_stringshare_del(cfgstr->data);
cfgstr = eina_list_remove_list(cfgstr, cfgstr);
}
}
static void
_cb_resize(E_Win *w)
{
evas_object_resize(o_cfg, win->w, win->h);
}
static void
_cb_cfg_item(void *data)
{
e_configure_registry_call(data,
e_util_zone_current_get(e_manager_current_get())->container,
NULL);
}

View File

@ -1,7 +0,0 @@
#ifndef E_MOD_GAD_CFG_H
#define E_MOD_GAD_CFG_H
void _e_mod_gad_cfg_init(E_Module *m);
void _e_mod_gad_cfg_shutdown(void);
#endif

View File

@ -52,7 +52,6 @@ e_modapi_init(E_Module *m)
_e_mod_gad_gsm_init(m); _e_mod_gad_gsm_init(m);
_e_mod_gad_usb_init(m); _e_mod_gad_usb_init(m);
_e_mod_gad_bluetooth_init(m); _e_mod_gad_bluetooth_init(m);
_e_mod_gad_cfg_init(m);
return m; /* return NULL on failure, anything else on success. the pointer return m; /* return NULL on failure, anything else on success. the pointer
* returned will be set as m->data for convenience tracking */ * returned will be set as m->data for convenience tracking */
@ -62,7 +61,6 @@ e_modapi_init(E_Module *m)
EAPI int EAPI int
e_modapi_shutdown(E_Module *m) e_modapi_shutdown(E_Module *m)
{ {
_e_mod_gad_cfg_shutdown();
_e_mod_gad_bluetooth_shutdown(); _e_mod_gad_bluetooth_shutdown();
_e_mod_gad_usb_shutdown(); _e_mod_gad_usb_shutdown();
_e_mod_gad_gsm_shutdown(); _e_mod_gad_gsm_shutdown();

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
#Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640x16 & Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640x16 &
Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640 & #Xephyr :1 -noreset -ac -br -dpi 284 -screen 480x640 &
#Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480x16 & #Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480x16 &
#Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480 & #Xephyr :1 -noreset -ac -br -dpi 284 -screen 640x480 &
#Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320x16 & #Xephyr :1 -noreset -ac -br -dpi 181 -screen 320x320x16 &