2006-02-03 22:45:13 -08:00
|
|
|
#include "e.h"
|
|
|
|
|
2012-09-07 05:42:29 -07:00
|
|
|
static void _e_shelf_new_dialog_ok(void *data, char *text);
|
2012-06-26 04:32:02 -07:00
|
|
|
static void _e_shelf_del_cb(void *d);
|
2012-06-20 02:58:28 -07:00
|
|
|
static void _e_shelf_free(E_Shelf *es);
|
|
|
|
static void _e_shelf_gadcon_min_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
|
|
|
static void _e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h);
|
2006-04-04 08:42:25 -07:00
|
|
|
static Evas_Object *_e_shelf_gadcon_frame_request(void *data, E_Gadcon_Client *gcc, const char *style);
|
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
|
|
|
static void _e_shelf_toggle_client_fix(E_Shelf *es);
|
2012-06-20 02:58:28 -07:00
|
|
|
static void _e_shelf_cb_menu_config(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _e_shelf_cb_menu_edit(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _e_shelf_cb_menu_contents(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _e_shelf_cb_confirm_dialog_yes(void *data);
|
|
|
|
static void _e_shelf_cb_menu_delete(void *data, E_Menu *m, E_Menu_Item *mi);
|
|
|
|
static void _e_shelf_menu_append(E_Shelf *es, E_Menu *mn);
|
|
|
|
static void _e_shelf_cb_menu_items_append(void *data, E_Gadcon_Client *gcc, E_Menu *mn);
|
|
|
|
static void _e_shelf_cb_locked_set(void *data, int lock);
|
|
|
|
static void _e_shelf_cb_urgent_show(void *data);
|
|
|
|
static void _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
|
|
|
|
static Eina_Bool _e_shelf_cb_mouse_in(void *data, int type, void *event);
|
2012-09-07 11:59:43 -07:00
|
|
|
//static Eina_Bool _e_shelf_cb_mouse_out(void *data, int type, void *event);
|
|
|
|
//static void _e_shelf_cb_mouse_out2(E_Shelf *es, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Out *ev);
|
2012-06-20 02:58:28 -07:00
|
|
|
static int _e_shelf_cb_id_sort(const void *data1, const void *data2);
|
2015-03-18 15:09:09 -07:00
|
|
|
static void _e_shelf_cb_menu_rename(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED);
|
2012-06-20 02:58:28 -07:00
|
|
|
static Eina_Bool _e_shelf_cb_hide_animator(void *data);
|
|
|
|
static Eina_Bool _e_shelf_cb_hide_animator_timer(void *data);
|
|
|
|
static Eina_Bool _e_shelf_cb_hide_urgent_timer(void *data);
|
|
|
|
static Eina_Bool _e_shelf_cb_instant_hide_timer(void *data);
|
|
|
|
static void _e_shelf_menu_pre_cb(void *data, E_Menu *m);
|
|
|
|
static void _e_shelf_gadcon_client_remove(void *data, E_Gadcon_Client *gcc);
|
2012-10-05 02:57:34 -07:00
|
|
|
static int _e_shelf_gadcon_client_add(void *data, E_Gadcon_Client *gcc, const E_Gadcon_Client_Class *cc);
|
2012-06-20 02:58:28 -07:00
|
|
|
static const char *_e_shelf_orient_icon_name_get(E_Shelf *s);
|
|
|
|
static void _e_shelf_bindings_add(E_Shelf *es);
|
|
|
|
static void _e_shelf_bindings_del(E_Shelf *es);
|
|
|
|
static Eina_Bool _e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev);
|
2013-01-11 02:34:29 -08:00
|
|
|
static void _e_shelf_cb_dummy_del(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info);
|
|
|
|
static void _e_shelf_cb_dummy_moveresize(E_Shelf *, Evas *e, Evas_Object *obj, void *event_info);
|
2012-09-20 01:44:30 -07:00
|
|
|
static Eina_Bool _e_shelf_gadcon_populate_handler_cb(void *, int, void *);
|
2013-01-11 02:34:29 -08:00
|
|
|
static void _e_shelf_event_rename_end_cb(void *data, E_Event_Shelf *ev);
|
2006-02-03 22:45:13 -08:00
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
static Eina_List *shelves = NULL;
|
2012-06-28 03:59:19 -07:00
|
|
|
static Eina_List *dummies = NULL;
|
2006-02-03 22:45:13 -08:00
|
|
|
|
2012-09-07 05:42:29 -07:00
|
|
|
static int orientations[] =
|
|
|
|
{
|
|
|
|
[E_GADCON_ORIENT_FLOAT] = 2,
|
|
|
|
[E_GADCON_ORIENT_HORIZ] = 2,
|
|
|
|
[E_GADCON_ORIENT_VERT] = 2,
|
|
|
|
[E_GADCON_ORIENT_LEFT] = 37,
|
|
|
|
[E_GADCON_ORIENT_RIGHT] = 31,
|
|
|
|
[E_GADCON_ORIENT_TOP] = 29,
|
|
|
|
[E_GADCON_ORIENT_BOTTOM] = 23,
|
|
|
|
[E_GADCON_ORIENT_CORNER_TL] = 19,
|
|
|
|
[E_GADCON_ORIENT_CORNER_TR] = 17,
|
|
|
|
[E_GADCON_ORIENT_CORNER_BL] = 13,
|
|
|
|
[E_GADCON_ORIENT_CORNER_BR] = 11,
|
|
|
|
[E_GADCON_ORIENT_CORNER_LT] = 7,
|
|
|
|
[E_GADCON_ORIENT_CORNER_RT] = 5,
|
|
|
|
[E_GADCON_ORIENT_CORNER_LB] = 3,
|
|
|
|
[E_GADCON_ORIENT_CORNER_RB] = 2
|
|
|
|
};
|
|
|
|
|
2012-09-07 06:44:25 -07:00
|
|
|
static const char *orient_names[] =
|
|
|
|
{
|
2012-12-09 06:39:30 -08:00
|
|
|
[E_GADCON_ORIENT_FLOAT] = N_("Float"),
|
|
|
|
[E_GADCON_ORIENT_HORIZ] = N_("Horizontal"),
|
|
|
|
[E_GADCON_ORIENT_VERT] = N_("Vertical"),
|
|
|
|
[E_GADCON_ORIENT_LEFT] = N_("Left"),
|
|
|
|
[E_GADCON_ORIENT_RIGHT] = N_("Right"),
|
|
|
|
[E_GADCON_ORIENT_TOP] = N_("Top"),
|
|
|
|
[E_GADCON_ORIENT_BOTTOM] = N_("Bottom"),
|
|
|
|
[E_GADCON_ORIENT_CORNER_TL] = N_("Top-left Corner"),
|
|
|
|
[E_GADCON_ORIENT_CORNER_TR] = N_("Top-right Corner"),
|
|
|
|
[E_GADCON_ORIENT_CORNER_BL] = N_("Bottom-left Corner"),
|
|
|
|
[E_GADCON_ORIENT_CORNER_BR] = N_("Bottom-right Corner"),
|
|
|
|
[E_GADCON_ORIENT_CORNER_LT] = N_("Left-top Corner"),
|
|
|
|
[E_GADCON_ORIENT_CORNER_RT] = N_("Right-top Corner"),
|
|
|
|
[E_GADCON_ORIENT_CORNER_LB] = N_("Left-bottom Corner"),
|
|
|
|
[E_GADCON_ORIENT_CORNER_RB] = N_("Right-bottom Corner")
|
2012-09-07 06:44:25 -07:00
|
|
|
};
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int E_EVENT_SHELF_RENAME = -1;
|
|
|
|
E_API int E_EVENT_SHELF_ADD = -1;
|
|
|
|
E_API int E_EVENT_SHELF_DEL = -1;
|
2012-09-20 01:44:30 -07:00
|
|
|
static Ecore_Event_Handler *_e_shelf_gadcon_populate_handler = NULL;
|
2012-09-20 06:06:15 -07:00
|
|
|
static Ecore_Event_Handler *_e_shelf_module_init_end_handler = NULL;
|
2012-10-11 05:49:13 -07:00
|
|
|
static Ecore_Event_Handler *_e_shelf_zone_moveresize_handler = NULL;
|
2012-07-03 04:55:00 -07:00
|
|
|
|
2015-09-22 09:42:39 -07:00
|
|
|
static void
|
|
|
|
_e_shelf_remaximize(E_Shelf *es)
|
|
|
|
{
|
|
|
|
E_Client *ec;
|
|
|
|
|
|
|
|
if (es->cfg->overlap) return;
|
|
|
|
E_CLIENT_FOREACH(ec)
|
|
|
|
{
|
|
|
|
E_Maximize max = ec->maximized;
|
|
|
|
|
|
|
|
if (!ec->maximized) continue;
|
|
|
|
if ((!ec->sticky) && (!e_shelf_desk_visible(es, ec->desk ?: e_desk_current_get(es->zone))))
|
|
|
|
continue;
|
|
|
|
e_client_unmaximize(ec, ec->maximized);
|
|
|
|
e_client_maximize(ec, max);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-03 22:45:13 -08:00
|
|
|
/* externally accessible functions */
|
2010-11-22 07:21:32 -08:00
|
|
|
EINTERN int
|
2006-02-03 22:45:13 -08:00
|
|
|
e_shelf_init(void)
|
|
|
|
{
|
2012-11-02 00:53:37 -07:00
|
|
|
E_EVENT_SHELF_RENAME = ecore_event_type_new();
|
2012-07-03 04:55:00 -07:00
|
|
|
E_EVENT_SHELF_ADD = ecore_event_type_new();
|
2012-08-17 01:23:09 -07:00
|
|
|
E_EVENT_SHELF_DEL = ecore_event_type_new();
|
2012-09-20 01:44:30 -07:00
|
|
|
_e_shelf_gadcon_populate_handler = ecore_event_handler_add(E_EVENT_GADCON_POPULATE, _e_shelf_gadcon_populate_handler_cb, NULL);
|
2006-02-03 22:45:13 -08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-11-22 07:21:32 -08:00
|
|
|
EINTERN int
|
2006-02-03 22:45:13 -08:00
|
|
|
e_shelf_shutdown(void)
|
|
|
|
{
|
2011-02-15 21:20:13 -08:00
|
|
|
if (x_fatal) return 1;
|
2007-03-24 09:58:49 -07:00
|
|
|
while (shelves)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
E_Shelf *es;
|
2007-03-24 09:58:49 -07:00
|
|
|
|
2012-06-20 02:58:28 -07:00
|
|
|
es = eina_list_data_get(shelves);
|
|
|
|
e_object_del(E_OBJECT(es));
|
2007-03-24 09:58:49 -07:00
|
|
|
}
|
2012-10-29 01:01:25 -07:00
|
|
|
if (_e_shelf_gadcon_populate_handler)
|
|
|
|
_e_shelf_gadcon_populate_handler = ecore_event_handler_del(_e_shelf_gadcon_populate_handler);
|
|
|
|
if (_e_shelf_module_init_end_handler)
|
|
|
|
_e_shelf_module_init_end_handler = ecore_event_handler_del(_e_shelf_module_init_end_handler);
|
|
|
|
if (_e_shelf_zone_moveresize_handler)
|
|
|
|
_e_shelf_zone_moveresize_handler = ecore_event_handler_del(_e_shelf_zone_moveresize_handler);
|
2007-03-24 09:58:49 -07:00
|
|
|
|
2006-02-03 22:45:13 -08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2010-11-22 07:21:32 -08:00
|
|
|
e_shelf_config_update(void)
|
2006-02-15 22:32:54 -08:00
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l;
|
2009-08-21 08:08:49 -07:00
|
|
|
E_Config_Shelf *cf_es;
|
2007-10-04 23:05:16 -07:00
|
|
|
int id = 0;
|
2007-03-24 09:58:49 -07:00
|
|
|
|
2006-07-20 06:36:02 -07:00
|
|
|
while (shelves)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
E_Shelf *es;
|
2006-07-20 06:36:02 -07:00
|
|
|
|
2012-06-20 02:58:28 -07:00
|
|
|
es = eina_list_data_get(shelves);
|
|
|
|
e_object_del(E_OBJECT(es));
|
2006-07-20 06:36:02 -07:00
|
|
|
}
|
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(e_config->shelves, l, cf_es)
|
2006-02-15 22:32:54 -08:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
E_Zone *zone;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2012-06-20 02:58:28 -07:00
|
|
|
if (cf_es->id <= 0) cf_es->id = id + 1;
|
2015-03-13 12:54:51 -07:00
|
|
|
zone = e_comp_zone_number_get(cf_es->zone);
|
2012-06-20 02:58:28 -07:00
|
|
|
if (zone)
|
|
|
|
e_shelf_config_new(zone, cf_es);
|
|
|
|
id = cf_es->id;
|
2006-02-15 22:32:54 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Eina_List *
|
2012-06-28 03:59:19 -07:00
|
|
|
e_shelf_list_all(void)
|
|
|
|
{
|
|
|
|
Eina_List *d = NULL, *s = NULL, *ret = NULL;
|
|
|
|
|
|
|
|
if (shelves)
|
|
|
|
s = eina_list_clone(shelves);
|
|
|
|
if (dummies)
|
|
|
|
d = eina_list_clone(dummies);
|
|
|
|
if (s && d)
|
|
|
|
ret = eina_list_merge(s, d);
|
|
|
|
else
|
2013-01-11 02:34:29 -08:00
|
|
|
ret = d ? : s;
|
2012-06-28 03:59:19 -07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Eina_List *
|
2006-04-20 04:30:25 -07:00
|
|
|
e_shelf_list(void)
|
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
shelves = eina_list_sort(shelves, -1, _e_shelf_cb_id_sort);
|
2006-04-20 04:30:25 -07:00
|
|
|
return shelves;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Shelf *
|
2012-06-28 03:59:19 -07:00
|
|
|
e_shelf_zone_dummy_new(E_Zone *zone, Evas_Object *obj, int id)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2012-07-28 08:20:08 -07:00
|
|
|
|
2012-06-28 03:59:19 -07:00
|
|
|
es = E_OBJECT_ALLOC(E_Shelf, E_SHELF_DUMMY_TYPE, _e_shelf_free);
|
|
|
|
if (!es) return NULL;
|
|
|
|
es->id = id;
|
|
|
|
evas_object_geometry_get(obj, &es->x, &es->y, &es->w, &es->h);
|
2013-01-11 02:34:29 -08:00
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
|
2012-07-28 08:20:08 -07:00
|
|
|
(Evas_Object_Event_Cb)_e_shelf_cb_dummy_del, es);
|
2013-01-11 02:34:29 -08:00
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
|
2012-07-28 08:20:08 -07:00
|
|
|
(Evas_Object_Event_Cb)_e_shelf_cb_dummy_moveresize, es);
|
2013-01-11 02:34:29 -08:00
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
|
2012-07-28 08:20:08 -07:00
|
|
|
(Evas_Object_Event_Cb)_e_shelf_cb_dummy_moveresize, es);
|
2012-06-28 03:59:19 -07:00
|
|
|
es->zone = zone;
|
|
|
|
es->dummy = 1;
|
|
|
|
es->o_base = obj;
|
2012-07-31 02:43:10 -07:00
|
|
|
es->cfg = E_NEW(E_Config_Shelf, 1);
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-06-28 03:59:19 -07:00
|
|
|
e_object_del_attach_func_set(E_OBJECT(es), _e_shelf_del_cb);
|
|
|
|
dummies = eina_list_append(dummies, es);
|
2012-07-28 08:20:08 -07:00
|
|
|
|
2012-06-28 03:59:19 -07:00
|
|
|
return es;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Shelf *
|
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_shelf_zone_new(E_Zone *zone, const char *name, const char *style, E_Layer layer, int id)
|
2006-02-03 22:45:13 -08:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
char buf[1024];
|
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_Comp_Object_Type type = E_COMP_OBJECT_TYPE_POPUP;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-02-03 22:45:13 -08:00
|
|
|
es = E_OBJECT_ALLOC(E_Shelf, E_SHELF_TYPE, _e_shelf_free);
|
|
|
|
if (!es) return NULL;
|
2007-10-04 23:05:16 -07:00
|
|
|
es->id = id;
|
2006-02-14 05:09:01 -08:00
|
|
|
es->x = 0;
|
|
|
|
es->y = 0;
|
2006-02-15 22:32:54 -08:00
|
|
|
es->w = 32;
|
2006-02-14 05:09:01 -08:00
|
|
|
es->h = 32;
|
2008-01-19 03:41:42 -08:00
|
|
|
es->zone = zone;
|
2012-06-26 04:32:02 -07:00
|
|
|
e_object_del_attach_func_set(E_OBJECT(es), _e_shelf_del_cb);
|
2009-04-22 19:24:59 -07:00
|
|
|
e_zone_useful_geometry_dirty(zone);
|
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
|
|
|
|
|
|
|
|
2015-03-13 14:44:24 -07:00
|
|
|
es->ee = e_comp->ee;
|
|
|
|
es->evas = e_comp->evas;
|
2006-04-04 02:54:50 -07:00
|
|
|
es->fit_along = 1;
|
2006-02-14 05:09:01 -08:00
|
|
|
es->layer = layer;
|
2006-04-06 00:26:11 -07:00
|
|
|
|
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_LIST_HANDLER_APPEND(es->handlers, E_EVENT_ZONE_EDGE_MOVE, _e_shelf_cb_mouse_in, es);
|
2006-02-03 22:45:13 -08:00
|
|
|
es->o_base = edje_object_add(es->evas);
|
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
|
|
|
evas_object_name_set(es->o_base, "shelf");
|
2013-02-18 05:43:47 -08:00
|
|
|
evas_object_event_callback_add(es->o_base, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_e_shelf_cb_mouse_down, es);
|
2008-10-15 08:12:56 -07:00
|
|
|
es->name = eina_stringshare_add(name);
|
2006-02-14 05:09:01 -08:00
|
|
|
evas_object_resize(es->o_base, es->w, es->h);
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-08-16 17:25:37 -07:00
|
|
|
e_shelf_style_set(es, style);
|
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
|
|
|
evas_object_move(es->o_base, es->zone->x + es->x, es->zone->y + es->y);
|
|
|
|
if (layer == E_LAYER_DESKTOP)
|
|
|
|
type = E_COMP_OBJECT_TYPE_NONE;
|
|
|
|
es->comp_object = e_comp_object_util_add(es->o_base, type);
|
2013-09-05 03:02:02 -07:00
|
|
|
evas_object_data_set(es->comp_object, "E_Shelf", es);
|
2014-07-30 11:23:25 -07:00
|
|
|
evas_object_data_set(es->comp_object, "comp_skip", (void*)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
|
|
|
evas_object_name_set(es->comp_object, es->name);
|
|
|
|
evas_object_layer_set(es->comp_object, layer);
|
2014-02-06 18:43:40 -08:00
|
|
|
evas_object_lower(es->comp_object);
|
2006-07-20 06:36:02 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
es->gadcon =
|
2012-07-28 08:20:08 -07:00
|
|
|
e_gadcon_swallowed_new(es->name, es->id, es->o_base, "e.swallow.content");
|
2013-01-05 14:54:51 -08:00
|
|
|
if (es->name)
|
|
|
|
snprintf(buf, sizeof(buf), "%s", es->name);
|
|
|
|
else
|
|
|
|
snprintf(buf, sizeof(buf), _("Shelf #%d"), es->id);
|
2013-01-11 02:34:29 -08:00
|
|
|
es->gadcon->location =
|
|
|
|
e_gadcon_location_new(buf, E_GADCON_SITE_SHELF,
|
|
|
|
_e_shelf_gadcon_client_add, es,
|
2012-07-28 08:20:08 -07:00
|
|
|
_e_shelf_gadcon_client_remove, es);
|
2009-08-31 04:23:03 -07:00
|
|
|
e_gadcon_location_register(es->gadcon->location);
|
2012-06-20 02:58:28 -07:00
|
|
|
// hmm dnd in ibar and ibox kill this. ok. need to look into this more
|
2008-10-22 21:49:52 -07:00
|
|
|
// es->gadcon->instant_edit = 1;
|
2006-04-20 04:30:25 -07:00
|
|
|
e_gadcon_min_size_request_callback_set(es->gadcon,
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_gadcon_min_size_request, es);
|
2007-04-06 12:01:29 -07:00
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
e_gadcon_size_request_callback_set(es->gadcon,
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_gadcon_size_request, es);
|
2006-04-04 08:42:25 -07:00
|
|
|
e_gadcon_frame_request_callback_set(es->gadcon,
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_gadcon_frame_request, es);
|
2006-02-10 04:21:22 -08:00
|
|
|
e_gadcon_orient(es->gadcon, E_GADCON_ORIENT_TOP);
|
2012-06-20 02:58:28 -07:00
|
|
|
snprintf(buf, sizeof(buf), "e,state,orientation,%s",
|
|
|
|
e_shelf_orient_string_get(es));
|
2006-08-22 00:39:11 -07:00
|
|
|
edje_object_signal_emit(es->o_base, buf, "e");
|
2006-04-05 07:00:32 -07:00
|
|
|
edje_object_message_signal_process(es->o_base);
|
2006-02-10 04:21:22 -08:00
|
|
|
e_gadcon_zone_set(es->gadcon, zone);
|
|
|
|
e_gadcon_ecore_evas_set(es->gadcon, es->ee);
|
2007-05-07 12:54:12 -07:00
|
|
|
e_gadcon_shelf_set(es->gadcon, es);
|
2015-01-11 12:57:07 -08:00
|
|
|
e_gadcon_xdnd_window_set(es->gadcon, e_comp->ee_win);
|
|
|
|
e_gadcon_dnd_window_set(es->gadcon, e_comp->ee_win);
|
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
|
|
|
evas_object_clip_set(es->comp_object, es->zone->bg_clip_object);
|
2006-06-15 00:24:10 -07:00
|
|
|
e_gadcon_util_menu_attach_func_set(es->gadcon,
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_cb_menu_items_append, es);
|
2009-01-24 06:09:37 -08:00
|
|
|
|
|
|
|
e_gadcon_util_lock_func_set(es->gadcon,
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_cb_locked_set, es);
|
2009-03-24 09:08:37 -07:00
|
|
|
e_gadcon_util_urgent_show_func_set(es->gadcon,
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_cb_urgent_show, es);
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2008-10-22 04:49:33 -07:00
|
|
|
shelves = eina_list_append(shelves, es);
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2007-04-06 13:23:45 -07:00
|
|
|
es->hidden = 0;
|
2007-04-06 12:01:29 -07:00
|
|
|
es->hide_step = 0;
|
2009-01-24 06:09:37 -08:00
|
|
|
es->locked = 0;
|
2007-05-07 10:46:25 -07:00
|
|
|
|
2007-04-06 12:01:29 -07:00
|
|
|
es->hide_origin = -1;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2012-07-03 04:55:00 -07:00
|
|
|
{
|
|
|
|
E_Event_Shelf *ev;
|
2012-07-28 08:20:08 -07:00
|
|
|
|
2012-07-03 04:55:00 -07:00
|
|
|
ev = E_NEW(E_Event_Shelf, 1);
|
|
|
|
ev->shelf = es;
|
|
|
|
ecore_event_add(E_EVENT_SHELF_ADD, ev, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2006-02-03 22:45:13 -08:00
|
|
|
return es;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2012-08-07 03:48:47 -07:00
|
|
|
e_shelf_rename_dialog(E_Shelf *es)
|
|
|
|
{
|
|
|
|
if (!es) return;
|
|
|
|
if (es->rename_dialog) return;
|
|
|
|
_e_shelf_cb_menu_rename(es, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-05-04 21:47:57 -07:00
|
|
|
e_shelf_zone_move_resize_handle(E_Zone *zone)
|
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l;
|
2006-05-04 21:47:57 -07:00
|
|
|
E_Shelf *es;
|
2009-08-15 04:54:35 -07:00
|
|
|
Evas_Coord w, h;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2009-08-21 08:08:49 -07:00
|
|
|
EINA_LIST_FOREACH(shelves, l, es)
|
2006-05-04 21:47:57 -07:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
if (es->zone == zone)
|
|
|
|
{
|
|
|
|
E_Gadcon *gc;
|
|
|
|
|
|
|
|
gc = es->gadcon;
|
|
|
|
if (gc->min_size_request.func)
|
|
|
|
{
|
|
|
|
/* let gadcon container decrease to any size */
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(gc->o_container, 0, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
|
|
|
evas_object_smart_callback_call(gc->o_container, "min_size_request", NULL);
|
|
|
|
e_shelf_position_calc(es);
|
|
|
|
if (gc->min_size_request.func)
|
|
|
|
{
|
|
|
|
evas_object_geometry_get(gc->o_container, NULL, NULL, &w, &h);
|
|
|
|
/* fix gadcon container min size to current geometry */
|
2014-06-07 09:29:17 -07:00
|
|
|
evas_object_size_hint_min_set(gc->o_container, w, h);
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
|
|
|
}
|
2006-05-04 21:47:57 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-03 22:45:13 -08:00
|
|
|
e_shelf_populate(E_Shelf *es)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
2006-06-08 12:28:46 -07:00
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
2006-02-05 00:17:40 -08:00
|
|
|
e_gadcon_populate(es->gadcon);
|
2006-02-03 22:45:13 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-15 22:32:54 -08:00
|
|
|
e_shelf_show(E_Shelf *es)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
2006-06-08 12:28:46 -07:00
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
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
|
|
|
evas_object_show(es->comp_object);
|
2006-02-15 22:32:54 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-15 22:32:54 -08:00
|
|
|
e_shelf_hide(E_Shelf *es)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
2006-06-08 12:28:46 -07:00
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
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
|
|
|
evas_object_hide(es->comp_object);
|
2006-02-15 22:32:54 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2007-11-23 01:18:21 -08:00
|
|
|
e_shelf_locked_set(E_Shelf *es, int lock)
|
|
|
|
{
|
|
|
|
if (lock)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
e_shelf_toggle(es, 1);
|
|
|
|
es->locked++;
|
2007-11-23 01:18:21 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
if (es->locked > 0)
|
|
|
|
es->locked--;
|
|
|
|
if (!es->locked)
|
|
|
|
e_shelf_toggle(es, es->toggle);
|
2007-11-23 01:18:21 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2012-08-07 03:28:28 -07:00
|
|
|
e_shelf_name_set(E_Shelf *es, const char *name)
|
|
|
|
{
|
2012-11-02 00:53:37 -07:00
|
|
|
E_Event_Shelf *ev;
|
|
|
|
|
2012-08-07 03:28:28 -07:00
|
|
|
if (!es) return;
|
|
|
|
if (!name) return;
|
|
|
|
if (es->name == name) return;
|
|
|
|
eina_stringshare_replace(&es->name, name);
|
|
|
|
eina_stringshare_replace(&es->cfg->name, name);
|
2012-11-02 00:53:37 -07:00
|
|
|
ev = E_NEW(E_Event_Shelf, 1);
|
|
|
|
ev->shelf = es;
|
2012-11-02 01:03:35 -07:00
|
|
|
e_object_ref(E_OBJECT(es));
|
2012-11-02 00:53:37 -07:00
|
|
|
ecore_event_add(E_EVENT_SHELF_RENAME, ev, (Ecore_End_Cb)_e_shelf_event_rename_end_cb, NULL);
|
2012-08-07 03:28:28 -07:00
|
|
|
if (es->dummy) return;
|
|
|
|
e_gadcon_name_set(es->gadcon, name);
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2007-04-06 13:23:45 -07:00
|
|
|
e_shelf_toggle(E_Shelf *es, int show)
|
|
|
|
{
|
2007-11-23 01:18:21 -08:00
|
|
|
E_OBJECT_CHECK(es);
|
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
|
|
|
|
|
|
|
es->toggle = show;
|
2012-12-06 03:03:32 -08:00
|
|
|
if (es->autohide_timer) ecore_timer_del(es->autohide_timer);
|
|
|
|
es->autohide_timer = NULL;
|
2007-11-23 01:23:52 -08:00
|
|
|
if (es->locked) return;
|
|
|
|
es->interrupted = -1;
|
2009-03-23 05:14:31 -07:00
|
|
|
es->urgent_show = 0;
|
2007-11-23 01:18:21 -08:00
|
|
|
if ((show) && (es->hidden))
|
2009-04-27 08:42:43 -07:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
es->hidden = 0;
|
|
|
|
edje_object_signal_emit(es->o_base, "e,state,visible", "e");
|
|
|
|
if (es->instant_delay >= 0.0)
|
|
|
|
{
|
|
|
|
_e_shelf_cb_instant_hide_timer(es);
|
|
|
|
es->hide_timer =
|
|
|
|
ecore_timer_add(es->cfg->hide_timeout,
|
2009-04-27 08:42:43 -07:00
|
|
|
_e_shelf_cb_hide_urgent_timer, es);
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (es->hide_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(es->hide_timer);
|
|
|
|
es->hide_timer = NULL;
|
|
|
|
}
|
|
|
|
if (!es->hide_animator)
|
|
|
|
es->hide_animator =
|
|
|
|
ecore_animator_add(_e_shelf_cb_hide_animator, es);
|
|
|
|
}
|
2007-11-23 01:18:21 -08:00
|
|
|
}
|
2012-10-18 00:39:02 -07:00
|
|
|
else if ((!show) && (!es->hidden) && ((!es->gadcon) || (!es->gadcon->editing)) &&
|
2009-04-27 08:42:43 -07:00
|
|
|
(es->cfg->autohide))
|
2007-11-23 01:18:21 -08:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
if (es->instant_delay >= 0.0)
|
|
|
|
{
|
2009-03-23 05:14:31 -07:00
|
|
|
if (es->hide_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(es->hide_timer);
|
|
|
|
es->hide_timer = NULL;
|
|
|
|
}
|
2012-06-20 02:58:28 -07:00
|
|
|
es->hidden = 1;
|
|
|
|
if (!es->instant_timer)
|
|
|
|
es->instant_timer =
|
|
|
|
ecore_timer_add(es->instant_delay,
|
|
|
|
_e_shelf_cb_instant_hide_timer, es);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (es->hide_animator)
|
|
|
|
{
|
|
|
|
es->interrupted = show;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
es->hidden = 1;
|
|
|
|
if (es->hide_timer) ecore_timer_del(es->hide_timer);
|
|
|
|
es->hide_timer =
|
|
|
|
ecore_timer_add(es->cfg->hide_timeout,
|
2009-04-27 08:42:43 -07:00
|
|
|
_e_shelf_cb_hide_animator_timer, es);
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
2007-11-23 01:18:21 -08:00
|
|
|
}
|
2007-04-06 13:23:45 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2009-03-23 05:14:31 -07:00
|
|
|
e_shelf_urgent_show(E_Shelf *es)
|
|
|
|
{
|
|
|
|
e_shelf_toggle(es, 1);
|
|
|
|
es->urgent_show = 1;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-14 05:09:01 -08:00
|
|
|
e_shelf_move(E_Shelf *es, int x, int y)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
2006-06-08 12:28:46 -07:00
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
2015-09-22 09:42:39 -07:00
|
|
|
if ((es->x == x) && (es->y == y)) return;
|
2006-02-14 05:09:01 -08:00
|
|
|
es->x = x;
|
|
|
|
es->y = y;
|
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
|
|
|
evas_object_move(es->comp_object, es->zone->x + es->x, es->zone->y + es->y);
|
2015-09-22 09:42:39 -07:00
|
|
|
_e_shelf_remaximize(es);
|
2006-02-14 05:09:01 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-14 05:09:01 -08:00
|
|
|
e_shelf_resize(E_Shelf *es, int w, int h)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
2006-06-08 12:28:46 -07:00
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
2015-09-22 09:42:39 -07:00
|
|
|
if ((es->w == w) && (es->h == h)) return;
|
2006-02-14 05:09:01 -08:00
|
|
|
es->w = w;
|
|
|
|
es->h = h;
|
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
|
|
|
evas_object_resize(es->comp_object, es->w, es->h);
|
2015-09-22 09:42:39 -07:00
|
|
|
_e_shelf_remaximize(es);
|
2006-02-14 05:09:01 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-14 05:09:01 -08:00
|
|
|
e_shelf_move_resize(E_Shelf *es, int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
2006-06-08 12:28:46 -07:00
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
2015-09-22 09:42:39 -07:00
|
|
|
if ((es->x == x) && (es->y == y) && (es->w == w) && (es->h == h)) return;
|
2006-02-14 05:09:01 -08:00
|
|
|
es->x = x;
|
|
|
|
es->y = y;
|
|
|
|
es->w = w;
|
|
|
|
es->h = h;
|
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
|
|
|
evas_object_move(es->comp_object, es->zone->x + es->x, es->zone->y + es->y);
|
|
|
|
evas_object_resize(es->comp_object, es->w, es->h);
|
2015-09-22 09:42:39 -07:00
|
|
|
_e_shelf_remaximize(es);
|
2006-02-14 05:09:01 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-14 05:09:01 -08:00
|
|
|
e_shelf_save(E_Shelf *es)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
2006-06-08 12:28:46 -07:00
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
2006-02-16 01:27:37 -08:00
|
|
|
if (es->cfg)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
es->cfg->orient = es->gadcon->orient;
|
|
|
|
if (es->cfg->style) eina_stringshare_del(es->cfg->style);
|
|
|
|
es->cfg->style = eina_stringshare_add(es->style);
|
2006-02-16 01:27:37 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
E_Config_Shelf *cf_es;
|
|
|
|
|
|
|
|
cf_es = E_NEW(E_Config_Shelf, 1);
|
|
|
|
cf_es->name = eina_stringshare_add(es->name);
|
|
|
|
cf_es->zone = es->zone->num;
|
|
|
|
cf_es->layer = es->layer;
|
|
|
|
e_config->shelves = eina_list_append(e_config->shelves, cf_es);
|
|
|
|
cf_es->orient = es->gadcon->orient;
|
|
|
|
cf_es->style = eina_stringshare_add(es->style);
|
|
|
|
cf_es->fit_along = es->fit_along;
|
|
|
|
cf_es->fit_size = es->fit_size;
|
|
|
|
cf_es->overlap = 0;
|
|
|
|
cf_es->autohide = 0;
|
|
|
|
cf_es->hide_timeout = 1.0;
|
|
|
|
cf_es->hide_duration = 1.0;
|
|
|
|
es->cfg = cf_es;
|
2006-02-16 01:27:37 -08:00
|
|
|
}
|
|
|
|
e_config_save_queue();
|
2006-02-14 05:09:01 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-15 22:32:54 -08:00
|
|
|
e_shelf_unsave(E_Shelf *es)
|
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
2006-06-08 12:28:46 -07:00
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
2012-09-07 04:00:25 -07:00
|
|
|
es->cfg_delete = 1;
|
2006-02-15 22:32:54 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-02-14 05:09:01 -08:00
|
|
|
e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient)
|
|
|
|
{
|
2012-08-22 00:02:41 -07:00
|
|
|
char buf[4096];
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-02-14 05:09:01 -08:00
|
|
|
E_OBJECT_CHECK(es);
|
2012-06-28 03:59:19 -07:00
|
|
|
E_OBJECT_IF_NOT_TYPE(es, E_SHELF_DUMMY_TYPE)
|
2014-02-25 11:28:12 -08:00
|
|
|
{
|
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
|
|
|
}
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2012-06-28 03:59:19 -07:00
|
|
|
if (!es->dummy)
|
|
|
|
{
|
2012-07-31 02:43:10 -07:00
|
|
|
e_gadcon_orient(es->gadcon, orient);
|
2012-06-28 03:59:19 -07:00
|
|
|
snprintf(buf, sizeof(buf), "e,state,orientation,%s",
|
|
|
|
e_shelf_orient_string_get(es));
|
|
|
|
edje_object_signal_emit(es->o_base, buf, "e");
|
|
|
|
edje_object_message_signal_process(es->o_base);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_gadcon_location_set_icon_name(es->gadcon->location,
|
2012-07-28 08:20:08 -07:00
|
|
|
_e_shelf_orient_icon_name_get(es));
|
2012-06-28 03:59:19 -07:00
|
|
|
}
|
2009-04-22 19:24:59 -07:00
|
|
|
e_zone_useful_geometry_dirty(es->zone);
|
2006-04-05 07:00:32 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API const char *
|
2010-09-06 10:38:18 -07:00
|
|
|
e_shelf_orient_string_get(E_Shelf *es)
|
|
|
|
{
|
|
|
|
const char *sig = "";
|
|
|
|
|
|
|
|
switch (es->gadcon->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "float";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "horizontal";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_VERT:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "vertical";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_LEFT:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "left";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "right";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_TOP:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "top";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "bottom";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "top_left";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "top_right";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "bottom_left";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "bottom_right";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "left_top";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "right_top";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "left_bottom";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
2012-06-20 02:58:28 -07:00
|
|
|
sig = "right_bottom";
|
|
|
|
break;
|
|
|
|
|
2010-09-06 10:38:18 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
2010-09-06 10:38:18 -07:00
|
|
|
}
|
|
|
|
return sig;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2006-04-22 23:56:22 -07:00
|
|
|
e_shelf_position_calc(E_Shelf *es)
|
2006-02-15 22:32:54 -08:00
|
|
|
{
|
2006-04-04 08:42:25 -07:00
|
|
|
E_Gadcon_Orient orient = E_GADCON_ORIENT_FLOAT;
|
2012-07-28 08:32:50 -07:00
|
|
|
int size = (40 * e_scale);
|
2012-10-11 05:49:13 -07:00
|
|
|
int x, y, w, h;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2012-10-11 05:49:13 -07:00
|
|
|
x = es->x, y = es->y, w = es->w, h = es->h;
|
2006-04-04 08:42:25 -07:00
|
|
|
if (es->cfg)
|
2006-02-15 22:32:54 -08:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
orient = es->cfg->orient;
|
|
|
|
size = es->cfg->size * e_scale;
|
2006-04-04 08:42:25 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
orient = es->gadcon->orient;
|
|
|
|
switch (orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) w = es->zone->w;
|
|
|
|
if (!es->fit_size) h = size;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) w = es->zone->w;
|
|
|
|
if (!es->fit_size) h = size;
|
|
|
|
x = (es->zone->w - w) / 2;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_VERT:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) h = es->zone->h;
|
|
|
|
if (!es->fit_size) w = size;
|
|
|
|
y = (es->zone->h - h) / 2;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_LEFT:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) h = es->zone->h;
|
|
|
|
if (!es->fit_size) w = size;
|
|
|
|
x = 0;
|
|
|
|
y = (es->zone->h - h) / 2;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) h = es->zone->h;
|
|
|
|
if (!es->fit_size) w = size;
|
|
|
|
x = es->zone->w - w;
|
|
|
|
y = (es->zone->h - h) / 2;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_TOP:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) w = es->zone->w;
|
|
|
|
if (!es->fit_size) h = size;
|
|
|
|
x = (es->zone->w - w) / 2;
|
|
|
|
y = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) w = es->zone->w;
|
|
|
|
if (!es->fit_size) h = size;
|
|
|
|
x = (es->zone->w - w) / 2;
|
|
|
|
y = es->zone->h - h;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) w = es->zone->w;
|
|
|
|
if (!es->fit_size) h = size;
|
|
|
|
x = 0;
|
|
|
|
y = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) w = es->zone->w;
|
|
|
|
if (!es->fit_size) h = size;
|
|
|
|
x = es->zone->w - w;
|
|
|
|
y = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) w = es->zone->w;
|
|
|
|
if (!es->fit_size) h = size;
|
|
|
|
x = 0;
|
|
|
|
y = es->zone->h - h;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) w = es->zone->w;
|
|
|
|
if (!es->fit_size) h = size;
|
|
|
|
x = es->zone->w - w;
|
|
|
|
y = es->zone->h - h;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) h = es->zone->h;
|
|
|
|
if (!es->fit_size) w = size;
|
|
|
|
x = 0;
|
|
|
|
y = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) h = es->zone->h;
|
|
|
|
if (!es->fit_size) w = size;
|
|
|
|
x = es->zone->w - w;
|
|
|
|
y = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) h = es->zone->h;
|
|
|
|
if (!es->fit_size) w = size;
|
|
|
|
x = 0;
|
|
|
|
y = es->zone->h - h;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
2015-09-24 12:55:58 -07:00
|
|
|
if (!es->fit_along) h = es->zone->h;
|
|
|
|
if (!es->fit_size) w = size;
|
|
|
|
x = es->zone->w - w;
|
|
|
|
y = es->zone->h - h;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
2006-02-15 22:32:54 -08:00
|
|
|
}
|
2007-04-06 12:01:29 -07:00
|
|
|
es->hide_step = 0;
|
2009-04-16 19:54:56 -07:00
|
|
|
es->hide_origin = -1;
|
|
|
|
|
2012-10-11 05:49:13 -07:00
|
|
|
if ((es->x == x) && (es->y == y) && (es->w == w) && (es->h == h)) return;
|
|
|
|
|
2015-09-24 12:55:58 -07:00
|
|
|
e_shelf_move_resize(es, x, y, w, h);
|
2009-04-16 19:54:56 -07:00
|
|
|
if (es->hidden)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
es->hidden = 0;
|
|
|
|
e_shelf_toggle(es, 0);
|
2009-04-16 19:54:56 -07:00
|
|
|
}
|
2009-04-22 19:24:59 -07:00
|
|
|
e_zone_useful_geometry_dirty(es->zone);
|
2010-01-20 14:36:45 -08:00
|
|
|
_e_shelf_bindings_add(es);
|
2012-08-24 02:03:34 -07:00
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
Eina_Bool err = EINA_FALSE;
|
|
|
|
|
|
|
|
if (!es->cfg) break;
|
|
|
|
if (!es->zone) break;
|
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 (!es->cfg->autohide) break;
|
2012-08-24 02:03:34 -07:00
|
|
|
switch (es->cfg->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
if (!e_zone_exists_direction(es->zone, E_ZONE_EDGE_LEFT)) break;
|
|
|
|
err = EINA_TRUE;
|
|
|
|
break;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-08-24 02:03:34 -07:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
if (!e_zone_exists_direction(es->zone, E_ZONE_EDGE_RIGHT)) break;
|
|
|
|
err = EINA_TRUE;
|
|
|
|
break;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-08-24 02:03:34 -07:00
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
if (!e_zone_exists_direction(es->zone, E_ZONE_EDGE_TOP)) break;
|
|
|
|
err = EINA_TRUE;
|
|
|
|
break;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-08-24 02:03:34 -07:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
|
|
|
if (!e_zone_exists_direction(es->zone, E_ZONE_EDGE_BOTTOM)) break;
|
|
|
|
err = EINA_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (err)
|
|
|
|
e_util_dialog_show(_("Shelf Autohide Error"), _("Shelf autohiding will not work properly<br>"
|
|
|
|
"with the current configuration; set your shelf to<br>"
|
|
|
|
"\"Below Everything\" or disable autohiding."));
|
|
|
|
break;
|
|
|
|
} while (0);
|
2006-02-15 22:32:54 -08:00
|
|
|
}
|
2006-03-25 22:06:57 -08:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API Eina_Bool
|
2013-02-18 05:43:47 -08:00
|
|
|
e_shelf_desk_visible(const E_Shelf *es, const E_Desk *desk)
|
2012-10-04 02:53:52 -07:00
|
|
|
{
|
|
|
|
Eina_List *ll;
|
|
|
|
E_Config_Shelf *cf_es;
|
|
|
|
E_Zone *zone;
|
|
|
|
E_Config_Shelf_Desk *sd;
|
|
|
|
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(es, EINA_FALSE);
|
2012-10-04 23:43:44 -07:00
|
|
|
if (!desk)
|
|
|
|
{
|
2015-03-13 13:28:08 -07:00
|
|
|
EINA_LIST_FOREACH(e_comp->zones, ll, zone)
|
2012-10-04 23:43:44 -07:00
|
|
|
{
|
|
|
|
desk = e_desk_current_get(zone);
|
2012-10-04 23:44:53 -07:00
|
|
|
if (e_shelf_desk_visible(es, desk)) return EINA_TRUE;
|
2012-10-04 23:43:44 -07:00
|
|
|
}
|
2012-10-04 23:44:53 -07:00
|
|
|
return EINA_FALSE;
|
2012-10-04 23:43:44 -07:00
|
|
|
}
|
2012-10-04 02:53:52 -07:00
|
|
|
cf_es = es->cfg;
|
|
|
|
if (!cf_es) return EINA_FALSE;
|
|
|
|
|
|
|
|
zone = desk->zone;
|
|
|
|
if (cf_es->zone != (int)zone->num) return EINA_FALSE;
|
2015-04-27 15:48:16 -07:00
|
|
|
if (!es->cfg->desk_show_mode) return EINA_TRUE;
|
2012-10-04 02:53:52 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd)
|
|
|
|
{
|
|
|
|
if (!sd) continue;
|
|
|
|
if ((desk->x == sd->x) && (desk->y == sd->y))
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2012-06-20 02:58:28 -07:00
|
|
|
e_shelf_style_set(E_Shelf *es, const char *style)
|
2006-07-26 23:21:15 -07:00
|
|
|
{
|
2007-04-06 12:01:29 -07:00
|
|
|
const char *option;
|
2006-07-26 23:21:15 -07:00
|
|
|
char buf[1024];
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-07-26 23:21:15 -07:00
|
|
|
E_OBJECT_CHECK(es);
|
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
|
|
|
|
|
|
|
if (!es->o_base) return;
|
2012-07-27 06:46:06 -07:00
|
|
|
if (style != es->style)
|
|
|
|
eina_stringshare_replace(&es->style, style);
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-07-26 23:21:15 -07:00
|
|
|
if (style)
|
2006-08-22 20:39:02 -07:00
|
|
|
snprintf(buf, sizeof(buf), "e/shelf/%s/base", style);
|
2006-07-26 23:21:15 -07:00
|
|
|
else
|
2006-08-22 20:39:02 -07:00
|
|
|
snprintf(buf, sizeof(buf), "e/shelf/%s/base", "default");
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2006-07-26 23:21:15 -07:00
|
|
|
if (!e_theme_edje_object_set(es->o_base, "base/theme/shelf", buf))
|
2012-06-20 02:58:28 -07:00
|
|
|
e_theme_edje_object_set(es->o_base, "base/theme/shelf",
|
|
|
|
"e/shelf/default/base");
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2012-06-20 02:58:28 -07:00
|
|
|
option = edje_object_data_get(es->o_base, "hidden_state_size");
|
2007-04-06 12:01:29 -07:00
|
|
|
if (option)
|
|
|
|
es->hidden_state_size = atoi(option);
|
|
|
|
else
|
|
|
|
es->hidden_state_size = 4;
|
2012-06-20 02:58:28 -07:00
|
|
|
option = edje_object_data_get(es->o_base, "instant_delay");
|
2007-04-08 02:32:48 -07:00
|
|
|
if (option)
|
|
|
|
es->instant_delay = atof(option);
|
|
|
|
else
|
|
|
|
es->instant_delay = -1.0;
|
2006-07-26 23:21:15 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2012-12-19 05:59:36 -08:00
|
|
|
e_shelf_autohide_set(E_Shelf *es, int autohide_type)
|
2012-09-07 11:59:43 -07:00
|
|
|
{
|
|
|
|
E_OBJECT_CHECK(es);
|
|
|
|
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
|
|
|
|
|
2012-12-19 05:59:36 -08:00
|
|
|
if ((es->cfg->autohide == !!autohide_type) && ((!!es->autohide) == !!autohide_type))
|
|
|
|
{
|
|
|
|
if ((!es->autohide) || (es->cfg->autohide_show_action == autohide_type - 1))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
es->cfg->autohide = !!autohide_type;
|
2012-09-07 11:59:43 -07:00
|
|
|
if (!es->cfg->autohide)
|
|
|
|
{
|
|
|
|
if (!es->autohide) return;
|
|
|
|
ecore_event_handler_del(es->autohide);
|
|
|
|
es->autohide = NULL;
|
|
|
|
return;
|
|
|
|
}
|
2012-12-19 05:59:36 -08:00
|
|
|
es->cfg->autohide_show_action = autohide_type - 1;
|
|
|
|
if (es->autohide) ecore_event_handler_del(es->autohide);
|
|
|
|
es->autohide = NULL;
|
2012-09-07 11:59:43 -07:00
|
|
|
/*
|
|
|
|
* see FIXME in _e_shelf_cb_mouse_in() for why these are commented out
|
2013-01-11 02:34:29 -08:00
|
|
|
es->handlers =
|
2012-09-07 11:59:43 -07:00
|
|
|
eina_list_append(es->handlers,
|
2013-01-11 02:34:29 -08:00
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN,
|
2012-09-07 11:59:43 -07:00
|
|
|
_e_shelf_cb_mouse_in, es));
|
2013-01-11 02:34:29 -08:00
|
|
|
*/
|
2012-12-19 05:59:36 -08:00
|
|
|
if (!es->cfg->autohide_show_action)
|
2013-01-11 02:34:29 -08:00
|
|
|
es->autohide = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
|
2012-12-19 05:59:36 -08:00
|
|
|
_e_shelf_cb_mouse_in, es);
|
2012-09-07 11:59:43 -07:00
|
|
|
/*
|
2013-01-11 02:34:29 -08:00
|
|
|
es->handlers =
|
2012-09-07 11:59:43 -07:00
|
|
|
eina_list_append(es->handlers,
|
2013-01-11 02:34:29 -08:00
|
|
|
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT,
|
2012-09-07 11:59:43 -07:00
|
|
|
_e_shelf_cb_mouse_out, es));
|
|
|
|
if (!popup)
|
2013-01-11 02:34:29 -08:00
|
|
|
evas_object_event_callback_add(es->o_event, EVAS_CALLBACK_MOUSE_OUT,
|
2012-09-07 11:59:43 -07:00
|
|
|
(Evas_Object_Event_Cb)_e_shelf_cb_mouse_out2, es);
|
2013-01-11 02:34:29 -08:00
|
|
|
*/
|
2012-09-07 11:59:43 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Shelf *
|
2007-10-18 02:06:30 -07:00
|
|
|
e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2007-11-23 01:18:21 -08:00
|
|
|
|
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
|
|
|
es = e_shelf_zone_new(zone, cf_es->name, cf_es->style, cf_es->layer, cf_es->id);
|
2007-10-18 02:06:30 -07:00
|
|
|
if (!es) return NULL;
|
2007-11-23 01:18:21 -08:00
|
|
|
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0;
|
|
|
|
if (!cf_es->hide_duration) cf_es->hide_duration = 1.0;
|
2007-10-18 02:06:30 -07:00
|
|
|
es->cfg = cf_es;
|
|
|
|
es->fit_along = cf_es->fit_along;
|
|
|
|
es->fit_size = cf_es->fit_size;
|
2007-11-23 01:18:21 -08:00
|
|
|
|
2012-12-19 05:59:36 -08:00
|
|
|
e_shelf_autohide_set(es, cf_es->autohide + (cf_es->autohide * cf_es->autohide_show_action));
|
2007-10-18 02:06:30 -07:00
|
|
|
e_shelf_orient(es, cf_es->orient);
|
|
|
|
e_shelf_populate(es);
|
2013-02-18 05:43:47 -08:00
|
|
|
e_shelf_position_calc(es);
|
2007-11-23 01:18:21 -08:00
|
|
|
|
2007-10-18 02:06:30 -07:00
|
|
|
if (cf_es->desk_show_mode)
|
|
|
|
{
|
2013-12-10 11:57:57 -08:00
|
|
|
if (e_shelf_desk_visible(es, NULL))
|
|
|
|
e_shelf_show(es);
|
|
|
|
else
|
|
|
|
e_shelf_hide(es);
|
2007-10-18 02:06:30 -07:00
|
|
|
}
|
|
|
|
else
|
2013-02-18 05:43:47 -08:00
|
|
|
e_shelf_show(es);
|
2007-11-23 01:18:21 -08:00
|
|
|
|
2007-10-18 02:06:30 -07:00
|
|
|
e_shelf_toggle(es, 0);
|
|
|
|
return es;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Entry_Dialog *
|
2012-09-07 05:42:29 -07:00
|
|
|
e_shelf_new_dialog(E_Zone *zone)
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
|
2013-01-05 14:54:51 -08:00
|
|
|
snprintf(buf, sizeof(buf), _("Shelf #%d"), eina_list_count(e_config->shelves));
|
2012-09-07 05:42:29 -07:00
|
|
|
return e_entry_dialog_show(_("Add New Shelf"), "preferences-desktop-shelf",
|
2013-01-11 02:34:29 -08:00
|
|
|
_("Name:"), buf, NULL, NULL,
|
|
|
|
_e_shelf_new_dialog_ok, NULL, zone);
|
2012-09-07 05:42:29 -07:00
|
|
|
}
|
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
/* local subsystem functions */
|
2012-09-07 05:42:29 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_e_shelf_new_dialog_ok(void *data, char *text)
|
|
|
|
{
|
|
|
|
E_Config_Shelf *cfg, *es_cf;
|
|
|
|
E_Zone *zone = data;
|
|
|
|
Eina_List *l;
|
|
|
|
unsigned int x;
|
|
|
|
unsigned long orient = 1;
|
2012-09-07 05:47:24 -07:00
|
|
|
E_Shelf *es;
|
2012-09-07 05:42:29 -07:00
|
|
|
|
|
|
|
if ((!text) || (!text[0])) return;
|
|
|
|
EINA_LIST_FOREACH(e_config->shelves, l, es_cf)
|
|
|
|
{
|
|
|
|
if (strcmp(es_cf->name, text)) continue;
|
|
|
|
e_util_dialog_internal(_("Shelf Error"), _("A shelf with that name already exists!"));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
cfg = E_NEW(E_Config_Shelf, 1);
|
|
|
|
cfg->name = eina_stringshare_add(text);
|
|
|
|
cfg->zone = zone->num;
|
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
|
|
|
cfg->layer = E_LAYER_CLIENT_ABOVE;
|
2012-09-07 05:42:29 -07:00
|
|
|
EINA_LIST_FOREACH(e_config->shelves, l, es_cf)
|
|
|
|
orient *= orientations[es_cf->orient];
|
|
|
|
for (x = 3; x < (sizeof(orientations) / sizeof(orientations[0])); x++)
|
|
|
|
if (orient % orientations[x])
|
|
|
|
{
|
|
|
|
cfg->orient = x;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
cfg->fit_along = 1;
|
|
|
|
cfg->fit_size = 0;
|
|
|
|
cfg->style = eina_stringshare_add("default");
|
|
|
|
cfg->size = 40;
|
|
|
|
cfg->overlap = 0;
|
|
|
|
cfg->autohide = 0;
|
|
|
|
e_config->shelves = eina_list_append(e_config->shelves, cfg);
|
|
|
|
e_config_save_queue();
|
|
|
|
|
2012-11-12 02:05:09 -08:00
|
|
|
es_cf = eina_list_last_data_get(e_config->shelves);
|
2012-09-07 05:42:29 -07:00
|
|
|
cfg->id = es_cf->id + 1;
|
2012-09-07 05:47:24 -07:00
|
|
|
es = e_shelf_config_new(zone, cfg);
|
|
|
|
if (es && es->gadcon)
|
|
|
|
e_int_gadcon_config_shelf(es->gadcon);
|
2012-09-07 05:42:29 -07:00
|
|
|
}
|
|
|
|
|
2012-06-26 04:32:02 -07:00
|
|
|
static void
|
|
|
|
_e_shelf_del_cb(void *d)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
|
|
|
|
es = d;
|
2012-06-28 03:59:19 -07:00
|
|
|
if (es->dummy)
|
2012-07-31 02:43:10 -07:00
|
|
|
{
|
|
|
|
dummies = eina_list_remove(dummies, es);
|
|
|
|
E_FREE(es->cfg);
|
|
|
|
}
|
2012-06-28 03:59:19 -07:00
|
|
|
else
|
|
|
|
shelves = eina_list_remove(shelves, es);
|
2012-06-26 04:32:02 -07:00
|
|
|
}
|
|
|
|
|
2012-11-02 00:53:37 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_event_rename_end_cb(void *data EINA_UNUSED, E_Event_Shelf *ev)
|
2012-11-02 00:53:37 -07:00
|
|
|
{
|
|
|
|
e_object_unref(E_OBJECT(ev->shelf));
|
|
|
|
free(ev);
|
|
|
|
}
|
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_free_cb(void *data EINA_UNUSED, void *event)
|
2006-04-22 23:56:22 -07:00
|
|
|
{
|
2012-08-17 01:33:46 -07:00
|
|
|
E_Event_Shelf *ev = event;
|
|
|
|
E_Shelf *es = ev->shelf;
|
2012-09-07 03:07:09 -07:00
|
|
|
|
|
|
|
eina_stringshare_del(es->name);
|
|
|
|
eina_stringshare_del(es->style);
|
|
|
|
|
|
|
|
if (es->cfg_delete)
|
|
|
|
{
|
2012-09-07 04:00:25 -07:00
|
|
|
if (es->cfg)
|
|
|
|
{
|
|
|
|
e_config->shelves = eina_list_remove(e_config->shelves, es->cfg);
|
|
|
|
eina_stringshare_del(es->cfg->name);
|
|
|
|
eina_stringshare_del(es->cfg->style);
|
|
|
|
free(es->cfg);
|
|
|
|
}
|
2012-09-07 03:07:09 -07:00
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
free(es);
|
2012-08-17 01:33:46 -07:00
|
|
|
free(ev);
|
2012-09-07 03:07:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_shelf_free(E_Shelf *es)
|
|
|
|
{
|
|
|
|
E_Event_Shelf *ev;
|
|
|
|
|
2012-06-28 03:59:19 -07:00
|
|
|
if (!es->dummy)
|
|
|
|
_e_shelf_bindings_del(es);
|
2010-01-20 14:36:45 -08:00
|
|
|
|
2014-11-05 11:39:31 -08:00
|
|
|
if (!stopping)
|
|
|
|
e_zone_useful_geometry_dirty(es->zone);
|
2007-11-22 13:39:45 -08:00
|
|
|
E_FREE_LIST(es->handlers, ecore_event_handler_del);
|
2008-10-20 00:40:14 -07:00
|
|
|
|
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_FREE_FUNC(es->autohide, ecore_event_handler_del);
|
|
|
|
E_FREE_FUNC(es->hide_animator, ecore_animator_del);
|
|
|
|
E_FREE_FUNC(es->autohide_timer, ecore_timer_del);
|
|
|
|
E_FREE_FUNC(es->hide_timer, ecore_timer_del);
|
|
|
|
E_FREE_FUNC(es->instant_timer, ecore_timer_del);
|
|
|
|
E_FREE_FUNC(es->module_init_end_timer, ecore_timer_del);
|
2006-04-23 06:20:57 -07:00
|
|
|
if (es->menu)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
e_menu_post_deactivate_callback_set(es->menu, NULL, NULL);
|
|
|
|
e_object_del(E_OBJECT(es->menu));
|
|
|
|
es->menu = NULL;
|
2006-04-23 06:20:57 -07:00
|
|
|
}
|
2012-06-28 03:59:19 -07:00
|
|
|
if (es->dummy)
|
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_DEL,
|
2012-07-28 08:20:08 -07:00
|
|
|
(Evas_Object_Event_Cb)_e_shelf_cb_dummy_del, es);
|
2013-01-11 02:34:29 -08:00
|
|
|
evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_MOVE,
|
2012-07-28 08:20:08 -07:00
|
|
|
(Evas_Object_Event_Cb)_e_shelf_cb_dummy_moveresize, es);
|
2013-01-11 02:34:29 -08:00
|
|
|
evas_object_event_callback_del_full(es->o_base, EVAS_CALLBACK_RESIZE,
|
2012-07-28 08:20:08 -07:00
|
|
|
(Evas_Object_Event_Cb)_e_shelf_cb_dummy_moveresize, es);
|
2012-06-28 03:59:19 -07:00
|
|
|
}
|
2012-07-31 02:48:02 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
e_gadcon_location_unregister(es->gadcon->location);
|
|
|
|
e_gadcon_location_free(es->gadcon->location);
|
2012-09-07 04:00:25 -07:00
|
|
|
if (es->cfg_delete) e_gadcon_config_del(es->gadcon);
|
2012-07-31 02:48:02 -07:00
|
|
|
e_object_del(E_OBJECT(es->gadcon));
|
2012-09-07 03:07:09 -07:00
|
|
|
es->gadcon = NULL;
|
2012-07-31 02:48:02 -07:00
|
|
|
}
|
2006-04-22 23:56:22 -07:00
|
|
|
if (es->config_dialog) e_object_del(E_OBJECT(es->config_dialog));
|
2012-09-07 03:07:09 -07:00
|
|
|
es->config_dialog = NULL;
|
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 (stopping)
|
|
|
|
evas_object_unref(es->comp_object);
|
|
|
|
else
|
|
|
|
evas_object_hide(es->comp_object);
|
|
|
|
E_FREE_FUNC(es->comp_object, evas_object_del);
|
|
|
|
E_FREE_FUNC(es->o_base, evas_object_del);
|
2012-08-17 01:23:09 -07:00
|
|
|
|
|
|
|
ev = E_NEW(E_Event_Shelf, 1);
|
|
|
|
ev->shelf = es;
|
|
|
|
ecore_event_add(E_EVENT_SHELF_DEL, ev, _e_shelf_free_cb, NULL);
|
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_gadcon_min_size_request(void *data EINA_UNUSED, E_Gadcon *gc EINA_UNUSED, Evas_Coord w EINA_UNUSED, Evas_Coord h EINA_UNUSED)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-03-25 22:06:57 -08:00
|
|
|
static void
|
2006-04-03 07:01:00 -07:00
|
|
|
_e_shelf_gadcon_size_request(void *data, E_Gadcon *gc, Evas_Coord w, Evas_Coord h)
|
2006-03-25 22:06:57 -08:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2011-10-30 00:36:54 -07:00
|
|
|
Evas_Coord nx, ny, nw, nh, ww, hh, wantw, wanth;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-03-25 22:06:57 -08:00
|
|
|
es = data;
|
2006-04-03 07:01:00 -07:00
|
|
|
nx = es->x;
|
|
|
|
ny = es->y;
|
|
|
|
nw = es->w;
|
|
|
|
nh = es->h;
|
2006-04-04 02:54:50 -07:00
|
|
|
ww = hh = 0;
|
2013-02-22 02:30:29 -08:00
|
|
|
w = MAX(w, 16);
|
|
|
|
h = MAX(h, 16);
|
2006-04-04 02:54:50 -07:00
|
|
|
evas_object_geometry_get(gc->o_container, NULL, NULL, &ww, &hh);
|
|
|
|
switch (gc->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) w = ww;
|
|
|
|
if (!es->fit_size) h = hh;
|
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_VERT:
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) h = hh;
|
|
|
|
if (!es->fit_size) w = ww;
|
|
|
|
break;
|
|
|
|
|
2006-04-04 02:54:50 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
2006-04-04 02:54:50 -07:00
|
|
|
}
|
|
|
|
e_gadcon_swallowed_min_size_set(gc, w, h);
|
2006-04-03 07:01:00 -07:00
|
|
|
edje_object_size_min_calc(es->o_base, &nw, &nh);
|
2011-10-30 00:36:54 -07:00
|
|
|
wantw = nw;
|
|
|
|
wanth = nh;
|
2006-04-03 07:01:00 -07:00
|
|
|
switch (gc->orient)
|
2006-03-25 22:06:57 -08:00
|
|
|
{
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nw = es->w;
|
|
|
|
if (!es->fit_size) nh = es->h;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nw != es->w)*/ nx = es->x + ((es->w - nw) / 2);
|
|
|
|
/*if (nh != es->h)*/ ny = es->y + ((es->h - nh) / 2);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nw = es->w;
|
|
|
|
if (!es->fit_size) nh = es->h;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nw != es->w)*/ nx = es->x + ((es->w - nw) / 2);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_VERT:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nh = es->h;
|
|
|
|
if (!es->fit_size) nw = es->w;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nh != es->h)*/ ny = es->y + ((es->h - nh) / 2);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_LEFT:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nh = es->h;
|
|
|
|
if (!es->fit_size) nw = es->w;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nh != es->h)*/ ny = (es->zone->h - nh) / 2;
|
|
|
|
//nx = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nh = es->h;
|
|
|
|
if (!es->fit_size) nw = es->w;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nh != es->h)*/ ny = (es->zone->h - nh) / 2;
|
|
|
|
//nx = es->zone->w - nw;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_TOP:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nw = es->w;
|
|
|
|
if (!es->fit_size) nh = es->h;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nw != es->w)*/ nx = (es->zone->w - nw) / 2;
|
|
|
|
//ny = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nw = es->w;
|
|
|
|
if (!es->fit_size) nh = es->h;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nw != es->w)*/ nx = (es->zone->w - nw) / 2;
|
2012-06-20 02:58:28 -07:00
|
|
|
//ny = es->zone->h - nh;
|
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nw = es->w;
|
|
|
|
if (!es->fit_size) nh = es->h;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nw != es->w)*/ nx = 0;
|
|
|
|
//ny = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nw = es->w;
|
|
|
|
if (!es->fit_size) nh = es->h;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nw != es->w)*/ nx = es->zone->w - nw;
|
|
|
|
//ny = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nw = es->w;
|
|
|
|
if (!es->fit_size) nh = es->h;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nw != es->w)*/ nx = 0;
|
|
|
|
//ny = es->zone->h - nh;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nw = es->w;
|
|
|
|
if (!es->fit_size) nh = es->h;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nw != es->w)*/ nx = es->zone->w - nw;
|
2012-06-20 02:58:28 -07:00
|
|
|
//ny = es->zone->h - nh;
|
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nh = es->h;
|
|
|
|
if (!es->fit_size) nw = es->w;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nh != es->h)*/ ny = 0;
|
|
|
|
//nx = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nh = es->h;
|
|
|
|
if (!es->fit_size) nw = es->w;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nh != es->h)*/ ny = 0;
|
|
|
|
//nx = es->zone->w - nw;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nh = es->h;
|
|
|
|
if (!es->fit_size) nw = es->w;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nh != es->h)*/ ny = es->zone->h - nh;
|
|
|
|
//nx = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-05 07:00:32 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!es->fit_along) nh = es->h;
|
|
|
|
if (!es->fit_size) nw = es->w;
|
|
|
|
if (nw > es->zone->w) nw = es->zone->w;
|
|
|
|
if (nh > es->zone->h) nh = es->zone->h;
|
2012-07-29 20:46:34 -07:00
|
|
|
/*if (nh != es->h)*/ ny = es->zone->h - nh;
|
|
|
|
//nx = es->zone->w - nw;
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2006-04-03 07:01:00 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
2006-03-25 22:06:57 -08:00
|
|
|
}
|
2011-10-30 00:36:54 -07:00
|
|
|
w -= (wantw - nw);
|
|
|
|
h -= (wanth - nh);
|
|
|
|
e_gadcon_swallowed_min_size_set(gc, w, h);
|
2006-04-03 07:01:00 -07:00
|
|
|
e_shelf_move_resize(es, nx, ny, nw, nh);
|
2009-04-22 19:24:59 -07:00
|
|
|
e_zone_useful_geometry_dirty(es->zone);
|
2006-03-25 22:06:57 -08:00
|
|
|
}
|
2006-04-04 08:42:25 -07:00
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_e_shelf_gadcon_frame_request(void *data, E_Gadcon_Client *gcc, const char *style)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
Evas_Object *o;
|
2012-08-22 00:02:41 -07:00
|
|
|
char buf[4096];
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-04-04 08:42:25 -07:00
|
|
|
es = data;
|
|
|
|
o = edje_object_add(gcc->gadcon->evas);
|
2006-08-31 20:37:43 -07:00
|
|
|
|
2006-08-22 20:39:02 -07:00
|
|
|
snprintf(buf, sizeof(buf), "e/shelf/%s/%s", es->style, style);
|
2006-04-04 08:42:25 -07:00
|
|
|
if (!e_theme_edje_object_set(o, "base/theme/shelf", buf))
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
/* if an inset style (e.g. plain) isn't implemented for a given
|
|
|
|
* shelf style, fall back to the default one. no need for every
|
|
|
|
* theme to implement the plain style */
|
|
|
|
snprintf(buf, sizeof(buf), "e/shelf/default/%s", style);
|
|
|
|
if (!e_theme_edje_object_set(o, "base/theme/shelf", buf))
|
|
|
|
{
|
|
|
|
evas_object_del(o);
|
|
|
|
return NULL;
|
|
|
|
}
|
2006-04-04 08:42:25 -07:00
|
|
|
}
|
2012-06-20 02:58:28 -07:00
|
|
|
snprintf(buf, sizeof(buf), "e,state,orientation,%s",
|
2010-09-06 10:38:18 -07:00
|
|
|
e_shelf_orient_string_get(es));
|
2012-10-23 07:20:19 -07:00
|
|
|
edje_object_signal_emit(o, buf, "e");
|
2006-04-05 07:00:32 -07:00
|
|
|
edje_object_message_signal_process(o);
|
2006-04-04 08:42:25 -07:00
|
|
|
return o;
|
|
|
|
}
|
2006-04-22 23:56:22 -07:00
|
|
|
|
2007-04-11 08:37:04 -07:00
|
|
|
static void
|
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_shelf_toggle_client_fix(E_Shelf *es)
|
2007-04-11 08:37:04 -07:00
|
|
|
{
|
2008-10-22 04:49:33 -07:00
|
|
|
Eina_List *l;
|
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_Client *ec;
|
2007-04-11 08:37:04 -07:00
|
|
|
|
2013-01-16 01:56:50 -08:00
|
|
|
if (!e_config->border_fix_on_shelf_toggle)
|
|
|
|
return;
|
|
|
|
if (es->cfg->overlap)
|
2007-04-11 08:37:04 -07:00
|
|
|
return;
|
|
|
|
|
2015-01-11 12:57:07 -08:00
|
|
|
EINA_LIST_FOREACH(e_comp->clients, l, ec)
|
2007-04-11 08:37:04 -07:00
|
|
|
{
|
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 ((ec->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_NONE)
|
2012-06-20 02:58:28 -07:00
|
|
|
{
|
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 (ec->lock_client_location) continue;
|
2012-06-20 02:58:28 -07:00
|
|
|
if (es->hidden)
|
|
|
|
{
|
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 (!ec->shelf_fix.modified) continue;
|
|
|
|
if (!--ec->shelf_fix.modified)
|
2012-06-20 02:58:28 -07:00
|
|
|
{
|
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
|
|
|
evas_object_move(ec->frame, ec->shelf_fix.x, ec->shelf_fix.y);
|
2012-06-20 02:58:28 -07:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 (!E_INTERSECTS(ec->x, ec->y, ec->w, ec->h,
|
2009-04-27 08:42:43 -07:00
|
|
|
es->x, es->y, es->w, es->h))
|
2012-06-20 02:58:28 -07:00
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!es->hidden)
|
|
|
|
{
|
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 (!ec->shelf_fix.modified++)
|
|
|
|
ec->shelf_fix.x = ec->x;
|
|
|
|
ec->shelf_fix.y = ec->y;
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (es->gadcon->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
2009-04-27 08:42:43 -07:00
|
|
|
if (!es->hidden)
|
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
|
|
|
evas_object_move(ec->frame, ec->x, ec->y + es->h);
|
2009-04-27 08:42:43 -07:00
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2009-04-27 08:42:43 -07:00
|
|
|
if (!es->hidden)
|
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
|
|
|
evas_object_move(ec->frame, ec->x, ec->y - es->h);
|
2009-04-27 08:42:43 -07:00
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
2009-04-27 08:42:43 -07:00
|
|
|
if (!es->hidden)
|
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
|
|
|
evas_object_move(ec->frame, ec->x + es->w, ec->y);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2009-04-27 08:42:43 -07:00
|
|
|
if (!es->hidden)
|
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
|
|
|
evas_object_move(ec->frame, ec->x - es->w, ec->y);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
E_Maximize max;
|
|
|
|
|
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
|
|
|
max = ec->maximized;
|
|
|
|
e_client_unmaximize(ec, E_MAXIMIZE_BOTH);
|
|
|
|
e_client_maximize(ec, max);
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
2007-04-11 08:37:04 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-09 23:09:45 -08:00
|
|
|
static void
|
|
|
|
_e_shelf_menu_item_free(void *data)
|
|
|
|
{
|
2009-04-27 08:42:43 -07:00
|
|
|
E_Shelf *es;
|
|
|
|
|
|
|
|
es = e_object_data_get(data);
|
2009-01-09 23:09:45 -08:00
|
|
|
e_shelf_locked_set(es, 0);
|
2012-09-07 06:44:25 -07:00
|
|
|
e_object_unref(E_OBJECT(es));
|
2009-01-09 23:09:45 -08:00
|
|
|
}
|
|
|
|
|
2006-06-15 00:24:10 -07:00
|
|
|
static void
|
|
|
|
_e_shelf_menu_append(E_Shelf *es, E_Menu *mn)
|
|
|
|
{
|
|
|
|
E_Menu_Item *mi;
|
2007-02-02 22:48:31 -08:00
|
|
|
E_Menu *subm;
|
2011-03-22 17:18:15 -07:00
|
|
|
char buf[256];
|
|
|
|
|
2012-07-03 06:53:44 -07:00
|
|
|
if (es->name)
|
|
|
|
snprintf(buf, sizeof(buf), "%s", es->name);
|
|
|
|
else
|
2013-01-05 14:54:51 -08:00
|
|
|
snprintf(buf, sizeof(buf), _("Shelf %s"),
|
2012-07-28 08:20:08 -07:00
|
|
|
e_shelf_orient_string_get(es));
|
2009-01-09 23:09:45 -08:00
|
|
|
|
|
|
|
e_shelf_locked_set(es, 1);
|
|
|
|
|
2007-02-02 22:48:31 -08:00
|
|
|
subm = e_menu_new();
|
2006-06-15 00:24:10 -07:00
|
|
|
mi = e_menu_item_new(mn);
|
2011-03-22 17:18:15 -07:00
|
|
|
e_menu_item_label_set(mi, buf);
|
2009-03-08 16:09:48 -07:00
|
|
|
e_util_menu_item_theme_icon_set(mi, "preferences-desktop-shelf");
|
2007-02-02 22:48:31 -08:00
|
|
|
e_menu_pre_activate_callback_set(subm, _e_shelf_menu_pre_cb, es);
|
2012-09-07 06:44:25 -07:00
|
|
|
e_object_ref(E_OBJECT(es));
|
2009-01-09 23:09:45 -08:00
|
|
|
e_object_free_attach_func_set(E_OBJECT(mi), _e_shelf_menu_item_free);
|
|
|
|
e_object_data_set(E_OBJECT(mi), es);
|
2007-02-02 22:48:31 -08:00
|
|
|
e_menu_item_submenu_set(mi, subm);
|
2012-09-03 01:30:39 -07:00
|
|
|
e_object_unref(E_OBJECT(subm));
|
2012-08-18 03:54:02 -07:00
|
|
|
|
|
|
|
mi = e_menu_item_new(mn);
|
|
|
|
e_menu_item_separator_set(mi, 1);
|
|
|
|
|
|
|
|
mi = e_menu_item_new(mn);
|
|
|
|
if (es->gadcon->editing)
|
|
|
|
e_menu_item_label_set(mi, _("Stop Moving Gadgets"));
|
|
|
|
else
|
|
|
|
e_menu_item_label_set(mi, _("Begin Moving Gadgets"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "transform-scale");
|
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_edit, es);
|
2006-06-15 00:24:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_menu_items_append(void *data, E_Gadcon_Client *gcc EINA_UNUSED, E_Menu *mn)
|
2006-06-15 00:24:10 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-06-15 00:24:10 -07:00
|
|
|
es = data;
|
|
|
|
_e_shelf_menu_append(es, mn);
|
|
|
|
}
|
|
|
|
|
2009-01-24 06:09:37 -08:00
|
|
|
static void
|
|
|
|
_e_shelf_cb_locked_set(void *data, int lock)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2009-01-24 06:09:37 -08:00
|
|
|
es = data;
|
|
|
|
e_shelf_locked_set(es, lock);
|
|
|
|
}
|
|
|
|
|
2009-03-24 09:08:37 -07:00
|
|
|
static void
|
|
|
|
_e_shelf_cb_urgent_show(void *data)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2009-03-24 09:08:37 -07:00
|
|
|
es = data;
|
|
|
|
e_shelf_urgent_show(es);
|
|
|
|
}
|
|
|
|
|
2012-10-11 00:56:16 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_menu_autohide(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2012-10-11 00:56:16 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es = data;
|
|
|
|
|
2012-12-19 05:59:36 -08:00
|
|
|
e_shelf_autohide_set(es, (!es->cfg->autohide) + (!es->cfg->autohide * es->cfg->autohide_show_action));
|
2012-10-11 00:56:16 -07:00
|
|
|
if ((es->cfg->autohide) && (!es->hidden))
|
|
|
|
e_shelf_toggle(es, 0);
|
|
|
|
else if ((!es->cfg->autohide) && (es->hidden))
|
|
|
|
e_shelf_toggle(es, 1);
|
|
|
|
e_zone_useful_geometry_dirty(es->zone);
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
2012-09-21 00:45:39 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_menu_refresh(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2012-09-21 00:45:39 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es = data;
|
|
|
|
|
|
|
|
e_gadcon_unpopulate(es->gadcon);
|
|
|
|
e_gadcon_populate(es->gadcon);
|
|
|
|
}
|
|
|
|
|
2006-04-23 06:20:57 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_menu_config(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2006-04-23 06:20:57 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-04-23 06:20:57 -07:00
|
|
|
es = data;
|
|
|
|
if (!es->config_dialog) e_int_shelf_config(es);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_menu_edit(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2006-04-23 06:20:57 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-04-23 06:20:57 -07:00
|
|
|
es = data;
|
|
|
|
if (es->gadcon->editing)
|
2007-04-27 13:38:13 -07:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
e_gadcon_edit_end(es->gadcon);
|
|
|
|
e_shelf_toggle(es, 0);
|
2007-04-27 13:38:13 -07:00
|
|
|
}
|
2006-04-23 06:20:57 -07:00
|
|
|
else
|
2007-04-27 13:38:13 -07:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
e_shelf_toggle(es, 1);
|
|
|
|
e_gadcon_edit_begin(es->gadcon);
|
2007-04-27 13:38:13 -07:00
|
|
|
}
|
2006-04-23 06:20:57 -07:00
|
|
|
}
|
|
|
|
|
2006-05-10 00:42:39 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_menu_contents(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2006-05-10 00:42:39 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-05-10 00:42:39 -07:00
|
|
|
es = data;
|
2009-04-27 08:42:43 -07:00
|
|
|
if (!es->gadcon->config_dialog) e_int_gadcon_config_shelf(es->gadcon);
|
2006-05-10 00:42:39 -07:00
|
|
|
}
|
|
|
|
|
2006-10-30 02:42:23 -08:00
|
|
|
static void
|
|
|
|
_e_shelf_cb_confirm_dialog_destroy(void *data)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
|
|
|
|
es = data;
|
|
|
|
e_object_unref(E_OBJECT(es));
|
|
|
|
}
|
|
|
|
|
2006-05-13 19:38:14 -07:00
|
|
|
static void
|
2006-05-22 13:28:33 -07:00
|
|
|
_e_shelf_cb_confirm_dialog_yes(void *data)
|
2006-05-13 19:38:14 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2006-05-22 13:28:33 -07:00
|
|
|
|
2006-05-13 19:38:14 -07:00
|
|
|
es = data;
|
2006-10-30 02:42:23 -08:00
|
|
|
if (e_object_is_del(E_OBJECT(es))) return;
|
2012-08-31 11:58:18 -07:00
|
|
|
es->cfg_delete = 1;
|
2006-05-13 19:38:14 -07:00
|
|
|
e_object_del(E_OBJECT(es));
|
|
|
|
}
|
|
|
|
|
2006-05-22 13:28:33 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_menu_delete(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2006-05-22 13:28:33 -07:00
|
|
|
{
|
2007-04-23 22:04:15 -07:00
|
|
|
E_Shelf *es;
|
|
|
|
|
2009-04-27 08:42:43 -07:00
|
|
|
es = data;
|
2012-06-20 02:58:28 -07:00
|
|
|
if (e_config->cnfmdlg_disabled)
|
2007-10-01 14:22:51 -07:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
if (e_object_is_del(E_OBJECT(es))) return;
|
2012-09-07 04:00:25 -07:00
|
|
|
es->cfg_delete = 1;
|
2012-06-20 02:58:28 -07:00
|
|
|
e_object_del(E_OBJECT(es));
|
|
|
|
|
|
|
|
e_config_save_queue();
|
|
|
|
return;
|
2007-10-01 14:22:51 -07:00
|
|
|
}
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-10-30 02:42:23 -08:00
|
|
|
e_object_ref(E_OBJECT(es));
|
2013-01-11 02:34:29 -08:00
|
|
|
e_confirm_dialog_show(_("Are you sure you want to delete this shelf?"),
|
2012-07-28 08:20:08 -07:00
|
|
|
"enlightenment",
|
2012-06-20 02:58:28 -07:00
|
|
|
_("You requested to delete this shelf.<br>"
|
|
|
|
"<br>"
|
2013-01-11 02:34:29 -08:00
|
|
|
"Are you sure you want to delete it?"),
|
2012-07-28 08:20:08 -07:00
|
|
|
_("Delete"), _("Keep"),
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_cb_confirm_dialog_yes, NULL, data, NULL,
|
|
|
|
_e_shelf_cb_confirm_dialog_destroy, data);
|
2006-05-22 13:28:33 -07:00
|
|
|
}
|
|
|
|
|
2006-04-23 06:20:57 -07:00
|
|
|
static void
|
2015-06-08 22:29:25 -07:00
|
|
|
_e_shelf_cb_menu_post(void *data, E_Menu *m)
|
2006-04-23 06:20:57 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-04-23 06:20:57 -07:00
|
|
|
es = data;
|
2015-06-08 22:29:25 -07:00
|
|
|
e_object_del(E_OBJECT(m));
|
|
|
|
if (m != es->menu) return;
|
2006-04-23 06:20:57 -07:00
|
|
|
es->menu = NULL;
|
|
|
|
}
|
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
2006-04-22 23:56:22 -07:00
|
|
|
{
|
|
|
|
Evas_Event_Mouse_Down *ev;
|
|
|
|
E_Shelf *es;
|
2007-06-10 04:01:41 -07:00
|
|
|
E_Menu *mn;
|
2009-11-24 11:19:21 -08:00
|
|
|
int cx, cy;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2006-04-22 23:56:22 -07:00
|
|
|
es = data;
|
|
|
|
ev = event_info;
|
2007-06-10 04:01:41 -07:00
|
|
|
switch (ev->button)
|
2006-04-22 23:56:22 -07:00
|
|
|
{
|
2007-06-10 04:01:41 -07:00
|
|
|
case 1:
|
2012-06-20 02:58:28 -07:00
|
|
|
if (es->cfg->autohide_show_action) e_shelf_toggle(es, 1);
|
|
|
|
break;
|
|
|
|
|
2007-06-10 04:01:41 -07:00
|
|
|
case 3:
|
2013-02-18 05:43:47 -08:00
|
|
|
if (es->menu) return;
|
2012-06-20 02:58:28 -07:00
|
|
|
mn = e_menu_new();
|
|
|
|
e_menu_post_deactivate_callback_set(mn, _e_shelf_cb_menu_post, es);
|
|
|
|
es->menu = mn;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_menu_pre_cb(es, mn);
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2009-11-24 11:19:21 -08:00
|
|
|
e_gadcon_canvas_zone_geometry_get(es->gadcon, &cx, &cy, NULL, NULL);
|
2012-06-20 02:58:28 -07:00
|
|
|
e_menu_activate_mouse(mn,
|
2015-03-13 14:47:36 -07:00
|
|
|
e_zone_current_get(),
|
2012-06-20 02:58:28 -07:00
|
|
|
cx + ev->output.x,
|
2009-01-21 20:42:16 -08:00
|
|
|
cy + ev->output.y, 1, 1,
|
2012-06-20 02:58:28 -07:00
|
|
|
E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
|
|
|
break;
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-06 03:03:32 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_e_shelf_cb_mouse_move_autohide_fuck_systray(E_Shelf *es)
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
Ecore_Event_Mouse_Move ev;
|
|
|
|
|
|
|
|
memset(&ev, 0, sizeof(Ecore_Event_Mouse_Move));
|
2015-03-13 14:44:24 -07:00
|
|
|
ecore_evas_pointer_xy_get(e_comp->ee, &x, &y);
|
2015-03-13 12:54:51 -07:00
|
|
|
ev.root.x = e_comp_canvas_x_root_unadjust(x);
|
|
|
|
ev.root.y = e_comp_canvas_y_root_unadjust(y);
|
2012-12-06 03:03:32 -08:00
|
|
|
_e_shelf_cb_mouse_in(es, ECORE_EVENT_MOUSE_MOVE, &ev);
|
2012-12-19 00:55:51 -08:00
|
|
|
return EINA_TRUE;
|
2012-12-06 03:03:32 -08:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2007-11-22 13:39:45 -08:00
|
|
|
_e_shelf_cb_mouse_in(void *data, int type, void *event)
|
2006-04-22 23:56:22 -07:00
|
|
|
{
|
2009-04-27 08:42:43 -07:00
|
|
|
E_Shelf *es;
|
2007-04-06 12:01:29 -07:00
|
|
|
|
2007-05-07 12:16:51 -07:00
|
|
|
es = data;
|
2010-06-24 09:19:12 -07:00
|
|
|
if (es->cfg->autohide_show_action) return ECORE_CALLBACK_PASS_ON;
|
2007-11-24 04:31:15 -08:00
|
|
|
|
2009-10-02 13:53:05 -07:00
|
|
|
if (type == E_EVENT_ZONE_EDGE_MOVE)
|
2007-11-22 13:39:45 -08:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
E_Event_Zone_Edge *ev;
|
2014-05-07 13:04:48 -07:00
|
|
|
E_Desk *desk;
|
|
|
|
Eina_List *l;
|
|
|
|
E_Client *ec;
|
2012-06-20 02:58:28 -07:00
|
|
|
int show = 0;
|
|
|
|
|
|
|
|
ev = event;
|
|
|
|
if (es->zone != ev->zone) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (!_e_shelf_on_current_desk(es, ev)) return ECORE_CALLBACK_PASS_ON;
|
2014-05-07 13:04:48 -07:00
|
|
|
desk = e_desk_current_get(ev->zone);
|
|
|
|
EINA_LIST_FOREACH(desk->fullscreen_clients, l, ec)
|
|
|
|
if (evas_object_visible_get(ec->frame)) return ECORE_CALLBACK_RENEW;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2012-12-06 02:27:15 -08:00
|
|
|
ev->x -= es->zone->x, ev->y -= es->zone->y;
|
2012-06-20 02:58:28 -07:00
|
|
|
switch (es->gadcon->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
if (((ev->edge == E_ZONE_EDGE_LEFT) ||
|
|
|
|
(ev->edge == E_ZONE_EDGE_TOP_LEFT) ||
|
|
|
|
(ev->edge == E_ZONE_EDGE_BOTTOM_LEFT)) &&
|
|
|
|
(ev->y >= es->y) && (ev->y <= (es->y + es->h)))
|
|
|
|
show = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
if (((ev->edge == E_ZONE_EDGE_RIGHT) ||
|
|
|
|
(ev->edge == E_ZONE_EDGE_TOP_RIGHT) ||
|
|
|
|
(ev->edge == E_ZONE_EDGE_BOTTOM_RIGHT)) &&
|
|
|
|
(ev->y >= es->y) && (ev->y <= (es->y + es->h)))
|
|
|
|
show = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
if (((ev->edge == E_ZONE_EDGE_TOP) ||
|
|
|
|
(ev->edge == E_ZONE_EDGE_TOP_LEFT) ||
|
|
|
|
(ev->edge == E_ZONE_EDGE_TOP_RIGHT)) &&
|
|
|
|
(ev->x >= es->x) && (ev->x <= (es->x + es->w)))
|
|
|
|
show = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
|
|
|
if (((ev->edge == E_ZONE_EDGE_BOTTOM) ||
|
|
|
|
(ev->edge == E_ZONE_EDGE_BOTTOM_LEFT) ||
|
|
|
|
(ev->edge == E_ZONE_EDGE_BOTTOM_RIGHT)) &&
|
|
|
|
(ev->x >= es->x) && (ev->x <= (es->x + es->w)))
|
|
|
|
show = 1;
|
|
|
|
break;
|
2012-09-07 06:44:25 -07:00
|
|
|
|
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
|
|
|
case E_GADCON_ORIENT_VERT:
|
|
|
|
default:
|
|
|
|
/* noop */
|
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (show)
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(es->o_base, "e,state,focused", "e");
|
|
|
|
e_shelf_toggle(es, 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
e_shelf_toggle(es, 0);
|
2007-11-24 04:31:15 -08:00
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
/*
|
|
|
|
else if (type == ECORE_X_EVENT_MOUSE_IN)
|
|
|
|
{
|
|
|
|
Ecore_X_Event_Mouse_In *ev;
|
|
|
|
|
|
|
|
ev = event;
|
|
|
|
if ((!es->hidden) && (!es->menu))
|
|
|
|
{
|
|
|
|
int x, y, w, h;
|
|
|
|
evas_object_geometry_get(es->o_event, &x, &y, &w, &h);
|
|
|
|
if (!E_INSIDE(ev->x, ev->y, x, y, w, h))
|
|
|
|
e_shelf_toggle(es, 0);
|
|
|
|
}
|
|
|
|
if (!es->popup) return ECORE_CALLBACK_PASS_ON;
|
|
|
|
if (ev->win == es->popup->evas_win)
|
|
|
|
{
|
|
|
|
if (es->hidden || (!es->toggle))
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(es->o_base, "e,state,focused", "e");
|
|
|
|
e_shelf_toggle(es, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
2009-10-02 13:53:05 -07:00
|
|
|
else if (type == ECORE_EVENT_MOUSE_MOVE)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
Ecore_Event_Mouse_Move *ev;
|
2012-12-11 06:20:53 -08:00
|
|
|
int x, y;
|
2012-08-24 02:03:34 -07:00
|
|
|
Eina_Bool inside = EINA_FALSE;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
|
|
|
ev = event;
|
2012-09-07 11:59:43 -07:00
|
|
|
/* FIXME: checking every mouse movement here is only necessary because of
|
2012-09-21 00:27:33 -07:00
|
|
|
* shitty systray embedding xwindows into itself which generates unreliable
|
2012-09-07 11:59:43 -07:00
|
|
|
* mouse in/out events. in the future, when we remove systray, we should go
|
|
|
|
* back to mouse in/out events
|
|
|
|
*/
|
2015-03-13 12:54:51 -07:00
|
|
|
inside = E_INSIDE(e_comp_canvas_x_root_adjust(ev->root.x),
|
|
|
|
e_comp_canvas_x_root_adjust(ev->root.y),
|
2014-03-27 07:45:49 -07:00
|
|
|
es->zone->x, es->zone->y, es->zone->w + 4, es->zone->h + 4);
|
2015-03-13 12:54:51 -07:00
|
|
|
x = e_comp_canvas_x_root_adjust(ev->root.x) - es->zone->x;
|
|
|
|
y = e_comp_canvas_x_root_adjust(ev->root.y) - es->zone->y;
|
2014-03-27 07:45:49 -07:00
|
|
|
if (inside)
|
|
|
|
inside = (
|
|
|
|
((E_INSIDE(x, y, es->x, es->y, es->w, es->h)) ||
|
|
|
|
(E_INSIDE(x, y, es->x - 2, es->y - 2, es->w + 4, es->h + 4)) ||
|
|
|
|
(E_INSIDE(x, y, es->x + 2, es->y + 2, es->w + 4, es->h + 4)))
|
|
|
|
);
|
|
|
|
if (inside)
|
2012-12-06 02:27:15 -08:00
|
|
|
{
|
2014-03-27 07:45:49 -07:00
|
|
|
if (es->autohide_timer)
|
|
|
|
ecore_timer_reset(es->autohide_timer);
|
|
|
|
else
|
|
|
|
es->autohide_timer = ecore_timer_add(0.5, (Ecore_Task_Cb)_e_shelf_cb_mouse_move_autohide_fuck_systray, es);
|
2012-12-06 02:27:15 -08:00
|
|
|
}
|
2012-08-24 02:03:34 -07:00
|
|
|
if (inside)
|
2012-06-20 02:58:28 -07:00
|
|
|
{
|
2012-08-14 05:22:12 -07:00
|
|
|
if (es->hidden || (!es->toggle))
|
|
|
|
{
|
|
|
|
edje_object_signal_emit(es->o_base, "e,state,focused", "e");
|
|
|
|
e_shelf_toggle(es, 1);
|
|
|
|
}
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
2012-08-24 02:03:34 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((!es->hidden) && (es->toggle))
|
|
|
|
e_shelf_toggle(es, 0);
|
|
|
|
}
|
2007-11-22 13:39:45 -08:00
|
|
|
}
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2006-04-22 23:56:22 -07:00
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-09-07 11:59:43 -07:00
|
|
|
#if 0
|
2012-06-25 05:10:31 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_mouse_out2(E_Shelf *es, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, Evas_Event_Mouse_Out *ev)
|
2012-06-25 05:10:31 -07:00
|
|
|
{
|
|
|
|
int x, y, w, h;
|
2012-07-28 08:20:08 -07:00
|
|
|
|
2012-06-25 05:10:31 -07:00
|
|
|
evas_object_geometry_get(es->o_event, &x, &y, &w, &h);
|
|
|
|
if (!E_INSIDE(ev->output.x, ev->output.y, x, y, w, h))
|
|
|
|
e_shelf_toggle(es, 0);
|
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2007-11-22 13:39:45 -08:00
|
|
|
_e_shelf_cb_mouse_out(void *data, int type, void *event)
|
2007-05-07 09:37:54 -07:00
|
|
|
{
|
2009-04-27 08:42:43 -07:00
|
|
|
E_Shelf *es;
|
|
|
|
Ecore_X_Window win;
|
2007-05-07 09:37:54 -07:00
|
|
|
|
2007-05-07 12:16:51 -07:00
|
|
|
es = data;
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2009-10-02 13:53:05 -07:00
|
|
|
if (type == ECORE_X_EVENT_MOUSE_OUT)
|
2009-03-05 23:48:27 -08:00
|
|
|
{
|
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
|
|
|
Ecore_X_Event_Mouse_Out *ev = event;
|
2012-06-25 00:50:08 -07:00
|
|
|
int x, y, w, h;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2015-01-11 12:57:07 -08:00
|
|
|
if (ev->win != e_comp->ee_win) return ECORE_CALLBACK_PASS_ON;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* ECORE_X_EVENT_DETAIL_INFERIOR means focus went to children windows
|
|
|
|
* so do not hide shelf on this case (ie: systray base window, or
|
|
|
|
* embedded icons).
|
|
|
|
*
|
|
|
|
* Problem: when child window get mouse out, shelf window will
|
|
|
|
* not get mouse out itself, so it will stay visible and
|
|
|
|
* autohide will fail.
|
|
|
|
*/
|
2012-06-25 00:50:08 -07:00
|
|
|
if (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR)
|
|
|
|
{
|
|
|
|
//fprintf(stderr, "SYSTRAYED\n");
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2012-06-25 00:50:08 -07:00
|
|
|
evas_object_geometry_get(es->o_event, &x, &y, &w, &h);
|
|
|
|
if (!E_INSIDE(ev->x, ev->y, x, y, w, h))
|
|
|
|
{
|
|
|
|
//fprintf(stderr, "EVENT: %d,%d %dx%d || MOUSE: %d,%d\n", x, y, w, h, ev->x, ev->y);
|
|
|
|
e_shelf_toggle(es, 0);
|
|
|
|
}
|
2009-03-05 23:48:27 -08:00
|
|
|
}
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2007-05-07 09:37:54 -07:00
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2012-09-07 11:59:43 -07:00
|
|
|
#endif
|
2012-06-28 03:59:19 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_dummy_moveresize(E_Shelf *es, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-06-28 03:59:19 -07:00
|
|
|
{
|
|
|
|
int x, y, w, h;
|
2012-07-28 08:20:08 -07:00
|
|
|
|
2012-06-28 03:59:19 -07:00
|
|
|
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
|
|
|
if ((x != es->x) || (y != es->y) || (w != es->w) || (h != es->h))
|
|
|
|
{
|
|
|
|
es->x = x, es->y = y, es->w = w, es->h = h;
|
|
|
|
e_zone_useful_geometry_dirty(es->zone);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_dummy_del(E_Shelf *es, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2012-06-28 03:59:19 -07:00
|
|
|
{
|
|
|
|
e_object_free(E_OBJECT(es));
|
|
|
|
}
|
|
|
|
|
2006-07-20 06:36:02 -07:00
|
|
|
static int
|
2008-10-27 00:33:21 -07:00
|
|
|
_e_shelf_cb_id_sort(const void *data1, const void *data2)
|
2006-07-20 06:36:02 -07:00
|
|
|
{
|
2008-10-27 00:33:21 -07:00
|
|
|
const E_Shelf *es1, *es2;
|
2006-07-20 06:36:02 -07:00
|
|
|
|
|
|
|
es1 = data1;
|
|
|
|
es2 = data2;
|
2007-07-16 13:43:13 -07:00
|
|
|
if ((es1->id) < (es2->id)) return -1;
|
2012-06-20 02:58:28 -07:00
|
|
|
else if (es1->id > es2->id)
|
|
|
|
return 1;
|
2007-07-16 13:43:13 -07:00
|
|
|
return 0;
|
2006-07-20 06:36:02 -07:00
|
|
|
}
|
2007-02-02 22:48:31 -08:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2007-04-06 12:01:29 -07:00
|
|
|
_e_shelf_cb_hide_animator(void *data)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
2009-12-06 11:42:41 -08:00
|
|
|
int step, hide_max = 0;
|
2009-03-05 17:56:09 -08:00
|
|
|
|
2009-04-27 08:42:43 -07:00
|
|
|
es = data;
|
2012-11-28 21:23:52 -08:00
|
|
|
if (!es->gadcon)
|
|
|
|
{
|
|
|
|
es->hide_animator = NULL;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
2009-03-05 15:49:01 -08:00
|
|
|
switch (es->gadcon->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2012-07-05 07:04:51 -07:00
|
|
|
hide_max = es->h - es->hidden_state_size - 1;
|
2012-06-20 02:58:28 -07:00
|
|
|
if (es->hide_origin == -1) es->hide_origin = es->y;
|
2009-04-27 08:42:43 -07:00
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2009-03-05 15:49:01 -08:00
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2009-04-27 08:42:43 -07:00
|
|
|
hide_max = es->w - es->hidden_state_size;
|
|
|
|
if (es->hide_origin == -1) es->hide_origin = es->x;
|
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2009-09-21 13:19:14 -07:00
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
|
|
|
case E_GADCON_ORIENT_VERT:
|
2012-09-07 06:44:25 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
2009-03-05 15:49:01 -08:00
|
|
|
}
|
|
|
|
|
2009-03-05 17:56:09 -08:00
|
|
|
step = (hide_max / e_config->framerate) / es->cfg->hide_duration;
|
2009-03-05 15:49:01 -08:00
|
|
|
if (!step) step = 1;
|
|
|
|
|
|
|
|
if (es->hidden)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
if (es->hide_step < hide_max)
|
|
|
|
{
|
|
|
|
if (es->hide_step + step > hide_max)
|
2009-04-27 08:42:43 -07:00
|
|
|
es->hide_step = hide_max;
|
2012-06-20 02:58:28 -07:00
|
|
|
else
|
2009-04-27 08:42:43 -07:00
|
|
|
es->hide_step += step;
|
2012-06-20 02:58:28 -07:00
|
|
|
}
|
|
|
|
else goto end;
|
2009-03-05 15:49:01 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
if (es->hide_step > 0)
|
|
|
|
{
|
|
|
|
if (es->hide_step < step)
|
2009-04-27 08:42:43 -07:00
|
|
|
es->hide_step = 0;
|
2012-06-20 02:58:28 -07:00
|
|
|
else
|
|
|
|
es->hide_step -= step;
|
|
|
|
}
|
|
|
|
else goto end;
|
2009-03-05 15:49:01 -08:00
|
|
|
}
|
2007-04-06 12:01:29 -07:00
|
|
|
|
2007-04-08 14:00:30 -07:00
|
|
|
switch (es->gadcon->orient)
|
2007-04-06 12:01:29 -07:00
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
2009-04-27 08:42:43 -07:00
|
|
|
e_shelf_move(es, es->x, es->hide_origin - es->hide_step);
|
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2007-04-06 12:01:29 -07:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2009-04-27 08:42:43 -07:00
|
|
|
e_shelf_move(es, es->x, es->hide_origin + es->hide_step);
|
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2007-04-06 12:01:29 -07:00
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
2009-04-27 08:42:43 -07:00
|
|
|
e_shelf_move(es, es->hide_origin - es->hide_step, es->y);
|
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2007-04-06 12:01:29 -07:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2009-04-27 08:42:43 -07:00
|
|
|
e_shelf_move(es, es->hide_origin + es->hide_step, es->y);
|
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2009-09-21 13:19:14 -07:00
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
|
|
|
case E_GADCON_ORIENT_VERT:
|
2012-09-07 06:44:25 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
2007-04-06 12:01:29 -07:00
|
|
|
}
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
2007-04-06 12:01:29 -07:00
|
|
|
|
2009-04-27 08:42:43 -07:00
|
|
|
end:
|
2007-04-06 12:01:29 -07:00
|
|
|
es->hide_animator = NULL;
|
2007-05-10 01:49:14 -07:00
|
|
|
if (es->interrupted > -1)
|
|
|
|
e_shelf_toggle(es, es->interrupted);
|
2009-03-23 05:14:31 -07:00
|
|
|
else if (es->urgent_show)
|
|
|
|
e_shelf_toggle(es, 0);
|
2007-05-10 01:49:14 -07:00
|
|
|
else
|
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_shelf_toggle_client_fix(es);
|
2012-12-19 05:59:36 -08:00
|
|
|
if ((!es->hidden) && es->cfg->autohide_show_action)
|
|
|
|
{
|
|
|
|
es->hidden = 1;
|
|
|
|
if (!es->hide_timer)
|
|
|
|
es->hide_timer = ecore_timer_add(es->cfg->hide_timeout, _e_shelf_cb_hide_animator_timer, es);
|
|
|
|
}
|
2015-06-08 11:52:40 -07:00
|
|
|
if (es->hidden && (!es->hide_timer))
|
|
|
|
edje_object_signal_emit(es->o_base, "e,state,hidden", "e");
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2007-04-06 12:01:29 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2007-05-07 10:46:25 -07:00
|
|
|
_e_shelf_cb_hide_animator_timer(void *data)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
|
|
|
|
es = data;
|
|
|
|
if (!es->hide_animator)
|
|
|
|
es->hide_animator = ecore_animator_add(_e_shelf_cb_hide_animator, es);
|
|
|
|
es->hide_timer = NULL;
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2007-05-07 10:46:25 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2009-03-23 05:14:31 -07:00
|
|
|
_e_shelf_cb_hide_urgent_timer(void *data)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
|
|
|
|
es = data;
|
|
|
|
es->hide_timer = NULL;
|
2009-04-27 08:42:43 -07:00
|
|
|
if (es->urgent_show) e_shelf_toggle(es, 0);
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2009-03-23 05:14:31 -07:00
|
|
|
}
|
|
|
|
|
2010-06-24 09:19:12 -07:00
|
|
|
static Eina_Bool
|
2007-04-08 02:32:48 -07:00
|
|
|
_e_shelf_cb_instant_hide_timer(void *data)
|
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
|
|
|
|
es = data;
|
2007-04-08 14:00:30 -07:00
|
|
|
switch (es->gadcon->orient)
|
2007-04-08 02:32:48 -07:00
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
2009-04-27 08:42:43 -07:00
|
|
|
if (es->hidden)
|
|
|
|
e_shelf_move(es, es->x, es->y - es->h + es->hidden_state_size);
|
|
|
|
else
|
|
|
|
e_shelf_move(es, es->x, es->y + es->h - es->hidden_state_size);
|
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2007-04-08 02:32:48 -07:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2009-04-27 08:42:43 -07:00
|
|
|
if (es->hidden)
|
|
|
|
e_shelf_move(es, es->x, es->y + es->h - es->hidden_state_size);
|
|
|
|
else
|
|
|
|
e_shelf_move(es, es->x, es->y - es->h + es->hidden_state_size);
|
|
|
|
break;
|
2012-06-20 02:58:28 -07:00
|
|
|
|
2007-04-08 02:32:48 -07:00
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
2009-04-27 08:42:43 -07:00
|
|
|
if (es->hidden)
|
|
|
|
e_shelf_move(es, es->x - es->w + es->hidden_state_size, es->y);
|
|
|
|
else
|
|
|
|
e_shelf_move(es, es->x + es->w - es->hidden_state_size, es->y);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2007-04-08 02:32:48 -07:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2009-04-27 08:42:43 -07:00
|
|
|
if (es->hidden)
|
|
|
|
e_shelf_move(es, es->x + es->w - es->hidden_state_size, es->y);
|
|
|
|
else
|
|
|
|
e_shelf_move(es, es->x - es->w + es->hidden_state_size, es->y);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2007-04-08 02:32:48 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
2007-04-08 02:32:48 -07:00
|
|
|
}
|
2007-04-11 08:37:04 -07:00
|
|
|
es->instant_timer = NULL;
|
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_shelf_toggle_client_fix(es);
|
2010-06-24 09:19:12 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
2007-04-08 02:32:48 -07:00
|
|
|
}
|
|
|
|
|
2012-09-20 01:44:30 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_gadcon_populate_handler_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-09-20 01:44:30 -07:00
|
|
|
{
|
|
|
|
E_Event_Gadcon_Populate *ev = event;
|
|
|
|
Eina_List *l;
|
|
|
|
E_Shelf *es;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(shelves, l, es)
|
|
|
|
if (es->gadcon == ev->gc)
|
|
|
|
{
|
|
|
|
/* any shelf that's not already shown at this point will be
|
|
|
|
* waiting for this event to show it so that we don't ever resize the shelf
|
|
|
|
* object
|
|
|
|
*/
|
2012-10-04 23:43:44 -07:00
|
|
|
if (e_shelf_desk_visible(es, NULL)) e_shelf_show(es);
|
2012-09-20 01:44:30 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
2012-08-07 03:48:47 -07:00
|
|
|
static void
|
2012-09-03 02:06:10 -07:00
|
|
|
_e_shelf_cb_menu_rename_yes_cb(void *data, char *text)
|
2012-08-07 03:48:47 -07:00
|
|
|
{
|
2012-09-07 04:00:25 -07:00
|
|
|
E_Shelf *es = data;
|
2012-08-07 03:48:47 -07:00
|
|
|
Eina_List *l;
|
|
|
|
E_Config_Shelf *cf_es;
|
|
|
|
|
2012-09-07 04:00:25 -07:00
|
|
|
if ((!text) || (!text[0])) return;
|
|
|
|
if (!strcmp(text, es->cfg->name)) return;
|
2012-08-07 03:48:47 -07:00
|
|
|
EINA_LIST_FOREACH(e_config->shelves, l, cf_es)
|
2012-09-07 04:00:25 -07:00
|
|
|
if (!strcmp(cf_es->name, text))
|
2012-08-07 03:48:47 -07:00
|
|
|
{
|
|
|
|
e_util_dialog_internal(_("Error"), _("A shelf with that name and id already exists!"));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
e_shelf_name_set(es, text);
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_shelf_cb_menu_rename_cb(void *data)
|
|
|
|
{
|
|
|
|
E_Shelf *es = e_object_data_get(data);
|
|
|
|
es->rename_dialog = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_shelf_cb_menu_rename(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2012-08-07 03:48:47 -07:00
|
|
|
{
|
|
|
|
E_Shelf *es = data;
|
|
|
|
if (es->rename_dialog) return;
|
|
|
|
es->rename_dialog = e_entry_dialog_show(_("Rename Shelf"), "edit-rename",
|
2013-01-11 02:34:29 -08:00
|
|
|
_("Name:"), es->name, NULL, NULL,
|
|
|
|
_e_shelf_cb_menu_rename_yes_cb,
|
|
|
|
NULL, es);
|
2012-09-07 04:00:25 -07:00
|
|
|
e_object_data_set(E_OBJECT(es->rename_dialog), es);
|
2012-08-07 03:48:47 -07:00
|
|
|
e_object_del_attach_func_set(E_OBJECT(es->rename_dialog),
|
|
|
|
_e_shelf_cb_menu_rename_cb);
|
|
|
|
}
|
|
|
|
|
2012-09-07 06:44:25 -07:00
|
|
|
static void
|
|
|
|
_e_shelf_cb_menu_orient(void *data, E_Menu *m, E_Menu_Item *mi)
|
|
|
|
{
|
|
|
|
E_Shelf *es = data;
|
|
|
|
E_Menu_Item *mii;
|
|
|
|
int orient = E_GADCON_ORIENT_LEFT;
|
|
|
|
Eina_List *l;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(m->items, l, mii)
|
|
|
|
{
|
|
|
|
if (mi == mii)
|
|
|
|
{
|
|
|
|
E_Zone *zone;
|
|
|
|
E_Config_Shelf *cf_es;
|
2012-09-10 01:04:09 -07:00
|
|
|
void *cfd;
|
2012-09-07 06:44:25 -07:00
|
|
|
if (es->cfg->orient == orient) return;
|
|
|
|
es->cfg->orient = orient;
|
|
|
|
zone = es->zone;
|
|
|
|
cf_es = es->cfg;
|
2012-09-10 01:04:09 -07:00
|
|
|
cfd = es->config_dialog;
|
|
|
|
es->config_dialog = NULL;
|
2012-12-12 06:56:17 -08:00
|
|
|
e_gadcon_unpopulate(es->gadcon);
|
2012-09-07 06:44:25 -07:00
|
|
|
e_object_del(E_OBJECT(es));
|
2012-09-10 01:04:09 -07:00
|
|
|
es = e_shelf_config_new(zone, cf_es);
|
|
|
|
es->config_dialog = cfd;
|
2012-09-07 06:44:25 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
orient++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_shelf_menu_orientation_pre_cb(void *data, E_Menu *m)
|
|
|
|
{
|
|
|
|
E_Menu_Item *mi;
|
|
|
|
E_Shelf *es = data;
|
|
|
|
int orient;
|
|
|
|
|
|
|
|
if (m->items) return;
|
|
|
|
|
|
|
|
for (orient = E_GADCON_ORIENT_LEFT; orient < E_GADCON_ORIENT_LAST; orient++)
|
|
|
|
{
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_util_gadcon_orient_menu_item_icon_set(orient, mi);
|
|
|
|
e_menu_item_radio_set(mi, 1);
|
|
|
|
e_menu_item_radio_group_set(mi, 1);
|
|
|
|
e_menu_item_label_set(mi, _(orient_names[orient]));
|
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_orient, es);
|
|
|
|
if (es->cfg->orient == orient)
|
|
|
|
e_menu_item_toggle_set(mi, 1);
|
2012-12-12 06:44:10 -08:00
|
|
|
e_menu_item_disabled_set(mi, es->cfg->orient == orient);
|
2012-09-07 06:44:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-20 02:58:28 -07:00
|
|
|
static void
|
|
|
|
_e_shelf_menu_pre_cb(void *data, E_Menu *m)
|
2007-02-02 22:48:31 -08:00
|
|
|
{
|
|
|
|
E_Shelf *es;
|
|
|
|
E_Menu_Item *mi;
|
2012-09-07 06:44:25 -07:00
|
|
|
E_Menu *subm;
|
2007-02-02 22:48:31 -08:00
|
|
|
|
|
|
|
es = data;
|
|
|
|
e_menu_pre_activate_callback_set(m, NULL, NULL);
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2007-02-02 22:48:31 -08:00
|
|
|
mi = e_menu_item_new(m);
|
2010-09-03 11:41:23 -07:00
|
|
|
e_menu_item_label_set(mi, _("Contents"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "preferences-desktop-shelf");
|
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_contents, es);
|
|
|
|
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Settings"));
|
2009-03-08 16:09:48 -07:00
|
|
|
e_util_menu_item_theme_icon_set(mi, "configure");
|
2007-02-02 22:48:31 -08:00
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_config, es);
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2012-09-07 06:44:25 -07:00
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Orientation"));
|
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_config, es);
|
|
|
|
subm = e_menu_new();
|
|
|
|
e_menu_pre_activate_callback_set(subm, _e_shelf_menu_orientation_pre_cb, es);
|
|
|
|
e_object_data_set(E_OBJECT(subm), es);
|
|
|
|
e_menu_item_submenu_set(mi, subm);
|
|
|
|
e_object_unref(E_OBJECT(subm));
|
|
|
|
|
2012-10-11 00:56:16 -07:00
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Autohide"));
|
|
|
|
e_menu_item_check_set(mi, 1);
|
|
|
|
e_menu_item_toggle_set(mi, es->cfg->autohide);
|
|
|
|
//e_util_menu_item_theme_icon_set(mi, ""); FIXME
|
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_autohide, es);
|
|
|
|
|
2012-09-21 00:45:39 -07:00
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Refresh"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "view-refresh");
|
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_refresh, es);
|
|
|
|
|
2007-02-02 22:48:31 -08:00
|
|
|
mi = e_menu_item_new(m);
|
2010-09-03 11:41:23 -07:00
|
|
|
e_menu_item_separator_set(mi, 1);
|
2009-04-27 08:42:43 -07:00
|
|
|
|
2012-08-07 03:48:47 -07:00
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Rename"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "edit-rename");
|
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_rename, es);
|
|
|
|
|
2007-02-02 22:48:31 -08:00
|
|
|
mi = e_menu_item_new(m);
|
2010-09-03 11:41:23 -07:00
|
|
|
e_menu_item_label_set(mi, _("Delete"));
|
2009-03-06 11:17:12 -08:00
|
|
|
e_util_menu_item_theme_icon_set(mi, "list-remove");
|
2012-06-20 02:58:28 -07:00
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_delete, es);
|
2012-09-18 00:08:41 -07:00
|
|
|
|
|
|
|
if (m->parent_item) return;
|
|
|
|
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_separator_set(mi, 1);
|
|
|
|
|
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
if (es->gadcon->editing)
|
|
|
|
e_menu_item_label_set(mi, _("Stop Moving Gadgets"));
|
|
|
|
else
|
|
|
|
e_menu_item_label_set(mi, _("Begin Moving Gadgets"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "transform-scale");
|
|
|
|
e_menu_item_callback_set(mi, _e_shelf_cb_menu_edit, es);
|
2007-02-02 22:48:31 -08:00
|
|
|
}
|
2009-08-31 04:23:03 -07:00
|
|
|
|
|
|
|
static void
|
2009-11-24 11:08:41 -08:00
|
|
|
_e_shelf_gadcon_client_remove(void *data, E_Gadcon_Client *gcc)
|
2009-08-31 04:23:03 -07:00
|
|
|
{
|
|
|
|
E_Shelf *s;
|
|
|
|
E_Gadcon *gc;
|
|
|
|
|
|
|
|
s = data;
|
|
|
|
gc = s->gadcon;
|
2012-10-05 02:57:34 -07:00
|
|
|
if (gcc->cf) e_gadcon_client_config_del(gc->cf, gcc->cf);
|
2009-08-31 04:23:03 -07:00
|
|
|
e_gadcon_unpopulate(gc);
|
|
|
|
e_gadcon_populate(gc);
|
|
|
|
e_config_save_queue();
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-10-05 02:57:34 -07:00
|
|
|
_e_shelf_gadcon_client_add(void *data, E_Gadcon_Client *gcc, const E_Gadcon_Client_Class *cc)
|
2009-08-31 04:23:03 -07:00
|
|
|
{
|
|
|
|
E_Shelf *s;
|
|
|
|
E_Gadcon *gc;
|
|
|
|
|
|
|
|
s = data;
|
|
|
|
gc = s->gadcon;
|
2012-10-05 02:57:34 -07:00
|
|
|
if (gcc)
|
|
|
|
{
|
2014-04-04 12:26:11 -07:00
|
|
|
E_Config_Gadcon_Client *cf_gcc = gcc->cf;
|
2012-10-05 02:57:34 -07:00
|
|
|
gcc->gadcon->cf->clients = eina_list_remove(gcc->gadcon->cf->clients, cf_gcc);
|
|
|
|
if (gc->zone)
|
|
|
|
cf_gcc->geom.res = gc->zone->w;
|
|
|
|
else if (gc->o_container)
|
|
|
|
{
|
|
|
|
int w, h;
|
|
|
|
evas_object_geometry_get(gc->o_container, NULL, NULL, &w, &h);
|
|
|
|
switch (gc->orient)
|
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
case E_GADCON_ORIENT_VERT:
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
2012-10-05 02:57:34 -07:00
|
|
|
cf_gcc->geom.res = h;
|
|
|
|
break;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
|
|
|
default:
|
2012-10-05 02:57:34 -07:00
|
|
|
cf_gcc->geom.res = w;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
cf_gcc->geom.res = 800;
|
|
|
|
cf_gcc->geom.size = 80;
|
|
|
|
cf_gcc->geom.pos = cf_gcc->geom.res - cf_gcc->geom.size;
|
|
|
|
gc->cf->clients = eina_list_append(gc->cf->clients, cf_gcc);
|
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
else if (!e_gadcon_client_config_new(gc, cc->name))
|
|
|
|
return 0;
|
2009-08-31 04:23:03 -07:00
|
|
|
e_gadcon_unpopulate(gc);
|
|
|
|
e_gadcon_populate(gc);
|
|
|
|
e_config_save_queue();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *
|
2012-06-20 02:58:28 -07:00
|
|
|
_e_shelf_orient_icon_name_get(E_Shelf *s)
|
2009-08-31 04:23:03 -07:00
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
const char *name;
|
2009-08-31 04:23:03 -07:00
|
|
|
|
|
|
|
name = NULL;
|
2012-06-20 02:58:28 -07:00
|
|
|
switch (s->cfg->orient)
|
2009-08-31 04:23:03 -07:00
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-left";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-right";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_TOP:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-top";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-bottom";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-top-left";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-top-right";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-bottom-left";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-bottom-right";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-left-top";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-right-top";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-left-bottom";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-position-right-bottom";
|
|
|
|
break;
|
|
|
|
|
2009-08-31 04:23:03 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
name = "preferences-desktop-shelf";
|
|
|
|
break;
|
2009-08-31 04:23:03 -07:00
|
|
|
}
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
static void
|
|
|
|
_e_shelf_bindings_add(E_Shelf *es)
|
|
|
|
{
|
|
|
|
char buf[1024];
|
|
|
|
|
2010-01-23 12:06:02 -08:00
|
|
|
/* TODO: This might delete edge windows, and then add them again further down. Should prevent this. */
|
2010-01-20 14:36:45 -08:00
|
|
|
_e_shelf_bindings_del(es);
|
|
|
|
|
|
|
|
/* Don't need edge binding if we don't hide shelf */
|
2012-12-05 03:13:09 -08:00
|
|
|
if ((es->cfg) && (!es->cfg->autohide) &&
|
|
|
|
(!es->cfg->autohide_show_action))
|
|
|
|
return;
|
2010-01-20 14:36:45 -08:00
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "shelf.%d", es->id);
|
|
|
|
switch (es->gadcon->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_FLOAT:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
|
|
|
case E_GADCON_ORIENT_VERT:
|
2012-09-07 06:44:25 -07:00
|
|
|
default:
|
2012-06-20 02:58:28 -07:00
|
|
|
/* noop */
|
|
|
|
break;
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
case E_GADCON_ORIENT_LEFT:
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
case E_GADCON_ORIENT_TOP:
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP_LEFT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP_RIGHT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM_LEFT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
|
|
|
|
2010-01-20 14:36:45 -08:00
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_add(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM_RIGHT,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2012-06-20 02:58:28 -07:00
|
|
|
break;
|
2010-01-20 14:36:45 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_shelf_bindings_del(E_Shelf *es)
|
|
|
|
{
|
|
|
|
char buf[1024];
|
2010-01-23 12:06:02 -08:00
|
|
|
E_Zone_Edge edge;
|
2010-01-20 14:36:45 -08:00
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "shelf.%d", es->id);
|
2010-01-23 12:06:02 -08:00
|
|
|
for (edge = E_ZONE_EDGE_LEFT; edge <= E_ZONE_EDGE_BOTTOM_LEFT; edge++)
|
2013-01-11 02:34:29 -08:00
|
|
|
e_bindings_edge_del(E_BINDING_CONTEXT_ZONE, edge,
|
2013-02-05 05:13:33 -08:00
|
|
|
0, E_BINDING_MODIFIER_NONE, 1, buf, NULL, 0);
|
2010-01-20 14:36:45 -08:00
|
|
|
}
|
2011-02-28 20:48:48 -08:00
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_e_shelf_on_current_desk(E_Shelf *es, E_Event_Zone_Edge *ev)
|
|
|
|
{
|
|
|
|
E_Config_Shelf_Desk *sd;
|
|
|
|
Eina_List *ll;
|
|
|
|
int on_current_desk = 0;
|
|
|
|
int on_all_desks = 1;
|
|
|
|
|
2012-07-20 02:37:15 -07:00
|
|
|
if (ev->zone != es->zone) return EINA_FALSE;
|
2011-02-28 20:48:48 -08:00
|
|
|
EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd)
|
|
|
|
{
|
2012-06-20 02:58:28 -07:00
|
|
|
if (!sd) continue;
|
|
|
|
on_all_desks = 0;
|
2013-01-11 02:34:29 -08:00
|
|
|
if ((sd->x == ev->zone->desk_x_current) &&
|
2012-07-28 08:20:08 -07:00
|
|
|
(sd->y == ev->zone->desk_y_current))
|
2012-06-20 02:58:28 -07:00
|
|
|
{
|
|
|
|
on_current_desk = 1;
|
|
|
|
break;
|
|
|
|
}
|
2011-02-28 20:48:48 -08:00
|
|
|
}
|
2012-07-28 08:20:08 -07:00
|
|
|
if ((!on_all_desks) && (!on_current_desk))
|
2011-02-28 20:48:48 -08:00
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
|