2008-05-18 21:37:34 -07:00
|
|
|
#include "e_mod_gadman.h"
|
|
|
|
|
|
|
|
struct _E_Config_Dialog_Data
|
|
|
|
{
|
2012-09-06 11:28:02 -07:00
|
|
|
Evas_Object *o_avail;
|
|
|
|
Evas_Object *o_config;
|
2012-07-02 03:13:27 -07:00
|
|
|
Evas_Object *o_fm; //Filemanager Object
|
|
|
|
Evas_Object *o_sf; //Filemanager Scrollframe
|
|
|
|
Evas_Object *o_btn; //Filemanager updir button
|
|
|
|
E_Color *color; //Custom Color
|
2012-09-06 11:56:35 -07:00
|
|
|
int bg_type; //Type of background
|
2012-07-02 03:13:27 -07:00
|
|
|
int anim_bg; //Anim the background
|
|
|
|
int anim_gad; //Anim the gadgets
|
|
|
|
int fmdir; //Filemanager dir (personal or system)
|
2012-09-06 11:28:02 -07:00
|
|
|
Eina_List *waiting;
|
|
|
|
E_Config_Dialog *cfd;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *gadman_layer_names[] =
|
|
|
|
{
|
2013-01-03 07:28:50 -08:00
|
|
|
N_("Background"),
|
2013-06-11 22:26:25 -07:00
|
|
|
N_("Overlay (Action Toggle)"),
|
2012-09-06 11:28:02 -07:00
|
|
|
NULL
|
2008-05-18 21:37:34 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Local protos */
|
2012-07-02 03:13:27 -07:00
|
|
|
static void *_create_data(E_Config_Dialog *cfd);
|
|
|
|
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
2008-05-18 21:37:34 -07:00
|
|
|
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
2012-07-02 03:13:27 -07:00
|
|
|
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
2012-09-06 11:28:02 -07:00
|
|
|
static void _avail_list_cb_change(void *data);
|
2012-07-02 03:13:27 -07:00
|
|
|
static void _cb_fm_radio_change(void *data, Evas_Object *obj);
|
|
|
|
static void _cb_color_changed(void *data, Evas_Object *o);
|
|
|
|
static void _cb_fm_change(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _cb_fm_sel_change(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _cb_button_up(void *data1, void *data2);
|
2008-05-18 21:37:34 -07:00
|
|
|
|
2012-09-06 11:56:35 -07:00
|
|
|
static int
|
|
|
|
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|
|
|
{
|
|
|
|
Eina_List *sel;
|
|
|
|
|
|
|
|
#define CHECK(X, Y) \
|
|
|
|
if (Man->conf->X != cfdata->Y) return 1
|
|
|
|
CHECK(bg_type, bg_type);
|
|
|
|
CHECK(color_r, color->r);
|
|
|
|
CHECK(color_g, color->g);
|
|
|
|
CHECK(color_b, color->b);
|
|
|
|
CHECK(anim_bg, anim_bg);
|
|
|
|
CHECK(anim_gad, anim_gad);
|
|
|
|
#undef CHECK
|
|
|
|
|
|
|
|
sel = e_fm2_selected_list_get(cfdata->o_fm);
|
|
|
|
if ((!sel) && (!Man->conf->custom_bg)) return 0;
|
|
|
|
eina_list_free(sel);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-01-22 12:28:39 -08:00
|
|
|
E_Config_Dialog *
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
_config_gadman_module(E_Comp *comp, const char *params __UNUSED__)
|
2008-05-18 21:37:34 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog *cfd;
|
|
|
|
E_Config_Dialog_View *v;
|
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
/* check if config dialog exists ... */
|
2009-12-04 14:37:18 -08:00
|
|
|
if (e_config_dialog_find("E", "extensions/gadman"))
|
2008-05-19 02:21:44 -07:00
|
|
|
return NULL;
|
|
|
|
|
2008-05-18 21:37:34 -07:00
|
|
|
/* ... else create it */
|
|
|
|
v = E_NEW(E_Config_Dialog_View, 1);
|
|
|
|
v->create_cfdata = _create_data;
|
|
|
|
v->free_cfdata = _free_data;
|
|
|
|
v->basic.create_widgets = _basic_create_widgets;
|
2008-10-10 17:59:21 -07:00
|
|
|
v->basic.apply_cfdata = _basic_apply_data;
|
2012-09-06 11:56:35 -07:00
|
|
|
v->basic.check_changed = _basic_check_changed;
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-05-19 02:21:44 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/e-module-gadman.edj", Man->module->dir);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
cfd = e_config_dialog_new(comp, _("Desktop Gadgets"),
|
2009-12-04 14:37:18 -08:00
|
|
|
"E", "extensions/gadman",
|
2008-05-18 21:37:34 -07:00
|
|
|
buf, 0, v, Man);
|
2008-05-19 02:21:44 -07:00
|
|
|
|
2008-05-18 21:37:34 -07:00
|
|
|
Man->config_dialog = cfd;
|
|
|
|
return Man->config_dialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *
|
2012-09-06 11:28:02 -07:00
|
|
|
_create_data(E_Config_Dialog *cfd)
|
2008-05-18 21:37:34 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
2008-05-19 02:21:44 -07:00
|
|
|
|
2008-05-18 21:37:34 -07:00
|
|
|
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
2012-09-06 11:28:02 -07:00
|
|
|
cfdata->cfd = cfd;
|
2012-09-06 11:56:35 -07:00
|
|
|
cfdata->bg_type = Man->conf->bg_type;
|
2012-07-02 03:13:27 -07:00
|
|
|
if (Man->conf->custom_bg)
|
2008-10-10 17:59:21 -07:00
|
|
|
{
|
2012-07-02 03:13:27 -07:00
|
|
|
if (!strstr(Man->conf->custom_bg, e_user_homedir_get()))
|
|
|
|
cfdata->fmdir = 1;
|
2008-10-10 17:59:21 -07:00
|
|
|
}
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
cfdata->color = E_NEW(E_Color, 1);
|
|
|
|
cfdata->color->r = Man->conf->color_r;
|
|
|
|
cfdata->color->g = Man->conf->color_g;
|
|
|
|
cfdata->color->b = Man->conf->color_b;
|
|
|
|
cfdata->color->a = Man->conf->color_a;
|
|
|
|
cfdata->anim_bg = Man->conf->anim_bg;
|
|
|
|
cfdata->anim_gad = Man->conf->anim_gad;
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
e_color_update_rgb(cfdata->color);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-05-18 21:37:34 -07:00
|
|
|
return cfdata;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 12:18:43 -07:00
|
|
|
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2008-05-18 21:37:34 -07:00
|
|
|
{
|
|
|
|
Man->config_dialog = NULL;
|
2008-10-10 17:59:21 -07:00
|
|
|
E_FREE(cfdata->color);
|
2008-05-19 02:21:44 -07:00
|
|
|
E_FREE(cfdata);
|
2008-05-18 21:37:34 -07:00
|
|
|
}
|
|
|
|
|
2012-09-06 11:28:02 -07:00
|
|
|
static void
|
|
|
|
_cb_config_del(void *data)
|
|
|
|
{
|
2012-10-05 02:05:34 -07:00
|
|
|
int layer;
|
|
|
|
Eina_List *l;
|
|
|
|
E_Gadcon *gc;
|
|
|
|
Eina_Bool del = EINA_TRUE;
|
|
|
|
|
|
|
|
for (layer = 0; layer < GADMAN_LAYER_COUNT; layer++)
|
|
|
|
EINA_LIST_FOREACH(Man->gadcons[layer], l, gc)
|
|
|
|
if (gc->config_dialog)
|
|
|
|
{
|
|
|
|
del = EINA_FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
Man->waiting = eina_list_remove(Man->waiting, data);
|
|
|
|
if (del && Man->add) ecore_event_handler_del(Man->add);
|
2012-09-06 11:28:02 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_cb_config(void *data, void *data2 __UNUSED__)
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
E_Config_Dialog_Data *cfdata = data;
|
|
|
|
Eina_List *l;
|
|
|
|
E_Gadcon *gc;
|
|
|
|
|
|
|
|
x = e_widget_ilist_selected_get(cfdata->o_avail);
|
2012-12-02 23:54:07 -08:00
|
|
|
if (x < 0) return;
|
|
|
|
|
2012-09-06 11:28:02 -07:00
|
|
|
EINA_LIST_FOREACH(Man->gadcons[x], l, gc)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if (gc->zone != cfdata->cfd->dia->win->client->zone) continue;
|
2012-09-06 11:28:02 -07:00
|
|
|
if (gc->config_dialog) return;
|
|
|
|
e_int_gadcon_config_hook(gc, _("Desktop Gadgets"), E_GADCON_SITE_DESKTOP);
|
2012-10-05 02:05:34 -07:00
|
|
|
if (!Man->add)
|
|
|
|
Man->add = ecore_event_handler_add(E_EVENT_GADCON_CLIENT_ADD, (Ecore_Event_Handler_Cb)gadman_gadget_add_handler, NULL);
|
|
|
|
Man->waiting = eina_list_append(Man->waiting, gc);
|
2012-09-06 11:28:02 -07:00
|
|
|
e_object_data_set(E_OBJECT(gc->config_dialog), cfdata);
|
|
|
|
e_object_del_attach_func_set(E_OBJECT(gc->config_dialog), _cb_config_del);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-05-18 21:37:34 -07:00
|
|
|
static Evas_Object *
|
2012-12-03 01:24:12 -08:00
|
|
|
_basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data *cfdata)
|
2008-05-18 21:37:34 -07:00
|
|
|
{
|
2010-04-28 07:30:28 -07:00
|
|
|
Evas_Object *o, *ol, *ob, *ow, *ft, *of, *otb;
|
|
|
|
E_Radio_Group *rg;
|
2010-03-01 09:35:47 -08:00
|
|
|
Evas_Coord mw, mh;
|
2010-04-28 07:30:28 -07:00
|
|
|
E_Fm2_Config fmc;
|
|
|
|
char path[PATH_MAX];
|
2012-09-06 11:28:02 -07:00
|
|
|
int layer;
|
2008-05-18 21:37:34 -07:00
|
|
|
|
2010-04-28 07:30:28 -07:00
|
|
|
otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
|
2008-05-18 21:37:34 -07:00
|
|
|
o = e_widget_list_add(evas, 0, 0);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2012-09-06 11:28:02 -07:00
|
|
|
of = e_widget_framelist_add(evas, _("Available Layers"), 0);
|
2008-05-19 02:21:44 -07:00
|
|
|
|
2012-09-06 11:28:02 -07:00
|
|
|
//o_avail List of available layers
|
2008-05-18 21:37:34 -07:00
|
|
|
ol = e_widget_ilist_add(evas, 24, 24, NULL);
|
|
|
|
cfdata->o_avail = ol;
|
2012-09-06 11:28:02 -07:00
|
|
|
for (layer = 0; layer < GADMAN_LAYER_COUNT; layer++)
|
|
|
|
e_widget_ilist_append(ol, NULL, _(gadman_layer_names[layer]), _avail_list_cb_change, cfdata, NULL);
|
2008-05-18 21:37:34 -07:00
|
|
|
e_widget_framelist_object_append(of, ol);
|
2008-05-19 02:21:44 -07:00
|
|
|
|
2012-09-06 11:28:02 -07:00
|
|
|
//o_config Button to configure a layer
|
|
|
|
ob = e_widget_button_add(evas, _("Configure Layer"), NULL, _cb_config, cfdata, NULL);
|
2008-05-18 21:37:34 -07:00
|
|
|
e_widget_disabled_set(ob, 1);
|
2012-09-06 11:28:02 -07:00
|
|
|
cfdata->o_config = ob;
|
2010-03-01 09:35:47 -08:00
|
|
|
e_widget_size_min_get(ob, &mw, &mh);
|
|
|
|
e_widget_framelist_object_append_full(of, ob,
|
2012-07-02 03:13:27 -07:00
|
|
|
1, 1, /* fill */
|
|
|
|
1, 0, /* expand */
|
|
|
|
0.5, 0.5, /* align */
|
|
|
|
mw, mh, /* min */
|
|
|
|
99999, 99999 /* max */
|
|
|
|
);
|
2008-05-19 02:21:44 -07:00
|
|
|
|
2008-05-18 21:37:34 -07:00
|
|
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2012-09-06 11:28:02 -07:00
|
|
|
e_widget_toolbook_page_append(otb, NULL, _("Layers"), o, 1, 1, 1, 1, 0.5, 0.0);
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
2008-10-10 17:59:21 -07:00
|
|
|
ft = e_widget_table_add(evas, 0);
|
|
|
|
|
|
|
|
//Background mode
|
2010-04-28 07:30:28 -07:00
|
|
|
of = e_widget_frametable_add(evas, _("Mode"), 0);
|
2012-09-06 11:56:35 -07:00
|
|
|
rg = e_widget_radio_group_new(&(cfdata->bg_type));
|
2008-10-10 17:59:21 -07:00
|
|
|
ow = e_widget_radio_add(evas, _("Theme Defined"), BG_STD, rg);
|
|
|
|
//~ evas_object_smart_callback_add(ow, "changed", _cb_method_change, cfdata);
|
|
|
|
e_widget_frametable_object_append(of, ow, 0, 0, 1, 1, 1, 0, 1, 0);
|
|
|
|
ow = e_widget_radio_add(evas, _("Custom Image"), BG_CUSTOM, rg);
|
2012-07-02 03:13:27 -07:00
|
|
|
//~ evas_object_smart_callback_add(cfdata->o_custom, "changed",
|
|
|
|
//~ _cb_method_change, cfdata);
|
2008-10-10 17:59:21 -07:00
|
|
|
e_widget_frametable_object_append(of, ow, 0, 1, 1, 1, 1, 0, 1, 0);
|
|
|
|
ow = e_widget_radio_add(evas, _("Custom Color"), BG_COLOR, rg);
|
2012-07-02 03:13:27 -07:00
|
|
|
//~ evas_object_smart_callback_add(cfdata->o_custom, "changed",
|
|
|
|
//~ _cb_method_change, cfdata);
|
2008-10-10 17:59:21 -07:00
|
|
|
e_widget_frametable_object_append(of, ow, 0, 2, 1, 1, 1, 0, 1, 0);
|
|
|
|
ow = e_widget_radio_add(evas, _("Transparent"), BG_TRANS, rg);
|
2012-07-02 03:13:27 -07:00
|
|
|
//~ evas_object_smart_callback_add(cfdata->o_custom, "changed",
|
|
|
|
//~ _cb_method_change, cfdata);
|
2008-10-10 17:59:21 -07:00
|
|
|
e_widget_frametable_object_append(of, ow, 0, 3, 1, 1, 1, 0, 1, 0);
|
|
|
|
e_widget_table_object_append(ft, of, 0, 0, 1, 1, 1, 1, 1, 1);
|
|
|
|
|
|
|
|
//Animations
|
|
|
|
of = e_widget_frametable_add(evas, _("Animations"), 0);
|
2009-01-24 10:47:07 -08:00
|
|
|
ow = e_widget_check_add(evas, _("Background"), &(cfdata->anim_bg));
|
2008-10-10 17:59:21 -07:00
|
|
|
e_widget_frametable_object_append(of, ow, 0, 0, 1, 1, 1, 0, 1, 0);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2009-01-24 10:47:07 -08:00
|
|
|
ow = e_widget_check_add(evas, _("Gadgets"), &(cfdata->anim_gad));
|
2008-10-10 17:59:21 -07:00
|
|
|
e_widget_frametable_object_append(of, ow, 0, 1, 1, 1, 1, 0, 1, 0);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
e_widget_table_object_append(ft, of, 0, 1, 1, 1, 1, 1, 1, 1);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
//Custom Color
|
|
|
|
of = e_widget_framelist_add(evas, _("Custom Color"), 0);
|
|
|
|
ow = e_widget_color_well_add(evas, cfdata->color, 1);
|
|
|
|
e_widget_framelist_object_append(of, ow);
|
|
|
|
e_widget_on_change_hook_set(ow, _cb_color_changed, cfdata);
|
|
|
|
e_widget_table_object_append(ft, of, 0, 2, 1, 1, 1, 1, 1, 1);
|
|
|
|
|
|
|
|
//Background filemanager chooser
|
|
|
|
of = e_widget_frametable_add(evas, _("Custom Image"), 0);
|
|
|
|
rg = e_widget_radio_group_new(&(cfdata->fmdir));
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
ow = e_widget_radio_add(evas, _("Personal"), 0, rg);
|
|
|
|
e_widget_on_change_hook_set(ow, _cb_fm_radio_change, cfdata);
|
|
|
|
e_widget_frametable_object_append(of, ow, 0, 0, 1, 1, 1, 1, 0, 0);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
ow = e_widget_radio_add(evas, _("System"), 1, rg);
|
|
|
|
e_widget_on_change_hook_set(ow, _cb_fm_radio_change, cfdata);
|
|
|
|
e_widget_frametable_object_append(of, ow, 1, 0, 1, 1, 1, 1, 0, 0);
|
|
|
|
|
2012-07-02 03:13:27 -07:00
|
|
|
cfdata->o_btn = e_widget_button_add(evas, _("Go up a Directory"),
|
|
|
|
"widgets/up_dir", _cb_button_up,
|
|
|
|
cfdata, NULL);
|
2010-04-28 07:30:28 -07:00
|
|
|
e_widget_frametable_object_append(of, cfdata->o_btn, 0, 1, 2, 1, 1, 1, 1, 0);
|
2008-10-10 17:59:21 -07:00
|
|
|
|
|
|
|
if (cfdata->fmdir == 1)
|
2009-04-13 07:56:38 -07:00
|
|
|
e_prefix_data_concat_static(path, "data/backgrounds");
|
2008-10-10 17:59:21 -07:00
|
|
|
else
|
2009-04-13 07:56:38 -07:00
|
|
|
e_user_dir_concat_static(path, "backgrounds");
|
2008-10-10 17:59:21 -07:00
|
|
|
|
|
|
|
ow = e_fm2_add(evas);
|
|
|
|
cfdata->o_fm = ow;
|
|
|
|
memset(&fmc, 0, sizeof(E_Fm2_Config));
|
|
|
|
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
|
|
|
|
fmc.view.open_dirs_in_place = 1;
|
|
|
|
fmc.view.selector = 1;
|
|
|
|
fmc.view.single_click = 0;
|
|
|
|
fmc.view.no_subdir_jump = 0;
|
2010-04-28 07:30:28 -07:00
|
|
|
fmc.icon.list.w = 36;
|
|
|
|
fmc.icon.list.h = 36;
|
2008-10-10 17:59:21 -07:00
|
|
|
fmc.icon.fixed.w = 1;
|
|
|
|
fmc.icon.fixed.h = 1;
|
|
|
|
fmc.icon.extension.show = 0;
|
|
|
|
fmc.icon.key_hint = NULL;
|
|
|
|
fmc.list.sort.no_case = 1;
|
|
|
|
fmc.list.sort.dirs.first = 0;
|
|
|
|
fmc.list.sort.dirs.last = 1;
|
|
|
|
fmc.selection.single = 1;
|
|
|
|
fmc.selection.windows_modifiers = 0;
|
|
|
|
e_fm2_config_set(ow, &fmc);
|
|
|
|
e_fm2_icon_menu_flags_set(ow, E_FM2_MENU_NO_SHOW_HIDDEN);
|
|
|
|
e_fm2_path_set(ow, path, "/");
|
|
|
|
|
2012-07-02 03:13:27 -07:00
|
|
|
evas_object_smart_callback_add(ow, "selection_change",
|
|
|
|
_cb_fm_sel_change, cfdata);
|
2008-10-10 17:59:21 -07:00
|
|
|
evas_object_smart_callback_add(ow, "changed", _cb_fm_change, cfdata);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
|
|
|
cfdata->o_sf = e_widget_scrollframe_pan_add(evas, ow, e_fm2_pan_set,
|
|
|
|
e_fm2_pan_get,
|
|
|
|
e_fm2_pan_max_get,
|
|
|
|
e_fm2_pan_child_size_get);
|
2010-04-28 07:30:28 -07:00
|
|
|
e_widget_size_min_set(cfdata->o_sf, 150, 250);
|
2008-10-10 17:59:21 -07:00
|
|
|
e_widget_frametable_object_append(of, cfdata->o_sf, 0, 2, 2, 1, 1, 1, 1, 1);
|
2010-04-28 07:30:28 -07:00
|
|
|
e_widget_table_object_append(ft, of, 2, 0, 1, 3, 1, 1, 1, 1);
|
2008-10-10 17:59:21 -07:00
|
|
|
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2010-04-28 07:30:28 -07:00
|
|
|
e_widget_toolbook_page_append(otb, NULL, _("Background Options"), ft, 0, 0, 0, 0, 0.5, 0.0);
|
|
|
|
e_widget_toolbook_page_show(otb, 0);
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2010-04-28 07:30:28 -07:00
|
|
|
return otb;
|
2008-10-10 17:59:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2010-08-19 12:18:43 -07:00
|
|
|
_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
2008-10-10 17:59:21 -07:00
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *sel;
|
2008-10-10 17:59:21 -07:00
|
|
|
const char *p = NULL;
|
|
|
|
E_Fm2_Icon_Info *ic;
|
|
|
|
char path[PATH_MAX];
|
|
|
|
|
2012-09-06 11:56:35 -07:00
|
|
|
Man->conf->bg_type = cfdata->bg_type;
|
2008-10-10 17:59:21 -07:00
|
|
|
Man->conf->color_r = cfdata->color->r;
|
|
|
|
Man->conf->color_g = cfdata->color->g;
|
|
|
|
Man->conf->color_b = cfdata->color->b;
|
|
|
|
Man->conf->color_a = 255;
|
|
|
|
Man->conf->anim_bg = cfdata->anim_bg;
|
|
|
|
Man->conf->anim_gad = cfdata->anim_gad;
|
|
|
|
|
|
|
|
p = e_fm2_real_path_get(cfdata->o_fm);
|
|
|
|
sel = e_fm2_selected_list_get(cfdata->o_fm);
|
|
|
|
if (sel && p)
|
|
|
|
{
|
2012-07-02 03:13:27 -07:00
|
|
|
ic = sel->data;
|
|
|
|
if (ic->file)
|
|
|
|
{
|
|
|
|
snprintf(path, sizeof(path), "%s/%s", p, ic->file);
|
2012-09-06 11:56:35 -07:00
|
|
|
eina_stringshare_replace(&Man->conf->custom_bg, path);
|
2012-07-02 03:13:27 -07:00
|
|
|
}
|
|
|
|
eina_list_free(sel);
|
2008-10-10 17:59:21 -07:00
|
|
|
}
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2010-04-28 07:30:28 -07:00
|
|
|
gadman_gadget_edit_end(NULL, NULL, NULL, NULL);
|
2008-10-10 17:59:21 -07:00
|
|
|
e_config_save_queue();
|
|
|
|
gadman_update_bg();
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
return 1;
|
|
|
|
}
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
//Basic Callbacks
|
2012-07-02 03:13:27 -07:00
|
|
|
static void
|
2012-09-06 11:28:02 -07:00
|
|
|
_avail_list_cb_change(void *data)
|
2008-05-18 21:37:34 -07:00
|
|
|
{
|
2008-05-19 02:21:44 -07:00
|
|
|
E_Config_Dialog_Data *cfdata;
|
2008-05-18 21:37:34 -07:00
|
|
|
|
2008-05-19 02:21:44 -07:00
|
|
|
if (!(cfdata = data)) return;
|
2012-09-06 11:28:02 -07:00
|
|
|
e_widget_disabled_set(cfdata->o_config, 0);
|
2008-05-18 21:37:34 -07:00
|
|
|
}
|
2008-10-10 17:59:21 -07:00
|
|
|
|
|
|
|
//Advanced Callbacks
|
|
|
|
static void
|
2010-08-19 12:18:43 -07:00
|
|
|
_cb_color_changed(void *data, Evas_Object *o __UNUSED__)
|
2008-10-10 17:59:21 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
cfdata = data;
|
|
|
|
if (!cfdata) return;
|
|
|
|
e_color_update_rgb(cfdata->color);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-08-19 12:18:43 -07:00
|
|
|
_cb_fm_radio_change(void *data, Evas_Object *obj __UNUSED__)
|
2008-10-10 17:59:21 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
char path[PATH_MAX];
|
2009-04-13 07:56:38 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
cfdata = data;
|
|
|
|
if (!cfdata->o_fm) return;
|
2009-04-13 07:56:38 -07:00
|
|
|
if (cfdata->fmdir == 0)
|
|
|
|
e_user_dir_concat_static(path, "backgrounds");
|
|
|
|
else
|
|
|
|
e_prefix_data_concat_static(path, "data/backgrounds");
|
2008-10-10 17:59:21 -07:00
|
|
|
e_fm2_path_set(cfdata->o_fm, path, "/");
|
|
|
|
}
|
|
|
|
|
2012-07-02 03:13:27 -07:00
|
|
|
static void
|
2010-08-19 12:18:43 -07:00
|
|
|
_cb_fm_change(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2008-10-10 17:59:21 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
const char *p;
|
|
|
|
char path[PATH_MAX];
|
2009-04-13 07:56:38 -07:00
|
|
|
size_t len;
|
2008-10-10 17:59:21 -07:00
|
|
|
|
|
|
|
cfdata = data;
|
|
|
|
if (!Man->conf->custom_bg) return;
|
|
|
|
if (!cfdata->o_fm) return;
|
|
|
|
|
|
|
|
p = e_fm2_real_path_get(cfdata->o_fm);
|
2012-07-02 03:13:27 -07:00
|
|
|
if (!p) return;
|
2008-10-10 17:59:21 -07:00
|
|
|
|
|
|
|
if (strncmp(p, Man->conf->custom_bg, strlen(p))) return;
|
|
|
|
|
2009-04-13 07:56:38 -07:00
|
|
|
len = e_user_dir_concat_static(path, "backgrounds");
|
2012-07-02 03:13:27 -07:00
|
|
|
if (!strncmp(Man->conf->custom_bg, path, len))
|
2009-04-13 07:56:38 -07:00
|
|
|
p = Man->conf->custom_bg + len + 1;
|
2012-07-02 03:13:27 -07:00
|
|
|
else
|
2008-10-10 17:59:21 -07:00
|
|
|
{
|
2012-07-02 03:13:27 -07:00
|
|
|
len = e_prefix_data_concat_static(path, "data/backgrounds");
|
|
|
|
if (!strncmp(Man->conf->custom_bg, path, len))
|
|
|
|
p = Man->conf->custom_bg + len + 1;
|
|
|
|
else
|
|
|
|
p = Man->conf->custom_bg;
|
2008-10-10 17:59:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
e_fm2_select_set(cfdata->o_fm, p, 1);
|
|
|
|
e_fm2_file_show(cfdata->o_fm, p);
|
|
|
|
}
|
|
|
|
|
2012-07-02 03:13:27 -07:00
|
|
|
static void
|
2010-08-19 12:18:43 -07:00
|
|
|
_cb_fm_sel_change(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2008-10-10 17:59:21 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
|
|
|
|
cfdata = data;
|
|
|
|
e_widget_change(cfdata->o_sf);
|
|
|
|
}
|
2012-07-02 03:13:27 -07:00
|
|
|
|
2008-10-10 17:59:21 -07:00
|
|
|
static void
|
2010-08-19 12:18:43 -07:00
|
|
|
_cb_button_up(void *data1, void *data2 __UNUSED__)
|
2008-10-10 17:59:21 -07:00
|
|
|
{
|
|
|
|
E_Config_Dialog_Data *cfdata;
|
|
|
|
|
|
|
|
cfdata = data1;
|
|
|
|
if (!cfdata->o_fm) return;
|
|
|
|
|
|
|
|
e_fm2_parent_go(cfdata->o_fm);
|
|
|
|
e_widget_scrollframe_child_pos_set(cfdata->o_sf, 0, 0);
|
|
|
|
}
|