forked from enlightenment/enlightenment
e wizard - fix symbol linking for pages by exposing syms explicitly
wizard module was relying on implicit symbol linking for pages. since i chnaged dlopens to be local this broke page loading. this local dlopen change is all about not leaking symbols into the global table which is good/right, but this stops the wixzard setup from working, so move to explicitly exposing symbols to the modules in a struct.
This commit is contained in:
parent
28ad7b337c
commit
91463a9621
|
@ -1,4 +1,5 @@
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_priv.h"
|
||||||
|
|
||||||
/* actual module specifics */
|
/* actual module specifics */
|
||||||
E_Module *wiz_module = NULL;
|
E_Module *wiz_module = NULL;
|
||||||
|
@ -36,6 +37,21 @@ E_API E_Module_Api e_modapi =
|
||||||
"Wizard"
|
"Wizard"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const E_Wizard_Api api =
|
||||||
|
{
|
||||||
|
wizard_go,
|
||||||
|
wizard_apply,
|
||||||
|
wizard_next,
|
||||||
|
wizard_page_show,
|
||||||
|
wizard_page_add,
|
||||||
|
wizard_page_del,
|
||||||
|
wizard_button_next_enable_set,
|
||||||
|
wizard_title_set,
|
||||||
|
wizard_labels_update,
|
||||||
|
wizard_dir_get,
|
||||||
|
wizard_xdg_desktops_reset
|
||||||
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_cb_sort_files(char *f1, char *f2)
|
_cb_sort_files(char *f1, char *f2)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +67,7 @@ e_modapi_init(E_Module *m)
|
||||||
const char *src_path;
|
const char *src_path;
|
||||||
|
|
||||||
wiz_module = m;
|
wiz_module = m;
|
||||||
e_wizard_init();
|
wizard_init();
|
||||||
|
|
||||||
src_path = getenv("E_MODULE_SRC_PATH");
|
src_path = getenv("E_MODULE_SRC_PATH");
|
||||||
if (src_path)
|
if (src_path)
|
||||||
|
@ -77,12 +93,21 @@ e_modapi_init(E_Module *m)
|
||||||
handle = dlopen(buf, RTLD_NOW | RTLD_LOCAL);
|
handle = dlopen(buf, RTLD_NOW | RTLD_LOCAL);
|
||||||
#endif
|
#endif
|
||||||
if (handle)
|
if (handle)
|
||||||
e_wizard_page_add(handle, file,
|
{
|
||||||
|
void (*fn) (const E_Wizard_Api *a);
|
||||||
|
|
||||||
|
fn = dlsym(handle, "wizard_api_set");
|
||||||
|
if (fn)
|
||||||
|
{
|
||||||
|
fn(&api);
|
||||||
|
wizard_page_add(handle, file,
|
||||||
dlsym(handle, "wizard_page_init"),
|
dlsym(handle, "wizard_page_init"),
|
||||||
dlsym(handle, "wizard_page_shutdown"),
|
dlsym(handle, "wizard_page_shutdown"),
|
||||||
dlsym(handle, "wizard_page_show"),
|
dlsym(handle, "wizard_page_show"),
|
||||||
dlsym(handle, "wizard_page_hide"),
|
dlsym(handle, "wizard_page_hide"),
|
||||||
dlsym(handle, "wizard_page_apply"));
|
dlsym(handle, "wizard_page_apply"));
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if its an executable...
|
// if its an executable...
|
||||||
|
@ -93,7 +118,7 @@ e_modapi_init(E_Module *m)
|
||||||
}
|
}
|
||||||
free(file);
|
free(file);
|
||||||
}
|
}
|
||||||
e_wizard_go();
|
wizard_go();
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +126,7 @@ e_modapi_init(E_Module *m)
|
||||||
E_API int
|
E_API int
|
||||||
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
||||||
{
|
{
|
||||||
e_wizard_shutdown();
|
wizard_shutdown();
|
||||||
wiz_module = NULL;
|
wiz_module = NULL;
|
||||||
// FIXME: wrong place
|
// FIXME: wrong place
|
||||||
// e_module_disable(m); /* disable - on restart this won't be loaded now */
|
// e_module_disable(m); /* disable - on restart this won't be loaded now */
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_priv.h"
|
||||||
|
|
||||||
static void _e_wizard_next_eval(void);
|
static void _wizard_next_eval(void);
|
||||||
static Evas_Object *_e_wizard_main_new(E_Zone *zone);
|
static Evas_Object *_wizard_main_new(E_Zone *zone);
|
||||||
static Evas_Object *_e_wizard_extra_new(E_Zone *zone);
|
static Evas_Object *_wizard_extra_new(E_Zone *zone);
|
||||||
static Eina_Bool _e_wizard_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
static Eina_Bool _wizard_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
|
||||||
static void _e_wizard_cb_next(void *data, Evas_Object *obj, const char *emission, const char *source);
|
static void _wizard_cb_next(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||||
|
|
||||||
static Eina_Bool _e_wizard_check_xdg(void);
|
static Eina_Bool _wizard_check_xdg(void);
|
||||||
static void _e_wizard_next_xdg(void);
|
static void _wizard_next_xdg(void);
|
||||||
static Eina_Bool _e_wizard_cb_next_page(void *data);
|
static Eina_Bool _wizard_cb_next_page(void *data);
|
||||||
static Eina_Bool _e_wizard_cb_desktops_update(void *data, int ev_type, void *ev);
|
static Eina_Bool _wizard_cb_desktops_update(void *data, int ev_type, void *ev);
|
||||||
static Eina_Bool _e_wizard_cb_icons_update(void *data, int ev_type, void *ev);
|
static Eina_Bool _wizard_cb_icons_update(void *data, int ev_type, void *ev);
|
||||||
|
|
||||||
static Evas_Object *pop = NULL;
|
static Evas_Object *pop = NULL;
|
||||||
static Eina_List *pops = NULL;
|
static Eina_List *pops = NULL;
|
||||||
|
@ -32,8 +33,8 @@ static Eina_Bool need_xdg_icons = EINA_FALSE;
|
||||||
|
|
||||||
static Ecore_Timer *next_timer = NULL;
|
static Ecore_Timer *next_timer = NULL;
|
||||||
|
|
||||||
E_API int
|
EINTERN int
|
||||||
e_wizard_init(void)
|
wizard_init(void)
|
||||||
{
|
{
|
||||||
E_Zone *zone;
|
E_Zone *zone;
|
||||||
const Eina_List *l;
|
const Eina_List *l;
|
||||||
|
@ -41,30 +42,30 @@ e_wizard_init(void)
|
||||||
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
||||||
{
|
{
|
||||||
if (!pop)
|
if (!pop)
|
||||||
pop = _e_wizard_main_new(zone);
|
pop = _wizard_main_new(zone);
|
||||||
else
|
else
|
||||||
pops = eina_list_append(pops, _e_wizard_extra_new(zone));
|
pops = eina_list_append(pops, _wizard_extra_new(zone));
|
||||||
}
|
}
|
||||||
|
|
||||||
e_comp_grab_input(1, 1);
|
e_comp_grab_input(1, 1);
|
||||||
|
|
||||||
E_LIST_HANDLER_APPEND(handlers, EFREET_EVENT_DESKTOP_CACHE_BUILD,
|
E_LIST_HANDLER_APPEND(handlers, EFREET_EVENT_DESKTOP_CACHE_BUILD,
|
||||||
_e_wizard_cb_desktops_update, NULL);
|
_wizard_cb_desktops_update, NULL);
|
||||||
|
|
||||||
E_LIST_HANDLER_APPEND(handlers, EFREET_EVENT_ICON_CACHE_UPDATE,
|
E_LIST_HANDLER_APPEND(handlers, EFREET_EVENT_ICON_CACHE_UPDATE,
|
||||||
_e_wizard_cb_icons_update, NULL);
|
_wizard_cb_icons_update, NULL);
|
||||||
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN, _e_wizard_cb_key_down, NULL);
|
E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN, _wizard_cb_key_down, NULL);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API int
|
EINTERN int
|
||||||
e_wizard_shutdown(void)
|
wizard_shutdown(void)
|
||||||
{
|
{
|
||||||
E_FREE_FUNC(pop, evas_object_del);
|
E_FREE_FUNC(pop, evas_object_del);
|
||||||
E_FREE_LIST(pops, evas_object_del);
|
E_FREE_LIST(pops, evas_object_del);
|
||||||
|
|
||||||
while (pages)
|
while (pages)
|
||||||
e_wizard_page_del(pages);
|
wizard_page_del(pages);
|
||||||
|
|
||||||
if (next_timer) ecore_timer_del(next_timer);
|
if (next_timer) ecore_timer_del(next_timer);
|
||||||
next_timer = NULL;
|
next_timer = NULL;
|
||||||
|
@ -72,8 +73,8 @@ e_wizard_shutdown(void)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_go(void)
|
wizard_go(void)
|
||||||
{
|
{
|
||||||
if (!curpage)
|
if (!curpage)
|
||||||
curpage = pages;
|
curpage = pages;
|
||||||
|
@ -81,13 +82,13 @@ e_wizard_go(void)
|
||||||
{
|
{
|
||||||
if (curpage->init) curpage->init(curpage, &need_xdg_desktops, &need_xdg_icons);
|
if (curpage->init) curpage->init(curpage, &need_xdg_desktops, &need_xdg_icons);
|
||||||
curpage->state++;
|
curpage->state++;
|
||||||
_e_wizard_next_eval();
|
_wizard_next_eval();
|
||||||
if (_e_wizard_check_xdg())
|
if (_wizard_check_xdg())
|
||||||
{
|
{
|
||||||
if ((curpage->show) && (!curpage->show(curpage)))
|
if ((curpage->show) && (!curpage->show(curpage)))
|
||||||
{
|
{
|
||||||
curpage->state++;
|
curpage->state++;
|
||||||
e_wizard_next();
|
wizard_next();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
curpage->state++;
|
curpage->state++;
|
||||||
|
@ -95,8 +96,8 @@ e_wizard_go(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_apply(void)
|
wizard_apply(void)
|
||||||
{
|
{
|
||||||
E_Wizard_Page *pg;
|
E_Wizard_Page *pg;
|
||||||
|
|
||||||
|
@ -104,14 +105,14 @@ e_wizard_apply(void)
|
||||||
if (pg->apply) pg->apply(pg);
|
if (pg->apply) pg->apply(pg);
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_next(void)
|
wizard_next(void)
|
||||||
{
|
{
|
||||||
if (!curpage)
|
if (!curpage)
|
||||||
{
|
{
|
||||||
/* FINISH */
|
/* FINISH */
|
||||||
e_wizard_apply();
|
wizard_apply();
|
||||||
e_wizard_shutdown();
|
wizard_shutdown();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (curpage->hide)
|
if (curpage->hide)
|
||||||
|
@ -120,26 +121,26 @@ e_wizard_next(void)
|
||||||
curpage = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(curpage)->next, E_Wizard_Page);
|
curpage = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(curpage)->next, E_Wizard_Page);
|
||||||
if (!curpage)
|
if (!curpage)
|
||||||
{
|
{
|
||||||
e_wizard_next();
|
wizard_next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "WIZARD PAGE: %s\n", curpage->name);
|
fprintf(stderr, "WIZARD PAGE: %s\n", curpage->name);
|
||||||
e_wizard_button_next_enable_set(1);
|
wizard_button_next_enable_set(1);
|
||||||
need_xdg_desktops = EINA_FALSE;
|
need_xdg_desktops = EINA_FALSE;
|
||||||
need_xdg_icons = EINA_FALSE;
|
need_xdg_icons = EINA_FALSE;
|
||||||
if (curpage->init)
|
if (curpage->init)
|
||||||
curpage->init(curpage, &need_xdg_desktops, &need_xdg_icons);
|
curpage->init(curpage, &need_xdg_desktops, &need_xdg_icons);
|
||||||
curpage->state++;
|
curpage->state++;
|
||||||
if (!_e_wizard_check_xdg()) return;
|
if (!_wizard_check_xdg()) return;
|
||||||
|
|
||||||
_e_wizard_next_eval();
|
_wizard_next_eval();
|
||||||
curpage->state++;
|
curpage->state++;
|
||||||
if (curpage->show && curpage->show(curpage)) return;
|
if (curpage->show && curpage->show(curpage)) return;
|
||||||
e_wizard_next();
|
wizard_next();
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_page_show(Evas_Object *obj)
|
wizard_page_show(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
evas_object_del(o_content);
|
evas_object_del(o_content);
|
||||||
o_content = obj;
|
o_content = obj;
|
||||||
|
@ -151,8 +152,8 @@ e_wizard_page_show(Evas_Object *obj)
|
||||||
edje_object_signal_emit(o_bg, "e,action,page,new", "e");
|
edje_object_signal_emit(o_bg, "e,action,page,new", "e");
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API E_Wizard_Page *
|
EINTERN E_Wizard_Page *
|
||||||
e_wizard_page_add(void *handle, const char *name,
|
wizard_page_add(void *handle, const char *name,
|
||||||
int (*init_cb)(E_Wizard_Page *pg, Eina_Bool *need_xdg_desktops, Eina_Bool *need_xdg_icons),
|
int (*init_cb)(E_Wizard_Page *pg, Eina_Bool *need_xdg_desktops, Eina_Bool *need_xdg_icons),
|
||||||
int (*shutdown_cb)(E_Wizard_Page *pg),
|
int (*shutdown_cb)(E_Wizard_Page *pg),
|
||||||
int (*show_cb)(E_Wizard_Page *pg),
|
int (*show_cb)(E_Wizard_Page *pg),
|
||||||
|
@ -180,10 +181,10 @@ e_wizard_page_add(void *handle, const char *name,
|
||||||
return pg;
|
return pg;
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_page_del(E_Wizard_Page *pg)
|
wizard_page_del(E_Wizard_Page *pg)
|
||||||
{
|
{
|
||||||
// rare thing.. if we do e_wizard_next() from a page and we end up finishing
|
// rare thing.. if we do wizard_next() from a page and we end up finishing
|
||||||
// ther page seq.. we cant REALLY dlclose... not a problem as wizard runs
|
// ther page seq.. we cant REALLY dlclose... not a problem as wizard runs
|
||||||
// once only then e restarts itself with final wizard page
|
// once only then e restarts itself with final wizard page
|
||||||
// if (pg->handle) dlclose(pg->handle);
|
// if (pg->handle) dlclose(pg->handle);
|
||||||
|
@ -193,40 +194,40 @@ e_wizard_page_del(E_Wizard_Page *pg)
|
||||||
free(pg);
|
free(pg);
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_button_next_enable_set(int enable)
|
wizard_button_next_enable_set(int enable)
|
||||||
{
|
{
|
||||||
next_ok = enable;
|
next_ok = enable;
|
||||||
_e_wizard_next_eval();
|
_wizard_next_eval();
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_title_set(const char *title)
|
wizard_title_set(const char *title)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set(o_bg, "e.text.title", title);
|
edje_object_part_text_set(o_bg, "e.text.title", title);
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_labels_update(void)
|
wizard_labels_update(void)
|
||||||
{
|
{
|
||||||
edje_object_part_text_set(o_bg, "e.text.label", _("Next"));
|
edje_object_part_text_set(o_bg, "e.text.label", _("Next"));
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API const char *
|
EINTERN const char *
|
||||||
e_wizard_dir_get(void)
|
wizard_dir_get(void)
|
||||||
{
|
{
|
||||||
return e_module_dir_get(wiz_module);
|
return e_module_dir_get(wiz_module);
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API void
|
EINTERN void
|
||||||
e_wizard_xdg_desktops_reset(void)
|
wizard_xdg_desktops_reset(void)
|
||||||
{
|
{
|
||||||
if (xdg_error) return;
|
if (xdg_error) return;
|
||||||
got_desktops = EINA_FALSE;
|
got_desktops = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_wizard_next_eval(void)
|
_wizard_next_eval(void)
|
||||||
{
|
{
|
||||||
int ok;
|
int ok;
|
||||||
|
|
||||||
|
@ -249,20 +250,20 @@ _e_wizard_next_eval(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
_e_wizard_main_new(E_Zone *zone)
|
_wizard_main_new(E_Zone *zone)
|
||||||
{
|
{
|
||||||
o_bg = edje_object_add(e_comp->evas);
|
o_bg = edje_object_add(e_comp->evas);
|
||||||
|
|
||||||
e_theme_edje_object_set(o_bg, "base/theme/wizard", "e/wizard/main");
|
e_theme_edje_object_set(o_bg, "base/theme/wizard", "e/wizard/main");
|
||||||
edje_object_part_text_set(o_bg, "e.text.title", _("Welcome to Enlightenment"));
|
edje_object_part_text_set(o_bg, "e.text.title", _("Welcome to Enlightenment"));
|
||||||
edje_object_signal_callback_add(o_bg, "e,action,next", "",
|
edje_object_signal_callback_add(o_bg, "e,action,next", "",
|
||||||
_e_wizard_cb_next, o_bg);
|
_wizard_cb_next, o_bg);
|
||||||
evas_object_geometry_set(o_bg, zone->x, zone->y, zone->w, zone->h);
|
evas_object_geometry_set(o_bg, zone->x, zone->y, zone->w, zone->h);
|
||||||
evas_object_layer_set(o_bg, E_LAYER_POPUP);
|
evas_object_layer_set(o_bg, E_LAYER_POPUP);
|
||||||
|
|
||||||
/* set up next/prev buttons */
|
/* set up next/prev buttons */
|
||||||
// edje_object_signal_emit(o_bg, "e,state,next,disable", "e");
|
// edje_object_signal_emit(o_bg, "e,state,next,disable", "e");
|
||||||
e_wizard_labels_update();
|
wizard_labels_update();
|
||||||
|
|
||||||
o_box = elm_box_add(e_comp->elm);
|
o_box = elm_box_add(e_comp->elm);
|
||||||
edje_object_part_swallow(o_bg, "e.swallow.content", o_box);
|
edje_object_part_swallow(o_bg, "e.swallow.content", o_box);
|
||||||
|
@ -272,7 +273,7 @@ _e_wizard_main_new(E_Zone *zone)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
_e_wizard_extra_new(E_Zone *zone)
|
_wizard_extra_new(E_Zone *zone)
|
||||||
{
|
{
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
|
|
||||||
|
@ -285,7 +286,7 @@ _e_wizard_extra_new(E_Zone *zone)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_wizard_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
_wizard_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
Ecore_Event_Key *ev = event;
|
Ecore_Event_Key *ev = event;
|
||||||
|
|
||||||
|
@ -300,29 +301,29 @@ _e_wizard_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||||
else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter")))
|
else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter")))
|
||||||
{
|
{
|
||||||
if (next_can)
|
if (next_can)
|
||||||
e_wizard_next();
|
wizard_next();
|
||||||
}
|
}
|
||||||
return ECORE_CALLBACK_RENEW;
|
return ECORE_CALLBACK_RENEW;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_wizard_cb_next(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
_wizard_cb_next(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||||
{
|
{
|
||||||
/* TODO: Disable button in theme */
|
/* TODO: Disable button in theme */
|
||||||
if (next_can)
|
if (next_can)
|
||||||
e_wizard_next();
|
wizard_next();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_wizard_check_xdg(void)
|
_wizard_check_xdg(void)
|
||||||
{
|
{
|
||||||
if ((need_xdg_desktops) && (!got_desktops))
|
if ((need_xdg_desktops) && (!got_desktops))
|
||||||
{
|
{
|
||||||
/* Advance within 15 secs if no xdg event */
|
/* Advance within 15 secs if no xdg event */
|
||||||
if (!next_timer)
|
if (!next_timer)
|
||||||
next_timer = ecore_timer_loop_add(7.0, _e_wizard_cb_next_page, NULL);
|
next_timer = ecore_timer_loop_add(7.0, _wizard_cb_next_page, NULL);
|
||||||
next_can = 0;
|
next_can = 0;
|
||||||
_e_wizard_next_eval();
|
_wizard_next_eval();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((need_xdg_icons) && (!got_icons))
|
if ((need_xdg_icons) && (!got_icons))
|
||||||
|
@ -340,9 +341,9 @@ _e_wizard_check_xdg(void)
|
||||||
{
|
{
|
||||||
/* Advance within 15 secs if no xdg event */
|
/* Advance within 15 secs if no xdg event */
|
||||||
if (!next_timer)
|
if (!next_timer)
|
||||||
next_timer = ecore_timer_loop_add(7.0, _e_wizard_cb_next_page, NULL);
|
next_timer = ecore_timer_loop_add(7.0, _wizard_cb_next_page, NULL);
|
||||||
next_can = 0;
|
next_can = 0;
|
||||||
_e_wizard_next_eval();
|
_wizard_next_eval();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -353,7 +354,7 @@ _e_wizard_check_xdg(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_wizard_next_xdg(void)
|
_wizard_next_xdg(void)
|
||||||
{
|
{
|
||||||
need_xdg_desktops = EINA_FALSE;
|
need_xdg_desktops = EINA_FALSE;
|
||||||
need_xdg_icons = EINA_FALSE;
|
need_xdg_icons = EINA_FALSE;
|
||||||
|
@ -363,28 +364,28 @@ _e_wizard_next_xdg(void)
|
||||||
if (curpage->state != E_WIZARD_PAGE_STATE_SHOW)
|
if (curpage->state != E_WIZARD_PAGE_STATE_SHOW)
|
||||||
{
|
{
|
||||||
if (next_ok) return; // waiting for user
|
if (next_ok) return; // waiting for user
|
||||||
e_wizard_next();
|
wizard_next();
|
||||||
}
|
}
|
||||||
else if ((curpage->show) && (!curpage->show(curpage)))
|
else if ((curpage->show) && (!curpage->show(curpage)))
|
||||||
{
|
{
|
||||||
curpage->state++;
|
curpage->state++;
|
||||||
e_wizard_next();
|
wizard_next();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
curpage->state++;
|
curpage->state++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_wizard_cb_next_page(void *data EINA_UNUSED)
|
_wizard_cb_next_page(void *data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
next_timer = NULL;
|
next_timer = NULL;
|
||||||
_e_wizard_next_xdg();
|
_wizard_next_xdg();
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_wizard_cb_desktops_update(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
|
_wizard_cb_desktops_update(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
|
||||||
{
|
{
|
||||||
Efreet_Event_Cache_Update *e;
|
Efreet_Event_Cache_Update *e;
|
||||||
|
|
||||||
|
@ -393,16 +394,16 @@ _e_wizard_cb_desktops_update(void *data EINA_UNUSED, int ev_type EINA_UNUSED, vo
|
||||||
if ((e) && (e->error))
|
if ((e) && (e->error))
|
||||||
xdg_error = EINA_TRUE;
|
xdg_error = EINA_TRUE;
|
||||||
got_desktops = EINA_TRUE;
|
got_desktops = EINA_TRUE;
|
||||||
if (_e_wizard_check_xdg() && curpage)
|
if (_wizard_check_xdg() && curpage)
|
||||||
_e_wizard_next_xdg();
|
_wizard_next_xdg();
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_e_wizard_cb_icons_update(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev EINA_UNUSED)
|
_wizard_cb_icons_update(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev EINA_UNUSED)
|
||||||
{
|
{
|
||||||
got_icons = EINA_TRUE;
|
got_icons = EINA_TRUE;
|
||||||
if (_e_wizard_check_xdg() && curpage)
|
if (_wizard_check_xdg() && curpage)
|
||||||
_e_wizard_next_xdg();
|
_wizard_next_xdg();
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
extern E_Module *wiz_module;
|
extern E_Module *wiz_module;
|
||||||
|
|
||||||
typedef struct _E_Wizard_Page E_Wizard_Page;
|
typedef struct _E_Wizard_Page E_Wizard_Page;
|
||||||
|
typedef struct _E_Wizard_Api E_Wizard_Api;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -28,25 +29,26 @@ struct _E_Wizard_Page
|
||||||
E_Wizard_Page_State state;
|
E_Wizard_Page_State state;
|
||||||
};
|
};
|
||||||
|
|
||||||
E_API int e_wizard_init(void);
|
struct _E_Wizard_Api
|
||||||
E_API int e_wizard_shutdown(void);
|
{
|
||||||
E_API void e_wizard_go(void);
|
void (*wizard_go) (void);
|
||||||
E_API void e_wizard_apply(void);
|
void (*wizard_apply) (void);
|
||||||
E_API void e_wizard_next(void);
|
void (*wizard_next) (void);
|
||||||
E_API void e_wizard_page_show(Evas_Object *obj);
|
void (*wizard_page_show) (Evas_Object *obj);
|
||||||
E_API E_Wizard_Page *e_wizard_page_add(void *handle, const char *name,
|
E_Wizard_Page *(*wizard_page_add) (void *handle, const char *name,
|
||||||
int (*init) (E_Wizard_Page *pg, Eina_Bool *need_xdg_desktops, Eina_Bool *need_xdg_icons),
|
int (*init) (E_Wizard_Page *pg, Eina_Bool *need_xdg_desktops, Eina_Bool *need_xdg_icons),
|
||||||
int (*shutdown) (E_Wizard_Page *pg),
|
int (*shutdown) (E_Wizard_Page *pg),
|
||||||
int (*show) (E_Wizard_Page *pg),
|
int (*show) (E_Wizard_Page *pg),
|
||||||
int (*hide) (E_Wizard_Page *pg),
|
int (*hide) (E_Wizard_Page *pg),
|
||||||
int (*apply) (E_Wizard_Page *pg)
|
int (*apply) (E_Wizard_Page *pg)
|
||||||
);
|
);
|
||||||
E_API void e_wizard_page_del(E_Wizard_Page *pg);
|
void (*wizard_page_del) (E_Wizard_Page *pg);
|
||||||
E_API void e_wizard_button_next_enable_set(int enable);
|
void (*wizard_button_next_enable_set) (int enable);
|
||||||
E_API void e_wizard_title_set(const char *title);
|
void (*wizard_title_set) (const char *title);
|
||||||
E_API void e_wizard_labels_update(void);
|
void (*wizard_labels_update) (void);
|
||||||
E_API const char *e_wizard_dir_get(void);
|
const char *(*wizard_dir_get) (void);
|
||||||
E_API void e_wizard_xdg_desktops_reset(void);
|
void (*wizard_xdg_desktops_reset) (void);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup Optional_Conf
|
* @addtogroup Optional_Conf
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#ifndef E_WIZARD_API_H
|
||||||
|
|
||||||
|
static const E_Wizard_Api *api = NULL;
|
||||||
|
|
||||||
|
E_API void
|
||||||
|
wizard_api_set(const E_Wizard_Api *a)
|
||||||
|
{
|
||||||
|
api = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,37 @@
|
||||||
|
#ifndef E_WIZARD_PRIV_H
|
||||||
|
|
||||||
|
EINTERN int wizard_init(void);
|
||||||
|
EINTERN int wizard_shutdown(void);
|
||||||
|
EINTERN void wizard_go(void);
|
||||||
|
EINTERN void wizard_apply(void);
|
||||||
|
EINTERN void wizard_next(void);
|
||||||
|
EINTERN void wizard_page_show(Evas_Object *obj);
|
||||||
|
EINTERN E_Wizard_Page *wizard_page_add(void *handle, const char *name,
|
||||||
|
int (*init) (E_Wizard_Page *pg, Eina_Bool *need_xdg_desktops, Eina_Bool *need_xdg_icons),
|
||||||
|
int (*shutdown) (E_Wizard_Page *pg),
|
||||||
|
int (*show) (E_Wizard_Page *pg),
|
||||||
|
int (*hide) (E_Wizard_Page *pg),
|
||||||
|
int (*apply) (E_Wizard_Page *pg)
|
||||||
|
);
|
||||||
|
EINTERN void wizard_page_del(E_Wizard_Page *pg);
|
||||||
|
EINTERN void wizard_button_next_enable_set(int enable);
|
||||||
|
EINTERN void wizard_title_set(const char *title);
|
||||||
|
EINTERN void wizard_labels_update(void);
|
||||||
|
EINTERN const char *wizard_dir_get(void);
|
||||||
|
EINTERN void wizard_xdg_desktops_reset(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Optional_Conf
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @defgroup Module_Wizard Wizard
|
||||||
|
*
|
||||||
|
* Configures the whole Enlightenment in a nice walk-through wizard.
|
||||||
|
*
|
||||||
|
* Usually is presented on the first run of Enlightenment. The wizard
|
||||||
|
* pages are configurable and should be extended by distributions that
|
||||||
|
* want to ship Enlightenment as the default window manager.
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
#endif
|
|
@ -1,7 +1,9 @@
|
||||||
src = files(
|
src = files(
|
||||||
'e_mod_main.c',
|
'e_mod_main.c',
|
||||||
'e_wizard.c',
|
'e_wizard.c',
|
||||||
'e_wizard.h'
|
'e_wizard.h',
|
||||||
|
'e_wizard_api.h',
|
||||||
|
'e_wizard_priv.h'
|
||||||
)
|
)
|
||||||
|
|
||||||
if get_option(m) == true
|
if get_option(m) == true
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* Splash Screen */
|
/* Splash Screen */
|
||||||
|
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static Ecore_Timer *_next_timer = NULL;
|
static Ecore_Timer *_next_timer = NULL;
|
||||||
|
|
||||||
|
@ -21,8 +22,8 @@ static Eina_Bool
|
||||||
_next_page(void *data EINA_UNUSED)
|
_next_page(void *data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
_next_timer = NULL;
|
_next_timer = NULL;
|
||||||
e_wizard_button_next_enable_set(1);
|
api->wizard_button_next_enable_set(1);
|
||||||
e_wizard_next();
|
api->wizard_next();
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,11 +32,11 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
|
|
||||||
e_wizard_title_set(_("Enlightenment"));
|
api->wizard_title_set(_("Enlightenment"));
|
||||||
e_wizard_button_next_enable_set(0);
|
api->wizard_button_next_enable_set(0);
|
||||||
o = edje_object_add(pg->evas);
|
o = edje_object_add(pg->evas);
|
||||||
e_theme_edje_object_set(o, "base/theme/wizard", "e/wizard/firstpage");
|
e_theme_edje_object_set(o, "base/theme/wizard", "e/wizard/firstpage");
|
||||||
e_wizard_page_show(o);
|
api->wizard_page_show(o);
|
||||||
|
|
||||||
/* advance in 1 sec */
|
/* advance in 1 sec */
|
||||||
if (!_next_timer)
|
if (!_next_timer)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Language chooser */
|
/* Language chooser */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
typedef struct _E_Intl_Pair E_Intl_Pair;
|
typedef struct _E_Intl_Pair E_Intl_Pair;
|
||||||
|
|
||||||
|
@ -210,7 +211,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
.version = ELM_GENLIST_ITEM_CLASS_VERSION
|
.version = ELM_GENLIST_ITEM_CLASS_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
e_wizard_title_set(_("Language"));
|
api->wizard_title_set(_("Language"));
|
||||||
of = elm_frame_add(e_comp->elm);
|
of = elm_frame_add(e_comp->elm);
|
||||||
elm_object_text_set(of, _("Select one"));
|
elm_object_text_set(of, _("Select one"));
|
||||||
ob = elm_genlist_add(of);
|
ob = elm_genlist_add(of);
|
||||||
|
@ -236,7 +237,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
E_EXPAND(of);
|
E_EXPAND(of);
|
||||||
E_FILL(of);
|
E_FILL(of);
|
||||||
elm_genlist_item_show(elm_genlist_selected_item_get(ob), ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
|
elm_genlist_item_show(elm_genlist_selected_item_get(ob), ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
// pg->data = o;
|
// pg->data = o;
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
|
@ -251,9 +252,9 @@ wizard_page_hide(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
* This should be on lang select,
|
* This should be on lang select,
|
||||||
* so if next page needs xdg we can't press next */
|
* so if next page needs xdg we can't press next */
|
||||||
if (lang)
|
if (lang)
|
||||||
e_wizard_xdg_desktops_reset();
|
api->wizard_xdg_desktops_reset();
|
||||||
e_intl_language_set(e_config->language);
|
e_intl_language_set(e_config->language);
|
||||||
e_wizard_labels_update();
|
api->wizard_labels_update();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +264,7 @@ wizard_page_apply(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
// do this again as we want it to apply to the new profile
|
// do this again as we want it to apply to the new profile
|
||||||
eina_stringshare_replace(&e_config->language, lang);
|
eina_stringshare_replace(&e_config->language, lang);
|
||||||
e_intl_language_set(e_config->language);
|
e_intl_language_set(e_config->language);
|
||||||
e_wizard_labels_update();
|
api->wizard_labels_update();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Language chooser */
|
/* Language chooser */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
typedef struct _Layout Layout;
|
typedef struct _Layout Layout;
|
||||||
|
|
||||||
|
@ -183,7 +184,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
.version = ELM_GENLIST_ITEM_CLASS_VERSION
|
.version = ELM_GENLIST_ITEM_CLASS_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
e_wizard_title_set(_("Keyboard"));
|
api->wizard_title_set(_("Keyboard"));
|
||||||
of = elm_frame_add(e_comp->elm);
|
of = elm_frame_add(e_comp->elm);
|
||||||
elm_object_text_set(of, _("Select one"));
|
elm_object_text_set(of, _("Select one"));
|
||||||
ob = elm_genlist_add(of);
|
ob = elm_genlist_add(of);
|
||||||
|
@ -210,7 +211,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
elm_genlist_item_selected_set(sel_it, 1);
|
elm_genlist_item_selected_set(sel_it, 1);
|
||||||
elm_genlist_item_show(sel_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
|
elm_genlist_item_show(sel_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
|
||||||
}
|
}
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Profile chooser */
|
/* Profile chooser */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static const char *profile = NULL;
|
static const char *profile = NULL;
|
||||||
static Evas_Object *textblock = NULL;
|
static Evas_Object *textblock = NULL;
|
||||||
|
@ -88,7 +89,7 @@ _profile_select(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
|
||||||
elm_object_text_set(textblock, _("Unknown"));
|
elm_object_text_set(textblock, _("Unknown"));
|
||||||
|
|
||||||
// enable next once you choose a profile
|
// enable next once you choose a profile
|
||||||
e_wizard_button_next_enable_set(1);
|
api->wizard_button_next_enable_set(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
E_API int
|
E_API int
|
||||||
|
@ -109,7 +110,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
.version = ELM_GENLIST_ITEM_CLASS_VERSION
|
.version = ELM_GENLIST_ITEM_CLASS_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
e_wizard_title_set(_("Profile"));
|
api->wizard_title_set(_("Profile"));
|
||||||
of = elm_frame_add(e_comp->elm);
|
of = elm_frame_add(e_comp->elm);
|
||||||
elm_object_text_set(of, _("Select one"));
|
elm_object_text_set(of, _("Select one"));
|
||||||
|
|
||||||
|
@ -166,10 +167,10 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
evas_object_show(of);
|
evas_object_show(of);
|
||||||
E_EXPAND(of);
|
E_EXPAND(of);
|
||||||
E_FILL(of);
|
E_FILL(of);
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
// pg->data = o;
|
// pg->data = o;
|
||||||
if (!sel_it)
|
if (!sel_it)
|
||||||
e_wizard_button_next_enable_set(0);
|
api->wizard_button_next_enable_set(0);
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Menu setup */
|
/* Menu setup */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
/*
|
/*
|
||||||
E_API int
|
E_API int
|
||||||
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED)
|
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Extra desktop files setup */
|
/* Extra desktop files setup */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static Ecore_Timer *_next_timer = NULL;
|
static Ecore_Timer *_next_timer = NULL;
|
||||||
|
|
||||||
|
@ -20,8 +21,8 @@ static Eina_Bool
|
||||||
_next_page(void *data EINA_UNUSED)
|
_next_page(void *data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
_next_timer = NULL;
|
_next_timer = NULL;
|
||||||
e_wizard_button_next_enable_set(1);
|
api->wizard_button_next_enable_set(1);
|
||||||
e_wizard_next();
|
api->wizard_next();
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,11 +34,11 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
char buf[PATH_MAX], *file;
|
char buf[PATH_MAX], *file;
|
||||||
int found, copies = 0;
|
int found, copies = 0;
|
||||||
|
|
||||||
e_wizard_title_set(_("Adding missing App files"));
|
api->wizard_title_set(_("Adding missing App files"));
|
||||||
e_wizard_button_next_enable_set(0);
|
api->wizard_button_next_enable_set(0);
|
||||||
e_wizard_page_show(NULL);
|
api->wizard_page_show(NULL);
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/extra_desktops", e_wizard_dir_get());
|
snprintf(buf, sizeof(buf), "%s/extra_desktops", api->wizard_dir_get());
|
||||||
extra_desks = ecore_file_ls(buf);
|
extra_desks = ecore_file_ls(buf);
|
||||||
|
|
||||||
/* advance in 1 sec */
|
/* advance in 1 sec */
|
||||||
|
@ -46,7 +47,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
EINA_LIST_FREE(extra_desks, file)
|
EINA_LIST_FREE(extra_desks, file)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/extra_desktops/%s",
|
snprintf(buf, sizeof(buf), "%s/extra_desktops/%s",
|
||||||
e_wizard_dir_get(), file);
|
api->wizard_dir_get(), file);
|
||||||
extra_desk = efreet_desktop_uncached_new(buf);
|
extra_desk = efreet_desktop_uncached_new(buf);
|
||||||
if (extra_desk)
|
if (extra_desk)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Ask about Scaling */
|
/* Ask about Scaling */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static double scale = 1.0;
|
static double scale = 1.0;
|
||||||
static Eina_List *obs = NULL;
|
static Eina_List *obs = NULL;
|
||||||
|
@ -125,7 +126,7 @@ wizard_page_show(E_Wizard_Page *pg)
|
||||||
Evas_Coord sw, sh;
|
Evas_Coord sw, sh;
|
||||||
|
|
||||||
o = e_widget_list_add(pg->evas, 1, 0);
|
o = e_widget_list_add(pg->evas, 1, 0);
|
||||||
e_wizard_title_set(_("Sizing"));
|
api->wizard_title_set(_("Sizing"));
|
||||||
|
|
||||||
of = e_widget_frametable_add(pg->evas, _("Select preferred size"), 1);
|
of = e_widget_frametable_add(pg->evas, _("Select preferred size"), 1);
|
||||||
e_widget_frametable_content_align_set(of, 0.5, 0.5);
|
e_widget_frametable_content_align_set(of, 0.5, 0.5);
|
||||||
|
@ -165,9 +166,9 @@ wizard_page_show(E_Wizard_Page *pg)
|
||||||
evas_object_show(ob);
|
evas_object_show(ob);
|
||||||
evas_object_show(of);
|
evas_object_show(of);
|
||||||
|
|
||||||
e_wizard_button_next_enable_set(1);
|
api->wizard_button_next_enable_set(1);
|
||||||
|
|
||||||
e_wizard_page_show(o);
|
api->wizard_page_show(o);
|
||||||
// pg->data = o;
|
// pg->data = o;
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Ask about focus mode */
|
/* Ask about focus mode */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static int focus_mode = 1;
|
static int focus_mode = 1;
|
||||||
/*
|
/*
|
||||||
|
@ -22,7 +23,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
|
|
||||||
if (e_config->focus_policy == E_FOCUS_CLICK) focus_mode = 0;
|
if (e_config->focus_policy == E_FOCUS_CLICK) focus_mode = 0;
|
||||||
|
|
||||||
e_wizard_title_set(_("Window Focus"));
|
api->wizard_title_set(_("Window Focus"));
|
||||||
|
|
||||||
of = elm_frame_add(e_comp->elm);
|
of = elm_frame_add(e_comp->elm);
|
||||||
elm_object_text_set(of, _("Focus:"));
|
elm_object_text_set(of, _("Focus:"));
|
||||||
|
@ -46,7 +47,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
elm_object_text_set(ob, _("Whenever the mouse enters a window"));
|
elm_object_text_set(ob, _("Whenever the mouse enters a window"));
|
||||||
elm_radio_state_value_set(ob, 1);
|
elm_radio_state_value_set(ob, 1);
|
||||||
|
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
// pg->data = o;
|
// pg->data = o;
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* ask about policy mouse binding modifiers */
|
/* ask about policy mouse binding modifiers */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static Eina_Bool shift;
|
static Eina_Bool shift;
|
||||||
static Eina_Bool ctrl;
|
static Eina_Bool ctrl;
|
||||||
|
@ -38,7 +39,7 @@ modifiers_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
binding |= (1 << i);
|
binding |= (1 << i);
|
||||||
if (binding == current) return;
|
if (binding == current) return;
|
||||||
current = binding;
|
current = binding;
|
||||||
e_wizard_button_next_enable_set(!!current);
|
api->wizard_button_next_enable_set(!!current);
|
||||||
if (!current) return;
|
if (!current) return;
|
||||||
EINA_LIST_FOREACH(e_bindings->mouse_bindings, l, ebm)
|
EINA_LIST_FOREACH(e_bindings->mouse_bindings, l, ebm)
|
||||||
if (eina_streq(ebm->action, "window_move") ||
|
if (eina_streq(ebm->action, "window_move") ||
|
||||||
|
@ -81,7 +82,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!current) return 0;
|
if (!current) return 0;
|
||||||
e_wizard_title_set(_("Mouse Modifiers"));
|
api->wizard_title_set(_("Mouse Modifiers"));
|
||||||
|
|
||||||
keys[0].val = &shift;
|
keys[0].val = &shift;
|
||||||
keys[1].val = &ctrl;
|
keys[1].val = &ctrl;
|
||||||
|
@ -134,7 +135,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 5; i++)
|
||||||
check_add(o, keys[i].name, keys[i].val);
|
check_add(o, keys[i].name, keys[i].val);
|
||||||
|
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
|
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */return 1;
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Setup of default icon theme */
|
/* Setup of default icon theme */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
E_API int
|
E_API int
|
||||||
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons)
|
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Ibar setup */
|
/* Ibar setup */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
E_API int
|
E_API int
|
||||||
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops, Eina_Bool *need_xdg_icons EINA_UNUSED)
|
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops, Eina_Bool *need_xdg_icons EINA_UNUSED)
|
||||||
|
@ -20,7 +21,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
FILE *f, *fin;
|
FILE *f, *fin;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/def-ibar.txt", e_wizard_dir_get());
|
snprintf(buf, sizeof(buf), "%s/def-ibar.txt", api->wizard_dir_get());
|
||||||
fin = fopen(buf, "r");
|
fin = fopen(buf, "r");
|
||||||
if (!fin) return 0;
|
if (!fin) return 0;
|
||||||
e_user_dir_concat_static(buf, "applications/bar/default");
|
e_user_dir_concat_static(buf, "applications/bar/default");
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Setup if we need battery? */
|
/* Setup if we need battery? */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Setup if we need cpufreq? */
|
/* Setup if we need cpufreq? */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
/* Setup if we need connman? */
|
/* Setup if we need connman? */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_recommend_connman(E_Wizard_Page *pg EINA_UNUSED)
|
_recommend_connman(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Evas_Object *of, *ob;
|
Evas_Object *of, *ob;
|
||||||
|
|
||||||
e_wizard_title_set(_("Network Management"));
|
api->wizard_title_set(_("Network Management"));
|
||||||
|
|
||||||
of = elm_frame_add(e_comp->elm);
|
of = elm_frame_add(e_comp->elm);
|
||||||
ob = elm_label_add(of);
|
ob = elm_label_add(of);
|
||||||
|
@ -23,10 +24,10 @@ _recommend_connman(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
evas_object_show(ob);
|
evas_object_show(ob);
|
||||||
evas_object_show(of);
|
evas_object_show(of);
|
||||||
|
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
// pg->data = o;
|
// pg->data = o;
|
||||||
|
|
||||||
e_wizard_button_next_enable_set(1);
|
api->wizard_button_next_enable_set(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eldbus_Connection *conn;
|
static Eldbus_Connection *conn;
|
||||||
|
@ -63,7 +64,7 @@ _connman_fail(void *data)
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_page_next_call(void *data EINA_UNUSED)
|
_page_next_call(void *data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
e_wizard_next();
|
api->wizard_next();
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ _check_connman_owner(void *data, const Eldbus_Message *msg,
|
||||||
if (id[0] != ':')
|
if (id[0] != ':')
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
e_wizard_button_next_enable_set(1);
|
api->wizard_button_next_enable_set(1);
|
||||||
ecore_idler_add(_page_next_call, NULL);
|
ecore_idler_add(_page_next_call, NULL);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -129,7 +130,7 @@ wizard_page_show(E_Wizard_Page *pg)
|
||||||
ecore_timer_del(connman_timeout);
|
ecore_timer_del(connman_timeout);
|
||||||
connman_timeout = ecore_timer_loop_add(0.5, _connman_fail, pg);
|
connman_timeout = ecore_timer_loop_add(0.5, _connman_fail, pg);
|
||||||
have_connman = EINA_TRUE;
|
have_connman = EINA_TRUE;
|
||||||
e_wizard_button_next_enable_set(0);
|
api->wizard_button_next_enable_set(0);
|
||||||
}
|
}
|
||||||
if (!have_connman)
|
if (!have_connman)
|
||||||
{
|
{
|
||||||
|
@ -150,7 +151,7 @@ wizard_page_show(E_Wizard_Page *pg)
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
_recommend_connman(pg);
|
_recommend_connman(pg);
|
||||||
}
|
}
|
||||||
e_wizard_title_set(_("Checking to see if Connman exists"));
|
api->wizard_title_set(_("Checking to see if Connman exists"));
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Setup if we need temperature? */
|
/* Setup if we need temperature? */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Setup if we need backlight? */
|
/* Setup if we need backlight? */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
/*
|
/*
|
||||||
E_API int
|
E_API int
|
||||||
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED)
|
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Ask about compositing */
|
/* Ask about compositing */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
#include <Evas_GL.h>
|
#include <Evas_GL.h>
|
||||||
|
|
||||||
static Eina_Bool do_gl = 0;
|
static Eina_Bool do_gl = 0;
|
||||||
|
@ -25,7 +26,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Evas_Object *o, *of;
|
Evas_Object *o, *of;
|
||||||
|
|
||||||
e_wizard_title_set(_("Compositing"));
|
api->wizard_title_set(_("Compositing"));
|
||||||
|
|
||||||
of = elm_frame_add(e_comp->elm);
|
of = elm_frame_add(e_comp->elm);
|
||||||
elm_object_text_set(of, _("Settings"));
|
elm_object_text_set(of, _("Settings"));
|
||||||
|
@ -53,7 +54,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
check_add(o, _("Disable composite effects"), &disable_effects);
|
check_add(o, _("Disable composite effects"), &disable_effects);
|
||||||
|
|
||||||
evas_object_show(of);
|
evas_object_show(of);
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
|
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Setup favorites and desktop links */
|
/* Setup favorites and desktop links */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
/*
|
/*
|
||||||
E_API int
|
E_API int
|
||||||
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED)
|
wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED)
|
||||||
|
@ -21,13 +22,13 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
|
|
||||||
// make desktop dir
|
// make desktop dir
|
||||||
ecore_file_mkpath(efreet_desktop_dir_get());
|
ecore_file_mkpath(efreet_desktop_dir_get());
|
||||||
snprintf(buf, sizeof(buf), "%s/desktop", e_wizard_dir_get());
|
snprintf(buf, sizeof(buf), "%s/desktop", api->wizard_dir_get());
|
||||||
files = ecore_file_ls(buf);
|
files = ecore_file_ls(buf);
|
||||||
if (!files) return 0;
|
if (!files) return 0;
|
||||||
EINA_LIST_FREE(files, file)
|
EINA_LIST_FREE(files, file)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "%s/desktop/%s",
|
snprintf(buf, sizeof(buf), "%s/desktop/%s",
|
||||||
e_wizard_dir_get(), file);
|
api->wizard_dir_get(), file);
|
||||||
snprintf(buf2, sizeof(buf2), "%s/%s",
|
snprintf(buf2, sizeof(buf2), "%s/%s",
|
||||||
efreet_desktop_dir_get(), file);
|
efreet_desktop_dir_get(), file);
|
||||||
ecore_file_cp(buf, buf2);
|
ecore_file_cp(buf, buf2);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Ask about updates checking */
|
/* Ask about updates checking */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static Eina_Bool do_up = 1;
|
static Eina_Bool do_up = 1;
|
||||||
/*
|
/*
|
||||||
|
@ -20,7 +21,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Evas_Object *o, *of, *ob;
|
Evas_Object *o, *of, *ob;
|
||||||
|
|
||||||
e_wizard_title_set(_("Updates"));
|
api->wizard_title_set(_("Updates"));
|
||||||
|
|
||||||
of = elm_frame_add(e_comp->elm);
|
of = elm_frame_add(e_comp->elm);
|
||||||
elm_object_text_set(of, _("Check for available updates"));
|
elm_object_text_set(of, _("Check for available updates"));
|
||||||
|
@ -62,7 +63,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
|
|
||||||
evas_object_show(of);
|
evas_object_show(of);
|
||||||
|
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Setup if user wants Tasks? */
|
/* Setup if user wants Tasks? */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
static Eina_Bool do_tasks = 1;
|
static Eina_Bool do_tasks = 1;
|
||||||
/*
|
/*
|
||||||
|
@ -20,7 +21,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Evas_Object *o, *of, *ob;
|
Evas_Object *o, *of, *ob;
|
||||||
|
|
||||||
e_wizard_title_set(_("Taskbar"));
|
api->wizard_title_set(_("Taskbar"));
|
||||||
|
|
||||||
of = elm_frame_add(e_comp->elm);
|
of = elm_frame_add(e_comp->elm);
|
||||||
elm_object_text_set(of, _("Information"));
|
elm_object_text_set(of, _("Information"));
|
||||||
|
@ -48,7 +49,7 @@ wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
||||||
|
|
||||||
evas_object_show(of);
|
evas_object_show(of);
|
||||||
|
|
||||||
e_wizard_page_show(of);
|
api->wizard_page_show(of);
|
||||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* Delete previous copy of config profile and save new one */
|
/* Delete previous copy of config profile and save new one */
|
||||||
#include "e_wizard.h"
|
#include "e_wizard.h"
|
||||||
|
#include "e_wizard_api.h"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
E_API int
|
E_API int
|
||||||
|
|
Loading…
Reference in New Issue