static void _e_shelf_menu_del_hook(void *data);
static void _e_shelf_menu_pre_cb(void *data, E_Menu *m);
+static void _e_shelf_edge_event_register(E_Shelf *es, int reg);
+
static Evas_List *shelves = NULL;
static Evas_Hash *winid_shelves = NULL;
es->y = 0;
es->w = 32;
es->h = 32;
+ es->zone = zone;
if (popup)
{
es->popup = e_popup_new(zone, es->x, es->y, es->w, es->h);
}
es->fit_along = 1;
es->layer = layer;
- es->zone = zone;
es->style = evas_stringshare_add(style);
es->o_event = evas_object_rectangle_add(es->evas);
if (!es->cfg) return;
if (((popup) && (es->popup)) || ((!popup) && (!es->popup))) return;
+
if (popup)
{
es->popup = e_popup_new(es->zone, es->x, es->y, es->w, es->h);
e_drop_xdnd_register_set(es->popup->evas_win, 1);
e_popup_layer_set(es->popup, es->cfg->layer);
+
es->ee = es->popup->ecore_evas;
es->evas = es->popup->evas;
es->win = es->popup->evas_win;
evas_object_show(es->o_event);
evas_object_show(es->o_base);
e_popup_edje_bg_object_set(es->popup, es->o_base);
+
+ _e_shelf_edge_event_register(es, 1);
}
else
{
evas_object_move(es->o_base, es->zone->x + es->x, es->zone->y + es->y);
evas_object_layer_set(es->o_event, es->cfg->layer);
evas_object_layer_set(es->o_base, es->cfg->layer);
+
+ _e_shelf_edge_event_register(es, 0);
}
}
else
e_shelf_show(es);
+ if (es->popup)
+ _e_shelf_edge_event_register(es, 1);
e_shelf_toggle(es, 0);
return es;
}
evas_object_del(es->o_base);
if (es->popup)
{
+ _e_shelf_edge_event_register(es, 0);
e_drop_xdnd_register_set(es->popup->evas_win, 0);
winid_shelves = evas_hash_del(winid_shelves, e_util_winid_str_get(es->popup->evas_win), es);
e_object_del(E_OBJECT(es->popup));
e_util_menu_item_edje_icon_set(mi, "enlightenment/delete");
e_menu_item_callback_set(mi, _e_shelf_cb_menu_delete, es);
}
+
+static void
+_e_shelf_edge_event_register(E_Shelf *es, int reg)
+{
+ if (!es) return;
+ if ((!reg) && (!es->edge)) return;
+ if ((reg) && (es->edge)) return;
+ if ((reg) && ((!es->cfg->autohide) || (es->cfg->autohide_show_action) || (!es->popup))) return;
+ es->edge = reg;
+
+ switch (es->gadcon->orient)
+ {
+ case E_GADCON_ORIENT_LEFT:
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_LEFT, es->edge);
+ break;
+ case E_GADCON_ORIENT_RIGHT:
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_RIGHT, es->edge);
+ break;
+ case E_GADCON_ORIENT_TOP:
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_TOP, es->edge);
+ break;
+ case E_GADCON_ORIENT_BOTTOM:
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_BOTTOM, es->edge);
+ break;
+ case E_GADCON_ORIENT_CORNER_TL:
+ case E_GADCON_ORIENT_CORNER_LT:
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_TOP, es->edge);
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_LEFT, es->edge);
+ break;
+ case E_GADCON_ORIENT_CORNER_TR:
+ case E_GADCON_ORIENT_CORNER_RT:
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_TOP, es->edge);
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_RIGHT, es->edge);
+ break;
+ case E_GADCON_ORIENT_CORNER_BL:
+ case E_GADCON_ORIENT_CORNER_LB:
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_BOTTOM, es->edge);
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_LEFT, es->edge);
+ break;
+ case E_GADCON_ORIENT_CORNER_BR:
+ case E_GADCON_ORIENT_CORNER_RB:
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_BOTTOM, es->edge);
+ e_zone_edge_event_register(es->zone, E_ZONE_EDGE_RIGHT, es->edge);
+ break;
+ default:
+ break;
+ }
+}
unsigned char hidden : 1;
unsigned char locked : 1;
unsigned char toggle : 1;
+ unsigned char edge : 1;
};
EAPI int e_shelf_init(void);
static int _e_zone_cb_timer(void *data);
static int _e_zone_cb_desk_show(void *data, int type, void *event);
static void _e_zone_update_flip(E_Zone *zone);
+static void _e_zone_update_edge(E_Zone *zone);
static void _e_zone_event_move_resize_free(void *data, void *ev);
static void _e_zone_event_add_free(void *data, void *ev);
static void _e_zone_event_del_free(void *data, void *ev);
zone->id = id;
zone->edge.left = ecore_x_window_input_new(con->win, zone->x, zone->y, 1, zone->h);
- ecore_x_window_show(zone->edge.left);
e_container_window_raise(zone->container, zone->edge.left, 999);
zone->edge.right = ecore_x_window_input_new(con->win, zone->x + zone->w - 1, zone->y, 1, zone->h);
- ecore_x_window_show(zone->edge.right);
e_container_window_raise(zone->container, zone->edge.right, 999);
zone->edge.top = ecore_x_window_input_new(con->win, zone->x + 1, zone->y, zone->w - 2, 1);
- ecore_x_window_show(zone->edge.top);
e_container_window_raise(zone->container, zone->edge.top, 999);
zone->edge.bottom = ecore_x_window_input_new(con->win, zone->x + 1, zone->y + zone->h - 1, zone->w - 2, 1);
- ecore_x_window_show(zone->edge.bottom);
e_container_window_raise(zone->container, zone->edge.bottom, 999);
zone->handlers = evas_list_append(zone->handlers,
e_config->zone_desks_y_count);
_e_zone_update_flip(zone);
+ _e_zone_update_edge(zone);
e_object_del_attach_func_set(E_OBJECT(zone), _e_zone_object_del_attach);
E_Zone *zone;
zone = lll->data;
- ecore_x_window_show(zone->edge.left);
- ecore_x_window_show(zone->edge.right);
- ecore_x_window_show(zone->edge.top);
- ecore_x_window_show(zone->edge.bottom);
+ _e_zone_update_edge(zone);
}
}
}
}
+EAPI void
+e_zone_edge_event_register(E_Zone *zone, E_Zone_Edge edge, int reg)
+{
+ switch (edge)
+ {
+ case E_ZONE_EDGE_LEFT:
+ if (reg) zone->show.left++;
+ else zone->show.left--;
+ break;
+ case E_ZONE_EDGE_RIGHT:
+ if (reg) zone->show.right++;
+ else zone->show.right--;
+ break;
+ case E_ZONE_EDGE_TOP:
+ if (reg) zone->show.top++;
+ else zone->show.top--;
+ break;
+ case E_ZONE_EDGE_BOTTOM:
+ if (reg) zone->show.bottom++;
+ else zone->show.bottom--;
+ break;
+ }
+ _e_zone_update_edge(zone);
+}
+
/* local subsystem functions */
static void
_e_zone_free(E_Zone *zone)
static void
_e_zone_update_flip(E_Zone *zone)
{
+ if (zone->flip.left) zone->show.left--;
zone->flip.left = 0;
+ if (zone->flip.right) zone->show.right--;
zone->flip.right = 0;
+ if (zone->flip.top) zone->show.top--;
zone->flip.top = 0;
+ if (zone->flip.bottom) zone->show.bottom--;
zone->flip.bottom = 0;
if (e_config->edge_flip_moving)
}
if (one_col && E_ZONE_FLIP_LEFT(zone))
- zone->flip.left = 1;
+ {
+ zone->flip.left = 1;
+ zone->show.left++;
+ }
if (one_col && E_ZONE_FLIP_RIGHT(zone))
- zone->flip.right = 1;
+ {
+ zone->flip.right = 1;
+ zone->show.right++;
+ }
if (one_row && E_ZONE_FLIP_UP(zone))
- zone->flip.top = 1;
+ {
+ zone->flip.top = 1;
+ zone->show.top++;
+ }
if (one_row && E_ZONE_FLIP_DOWN(zone))
- zone->flip.bottom = 1;
+ {
+ zone->flip.bottom = 1;
+ zone->show.bottom++;
+ }
}
}
static void
+_e_zone_update_edge(E_Zone *zone)
+{
+ if (zone->show.left) ecore_x_window_show(zone->edge.left);
+ else ecore_x_window_hide(zone->edge.left);
+
+ if (zone->show.right) ecore_x_window_show(zone->edge.right);
+ else ecore_x_window_hide(zone->edge.right);
+
+ if (zone->show.top) ecore_x_window_show(zone->edge.top);
+ else ecore_x_window_hide(zone->edge.top);
+
+ if (zone->show.bottom) ecore_x_window_show(zone->edge.bottom);
+ else ecore_x_window_hide(zone->edge.bottom);
+}
+
+static void
_e_zone_event_move_resize_free(void *data, void *ev)
{
E_Event_Zone_Move_Resize *e;
struct {
Ecore_X_Window top, right, bottom, left;
} edge;
+ struct {
+ int top, right, bottom, left;
+ } show;
E_Action *cur_mouse_action;
Evas_List *popups;
EAPI void e_zone_desk_linear_flip_to(E_Zone *zone, int x);
EAPI void e_zone_flip_win_disable(void);
EAPI void e_zone_flip_win_restore(void);
+EAPI void e_zone_edge_event_register(E_Zone *zone, E_Zone_Edge edge, int reg);
extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET;
extern EAPI int E_EVENT_ZONE_MOVE_RESIZE;