enlightenment/src/bin/e_int_shelf_config.c

512 lines
18 KiB
C
Raw Normal View History

#include "e.h"
2012-06-20 23:19:43 -07:00
struct _E_Config_Dialog_Data
{
E_Shelf *es;
E_Config_Shelf *escfg;
2009-07-23 18:56:00 -07:00
Evas_Object *o_autohide, *o_desk_list, *o_overlap;
Eina_List *autohide_list, *desk_list;
int layer, overlap;
int orient, fit_along;
int size;
const char *style;
int autohide, autohide_show_action;
double hide_timeout, hide_duration;
int desk_show_mode;
Eina_List *handlers;
};
/* local function prototypes */
static void *_create_data(E_Config_Dialog *cfd);
static void _fill_data(E_Config_Dialog_Data *cfdata);
static int _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
static void _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata);
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static void _fill_styles(E_Config_Dialog_Data *cfdata, Evas_Object *obj);
static void _cb_autohide_change(void *data, Evas_Object *obj __UNUSED__);
static void _fill_desks(E_Config_Dialog_Data *cfdata);
2012-06-20 23:19:43 -07:00
EAPI void
e_int_shelf_config(E_Shelf *es)
{
E_Config_Dialog_View *v;
2009-07-23 18:56:00 -07:00
if (!(v = E_NEW(E_Config_Dialog_View, 1))) return;
2009-07-23 18:56:00 -07:00
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.create_widgets = _basic_create;
v->basic.apply_cfdata = _basic_apply;
v->basic.check_changed = _basic_check_changed;
2012-06-20 23:19:43 -07:00
es->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
e_config_dialog_new(es->zone->comp, _("Shelf Settings"),
2012-06-20 23:19:43 -07:00
"E", "_shelf_config_dialog",
"preferences-desktop-shelf", 0, v, es);
e_win_centered_set(es->config_dialog->dia->win, EINA_TRUE);
}
/* local functions */
static Eina_Bool
_shelf_event_add(E_Config_Dialog_Data *cfdata, int type __UNUSED__, E_Event_Shelf *ev)
{
if (ev->shelf->cfg == cfdata->escfg)
cfdata->es = ev->shelf;
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_shelf_event_del(E_Config_Dialog_Data *cfdata, int type __UNUSED__, E_Event_Shelf *ev)
{
if (ev->shelf == cfdata->es)
cfdata->es = NULL;
return ECORE_CALLBACK_RENEW;
}
static void *
2012-06-20 23:19:43 -07:00
_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->es = cfd->data;
cfdata->escfg = cfdata->es->cfg;
E_LIST_HANDLER_APPEND(cfdata->handlers, E_EVENT_SHELF_ADD, _shelf_event_add, cfdata);
E_LIST_HANDLER_APPEND(cfdata->handlers, E_EVENT_SHELF_DEL, _shelf_event_del, cfdata);
_fill_data(cfdata);
return cfdata;
}
2012-06-20 23:19:43 -07:00
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
/* stacking */
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
cfdata->layer = cfdata->escfg->layer;
cfdata->overlap = cfdata->escfg->overlap;
2010-04-28 07:58:27 -07:00
/* position */
cfdata->orient = cfdata->escfg->orient;
cfdata->fit_along = cfdata->escfg->fit_along;
/* size */
cfdata->size = cfdata->escfg->size;
/* style */
2012-06-20 23:19:43 -07:00
if (cfdata->escfg->style)
cfdata->style = eina_stringshare_ref(cfdata->escfg->style);
else
cfdata->style = eina_stringshare_add("");
/* autohide */
cfdata->autohide = cfdata->escfg->autohide;
cfdata->autohide_show_action = cfdata->escfg->autohide_show_action;
cfdata->hide_timeout = cfdata->escfg->hide_timeout;
cfdata->hide_duration = cfdata->escfg->hide_duration;
/* desktop */
cfdata->desk_show_mode = cfdata->escfg->desk_show_mode;
cfdata->desk_list = cfdata->escfg->desk_list;
}
static int
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
#define CHECK(X) if (cfdata->X != cfdata->escfg->X) return 1
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
CHECK(layer);
CHECK(overlap);
CHECK(orient);
CHECK(fit_along);
CHECK(size);
CHECK(style);
CHECK(autohide);
CHECK(autohide_show_action);
CHECK(desk_show_mode);
CHECK(desk_list);
2013-10-02 19:19:59 -07:00
if (fabs(cfdata->hide_timeout - cfdata->escfg->hide_timeout) > 0.19) return 1;
if (fabs(cfdata->hide_duration - cfdata->escfg->hide_duration) > 0.04) return 1;
return 0;
}
2012-06-20 23:19:43 -07:00
static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
eina_list_free(cfdata->autohide_list);
eina_stringshare_del(cfdata->style);
cfdata->style = NULL;
E_FREE_LIST(cfdata->handlers, ecore_event_handler_del);
cfdata->es->config_dialog = NULL;
2009-07-23 18:56:00 -07:00
E_FREE(cfdata);
}
static Evas_Object *
2012-06-20 23:19:43 -07:00
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *otb, *ol, *ow;
E_Radio_Group *rg;
otb = e_widget_toolbook_add(evas, 24, 24);
/* Stacking */
ol = e_widget_list_add(evas, 0, 0);
rg = e_widget_radio_group_new(&(cfdata->layer));
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
ow = e_widget_radio_add(evas, _("Above Everything"), E_LAYER_CLIENT_ABOVE, rg);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
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
ow = e_widget_radio_add(evas, _("Below Windows"), E_LAYER_CLIENT_DESKTOP, rg);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
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
ow = e_widget_radio_add(evas, _("Below Everything"), E_LAYER_DESKTOP, rg);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Stacking"), ol,
1, 0, 1, 0, 0.5, 0.0);
2010-04-28 07:58:27 -07:00
/* position */
ol = e_widget_table_add(evas, 1);
rg = e_widget_radio_group_new(&(cfdata->orient));
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-left",
24, 24, E_GADCON_ORIENT_LEFT, rg);
e_widget_table_object_append(ol, ow, 0, 2, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-right",
24, 24, E_GADCON_ORIENT_RIGHT, rg);
e_widget_table_object_append(ol, ow, 2, 2, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-top",
24, 24, E_GADCON_ORIENT_TOP, rg);
e_widget_table_object_append(ol, ow, 1, 0, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-bottom",
24, 24, E_GADCON_ORIENT_BOTTOM, rg);
e_widget_table_object_append(ol, ow, 1, 4, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-top-left",
24, 24, E_GADCON_ORIENT_CORNER_TL, rg);
e_widget_table_object_append(ol, ow, 0, 0, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-top-right",
24, 24, E_GADCON_ORIENT_CORNER_TR, rg);
e_widget_table_object_append(ol, ow, 2, 0, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-bottom-left",
24, 24, E_GADCON_ORIENT_CORNER_BL, rg);
e_widget_table_object_append(ol, ow, 0, 4, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-bottom-right",
24, 24, E_GADCON_ORIENT_CORNER_BR, rg);
e_widget_table_object_append(ol, ow, 2, 4, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-left-top",
24, 24, E_GADCON_ORIENT_CORNER_LT, rg);
e_widget_table_object_append(ol, ow, 0, 1, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-right-top",
24, 24, E_GADCON_ORIENT_CORNER_RT, rg);
e_widget_table_object_append(ol, ow, 2, 1, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-left-bottom",
24, 24, E_GADCON_ORIENT_CORNER_LB, rg);
e_widget_table_object_append(ol, ow, 0, 3, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
ow = e_widget_radio_icon_add(evas, NULL, "preferences-position-right-bottom",
24, 24, E_GADCON_ORIENT_CORNER_RB, rg);
e_widget_table_object_append(ol, ow, 2, 3, 1, 1, 1, 1, 1, 1);
2012-06-20 23:19:43 -07:00
e_widget_toolbook_page_append(otb, NULL, _("Position"), ol,
1, 0, 1, 0, 0.5, 0.0);
/* size */
ol = e_widget_list_add(evas, 0, 0);
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f pixels"), 4, 256, 4, 0,
NULL, &(cfdata->size), 100);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
2012-06-20 23:19:43 -07:00
ow = e_widget_check_add(evas, _("Shrink to Content Width"),
2010-04-28 07:58:27 -07:00
&(cfdata->fit_along));
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
2012-06-20 23:19:43 -07:00
e_widget_toolbook_page_append(otb, NULL, _("Size"), ol,
1, 0, 1, 0, 0.5, 0.0);
/* style */
ol = e_widget_list_add(evas, 0, 0);
ow = e_widget_ilist_add(evas, 60, 20, &(cfdata->style));
_fill_styles(cfdata, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
2012-06-20 23:19:43 -07:00
e_widget_toolbook_page_append(otb, NULL, _("Style"), ol,
1, 0, 1, 0, 0.5, 0.0);
/* autohide */
ol = e_widget_list_add(evas, 0, 0);
2012-06-20 23:19:43 -07:00
cfdata->o_autohide =
e_widget_check_add(evas, _("Auto-hide the shelf"), &(cfdata->autohide));
e_widget_on_change_hook_set(cfdata->o_autohide, _cb_autohide_change, cfdata);
e_widget_list_object_append(ol, cfdata->o_autohide, 1, 1, 0.5);
rg = e_widget_radio_group_new(&(cfdata->autohide_show_action));
ow = e_widget_radio_add(evas, _("Show on mouse in"), 0, rg);
e_widget_disabled_set(ow, !cfdata->autohide);
cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Show on mouse click"), 1, rg);
cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ow);
e_widget_disabled_set(ow, !cfdata->autohide);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_label_add(evas, _("Hide timeout"));
cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ow);
e_widget_disabled_set(ow, !cfdata->autohide);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
2012-06-20 23:19:43 -07:00
ow = e_widget_slider_add(evas, 1, 0, _("%.1f seconds"), 0.2, 6.0, 0.2, 0,
&(cfdata->hide_timeout), NULL, 100);
cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ow);
e_widget_disabled_set(ow, !cfdata->autohide);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_label_add(evas, _("Hide duration"));
cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ow);
e_widget_disabled_set(ow, !cfdata->autohide);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
2012-06-20 23:19:43 -07:00
ow = e_widget_slider_add(evas, 1, 0, _("%.2f seconds"), 0.05, 6.0, 0.05, 0,
&(cfdata->hide_duration), NULL, 100);
cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ow);
e_widget_disabled_set(ow, !cfdata->autohide);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_check_add(evas, _("Don't adjust windows when overlapping the shelf"),
&(cfdata->overlap));
e_widget_disabled_set(ow, ((!cfdata->autohide) || (!e_config->border_fix_on_shelf_toggle)));
cfdata->o_overlap = ow;
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
2012-06-20 23:19:43 -07:00
e_widget_toolbook_page_append(otb, NULL, _("Auto Hide"), ol,
1, 0, 1, 0, 0.5, 0.0);
/* Desktop */
ol = e_widget_list_add(evas, 0, 0);
rg = e_widget_radio_group_new(&(cfdata->desk_show_mode));
ow = e_widget_radio_add(evas, _("Show on all Desktops"), 0, rg);
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
ow = e_widget_radio_add(evas, _("Show on specified Desktops"), 1, rg);
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
cfdata->o_desk_list = e_widget_ilist_add(evas, 24, 24, NULL);
e_widget_ilist_multi_select_set(cfdata->o_desk_list, EINA_TRUE);
_fill_desks(cfdata);
e_widget_list_object_append(ol, cfdata->o_desk_list, 1, 1, 0.5);
2012-06-20 23:19:43 -07:00
e_widget_toolbook_page_append(otb, NULL, _("Desktop"), ol,
1, 0, 1, 0, 0.5, 0.0);
e_widget_toolbook_page_show(otb, 0);
return otb;
}
2012-06-20 23:19:43 -07:00
static int
_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
2010-01-14 14:10:38 -08:00
E_Config_Shelf_Desk *sd;
2012-05-03 19:34:56 -07:00
int recreate = 0;
2012-06-20 23:19:43 -07:00
if (cfdata->escfg->orient != cfdata->orient)
{
cfdata->escfg->orient = cfdata->orient;
2012-05-03 19:34:56 -07:00
recreate = 1;
}
2012-06-20 23:19:43 -07:00
if (cfdata->escfg->fit_along != cfdata->fit_along)
{
cfdata->escfg->fit_along = cfdata->fit_along;
cfdata->es->fit_along = cfdata->fit_along;
2012-05-03 19:34:56 -07:00
recreate = 1;
}
2012-06-20 23:19:43 -07:00
if (cfdata->escfg->size != cfdata->size)
{
cfdata->escfg->size = cfdata->size;
cfdata->es->size = cfdata->size;
2012-05-03 19:34:56 -07:00
recreate = 1;
}
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
cfdata->escfg->layer = cfdata->layer;
evas_object_layer_set(cfdata->es->comp_object, cfdata->escfg->layer);
cfdata->escfg->overlap = cfdata->overlap;
e_shelf_autohide_set(cfdata->es, cfdata->autohide + (cfdata->autohide * cfdata->autohide_show_action));
cfdata->escfg->autohide_show_action = cfdata->autohide_show_action;
cfdata->escfg->hide_timeout = cfdata->hide_timeout;
cfdata->escfg->hide_duration = cfdata->hide_duration;
cfdata->escfg->desk_show_mode = cfdata->desk_show_mode;
2010-01-14 14:10:38 -08:00
EINA_LIST_FREE(cfdata->escfg->desk_list, sd)
E_FREE(sd);
cfdata->escfg->desk_list = NULL;
2012-06-20 23:19:43 -07:00
if (cfdata->desk_show_mode)
{
2012-09-12 06:39:43 -07:00
const Eina_List *l;
const E_Ilist_Item *it;
int idx = -1;
2012-06-20 23:19:43 -07:00
EINA_LIST_FOREACH(e_widget_ilist_items_get(cfdata->o_desk_list), l, it)
{
E_Desk *desk;
idx++;
if ((!it) || (!it->selected)) continue;
if (!(desk = e_desk_at_pos_get(cfdata->es->zone, idx))) continue;
sd = E_NEW(E_Config_Shelf_Desk, 1);
sd->x = desk->x;
sd->y = desk->y;
2012-06-20 23:19:43 -07:00
cfdata->escfg->desk_list =
eina_list_append(cfdata->escfg->desk_list, sd);
}
}
e_gadcon_unpopulate(cfdata->es->gadcon);
if (!cfdata->escfg->style)
{
cfdata->escfg->style = eina_stringshare_ref(cfdata->style);
e_shelf_style_set(cfdata->es, cfdata->style);
}
else if ((cfdata->escfg->style) &&
(cfdata->escfg->style != cfdata->style))
{
eina_stringshare_replace(&cfdata->escfg->style, cfdata->style);
e_shelf_style_set(cfdata->es, cfdata->style);
}
2012-06-20 23:19:43 -07:00
if (recreate)
{
E_Zone *zone;
E_Config_Shelf *cf_es;
zone = cfdata->es->zone;
cf_es = cfdata->es->cfg;
cfdata->es->config_dialog = NULL;
e_shelf_hide(cfdata->es);
e_object_del(E_OBJECT(cfdata->es));
cfdata->es = e_shelf_config_new(zone, cf_es);
cfdata->es->config_dialog = cfd;
}
else
e_gadcon_populate(cfdata->es->gadcon);
2012-06-20 23:19:43 -07:00
if (cfdata->escfg->desk_show_mode)
{
E_Desk *desk;
Eina_List *l;
int show = 0;
desk = e_desk_current_get(cfdata->es->zone);
2012-06-20 23:19:43 -07:00
EINA_LIST_FOREACH(cfdata->escfg->desk_list, l, sd)
{
2012-06-20 23:19:43 -07:00
if ((desk->x == sd->x) && (desk->y == sd->y))
{
show = 1;
break;
}
}
if (show) e_shelf_show(cfdata->es);
else e_shelf_hide(cfdata->es);
}
else
e_shelf_show(cfdata->es);
if ((cfdata->escfg->autohide) && (!cfdata->es->hidden))
e_shelf_toggle(cfdata->es, 0);
else if ((!cfdata->escfg->autohide) && (cfdata->es->hidden))
e_shelf_toggle(cfdata->es, 1);
e_zone_useful_geometry_dirty(cfdata->es->zone);
e_config_save_queue();
cfdata->es->config_dialog = cfd;
return 1;
}
2012-06-20 23:19:43 -07:00
static void
_fill_styles(E_Config_Dialog_Data *cfdata, Evas_Object *obj)
{
Evas *evas;
Eina_List *l, *styles;
char *style;
const char *str;
int mw, n = 0;
evas = evas_object_evas_get(obj);
evas_event_freeze(evas);
edje_freeze();
e_widget_ilist_freeze(obj);
e_widget_ilist_clear(obj);
styles = e_theme_shelf_list();
2012-06-20 23:19:43 -07:00
EINA_LIST_FOREACH(styles, l, style)
{
Evas_Object *thumb, *ow;
char buff[4096];
thumb = e_livethumb_add(evas);
e_livethumb_vsize_set(thumb, 120, 40);
ow = edje_object_add(e_livethumb_evas_get(thumb));
snprintf(buff, sizeof(buff), "e/shelf/%s/base", style);
e_theme_edje_object_set(ow, "base/theme/shelf", buff);
e_livethumb_thumb_set(thumb, ow);
e_widget_ilist_append(obj, thumb, style, NULL, NULL, style);
if (!strcmp(cfdata->style, style))
e_widget_ilist_selected_set(obj, n);
n++;
}
e_widget_size_min_get(obj, &mw, NULL);
e_widget_size_min_set(obj, mw, 180);
e_widget_ilist_go(obj);
e_widget_ilist_thaw(obj);
edje_thaw();
evas_event_thaw(evas);
EINA_LIST_FREE(styles, str)
eina_stringshare_del(str);
}
2012-06-20 23:19:43 -07:00
static void
_cb_autohide_change(void *data, Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata;
Eina_List *l;
Evas_Object *ow;
if (!(cfdata = data)) return;
EINA_LIST_FOREACH(cfdata->autohide_list, l, ow)
e_widget_disabled_set(ow, !cfdata->autohide);
e_widget_disabled_set(cfdata->o_overlap, ((!cfdata->autohide) || (!e_config->border_fix_on_shelf_toggle)));
}
2012-06-20 23:19:43 -07:00
static void
_fill_desks(E_Config_Dialog_Data *cfdata)
{
Evas *evas;
int mw, x, y;
int i = 0;
evas = evas_object_evas_get(cfdata->o_desk_list);
evas_event_freeze(evas);
edje_freeze();
e_widget_ilist_freeze(cfdata->o_desk_list);
e_widget_ilist_clear(cfdata->o_desk_list);
for (y = 0; y < e_config->zone_desks_y_count; y++)
2012-06-20 23:19:43 -07:00
for (x = 0; x < e_config->zone_desks_x_count; x++)
{
E_Desk *desk;
Eina_List *l;
E_Config_Shelf_Desk *sd;
desk = e_desk_at_xy_get(cfdata->es->zone, x, y);
2012-06-20 23:19:43 -07:00
e_widget_ilist_append(cfdata->o_desk_list, NULL, desk->name,
NULL, NULL, NULL);
i++;
2012-06-20 23:19:43 -07:00
EINA_LIST_FOREACH(cfdata->desk_list, l, sd)
{
if ((sd->x != x) || (sd->y != y)) continue;
e_widget_ilist_multi_select(cfdata->o_desk_list, i);
break;
}
}
e_widget_size_min_get(cfdata->o_desk_list, &mw, NULL);
e_widget_size_min_set(cfdata->o_desk_list, mw, 180);
e_widget_ilist_go(cfdata->o_desk_list);
e_widget_ilist_thaw(cfdata->o_desk_list);
edje_thaw();
evas_event_thaw(evas);
}