forked from enlightenment/enlightenment
big big big wizard revamp. as per todo list.
SVN revision: 62478
This commit is contained in:
parent
25c30ef7a7
commit
7c9f1888df
2272
config/illume/e.src
2272
config/illume/e.src
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 3.0 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 1.8 KiB |
|
@ -1,5 +1,5 @@
|
|||
[Desktop Entry]
|
||||
Type=Link
|
||||
Name=Computer
|
||||
Name=Computer (Standard Enlightenment)
|
||||
Icon=icon.png
|
||||
Comment=Configuration for devices with keyboards and mice<br>like your average PC Desktop, Laptop or Netbook.
|
||||
Comment=Configuration for devices with keyboards and mice<br>like your average PC Desktop, Laptop or Netbook<br>with Enlightenment's traditional keyboard bindings<br>and mouse controls.
|
||||
|
|
|
@ -875,7 +875,6 @@ data/images/Makefile
|
|||
data/input_methods/Makefile
|
||||
data/themes/Makefile
|
||||
data/themes/images/Makefile
|
||||
data/other/Makefile
|
||||
data/xsession/Makefile
|
||||
data/xsession/enlightenment.desktop
|
||||
data/tools/Makefile
|
||||
|
|
|
@ -2,7 +2,6 @@ MAINTAINERCLEANFILES = Makefile.in
|
|||
SUBDIRS = \
|
||||
images \
|
||||
themes \
|
||||
other \
|
||||
tools \
|
||||
xsession \
|
||||
input_methods \
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
MAINTAINERCLEANFILES = Makefile.in
|
||||
filesdir = $(datadir)/enlightenment/data/other
|
||||
files_DATA = \
|
||||
desktop_files.tar.gz \
|
||||
desktop_order.tar.gz \
|
||||
efm_favorites.tar.gz \
|
||||
icon_example.tar.gz
|
||||
|
||||
EXTRA_DIST = $(files_DATA)
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -26,7 +26,9 @@ module_la_SOURCES = e_mod_main.c \
|
|||
e_mod_comp.c \
|
||||
e_mod_comp.h \
|
||||
e_mod_comp_update.c \
|
||||
e_mod_comp_update.h
|
||||
e_mod_comp_update.h \
|
||||
e_mod_comp_cfdata.c \
|
||||
e_mod_comp_cfdata.h
|
||||
|
||||
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
module_la_LDFLAGS = -module -avoid-version
|
||||
|
|
|
@ -0,0 +1,171 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_comp_cfdata.h"
|
||||
|
||||
EAPI void
|
||||
e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd)
|
||||
{
|
||||
*match_edd = E_CONFIG_DD_NEW("Comp_Match", Match);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Match
|
||||
#define D *match_edd
|
||||
E_CONFIG_VAL(D, T, title, STR);
|
||||
E_CONFIG_VAL(D, T, name, STR);
|
||||
E_CONFIG_VAL(D, T, clas, STR);
|
||||
E_CONFIG_VAL(D, T, role, STR);
|
||||
E_CONFIG_VAL(D, T, primary_type, INT);
|
||||
E_CONFIG_VAL(D, T, borderless, CHAR);
|
||||
E_CONFIG_VAL(D, T, dialog, CHAR);
|
||||
E_CONFIG_VAL(D, T, accepts_focus, CHAR);
|
||||
E_CONFIG_VAL(D, T, vkbd, CHAR);
|
||||
E_CONFIG_VAL(D, T, quickpanel, CHAR);
|
||||
E_CONFIG_VAL(D, T, argb, CHAR);
|
||||
E_CONFIG_VAL(D, T, fullscreen, CHAR);
|
||||
E_CONFIG_VAL(D, T, modal, CHAR);
|
||||
E_CONFIG_VAL(D, T, shadow_style, STR);
|
||||
|
||||
*conf_edd = E_CONFIG_DD_NEW("Comp_Config", Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Config
|
||||
#define D *conf_edd
|
||||
E_CONFIG_VAL(D, T, shadow_file, STR);
|
||||
E_CONFIG_VAL(D, T, shadow_style, STR);
|
||||
E_CONFIG_VAL(D, T, engine, INT);
|
||||
E_CONFIG_VAL(D, T, max_unmapped_pixels, INT);
|
||||
E_CONFIG_VAL(D, T, max_unmapped_time, INT);
|
||||
E_CONFIG_VAL(D, T, min_unmapped_time, INT);
|
||||
E_CONFIG_VAL(D, T, fps_average_range, INT);
|
||||
E_CONFIG_VAL(D, T, fps_corner, UCHAR);
|
||||
E_CONFIG_VAL(D, T, fps_show, UCHAR);
|
||||
E_CONFIG_VAL(D, T, use_shadow, UCHAR);
|
||||
E_CONFIG_VAL(D, T, indirect, UCHAR);
|
||||
E_CONFIG_VAL(D, T, texture_from_pixmap, UCHAR);
|
||||
E_CONFIG_VAL(D, T, lock_fps, UCHAR);
|
||||
E_CONFIG_VAL(D, T, efl_sync, UCHAR);
|
||||
E_CONFIG_VAL(D, T, loose_sync, UCHAR);
|
||||
E_CONFIG_VAL(D, T, grab, UCHAR);
|
||||
E_CONFIG_VAL(D, T, vsync, UCHAR);
|
||||
E_CONFIG_VAL(D, T, keep_unmapped, UCHAR);
|
||||
E_CONFIG_VAL(D, T, send_flush, UCHAR);
|
||||
E_CONFIG_VAL(D, T, send_dump, UCHAR);
|
||||
E_CONFIG_VAL(D, T, nocomp_fs, UCHAR);
|
||||
E_CONFIG_VAL(D, T, smooth_windows, UCHAR);
|
||||
E_CONFIG_VAL(D, T, first_draw_delay, DOUBLE);
|
||||
E_CONFIG_LIST(D, T, match.popups, *match_edd);
|
||||
E_CONFIG_LIST(D, T, match.borders, *match_edd);
|
||||
E_CONFIG_LIST(D, T, match.overrides, *match_edd);
|
||||
E_CONFIG_LIST(D, T, match.menus, *match_edd);
|
||||
}
|
||||
|
||||
EAPI Config *
|
||||
e_mod_comp_cfdata_config_new(void)
|
||||
{
|
||||
Config *cfg;
|
||||
Match *mat;
|
||||
|
||||
cfg = E_NEW(Config, 1);
|
||||
cfg->shadow_file = NULL;
|
||||
cfg->shadow_style = eina_stringshare_add("default");
|
||||
cfg->engine = E_EVAS_ENGINE_SOFTWARE_X11;
|
||||
cfg->max_unmapped_pixels = 32 * 1024; // implement
|
||||
cfg->max_unmapped_time = 10 * 3600; // implement
|
||||
cfg->min_unmapped_time = 5 * 60; // implement
|
||||
cfg->fps_average_range = 30;
|
||||
cfg->fps_corner = 0;
|
||||
cfg->fps_show = 0;
|
||||
cfg->use_shadow = 1;
|
||||
cfg->indirect = 0;
|
||||
cfg->texture_from_pixmap = 1;
|
||||
cfg->lock_fps = 1;
|
||||
cfg->efl_sync = 1;
|
||||
cfg->loose_sync = 1;
|
||||
cfg->grab = 0;
|
||||
cfg->vsync = 1;
|
||||
cfg->keep_unmapped = 1;
|
||||
cfg->send_flush = 1; // implement
|
||||
cfg->send_dump = 1; // implement
|
||||
cfg->nocomp_fs = 1; // buggy
|
||||
cfg->smooth_windows = 0; // 1 if gl, 0 if not
|
||||
cfg->first_draw_delay = 0.15;
|
||||
|
||||
cfg->match.popups = NULL;
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.popups = eina_list_append(cfg->match.popups, mat);
|
||||
mat->name = eina_stringshare_add("shelf");
|
||||
mat->shadow_style = eina_stringshare_add("popup");
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.popups = eina_list_append(cfg->match.popups, mat);
|
||||
mat->shadow_style = eina_stringshare_add("popup");
|
||||
|
||||
cfg->match.borders = NULL;
|
||||
|
||||
cfg->match.overrides = NULL;
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.overrides = eina_list_append(cfg->match.overrides, mat);
|
||||
mat->name = eina_stringshare_add("E");
|
||||
mat->clas = eina_stringshare_add("Background_Window");
|
||||
mat->shadow_style = eina_stringshare_add("none");
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.overrides = eina_list_append(cfg->match.overrides, mat);
|
||||
mat->name = eina_stringshare_add("E");
|
||||
mat->clas = eina_stringshare_add("everything");
|
||||
mat->shadow_style = eina_stringshare_add("everything");
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.overrides = eina_list_append(cfg->match.overrides, mat);
|
||||
mat->primary_type = ECORE_X_WINDOW_TYPE_DROPDOWN_MENU;
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.overrides = eina_list_append(cfg->match.overrides, mat);
|
||||
mat->primary_type = ECORE_X_WINDOW_TYPE_POPUP_MENU;
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.overrides = eina_list_append(cfg->match.overrides, mat);
|
||||
mat->primary_type = ECORE_X_WINDOW_TYPE_COMBO;
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.overrides = eina_list_append(cfg->match.overrides, mat);
|
||||
mat->primary_type = ECORE_X_WINDOW_TYPE_TOOLTIP;
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.overrides = eina_list_append(cfg->match.overrides, mat);
|
||||
mat->shadow_style = eina_stringshare_add("popup");
|
||||
|
||||
cfg->match.menus = NULL;
|
||||
mat = E_NEW(Match, 1);
|
||||
cfg->match.menus = eina_list_append(cfg->match.menus, mat);
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
|
||||
return cfg;
|
||||
}
|
||||
|
||||
static void
|
||||
_match_list_free(Eina_List *list)
|
||||
{
|
||||
Match *m;
|
||||
|
||||
EINA_LIST_FREE(list, m)
|
||||
{
|
||||
if (m->title) eina_stringshare_del(m->title);
|
||||
if (m->name) eina_stringshare_del(m->name);
|
||||
if (m->clas) eina_stringshare_del(m->clas);
|
||||
if (m->role) eina_stringshare_del(m->role);
|
||||
if (m->shadow_style) eina_stringshare_del(m->shadow_style);
|
||||
free(m);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_mod_cfdata_config_free(Config *cfg)
|
||||
{
|
||||
if (cfg->shadow_file) eina_stringshare_del(cfg->shadow_file);
|
||||
if (cfg->shadow_style) eina_stringshare_del(cfg->shadow_style);
|
||||
|
||||
_match_list_free(cfg->match.popups);
|
||||
_match_list_free(cfg->match.borders);
|
||||
_match_list_free(cfg->match.overrides);
|
||||
_match_list_free(cfg->match.menus);
|
||||
|
||||
free(cfg);
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
#ifndef E_MOD_COMP_CFDATA_H
|
||||
#define E_MOD_COMP_CFDATA_H
|
||||
|
||||
typedef struct _Config Config;
|
||||
typedef struct _Match Match;
|
||||
|
||||
struct _Config
|
||||
{
|
||||
const char *shadow_file;
|
||||
const char *shadow_style;
|
||||
int engine;
|
||||
int max_unmapped_pixels;
|
||||
int max_unmapped_time;
|
||||
int min_unmapped_time;
|
||||
int fps_average_range;
|
||||
unsigned char fps_corner;
|
||||
unsigned char fps_show;
|
||||
unsigned char use_shadow;
|
||||
unsigned char indirect;
|
||||
unsigned char texture_from_pixmap;
|
||||
unsigned char lock_fps;
|
||||
unsigned char loose_sync;
|
||||
unsigned char efl_sync;
|
||||
unsigned char grab;
|
||||
unsigned char vsync;
|
||||
unsigned char keep_unmapped;
|
||||
unsigned char send_flush;
|
||||
unsigned char send_dump;
|
||||
unsigned char nocomp_fs;
|
||||
unsigned char smooth_windows;
|
||||
double first_draw_delay;
|
||||
|
||||
struct
|
||||
{
|
||||
Eina_List *popups; // used for e popups
|
||||
Eina_List *borders; // used for borders
|
||||
Eina_List *overrides; // used for client menus, tooltips etc.
|
||||
Eina_List *menus; // used for e menus
|
||||
} match;
|
||||
};
|
||||
|
||||
struct _Match
|
||||
{
|
||||
const char *title; // glob - used for borders, NULL if not to be used
|
||||
const char *name; // glob - used for borders, overrides, popups, NULL if not to be used
|
||||
const char *clas; // glob - used for borders, overrides, NULL if not to be used
|
||||
const char *role; // glob - used for borders
|
||||
|
||||
const char *shadow_style; // shadow style to use
|
||||
|
||||
int primary_type; // Ecore_X_Window_Type - used for borders, overrides, first one found - ECORE_X_WINDOW_TYPE_UNKNOWN if not to be used
|
||||
char borderless; // used for borders, 0 == dont use, 1 == borderless, -1 == not borderless
|
||||
char dialog; // used for borders, 0 == don't use, 1 == dialog, -1 == not dialog
|
||||
char accepts_focus; // used for borders, 0 == don't use, 1 == accepts focus, -1 == does not accept focus
|
||||
char vkbd; // used for borders, 0 == don't use, 1 == is vkbd, -1 == not vkbd
|
||||
char quickpanel; // used for borders, 0 == don't use, 1 == is quickpanel, -1 == not quickpanel
|
||||
char argb; // used for borders, overrides, popups, menus, 0 == don't use, 1 == is argb, -1 == not argb
|
||||
char fullscreen; // used for borders, 0 == don't use, 1 == is fullscreen, -1 == not fullscreen
|
||||
char modal; // used for borders, 0 == don't use, 1 == is modal, -1 == not modal
|
||||
};
|
||||
|
||||
EAPI void e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd);
|
||||
EAPI Config *e_mod_comp_cfdata_config_new(void);
|
||||
EAPI void e_mod_cfdata_config_free(Config *cfg);
|
||||
|
||||
#endif
|
|
@ -43,58 +43,9 @@ e_modapi_init(E_Module *m)
|
|||
e_configure_registry_item_add("appearance/comp", 120, _("Composite"), NULL,
|
||||
buf, e_int_config_comp_module);
|
||||
|
||||
mod->conf_match_edd = E_CONFIG_DD_NEW("Comp_Match", Match);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Match
|
||||
#define D mod->conf_match_edd
|
||||
E_CONFIG_VAL(D, T, title, STR);
|
||||
E_CONFIG_VAL(D, T, name, STR);
|
||||
E_CONFIG_VAL(D, T, clas, STR);
|
||||
E_CONFIG_VAL(D, T, role, STR);
|
||||
E_CONFIG_VAL(D, T, primary_type, INT);
|
||||
E_CONFIG_VAL(D, T, borderless, CHAR);
|
||||
E_CONFIG_VAL(D, T, dialog, CHAR);
|
||||
E_CONFIG_VAL(D, T, accepts_focus, CHAR);
|
||||
E_CONFIG_VAL(D, T, vkbd, CHAR);
|
||||
E_CONFIG_VAL(D, T, quickpanel, CHAR);
|
||||
E_CONFIG_VAL(D, T, argb, CHAR);
|
||||
E_CONFIG_VAL(D, T, fullscreen, CHAR);
|
||||
E_CONFIG_VAL(D, T, modal, CHAR);
|
||||
E_CONFIG_VAL(D, T, shadow_style, STR);
|
||||
|
||||
mod->conf_edd = E_CONFIG_DD_NEW("Comp_Config", Config);
|
||||
#undef T
|
||||
#undef D
|
||||
#define T Config
|
||||
#define D mod->conf_edd
|
||||
E_CONFIG_VAL(D, T, shadow_file, STR);
|
||||
E_CONFIG_VAL(D, T, shadow_style, STR);
|
||||
E_CONFIG_VAL(D, T, engine, INT);
|
||||
E_CONFIG_VAL(D, T, max_unmapped_pixels, INT);
|
||||
E_CONFIG_VAL(D, T, max_unmapped_time, INT);
|
||||
E_CONFIG_VAL(D, T, min_unmapped_time, INT);
|
||||
E_CONFIG_VAL(D, T, fps_average_range, INT);
|
||||
E_CONFIG_VAL(D, T, fps_corner, UCHAR);
|
||||
E_CONFIG_VAL(D, T, fps_show, UCHAR);
|
||||
E_CONFIG_VAL(D, T, use_shadow, UCHAR);
|
||||
E_CONFIG_VAL(D, T, indirect, UCHAR);
|
||||
E_CONFIG_VAL(D, T, texture_from_pixmap, UCHAR);
|
||||
E_CONFIG_VAL(D, T, lock_fps, UCHAR);
|
||||
E_CONFIG_VAL(D, T, efl_sync, UCHAR);
|
||||
E_CONFIG_VAL(D, T, loose_sync, UCHAR);
|
||||
E_CONFIG_VAL(D, T, grab, UCHAR);
|
||||
E_CONFIG_VAL(D, T, vsync, UCHAR);
|
||||
E_CONFIG_VAL(D, T, keep_unmapped, UCHAR);
|
||||
E_CONFIG_VAL(D, T, send_flush, UCHAR);
|
||||
E_CONFIG_VAL(D, T, send_dump, UCHAR);
|
||||
E_CONFIG_VAL(D, T, nocomp_fs, UCHAR);
|
||||
E_CONFIG_VAL(D, T, smooth_windows, UCHAR);
|
||||
E_CONFIG_VAL(D, T, first_draw_delay, DOUBLE);
|
||||
E_CONFIG_LIST(D, T, match.popups, mod->conf_match_edd);
|
||||
E_CONFIG_LIST(D, T, match.borders, mod->conf_match_edd);
|
||||
E_CONFIG_LIST(D, T, match.overrides, mod->conf_match_edd);
|
||||
E_CONFIG_LIST(D, T, match.menus, mod->conf_match_edd);
|
||||
e_mod_comp_cfdata_edd_init(&(mod->conf_edd),
|
||||
&(mod->conf_match_edd));
|
||||
|
||||
|
||||
mod->conf = e_config_domain_load("module.comp", mod->conf_edd);
|
||||
if (!mod->conf) _e_mod_config_new(m);
|
||||
|
@ -118,7 +69,7 @@ e_modapi_init(E_Module *m)
|
|||
|
||||
/* XXX: update old configs. add config versioning */
|
||||
if (mod->conf->first_draw_delay == 0)
|
||||
mod->conf->first_draw_delay = 0.05;
|
||||
mod->conf->first_draw_delay = 0.20;
|
||||
|
||||
_comp_mod = mod;
|
||||
|
||||
|
@ -136,95 +87,8 @@ void
|
|||
_e_mod_config_new(E_Module *m)
|
||||
{
|
||||
Mod *mod = m->data;
|
||||
Match *mat;
|
||||
|
||||
mod->conf = E_NEW(Config, 1);
|
||||
mod->conf->shadow_file = NULL;
|
||||
mod->conf->shadow_style = eina_stringshare_add("default");
|
||||
mod->conf->engine = E_EVAS_ENGINE_SOFTWARE_X11;
|
||||
mod->conf->max_unmapped_pixels = 32 * 1024; // implement
|
||||
mod->conf->max_unmapped_time = 10 * 3600; // implement
|
||||
mod->conf->min_unmapped_time = 5 * 60; // implement
|
||||
mod->conf->fps_average_range = 30;
|
||||
mod->conf->fps_corner = 0;
|
||||
mod->conf->fps_show = 0;
|
||||
mod->conf->use_shadow = 1;
|
||||
mod->conf->indirect = 0;
|
||||
mod->conf->texture_from_pixmap = 0;
|
||||
mod->conf->lock_fps = 0;
|
||||
mod->conf->efl_sync = 1;
|
||||
mod->conf->loose_sync = 1;
|
||||
mod->conf->grab = 0;
|
||||
mod->conf->vsync = 1;
|
||||
mod->conf->keep_unmapped = 1;
|
||||
mod->conf->send_flush = 1; // implement
|
||||
mod->conf->send_dump = 0; // implement
|
||||
mod->conf->nocomp_fs = 0; // buggy
|
||||
mod->conf->smooth_windows = 0;
|
||||
mod->conf->first_draw_delay = 0.05;
|
||||
|
||||
mod->conf->match.popups = NULL;
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.popups = eina_list_append(mod->conf->match.popups, mat);
|
||||
mat->name = eina_stringshare_add("shelf");
|
||||
mat->shadow_style = eina_stringshare_add("still");
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.popups = eina_list_append(mod->conf->match.popups, mat);
|
||||
mat->shadow_style = eina_stringshare_add("popup");
|
||||
|
||||
mod->conf->match.borders = NULL;
|
||||
|
||||
mod->conf->match.overrides = NULL;
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.overrides = eina_list_append(mod->conf->match.overrides, mat);
|
||||
mat->name = eina_stringshare_add("E");
|
||||
mat->clas = eina_stringshare_add("Background_Window");
|
||||
mat->shadow_style = eina_stringshare_add("none");
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.overrides = eina_list_append(mod->conf->match.overrides, mat);
|
||||
mat->name = eina_stringshare_add("E");
|
||||
mat->clas = eina_stringshare_add("everything");
|
||||
mat->shadow_style = eina_stringshare_add("everything");
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.overrides = eina_list_append(mod->conf->match.overrides, mat);
|
||||
mat->primary_type = ECORE_X_WINDOW_TYPE_DROPDOWN_MENU;
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.overrides = eina_list_append(mod->conf->match.overrides, mat);
|
||||
mat->primary_type = ECORE_X_WINDOW_TYPE_POPUP_MENU;
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.overrides = eina_list_append(mod->conf->match.overrides, mat);
|
||||
mat->primary_type = ECORE_X_WINDOW_TYPE_COMBO;
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.overrides = eina_list_append(mod->conf->match.overrides, mat);
|
||||
mat->primary_type = ECORE_X_WINDOW_TYPE_TOOLTIP;
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.overrides = eina_list_append(mod->conf->match.overrides, mat);
|
||||
mat->shadow_style = eina_stringshare_add("popup");
|
||||
|
||||
mod->conf->match.menus = NULL;
|
||||
mat = E_NEW(Match, 1);
|
||||
mod->conf->match.menus = eina_list_append(mod->conf->match.menus, mat);
|
||||
mat->shadow_style = eina_stringshare_add("menu");
|
||||
}
|
||||
|
||||
static void
|
||||
_match_list_free(Eina_List *list)
|
||||
{
|
||||
Match *m;
|
||||
|
||||
EINA_LIST_FREE(list, m)
|
||||
{
|
||||
if (m->title) eina_stringshare_del(m->title);
|
||||
if (m->name) eina_stringshare_del(m->name);
|
||||
if (m->clas) eina_stringshare_del(m->clas);
|
||||
if (m->role) eina_stringshare_del(m->role);
|
||||
if (m->shadow_style) eina_stringshare_del(m->shadow_style);
|
||||
free(m);
|
||||
}
|
||||
mod->conf = e_mod_comp_cfdata_config_new();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -232,15 +96,7 @@ _e_mod_config_free(E_Module *m)
|
|||
{
|
||||
Mod *mod = m->data;
|
||||
|
||||
if (mod->conf->shadow_file) eina_stringshare_del(mod->conf->shadow_file);
|
||||
if (mod->conf->shadow_style) eina_stringshare_del(mod->conf->shadow_style);
|
||||
|
||||
_match_list_free(mod->conf->match.popups);
|
||||
_match_list_free(mod->conf->match.borders);
|
||||
_match_list_free(mod->conf->match.overrides);
|
||||
_match_list_free(mod->conf->match.menus);
|
||||
|
||||
free(mod->conf);
|
||||
e_mod_cfdata_config_free(mod->conf);
|
||||
mod->conf = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,46 +1,10 @@
|
|||
#ifndef E_MOD_MAIN_H
|
||||
#define E_MOD_MAIN_H
|
||||
|
||||
typedef struct _Config Config;
|
||||
#include "e_mod_comp_cfdata.h"
|
||||
|
||||
typedef struct _Mod Mod;
|
||||
|
||||
typedef struct _Match Match;
|
||||
|
||||
struct _Config
|
||||
{
|
||||
const char *shadow_file;
|
||||
const char *shadow_style;
|
||||
int engine;
|
||||
int max_unmapped_pixels;
|
||||
int max_unmapped_time;
|
||||
int min_unmapped_time;
|
||||
int fps_average_range;
|
||||
unsigned char fps_corner;
|
||||
unsigned char fps_show;
|
||||
unsigned char use_shadow;
|
||||
unsigned char indirect;
|
||||
unsigned char texture_from_pixmap;
|
||||
unsigned char lock_fps;
|
||||
unsigned char loose_sync;
|
||||
unsigned char efl_sync;
|
||||
unsigned char grab;
|
||||
unsigned char vsync;
|
||||
unsigned char keep_unmapped;
|
||||
unsigned char send_flush;
|
||||
unsigned char send_dump;
|
||||
unsigned char nocomp_fs;
|
||||
unsigned char smooth_windows;
|
||||
double first_draw_delay;
|
||||
|
||||
struct
|
||||
{
|
||||
Eina_List *popups; // used for e popups
|
||||
Eina_List *borders; // used for borders
|
||||
Eina_List *overrides; // used for client menus, tooltips etc.
|
||||
Eina_List *menus; // used for e menus
|
||||
} match;
|
||||
};
|
||||
|
||||
struct _Mod
|
||||
{
|
||||
E_Module *module;
|
||||
|
@ -52,26 +16,6 @@ struct _Mod
|
|||
E_Config_Dialog *config_dialog;
|
||||
};
|
||||
|
||||
struct _Match
|
||||
{
|
||||
const char *title; // glob - used for borders, NULL if not to be used
|
||||
const char *name; // glob - used for borders, overrides, popups, NULL if not to be used
|
||||
const char *clas; // glob - used for borders, overrides, NULL if not to be used
|
||||
const char *role; // glob - used for borders
|
||||
|
||||
const char *shadow_style; // shadow style to use
|
||||
|
||||
int primary_type; // Ecore_X_Window_Type - used for borders, overrides, first one found - ECORE_X_WINDOW_TYPE_UNKNOWN if not to be used
|
||||
char borderless; // used for borders, 0 == dont use, 1 == borderless, -1 == not borderless
|
||||
char dialog; // used for borders, 0 == don't use, 1 == dialog, -1 == not dialog
|
||||
char accepts_focus; // used for borders, 0 == don't use, 1 == accepts focus, -1 == does not accept focus
|
||||
char vkbd; // used for borders, 0 == don't use, 1 == is vkbd, -1 == not vkbd
|
||||
char quickpanel; // used for borders, 0 == don't use, 1 == is quickpanel, -1 == not quickpanel
|
||||
char argb; // used for borders, overrides, popups, menus, 0 == don't use, 1 == is argb, -1 == not argb
|
||||
char fullscreen; // used for borders, 0 == don't use, 1 == is fullscreen, -1 == not fullscreen
|
||||
char modal; // used for borders, 0 == don't use, 1 == is modal, -1 == not modal
|
||||
};
|
||||
|
||||
extern Mod *_comp_mod;
|
||||
|
||||
EAPI extern E_Module_Api e_modapi;
|
||||
|
|
|
@ -3,11 +3,35 @@ MODULE = wizard
|
|||
|
||||
# data files for the module
|
||||
filesdir = $(libdir)/enlightenment/modules/$(MODULE)
|
||||
files_DATA = \
|
||||
data/def-ibar.txt
|
||||
|
||||
desksdir = $(libdir)/enlightenment/modules/$(MODULE)/extra_desktops
|
||||
desks_DATA = \
|
||||
data/extra_desktops/mplayer.desktop \
|
||||
data/extra_desktops/xterm.desktop
|
||||
|
||||
favsdir = $(libdir)/enlightenment/modules/$(MODULE)/favorites
|
||||
favs_DATA = \
|
||||
data/favorites/.order \
|
||||
data/favorites/desktop.desktop \
|
||||
data/favorites/home.desktop \
|
||||
data/favorites/root.desktop \
|
||||
data/favorites/tmp.desktop
|
||||
|
||||
desktopdir = $(libdir)/enlightenment/modules/$(MODULE)/desktop
|
||||
desktop_DATA = \
|
||||
data/desktop/home.desktop \
|
||||
data/desktop/root.desktop \
|
||||
data/desktop/tmp.desktop
|
||||
|
||||
### dont install these - this way e wont list the module for people to
|
||||
# accidentally load
|
||||
#files_DATA = \
|
||||
# e-module-$(MODULE).edj
|
||||
# module.desktop
|
||||
|
||||
EXTRA_DIST = $(files_DATA) page_040.c page_050.c page_060.c
|
||||
EXTRA_DIST = $(files_DATA) $(desks_DATA)
|
||||
|
||||
# the module .so file
|
||||
INCLUDES = -I. \
|
||||
|
@ -16,23 +40,30 @@ INCLUDES = -I. \
|
|||
-I$(top_srcdir)/src/bin \
|
||||
-I$(top_builddir)/src/bin \
|
||||
-I$(top_srcdir)/src/modules \
|
||||
@e_cflags@
|
||||
@ECONNMAN_CFLAGS@ \
|
||||
@e_cflags@ \
|
||||
-I$(top_srcdir)/src/modules/comp
|
||||
pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH)
|
||||
pkg_LTLIBRARIES = module.la \
|
||||
page_000.la \
|
||||
page_010.la \
|
||||
page_020.la \
|
||||
page_030.la \
|
||||
page_040.la \
|
||||
page_050.la \
|
||||
page_060.la \
|
||||
page_070.la \
|
||||
page_080.la \
|
||||
page_090.la \
|
||||
page_100.la \
|
||||
page_110.la \
|
||||
page_120.la \
|
||||
page_130.la \
|
||||
page_140.la \
|
||||
page_150.la \
|
||||
page_160.la \
|
||||
page_200.la
|
||||
|
||||
### disabled because profile selector really does the job. code here just for
|
||||
### informational purposes on how to make wizard pages
|
||||
# page_040.la
|
||||
# page_050.la
|
||||
# page_060.la
|
||||
|
||||
module_la_SOURCES = e_mod_main.c \
|
||||
e_mod_main.h \
|
||||
e_wizard.c \
|
||||
|
@ -42,7 +73,7 @@ module_la_LIBADD = @e_libs@ @dlopen_libs@
|
|||
module_la_LDFLAGS = -module -avoid-version
|
||||
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Splash screen
|
||||
#Auto - Splash screen
|
||||
page_000_la_SOURCES = page_000.c
|
||||
page_000_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_000_la_LDFLAGS = -module -avoid-version
|
||||
|
@ -60,39 +91,91 @@ page_020_la_LIBADD = @e_libs@ @dlopen_libs@
|
|||
page_020_la_LDFLAGS = -module -avoid-version
|
||||
page_020_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Choose Menus
|
||||
#Auto - set up menu
|
||||
page_030_la_SOURCES = page_030.c
|
||||
page_030_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_030_la_LDFLAGS = -module -avoid-version
|
||||
page_030_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#page_040_la_SOURCES = page_040.c
|
||||
#page_040_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
#page_040_la_LDFLAGS = -module -avoid-version
|
||||
#page_040_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
#Auto - add new app icons
|
||||
page_040_la_SOURCES = page_040.c
|
||||
page_040_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_040_la_LDFLAGS = -module -avoid-version
|
||||
page_040_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#page_050_la_SOURCES = page_050.c
|
||||
#page_050_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
#page_050_la_LDFLAGS = -module -avoid-version
|
||||
#page_050_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
#Request what scaling to use
|
||||
page_050_la_SOURCES = page_050.c
|
||||
page_050_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_050_la_LDFLAGS = -module -avoid-version
|
||||
page_050_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#page_060_la_SOURCES = page_060.c
|
||||
#page_060_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
#page_060_la_LDFLAGS = -module -avoid-version
|
||||
#page_060_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
#Request which focus style to use
|
||||
page_060_la_SOURCES = page_060.c
|
||||
page_060_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_060_la_LDFLAGS = -module -avoid-version
|
||||
page_060_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Choose appliactions
|
||||
#Auto - Figure out icon theme to use
|
||||
page_070_la_SOURCES = page_070.c
|
||||
page_070_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_070_la_LDFLAGS = -module -avoid-version
|
||||
page_070_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Choose quick launch
|
||||
#Auto - fill ibar
|
||||
page_080_la_SOURCES = page_080.c
|
||||
page_080_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_080_la_LDFLAGS = -module -avoid-version
|
||||
page_080_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto - do we need battery?
|
||||
page_090_la_SOURCES = page_090.c
|
||||
page_090_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_090_la_LDFLAGS = -module -avoid-version
|
||||
page_090_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto - do we need cpufreq?
|
||||
page_100_la_SOURCES = page_100.c
|
||||
page_100_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_100_la_LDFLAGS = -module -avoid-version
|
||||
page_100_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto+feedback - do we need connman?
|
||||
page_110_la_SOURCES = page_110.c
|
||||
page_110_la_LIBADD = @e_libs@ @dlopen_libs@ @ECONNMAN_LIBS@
|
||||
page_110_la_LDFLAGS = -module -avoid-version
|
||||
page_110_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto - do we need temperature?
|
||||
page_120_la_SOURCES = page_120.c
|
||||
page_120_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_120_la_LDFLAGS = -module -avoid-version
|
||||
page_120_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto - do we need backlight?
|
||||
page_130_la_SOURCES = page_130.c
|
||||
page_130_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_130_la_LDFLAGS = -module -avoid-version
|
||||
page_130_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto - do we need temperature?
|
||||
page_140_la_SOURCES = page_140.c
|
||||
page_140_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_140_la_LDFLAGS = -module -avoid-version
|
||||
page_140_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto - do we need temperature?
|
||||
page_150_la_SOURCES = page_150.c $(top_srcdir)/src/modules/comp/e_mod_comp_cfdata.c
|
||||
page_150_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_150_la_LDFLAGS = -module -avoid-version
|
||||
page_150_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto - install favorites and ~/Desktop and entries
|
||||
page_160_la_SOURCES = page_160.c
|
||||
page_160_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_160_la_LDFLAGS = -module -avoid-version
|
||||
page_160_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
#Auto - finish up applying
|
||||
page_200_la_SOURCES = page_200.c
|
||||
page_200_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
page_200_la_LDFLAGS = -module -avoid-version
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
# list of desktop files to put in ibar by default minus the .desktop extension
|
||||
# each line is 1 entry in ibar and it is a list of desktop files to
|
||||
# look for in order of preference - first found is put in to ibar
|
||||
|
||||
xterm rxvt urxvt gnome-terminal konsole xfce4-terminal exo-terminal-emulator lxde-x-terminal-emulator lxterminal mlterm roxterm Terminal terminator vala-terminal
|
||||
sylpheed claws-mail thunderbird evolution KMail
|
||||
firefox iceweasel chromium-browser eve epiphany midori konqueror opera rekonq dooble
|
||||
xchat pidgin konversation kvirc loqui lostirc quassel qutim
|
||||
enjoy banshee rhythmbox amarok listen audacious xmms2
|
||||
gimp
|
||||
inkscape
|
||||
libreoffice-startcenter openoffice.org-startcenter koffice
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Home
|
||||
Comment=The Directory containing all your personal files
|
||||
Comment[it]=La directory contenente i vostri file personali
|
||||
Comment[fr]=Le dossier contenant vos fichiers personnels
|
||||
Type=Link
|
||||
X-Enlightenment-Type=Mount
|
||||
URL=file:$HOME
|
||||
Icon=user-home
|
||||
NotShowIn=GNOME;KDE;LXDE;ROX;XFCE;
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Root
|
||||
Comment=The Root Filesystem base
|
||||
Comment[it]=Il filesystem principale
|
||||
Comment[fr]=Le système de fichiers à la base
|
||||
Type=Link
|
||||
X-Enlightenment-Type=Mount
|
||||
URL=file:/
|
||||
Icon=computer
|
||||
NotShowIn=GNOME;KDE;LXDE;ROX;XFCE;
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Temp
|
||||
Comment=Temporary files
|
||||
Comment[it]=File temporanei
|
||||
Comment[fr]=Les fichiers temporaires
|
||||
Type=Link
|
||||
X-Enlightenment-Type=Mount
|
||||
URL=file:/tmp
|
||||
Icon=user-temp
|
||||
NotShowIn=GNOME;KDE;LXDE;ROX;XFCE;
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Application
|
||||
Name=MPlayer
|
||||
GenericName=Movie Player
|
||||
Comment=Watch movies and videos
|
||||
Exec=mplayer %U
|
||||
Icon=video_player.png
|
||||
StartupWMClass=MPlayer
|
||||
Categories=Application;AudioVideo;Player;
|
||||
MimeType=application/mxf;application/ogg;application/ram;application/sdp;application/smil;application/smil+xml;application/vnd.ms-wpl;application/vnd.rn-realmedia;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-flash-video;application/x-matroska;application/x-netshow-channel;application/x-ogg;application/x-quicktime-media-link;application/x-quicktimeplayer;application/x-shorten;application/x-smil;application/xspf+xml;audio/3gpp;audio/ac3;audio/AMR;audio/AMR-WB;audio/basic;audio/midi;audio/mp4;audio/mpeg;audio/mpegurl;audio/ogg;audio/prs.sid;audio/vnd.rn-realaudio;audio/x-aiff;audio/x-ape;audio/x-flac;audio/x-gsm;audio/x-it;audio/x-m4a;audio/x-matroska;audio/x-mod;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;audio/x-ms-wma;audio/x-musepack;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;audio/x-pn-wav;audio/x-pn-windows-acm;audio/x-realaudio;audio/x-real-audio;audio/x-sbc;audio/x-scpls;audio/x-speex;audio/x-tta;audio/x-wav;audio/x-wavpack;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-xm;image/vnd.rn-realpix;image/x-pict;misc/ultravox;text/google-video-pointer;text/x-google-video-pointer;video/3gpp;video/dv;video/fli;video/flv;video/mp2t;video/mp4;video/mp4v-es;video/mpeg;video/msvideo;video/ogg;video/quicktime;video/vivo;video/vnd.divx;video/vnd.rn-realvideo;video/vnd.vivo;video/webm;video/x-anim;video/x-avi;video/x-flc;video/x-fli;video/x-flic;video/x-flv;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-ms-asf;video/x-ms-asx;video/x-msvideo;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-nsv;video/x-ogm+ogg;video/x-theora+ogg;video/x-totem-stream;x-content/video-dvd;x-content/video-vcd;x-content/video-svcd;
|
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Application
|
||||
Name=XTerm
|
||||
GenericName=Terminal
|
||||
Comment=Run commands in a shell
|
||||
Exec=xterm
|
||||
Icon=xterm.png
|
||||
StartupWMClass=XTerm
|
||||
Categories=Utility;TerminalEmulator;
|
|
@ -0,0 +1,4 @@
|
|||
home.desktop
|
||||
desktop.desktop
|
||||
root.desktop
|
||||
tmp.desktop
|
|
@ -0,0 +1,12 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Desktop
|
||||
Name[fr]=Bureau
|
||||
Comment=Files on your Desktop
|
||||
Comment[it]=I file sul vostro desktop
|
||||
Comment[fr]=Les fichiers sur votre bureau
|
||||
Type=Link
|
||||
X-Enlightenment-Type=Mount
|
||||
URL=file:$HOME/Desktop
|
||||
Icon=user-desktop
|
||||
NotShowIn=GNOME;KDE;LXDE;ROX;XFCE;
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Home
|
||||
Comment=The Directory containing all your personal files
|
||||
Comment[it]=La directory contenente i vostri file personali
|
||||
Comment[fr]=Le dossier contenant vos fichiers personnels
|
||||
Type=Link
|
||||
X-Enlightenment-Type=Mount
|
||||
URL=file:$HOME
|
||||
Icon=user-home
|
||||
NotShowIn=GNOME;KDE;LXDE;ROX;XFCE;
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Root
|
||||
Comment=The Root Filesystem base
|
||||
Comment[it]=Il filesystem principale
|
||||
Comment[fr]=Le système de fichiers à la base
|
||||
Type=Link
|
||||
X-Enlightenment-Type=Mount
|
||||
URL=file:/
|
||||
Icon=computer
|
||||
NotShowIn=GNOME;KDE;LXDE;ROX;XFCE;
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Name=Temp
|
||||
Comment=Temporary files
|
||||
Comment[it]=File temporanei
|
||||
Comment[fr]=Les fichiers temporaires
|
||||
Type=Link
|
||||
X-Enlightenment-Type=Mount
|
||||
URL=file:/tmp
|
||||
Icon=user-temp
|
||||
NotShowIn=GNOME;KDE;LXDE;ROX;XFCE;
|
|
@ -2,7 +2,7 @@
|
|||
#include "e_mod_main.h"
|
||||
|
||||
/* actual module specifics */
|
||||
static E_Module *conf_module = NULL;
|
||||
E_Module *wiz_module = NULL;
|
||||
|
||||
/*
|
||||
* These are the currently planned wizard pages:
|
||||
|
@ -50,33 +50,36 @@ e_modapi_init(E_Module *m)
|
|||
char buf[PATH_MAX];
|
||||
char *file;
|
||||
|
||||
conf_module = m;
|
||||
wiz_module = m;
|
||||
e_wizard_init();
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/%s", e_module_dir_get(m), MODULE_ARCH);
|
||||
files = ecore_file_ls(buf);
|
||||
files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files);
|
||||
EINA_LIST_FREE(files, file)
|
||||
{
|
||||
if (!strncmp(file, "page_", 5))
|
||||
{
|
||||
void *handle;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/%s/%s",
|
||||
e_module_dir_get(m), MODULE_ARCH, file);
|
||||
handle = dlopen(buf, RTLD_NOW | RTLD_GLOBAL);
|
||||
if (handle)
|
||||
{
|
||||
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"));
|
||||
}
|
||||
else
|
||||
printf("%s\n", dlerror());
|
||||
}
|
||||
{
|
||||
if (!strncmp(file, "page_", 5))
|
||||
{
|
||||
void *handle;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/%s/%s",
|
||||
e_module_dir_get(m), MODULE_ARCH, file);
|
||||
handle = dlopen(buf, RTLD_NOW | RTLD_GLOBAL);
|
||||
if (handle)
|
||||
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"));
|
||||
else
|
||||
{
|
||||
// if its an executable...
|
||||
// XXX
|
||||
// else...
|
||||
printf("%s\n", dlerror());
|
||||
}
|
||||
}
|
||||
free(file);
|
||||
}
|
||||
e_wizard_go();
|
||||
|
@ -88,7 +91,7 @@ EAPI int
|
|||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||
{
|
||||
e_wizard_shutdown();
|
||||
conf_module = NULL;
|
||||
wiz_module = NULL;
|
||||
// FIXME: wrong place
|
||||
// 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 */
|
||||
|
|
|
@ -14,4 +14,6 @@ EAPI void *e_modapi_init (E_Module *m);
|
|||
EAPI int e_modapi_shutdown (E_Module *m);
|
||||
EAPI int e_modapi_save (E_Module *m);
|
||||
|
||||
extern E_Module *wiz_module;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -194,7 +194,10 @@ e_wizard_page_add(void *handle,
|
|||
EAPI void
|
||||
e_wizard_page_del(E_Wizard_Page *pg)
|
||||
{
|
||||
if (pg->handle) dlclose(pg->handle);
|
||||
// rare thing.. if we do e_wizard_next() from a page and we end up finishing
|
||||
// ther page seq.. we cant REALLY dlclose... not a problem as wizard runs
|
||||
// once only then e restarts itself with final wizard page
|
||||
// if (pg->handle) dlclose(pg->handle);
|
||||
pages = eina_list_remove(pages, pg);
|
||||
free(pg);
|
||||
}
|
||||
|
@ -218,6 +221,12 @@ e_wizard_labels_update(void)
|
|||
edje_object_part_text_set(o_bg, "e.text.label", _("Next"));
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
e_wizard_dir_get(void)
|
||||
{
|
||||
return e_module_dir_get(wiz_module);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wizard_next_eval(void)
|
||||
{
|
||||
|
|
|
@ -24,18 +24,18 @@ EAPI void e_wizard_go(void);
|
|||
EAPI void e_wizard_apply(void);
|
||||
EAPI void e_wizard_next(void);
|
||||
EAPI void e_wizard_page_show(Evas_Object *obj);
|
||||
EAPI E_Wizard_Page *
|
||||
e_wizard_page_add(void *handle,
|
||||
int (*init) (E_Wizard_Page *pg),
|
||||
int (*shutdown) (E_Wizard_Page *pg),
|
||||
int (*show) (E_Wizard_Page *pg),
|
||||
int (*hide) (E_Wizard_Page *pg),
|
||||
int (*apply) (E_Wizard_Page *pg)
|
||||
);
|
||||
EAPI E_Wizard_Page *e_wizard_page_add(void *handle,
|
||||
int (*init) (E_Wizard_Page *pg),
|
||||
int (*shutdown) (E_Wizard_Page *pg),
|
||||
int (*show) (E_Wizard_Page *pg),
|
||||
int (*hide) (E_Wizard_Page *pg),
|
||||
int (*apply) (E_Wizard_Page *pg)
|
||||
);
|
||||
EAPI void e_wizard_page_del(E_Wizard_Page *pg);
|
||||
EAPI void e_wizard_button_next_enable_set(int enable);
|
||||
EAPI void e_wizard_title_set(const char *title);
|
||||
EAPI void e_wizard_labels_update(void);
|
||||
|
||||
EAPI const char *e_wizard_dir_get(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -131,9 +131,10 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
|||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
{
|
||||
Evas_Object *o, *of, *ob;
|
||||
Evas_Object *o, *of, *ob, *ic;
|
||||
Eina_List *l;
|
||||
int i, sel = -1;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Language"));
|
||||
|
@ -143,13 +144,13 @@ wizard_page_show(E_Wizard_Page *pg)
|
|||
|
||||
e_widget_ilist_freeze(ob);
|
||||
|
||||
e_widget_ilist_append(ob, NULL, _("System Default"),
|
||||
e_prefix_data_snprintf(buf, sizeof(buf), "data/images/%s", "lang-system.png");
|
||||
ic = e_util_icon_add(buf, pg->evas);
|
||||
e_widget_ilist_append(ob, ic, _("System Default"),
|
||||
NULL, NULL, NULL);
|
||||
for (i = 1, l = blang_list; l; l = l->next, i++)
|
||||
{
|
||||
E_Intl_Pair *pair;
|
||||
Evas_Object *ic;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
pair = l->data;
|
||||
e_prefix_data_snprintf(buf, sizeof(buf), "data/images/%s", pair->locale_icon);
|
||||
|
|
|
@ -92,6 +92,7 @@ wizard_page_show(E_Wizard_Page *pg)
|
|||
free(prof);
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(prof, "standard")) sel = i;
|
||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
|
||||
desk = efreet_desktop_new(buf);
|
||||
label = prof;
|
||||
|
@ -135,24 +136,20 @@ wizard_page_show(E_Wizard_Page *pg)
|
|||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
|
||||
evas_object_del(pg->data);
|
||||
// actually apply profile
|
||||
if (e_config_profile_get())
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
if (e_user_dir_snprintf(buf, sizeof(buf), "config/%s",
|
||||
e_config_profile_get()) >= sizeof(buf))
|
||||
return 1;
|
||||
ecore_file_recursive_rm(buf);
|
||||
}
|
||||
if (!profile) profile = "standard";
|
||||
e_config_profile_set(profile);
|
||||
e_config_profile_del(e_config_profile_get());
|
||||
e_config_load();
|
||||
e_config_save();
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
// no need. done in page_070's wizard_page_show()
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,224 +1,38 @@
|
|||
/* Menu chooser */
|
||||
/* Menu setup */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
static const char *xdg_sel = NULL;
|
||||
static Eina_List *menus = NULL;
|
||||
|
||||
static void
|
||||
check_menu_dir(const char *dir)
|
||||
{
|
||||
char buf[PATH_MAX], *file;
|
||||
Eina_List *files;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/menus", dir);
|
||||
files = ecore_file_ls(buf);
|
||||
EINA_LIST_FREE(files, file)
|
||||
{
|
||||
if (e_util_glob_match(file, "*.menu"))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/menus/%s", dir, file);
|
||||
menus = eina_list_append(menus, strdup(buf));
|
||||
}
|
||||
free(file);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
const char *dirs[] =
|
||||
{
|
||||
"/etc/xdg",
|
||||
"/usr/etc/xdg",
|
||||
"/usr/local/etc/xdg",
|
||||
"/usr/opt/etc/xdg",
|
||||
"/usr/opt/xdg",
|
||||
"/usr/local/opt/etc/xdg",
|
||||
"/usr/local/opt/xdg",
|
||||
"/opt/etc/xdg",
|
||||
"/opt/xdg",
|
||||
// FIXME: add more "known locations"
|
||||
NULL
|
||||
};
|
||||
int i, newdir;
|
||||
|
||||
e_user_homedir_concat(buf, sizeof(buf), ".config");
|
||||
check_menu_dir(buf);
|
||||
|
||||
for (i = 0; dirs[i]; i++) check_menu_dir(dirs[i]);
|
||||
|
||||
newdir = 1;
|
||||
snprintf(buf, sizeof(buf), "%s/etc/xdg", e_prefix_get());
|
||||
for (i = 0; dirs[i]; i++)
|
||||
{
|
||||
if (!strcmp(dirs[i], buf))
|
||||
{
|
||||
newdir = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (newdir) check_menu_dir(buf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
// FIXME: free menus
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
Evas_Object *o, *of, *ob;
|
||||
char *file;
|
||||
int sel = -1, i = 0;
|
||||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Menus"));
|
||||
|
||||
if (!menus)
|
||||
{
|
||||
of = e_widget_framelist_add(pg->evas, _("Error"), 0);
|
||||
|
||||
ob = e_widget_textblock_add(pg->evas);
|
||||
e_widget_size_min_set(ob, 140 * e_scale, 140 * e_scale);
|
||||
e_widget_textblock_markup_set
|
||||
(ob,
|
||||
_("No menu files were<br>"
|
||||
"found on your system.<br>"
|
||||
"Please see the<br>"
|
||||
"documentation on<br>"
|
||||
"www.enlightenment.org<br>"
|
||||
"for more details on<br>"
|
||||
"how to get your<br>"
|
||||
"application menus<br>"
|
||||
"working."));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
}
|
||||
else
|
||||
{
|
||||
of = e_widget_framelist_add(pg->evas, _("Select application menu"), 0);
|
||||
|
||||
ob = e_widget_ilist_add(pg->evas, 32 * e_scale, 32 * e_scale, &xdg_sel);
|
||||
e_widget_size_min_set(ob, 140 * e_scale, 140 * e_scale);
|
||||
|
||||
e_widget_ilist_freeze(ob);
|
||||
|
||||
EINA_LIST_FREE(menus, file)
|
||||
{
|
||||
char buf[PATH_MAX], buf2[PATH_MAX], *p, *p2, *tlabel, *tdesc;
|
||||
const char *label;
|
||||
|
||||
label = file;
|
||||
tlabel = NULL;
|
||||
tdesc = NULL;
|
||||
e_user_homedir_concat(buf, sizeof(buf),
|
||||
".config/menus/applications.menu");
|
||||
snprintf(buf2, sizeof(buf2),
|
||||
"%s/etc/xdg/menus/enlightenment.menu",
|
||||
e_prefix_get());
|
||||
if (!strcmp("/etc/xdg/menus/applications.menu", file))
|
||||
{
|
||||
label = _("System Default");
|
||||
sel = i;
|
||||
}
|
||||
else if (!strcmp(buf2, file))
|
||||
{
|
||||
label = _("Enlightenment Default");
|
||||
sel = i;
|
||||
}
|
||||
else if (!strcmp(buf, file))
|
||||
{
|
||||
label = _("Personal Default");
|
||||
}
|
||||
else
|
||||
{
|
||||
p = strrchr(file, '/');
|
||||
if (p)
|
||||
{
|
||||
p++;
|
||||
p2 = strchr(p, '-');
|
||||
if (!p2) p2 = strrchr(p, '.');
|
||||
if (p2)
|
||||
{
|
||||
tlabel = malloc(p2 - p + 1);
|
||||
if (tlabel)
|
||||
{
|
||||
eina_strlcpy(tlabel, p, p2 - p + 1);
|
||||
tlabel[0] = toupper(tlabel[0]);
|
||||
if (*p2 == '-')
|
||||
{
|
||||
p2++;
|
||||
p = strrchr(p2, '.');
|
||||
if (p)
|
||||
{
|
||||
tdesc = malloc(p - p2 + 1);
|
||||
if (tdesc)
|
||||
{
|
||||
eina_strlcpy(tdesc, p2, p - p2 + 1);
|
||||
tdesc[0] = toupper(tdesc[0]);
|
||||
snprintf(buf, sizeof(buf), "%s (%s)", tlabel, tdesc);
|
||||
}
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s", tlabel);
|
||||
}
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s", tlabel);
|
||||
}
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s", tlabel);
|
||||
label = buf;
|
||||
}
|
||||
}
|
||||
else
|
||||
label = p;
|
||||
}
|
||||
}
|
||||
e_widget_ilist_append(ob, NULL, label, NULL, NULL, file);
|
||||
if (tlabel) free(tlabel);
|
||||
if (tdesc) free(tdesc);
|
||||
free(file);
|
||||
i++;
|
||||
}
|
||||
e_widget_ilist_go(ob);
|
||||
e_widget_ilist_thaw(ob);
|
||||
|
||||
if (sel >= 0) e_widget_ilist_selected_set(ob, sel);
|
||||
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
}
|
||||
|
||||
e_wizard_page_show(o);
|
||||
pg->data = of;
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
char buf[PATH_MAX];
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/etc/xdg/menus/enlightenment.menu",
|
||||
e_prefix_get());
|
||||
e_config->default_system_menu = eina_stringshare_add(buf);
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
if ((xdg_sel) && (!strcmp("/etc/xdg/menus/applications.menu", xdg_sel)))
|
||||
{
|
||||
eina_stringshare_del(xdg_sel);
|
||||
xdg_sel = NULL;
|
||||
}
|
||||
e_config->default_system_menu = eina_stringshare_ref(xdg_sel);
|
||||
efreet_menu_file_set(e_config->default_system_menu);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,54 +1,96 @@
|
|||
/* Extra desktop files setup */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg)
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
{
|
||||
Evas_Object *o, *of, *ob;
|
||||
Eina_List *l;
|
||||
int i, sel = -1;
|
||||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Launcher Bar"));
|
||||
|
||||
of = e_widget_framelist_add(pg->evas, _("Select applications"), 0);
|
||||
|
||||
ob = e_widget_ilist_add(pg->evas, 32 * e_scale, 32 * e_scale, NULL);
|
||||
e_widget_size_min_set(ob, 140 * e_scale, 140 * e_scale);
|
||||
|
||||
e_widget_ilist_freeze(ob);
|
||||
e_widget_ilist_go(ob);
|
||||
e_widget_ilist_thaw(ob);
|
||||
|
||||
if (sel >= 0) e_widget_ilist_selected_set(ob, sel);
|
||||
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
|
||||
e_wizard_page_show(o);
|
||||
pg->data = of;
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
{
|
||||
evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg)
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
Eina_List *extra_desks, *desks;
|
||||
Efreet_Desktop *desk, *extra_desk;
|
||||
char buf[PATH_MAX], *file;
|
||||
int found;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/extra_desktops", e_wizard_dir_get());
|
||||
extra_desks = ecore_file_ls(buf);
|
||||
if (!extra_desks) return 0;
|
||||
EINA_LIST_FREE(extra_desks, file)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/extra_desktops/%s",
|
||||
e_wizard_dir_get(), file);
|
||||
extra_desk = efreet_desktop_uncached_new(buf);
|
||||
if (extra_desk)
|
||||
{
|
||||
if (extra_desk->exec)
|
||||
{
|
||||
char abuf[4096], dbuf[4096];
|
||||
|
||||
found = 0;
|
||||
if (sscanf(extra_desk->exec, "%4000s", abuf) == 1)
|
||||
{
|
||||
if (ecore_file_app_installed(abuf))
|
||||
{
|
||||
desks = efreet_util_desktop_name_glob_list("*");
|
||||
EINA_LIST_FREE(desks, desk)
|
||||
{
|
||||
if ((!found) && (desk->exec))
|
||||
{
|
||||
if (sscanf(desk->exec, "%4000s", dbuf) == 1)
|
||||
{
|
||||
char *p1, *p2;
|
||||
|
||||
p1 = strrchr(dbuf, '/');
|
||||
if (p1) p1++;
|
||||
else p1 = dbuf;
|
||||
p2 = strrchr(abuf, '/');
|
||||
if (p2) p2++;
|
||||
else p2 = abuf;
|
||||
if (!strcmp(p1, p2)) found = 1;
|
||||
}
|
||||
}
|
||||
efreet_desktop_free(desk);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
// copy file
|
||||
snprintf(abuf, sizeof(abuf),
|
||||
"%s/applications",
|
||||
efreet_data_home_get());
|
||||
ecore_file_mkpath(abuf);
|
||||
snprintf(abuf, sizeof(abuf),
|
||||
"%s/applications/%s",
|
||||
efreet_data_home_get(), file);
|
||||
ecore_file_cp(buf, abuf);
|
||||
}
|
||||
}
|
||||
efreet_desktop_free(extra_desk);
|
||||
}
|
||||
free(file);
|
||||
}
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,63 +1,190 @@
|
|||
/* Ask about Scaling */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
static int desktop_files = 1;
|
||||
static double scale = 1.0;
|
||||
static Eina_List *obs = NULL;
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg)
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg)
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
_scale_preview_sel_set(Evas_Object *ob, int sel)
|
||||
{
|
||||
Evas_Object *rc, *ob2;
|
||||
double *sc, scl;
|
||||
int v;
|
||||
Eina_List *l;
|
||||
|
||||
rc = evas_object_data_get(ob, "rec");
|
||||
if (sel)
|
||||
{
|
||||
evas_object_color_set(rc, 0, 0, 0, 0);
|
||||
sc = evas_object_data_get(ob, "scalep");
|
||||
v = (int)(unsigned long)evas_object_data_get(ob, "scale");
|
||||
scl = (double)v / 1000.0;
|
||||
if (sc) *sc = scl;
|
||||
EINA_LIST_FOREACH(obs, l, ob2)
|
||||
{
|
||||
if (ob == ob2) continue;
|
||||
_scale_preview_sel_set(ob2, 0);
|
||||
}
|
||||
}
|
||||
else evas_object_color_set(rc, 0, 0, 0, 192);
|
||||
}
|
||||
|
||||
static void
|
||||
_scale_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *ob = data;
|
||||
|
||||
_scale_preview_sel_set(ob, 1);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_scale_preview_new(Evas *e, double sc, double *scp)
|
||||
{
|
||||
Evas_Object *ob, *bg, *cm, *bd, *wb, *rc;
|
||||
const char *file;
|
||||
char buf[64];
|
||||
int v;
|
||||
|
||||
#define SZW 110
|
||||
#define SZH 80
|
||||
ob = e_widget_preview_add(e, SZW, SZH);
|
||||
e_widget_preview_vsize_set(ob, SZW, SZH);
|
||||
|
||||
bg = edje_object_add(e_widget_preview_evas_get(ob));
|
||||
file = e_bg_file_get(0, 0, 0, 0);
|
||||
edje_object_file_set(bg, file, "e/desktop/background");
|
||||
evas_object_move(bg, 0, 0);
|
||||
evas_object_resize(bg, 640, 480);
|
||||
evas_object_show(bg);
|
||||
|
||||
cm = edje_object_add(e_widget_preview_evas_get(ob));
|
||||
e_theme_edje_object_set(cm, "base/theme/borders", "e/comp/default");
|
||||
evas_object_move(cm, 16, 16);
|
||||
evas_object_resize(cm, 320, 400);
|
||||
evas_object_show(cm);
|
||||
|
||||
bd = edje_object_add(e_widget_preview_evas_get(ob));
|
||||
e_theme_edje_object_set(bd, "base/theme/borders", "e/widgets/border/default/border");
|
||||
edje_object_part_swallow(cm, "e.swallow.content", bd);
|
||||
evas_object_show(bd);
|
||||
|
||||
wb = edje_object_add(e_widget_preview_evas_get(ob));
|
||||
e_theme_edje_object_set(wb, "base/theme/dialog", "e/widgets/dialog/main");
|
||||
edje_object_part_swallow(bd, "e.swallow.client", wb);
|
||||
evas_object_show(wb);
|
||||
|
||||
rc = evas_object_rectangle_add(e_widget_preview_evas_get(ob));
|
||||
evas_object_move(rc, 0, 0);
|
||||
evas_object_resize(rc, 640, 480);
|
||||
evas_object_color_set(rc, 0, 0, 0, 192);
|
||||
evas_object_show(rc);
|
||||
|
||||
snprintf(buf, sizeof(buf), "%1.1f %s", sc, _("Title"));
|
||||
edje_object_part_text_set(bd, "e.text.title", buf);
|
||||
edje_object_signal_emit(bd, "e,state,focused", "e");
|
||||
|
||||
edje_object_signal_emit(cm, "e,state,visible,on", "e");
|
||||
edje_object_signal_emit(cm, "e,state,shadow,on", "e");
|
||||
edje_object_signal_emit(cm, "e,state,focus,on", "e");
|
||||
|
||||
edje_object_scale_set(bd, sc);
|
||||
edje_object_scale_set(cm, sc);
|
||||
edje_object_scale_set(bg, sc);
|
||||
edje_object_scale_set(wb, sc);
|
||||
|
||||
evas_object_data_set(ob, "rec", rc);
|
||||
v = sc * 1000;
|
||||
evas_object_data_set(ob, "scale", (void *)(unsigned long)v);
|
||||
evas_object_data_set(ob, "scalep", scp);
|
||||
|
||||
evas_object_event_callback_add(rc,
|
||||
EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_scale_down, ob);
|
||||
obs = eina_list_append(obs, ob);
|
||||
|
||||
return ob;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
{
|
||||
Evas_Object *o, *of, *ob;
|
||||
E_Radio_Group *rg;
|
||||
Evas_Coord sw, sh;
|
||||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("File Manager"));
|
||||
e_wizard_title_set(_("Sizing"));
|
||||
|
||||
of = e_widget_framelist_add(pg->evas, _("Desktop Files"), 0);
|
||||
|
||||
rg = e_widget_radio_group_new(&desktop_files);
|
||||
of = e_widget_frametable_add(pg->evas, _("Select preferred size"), 1);
|
||||
e_widget_frametable_content_align_set(of, 0.5, 0.5);
|
||||
|
||||
ob = e_widget_radio_add(pg->evas, _("No icons on desktop"), 0, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = _scale_preview_new(pg->evas, 0.80, &scale);
|
||||
e_widget_size_min_get(ob, &sw, &sh);
|
||||
e_widget_frametable_object_append_full(of, ob, 0, 0, 1, 1, 0, 0, 1, 1, 0.5, 0.5, sw, sh, sw, sh);
|
||||
evas_object_show(ob);
|
||||
ob = e_widget_radio_add(pg->evas, _("Enable desktop icons"), 1, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = _scale_preview_new(pg->evas, 1.00, &scale);
|
||||
_scale_preview_sel_set(ob, 1);
|
||||
e_widget_size_min_get(ob, &sw, &sh);
|
||||
e_widget_frametable_object_append_full(of, ob, 1, 0, 1, 1, 0, 0, 1, 1, 0.5, 0.5, sw, sh, sw, sh);
|
||||
evas_object_show(ob);
|
||||
|
||||
ob = _scale_preview_new(pg->evas, 1.20, &scale);
|
||||
e_widget_size_min_get(ob, &sw, &sh);
|
||||
e_widget_frametable_object_append_full(of, ob, 0, 1, 1, 1, 0, 0, 1, 1, 0.5, 0.5, sw, sh, sw, sh);
|
||||
evas_object_show(ob);
|
||||
|
||||
ob = _scale_preview_new(pg->evas, 1.50, &scale);
|
||||
e_widget_size_min_get(ob, &sw, &sh);
|
||||
e_widget_frametable_object_append_full(of, ob, 1, 1, 1, 1, 0, 0, 1, 1, 0.5, 0.5, sw, sh, sw, sh);
|
||||
evas_object_show(ob);
|
||||
|
||||
ob = _scale_preview_new(pg->evas, 1.70, &scale);
|
||||
e_widget_size_min_get(ob, &sw, &sh);
|
||||
e_widget_frametable_object_append_full(of, ob, 0, 2, 1, 1, 0, 0, 1, 1, 0.5, 0.5, sw, sh, sw, sh);
|
||||
evas_object_show(ob);
|
||||
|
||||
ob = _scale_preview_new(pg->evas, 2.00, &scale);
|
||||
e_widget_size_min_get(ob, &sw, &sh);
|
||||
e_widget_frametable_object_append_full(of, ob, 1, 2, 1, 1, 0, 0, 1, 1, 0.5, 0.5, sw, sh, sw, sh);
|
||||
evas_object_show(ob);
|
||||
|
||||
e_widget_list_object_append(o, of, 0, 0, 0.5);
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
|
||||
|
||||
e_wizard_page_show(o);
|
||||
pg->data = of;
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
{
|
||||
obs = eina_list_free(obs);
|
||||
evas_object_del(pg->data);
|
||||
|
||||
e_config->scale.use_dpi = 0;
|
||||
e_config->scale.use_custom = 1;
|
||||
e_config->scale.factor = scale;
|
||||
e_scale_update();
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg)
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
if (!desktop_files)
|
||||
{
|
||||
// FIXME: disable fileman
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: enable fileman
|
||||
// FIXME: populate ~/Desktop
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,18 +1,21 @@
|
|||
/* Ask about focus mode */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
static int focus_mode = 1;
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg)
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg)
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
{
|
||||
|
@ -22,41 +25,56 @@ wizard_page_show(E_Wizard_Page *pg)
|
|||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Window Focus"));
|
||||
|
||||
of = e_widget_framelist_add(pg->evas, _("Focus mode"), 0);
|
||||
of = e_widget_framelist_add(pg->evas, _("Focus by ..."), 0);
|
||||
|
||||
rg = e_widget_radio_group_new(&focus_mode);
|
||||
|
||||
ob = e_widget_radio_add(pg->evas, _("Click to focus windows"), 0, rg);
|
||||
ob = e_widget_radio_add(pg->evas, _("Click"), 0, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
evas_object_show(ob);
|
||||
ob = e_widget_radio_add(pg->evas, _("Mouse over focuses windows"), 1, rg);
|
||||
ob = e_widget_radio_add(pg->evas, _("Mouse Over"), 1, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
evas_object_show(ob);
|
||||
|
||||
e_widget_list_object_append(o, of, 0, 0, 0.5);
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
|
||||
e_wizard_page_show(o);
|
||||
pg->data = of;
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
{
|
||||
evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg)
|
||||
{
|
||||
if (!focus_mode)
|
||||
{
|
||||
// FIXME: click to focus
|
||||
e_config->focus_policy = E_FOCUS_CLICK;
|
||||
e_config->focus_setting = E_FOCUS_NEW_WINDOW;
|
||||
e_config->pass_click_on = 1;
|
||||
e_config->always_click_to_raise = 0;
|
||||
e_config->always_click_to_focus = 0;
|
||||
e_config->focus_last_focused_per_desktop = 1;
|
||||
e_config->focus_revert_on_hide_or_close = 1;
|
||||
e_config->pointer_slide = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: sloppy focus
|
||||
e_config->focus_policy = E_FOCUS_SLOPPY;
|
||||
e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED;
|
||||
e_config->pass_click_on = 1;
|
||||
e_config->always_click_to_raise = 0;
|
||||
e_config->always_click_to_focus = 0;
|
||||
e_config->focus_last_focused_per_desktop = 1;
|
||||
e_config->focus_revert_on_hide_or_close = 1;
|
||||
e_config->pointer_slide = 1;
|
||||
}
|
||||
evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,182 +1,13 @@
|
|||
/* Adding application icons */
|
||||
/* Setup of default icon theme */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
typedef struct _App App;
|
||||
struct _App
|
||||
{
|
||||
const char *file; // must be unique - should normally be app name
|
||||
const char *name, *generic, *comment; // fields we should provide
|
||||
const char *exec; // the exec line
|
||||
const char *icon; // icon file
|
||||
const char *extra; // extra fields (tranlations etc.)
|
||||
int found;
|
||||
};
|
||||
|
||||
static App apps[] =
|
||||
{
|
||||
{ "firefox", "Firefox", "Web Browser", "Browse the Internet",
|
||||
"firefox %u", "web_browser.png",
|
||||
"StartupNotify=true\n"
|
||||
"StartupWMClass=Firefox-bin\n"
|
||||
"Categories=Application;Network;",
|
||||
0 },
|
||||
{ "xterm", "XTerm", "Terminal", "Run commands in a shell",
|
||||
"xterm", "xterm.png",
|
||||
"StartupWMClass=XTerm\n"
|
||||
"Categories=Utility;TerminalEmulator;",
|
||||
0 },
|
||||
{ "eterm", "ETerm", "Terminal", "Run commands in a shell",
|
||||
"Eterm", "xterm.png",
|
||||
"StartupWMClass=Eterm\n"
|
||||
"Categories=Utility;TerminalEmulator;",
|
||||
0 },
|
||||
{ "sylpheed", "Sylpheed", "E-Mail Client", "Read and write E-Mail",
|
||||
"sylpheed", "mail_client.png",
|
||||
"StartupNotify=true\n"
|
||||
"StartupWMClass=Sylpheed\n"
|
||||
"Categories=Application;Network;",
|
||||
0 },
|
||||
{ "xine", "Xine", "Movie Player", "Watch movies and videos",
|
||||
"xine %U", "video_player.png",
|
||||
"StartupWMClass=xine\n"
|
||||
"Categories=Application;AudioVideo;Player;",
|
||||
0 },
|
||||
{ "mplayer", "MPlayer", "Movie Player", "Watch movies and videos",
|
||||
"mplayer %U", "video_player.png",
|
||||
"StartupWMClass=MPlayer\n"
|
||||
"Categories=Application;AudioVideo;Player;",
|
||||
0 },
|
||||
{ "xmms", "XMMS", "Audio Player", "Listen to music",
|
||||
"xmms %U", "audio_player.png",
|
||||
"StartupWMClass=XMMS\n"
|
||||
"Categories=Application;AudioVideo;Player;",
|
||||
0 },
|
||||
{ "beep-media-player", "BMP", "Audio Player", "Listen to music",
|
||||
"beep-media-player %U", "audio_player.png",
|
||||
"StartupWMClass=Beep-Media-Player\n"
|
||||
"Categories=Application;AudioVideo;Player;",
|
||||
0 },
|
||||
{ "audacious", "Audacious", "Audio Player", "Listen to music",
|
||||
"audacious %U", "audio_player.png",
|
||||
"StartupWMClass=Audacious\n"
|
||||
"Categories=Application;AudioVideo;Player;",
|
||||
0 },
|
||||
{ "gqview", "GQView", "Image Viewer", "Look at photos",
|
||||
"gqview %U", "image_viewer.png",
|
||||
"StartupWMClass=GQView\n"
|
||||
"Categories=Application;Graphics;Viewer;",
|
||||
0 },
|
||||
{ "xjed", "X-Jed", "Text Editor", "Edit text files",
|
||||
"xjed %U", "text_editor.png",
|
||||
"StartupWMClass=XJed\n"
|
||||
"Categories=Application;Utility;TextEditor;\n"
|
||||
"MimeType=text/plain;",
|
||||
0 }
|
||||
// FIXME: add more apps to search for to add .desktops for OR add to ibar.
|
||||
// feel free to have a pretty big list here. only list from the above ones
|
||||
// that have a executable installed.
|
||||
// FIXME: make sure these .desktop handle MimteType lists like xjed
|
||||
// FIXME: this might be nice moved into a set of sample .desktops that get
|
||||
// loaded and parsed to make it easier to add more in some dir somewhere
|
||||
};
|
||||
|
||||
/* FIXME unused*/
|
||||
#if 0
|
||||
static int
|
||||
_cb_sort_desks(Efreet_Desktop *d1, Efreet_Desktop *d2)
|
||||
{
|
||||
if (!d1->name) return 1;
|
||||
if (!d2->name) return -1;
|
||||
return strcmp(d1->name, d2->name);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
_app_write(App *a)
|
||||
{
|
||||
FILE *f;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/applications",
|
||||
efreet_data_home_get());
|
||||
ecore_file_mkpath(buf);
|
||||
snprintf(buf, sizeof(buf), "%s/applications/%s.desktop",
|
||||
efreet_data_home_get(), a->file);
|
||||
f = fopen(buf, "w");
|
||||
if (!f) return;
|
||||
fprintf(f,
|
||||
"[Desktop Entry]\n"
|
||||
"Encoding=UTF-8\n"
|
||||
"Type=Application\n"
|
||||
"Name=%s\n"
|
||||
"GenericName=%s\n"
|
||||
"Comment=%s\n"
|
||||
"Exec=%s\n"
|
||||
"Icon=%s\n",
|
||||
a->name, a->generic, a->comment, a->exec, a->icon);
|
||||
if (a->extra) fprintf(f, "%s\n", a->extra);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
Eina_List *desks = NULL;
|
||||
Efreet_Desktop *desk;
|
||||
int i;
|
||||
|
||||
desks = efreet_util_desktop_name_glob_list("*");
|
||||
EINA_LIST_FREE(desks, desk)
|
||||
{
|
||||
char dbuf[4096];
|
||||
|
||||
if (!desk->exec)
|
||||
{
|
||||
efreet_desktop_free(desk);
|
||||
continue;
|
||||
}
|
||||
if (sscanf(desk->exec, "%4000s", dbuf) == 1)
|
||||
{
|
||||
for (i = 0; i < (sizeof(apps) / sizeof(App)); i++)
|
||||
{
|
||||
if (apps[i].found == 0)
|
||||
{
|
||||
char abuf[4096];
|
||||
|
||||
if (sscanf(apps[i].exec, "%4000s", abuf) == 1)
|
||||
{
|
||||
char *p1, *p2;
|
||||
|
||||
if (!ecore_file_app_installed(abuf))
|
||||
{
|
||||
/* can't find exe - mark as not available */
|
||||
apps[i].found = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
p1 = strrchr(dbuf, '/');
|
||||
if (p1) p1++;
|
||||
else p1 = dbuf;
|
||||
p2 = strrchr(abuf, '/');
|
||||
if (p2) p2++;
|
||||
else p2 = abuf;
|
||||
if (!strcmp(p1, p2))
|
||||
/* mark as found in .desktops */
|
||||
apps[i].found = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
efreet_desktop_free(desk);
|
||||
}
|
||||
|
||||
// FIXME: list all apps and of the apps either already installed, or to be
|
||||
// created, offer them to be added to ibar by default. (actually should be
|
||||
// page_080)
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
|
@ -184,81 +15,54 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
|||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
Evas_Object *o, *of, *ob, *li, *ck;
|
||||
Evas_Coord mw, mh;
|
||||
Eina_List *l, *themes = efreet_icon_theme_list_get();
|
||||
Efreet_Icon_Theme *th;
|
||||
int i;
|
||||
int appnum = 0;
|
||||
|
||||
for (i = 0; i < (sizeof(apps) / sizeof(App)); i++)
|
||||
const char *selected = NULL;
|
||||
const char *search[] =
|
||||
{
|
||||
if (apps[i].found == 0) appnum++;
|
||||
}
|
||||
if (appnum == 0) return 0;
|
||||
"gnome",
|
||||
"Humanity",
|
||||
"Humanity-Dark",
|
||||
"ubuntu-mono-light",
|
||||
"ubuntu-mono-dark",
|
||||
"ubuntu-mono-light",
|
||||
"unity-icon-theme",
|
||||
NULL
|
||||
};
|
||||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Applications"));
|
||||
|
||||
of = e_widget_framelist_add(pg->evas, _("Select Icons to Add"), 0);
|
||||
|
||||
li = e_widget_list_add(pg->evas, 1, 0);
|
||||
ob = e_widget_scrollframe_simple_add(pg->evas, li);
|
||||
e_widget_size_min_set(ob, 140 * e_scale, 140 * e_scale);
|
||||
|
||||
for (i = 0; i < (sizeof(apps) / sizeof(App)); i++)
|
||||
if (!themes) return 0;
|
||||
for (i = 0; search[i]; i++)
|
||||
{
|
||||
if (apps[i].found == 0)
|
||||
EINA_LIST_FOREACH(themes, l, th)
|
||||
{
|
||||
const char *icon;
|
||||
|
||||
apps[i].found = 1;
|
||||
icon = efreet_icon_path_find(e_config->icon_theme,
|
||||
apps[i].icon, 48);
|
||||
ck = e_widget_check_icon_add(pg->evas, apps[i].name,
|
||||
icon, 32 * e_scale, 32 * e_scale,
|
||||
&(apps[i].found));
|
||||
e_widget_list_object_append(li, ck, 1, 1, 0.0);
|
||||
evas_object_show(ck);
|
||||
if (!strcasecmp(search[i], th->name.internal))
|
||||
{
|
||||
selected = search[i];
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e_widget_size_min_get(li, &mw, &mh);
|
||||
evas_object_resize(li, mw, mh);
|
||||
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
evas_object_show(li);
|
||||
|
||||
e_wizard_page_show(o);
|
||||
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
done:
|
||||
if (selected)
|
||||
{
|
||||
if (e_config->icon_theme) eina_stringshare_del(e_config->icon_theme);
|
||||
e_config->icon_theme = eina_stringshare_add(selected);
|
||||
}
|
||||
eina_list_free(themes);
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* .desktops are actually written here. this is because page_080 needs them
|
||||
* to exist in the efreet desktops list to select what is to go in ibar */
|
||||
for (i = 0; i < (sizeof(apps) / sizeof(App)); i++)
|
||||
{
|
||||
printf("%s %i\n", apps[i].name, apps[i].found);
|
||||
if (apps[i].found == 1)
|
||||
{
|
||||
_app_write(&(apps[i]));
|
||||
}
|
||||
}
|
||||
evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
// FIXME: write ~/.e/e/applications/bar/default/.order
|
||||
// which should contain whatever apps the user wants in their bar by
|
||||
// default (should be page_080)
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,41 +1,10 @@
|
|||
/* Quick launch chooser */
|
||||
/* Ibar setup */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
static Eina_List *desktops = NULL;
|
||||
static int *desktops_add = NULL;
|
||||
static int desktops_num = 0;
|
||||
|
||||
static int
|
||||
_cb_sort_desks(Efreet_Desktop *d1, Efreet_Desktop *d2)
|
||||
{
|
||||
if (!d1->name) return 1;
|
||||
if (!d2->name) return -1;
|
||||
return strcmp(d1->name, d2->name);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
Eina_List *desks = NULL;
|
||||
Efreet_Desktop *desk;
|
||||
|
||||
desks = efreet_util_desktop_name_glob_list("*");
|
||||
desks = eina_list_sort(desks, 0, (Eina_Compare_Cb)_cb_sort_desks);
|
||||
EINA_LIST_FREE(desks, desk)
|
||||
{
|
||||
if (!desk->exec)
|
||||
{
|
||||
efreet_desktop_free(desk);
|
||||
continue;
|
||||
}
|
||||
desktops = eina_list_append(desktops, desk);
|
||||
}
|
||||
if (desktops)
|
||||
{
|
||||
desktops_num = eina_list_count(desktops);
|
||||
desktops_add = calloc(sizeof(int), desktops_num);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -48,98 +17,56 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
|||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
Evas_Object *o, *of, *ob, *li, *ck;
|
||||
Evas_Coord mw, mh;
|
||||
Eina_List *l;
|
||||
int i;
|
||||
|
||||
if (!desktops) return 0;
|
||||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Quick Launch"));
|
||||
|
||||
of = e_widget_framelist_add(pg->evas, _("Select Applications"), 0);
|
||||
|
||||
li = e_widget_list_add(pg->evas, 1, 0);
|
||||
ob = e_widget_scrollframe_simple_add(pg->evas, li);
|
||||
e_widget_size_min_set(ob, 140 * e_scale, 140 * e_scale);
|
||||
|
||||
for (i = 0, l = desktops; l ; l = l->next, i++)
|
||||
{
|
||||
Efreet_Desktop *desk;
|
||||
const char *icon;
|
||||
|
||||
desk = l->data;
|
||||
icon = NULL;
|
||||
if (desk->icon)
|
||||
icon = efreet_icon_path_find(e_config->icon_theme,
|
||||
desk->icon, 48);
|
||||
ck = e_widget_check_icon_add(pg->evas, desk->name,
|
||||
icon, 32 * e_scale, 32 * e_scale,
|
||||
&(desktops_add[i]));
|
||||
e_widget_list_object_append(li, ck, 1, 1, 0.0);
|
||||
evas_object_show(ck);
|
||||
}
|
||||
|
||||
e_widget_size_min_get(li, &mw, &mh);
|
||||
evas_object_resize(li, mw, mh);
|
||||
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
evas_object_show(li);
|
||||
|
||||
e_wizard_page_show(o);
|
||||
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
{
|
||||
evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
Efreet_Desktop *desk;
|
||||
Eina_List *l;
|
||||
int i;
|
||||
FILE *f;
|
||||
FILE *f, *fin;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/def-ibar.txt", e_wizard_dir_get());
|
||||
fin = fopen(buf, "r");
|
||||
if (!fin) return 0;
|
||||
e_user_dir_concat_static(buf, "applications/bar/default");
|
||||
ecore_file_mkpath(buf);
|
||||
e_user_dir_concat_static(buf, "applications/bar/default/.order");
|
||||
f = fopen(buf, "w");
|
||||
if (f)
|
||||
{
|
||||
for (i = 0, l = desktops; l ; l = l->next, i++)
|
||||
while (fgets(buf, sizeof(buf), fin))
|
||||
{
|
||||
if (desktops_add[i])
|
||||
Efreet_Desktop *desk;
|
||||
char name[PATH_MAX], buf2[PATH_MAX], *p;
|
||||
int n;
|
||||
|
||||
if (buf[0] == '#') continue;
|
||||
p = buf;
|
||||
while (isspace(*p)) p++;
|
||||
for (;;)
|
||||
{
|
||||
char *p;
|
||||
|
||||
desk = l->data;
|
||||
p = strrchr(desk->orig_path, '/');
|
||||
if (!p) p = desk->orig_path;
|
||||
else p++;
|
||||
fprintf(f, "%s\n", p);
|
||||
n = sscanf(p, "%s", name);
|
||||
if (n != 1) break;
|
||||
p += strlen(name);
|
||||
while (isspace(*p)) p++;
|
||||
snprintf(buf2, sizeof(buf2), "%s.desktop", name);
|
||||
desk = efreet_util_desktop_file_id_find(buf2);
|
||||
if (desk)
|
||||
{
|
||||
fprintf(f, "%s\n", buf2);
|
||||
efreet_desktop_free(desk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
EINA_LIST_FREE(desktops, desk)
|
||||
efreet_desktop_free(desk);
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
if (desktops_add)
|
||||
{
|
||||
free(desktops_add);
|
||||
desktops_add = NULL;
|
||||
}
|
||||
desktops_num = 0;
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,130 @@
|
|||
/* Setup if we need battery? */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
# include <sys/ioctl.h>
|
||||
# include <sys/sysctl.h>
|
||||
# ifdef __i386__
|
||||
# include <machine/apm_bios.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static char *
|
||||
read_file(const char *file)
|
||||
{
|
||||
FILE *f = fopen(file, "r");
|
||||
size_t len;
|
||||
char buf[4096], *p;
|
||||
if (!f) return NULL;
|
||||
len = fread(buf, 1, sizeof(buf) - 1, f);
|
||||
if (len == 0)
|
||||
{
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
buf[len] = 0;
|
||||
for (p = buf; *p; p++)
|
||||
{
|
||||
if (p[0] == '\n') p[0] = 0;
|
||||
}
|
||||
fclose(f);
|
||||
return strdup(buf);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
int hav_bat = 0;
|
||||
Eina_List *dir;
|
||||
char buf[PATH_MAX], *file, *dname, *str;
|
||||
|
||||
dname = "/sys/class/power_supply";
|
||||
dir = ecore_file_ls(dname);
|
||||
if (dir)
|
||||
{
|
||||
EINA_LIST_FREE(dir, file)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/%s/type", dname, file);
|
||||
str = read_file(buf);
|
||||
if (str)
|
||||
{
|
||||
if (!strcasecmp(str, "Battery")) hav_bat = 1;
|
||||
free(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
dname = "/proc/acpi/battery/";
|
||||
dir = ecore_file_ls(dname);
|
||||
if (dir)
|
||||
{
|
||||
EINA_LIST_FREE(dir, file)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/%s/state", dname, file);
|
||||
str = read_file(buf);
|
||||
if (str)
|
||||
{
|
||||
hav_bat = 1;
|
||||
free(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef __FreeBSD__
|
||||
do {
|
||||
int mib_state[4];
|
||||
int state = 0;
|
||||
size_t len;
|
||||
|
||||
/* Read some information on first run. */
|
||||
len = 4;
|
||||
sysctlnametomib("hw.acpi.battery.state", mib_state, &len);
|
||||
len = sizeof(state);
|
||||
if (sysctl(mib_state, 4, &state, &len, NULL, 0) != -1)
|
||||
hav_bat = 1;
|
||||
} while (0);
|
||||
#endif
|
||||
if (!hav_bat)
|
||||
{
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "battery"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e_config_save_queue();
|
||||
}
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
/* Setup if we need cpufreq? */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
static char *
|
||||
read_file(const char *file)
|
||||
{
|
||||
FILE *f = fopen(file, "r");
|
||||
size_t len;
|
||||
char buf[4096], *p;
|
||||
if (!f) return NULL;
|
||||
len = fread(buf, 1, sizeof(buf) - 1, f);
|
||||
if (len == 0)
|
||||
{
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
buf[len] = 0;
|
||||
for (p = buf; *p; p++)
|
||||
{
|
||||
if (p[0] == '\n') p[0] = 0;
|
||||
}
|
||||
fclose(f);
|
||||
return strdup(buf);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
int hav_cpufreq = 0;
|
||||
#ifdef __FreeBSD__
|
||||
char buf[PATH_MAX];
|
||||
size_t len = 0;
|
||||
|
||||
len = sizeof(buf);
|
||||
if (sysctlbyname("dev.cpu.0.freq_levels", buf, &len, NULL, 0) == 0)
|
||||
hav_cpufreq = 1;
|
||||
#else
|
||||
char *str, *p;
|
||||
|
||||
str = read_file("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies");
|
||||
if (str)
|
||||
{
|
||||
for (p = str; *p; p++)
|
||||
{
|
||||
if (isspace(*p))
|
||||
{
|
||||
hav_cpufreq = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(str);
|
||||
}
|
||||
#endif
|
||||
if (!hav_cpufreq)
|
||||
{
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "cpufreq"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e_config_save_queue();
|
||||
}
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
/* Setup if we need connman? */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#ifdef HAVE_ECONNMAN
|
||||
#include <E_Connman.h>
|
||||
#endif
|
||||
|
||||
static Ecore_Event_Handler *handler = NULL;
|
||||
static Ecore_Timer *connman_timeout = NULL;
|
||||
|
||||
static void
|
||||
_recommend_connman(E_Wizard_Page *pg)
|
||||
{
|
||||
Evas_Object *o, *of, *ob;
|
||||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Network Management"));
|
||||
|
||||
of = e_widget_framelist_add(pg->evas,
|
||||
_("Connman network service not found"), 0);
|
||||
|
||||
ob = e_widget_label_add
|
||||
(pg->evas, _("Install Connman for network management support"));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
evas_object_show(ob);
|
||||
|
||||
e_widget_list_object_append(o, of, 0, 0, 0.5);
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
|
||||
e_wizard_page_show(o);
|
||||
pg->data = of;
|
||||
|
||||
e_wizard_button_next_enable_set(1);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_connman_in(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
||||
{
|
||||
if (handler)
|
||||
{
|
||||
ecore_event_handler_del(handler);
|
||||
handler = NULL;
|
||||
}
|
||||
if (connman_timeout)
|
||||
{
|
||||
ecore_timer_del(connman_timeout);
|
||||
connman_timeout = NULL;
|
||||
}
|
||||
e_wizard_button_next_enable_set(1);
|
||||
e_wizard_next();
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_connman_timeout(void *data)
|
||||
{
|
||||
E_Wizard_Page *pg = data;
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "connman"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e_config_save_queue();
|
||||
connman_timeout = NULL;
|
||||
if (handler)
|
||||
{
|
||||
ecore_event_handler_del(handler);
|
||||
handler = NULL;
|
||||
}
|
||||
_recommend_connman(pg);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
{
|
||||
int hav_connman = 0;
|
||||
E_DBus_Connection *c;
|
||||
|
||||
c = e_dbus_bus_get(DBUS_BUS_SYSTEM);
|
||||
if (c)
|
||||
{
|
||||
if (e_connman_system_init(c))
|
||||
{
|
||||
#ifdef HAVE_ECONNMAN
|
||||
handler = ecore_event_handler_add
|
||||
(E_CONNMAN_EVENT_MANAGER_IN, _connman_in, NULL);
|
||||
if (connman_timeout) ecore_timer_del(connman_timeout);
|
||||
connman_timeout = ecore_timer_add(2.0, _connman_timeout, pg);
|
||||
hav_connman = 1;
|
||||
e_wizard_button_next_enable_set(0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (!hav_connman)
|
||||
{
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "connman"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e_config_save_queue();
|
||||
_recommend_connman(pg);
|
||||
}
|
||||
e_wizard_title_set(_("Checking to see if Connman exists"));
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
if (handler)
|
||||
{
|
||||
ecore_event_handler_del(handler);
|
||||
handler = NULL;
|
||||
}
|
||||
if (connman_timeout)
|
||||
{
|
||||
ecore_timer_del(connman_timeout);
|
||||
connman_timeout = NULL;
|
||||
}
|
||||
if (pg->data) evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
/* Setup if we need temperature? */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
# include <sys/types.h>
|
||||
# include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
static char *
|
||||
read_file(const char *file)
|
||||
{
|
||||
FILE *f = fopen(file, "r");
|
||||
size_t len;
|
||||
char buf[4096], *p;
|
||||
if (!f) return NULL;
|
||||
len = fread(buf, 1, sizeof(buf) - 1, f);
|
||||
if (len == 0)
|
||||
{
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
buf[len] = 0;
|
||||
for (p = buf; *p; p++)
|
||||
{
|
||||
if (p[0] == '\n') p[0] = 0;
|
||||
}
|
||||
fclose(f);
|
||||
return strdup(buf);
|
||||
}
|
||||
*/
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
int hav_temperature = 1;
|
||||
#ifdef __FreeBSD__
|
||||
// figure out on bsd if we have temp sensors
|
||||
#else
|
||||
// figure out on linux if we have temp sensors
|
||||
#endif
|
||||
if (!hav_temperature)
|
||||
{
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "temperature"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e_config_save_queue();
|
||||
}
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/* Setup if we need backlight? */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
int hav_backlight = 0;
|
||||
|
||||
if (e_backlight_exists()) hav_backlight = 1;
|
||||
if (!hav_backlight)
|
||||
{
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "backlight"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e_config_save_queue();
|
||||
}
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/* Setup if we need mixer? */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
int hav_mixer = 0;
|
||||
#ifdef HAVE_ALSA
|
||||
hav_mixer = 1;
|
||||
#endif
|
||||
if (!hav_mixer)
|
||||
{
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "mixer"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e_config_save_queue();
|
||||
}
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,203 @@
|
|||
/* Ask about compositing */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_mod_comp_cfdata.h"
|
||||
|
||||
static int do_comp = 1;
|
||||
static int do_gl = 0;
|
||||
static int do_vsync = 0;
|
||||
|
||||
static int
|
||||
match_file_glob(FILE *f, const char *glob)
|
||||
{
|
||||
char buf[32768];
|
||||
int found = 0;
|
||||
|
||||
while (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
if (e_util_glob_match(buf, glob))
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
return found;
|
||||
}
|
||||
|
||||
static int
|
||||
match_xorg_log(const char *glob)
|
||||
{
|
||||
FILE *f;
|
||||
int i;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "/var/log/Xorg.%i.log", i);
|
||||
f = fopen(buf, "rb");
|
||||
if (f)
|
||||
{
|
||||
if (match_file_glob(f, glob)) return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
{
|
||||
Evas_Object *o, *of, *ob;
|
||||
Ecore_Evas *ee;
|
||||
|
||||
ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 320, 240);
|
||||
if (ee)
|
||||
{
|
||||
ecore_evas_free(ee);
|
||||
if (
|
||||
(match_xorg_log("*(II)*NVIDIA*: Creating default Display*")) ||
|
||||
(match_xorg_log("*(II)*intel*: Creating default Display*")) ||
|
||||
(match_xorg_log("*(II)*NOUVEAU*: Creating default Display*")) ||
|
||||
(match_xorg_log("*(II)*RADEON*: Creating default Display*"))
|
||||
)
|
||||
{
|
||||
do_gl = 1;
|
||||
do_vsync = 1;
|
||||
}
|
||||
}
|
||||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Compositing"));
|
||||
|
||||
of = e_widget_framelist_add(pg->evas, _("Transparent windows and effects"), 0);
|
||||
|
||||
ob = e_widget_textblock_add(pg->evas);
|
||||
e_widget_size_min_set(ob, 200 * e_scale, 180 * e_scale);
|
||||
e_widget_textblock_markup_set
|
||||
(ob,
|
||||
_("Compositing provides translucency<br>"
|
||||
"for windows, window effects like<br>"
|
||||
"fading in and out and zooming<br>"
|
||||
"when they appea and dissapear.<br>"
|
||||
"It is highly recommended to<br>"
|
||||
"enable this for a better<br>"
|
||||
"experience, but it comes at a<br>"
|
||||
"cost. It requires extra CPU<br>"
|
||||
"or a GLSL Shader capable GPU<br>"
|
||||
"with well written drivers.<br>"
|
||||
"It also will add between 10 to<br>"
|
||||
"100 MB to the memory needed<br>"
|
||||
"for Enlightenment."
|
||||
)
|
||||
);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = e_widget_check_add(pg->evas, _("Enable Compositing"), &(do_comp));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11))
|
||||
{
|
||||
ob = e_widget_check_add(pg->evas, _("Hardware Accelerated (OpenGL)"), &(do_gl));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = e_widget_check_add(pg->evas, _("Tear-free Rendering (OpenGL only)"), &(do_vsync));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
}
|
||||
|
||||
e_widget_list_object_append(o, of, 0, 0, 0.5);
|
||||
|
||||
evas_object_show(of);
|
||||
|
||||
e_wizard_page_show(o);
|
||||
pg->data = of;
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
{
|
||||
if (!do_comp)
|
||||
{
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "comp"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e_config->use_composite = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
E_Config_Module *em;
|
||||
Eina_List *l;
|
||||
E_Config_DD *conf_edd = NULL;
|
||||
E_Config_DD *conf_match_edd = NULL;
|
||||
Config *cfg = NULL;
|
||||
|
||||
EINA_LIST_FOREACH(e_config->modules, l, em)
|
||||
{
|
||||
if (!em->name) continue;
|
||||
if (!strcmp(em->name, "dropshadow"))
|
||||
{
|
||||
e_config->modules = eina_list_remove_list
|
||||
(e_config->modules, l);
|
||||
if (em->name) eina_stringshare_del(em->name);
|
||||
free(em);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
e_config->use_composite = 1;
|
||||
|
||||
e_mod_comp_cfdata_edd_init(&(conf_edd),
|
||||
&(conf_match_edd));
|
||||
cfg = e_mod_comp_cfdata_config_new();
|
||||
|
||||
if (do_gl)
|
||||
{
|
||||
cfg->engine = E_EVAS_ENGINE_GL_X11;
|
||||
cfg->smooth_windows = 1;
|
||||
cfg->vsync = do_vsync;
|
||||
}
|
||||
else
|
||||
{
|
||||
cfg->engine = E_EVAS_ENGINE_SOFTWARE_X11;
|
||||
cfg->smooth_windows = 0;
|
||||
cfg->vsync = 0;
|
||||
}
|
||||
|
||||
e_config_domain_save("module.comp", conf_edd, cfg);
|
||||
E_CONFIG_DD_FREE(conf_match_edd);
|
||||
E_CONFIG_DD_FREE(conf_edd);
|
||||
}
|
||||
e_config_save_queue();
|
||||
evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
/* Setup favorites and desktop links */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
Eina_List *files;
|
||||
char buf[PATH_MAX], buf2[PATH_MAX], *file;
|
||||
|
||||
// make dir for favorites and install ones shipped
|
||||
snprintf(buf, sizeof(buf), "%s/fileman/favorites", e_user_dir_get());
|
||||
ecore_file_mkpath(buf);
|
||||
snprintf(buf, sizeof(buf), "%s/favorites", e_wizard_dir_get());
|
||||
files = ecore_file_ls(buf);
|
||||
if (!files) return 0;
|
||||
EINA_LIST_FREE(files, file)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/favorites/%s",
|
||||
e_wizard_dir_get(), file);
|
||||
snprintf(buf2, sizeof(buf2), "%s/fileman/favorites/%s",
|
||||
e_user_dir_get(), file);
|
||||
ecore_file_cp(buf, buf2);
|
||||
free(file);
|
||||
}
|
||||
// make desktop dir
|
||||
e_user_homedir_concat(buf, sizeof(buf), _("Desktop"));
|
||||
ecore_file_mkpath(buf);
|
||||
snprintf(buf, sizeof(buf), "%s/desktop", e_wizard_dir_get());
|
||||
files = ecore_file_ls(buf);
|
||||
if (!files) return 0;
|
||||
EINA_LIST_FREE(files, file)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/desktop/%s",
|
||||
e_wizard_dir_get(), file);
|
||||
snprintf(buf2, sizeof(buf2), "%s/%s/%s",
|
||||
e_user_homedir_get(), _("Desktop"), file);
|
||||
ecore_file_cp(buf, buf2);
|
||||
free(file);
|
||||
}
|
||||
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
/* Delete previous copy of config profile and save new one */
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
|
@ -16,50 +17,18 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
|||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
|
||||
if ((e_config_profile_get()) && (strlen(e_config_profile_get()) > 0))
|
||||
{
|
||||
if (e_user_dir_snprintf(buf, sizeof(buf), "config/%s", e_config_profile_get()) >= sizeof(buf))
|
||||
return 0;
|
||||
if (ecore_file_is_dir(buf)) ecore_file_recursive_rm(buf);
|
||||
}
|
||||
// load profile as e_config
|
||||
e_config_load();
|
||||
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_hide(E_Wizard_Page *pg)
|
||||
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
evas_object_del(pg->data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
// setup ~/Desktop and ~/.e/e/fileman/favorites and
|
||||
// ~/.e/e/applications/bar/default, maybe ~/.e/e/applications/startup/.order
|
||||
|
||||
// FIXME: should become a wizard page on its own
|
||||
// setup fileman favorites
|
||||
snprintf(buf, sizeof(buf),
|
||||
"gzip -d -c < %s/data/other/efm_favorites.tar.gz | "
|
||||
"(cd %s/.e/e/ ; tar -xkf -)",
|
||||
e_prefix_data_get(), e_user_homedir_get());
|
||||
system(buf);
|
||||
// FIXME: efm favorites linked to desktop should be an option in another
|
||||
// wizard page
|
||||
// ~/Desktop
|
||||
e_user_homedir_concat(buf, sizeof(buf), _("Desktop"));
|
||||
ecore_file_mkpath(buf);
|
||||
e_user_homedir_snprintf(buf, sizeof(buf), "%s/%s", _("Desktop"), "home.desktop");
|
||||
ecore_file_symlink("../.e/e/fileman/favorites/home.desktop", buf);
|
||||
e_user_homedir_snprintf(buf, sizeof(buf), "%s/%s", _("Desktop"), "root.desktop");
|
||||
ecore_file_symlink("../.e/e/fileman/favorites/root.desktop", buf);
|
||||
e_user_homedir_snprintf(buf, sizeof(buf), "%s/%s", _("Desktop"), "tmp.desktop");
|
||||
ecore_file_symlink("../.e/e/fileman/favorites/tmp.desktop", buf);
|
||||
|
||||
// save the config now everyone has modified it
|
||||
e_config_save();
|
||||
// restart e
|
||||
|
|
Loading…
Reference in New Issue