@ -0,0 +1,172 @@ |
||||
#ifdef E_TYPEDEFS |
||||
|
||||
typedef struct E_Event_Configure_Option E_Event_Configure_Option_Changed; |
||||
typedef struct E_Event_Configure_Option E_Event_Configure_Option_Add; |
||||
typedef struct E_Event_Configure_Option E_Event_Configure_Option_Del; |
||||
typedef struct E_Event_Configure_Category E_Event_Configure_Option_Category_Add; |
||||
typedef struct E_Event_Configure_Category E_Event_Configure_Option_Category_Del; |
||||
typedef struct E_Event_Configure_Tag E_Event_Configure_Option_Tag_Add; |
||||
typedef struct E_Event_Configure_Tag E_Event_Configure_Option_Tag_Del; |
||||
typedef struct E_Configure_Option_Info E_Configure_Option_Info; |
||||
typedef struct E_Configure_Option E_Configure_Option; |
||||
typedef struct E_Configure_Option_Ctx E_Configure_Option_Ctx; |
||||
typedef void (*E_Configure_Option_Set_Cb)(); |
||||
typedef Eina_List *(*E_Configure_Option_Info_Cb)(E_Configure_Option *); |
||||
typedef Evas_Object *(*E_Configure_Option_Info_Thumb_Cb)(E_Configure_Option_Info *, Evas *); |
||||
|
||||
#else |
||||
# ifndef E_CONFIGURE_OPTION_H |
||||
# define E_CONFIGURE_OPTION_H |
||||
|
||||
#define E_CONFIGURE_OPTION_TAG_LENGTH 128 |
||||
|
||||
#define E_CONFIGURE_OPTION_ADD(OPT, TYPE, NAME, CFGPTR, DESC, ...) \ |
||||
OPT = e_configure_option_add(E_CONFIGURE_OPTION_TYPE_##TYPE, DESC, #NAME, EINA_TRUE, &CFGPTR->NAME, NULL);\
|
||||
e_configure_option_tags_set(OPT, (const char*[]){__VA_ARGS__, NULL}, 0) |
||||
#define E_CONFIGURE_OPTION_HELP(OPT, STR) \ |
||||
OPT->help = eina_stringshare_add(_(STR)) |
||||
#define E_CONFIGURE_OPTION_MINMAX_STEP_FMT(OPT, MIN, MAX, STEP, FMT) \ |
||||
OPT->minmax[0] = (MIN), OPT->minmax[1] = (MAX), OPT->step = (STEP),\
|
||||
OPT->info = eina_stringshare_add(_(FMT)) |
||||
#define E_CONFIGURE_OPTION_ICON(OPT, ICON) \ |
||||
e_configure_option_data_set(OPT, "icon", eina_stringshare_add(ICON)) |
||||
#define E_CONFIGURE_OPTION_LIST_CLEAR(LIST) do {\ |
||||
while (LIST) \
|
||||
{ \
|
||||
E_Configure_Option *co; \
|
||||
\
|
||||
co = (E_Configure_Option*)LIST; \
|
||||
LIST = eina_inlist_remove(LIST, EINA_INLIST_GET(co)); \
|
||||
e_configure_option_del(co); \
|
||||
}\
|
||||
} while (0) |
||||
|
||||
|
||||
EAPI extern int E_EVENT_CONFIGURE_OPTION_CHANGED; |
||||
EAPI extern int E_EVENT_CONFIGURE_OPTION_ADD; |
||||
EAPI extern int E_EVENT_CONFIGURE_OPTION_DEL; |
||||
EAPI extern int E_EVENT_CONFIGURE_OPTION_CATEGORY_ADD; |
||||
EAPI extern int E_EVENT_CONFIGURE_OPTION_CATEGORY_DEL; |
||||
EAPI extern int E_EVENT_CONFIGURE_OPTION_TAG_ADD; |
||||
EAPI extern int E_EVENT_CONFIGURE_OPTION_TAG_DEL; |
||||
|
||||
typedef enum |
||||
{ |
||||
E_CONFIGURE_OPTION_TYPE_BOOL, |
||||
E_CONFIGURE_OPTION_TYPE_INT, |
||||
E_CONFIGURE_OPTION_TYPE_UINT, |
||||
E_CONFIGURE_OPTION_TYPE_ENUM, |
||||
E_CONFIGURE_OPTION_TYPE_DOUBLE, |
||||
E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR, //lround(double)
|
||||
E_CONFIGURE_OPTION_TYPE_DOUBLE_INT, //lround(double)
|
||||
E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT, //lround(double)
|
||||
E_CONFIGURE_OPTION_TYPE_STR, |
||||
E_CONFIGURE_OPTION_TYPE_CUSTOM, |
||||
} E_Configure_Option_Type; |
||||
|
||||
struct E_Configure_Option |
||||
{ |
||||
EINA_INLIST; |
||||
Eina_Value val; |
||||
E_Configure_Option_Type type; |
||||
void *valptr; |
||||
Eina_Hash *data; |
||||
|
||||
double minmax[2]; //for sliders
|
||||
double step; //for sliders
|
||||
Eina_Stringshare *info; //for sliders, custom
|
||||
E_Configure_Option_Info_Cb info_cb; //for enums
|
||||
E_Configure_Option_Info_Thumb_Cb thumb_cb; //for custom thumbs
|
||||
|
||||
Eina_Stringshare *name; |
||||
Eina_Stringshare *desc; |
||||
Eina_Stringshare *help; |
||||
Eina_List *tags; //Eina_Stringshare
|
||||
|
||||
int event_type; //event to emit if changed
|
||||
Eina_Stringshare *changed_action; //action to call if changed
|
||||
struct |
||||
{ |
||||
void (*none)(void); |
||||
void (*one)(); |
||||
void (*two)(); |
||||
} funcs[2]; //disable, enable
|
||||
Eina_Bool private : 1; |
||||
Eina_Bool requires_restart : 1; |
||||
Eina_Bool changed : 1; |
||||
}; |
||||
|
||||
struct E_Configure_Option_Info |
||||
{ |
||||
E_Configure_Option *co; |
||||
Eina_Stringshare *name; |
||||
void *value; |
||||
Eina_Stringshare *thumb_file; |
||||
Eina_Stringshare *thumb_key; |
||||
Eina_Bool current : 1; |
||||
}; |
||||
|
||||
struct E_Event_Configure_Option |
||||
{ |
||||
E_Configure_Option *co; |
||||
}; |
||||
|
||||
struct E_Event_Configure_Category |
||||
{ |
||||
Eina_Stringshare *category; |
||||
}; |
||||
|
||||
struct E_Event_Configure_Tag |
||||
{ |
||||
Eina_Stringshare *tag; |
||||
}; |
||||
|
||||
struct E_Configure_Option_Ctx |
||||
{ |
||||
Eina_List *tags; // Eina_Stringshare
|
||||
Eina_List *match_tags; // Eina_Stringshare
|
||||
Eina_List *opts; // E_Configure_Option
|
||||
Eina_Stringshare *category; |
||||
Eina_Bool changed : 1; |
||||
}; |
||||
|
||||
EAPI const Eina_List *e_configure_option_tags_list(void); |
||||
EAPI const Eina_List *e_configure_option_changed_list(void); |
||||
EAPI void e_configure_option_apply_all(void); |
||||
EAPI void e_configure_option_reset_all(void); |
||||
|
||||
EAPI E_Configure_Option *e_configure_option_add(E_Configure_Option_Type type, const char *desc, const char *name, Eina_Bool private_scope, void *valptr, const void *data); |
||||
EAPI void e_configure_option_tags_set(E_Configure_Option *co, const char const **tags, unsigned int num_tags); |
||||
EAPI void e_configure_option_del(E_Configure_Option *eci); |
||||
EAPI const Eina_List *e_configure_option_tag_list_options(const char *tag); |
||||
EAPI void e_configure_option_changed(E_Configure_Option *co); |
||||
EAPI void e_configure_option_apply(E_Configure_Option *co); |
||||
EAPI void e_configure_option_reset(E_Configure_Option *co); |
||||
EAPI void *e_configure_option_data_set(E_Configure_Option *co, const char *key, const void *data); |
||||
EAPI void *e_configure_option_data_get(E_Configure_Option *co, const char *key); |
||||
EAPI const void *e_configure_option_value_get(E_Configure_Option *co); |
||||
|
||||
EAPI E_Configure_Option_Info *e_configure_option_info_new(E_Configure_Option *co, const char *name, const void *value); |
||||
EAPI void e_configure_option_info_free(E_Configure_Option_Info *oi); |
||||
EAPI Eina_List *e_configure_option_info_get(E_Configure_Option *co); |
||||
EAPI Evas_Object *e_configure_option_info_thumb_get(E_Configure_Option_Info *oi, Evas *evas); |
||||
|
||||
EAPI const Eina_List *e_configure_option_category_list(void); |
||||
EAPI const Eina_List *e_configure_option_category_list_tags(const char *cat); |
||||
EAPI void e_configure_option_category_tag_add(const char *cat, const char *tag); |
||||
EAPI void e_configure_option_category_tag_del(const char *cat, const char *tag); |
||||
EAPI Eina_Stringshare *e_configure_option_category_icon_get(const char *cat); |
||||
EAPI void e_configure_option_category_icon_set(const char *cat, const char *icon); |
||||
|
||||
EAPI E_Configure_Option_Ctx *e_configure_option_ctx_new(void); |
||||
EAPI void e_configure_option_ctx_free(E_Configure_Option_Ctx *ctx); |
||||
EAPI Eina_Bool e_configure_option_ctx_update(E_Configure_Option_Ctx *ctx, const char *str); |
||||
EAPI const Eina_List *e_configure_option_ctx_option_list(E_Configure_Option_Ctx *ctx); |
||||
EAPI const Eina_List *e_configure_option_ctx_match_tag_list(E_Configure_Option_Ctx *ctx); |
||||
EAPI Eina_Bool e_configure_option_ctx_tag_add(E_Configure_Option_Ctx *ctx, Eina_Stringshare *tag); |
||||
EAPI Eina_Bool e_configure_option_ctx_tag_pop(E_Configure_Option_Ctx *ctx); |
||||
|
||||
EINTERN int e_configure_option_init(void); |
||||
EINTERN int e_configure_option_shutdown(void); |
||||
# endif |
||||
#endif |
@ -0,0 +1,74 @@ |
||||
conf2dir = $(MDIR)/conf2 |
||||
conf2_DATA = conf2/e-module-conf2.edj \ |
||||
conf2/module.desktop |
||||
|
||||
EXTRA_DIST += $(conf2_DATA) $(conf2dir)/e-module-conf2.edc |
||||
EXTRA_DIST += \ |
||||
images/volume_knob_ledsoff.png \ |
||||
images/volume_knob_move.png \ |
||||
images/volume_knob.png \ |
||||
images/volume_led_01.png \ |
||||
images/volume_led_02.png \ |
||||
images/volume_led_03.png \ |
||||
images/volume_led_04.png \ |
||||
images/volume_led_05.png \ |
||||
images/volume_led_06.png \ |
||||
images/volume_led_07.png \ |
||||
images/volume_led_08.png \ |
||||
images/volume_led_09.png \ |
||||
images/volume_led_10.png \ |
||||
images/volume_led_11.png \ |
||||
images/volume_led_12.png \ |
||||
images/volume_led_13.png \ |
||||
images/volume_led_14.png \ |
||||
images/volume_led_15.png \ |
||||
images/volume_led_16.png \ |
||||
images/volume_led_17.png \ |
||||
images/volume_led_18.png \ |
||||
images/volume_led_19.png \ |
||||
images/volume_led_20.png \ |
||||
images/volume_led_21.png \ |
||||
images/volume_led_22.png \ |
||||
images/volume_led_23.png \ |
||||
images/volume_led_24.png \ |
||||
images/volume_led_25.png \ |
||||
images/volume_led_26.png \ |
||||
images/volume_led_27.png \ |
||||
images/volume_led_28.png \ |
||||
images/volume_led_29.png \ |
||||
images/volume_led_30.png \ |
||||
images/volume_led_31.png \ |
||||
images/volume_led_32.png \ |
||||
images/volume_led_33.png \ |
||||
images/volume_led_34.png \ |
||||
images/volume_led_35.png \ |
||||
images/volume_led_36.png \ |
||||
images/volume_led_37.png \ |
||||
images/volume_led_38.png \ |
||||
images/volume_led_39.png \ |
||||
images/volume_led_40.png \ |
||||
images/volume_led_41.png \ |
||||
images/volume_led_42.png \ |
||||
images/volume_led_43.png \ |
||||
images/volume_led_44.png \ |
||||
images/volume_led_45.png |
||||
|
||||
conf2pkgdir = $(MDIR)/conf2/$(MODULE_ARCH) |
||||
conf2pkg_LTLIBRARIES = conf2/module.la |
||||
|
||||
conf2_module_la_SOURCES = conf2/e_mod_main.c \ |
||||
conf2/e_mod_main.h \ |
||||
conf2/e_conf2.c |
||||
|
||||
conf2_module_la_CFLAGS = $(AM_CFLAGS) @ELM_CFLAGS@ |
||||
conf2_module_la_LIBADD = @ELM_LIBS@ |
||||
|
||||
CONF2_EDJE_FLAGS = $(EDJE_FLAGS) -id $(srcdir)/conf2/images -id $(top_srcdir)/data/themes/img |
||||
|
||||
conf2/%.edj: conf2/%.edc Makefile |
||||
$(EDJE_CC) $(CONF2_EDJE_FLAGS) $< $@ |
||||
|
||||
.PHONY: conf2 install-conf2 |
||||
conf2: $(conf2pkg_LTLIBRARIES) $(conf2_DATA) |
||||
install-conf2: install-conf2DATA install-conf2pkgLTLIBRARIES |
||||
|
@ -0,0 +1,381 @@ |
||||
#include "e.h" |
||||
#include "e_mod_main.h" |
||||
|
||||
typedef struct _Instance Instance; |
||||
struct _Instance |
||||
{ |
||||
E_Gadcon_Client *gcc; |
||||
Evas_Object *o_toggle; |
||||
}; |
||||
|
||||
/* actual module specifics */ |
||||
|
||||
//static void _e_mod_conf_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
//static void _e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
//static void _config_pre_activate_cb(void *data, E_Menu *m);
|
||||
|
||||
/* 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 const char *_gc_label(const E_Gadcon_Client_Class *client_class); |
||||
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas); |
||||
static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class); |
||||
static void _cb_action_conf(void *data, Evas_Object *obj, const char *emission, const char *source); |
||||
|
||||
static E_Module *conf_module = NULL; |
||||
static E_Action *act = NULL; |
||||
static E_Int_Menu_Augmentation *maug = NULL; |
||||
static Eina_List *instances = NULL; |
||||
|
||||
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Conf2" }; |
||||
|
||||
/* 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_site_is_not_toolbar |
||||
}, |
||||
E_GADCON_CLIENT_STYLE_PLAIN |
||||
}; |
||||
|
||||
static E_Gadcon_Client * |
||||
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) |
||||
{ |
||||
Instance *inst; |
||||
|
||||
inst = E_NEW(Instance, 1); |
||||
inst->o_toggle = edje_object_add(gc->evas); |
||||
e_theme_edje_object_set(inst->o_toggle, |
||||
"base/theme/modules/conf2", |
||||
"e/modules/conf2/main"); |
||||
|
||||
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->o_toggle); |
||||
inst->gcc->data = inst; |
||||
|
||||
edje_object_signal_callback_add(inst->o_toggle, "e,action,conf2", "", |
||||
_cb_action_conf, inst); |
||||
|
||||
instances = eina_list_append(instances, inst); |
||||
e_gadcon_client_util_menu_attach(inst->gcc); |
||||
|
||||
return inst->gcc; |
||||
} |
||||
|
||||
static void |
||||
_gc_shutdown(E_Gadcon_Client *gcc) |
||||
{ |
||||
Instance *inst; |
||||
|
||||
if (!(inst = gcc->data)) return; |
||||
instances = eina_list_remove(instances, inst); |
||||
if (inst->o_toggle) evas_object_del(inst->o_toggle); |
||||
E_FREE(inst); |
||||
} |
||||
|
||||
static void |
||||
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient EINA_UNUSED) |
||||
{ |
||||
Evas_Coord mw, mh; |
||||
|
||||
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 const char * |
||||
_gc_label(const E_Gadcon_Client_Class *client_class EINA_UNUSED) |
||||
{ |
||||
return _("Settings"); |
||||
} |
||||
|
||||
static Evas_Object * |
||||
_gc_icon(const E_Gadcon_Client_Class *client_class EINA_UNUSED, Evas *evas) |
||||
{ |
||||
Evas_Object *o; |
||||
char buf[PATH_MAX]; |
||||
|
||||
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(const E_Gadcon_Client_Class *client_class EINA_UNUSED) |
||||
{ |
||||
return _gadcon_class.name; |
||||
} |
||||
|
||||
/*
|
||||
static void |
||||
_cb_button_click(void *data EINA_UNUSED, void *data2 EINA_UNUSED) |
||||
{ |
||||
E_Action *a; |
||||
|
||||
a = e_action_find("configuration"); |
||||
if ((a) && (a->func.go)) a->func.go(NULL, NULL); |
||||
} |
||||
*/ |
||||
|
||||
static void |
||||
_cb_action_conf(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) |
||||
{ |
||||
Instance *inst; |
||||
E_Action *a; |
||||
|
||||
if (!(inst = data)) return; |
||||
a = e_action_find("configuration"); |
||||
if ((a) && (a->func.go)) a->func.go(NULL, NULL); |
||||
} |
||||
|
||||
#if 0 |
||||
static void |
||||
_e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi EINA_UNUSED) |
||||
{ |
||||
Eina_List *l; |
||||
E_Configure_Cat *ecat; |
||||
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat) |
||||
{ |
||||
if ((ecat->pri >= 0) && (ecat->items)) |
||||
{ |
||||
E_Configure_It *eci; |
||||
Eina_List *ll; |
||||
|
||||
EINA_LIST_FOREACH(ecat->items, ll, eci) |
||||
{ |
||||
char buf[1024]; |
||||
|
||||
if ((eci->pri >= 0) && (eci == data)) |
||||
{ |
||||
snprintf(buf, sizeof(buf), "%s/%s", ecat->cat, eci->item); |
||||
e_configure_registry_call(buf, m->zone->container, NULL); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
static void |
||||
_config_pre_activate_cb(void *data, E_Menu *m) |
||||
{ |
||||
E_Configure_Cat *ecat = data; |
||||
E_Configure_It *eci; |
||||
Eina_List *l; |
||||
E_Menu_Item *mi; |
||||
|
||||
e_menu_pre_activate_callback_set(m, NULL, NULL); |
||||
|
||||
EINA_LIST_FOREACH(ecat->items, l, eci) |
||||
{ |
||||
if (eci->pri >= 0) |
||||
{ |
||||
mi = e_menu_item_new(m); |
||||
e_menu_item_label_set(mi, eci->label); |
||||
if (eci->icon) |
||||
{ |
||||
if (eci->icon_file) |
||||
e_menu_item_icon_edje_set(mi, eci->icon_file, eci->icon); |
||||
else |
||||
e_util_menu_item_theme_icon_set(mi, eci->icon); |
||||
} |
||||
e_menu_item_callback_set(mi, _e_mod_run_cb, eci); |
||||
} |
||||
} |
||||
} |
||||
|
||||
static void |
||||
_config_item_activate_cb(void *data, E_Menu *m, E_Menu_Item *mi EINA_UNUSED) |
||||
{ |
||||
E_Configure_Cat *ecat = data; |
||||
e_configure_show(m->zone->container, ecat->cat); |
||||
} |
||||
|
||||
static void |
||||
_config_all_pre_activate_cb(void *data EINA_UNUSED, E_Menu *m) |
||||
{ |
||||
const Eina_List *l; |
||||
E_Configure_Cat *ecat; |
||||
|
||||
e_menu_pre_activate_callback_set(m, NULL, NULL); |
||||
|
||||
EINA_LIST_FOREACH(e_configure_registry, l, ecat) |
||||
{ |
||||
E_Menu_Item *mi; |
||||
E_Menu *sub; |
||||
|
||||
if ((ecat->pri < 0) || (!ecat->items)) continue; |
||||
|
||||
mi = e_menu_item_new(m); |
||||
e_menu_item_label_set(mi, ecat->label); |
||||
if (ecat->icon) |
||||
{ |
||||
if (ecat->icon_file) |
||||
e_menu_item_icon_edje_set(mi, ecat->icon_file, ecat->icon); |
||||
else |
||||
e_util_menu_item_theme_icon_set(mi, ecat->icon); |
||||
} |
||||
e_menu_item_callback_set(mi, _config_item_activate_cb, ecat); |
||||
sub = e_menu_new(); |
||||
e_menu_item_submenu_set(mi, sub); |
||||
e_object_unref(E_OBJECT(sub)); |
||||
e_menu_pre_activate_callback_set(sub, _config_pre_activate_cb, ecat); |
||||
} |
||||
} |
||||
|
||||
/* menu item add hook */ |
||||
void |
||||
e_mod_config_menu_add(void *data EINA_UNUSED, E_Menu *m) |
||||
{ |
||||
E_Menu_Item *mi; |
||||
E_Menu *sub; |
||||
|
||||
e_menu_pre_activate_callback_set(m, NULL, NULL); |
||||
|
||||
sub = e_menu_new(); |
||||
e_menu_pre_activate_callback_set(sub, _config_all_pre_activate_cb, NULL); |
||||
|
||||
mi = e_menu_item_new(m); |
||||
e_menu_item_label_set(mi, _("All")); |
||||
e_menu_item_submenu_set(mi, sub); |
||||
e_object_unref(E_OBJECT(sub)); |
||||
} |
||||
#endif |
||||
static void |
||||
_e_mod_action_conf_cb(E_Object *obj, const char *params) |
||||
{ |
||||
E_Zone *zone = NULL; |
||||
|
||||
if (obj) |
||||
{ |
||||
if (obj->type == E_MANAGER_TYPE) |
||||
zone = e_util_zone_current_get((E_Manager *)obj); |
||||
else if (obj->type == E_CONTAINER_TYPE) |
||||
zone = e_util_zone_current_get(((E_Container *)obj)->manager); |
||||
else if (obj->type == E_ZONE_TYPE) |
||||
zone = ((E_Zone *)obj); |
||||
else |
||||
zone = e_util_zone_current_get(e_manager_current_get()); |
||||
} |
||||
if (!zone) zone = e_util_zone_current_get(e_manager_current_get()); |
||||
if ((zone) && (params)) |
||||
e_configure_registry_call(params, zone->container, params); |
||||
else if (zone) |
||||
e_conf2_show(zone->container, params); |
||||
} |
||||
|
||||
static void |
||||
_e_mod_menu_cb(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED) |
||||
{ |
||||
e_conf2_show(NULL, NULL); |
||||
} |
||||
|
||||
static void |
||||
_e_mod_menu_add(void *data EINA_UNUSED, E_Menu *m) |
||||
{ |
||||
E_Menu_Item *mi; |
||||
|
||||
mi = e_menu_item_new(m); |
||||
e_menu_item_label_set(mi, _("Configuration")); |
||||
e_util_menu_item_theme_icon_set(mi, "preferences-system"); |
||||
e_menu_item_callback_set(mi, _e_mod_menu_cb, NULL); |
||||
} |
||||
|
||||
EAPI void * |
||||
e_modapi_init(E_Module *m) |
||||
{ |
||||
char buf[PATH_MAX]; |
||||
|
||||
if (!e_win_elm_available()) return NULL; |
||||
if (e_action_find("configuration")) |
||||
{ |
||||
e_util_dialog_show(_("Error"), _("conf2 module cannot be loaded when conf module is already loaded!")); |
||||
return NULL; |
||||
} |
||||
conf_module = m; |
||||
|
||||
/* add module supplied action */ |
||||
act = e_action_add("configuration"); |
||||
if (act) |
||||
{ |
||||
act->func.go = _e_mod_action_conf_cb; |
||||
e_action_predef_name_set(N_("Launch"), N_("Control Panel"), |
||||
"configuration", NULL, NULL, 0); |
||||
} |
||||
maug = |
||||
e_int_menus_menu_augmentation_add_sorted("config/0", _("Configuration"), |
||||
_e_mod_menu_add, NULL, NULL, NULL); |
||||
e_module_delayed_set(m, 1); |
||||
|
||||
snprintf(buf, sizeof(buf), "%s/e-module-conf2.edj", e_module_dir_get(conf_module)); |
||||
elm_theme_extension_add(NULL, buf); |
||||
|
||||
//e_configure_registry_category_add("settings", 80, _("Settings"),
|
||||
//NULL, "preferences-settings");
|
||||
//e_configure_registry_item_add("settings/conf2", 110, _("Control Panel"),
|
||||
//NULL, buf, e_int_config_conf2);
|
||||
/*
|
||||
if (conf->menu_augmentation) |
||||
{ |
||||
conf->aug = |
||||
e_int_menus_menu_augmentation_add |
||||
("config/2", e_mod_config_menu_add, NULL, NULL, NULL); |
||||
} |
||||
*/ |
||||
e_gadcon_provider_register(&_gadcon_class); |
||||
return m; |
||||
} |
||||
|
||||
EAPI int |
||||
e_modapi_shutdown(E_Module *m EINA_UNUSED) |
||||
{ |
||||
char buf[PATH_MAX]; |
||||
|
||||
e_conf2_hide(); |
||||
|
||||
snprintf(buf, sizeof(buf), "%s/e-module-conf2.edj", e_module_dir_get(conf_module)); |
||||
elm_theme_extension_del(NULL, buf); |
||||
|
||||
e_configure_registry_item_del("advanced/conf2"); |
||||
e_configure_registry_category_del("advanced"); |
||||
|
||||
e_gadcon_provider_unregister(&_gadcon_class); |
||||
|
||||
/* remove module-supplied menu additions */ |
||||
if (maug) |
||||
{ |
||||
e_int_menus_menu_augmentation_del("config/0", maug); |
||||
maug = NULL; |
||||
} |
||||
/*
|
||||
if (conf->aug) |
||||
{ |
||||
e_int_menus_menu_augmentation_del("config/2", conf->aug); |
||||
conf->aug = NULL; |
||||
} |
||||
*/ |
||||
/* remove module-supplied action */ |
||||
if (act) |
||||
{ |
||||
e_action_predef_name_del("Launch", "Control Panel"); |
||||
e_action_del("conf2"); |
||||
act = NULL; |
||||
} |
||||
conf_module = NULL; |
||||
|
||||
return 1; |
||||
} |
||||
|
||||
EAPI int |
||||
e_modapi_save(E_Module *m EINA_UNUSED) |
||||
{ |
||||
return 1; |
||||
} |
@ -0,0 +1,30 @@ |
||||
#ifndef E_MOD_MAIN_H |
||||
#define E_MOD_MAIN_H |
||||
|
||||
#include <Elementary.h> |
||||
|
||||
#define WEIGHT evas_object_size_hint_weight_set |
||||
#define ALIGN evas_object_size_hint_align_set |
||||
#define EXPAND(X) WEIGHT((X), EVAS_HINT_EXPAND, EVAS_HINT_EXPAND) |
||||
#define FILL(X) ALIGN((X), EVAS_HINT_FILL, EVAS_HINT_FILL) |
||||
|
||||
/**
|
||||
* @addtogroup Optional_Conf |
||||
* @{ |
||||
* |
||||
* @defgroup Module_Conf2 Improved Configuration Dialog |
||||
* |
||||
* Show the main configuration dialog used to access other |
||||
* configuration. |
||||
* |
||||
* @} |
||||
*/ |
||||
|
||||
typedef struct Config |
||||
{ |
||||
} Config; |
||||
|
||||
EINTERN void e_conf2_show(E_Container *con, const char *params); |
||||
EINTERN void e_conf2_hide(void); |
||||
|
||||
#endif |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 761 B |
After Width: | Height: | Size: 757 B |
After Width: | Height: | Size: 738 B |
After Width: | Height: | Size: 742 B |
After Width: | Height: | Size: 700 B |
After Width: | Height: | Size: 710 B |
After Width: | Height: | Size: 665 B |
After Width: | Height: | Size: 585 B |
After Width: | Height: | Size: 655 B |
After Width: | Height: | Size: 705 B |
After Width: | Height: | Size: 743 B |
After Width: | Height: | Size: 738 B |
After Width: | Height: | Size: 755 B |
After Width: | Height: | Size: 755 B |
After Width: | Height: | Size: 745 B |
After Width: | Height: | Size: 716 B |
After Width: | Height: | Size: 753 B |
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 716 B |
After Width: | Height: | Size: 709 B |
After Width: | Height: | Size: 681 B |
After Width: | Height: | Size: 605 B |
After Width: | Height: | Size: 692 B |
After Width: | Height: | Size: 726 B |
After Width: | Height: | Size: 699 B |
After Width: | Height: | Size: 721 B |
After Width: | Height: | Size: 748 B |
After Width: | Height: | Size: 764 B |
After Width: | Height: | Size: 740 B |
After Width: | Height: | Size: 751 B |
After Width: | Height: | Size: 761 B |
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 723 B |
After Width: | Height: | Size: 715 B |
After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 695 B |
After Width: | Height: | Size: 702 B |
After Width: | Height: | Size: 730 B |
After Width: | Height: | Size: 746 B |
After Width: | Height: | Size: 751 B |
After Width: | Height: | Size: 719 B |
@ -0,0 +1,6 @@ |
||||
[Desktop Entry] |
||||
Type=Link |
||||
Name=Configuration |
||||
Icon=e-module-conf2 |
||||
Comment=Improved Enlightenment configuration panel. |
||||
X-Enlightenment-ModuleType=core |