2012-11-30 06:38:34 -08:00
|
|
|
#include "e_wizard.h"
|
2007-08-12 03:16:26 -07:00
|
|
|
|
|
|
|
/* actual module specifics */
|
2011-08-15 02:21:12 -07:00
|
|
|
E_Module *wiz_module = NULL;
|
2007-08-12 03:16:26 -07:00
|
|
|
|
2007-09-14 20:10:29 -07:00
|
|
|
/*
|
|
|
|
* These are the currently planned wizard pages:
|
2012-06-28 06:12:13 -07:00
|
|
|
*
|
2007-09-14 20:10:29 -07:00
|
|
|
* o == interactive
|
2008-10-24 23:54:38 -07:00
|
|
|
* . == automatic (no gui - none implemented currently)
|
2012-06-28 06:12:13 -07:00
|
|
|
*
|
2008-10-26 02:04:05 -07:00
|
|
|
* * = done
|
|
|
|
* - = code here, but disabled in build
|
2012-06-28 06:12:13 -07:00
|
|
|
*
|
2007-09-14 20:10:29 -07:00
|
|
|
* --- THE LIST
|
2008-10-25 08:33:28 -07:00
|
|
|
* o *ask for language (default selection is current locale).
|
|
|
|
* o *ask for initial profile
|
|
|
|
* o *find XDG app menus/repositories and list them let user choose which
|
2007-09-14 20:10:29 -07:00
|
|
|
* one(s) are to be used.
|
2008-10-26 02:04:05 -07:00
|
|
|
* o -ask for ibar initial app set
|
|
|
|
* o -ask if user wants desktop icons or not (enable fwin module but seed it
|
2008-10-25 22:46:45 -07:00
|
|
|
* with default config icons on desktop and favorites).
|
2008-10-26 02:04:05 -07:00
|
|
|
* o -ask click to focus or sloppy
|
|
|
|
* . *take some of current config (language, fileman, profile) and load
|
2008-10-24 23:54:38 -07:00
|
|
|
* load profile, apply language to it and save, restart e.
|
2012-06-28 06:12:13 -07:00
|
|
|
*
|
2008-10-26 02:04:05 -07:00
|
|
|
* why are some disabled? profiels take care of this and do a better job
|
|
|
|
* at collecting all the things together. for example illume makes no sense
|
|
|
|
* with pointer focus and ibar icons/desktop makes no sense.
|
2007-09-14 20:10:29 -07:00
|
|
|
*/
|
|
|
|
|
2007-08-12 03:16:26 -07:00
|
|
|
/* module setup */
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Module_Api e_modapi =
|
2007-08-12 03:16:26 -07:00
|
|
|
{
|
|
|
|
E_MODULE_API_VERSION,
|
2012-06-28 06:12:13 -07:00
|
|
|
"Wizard"
|
2007-08-12 03:16:26 -07:00
|
|
|
};
|
|
|
|
|
2012-06-28 06:12:13 -07:00
|
|
|
static int
|
2010-08-19 09:52:09 -07:00
|
|
|
_cb_sort_files(char *f1, char *f2)
|
2008-10-25 08:18:48 -07:00
|
|
|
{
|
|
|
|
return strcmp(f1, f2);
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void *
|
2007-08-12 03:16:26 -07:00
|
|
|
e_modapi_init(E_Module *m)
|
|
|
|
{
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *files;
|
2007-09-14 09:57:01 -07:00
|
|
|
char buf[PATH_MAX];
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
char *file;
|
2015-07-30 10:24:24 -07:00
|
|
|
const char *src_path;
|
2012-06-28 06:12:13 -07:00
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
wiz_module = m;
|
2007-08-12 03:16:26 -07:00
|
|
|
e_wizard_init();
|
2012-06-28 06:12:13 -07:00
|
|
|
|
2012-11-30 02:46:48 -08:00
|
|
|
e_config->scale.use_dpi = 0;
|
|
|
|
e_config->scale.use_custom = 1;
|
|
|
|
e_config->scale.factor = 1.2;
|
|
|
|
e_scale_update();
|
2015-07-30 10:24:24 -07:00
|
|
|
src_path = getenv("E_MODULE_SRC_PATH");
|
|
|
|
if (src_path)
|
|
|
|
snprintf(buf, sizeof(buf), "%s/.libs", e_module_dir_get(m));
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), "%s/%s", e_module_dir_get(m), MODULE_ARCH);
|
2007-09-14 09:57:01 -07:00
|
|
|
files = ecore_file_ls(buf);
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files);
|
|
|
|
EINA_LIST_FREE(files, file)
|
2011-08-15 02:21:12 -07:00
|
|
|
{
|
2012-11-12 03:52:33 -08:00
|
|
|
if ((!strncmp(file, "page_", 5)) && (eina_str_has_extension(file, ".so")))
|
2011-08-15 02:21:12 -07:00
|
|
|
{
|
|
|
|
void *handle;
|
2012-06-28 06:12:13 -07:00
|
|
|
|
2015-07-30 10:24:24 -07:00
|
|
|
if (src_path)
|
|
|
|
snprintf(buf, sizeof(buf), "%s/.libs/%s", e_module_dir_get(m), file);
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), "%s/%s/%s",
|
|
|
|
e_module_dir_get(m), MODULE_ARCH, file);
|
2011-08-15 02:21:12 -07:00
|
|
|
handle = dlopen(buf, RTLD_NOW | RTLD_GLOBAL);
|
|
|
|
if (handle)
|
2012-06-28 06:12:13 -07:00
|
|
|
e_wizard_page_add(handle,
|
|
|
|
dlsym(handle, "wizard_page_init"),
|
|
|
|
dlsym(handle, "wizard_page_shutdown"),
|
|
|
|
dlsym(handle, "wizard_page_show"),
|
|
|
|
dlsym(handle, "wizard_page_hide"),
|
|
|
|
dlsym(handle, "wizard_page_apply"));
|
2011-08-15 02:21:12 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// if its an executable...
|
|
|
|
// XXX
|
|
|
|
// else...
|
|
|
|
printf("%s\n", dlerror());
|
|
|
|
}
|
|
|
|
}
|
2012-06-28 06:12:13 -07:00
|
|
|
free(file);
|
2007-09-14 09:57:01 -07:00
|
|
|
}
|
2007-09-13 06:56:36 -07:00
|
|
|
e_wizard_go();
|
2012-06-28 06:12:13 -07:00
|
|
|
|
2007-08-12 03:16:26 -07:00
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2015-03-18 15:09:09 -07:00
|
|
|
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
2007-08-12 03:16:26 -07:00
|
|
|
{
|
|
|
|
e_wizard_shutdown();
|
2011-08-15 02:21:12 -07:00
|
|
|
wiz_module = NULL;
|
2012-06-28 06:12:13 -07:00
|
|
|
// FIXME: wrong place
|
2007-09-14 09:57:01 -07:00
|
|
|
// e_module_disable(m); /* disable - on restart this won't be loaded now */
|
|
|
|
// e_sys_action_do(E_SYS_RESTART, NULL); /* restart e - cleanly try settings */
|
2007-08-12 03:16:26 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2015-03-18 15:09:09 -07:00
|
|
|
e_modapi_save(E_Module *m EINA_UNUSED)
|
2007-08-12 03:16:26 -07:00
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
2012-06-28 06:12:13 -07:00
|
|
|
|