forked from enlightenment/enlightenment
- nice config for thumbnailing. Needs config dialog.
- event for theme change. SVN revision: 29381
This commit is contained in:
parent
260d229f07
commit
8e1c36d005
|
@ -45,6 +45,7 @@ static int _e_border_cb_window_move_resize_request(void *data, int ev_type, void
|
||||||
static int _e_border_cb_desktop_change(void *data, int ev_type, void *ev);
|
static int _e_border_cb_desktop_change(void *data, int ev_type, void *ev);
|
||||||
static int _e_border_cb_sync_alarm(void *data, int ev_type, void *ev);
|
static int _e_border_cb_sync_alarm(void *data, int ev_type, void *ev);
|
||||||
static int _e_border_cb_util_desktop_list_change(void *data, int ev_type, void *ev);
|
static int _e_border_cb_util_desktop_list_change(void *data, int ev_type, void *ev);
|
||||||
|
static int _e_border_cb_config_icon_theme(void *data, int ev_type, void *ev);
|
||||||
|
|
||||||
static int _e_border_cb_pointer_warp(void *data, int ev_type, void *ev);
|
static int _e_border_cb_pointer_warp(void *data, int ev_type, void *ev);
|
||||||
static void _e_border_cb_signal_bind(void *data, Evas_Object *obj, const char *emission, const char *source);
|
static void _e_border_cb_signal_bind(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||||
|
@ -170,6 +171,7 @@ e_border_init(void)
|
||||||
handlers = evas_list_append(handlers, ecore_event_handler_add(E_EVENT_POINTER_WARP, _e_border_cb_pointer_warp, NULL));
|
handlers = evas_list_append(handlers, ecore_event_handler_add(E_EVENT_POINTER_WARP, _e_border_cb_pointer_warp, NULL));
|
||||||
|
|
||||||
handlers = evas_list_append(handlers, ecore_event_handler_add(EFREET_EVENT_UTIL_DESKTOP_LIST_CHANGE, _e_border_cb_util_desktop_list_change, NULL));
|
handlers = evas_list_append(handlers, ecore_event_handler_add(EFREET_EVENT_UTIL_DESKTOP_LIST_CHANGE, _e_border_cb_util_desktop_list_change, NULL));
|
||||||
|
handlers = evas_list_append(handlers, ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME, _e_border_cb_config_icon_theme, NULL));
|
||||||
|
|
||||||
E_EVENT_BORDER_ADD = ecore_event_type_new();
|
E_EVENT_BORDER_ADD = ecore_event_type_new();
|
||||||
E_EVENT_BORDER_REMOVE = ecore_event_type_new();
|
E_EVENT_BORDER_REMOVE = ecore_event_type_new();
|
||||||
|
@ -4292,6 +4294,23 @@ _e_border_cb_util_desktop_list_change(void *data, int ev_type, void *ev)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_e_border_cb_config_icon_theme(void *data, int ev_type, void *ev)
|
||||||
|
{
|
||||||
|
Evas_List *l;
|
||||||
|
|
||||||
|
/* mark all borders for desktop/icon updates */
|
||||||
|
for (l = borders; l; l = l->next)
|
||||||
|
{
|
||||||
|
E_Border *bd;
|
||||||
|
|
||||||
|
bd = l->data;
|
||||||
|
bd->changes.icon = 1;
|
||||||
|
bd->changed = 1;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME:
|
/* FIXME:
|
||||||
* Using '2' is bad, may change in zone flip code.
|
* Using '2' is bad, may change in zone flip code.
|
||||||
* Calculate pos from e->x and e->y
|
* Calculate pos from e->x and e->y
|
||||||
|
|
|
@ -41,10 +41,14 @@ static E_Config_DD *_e_config_gadcon_client_edd = NULL;
|
||||||
static E_Config_DD *_e_config_shelf_edd = NULL;
|
static E_Config_DD *_e_config_shelf_edd = NULL;
|
||||||
static E_Config_DD *_e_config_mime_icon_edd = NULL;
|
static E_Config_DD *_e_config_mime_icon_edd = NULL;
|
||||||
|
|
||||||
|
EAPI int E_EVENT_CONFIG_ICON_THEME = 0;
|
||||||
|
|
||||||
/* externally accessible functions */
|
/* externally accessible functions */
|
||||||
EAPI int
|
EAPI int
|
||||||
e_config_init(void)
|
e_config_init(void)
|
||||||
{
|
{
|
||||||
|
E_EVENT_CONFIG_ICON_THEME = ecore_event_type_new();
|
||||||
|
|
||||||
_e_config_profile = getenv("E_CONF_PROFILE");
|
_e_config_profile = getenv("E_CONF_PROFILE");
|
||||||
if (!_e_config_profile)
|
if (!_e_config_profile)
|
||||||
{
|
{
|
||||||
|
@ -542,6 +546,8 @@ e_config_init(void)
|
||||||
E_CONFIG_LIST(D, T, mime_icons, _e_config_mime_icon_edd); /**/
|
E_CONFIG_LIST(D, T, mime_icons, _e_config_mime_icon_edd); /**/
|
||||||
|
|
||||||
E_CONFIG_VAL(D, T, desk_auto_switch, INT);
|
E_CONFIG_VAL(D, T, desk_auto_switch, INT);
|
||||||
|
|
||||||
|
E_CONFIG_VAL(D, T, thumb_nice, INT);
|
||||||
|
|
||||||
e_config = e_config_domain_load("e", _e_config_edd);
|
e_config = e_config_domain_load("e", _e_config_edd);
|
||||||
if (e_config)
|
if (e_config)
|
||||||
|
@ -1362,6 +1368,10 @@ e_config_init(void)
|
||||||
e_config->clientlist_max_caption_len = 0;
|
e_config->clientlist_max_caption_len = 0;
|
||||||
IFCFGEND;
|
IFCFGEND;
|
||||||
|
|
||||||
|
IFCFG(0x114)
|
||||||
|
e_config->thumb_nice = 0;
|
||||||
|
IFCFGEND;
|
||||||
|
|
||||||
e_config->config_version = E_CONFIG_FILE_VERSION;
|
e_config->config_version = E_CONFIG_FILE_VERSION;
|
||||||
|
|
||||||
#if 0 /* example of new config */
|
#if 0 /* example of new config */
|
||||||
|
|
|
@ -39,6 +39,8 @@ typedef struct _E_Config_Gadcon_Client E_Config_Gadcon_Client;
|
||||||
typedef struct _E_Config_Shelf E_Config_Shelf;
|
typedef struct _E_Config_Shelf E_Config_Shelf;
|
||||||
typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon;
|
typedef struct _E_Config_Mime_Icon E_Config_Mime_Icon;
|
||||||
|
|
||||||
|
typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
|
||||||
|
|
||||||
typedef Eet_Data_Descriptor E_Config_DD;
|
typedef Eet_Data_Descriptor E_Config_DD;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -52,7 +54,7 @@ typedef Eet_Data_Descriptor E_Config_DD;
|
||||||
/* increment this whenever a new set of config values are added but the users
|
/* increment this whenever a new set of config values are added but the users
|
||||||
* config doesn't need to be wiped - simply new values need to be put in
|
* config doesn't need to be wiped - simply new values need to be put in
|
||||||
*/
|
*/
|
||||||
#define E_CONFIG_FILE_GENERATION 0x0113
|
#define E_CONFIG_FILE_GENERATION 0x0114
|
||||||
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
|
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
|
||||||
|
|
||||||
#define E_EVAS_ENGINE_DEFAULT 0
|
#define E_EVAS_ENGINE_DEFAULT 0
|
||||||
|
@ -288,6 +290,8 @@ struct _E_Config
|
||||||
|
|
||||||
Evas_List *mime_icons; // GUI
|
Evas_List *mime_icons; // GUI
|
||||||
int desk_auto_switch; // GUI;
|
int desk_auto_switch; // GUI;
|
||||||
|
|
||||||
|
int thumb_nice;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _E_Config_Module
|
struct _E_Config_Module
|
||||||
|
@ -405,6 +409,11 @@ struct _E_Config_Mime_Icon
|
||||||
const char *icon;
|
const char *icon;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _E_Event_Config_Icon_Theme
|
||||||
|
{
|
||||||
|
const char *icon_theme;
|
||||||
|
};
|
||||||
|
|
||||||
EAPI int e_config_init(void);
|
EAPI int e_config_init(void);
|
||||||
EAPI int e_config_shutdown(void);
|
EAPI int e_config_shutdown(void);
|
||||||
|
|
||||||
|
@ -436,5 +445,7 @@ EAPI E_Config_Binding_Wheel *e_config_binding_wheel_match(E_Config_Binding_Whee
|
||||||
|
|
||||||
extern EAPI E_Config *e_config;
|
extern EAPI E_Config *e_config;
|
||||||
|
|
||||||
|
extern EAPI int E_EVENT_CONFIG_ICON_THEME;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -99,16 +99,18 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
static int
|
static int
|
||||||
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
E_Action *a;
|
E_Event_Config_Icon_Theme *ev;
|
||||||
|
|
||||||
/* Actually take our cfdata settings and apply them in real life */
|
/* Actually take our cfdata settings and apply them in real life */
|
||||||
e_config->icon_theme = evas_stringshare_add(cfdata->themename);
|
e_config->icon_theme = evas_stringshare_add(cfdata->themename);
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
|
|
||||||
/* If it's good enough for themes, it's good enough for icon themes, but ICK!. */
|
ev = E_NEW(E_Event_Config_Icon_Theme, 1);
|
||||||
a = e_action_find("restart");
|
if (ev)
|
||||||
if ((a) && (a->func.go)) a->func.go(NULL, NULL);
|
{
|
||||||
|
ev->icon_theme = e_config->icon_theme;
|
||||||
|
ecore_event_add(E_EVENT_CONFIG_ICON_THEME, ev, NULL, NULL);
|
||||||
|
}
|
||||||
return 1; /* Apply was OK */
|
return 1; /* Apply was OK */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,8 @@ e_thumb_icon_begin(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Ecore_Exe *exe;
|
Ecore_Exe *exe;
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/enlightenment_thumb", e_prefix_bin_get());
|
snprintf(buf, sizeof(buf), "%s/enlightenment_thumb --nice=%d", e_prefix_bin_get(),
|
||||||
|
e_config->thumb_nice);
|
||||||
exe = ecore_exe_run(buf, NULL);
|
exe = ecore_exe_run(buf, NULL);
|
||||||
_thumbnailers_exe = evas_list_append(_thumbnailers_exe, exe);
|
_thumbnailers_exe = evas_list_append(_thumbnailers_exe, exe);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,13 +44,12 @@ static char _thumbdir[4096] = "";
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
// char buf[4096];
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* FIXME: make this configurable */
|
|
||||||
// nice(20);
|
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
|
printf("arg: %d - '%s'\n", strlen(argv[i]), argv[i]);
|
||||||
|
printf("hm: %d\n", (!strncmp(argv[i], "--nice=", 7)));
|
||||||
if ((!strcmp(argv[i], "-h")) ||
|
if ((!strcmp(argv[i], "-h")) ||
|
||||||
(!strcmp(argv[i], "-help")) ||
|
(!strcmp(argv[i], "-help")) ||
|
||||||
(!strcmp(argv[i], "--help")))
|
(!strcmp(argv[i], "--help")))
|
||||||
|
@ -61,6 +60,14 @@ main(int argc, char **argv)
|
||||||
);
|
);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
else if (!strncmp(argv[i], "--nice=", 7))
|
||||||
|
{
|
||||||
|
const char *val;
|
||||||
|
|
||||||
|
val = argv[i] + 7;
|
||||||
|
if (*val)
|
||||||
|
nice(atoi(val));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ecore_init();
|
ecore_init();
|
||||||
|
@ -359,7 +366,6 @@ _e_thumb_generate(E_Thumb *eth)
|
||||||
ecore_ipc_server_send(_e_ipc_server, 5, 2, eth->objid, 0, 0, buf, strlen(buf) + 1);
|
ecore_ipc_server_send(_e_ipc_server, 5, 2, eth->objid, 0, 0, buf, strlen(buf) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: should use md5 or sha1 sum of the path */
|
|
||||||
static char *
|
static char *
|
||||||
_e_thumb_file_id(char *file, char *key)
|
_e_thumb_file_id(char *file, char *key)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue