Fix nasty formatting.

Remove whitespace.
Use -1 for eina_list_sort (saves a function call to eina_list_count).



SVN revision: 44801
This commit is contained in:
Christopher Michael 2009-12-30 18:24:37 +00:00
parent ec8e145dcd
commit 694a80290f
1 changed files with 269 additions and 255 deletions

View File

@ -87,6 +87,7 @@ ACT_FN_GO(window_move)
if (!((E_Border *)obj)->lock_user_location) if (!((E_Border *)obj)->lock_user_location)
e_border_act_move_begin((E_Border *)obj, NULL); e_border_act_move_begin((E_Border *)obj, NULL);
} }
ACT_FN_GO_MOUSE(window_move) ACT_FN_GO_MOUSE(window_move)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -95,6 +96,7 @@ ACT_FN_GO_MOUSE(window_move)
if (!((E_Border *)obj)->lock_user_location) if (!((E_Border *)obj)->lock_user_location)
e_border_act_move_begin((E_Border *)obj, ev); e_border_act_move_begin((E_Border *)obj, ev);
} }
ACT_FN_GO_SIGNAL(window_move) ACT_FN_GO_SIGNAL(window_move)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -103,9 +105,7 @@ ACT_FN_GO_SIGNAL(window_move)
if (!((E_Border *)obj)->lock_user_location) if (!((E_Border *)obj)->lock_user_location)
{ {
if ((params) && (!strcmp(params, "end"))) if ((params) && (!strcmp(params, "end")))
{
e_border_signal_move_end((E_Border *)obj, sig, src); e_border_signal_move_end((E_Border *)obj, sig, src);
}
else else
{ {
if (((E_Border *)obj)->moving) if (((E_Border *)obj)->moving)
@ -115,6 +115,7 @@ ACT_FN_GO_SIGNAL(window_move)
} }
} }
} }
ACT_FN_END(window_move) ACT_FN_END(window_move)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -122,6 +123,7 @@ ACT_FN_END(window_move)
if (obj->type != E_BORDER_TYPE) return; if (obj->type != E_BORDER_TYPE) return;
e_border_act_move_end((E_Border *)obj, NULL); e_border_act_move_end((E_Border *)obj, NULL);
} }
ACT_FN_END_MOUSE(window_move) ACT_FN_END_MOUSE(window_move)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -152,6 +154,7 @@ ACT_FN_GO(window_resize)
if (!((E_Border *)obj)->lock_user_size) if (!((E_Border *)obj)->lock_user_size)
e_border_act_resize_begin((E_Border *)obj, NULL); e_border_act_resize_begin((E_Border *)obj, NULL);
} }
ACT_FN_GO_MOUSE(window_resize) ACT_FN_GO_MOUSE(window_resize)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -160,6 +163,7 @@ ACT_FN_GO_MOUSE(window_resize)
if (!((E_Border *)obj)->lock_user_size) if (!((E_Border *)obj)->lock_user_size)
e_border_act_resize_begin((E_Border *)obj, ev); e_border_act_resize_begin((E_Border *)obj, ev);
} }
ACT_FN_GO_SIGNAL(window_resize) ACT_FN_GO_SIGNAL(window_resize)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -179,6 +183,7 @@ ACT_FN_GO_SIGNAL(window_resize)
} }
} }
} }
ACT_FN_END(window_resize) ACT_FN_END(window_resize)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -186,6 +191,7 @@ ACT_FN_END(window_resize)
if (obj->type != E_BORDER_TYPE) return; if (obj->type != E_BORDER_TYPE) return;
e_border_act_resize_end((E_Border *)obj, NULL); e_border_act_resize_end((E_Border *)obj, NULL);
} }
ACT_FN_END_MOUSE(window_resize) ACT_FN_END_MOUSE(window_resize)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -219,6 +225,7 @@ ACT_FN_GO(window_menu)
} }
e_border_act_menu_begin((E_Border *)obj, NULL, 0); e_border_act_menu_begin((E_Border *)obj, NULL, 0);
} }
ACT_FN_GO_MOUSE(window_menu) ACT_FN_GO_MOUSE(window_menu)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -230,6 +237,7 @@ ACT_FN_GO_MOUSE(window_menu)
} }
e_border_act_menu_begin((E_Border *)obj, ev, 0); e_border_act_menu_begin((E_Border *)obj, ev, 0);
} }
ACT_FN_GO_KEY(window_menu) ACT_FN_GO_KEY(window_menu)
{ {
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -469,6 +477,7 @@ ACT_FN_GO(window_fullscreen_toggle)
if (!((E_Border *)obj)->lock_user_fullscreen) if (!((E_Border *)obj)->lock_user_fullscreen)
{ {
E_Border *bd; E_Border *bd;
bd = (E_Border *)obj; bd = (E_Border *)obj;
if (bd->fullscreen) if (bd->fullscreen)
e_border_unfullscreen(bd); e_border_unfullscreen(bd);
@ -494,11 +503,13 @@ ACT_FN_GO(window_fullscreen)
if (!((E_Border *)obj)->lock_user_fullscreen) if (!((E_Border *)obj)->lock_user_fullscreen)
{ {
E_Border *bd; E_Border *bd;
bd = (E_Border *)obj; bd = (E_Border *)obj;
if (params) if (params)
{ {
int v; int v;
char buf[32]; char buf[32];
buf[0] = 0; buf[0] = 0;
if (sscanf(params, "%i %20s", &v, buf) == 2) if (sscanf(params, "%i %20s", &v, buf) == 2)
{ {
@ -604,11 +615,16 @@ ACT_FN_GO(window_maximized)
{ {
if (v == 1) if (v == 1)
{ {
if (!strcmp(s1, "fullscreen")) e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN | max); if (!strcmp(s1, "fullscreen"))
else if (!strcmp(s1, "smart")) e_border_maximize(bd, E_MAXIMIZE_SMART | max); e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN | max);
else if (!strcmp(s1, "expand")) e_border_maximize(bd, E_MAXIMIZE_EXPAND | max); else if (!strcmp(s1, "smart"))
else if (!strcmp(s1, "fill")) e_border_maximize(bd, E_MAXIMIZE_FILL | max); e_border_maximize(bd, E_MAXIMIZE_SMART | max);
else e_border_maximize(bd, (e_config->maximize_policy & E_MAXIMIZE_TYPE) | max); else if (!strcmp(s1, "expand"))
e_border_maximize(bd, E_MAXIMIZE_EXPAND | max);
else if (!strcmp(s1, "fill"))
e_border_maximize(bd, E_MAXIMIZE_FILL | max);
else
e_border_maximize(bd, (e_config->maximize_policy & E_MAXIMIZE_TYPE) | max);
} }
else if (v == 0) else if (v == 0)
e_border_unmaximize(bd, max); e_border_unmaximize(bd, max);
@ -638,11 +654,16 @@ ACT_FN_GO(window_shaded_toggle)
e_border_unshade(bd, E_DIRECTION_UP); e_border_unshade(bd, E_DIRECTION_UP);
else else
{ {
if (!strcmp(params, "up")) e_border_unshade(bd, E_DIRECTION_UP); if (!strcmp(params, "up"))
else if (!strcmp(params, "down")) e_border_unshade(bd, E_DIRECTION_DOWN); e_border_unshade(bd, E_DIRECTION_UP);
else if (!strcmp(params, "left")) e_border_unshade(bd, E_DIRECTION_LEFT); else if (!strcmp(params, "down"))
else if (!strcmp(params, "right")) e_border_unshade(bd, E_DIRECTION_RIGHT); e_border_unshade(bd, E_DIRECTION_DOWN);
else e_border_unshade(bd, E_DIRECTION_UP); else if (!strcmp(params, "left"))
e_border_unshade(bd, E_DIRECTION_LEFT);
else if (!strcmp(params, "right"))
e_border_unshade(bd, E_DIRECTION_RIGHT);
else
e_border_unshade(bd, E_DIRECTION_UP);
} }
} }
else else
@ -651,11 +672,16 @@ ACT_FN_GO(window_shaded_toggle)
e_border_shade(bd, E_DIRECTION_UP); e_border_shade(bd, E_DIRECTION_UP);
else else
{ {
if (!strcmp(params, "up")) e_border_shade(bd, E_DIRECTION_UP); if (!strcmp(params, "up"))
else if (!strcmp(params, "down")) e_border_shade(bd, E_DIRECTION_DOWN); e_border_shade(bd, E_DIRECTION_UP);
else if (!strcmp(params, "left")) e_border_shade(bd, E_DIRECTION_LEFT); else if (!strcmp(params, "down"))
else if (!strcmp(params, "right")) e_border_shade(bd, E_DIRECTION_RIGHT); e_border_shade(bd, E_DIRECTION_DOWN);
else e_border_shade(bd, E_DIRECTION_UP); else if (!strcmp(params, "left"))
e_border_shade(bd, E_DIRECTION_LEFT);
else if (!strcmp(params, "right"))
e_border_shade(bd, E_DIRECTION_RIGHT);
else
e_border_shade(bd, E_DIRECTION_UP);
} }
} }
} }
@ -742,7 +768,6 @@ ACT_FN_GO(window_pinned_toggle)
E_Border *bd; E_Border *bd;
bd = (E_Border *)obj; bd = (E_Border *)obj;
if ((bd->client.netwm.state.stacking == E_STACKING_BELOW) && if ((bd->client.netwm.state.stacking == E_STACKING_BELOW) &&
(bd->user_skip_winlist) && (bd->borderless)) (bd->user_skip_winlist) && (bd->borderless))
e_border_pinned_set(bd, 0); e_border_pinned_set(bd, 0);
@ -770,7 +795,6 @@ ACT_FN_GO(window_move_by)
E_Border *bd; E_Border *bd;
bd = (E_Border *)obj; bd = (E_Border *)obj;
e_border_move(bd, bd->x + dx, bd->y + dy); e_border_move(bd, bd->x + dx, bd->y + dy);
if (e_config->focus_policy != E_FOCUS_CLICK) if (e_config->focus_policy != E_FOCUS_CLICK)
@ -798,7 +822,6 @@ ACT_FN_GO(window_move_to)
char cx, cy; char cx, cy;
bd = (E_Border *)obj; bd = (E_Border *)obj;
if (sscanf(params, "%c%i %c%i", &cx, &x, &cy, &y) == 4) if (sscanf(params, "%c%i %c%i", &cx, &x, &cy, &y) == 4)
{ {
/* Nothing, both x and y is updated. */ /* Nothing, both x and y is updated. */
@ -832,6 +855,9 @@ ACT_FN_GO(window_move_to)
/***************************************************************************/ /***************************************************************************/
ACT_FN_GO(window_move_to_center) ACT_FN_GO(window_move_to_center)
{ {
E_Border *bd;
int x, y;
if (!obj) obj = E_OBJECT(e_border_focused_get()); if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return; if (!obj) return;
if (obj->type != E_BORDER_TYPE) if (obj->type != E_BORDER_TYPE)
@ -840,8 +866,6 @@ ACT_FN_GO(window_move_to_center)
if (!obj) return; if (!obj) return;
} }
E_Border *bd;
int x, y;
bd = (E_Border *)obj; bd = (E_Border *)obj;
e_border_center_pos_get(bd, &x, &y); e_border_center_pos_get(bd, &x, &y);
@ -874,6 +898,7 @@ ACT_FN_GO(window_resize_by)
if (sscanf(params, "%i %i", &dw, &dh) == 2) if (sscanf(params, "%i %i", &dw, &dh) == 2)
{ {
E_Border *bd; E_Border *bd;
bd = (E_Border *)obj; bd = (E_Border *)obj;
dw += bd->w; dw += bd->w;
@ -963,7 +988,6 @@ ACT_FN_GO(window_push)
if ((x != bd->x) || (y != bd->y)) if ((x != bd->x) || (y != bd->y))
{ {
e_border_move(bd, x, y); e_border_move(bd, x, y);
if (e_config->focus_policy != E_FOCUS_CLICK) if (e_config->focus_policy != E_FOCUS_CLICK)
ecore_x_pointer_warp(bd->zone->container->win, ecore_x_pointer_warp(bd->zone->container->win,
bd->x + (bd->w / 2), bd->y + (bd->h / 2)); bd->x + (bd->w / 2), bd->y + (bd->h / 2));
@ -1072,8 +1096,7 @@ ACT_FN_GO(window_desk_move_to)
E_Desk *desk; E_Desk *desk;
desk = e_desk_at_xy_get(bd->zone, x, y); desk = e_desk_at_xy_get(bd->zone, x, y);
if (desk) if (desk) e_border_desk_set(bd, desk);
e_border_desk_set(bd, desk);
} }
} }
@ -1281,7 +1304,6 @@ ACT_FN_GO(desk_linear_flip_to)
} }
#define DESK_ACTION_ALL(zone, act) \ #define DESK_ACTION_ALL(zone, act) \
E_Zone *zone; \ E_Zone *zone; \
Eina_List *lm, *lc, *lz; \ Eina_List *lm, *lc, *lz; \
@ -1353,8 +1375,6 @@ ACT_FN_GO(desk_linear_flip_to_all)
} }
} }
/***************************************************************************/ /***************************************************************************/
ACT_FN_GO(screen_send_to) ACT_FN_GO(screen_send_to)
{ {
@ -1433,8 +1453,8 @@ ACT_FN_GO(screen_send_by)
} }
#define ZONE_DESK_ACTION(con_num, zone_num, zone, act) \ #define ZONE_DESK_ACTION(con_num, zone_num, zone, act) \
E_Zone *zone; \ E_Zone *zone; \
if ((con_num < 0) || (zone_num < 0)) { \ if ((con_num < 0) || (zone_num < 0)) { \
Eina_List *l, *ll, *lll; \ Eina_List *l, *ll, *lll; \
E_Container *con; \ E_Container *con; \
E_Manager *man; \ E_Manager *man; \
@ -1456,10 +1476,10 @@ if ((con_num < 0) || (zone_num < 0)) { \
EINA_LIST_FOREACH(con->zones, lll, zone) { \ EINA_LIST_FOREACH(con->zones, lll, zone) { \
act; \ act; \
} } } } } \ } } } } } \
else { \ else { \
zone = e_util_container_zone_number_get(con_num, zone_num); \ zone = e_util_container_zone_number_get(con_num, zone_num); \
if (zone) act; \ if (zone) act; \
} }
/***************************************************************************/ /***************************************************************************/
#if 0 #if 0
@ -1471,11 +1491,9 @@ ACT_FN_GO(zone_desk_flip_by)
int dx = 0, dy = 0; int dx = 0, dy = 0;
if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4) if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4)
{
ZONE_DESK_ACTION(con_num, zone_num, zone, ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_flip_by(zone, dx, dy)); e_zone_desk_flip_by(zone, dx, dy));
} }
}
} }
#endif #endif
@ -1489,11 +1507,9 @@ ACT_FN_GO(zone_desk_flip_to)
int dx = 0, dy = 0; int dx = 0, dy = 0;
if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4) if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4)
{
ZONE_DESK_ACTION(con_num, zone_num, zone, ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_flip_to(zone, dx, dy)); e_zone_desk_flip_to(zone, dx, dy));
} }
}
} }
#endif #endif
@ -1507,11 +1523,9 @@ ACT_FN_GO(zone_desk_linear_flip_by)
int dx = 0; int dx = 0;
if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3) if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3)
{
ZONE_DESK_ACTION(con_num, zone_num, zone, ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_linear_flip_by(zone, dx)); e_zone_desk_linear_flip_by(zone, dx));
} }
}
} }
#endif #endif
@ -1525,11 +1539,9 @@ ACT_FN_GO(zone_desk_linear_flip_to)
int dx = 0; int dx = 0;
if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3) if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3)
{
ZONE_DESK_ACTION(con_num, zone_num, zone, ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_linear_flip_to(zone, dx)); e_zone_desk_linear_flip_to(zone, dx));
} }
}
} }
#endif #endif
@ -1539,17 +1551,25 @@ _e_actions_cb_menu_end(void *data, E_Menu *m)
{ {
e_object_del(E_OBJECT(m)); e_object_del(E_OBJECT(m));
} }
static E_Menu * static E_Menu *
_e_actions_menu_find(const char *name) _e_actions_menu_find(const char *name)
{ {
if (!strcmp(name, "main")) return e_int_menus_main_new(); if (!strcmp(name, "main"))
else if (!strcmp(name, "favorites")) return e_int_menus_favorite_apps_new(); return e_int_menus_main_new();
else if (!strcmp(name, "all")) return e_int_menus_all_apps_new(); else if (!strcmp(name, "favorites"))
else if (!strcmp(name, "clients")) return e_int_menus_clients_new(); return e_int_menus_favorite_apps_new();
else if (!strcmp(name, "lost_clients")) return e_int_menus_lost_clients_new(); else if (!strcmp(name, "all"))
else if (!strcmp(name, "configuration")) return e_int_menus_config_new(); return e_int_menus_all_apps_new();
else if (!strcmp(name, "clients"))
return e_int_menus_clients_new();
else if (!strcmp(name, "lost_clients"))
return e_int_menus_lost_clients_new();
else if (!strcmp(name, "configuration"))
return e_int_menus_config_new();
return NULL; return NULL;
} }
ACT_FN_GO(menu_show) ACT_FN_GO(menu_show)
{ {
E_Zone *zone; E_Zone *zone;
@ -1579,6 +1599,7 @@ ACT_FN_GO(menu_show)
} }
} }
} }
ACT_FN_GO_MOUSE(menu_show) ACT_FN_GO_MOUSE(menu_show)
{ {
E_Zone *zone; E_Zone *zone;
@ -1610,6 +1631,7 @@ ACT_FN_GO_MOUSE(menu_show)
} }
} }
} }
ACT_FN_GO_KEY(menu_show) ACT_FN_GO_KEY(menu_show)
{ {
E_Zone *zone; E_Zone *zone;
@ -1648,10 +1670,8 @@ ACT_FN_GO(exec)
if (zone) if (zone)
{ {
if (params) if (params)
{
e_exec(zone, NULL, params, NULL, "action/exec"); e_exec(zone, NULL, params, NULL, "action/exec");
} }
}
} }
/***************************************************************************/ /***************************************************************************/
@ -1695,10 +1715,7 @@ ACT_FN_GO(desk_deskshow_toggle)
zone = _e_actions_zone_get(obj); zone = _e_actions_zone_get(obj);
if (!zone) zone = e_util_zone_current_get(e_manager_current_get()); if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
if (zone) if (zone) e_desk_deskshow(zone);
{
e_desk_deskshow(zone);
}
} }
ACT_FN_GO(cleanup_windows) ACT_FN_GO(cleanup_windows)
@ -1707,8 +1724,7 @@ ACT_FN_GO(cleanup_windows)
zone = _e_actions_zone_get(obj); zone = _e_actions_zone_get(obj);
if (!zone) zone = e_util_zone_current_get(e_manager_current_get()); if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
if (zone) if (zone) e_place_zone_region_smart_cleanup(zone);
e_place_zone_region_smart_cleanup(zone);
} }
/***************************************************************************/ /***************************************************************************/
@ -1763,8 +1779,7 @@ ACT_FN_GO(exit)
e_dialog_text_set(exit_dialog, e_dialog_text_set(exit_dialog,
_("You requested to exit Enlightenment.<br>" _("You requested to exit Enlightenment.<br>"
"<br>" "<br>"
"Are you sure you want to exit?" "Are you sure you want to exit?"));
));
e_dialog_icon_set(exit_dialog, "application-exit", 64); e_dialog_icon_set(exit_dialog, "application-exit", 64);
e_dialog_button_add(exit_dialog, _("Yes"), NULL, e_dialog_button_add(exit_dialog, _("Yes"), NULL,
_e_actions_cb_exit_dialog_ok, NULL); _e_actions_cb_exit_dialog_ok, NULL);
@ -1861,8 +1876,7 @@ ACT_FN_GO(logout)
e_dialog_text_set(logout_dialog, e_dialog_text_set(logout_dialog,
_("You are about to log out.<br>" _("You are about to log out.<br>"
"<br>" "<br>"
"Are you sure you want to do this?" "Are you sure you want to do this?"));
));
e_dialog_icon_set(logout_dialog, "system-log-out", 64); e_dialog_icon_set(logout_dialog, "system-log-out", 64);
e_dialog_button_add(logout_dialog, _("Yes"), NULL, e_dialog_button_add(logout_dialog, _("Yes"), NULL,
_e_actions_cb_logout_dialog_ok, NULL); _e_actions_cb_logout_dialog_ok, NULL);
@ -1925,8 +1939,7 @@ ACT_FN_GO(halt)
e_dialog_text_set(halt_dialog, e_dialog_text_set(halt_dialog,
_("You requested to turn off your Computer.<br>" _("You requested to turn off your Computer.<br>"
"<br>" "<br>"
"Are you sure you want to shut down?" "Are you sure you want to shut down?"));
));
e_dialog_icon_set(halt_dialog, "system-shutdown", 64); e_dialog_icon_set(halt_dialog, "system-shutdown", 64);
e_dialog_button_add(halt_dialog, _("Yes"), NULL, e_dialog_button_add(halt_dialog, _("Yes"), NULL,
_e_actions_cb_halt_dialog_ok, NULL); _e_actions_cb_halt_dialog_ok, NULL);
@ -1989,8 +2002,7 @@ ACT_FN_GO(reboot)
e_dialog_text_set(reboot_dialog, e_dialog_text_set(reboot_dialog,
_("You requested to reboot your Computer.<br>" _("You requested to reboot your Computer.<br>"
"<br>" "<br>"
"Are you sure you want to restart it?" "Are you sure you want to restart it?"));
));
e_dialog_icon_set(reboot_dialog, "system-restart", 64); e_dialog_icon_set(reboot_dialog, "system-restart", 64);
e_dialog_button_add(reboot_dialog, _("Yes"), NULL, e_dialog_button_add(reboot_dialog, _("Yes"), NULL,
_e_actions_cb_reboot_dialog_ok, NULL); _e_actions_cb_reboot_dialog_ok, NULL);
@ -2053,8 +2065,7 @@ ACT_FN_GO(suspend)
e_dialog_text_set(suspend_dialog, e_dialog_text_set(suspend_dialog,
_("You requested to suspend your Computer.<br>" _("You requested to suspend your Computer.<br>"
"<br>" "<br>"
"Are you sure you want to suspend?" "Are you sure you want to suspend?"));
));
e_dialog_icon_set(suspend_dialog, "system-suspend", 64); e_dialog_icon_set(suspend_dialog, "system-suspend", 64);
e_dialog_button_add(suspend_dialog, _("Yes"), NULL, e_dialog_button_add(suspend_dialog, _("Yes"), NULL,
_e_actions_cb_suspend_dialog_ok, NULL); _e_actions_cb_suspend_dialog_ok, NULL);
@ -2117,8 +2128,7 @@ ACT_FN_GO(hibernate)
e_dialog_text_set(hibernate_dialog, e_dialog_text_set(hibernate_dialog,
_("You requested to hibernate your Computer.<br>" _("You requested to hibernate your Computer.<br>"
"<br>" "<br>"
"Are you sure you want to suspend to disk?" "Are you sure you want to suspend to disk?"));
));
e_dialog_icon_set(hibernate_dialog, "system-suspend-hibernate", 64); e_dialog_icon_set(hibernate_dialog, "system-suspend-hibernate", 64);
e_dialog_button_add(hibernate_dialog, _("Yes"), NULL, e_dialog_button_add(hibernate_dialog, _("Yes"), NULL,
_e_actions_cb_hibernate_dialog_ok, NULL); _e_actions_cb_hibernate_dialog_ok, NULL);
@ -2138,6 +2148,7 @@ ACT_FN_GO(pointer_resize_push)
if (obj->type == E_BORDER_TYPE) if (obj->type == E_BORDER_TYPE)
{ {
E_Border *bd; E_Border *bd;
bd = (E_Border *)obj; bd = (E_Border *)obj;
if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) || if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) ||
(bd->fullscreen) || (bd->fullscreen) ||
@ -2159,6 +2170,7 @@ ACT_FN_GO(pointer_resize_pop)
if (obj->type == E_BORDER_TYPE) if (obj->type == E_BORDER_TYPE)
{ {
E_Border *bd; E_Border *bd;
bd = (E_Border *)obj; bd = (E_Border *)obj;
if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) || if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) ||
(bd->fullscreen) || (bd->fullscreen) ||
@ -2211,6 +2223,7 @@ if ((!params) || (params && (fnmatch(params, es->name, 0) == 0))) \
e_shelf_toggle(es, 1); \ e_shelf_toggle(es, 1); \
e_shelf_toggle(es, 0); \ e_shelf_toggle(es, 0); \
} }
ACT_FN_GO_EDGE(shelf_show) ACT_FN_GO_EDGE(shelf_show)
{ {
Eina_List *l; Eina_List *l;
@ -2263,20 +2276,19 @@ ACT_FN_GO_EDGE(shelf_show)
} }
} }
#undef ACT_SHELF_SHOW #undef ACT_SHELF_SHOW
/***************************************************************************/
/***************************************************************************/
typedef struct _Delayed_Action Delayed_Action; typedef struct _Delayed_Action Delayed_Action;
struct _Delayed_Action struct _Delayed_Action
{ {
int mouse; int mouse, button;
int button;
const char *keyname; const char *keyname;
E_Object *obj; E_Object *obj;
Ecore_Timer *timer; Ecore_Timer *timer;
struct { struct
const char *action; {
const char *params; const char *action, *params;
} def, delayed; } def, delayed;
}; };
@ -2353,9 +2365,8 @@ static void
_delayed_action_list_parse(Delayed_Action *da, const char *params) _delayed_action_list_parse(Delayed_Action *da, const char *params)
{ {
double delay = 2.0; double delay = 2.0;
const char *p, const char *p, *a1start = NULL, *a1stop = NULL;
*a1start = NULL, *a1stop = NULL, const char *a2start = NULL, *a2stop = NULL;
*a2start = NULL, *a2stop = NULL;
// FORMAT: "[0.0 default_action param1 param2] [x.x action2 param1 param2]" // FORMAT: "[0.0 default_action param1 param2] [x.x action2 param1 param2]"
p = params; p = params;
@ -2476,14 +2487,17 @@ ACT_FN_GO_KEY(delayed_action)
{ {
_delayed_action_key_add(obj, params, ev); _delayed_action_key_add(obj, params, ev);
} }
ACT_FN_GO_MOUSE(delayed_action) ACT_FN_GO_MOUSE(delayed_action)
{ {
_delayed_action_mouse_add(obj, params, ev); _delayed_action_mouse_add(obj, params, ev);
} }
ACT_FN_END_KEY(delayed_action) ACT_FN_END_KEY(delayed_action)
{ {
_delayed_action_key_del(obj, params, ev); _delayed_action_key_del(obj, params, ev);
} }
ACT_FN_END_MOUSE(delayed_action) ACT_FN_END_MOUSE(delayed_action)
{ {
_delayed_action_mouse_del(obj, params, ev); _delayed_action_mouse_del(obj, params, ev);
@ -2747,7 +2761,6 @@ e_actions_init(void)
"desk_linear_flip_to_all", NULL, "desk_linear_flip_to_all", NULL,
"syntax: N, example: 1", 1); "syntax: N, example: 1", 1);
/* screen_send_to */ /* screen_send_to */
ACT_GO(screen_send_to); ACT_GO(screen_send_to);
e_action_predef_name_set(_("Screen"), _("Send Mouse To Screen 0"), e_action_predef_name_set(_("Screen"), _("Send Mouse To Screen 0"),
@ -2757,6 +2770,7 @@ e_actions_init(void)
e_action_predef_name_set(_("Screen"), _("Send Mouse To Screen..."), e_action_predef_name_set(_("Screen"), _("Send Mouse To Screen..."),
"screen_send_to", NULL, "screen_send_to", NULL,
"syntax: N, example: 0", 1); "syntax: N, example: 0", 1);
/* screen_send_by */ /* screen_send_by */
ACT_GO(screen_send_by); ACT_GO(screen_send_by);
e_action_predef_name_set(_("Screen"), _("Send Mouse Forward 1 Screen"), e_action_predef_name_set(_("Screen"), _("Send Mouse Forward 1 Screen"),
@ -2954,14 +2968,14 @@ e_action_del(const char *name)
E_Action *act; E_Action *act;
act = eina_hash_find(actions, name); act = eina_hash_find(actions, name);
if (act) if (act) _e_action_free(act);
_e_action_free(act);
} }
EAPI E_Action * EAPI E_Action *
e_action_find(const char *name) e_action_find(const char *name)
{ {
E_Action *act; E_Action *act;
act = eina_hash_find(actions, name); act = eina_hash_find(actions, name);
return act; return act;
} }
@ -2999,12 +3013,11 @@ e_action_predef_name_set(const char *act_grp, const char *act_name, const char *
E_Action_Description *actd = NULL; E_Action_Description *actd = NULL;
Eina_List *l; Eina_List *l;
if (!act_grp || !act_name) return; if ((!act_grp) || (!act_name)) return;
EINA_LIST_FOREACH(action_groups, l, actg) EINA_LIST_FOREACH(action_groups, l, actg)
{ {
if (!strcmp(actg->act_grp, act_grp)) if (!strcmp(actg->act_grp, act_grp)) break;
break;
actg = NULL; actg = NULL;
} }
@ -3018,14 +3031,12 @@ e_action_predef_name_set(const char *act_grp, const char *act_name, const char *
action_groups = eina_list_append(action_groups, actg); action_groups = eina_list_append(action_groups, actg);
action_groups = action_groups =
eina_list_sort(action_groups, eina_list_count(action_groups), eina_list_sort(action_groups, -1, _action_groups_sort_cb);
_action_groups_sort_cb);
} }
EINA_LIST_FOREACH(actg->acts, l, actd) EINA_LIST_FOREACH(actg->acts, l, actd)
{ {
if (!strcmp(actd->act_name, act_name)) if (!strcmp(actd->act_name, act_name)) break;
break;
actd = NULL; actd = NULL;
} }
@ -3052,8 +3063,7 @@ e_action_predef_name_del(const char *act_grp, const char *act_name)
EINA_LIST_FOREACH(action_groups, l, actg) EINA_LIST_FOREACH(action_groups, l, actg)
{ {
if (!strcmp(actg->act_grp, act_grp)) if (!strcmp(actg->act_grp, act_grp)) break;
break;
actg = NULL; actg = NULL;
} }
@ -3134,17 +3144,25 @@ _e_actions_maximize_parse(const char *params)
ret = sscanf(params, "%20s %20s", s1, s2); ret = sscanf(params, "%20s %20s", s1, s2);
if (ret == 2) if (ret == 2)
{ {
if (!strcmp(s2, "horizontal")) max = E_MAXIMIZE_HORIZONTAL; if (!strcmp(s2, "horizontal"))
else if (!strcmp(s2, "vertical")) max = E_MAXIMIZE_VERTICAL; max = E_MAXIMIZE_HORIZONTAL;
else max = E_MAXIMIZE_BOTH; else if (!strcmp(s2, "vertical"))
max = E_MAXIMIZE_VERTICAL;
else
max = E_MAXIMIZE_BOTH;
} }
if (ret >= 1) if (ret >= 1)
{ {
if (!strcmp(s1, "fullscreen")) max |= E_MAXIMIZE_FULLSCREEN; if (!strcmp(s1, "fullscreen"))
else if (!strcmp(s1, "smart")) max |= E_MAXIMIZE_SMART; max |= E_MAXIMIZE_FULLSCREEN;
else if (!strcmp(s1, "expand")) max |= E_MAXIMIZE_EXPAND; else if (!strcmp(s1, "smart"))
else if (!strcmp(s1, "fill")) max |= E_MAXIMIZE_FILL; max |= E_MAXIMIZE_SMART;
else max |= (e_config->maximize_policy & E_MAXIMIZE_TYPE); else if (!strcmp(s1, "expand"))
max |= E_MAXIMIZE_EXPAND;
else if (!strcmp(s1, "fill"))
max |= E_MAXIMIZE_FILL;
else
max |= (e_config->maximize_policy & E_MAXIMIZE_TYPE);
} }
else else
max = e_config->maximize_policy; max = e_config->maximize_policy;
@ -3156,11 +3174,7 @@ _action_groups_sort_cb(const void *d1, const void *d2)
{ {
const E_Action_Group *g1, *g2; const E_Action_Group *g1, *g2;
g1 = d1; if (!(g1 = d1)) return 1;
g2 = d2; if (!(g2 = d2)) return -1;
if (!g1) return 1;
if (!g2) return -1;
return strcmp(g1->act_grp, g2->act_grp); return strcmp(g1->act_grp, g2->act_grp);
} }