Formatting & Whitespace removal

SVN revision: 40417
This commit is contained in:
Christopher Michael 2009-04-27 15:42:43 +00:00
parent b455d7316a
commit 022e23f4cb
1 changed files with 196 additions and 190 deletions

View File

@ -19,13 +19,13 @@ static void _e_shelf_cb_menu_items_append(void *data, E_Gadcon_Client *gcc, E_Me
static void _e_shelf_cb_locked_set(void *data, int lock); 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_urgent_show(void *data);
static void _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static int _e_shelf_cb_mouse_in(void *data, int type, void *event); static int _e_shelf_cb_mouse_in(void *data, int type, void *event);
static int _e_shelf_cb_mouse_out(void *data, int type, void *event); static int _e_shelf_cb_mouse_out(void *data, int type, void *event);
static int _e_shelf_cb_id_sort(const void *data1, const void *data2); static int _e_shelf_cb_id_sort(const void *data1, const void *data2);
static int _e_shelf_cb_hide_animator(void *data); static int _e_shelf_cb_hide_animator(void *data);
static int _e_shelf_cb_hide_animator_timer(void *data); static int _e_shelf_cb_hide_animator_timer(void *data);
static int _e_shelf_cb_hide_urgent_timer(void *data); static int _e_shelf_cb_hide_urgent_timer(void *data);
static int _e_shelf_cb_instant_hide_timer(void *data); static int _e_shelf_cb_instant_hide_timer(void *data);
static void _e_shelf_menu_pre_cb(void *data, E_Menu *m); static void _e_shelf_menu_pre_cb(void *data, E_Menu *m);
static Eina_List *shelves = NULL; static Eina_List *shelves = NULL;
@ -99,7 +99,6 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
es = E_OBJECT_ALLOC(E_Shelf, E_SHELF_TYPE, _e_shelf_free); es = E_OBJECT_ALLOC(E_Shelf, E_SHELF_TYPE, _e_shelf_free);
if (!es) return NULL; if (!es) return NULL;
es->id = id; es->id = id;
es->x = 0; es->x = 0;
es->y = 0; es->y = 0;
es->w = 32; es->w = 32;
@ -180,8 +179,10 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i
e_gadcon_shelf_set(es->gadcon, es); e_gadcon_shelf_set(es->gadcon, es);
if (popup) if (popup)
{ {
if (!winid_shelves) winid_shelves = eina_hash_string_superfast_new(NULL); if (!winid_shelves)
eina_hash_add(winid_shelves, e_util_winid_str_get(es->popup->evas_win), es); winid_shelves = eina_hash_string_superfast_new(NULL);
eina_hash_add(winid_shelves,
e_util_winid_str_get(es->popup->evas_win), es);
e_drop_xdnd_register_set(es->popup->evas_win, 1); e_drop_xdnd_register_set(es->popup->evas_win, 1);
e_gadcon_xdnd_window_set(es->gadcon, es->popup->evas_win); e_gadcon_xdnd_window_set(es->gadcon, es->popup->evas_win);
e_gadcon_dnd_window_set(es->gadcon, es->popup->evas_win); e_gadcon_dnd_window_set(es->gadcon, es->popup->evas_win);
@ -305,7 +306,9 @@ e_shelf_toggle(E_Shelf *es, int show)
if (es->instant_delay >= 0.0) if (es->instant_delay >= 0.0)
{ {
_e_shelf_cb_instant_hide_timer(es); _e_shelf_cb_instant_hide_timer(es);
es->hide_timer = ecore_timer_add(es->cfg->hide_timeout, _e_shelf_cb_hide_urgent_timer, es); es->hide_timer =
ecore_timer_add(es->cfg->hide_timeout,
_e_shelf_cb_hide_urgent_timer, es);
} }
else else
{ {
@ -315,10 +318,12 @@ e_shelf_toggle(E_Shelf *es, int show)
es->hide_timer = NULL; es->hide_timer = NULL;
} }
if (!es->hide_animator) if (!es->hide_animator)
es->hide_animator = ecore_animator_add(_e_shelf_cb_hide_animator, es); es->hide_animator =
ecore_animator_add(_e_shelf_cb_hide_animator, es);
} }
} }
else if ((!show) && (!es->hidden) && (!es->gadcon->editing) && (es->cfg->autohide)) else if ((!show) && (!es->hidden) && (!es->gadcon->editing) &&
(es->cfg->autohide))
{ {
edje_object_signal_emit(es->o_base, "e,state,hidden", "e"); edje_object_signal_emit(es->o_base, "e,state,hidden", "e");
if (es->instant_delay >= 0.0) if (es->instant_delay >= 0.0)
@ -330,7 +335,9 @@ e_shelf_toggle(E_Shelf *es, int show)
} }
es->hidden = 1; es->hidden = 1;
if (!es->instant_timer) if (!es->instant_timer)
es->instant_timer = ecore_timer_add(es->instant_delay, _e_shelf_cb_instant_hide_timer, es); es->instant_timer =
ecore_timer_add(es->instant_delay,
_e_shelf_cb_instant_hide_timer, es);
} }
else else
{ {
@ -341,7 +348,9 @@ e_shelf_toggle(E_Shelf *es, int show)
} }
es->hidden = 1; es->hidden = 1;
if (es->hide_timer) ecore_timer_del(es->hide_timer); if (es->hide_timer) ecore_timer_del(es->hide_timer);
es->hide_timer = ecore_timer_add(es->cfg->hide_timeout, _e_shelf_cb_hide_animator_timer, es); es->hide_timer =
ecore_timer_add(es->cfg->hide_timeout,
_e_shelf_cb_hide_animator_timer, es);
} }
} }
} }
@ -376,8 +385,7 @@ e_shelf_resize(E_Shelf *es, int w, int h)
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE); E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
es->w = w; es->w = w;
es->h = h; es->h = h;
if (es->popup) if (es->popup) e_popup_resize(es->popup, es->w, es->h);
e_popup_resize(es->popup, es->w, es->h);
evas_object_resize(es->o_event, es->w, es->h); evas_object_resize(es->o_event, es->w, es->h);
evas_object_resize(es->o_base, es->w, es->h); evas_object_resize(es->o_base, es->w, es->h);
} }
@ -471,11 +479,13 @@ EAPI void
e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient) e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient)
{ {
char buf[PATH_MAX]; char buf[PATH_MAX];
E_OBJECT_CHECK(es); E_OBJECT_CHECK(es);
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE); E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
e_gadcon_orient(es->gadcon, orient); e_gadcon_orient(es->gadcon, orient);
snprintf(buf, sizeof(buf), "e,state,orientation,%s", _e_shelf_orient_string_get(es)); 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_signal_emit(es->o_base, buf, "e");
edje_object_message_signal_process(es->o_base); edje_object_message_signal_process(es->o_base);
e_zone_useful_geometry_dirty(es->zone); e_zone_useful_geometry_dirty(es->zone);
@ -607,9 +617,7 @@ e_shelf_style_set(E_Shelf *es, const char *style)
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE); E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
if (!es->o_base) return; if (!es->o_base) return;
if (es->style) eina_stringshare_del(es->style);
if (es->style)
eina_stringshare_del(es->style);
es->style = eina_stringshare_add(style); es->style = eina_stringshare_add(style);
if (style) if (style)
@ -687,7 +695,7 @@ e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
E_Shelf *es; E_Shelf *es;
es = e_shelf_zone_new(zone, cf_es->name, cf_es->style, es = e_shelf_zone_new(zone, cf_es->name, cf_es->style,
cf_es->popup, cf_es->layer, cf_es->id); cf_es->popup, cf_es->layer, cf_es->id);
if (!es) return NULL; if (!es) return NULL;
if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0; if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0;
@ -764,7 +772,8 @@ _e_shelf_free(E_Shelf *es)
if (es->popup) if (es->popup)
{ {
e_drop_xdnd_register_set(es->popup->evas_win, 0); e_drop_xdnd_register_set(es->popup->evas_win, 0);
eina_hash_del(winid_shelves, e_util_winid_str_get(es->popup->evas_win), es); eina_hash_del(winid_shelves,
e_util_winid_str_get(es->popup->evas_win), es);
if (!eina_hash_population(winid_shelves)) if (!eina_hash_population(winid_shelves))
{ {
eina_hash_free(winid_shelves); eina_hash_free(winid_shelves);
@ -1029,7 +1038,8 @@ _e_shelf_gadcon_frame_request(void *data, E_Gadcon_Client *gcc, const char *styl
return NULL; return NULL;
} }
} }
snprintf(buf, sizeof(buf), "e,state,orientation,%s", _e_shelf_orient_string_get(es)); 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_signal_emit(es->o_base, buf, "e");
edje_object_message_signal_process(o); edje_object_message_signal_process(o);
return o; return o;
@ -1040,7 +1050,7 @@ _e_shelf_toggle_border_fix(E_Shelf *es)
{ {
Eina_List *l; Eina_List *l;
if (es->cfg->overlap || !e_config->border_fix_on_shelf_toggle) if ((es->cfg->overlap) || (!e_config->border_fix_on_shelf_toggle))
return; return;
for (l = e_border_client_list(); l; l = l->next) for (l = e_border_client_list(); l; l = l->next)
@ -1050,12 +1060,10 @@ _e_shelf_toggle_border_fix(E_Shelf *es)
bd = l->data; bd = l->data;
if ((bd->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_NONE) if ((bd->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_NONE)
{ {
if (bd->lock_client_location) if (bd->lock_client_location) continue;
continue;
if (es->hidden) if (es->hidden)
{ {
if (!bd->shelf_fix.modified) if (!bd->shelf_fix.modified) continue;
continue;
if (!--bd->shelf_fix.modified) if (!--bd->shelf_fix.modified)
{ {
e_border_move(bd, bd->shelf_fix.x, bd->shelf_fix.y); e_border_move(bd, bd->shelf_fix.x, bd->shelf_fix.y);
@ -1064,7 +1072,7 @@ _e_shelf_toggle_border_fix(E_Shelf *es)
} }
if (!E_INTERSECTS(bd->x, bd->y, bd->w, bd->h, if (!E_INTERSECTS(bd->x, bd->y, bd->w, bd->h,
es->x, es->y, es->w, es->h)) es->x, es->y, es->w, es->h))
continue; continue;
if (!es->hidden) if (!es->hidden)
@ -1079,27 +1087,27 @@ _e_shelf_toggle_border_fix(E_Shelf *es)
case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_TR: case E_GADCON_ORIENT_CORNER_TR:
if (!es->hidden) if (!es->hidden)
e_border_move(bd, bd->x, bd->y + es->h); e_border_move(bd, bd->x, bd->y + es->h);
break; break;
case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_BOTTOM:
case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR: case E_GADCON_ORIENT_CORNER_BR:
if (!es->hidden) if (!es->hidden)
e_border_move(bd, bd->x, bd->y - es->h); e_border_move(bd, bd->x, bd->y - es->h);
break; break;
case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_LEFT:
case E_GADCON_ORIENT_CORNER_LB: case E_GADCON_ORIENT_CORNER_LB:
case E_GADCON_ORIENT_CORNER_LT: case E_GADCON_ORIENT_CORNER_LT:
if (!es->hidden) if (!es->hidden)
e_border_move(bd, bd->x + es->w, bd->y); e_border_move(bd, bd->x + es->w, bd->y);
break; break;
case E_GADCON_ORIENT_RIGHT: case E_GADCON_ORIENT_RIGHT:
case E_GADCON_ORIENT_CORNER_RB: case E_GADCON_ORIENT_CORNER_RB:
case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RT:
if (!es->hidden) if (!es->hidden)
e_border_move(bd, bd->x - es->w, bd->y); e_border_move(bd, bd->x - es->w, bd->y);
break; break;
default: default:
break; break;
} }
@ -1107,6 +1115,7 @@ _e_shelf_toggle_border_fix(E_Shelf *es)
else else
{ {
E_Maximize max; E_Maximize max;
max = bd->maximized; max = bd->maximized;
e_border_unmaximize(bd, E_MAXIMIZE_BOTH); e_border_unmaximize(bd, E_MAXIMIZE_BOTH);
e_border_maximize(bd, max); e_border_maximize(bd, max);
@ -1117,7 +1126,9 @@ _e_shelf_toggle_border_fix(E_Shelf *es)
static void static void
_e_shelf_menu_item_free(void *data) _e_shelf_menu_item_free(void *data)
{ {
E_Shelf *es = e_object_data_get(data); E_Shelf *es;
es = e_object_data_get(data);
e_shelf_locked_set(es, 0); e_shelf_locked_set(es, 0);
} }
@ -1205,8 +1216,7 @@ _e_shelf_cb_menu_contents(void *data, E_Menu *m, E_Menu_Item *mi)
E_Shelf *es; E_Shelf *es;
es = data; es = data;
if (!es->gadcon->config_dialog) if (!es->gadcon->config_dialog) e_int_gadcon_config_shelf(es->gadcon);
e_int_gadcon_config_shelf(es->gadcon);
} }
static void static void
@ -1244,7 +1254,6 @@ _e_shelf_cb_menu_delete(void *data, E_Menu *m, E_Menu_Item *mi)
E_Config_Shelf *cfg; E_Config_Shelf *cfg;
es = data; es = data;
if (e_config->cnfmdlg_disabled) if (e_config->cnfmdlg_disabled)
{ {
cfg = es->cfg; cfg = es->cfg;
@ -1317,7 +1326,7 @@ _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_inf
static int static int
_e_shelf_cb_mouse_in(void *data, int type, void *event) _e_shelf_cb_mouse_in(void *data, int type, void *event)
{ {
E_Shelf *es; E_Shelf *es;
es = data; es = data;
if (es->cfg->autohide_show_action) return 1; if (es->cfg->autohide_show_action) return 1;
@ -1325,58 +1334,70 @@ _e_shelf_cb_mouse_in(void *data, int type, void *event)
if ((type == E_EVENT_ZONE_EDGE_IN) || (type == E_EVENT_ZONE_EDGE_MOVE)) if ((type == E_EVENT_ZONE_EDGE_IN) || (type == E_EVENT_ZONE_EDGE_MOVE))
{ {
E_Event_Zone_Edge *ev; E_Event_Zone_Edge *ev;
int show = 0; int show = 0;
ev = event; ev = event;
if (es->zone != ev->zone) return 1; if (es->zone != ev->zone) return 1;
switch (es->gadcon->orient) switch (es->gadcon->orient)
{ {
case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_LEFT:
if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h))) if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) &&
show = 1; (ev->y <= (es->y + es->h)))
break; show = 1;
break;
case E_GADCON_ORIENT_RIGHT: case E_GADCON_ORIENT_RIGHT:
if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h))) if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) &&
show = 1; (ev->y <= (es->y + es->h)))
break; show = 1;
break;
case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_TOP:
if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) && (ev->x <= (es->x + es->w))) if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) &&
show = 1; (ev->x <= (es->x + es->w)))
break; show = 1;
break;
case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_BOTTOM:
if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) && (ev->x <= (es->x + es->w))) if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) &&
show = 1; (ev->x <= (es->x + es->w)))
break; show = 1;
break;
case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_LT: case E_GADCON_ORIENT_CORNER_LT:
if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) && (ev->x <= (es->x + es->w))) if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) &&
show = 1; (ev->x <= (es->x + es->w)))
else if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h))) show = 1;
show = 1; else if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) &&
break; (ev->y <= (es->y + es->h)))
show = 1;
break;
case E_GADCON_ORIENT_CORNER_TR: case E_GADCON_ORIENT_CORNER_TR:
case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RT:
if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) && (ev->x <= (es->x + es->w))) if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->x >= es->x) &&
show = 1; (ev->x <= (es->x + es->w)))
else if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h))) show = 1;
show = 1; else if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) &&
break; (ev->y <= (es->y + es->h)))
show = 1;
break;
case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_LB: case E_GADCON_ORIENT_CORNER_LB:
if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) && (ev->x <= (es->x + es->w))) if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) &&
show = 1; (ev->x <= (es->x + es->w)))
else if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h))) show = 1;
show = 1; else if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->y >= es->y) &&
break; (ev->y <= (es->y + es->h)))
show = 1;
break;
case E_GADCON_ORIENT_CORNER_BR: case E_GADCON_ORIENT_CORNER_BR:
case E_GADCON_ORIENT_CORNER_RB: case E_GADCON_ORIENT_CORNER_RB:
if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) && (ev->x <= (es->x + es->w))) if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (ev->x >= es->x) &&
show = 1; (ev->x <= (es->x + es->w)))
else if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) && (ev->y <= (es->y + es->h))) show = 1;
show = 1; else if ((ev->edge == E_ZONE_EDGE_RIGHT) && (ev->y >= es->y) &&
break; (ev->y <= (es->y + es->h)))
show = 1;
break;
default: default:
break; break;
} }
if (show) if (show)
@ -1409,15 +1430,15 @@ _e_shelf_cb_mouse_in(void *data, int type, void *event)
static int static int
_e_shelf_cb_mouse_out(void *data, int type, void *event) _e_shelf_cb_mouse_out(void *data, int type, void *event)
{ {
E_Shelf *es; E_Shelf *es;
Ecore_X_Window win; Ecore_X_Window win;
es = data; es = data;
if (type == E_EVENT_ZONE_EDGE_OUT) if (type == E_EVENT_ZONE_EDGE_OUT)
{ {
E_Event_Zone_Edge *ev; E_Event_Zone_Edge *ev;
int show = 1; int show = 1;
ev = event; ev = event;
if (es->zone != ev->zone) return 1; if (es->zone != ev->zone) return 1;
@ -1426,32 +1447,30 @@ _e_shelf_cb_mouse_out(void *data, int type, void *event)
case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_LEFT:
case E_GADCON_ORIENT_CORNER_LT: case E_GADCON_ORIENT_CORNER_LT:
case E_GADCON_ORIENT_CORNER_LB: case E_GADCON_ORIENT_CORNER_LB:
if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->x >= es->x + es->w)) if ((ev->edge == E_ZONE_EDGE_LEFT) && (ev->x >= es->x + es->w))
show = 0; show = 0;
break; break;
case E_GADCON_ORIENT_RIGHT: case E_GADCON_ORIENT_RIGHT:
case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RT:
case E_GADCON_ORIENT_CORNER_RB: case E_GADCON_ORIENT_CORNER_RB:
if ((ev->edge == E_ZONE_EDGE_RIGHT) && (-ev->x > es->w)) if ((ev->edge == E_ZONE_EDGE_RIGHT) && (-ev->x > es->w))
show = 0; show = 0;
break; break;
case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_TR: case E_GADCON_ORIENT_CORNER_TR:
if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->y > es->y + es->h)) if ((ev->edge == E_ZONE_EDGE_TOP) && (ev->y > es->y + es->h))
show = 0; show = 0;
break; break;
case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_BOTTOM:
case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR: case E_GADCON_ORIENT_CORNER_BR:
if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (-ev->y > es->h)) if ((ev->edge == E_ZONE_EDGE_BOTTOM) && (-ev->y > es->h))
show = 0; show = 0;
break; break;
default: default:
break; break;
} }
if (!show) e_shelf_toggle(es, 0); if (!show) e_shelf_toggle(es, 0);
} }
else if (type == ECORE_X_EVENT_MOUSE_OUT) else if (type == ECORE_X_EVENT_MOUSE_OUT)
@ -1499,7 +1518,6 @@ _e_shelf_cb_hide_animator(void *data)
int step, hide_max; int step, hide_max;
es = data; es = data;
switch (es->gadcon->orient) switch (es->gadcon->orient)
{ {
case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_TOP:
@ -1508,20 +1526,18 @@ _e_shelf_cb_hide_animator(void *data)
case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_BOTTOM:
case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR: case E_GADCON_ORIENT_CORNER_BR:
hide_max = es->h - es->hidden_state_size; hide_max = es->h - es->hidden_state_size;
if (es->hide_origin == -1) if (es->hide_origin == -1) es->hide_origin = es->y;
es->hide_origin = es->y; break;
break;
case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_LEFT:
case E_GADCON_ORIENT_CORNER_LB: case E_GADCON_ORIENT_CORNER_LB:
case E_GADCON_ORIENT_CORNER_LT: case E_GADCON_ORIENT_CORNER_LT:
case E_GADCON_ORIENT_RIGHT: case E_GADCON_ORIENT_RIGHT:
case E_GADCON_ORIENT_CORNER_RB: case E_GADCON_ORIENT_CORNER_RB:
case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RT:
hide_max = es->w - es->hidden_state_size; hide_max = es->w - es->hidden_state_size;
if (es->hide_origin == -1) if (es->hide_origin == -1) es->hide_origin = es->x;
es->hide_origin = es->x; break;
break;
} }
step = (hide_max / e_config->framerate) / es->cfg->hide_duration; step = (hide_max / e_config->framerate) / es->cfg->hide_duration;
@ -1532,13 +1548,9 @@ _e_shelf_cb_hide_animator(void *data)
if (es->hide_step < hide_max) if (es->hide_step < hide_max)
{ {
if (es->hide_step + step > hide_max) if (es->hide_step + step > hide_max)
{ es->hide_step = hide_max;
es->hide_step = hide_max;
}
else else
{ es->hide_step += step;
es->hide_step += step;
}
} }
else goto end; else goto end;
} }
@ -1547,13 +1559,9 @@ _e_shelf_cb_hide_animator(void *data)
if (es->hide_step > 0) if (es->hide_step > 0)
{ {
if (es->hide_step < step) if (es->hide_step < step)
{ es->hide_step = 0;
es->hide_step = 0;
}
else else
{ es->hide_step -= step;
es->hide_step -= step;
}
} }
else goto end; else goto end;
} }
@ -1563,28 +1571,28 @@ _e_shelf_cb_hide_animator(void *data)
case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_TR: case E_GADCON_ORIENT_CORNER_TR:
e_shelf_move(es, es->x, es->hide_origin - es->hide_step); e_shelf_move(es, es->x, es->hide_origin - es->hide_step);
break; break;
case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_BOTTOM:
case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR: case E_GADCON_ORIENT_CORNER_BR:
e_shelf_move(es, es->x, es->hide_origin + es->hide_step); e_shelf_move(es, es->x, es->hide_origin + es->hide_step);
break; break;
case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_LEFT:
case E_GADCON_ORIENT_CORNER_LB: case E_GADCON_ORIENT_CORNER_LB:
case E_GADCON_ORIENT_CORNER_LT: case E_GADCON_ORIENT_CORNER_LT:
e_shelf_move(es, es->hide_origin - es->hide_step, es->y); e_shelf_move(es, es->hide_origin - es->hide_step, es->y);
break; break;
case E_GADCON_ORIENT_RIGHT: case E_GADCON_ORIENT_RIGHT:
case E_GADCON_ORIENT_CORNER_RB: case E_GADCON_ORIENT_CORNER_RB:
case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RT:
e_shelf_move(es, es->hide_origin + es->hide_step, es->y); e_shelf_move(es, es->hide_origin + es->hide_step, es->y);
break; break;
} }
return 1; return 1;
end: end:
es->hide_animator = NULL; es->hide_animator = NULL;
if (es->interrupted > -1) if (es->interrupted > -1)
e_shelf_toggle(es, es->interrupted); e_shelf_toggle(es, es->interrupted);
@ -1614,8 +1622,7 @@ _e_shelf_cb_hide_urgent_timer(void *data)
es = data; es = data;
es->hide_timer = NULL; es->hide_timer = NULL;
if (es->urgent_show) if (es->urgent_show) e_shelf_toggle(es, 0);
e_shelf_toggle(es, 0);
return 0; return 0;
} }
@ -1625,41 +1632,40 @@ _e_shelf_cb_instant_hide_timer(void *data)
E_Shelf *es; E_Shelf *es;
es = data; es = data;
switch (es->gadcon->orient) switch (es->gadcon->orient)
{ {
case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_TOP:
case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TL:
case E_GADCON_ORIENT_CORNER_TR: case E_GADCON_ORIENT_CORNER_TR:
if (es->hidden) if (es->hidden)
e_shelf_move(es, es->x, es->y - es->h + es->hidden_state_size); e_shelf_move(es, es->x, es->y - es->h + es->hidden_state_size);
else else
e_shelf_move(es, es->x, es->y + es->h - es->hidden_state_size); e_shelf_move(es, es->x, es->y + es->h - es->hidden_state_size);
break; break;
case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_BOTTOM:
case E_GADCON_ORIENT_CORNER_BL: case E_GADCON_ORIENT_CORNER_BL:
case E_GADCON_ORIENT_CORNER_BR: case E_GADCON_ORIENT_CORNER_BR:
if (es->hidden) if (es->hidden)
e_shelf_move(es, es->x, es->y + es->h - es->hidden_state_size); e_shelf_move(es, es->x, es->y + es->h - es->hidden_state_size);
else else
e_shelf_move(es, es->x, es->y - es->h + es->hidden_state_size); e_shelf_move(es, es->x, es->y - es->h + es->hidden_state_size);
break; break;
case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_LEFT:
case E_GADCON_ORIENT_CORNER_LB: case E_GADCON_ORIENT_CORNER_LB:
case E_GADCON_ORIENT_CORNER_LT: case E_GADCON_ORIENT_CORNER_LT:
if (es->hidden) if (es->hidden)
e_shelf_move(es, es->x - es->w + es->hidden_state_size, es->y); e_shelf_move(es, es->x - es->w + es->hidden_state_size, es->y);
else else
e_shelf_move(es, es->x + es->w - es->hidden_state_size, es->y); e_shelf_move(es, es->x + es->w - es->hidden_state_size, es->y);
break; break;
case E_GADCON_ORIENT_RIGHT: case E_GADCON_ORIENT_RIGHT:
case E_GADCON_ORIENT_CORNER_RB: case E_GADCON_ORIENT_CORNER_RB:
case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RT:
if (es->hidden) if (es->hidden)
e_shelf_move(es, es->x + es->w - es->hidden_state_size, es->y); e_shelf_move(es, es->x + es->w - es->hidden_state_size, es->y);
else else
e_shelf_move(es, es->x - es->w + es->hidden_state_size, es->y); e_shelf_move(es, es->x - es->w + es->hidden_state_size, es->y);
break; break;
default: default:
break; break;
} }