SVN revision: 82078
This commit is contained in:
Mike Blumenkrantz 2013-01-03 14:47:21 +00:00
parent 5cd9d5a35a
commit 9e207e6f92
70 changed files with 6919 additions and 6 deletions

1
.gitignore vendored
View File

@ -118,6 +118,7 @@ src/modules/battery/module.desktop
src/modules/clock/module.desktop
src/modules/comp/module.desktop
src/modules/conf/module.desktop
src/modules/conf2/e-module-conf2.edj
src/modules/conf_applications/module.desktop
src/modules/conf_dialogs/module.desktop
src/modules/conf_display/module.desktop

View File

@ -1,3 +1,9 @@
2013-01-03 Mike Blumenkrantz
* Added e_win_elm_available()
* Added conf2 module
* Added e_configure_option API
2013-01-03 Carsten Haitzler
* Fix translation of evrything strigns to include many more

11
NEWS
View File

@ -2,9 +2,14 @@ Changes since 0.17.0:
---------------------
Additions:
* Added action to reset filemanager
* Added function to hide all active menus
* Added enum for deskflip animation mode
Modules:
* conf2
API:
* Added action to reset filemanager
* Added function to hide all active menus
* Added enum for deskflip animation mode
* Added e_win_elm_available()
* Added e_configure_option API
Deprecations:
*

View File

@ -841,6 +841,7 @@ AC_E_OPTIONAL_MODULE([fileman], true)
AC_E_OPTIONAL_MODULE([fileman_opinfo], true)
AC_E_OPTIONAL_MODULE([wizard], true)
AC_E_OPTIONAL_MODULE([conf], true)
AC_E_OPTIONAL_MODULE([conf2], $have_elementary)
AC_E_OPTIONAL_MODULE([conf_wallpaper2], true)
AC_E_OPTIONAL_MODULE([conf_theme], true, true)
AC_E_OPTIONAL_MODULE([conf_intl], true)
@ -938,6 +939,7 @@ src/modules/winlist/module.desktop
src/modules/fileman/module.desktop
src/modules/fileman_opinfo/module.desktop
src/modules/conf/module.desktop
src/modules/conf2/module.desktop
src/modules/conf_wallpaper2/module.desktop
src/modules/conf_theme/module.desktop
src/modules/conf_intl/module.desktop

View File

@ -59,6 +59,7 @@ e_config_data.h \
e_config_dialog.h \
e_config.h \
e_configure.h \
e_configure_option.h \
e_confirm_dialog.h \
e_container.h \
e_datastore.h \
@ -216,6 +217,7 @@ e_config.c \
e_config_data.c \
e_config_dialog.c \
e_configure.c \
e_configure_option.c \
e_confirm_dialog.c \
e_container.c \
e_datastore.c \

View File

@ -744,6 +744,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, transition_change, STR); /**/
E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
E_CONFIG_VAL(D, T, remember_internal_windows, INT);
E_CONFIG_VAL(D, T, remember_internal_fm_windows, UCHAR);
E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
E_CONFIG_VAL(D, T, move_info_visible, INT); /**/
@ -1080,6 +1081,8 @@ e_config_load(void)
e_sys_action_do(E_SYS_RESTART, NULL);
}
}
if (!e_config->remember_internal_fm_windows)
e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS);
e_config->config_version = E_CONFIG_FILE_VERSION;
@ -1181,6 +1184,7 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1);
E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1);
E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3);
E_CONFIG_LIMIT(e_config->remember_internal_fm_windows, 0, 1);
E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
E_CONFIG_LIMIT(e_config->screen_limits, 0, 2);

View File

@ -38,7 +38,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
* config doesn't need to be wiped - simply new values need to be put in
*/
#define E_CONFIG_FILE_GENERATION 0
#define E_CONFIG_FILE_GENERATION 1
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
struct _E_Config
@ -144,6 +144,7 @@ struct _E_Config
const char *transition_change; // GUI
Eina_List *remembers; // GUI
int remember_internal_windows; // GUI
Eina_Bool remember_internal_fm_windows; // GUI
int move_info_follows; // GUI
int resize_info_follows; // GUI
int move_info_visible; // GUI
@ -378,7 +379,7 @@ struct _E_Config
const char *xft_rgba;
const char *net_theme_name; // GUI
const char *net_theme_name_detected; // not saved
const char *net_icon_theme_name; // GUI
const char *net_icon_theme_name;
const char *gtk_font_name;
} xsettings;

2687
src/bin/e_configure_option.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -57,6 +57,7 @@
#include "e_pan.h"
#include "e_dialog.h"
#include "e_configure.h"
#include "e_configure_option.h"
#include "e_about.h"
#include "e_theme_about.h"
#include "e_widget.h"

View File

@ -508,6 +508,11 @@ main(int argc, char **argv)
TS("E_Config Init Done");
_e_main_shutdown_push(e_config_shutdown);
TS("E_Configure Option Init");
e_configure_option_init();
TS("E_Configure Option Init Done");
_e_main_shutdown_push(e_configure_option_shutdown);
_xdg_data_dirs_augment();
_fix_user_default_edj();

View File

@ -706,6 +706,8 @@ _e_module_whitelist_check(void)
"xkbswitch",
"echievements",
"music-control",
"conf2",
NULL // end marker
};

View File

@ -602,7 +602,8 @@ _e_remember_cb_hook_eval_post_new_border(void *data __UNUSED__, void *border)
if (!strncmp(bd->client.icccm.class, "e_fwin", 6))
{
if (!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS))
if (!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS) &&
(!e_config->remember_internal_fm_windows))
return;
}
else

View File

@ -229,6 +229,16 @@ e_win_shutdown(void)
return 1;
}
EAPI Eina_Bool
e_win_elm_available(void)
{
#ifdef HAVE_ELEMENTARY
return EINA_TRUE;
#else
return EINA_FALSE;
#endif
}
EAPI E_Win *
e_win_new(E_Container *con)
{

View File

@ -46,6 +46,7 @@ struct _E_Win
EINTERN int e_win_init (void);
EINTERN int e_win_shutdown (void);
EAPI Eina_Bool e_win_elm_available(void);
EAPI E_Win *e_win_new (E_Container *con);
EAPI void e_win_show (E_Win *win);
EAPI void e_win_hide (E_Win *win);

View File

@ -90,6 +90,10 @@ if USE_MODULE_CONF
include Makefile_conf.am
endif
if USE_MODULE_CONF2
include Makefile_conf2.am
endif
if USE_MODULE_CONF_WALLPAPER2
include Makefile_conf_wallpaper2.am
endif

View File

@ -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

File diff suppressed because it is too large Load Diff

1326
src/modules/conf2/e_conf2.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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;
}

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Type=Link
Name=Configuration
Icon=e-module-conf2
Comment=Improved Enlightenment configuration panel.
X-Enlightenment-ModuleType=core