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)
e_border_act_move_begin((E_Border *)obj, NULL);
}
ACT_FN_GO_MOUSE(window_move)
{
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)
e_border_act_move_begin((E_Border *)obj, ev);
}
ACT_FN_GO_SIGNAL(window_move)
{
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 ((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
{
if (((E_Border *)obj)->moving)
@ -115,6 +115,7 @@ ACT_FN_GO_SIGNAL(window_move)
}
}
}
ACT_FN_END(window_move)
{
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;
e_border_act_move_end((E_Border *)obj, NULL);
}
ACT_FN_END_MOUSE(window_move)
{
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)
e_border_act_resize_begin((E_Border *)obj, NULL);
}
ACT_FN_GO_MOUSE(window_resize)
{
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)
e_border_act_resize_begin((E_Border *)obj, ev);
}
ACT_FN_GO_SIGNAL(window_resize)
{
if (!obj) obj = E_OBJECT(e_border_focused_get());
@ -179,6 +183,7 @@ ACT_FN_GO_SIGNAL(window_resize)
}
}
}
ACT_FN_END(window_resize)
{
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;
e_border_act_resize_end((E_Border *)obj, NULL);
}
ACT_FN_END_MOUSE(window_resize)
{
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);
}
ACT_FN_GO_MOUSE(window_menu)
{
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);
}
ACT_FN_GO_KEY(window_menu)
{
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)
{
E_Border *bd;
bd = (E_Border *)obj;
if (bd->fullscreen)
e_border_unfullscreen(bd);
@ -494,11 +503,13 @@ ACT_FN_GO(window_fullscreen)
if (!((E_Border *)obj)->lock_user_fullscreen)
{
E_Border *bd;
bd = (E_Border *)obj;
if (params)
{
int v;
char buf[32];
buf[0] = 0;
if (sscanf(params, "%i %20s", &v, buf) == 2)
{
@ -604,11 +615,16 @@ ACT_FN_GO(window_maximized)
{
if (v == 1)
{
if (!strcmp(s1, "fullscreen")) e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN | max);
else if (!strcmp(s1, "smart")) e_border_maximize(bd, E_MAXIMIZE_SMART | 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);
if (!strcmp(s1, "fullscreen"))
e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN | max);
else if (!strcmp(s1, "smart"))
e_border_maximize(bd, E_MAXIMIZE_SMART | 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)
e_border_unmaximize(bd, max);
@ -638,11 +654,16 @@ ACT_FN_GO(window_shaded_toggle)
e_border_unshade(bd, E_DIRECTION_UP);
else
{
if (!strcmp(params, "up")) e_border_unshade(bd, E_DIRECTION_UP);
else if (!strcmp(params, "down")) e_border_unshade(bd, E_DIRECTION_DOWN);
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);
if (!strcmp(params, "up"))
e_border_unshade(bd, E_DIRECTION_UP);
else if (!strcmp(params, "down"))
e_border_unshade(bd, E_DIRECTION_DOWN);
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
@ -651,11 +672,16 @@ ACT_FN_GO(window_shaded_toggle)
e_border_shade(bd, E_DIRECTION_UP);
else
{
if (!strcmp(params, "up")) e_border_shade(bd, E_DIRECTION_UP);
else if (!strcmp(params, "down")) e_border_shade(bd, E_DIRECTION_DOWN);
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);
if (!strcmp(params, "up"))
e_border_shade(bd, E_DIRECTION_UP);
else if (!strcmp(params, "down"))
e_border_shade(bd, E_DIRECTION_DOWN);
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,9 +768,8 @@ ACT_FN_GO(window_pinned_toggle)
E_Border *bd;
bd = (E_Border *)obj;
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);
else
e_border_pinned_set(bd, 1);
@ -770,7 +795,6 @@ ACT_FN_GO(window_move_by)
E_Border *bd;
bd = (E_Border *)obj;
e_border_move(bd, bd->x + dx, bd->y + dy);
if (e_config->focus_policy != E_FOCUS_CLICK)
@ -798,7 +822,6 @@ ACT_FN_GO(window_move_to)
char cx, cy;
bd = (E_Border *)obj;
if (sscanf(params, "%c%i %c%i", &cx, &x, &cy, &y) == 4)
{
/* Nothing, both x and y is updated. */
@ -832,6 +855,9 @@ ACT_FN_GO(window_move_to)
/***************************************************************************/
ACT_FN_GO(window_move_to_center)
{
E_Border *bd;
int x, y;
if (!obj) obj = E_OBJECT(e_border_focused_get());
if (!obj) return;
if (obj->type != E_BORDER_TYPE)
@ -840,19 +866,17 @@ ACT_FN_GO(window_move_to_center)
if (!obj) return;
}
E_Border *bd;
int x, y;
bd = (E_Border *)obj;
e_border_center_pos_get(bd, &x, &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)
ecore_x_pointer_warp(bd->zone->container->win,
x + (bd->w / 2),
y + (bd->h / 2));
if (e_config->focus_policy != E_FOCUS_CLICK)
ecore_x_pointer_warp(bd->zone->container->win,
x + (bd->w / 2),
y + (bd->h / 2));
}
}
@ -874,6 +898,7 @@ ACT_FN_GO(window_resize_by)
if (sscanf(params, "%i %i", &dw, &dh) == 2)
{
E_Border *bd;
bd = (E_Border *)obj;
dw += bd->w;
@ -963,7 +988,6 @@ ACT_FN_GO(window_push)
if ((x != bd->x) || (y != bd->y))
{
e_border_move(bd, x, y);
if (e_config->focus_policy != E_FOCUS_CLICK)
ecore_x_pointer_warp(bd->zone->container->win,
bd->x + (bd->w / 2), bd->y + (bd->h / 2));
@ -1072,8 +1096,7 @@ ACT_FN_GO(window_desk_move_to)
E_Desk *desk;
desk = e_desk_at_xy_get(bd->zone, x, y);
if (desk)
e_border_desk_set(bd, desk);
if (desk) e_border_desk_set(bd, desk);
}
}
@ -1131,14 +1154,14 @@ ACT_FN_GO(desk_flip_to)
}
/***************************************************************************/
#define ACT_FLIP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0))
#define ACT_FLIP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0))
#define ACT_FLIP_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || (((zone)->desk_x_current + 1) < (zone)->desk_x_count))
#define ACT_FLIP_UP(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || ((zone)->desk_y_current > 0))
#define ACT_FLIP_DOWN(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || (((zone)->desk_y_current + 1) < (zone)->desk_y_count))
#define ACT_FLIP_UP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || (((zone)->desk_x_current > 0) && ((zone)->desk_y_current > 0)))
#define ACT_FLIP_UP_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || ((((zone)->desk_x_current + 1) < (zone)->desk_x_count) && ((zone)->desk_y_current > 0)))
#define ACT_FLIP_DOWN_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || ((((zone)->desk_x_current + 1) < (zone)->desk_x_count) && (((zone)->desk_y_current + 1) < (zone)->desk_y_count)))
#define ACT_FLIP_DOWN_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || (((zone)->desk_x_current > 0) && (((zone)->desk_y_current + 1) < (zone)->desk_y_count)))
#define ACT_FLIP_UP(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || ((zone)->desk_y_current > 0))
#define ACT_FLIP_DOWN(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || (((zone)->desk_y_current + 1) < (zone)->desk_y_count))
#define ACT_FLIP_UP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || (((zone)->desk_x_current > 0) && ((zone)->desk_y_current > 0)))
#define ACT_FLIP_UP_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || ((((zone)->desk_x_current + 1) < (zone)->desk_x_count) && ((zone)->desk_y_current > 0)))
#define ACT_FLIP_DOWN_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || ((((zone)->desk_x_current + 1) < (zone)->desk_x_count) && (((zone)->desk_y_current + 1) < (zone)->desk_y_count)))
#define ACT_FLIP_DOWN_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1) && ((zone)->desk_y_count > 1)) || (((zone)->desk_x_current > 0) && (((zone)->desk_y_current + 1) < (zone)->desk_y_count)))
ACT_FN_GO_EDGE(desk_flip_in_direction)
{
@ -1281,7 +1304,6 @@ ACT_FN_GO(desk_linear_flip_to)
}
#define DESK_ACTION_ALL(zone, act) \
E_Zone *zone; \
Eina_List *lm, *lc, *lz; \
@ -1300,61 +1322,59 @@ ACT_FN_GO(desk_linear_flip_to)
/***************************************************************************/
ACT_FN_GO(desk_flip_by_all)
{
if (params)
{
int dx = 0, dy = 0;
if (params)
{
int dx = 0, dy = 0;
if (sscanf(params, "%i %i", &dx, &dy) == 2)
{
DESK_ACTION_ALL(zone, e_zone_desk_flip_by(zone, dx, dy));
}
}
if (sscanf(params, "%i %i", &dx, &dy) == 2)
{
DESK_ACTION_ALL(zone, e_zone_desk_flip_by(zone, dx, dy));
}
}
}
/***************************************************************************/
ACT_FN_GO(desk_flip_to_all)
{
if (params)
{
int dx = 0, dy = 0;
if (params)
{
int dx = 0, dy = 0;
if (sscanf(params, "%i %i", &dx, &dy) == 2)
{
DESK_ACTION_ALL(zone, e_zone_desk_flip_to(zone, dx, dy));
}
}
if (sscanf(params, "%i %i", &dx, &dy) == 2)
{
DESK_ACTION_ALL(zone, e_zone_desk_flip_to(zone, dx, dy));
}
}
}
/***************************************************************************/
ACT_FN_GO(desk_linear_flip_by_all)
{
if (params)
{
int dx = 0;
if (params)
{
int dx = 0;
if (sscanf(params, "%i", &dx) == 1)
{
DESK_ACTION_ALL(zone, e_zone_desk_linear_flip_by(zone, dx));
}
}
if (sscanf(params, "%i", &dx) == 1)
{
DESK_ACTION_ALL(zone, e_zone_desk_linear_flip_by(zone, dx));
}
}
}
/***************************************************************************/
ACT_FN_GO(desk_linear_flip_to_all)
{
if (params)
{
int dx = 0;
if (params)
{
int dx = 0;
if (sscanf(params, "%i", &dx) == 1)
{
DESK_ACTION_ALL(zone, e_zone_desk_linear_flip_to(zone, dx));
}
}
if (sscanf(params, "%i", &dx) == 1)
{
DESK_ACTION_ALL(zone, e_zone_desk_linear_flip_to(zone, dx));
}
}
}
/***************************************************************************/
ACT_FN_GO(screen_send_to)
{
@ -1433,33 +1453,33 @@ ACT_FN_GO(screen_send_by)
}
#define ZONE_DESK_ACTION(con_num, zone_num, zone, act) \
E_Zone *zone; \
if ((con_num < 0) || (zone_num < 0)) { \
Eina_List *l, *ll, *lll; \
E_Container *con; \
E_Manager *man; \
if ((con_num >= 0) && (zone_num < 0)) /* con=1 zone=all */ { \
con = e_util_container_number_get(con_num); \
EINA_LIST_FOREACH(con->zones, l, zone) { \
act; \
} } \
else if ((con_num < 0) && (zone_num >= 0)) /* con=all zone=1 */ { \
EINA_LIST_FOREACH(e_manager_list(), l, man) { \
EINA_LIST_FOREACH(man->containers, ll, con) { \
zone = e_container_zone_number_get(con, zone_num); \
if (zone) \
act; \
} } } \
else if ((con_num < 0) && (zone_num < 0)) /* con=all zone=all */ { \
EINA_LIST_FOREACH(e_manager_list(), l, man) { \
EINA_LIST_FOREACH(man->containers, ll, con) { \
EINA_LIST_FOREACH(con->zones, lll, zone) { \
act; \
} } } } } \
else { \
zone = e_util_container_zone_number_get(con_num, zone_num); \
if (zone) act; \
}
E_Zone *zone; \
if ((con_num < 0) || (zone_num < 0)) { \
Eina_List *l, *ll, *lll; \
E_Container *con; \
E_Manager *man; \
if ((con_num >= 0) && (zone_num < 0)) /* con=1 zone=all */ { \
con = e_util_container_number_get(con_num); \
EINA_LIST_FOREACH(con->zones, l, zone) { \
act; \
} } \
else if ((con_num < 0) && (zone_num >= 0)) /* con=all zone=1 */ { \
EINA_LIST_FOREACH(e_manager_list(), l, man) { \
EINA_LIST_FOREACH(man->containers, ll, con) { \
zone = e_container_zone_number_get(con, zone_num); \
if (zone) \
act; \
} } } \
else if ((con_num < 0) && (zone_num < 0)) /* con=all zone=all */ { \
EINA_LIST_FOREACH(e_manager_list(), l, man) { \
EINA_LIST_FOREACH(man->containers, ll, con) { \
EINA_LIST_FOREACH(con->zones, lll, zone) { \
act; \
} } } } } \
else { \
zone = e_util_container_zone_number_get(con_num, zone_num); \
if (zone) act; \
}
/***************************************************************************/
#if 0
@ -1471,10 +1491,8 @@ ACT_FN_GO(zone_desk_flip_by)
int dx = 0, dy = 0;
if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4)
{
ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_flip_by(zone, dx, dy));
}
ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_flip_by(zone, dx, dy));
}
}
#endif
@ -1489,10 +1507,8 @@ ACT_FN_GO(zone_desk_flip_to)
int dx = 0, dy = 0;
if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4)
{
ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_flip_to(zone, dx, dy));
}
ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_flip_to(zone, dx, dy));
}
}
#endif
@ -1507,10 +1523,8 @@ ACT_FN_GO(zone_desk_linear_flip_by)
int dx = 0;
if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3)
{
ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_linear_flip_by(zone, dx));
}
ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_linear_flip_by(zone, dx));
}
}
#endif
@ -1525,10 +1539,8 @@ ACT_FN_GO(zone_desk_linear_flip_to)
int dx = 0;
if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3)
{
ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_linear_flip_to(zone, dx));
}
ZONE_DESK_ACTION(con_num, zone_num, zone,
e_zone_desk_linear_flip_to(zone, dx));
}
}
#endif
@ -1539,17 +1551,25 @@ _e_actions_cb_menu_end(void *data, E_Menu *m)
{
e_object_del(E_OBJECT(m));
}
static E_Menu *
_e_actions_menu_find(const char *name)
{
if (!strcmp(name, "main")) return e_int_menus_main_new();
else if (!strcmp(name, "favorites")) return e_int_menus_favorite_apps_new();
else if (!strcmp(name, "all")) 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();
if (!strcmp(name, "main"))
return e_int_menus_main_new();
else if (!strcmp(name, "favorites"))
return e_int_menus_favorite_apps_new();
else if (!strcmp(name, "all"))
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;
}
ACT_FN_GO(menu_show)
{
E_Zone *zone;
@ -1579,6 +1599,7 @@ ACT_FN_GO(menu_show)
}
}
}
ACT_FN_GO_MOUSE(menu_show)
{
E_Zone *zone;
@ -1610,6 +1631,7 @@ ACT_FN_GO_MOUSE(menu_show)
}
}
}
ACT_FN_GO_KEY(menu_show)
{
E_Zone *zone;
@ -1648,9 +1670,7 @@ ACT_FN_GO(exec)
if (zone)
{
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);
if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
if (zone)
{
e_desk_deskshow(zone);
}
if (zone) e_desk_deskshow(zone);
}
ACT_FN_GO(cleanup_windows)
@ -1707,8 +1724,7 @@ ACT_FN_GO(cleanup_windows)
zone = _e_actions_zone_get(obj);
if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
if (zone)
e_place_zone_region_smart_cleanup(zone);
if (zone) e_place_zone_region_smart_cleanup(zone);
}
/***************************************************************************/
@ -1763,8 +1779,7 @@ ACT_FN_GO(exit)
e_dialog_text_set(exit_dialog,
_("You requested to exit Enlightenment.<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_button_add(exit_dialog, _("Yes"), NULL,
_e_actions_cb_exit_dialog_ok, NULL);
@ -1861,8 +1876,7 @@ ACT_FN_GO(logout)
e_dialog_text_set(logout_dialog,
_("You are about to log out.<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_button_add(logout_dialog, _("Yes"), NULL,
_e_actions_cb_logout_dialog_ok, NULL);
@ -1925,8 +1939,7 @@ ACT_FN_GO(halt)
e_dialog_text_set(halt_dialog,
_("You requested to turn off your Computer.<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_button_add(halt_dialog, _("Yes"), NULL,
_e_actions_cb_halt_dialog_ok, NULL);
@ -1989,8 +2002,7 @@ ACT_FN_GO(reboot)
e_dialog_text_set(reboot_dialog,
_("You requested to reboot your Computer.<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_button_add(reboot_dialog, _("Yes"), NULL,
_e_actions_cb_reboot_dialog_ok, NULL);
@ -2053,8 +2065,7 @@ ACT_FN_GO(suspend)
e_dialog_text_set(suspend_dialog,
_("You requested to suspend your Computer.<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_button_add(suspend_dialog, _("Yes"), NULL,
_e_actions_cb_suspend_dialog_ok, NULL);
@ -2117,8 +2128,7 @@ ACT_FN_GO(hibernate)
e_dialog_text_set(hibernate_dialog,
_("You requested to hibernate your Computer.<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_button_add(hibernate_dialog, _("Yes"), NULL,
_e_actions_cb_hibernate_dialog_ok, NULL);
@ -2138,6 +2148,7 @@ ACT_FN_GO(pointer_resize_push)
if (obj->type == E_BORDER_TYPE)
{
E_Border *bd;
bd = (E_Border *)obj;
if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) ||
(bd->fullscreen) ||
@ -2159,6 +2170,7 @@ ACT_FN_GO(pointer_resize_pop)
if (obj->type == E_BORDER_TYPE)
{
E_Border *bd;
bd = (E_Border *)obj;
if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) ||
(bd->fullscreen) ||
@ -2211,6 +2223,7 @@ if ((!params) || (params && (fnmatch(params, es->name, 0) == 0))) \
e_shelf_toggle(es, 1); \
e_shelf_toggle(es, 0); \
}
ACT_FN_GO_EDGE(shelf_show)
{
Eina_List *l;
@ -2263,21 +2276,20 @@ ACT_FN_GO_EDGE(shelf_show)
}
}
#undef ACT_SHELF_SHOW
/***************************************************************************/
typedef struct _Delayed_Action Delayed_Action;
/***************************************************************************/
typedef struct _Delayed_Action Delayed_Action;
struct _Delayed_Action
{
int mouse;
int button;
const char *keyname;
E_Object *obj;
int mouse, button;
const char *keyname;
E_Object *obj;
Ecore_Timer *timer;
struct {
const char *action;
const char *params;
} def, delayed;
struct
{
const char *action, *params;
} def, delayed;
};
static Eina_List *_delayed_actions = NULL;
@ -2353,9 +2365,8 @@ static void
_delayed_action_list_parse(Delayed_Action *da, const char *params)
{
double delay = 2.0;
const char *p,
*a1start = NULL, *a1stop = NULL,
*a2start = NULL, *a2stop = NULL;
const char *p, *a1start = NULL, *a1stop = NULL;
const char *a2start = NULL, *a2stop = NULL;
// FORMAT: "[0.0 default_action param1 param2] [x.x action2 param1 param2]"
p = params;
@ -2476,14 +2487,17 @@ ACT_FN_GO_KEY(delayed_action)
{
_delayed_action_key_add(obj, params, ev);
}
ACT_FN_GO_MOUSE(delayed_action)
{
_delayed_action_mouse_add(obj, params, ev);
}
ACT_FN_END_KEY(delayed_action)
{
_delayed_action_key_del(obj, params, ev);
}
ACT_FN_END_MOUSE(delayed_action)
{
_delayed_action_mouse_del(obj, params, ev);
@ -2747,7 +2761,6 @@ e_actions_init(void)
"desk_linear_flip_to_all", NULL,
"syntax: N, example: 1", 1);
/* screen_send_to */
ACT_GO(screen_send_to);
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..."),
"screen_send_to", NULL,
"syntax: N, example: 0", 1);
/* screen_send_by */
ACT_GO(screen_send_by);
e_action_predef_name_set(_("Screen"), _("Send Mouse Forward 1 Screen"),
@ -2954,14 +2968,14 @@ e_action_del(const char *name)
E_Action *act;
act = eina_hash_find(actions, name);
if (act)
_e_action_free(act);
if (act) _e_action_free(act);
}
EAPI E_Action *
e_action_find(const char *name)
{
E_Action *act;
act = eina_hash_find(actions, name);
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;
Eina_List *l;
if (!act_grp || !act_name) return;
if ((!act_grp) || (!act_name)) return;
EINA_LIST_FOREACH(action_groups, l, actg)
{
if (!strcmp(actg->act_grp, act_grp))
break;
if (!strcmp(actg->act_grp, act_grp)) break;
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_sort(action_groups, eina_list_count(action_groups),
_action_groups_sort_cb);
eina_list_sort(action_groups, -1, _action_groups_sort_cb);
}
EINA_LIST_FOREACH(actg->acts, l, actd)
{
if (!strcmp(actd->act_name, act_name))
break;
if (!strcmp(actd->act_name, act_name)) break;
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)
{
if (!strcmp(actg->act_grp, act_grp))
break;
if (!strcmp(actg->act_grp, act_grp)) break;
actg = NULL;
}
@ -3134,17 +3144,25 @@ _e_actions_maximize_parse(const char *params)
ret = sscanf(params, "%20s %20s", s1, s2);
if (ret == 2)
{
if (!strcmp(s2, "horizontal")) max = E_MAXIMIZE_HORIZONTAL;
else if (!strcmp(s2, "vertical")) max = E_MAXIMIZE_VERTICAL;
else max = E_MAXIMIZE_BOTH;
if (!strcmp(s2, "horizontal"))
max = E_MAXIMIZE_HORIZONTAL;
else if (!strcmp(s2, "vertical"))
max = E_MAXIMIZE_VERTICAL;
else
max = E_MAXIMIZE_BOTH;
}
if (ret >= 1)
{
if (!strcmp(s1, "fullscreen")) max |= E_MAXIMIZE_FULLSCREEN;
else if (!strcmp(s1, "smart")) max |= E_MAXIMIZE_SMART;
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);
if (!strcmp(s1, "fullscreen"))
max |= E_MAXIMIZE_FULLSCREEN;
else if (!strcmp(s1, "smart"))
max |= E_MAXIMIZE_SMART;
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
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;
g1 = d1;
g2 = d2;
if (!g1) return 1;
if (!g2) return -1;
if (!(g1 = d1)) return 1;
if (!(g2 = d2)) return -1;
return strcmp(g1->act_grp, g2->act_grp);
}