4 # define MAX(x, y) (((x) > (y)) ? (x) : (y))
10 act = e_action_add(#name); \
11 if (act) act->func.go = _e_actions_act_##name##_go; \
13 #define ACT_FN_GO(act, use) \
14 static void _e_actions_act_##act##_go(E_Object *obj __UNUSED__, const char *params use)
16 #define ACT_GO_MOUSE(name) \
18 act = e_action_add(#name); \
19 if (act) act->func.go_mouse = _e_actions_act_##name##_go_mouse; \
21 #define ACT_FN_GO_MOUSE(act, use) \
22 static void _e_actions_act_##act##_go_mouse(E_Object *obj __UNUSED__, const char *params use, Ecore_Event_Mouse_Button *ev __UNUSED__)
24 #define ACT_GO_WHEEL(name) \
26 act = e_action_add(#name); \
27 if (act) act->func.go_wheel = _e_actions_act_##name##_go_wheel; \
29 #define ACT_FN_GO_WHEEL(act, use) \
30 static void _e_actions_act_##act##_go_wheel(E_Object *obj __UNUSED__, const char *params use, Ecore_Event_Mouse_Wheel *ev __UNUSED__)
32 #define ACT_GO_EDGE(name) \
34 act = e_action_add(#name); \
35 if (act) act->func.go_edge = _e_actions_act_##name##_go_edge; \
37 #define ACT_FN_GO_EDGE(act, use) \
38 static void _e_actions_act_##act##_go_edge(E_Object *obj __UNUSED__, const char *params use, E_Event_Zone_Edge *ev __UNUSED__)
40 #define ACT_GO_SIGNAL(name) \
42 act = e_action_add(#name); \
43 if (act) act->func.go_signal = _e_actions_act_##name##_go_signal; \
45 #define ACT_FN_GO_SIGNAL(act, use) \
46 static void _e_actions_act_##act##_go_signal(E_Object *obj __UNUSED__, const char *params use, const char *sig, const char *src)
48 #define ACT_GO_KEY(name) \
50 act = e_action_add(#name); \
51 if (act) act->func.go_key = _e_actions_act_##name##_go_key; \
53 #define ACT_FN_GO_KEY(act, use) \
54 static void _e_actions_act_##act##_go_key(E_Object *obj __UNUSED__, const char *params use, Ecore_Event_Key *ev __UNUSED__)
56 #define ACT_END(name) \
58 act = e_action_add(#name); \
59 if (act) act->func.end = _e_actions_act_##name##_end; \
61 #define ACT_FN_END(act, use) \
62 static void _e_actions_act_##act##_end(E_Object *obj __UNUSED__, const char *params use)
64 #define ACT_END_MOUSE(name) \
66 act = e_action_add(#name); \
67 if (act) act->func.end_mouse = _e_actions_act_##name##_end_mouse; \
69 #define ACT_FN_END_MOUSE(act, use) \
70 static void _e_actions_act_##act##_end_mouse(E_Object *obj __UNUSED__, const char *params use, Ecore_Event_Mouse_Button *ev __UNUSED__)
72 #define ACT_END_KEY(name) \
74 act = e_action_add(#name); \
75 if (act) act->func.end_key = _e_actions_act_##name##_end_key; \
77 #define ACT_FN_END_KEY(act, use) \
78 static void _e_actions_act_##act##_end_key(E_Object *obj __UNUSED__, const char *params use, Ecore_Event_Key *ev __UNUSED__)
80 #define ACT_GO_ACPI(name) \
82 act = e_action_add(#name); \
83 if (act) act->func.go_acpi = _e_actions_act_##name##_go_acpi; \
85 #define ACT_FN_GO_ACPI(act, use) \
86 static void _e_actions_act_##act##_go_acpi(E_Object *obj __UNUSED__, const char *params use, E_Event_Acpi *ev __UNUSED__)
88 /* local subsystem functions */
89 static void _e_action_free(E_Action *act);
90 static E_Maximize _e_actions_maximize_parse(const char *maximize);
91 static int _action_groups_sort_cb(const void *d1, const void *d2);
93 /* to save writing this in N places - the sections are defined here */
94 /***************************************************************************/
95 ACT_FN_GO(window_move, __UNUSED__)
97 if (!obj) obj = E_OBJECT(e_border_focused_get());
99 if (obj->type != E_BORDER_TYPE) return;
100 if (!((E_Border *)obj)->lock_user_location)
101 e_border_act_move_begin((E_Border *)obj, NULL);
104 ACT_FN_GO_MOUSE(window_move, __UNUSED__)
106 if (!obj) obj = E_OBJECT(e_border_focused_get());
108 if (obj->type != E_BORDER_TYPE) return;
109 e_border_act_move_begin((E_Border *)obj, ev);
112 ACT_FN_GO_SIGNAL(window_move, )
114 if (!obj) obj = E_OBJECT(e_border_focused_get());
116 if (obj->type != E_BORDER_TYPE) return;
117 if (!((E_Border *)obj)->lock_user_location)
119 if ((params) && (!strcmp(params, "end")))
120 e_border_signal_move_end((E_Border *)obj, sig, src);
123 if (((E_Border *)obj)->moving)
124 e_border_signal_move_end((E_Border *)obj, sig, src);
126 e_border_signal_move_begin((E_Border *)obj, sig, src);
131 ACT_FN_END(window_move, __UNUSED__)
133 if (!obj) obj = E_OBJECT(e_border_focused_get());
135 if (obj->type != E_BORDER_TYPE) return;
136 e_border_act_move_end((E_Border *)obj, NULL);
139 ACT_FN_END_MOUSE(window_move, __UNUSED__)
141 if (!obj) obj = E_OBJECT(e_border_focused_get());
143 if (obj->type != E_BORDER_TYPE) return;
144 e_border_act_move_end((E_Border *)obj, ev);
147 ACT_FN_GO_KEY(window_move, __UNUSED__)
149 if (!obj) obj = E_OBJECT(e_border_focused_get());
151 if (obj->type != E_BORDER_TYPE)
153 obj = E_OBJECT(e_border_focused_get());
156 if (!((E_Border *)obj)->lock_user_location)
157 e_border_act_move_keyboard((E_Border *)obj);
160 /***************************************************************************/
161 ACT_FN_GO(window_resize, __UNUSED__)
163 if (!obj) obj = E_OBJECT(e_border_focused_get());
165 if (obj->type != E_BORDER_TYPE) return;
166 if (!((E_Border *)obj)->lock_user_size)
167 e_border_act_resize_begin((E_Border *)obj, NULL);
170 ACT_FN_GO_MOUSE(window_resize, __UNUSED__)
172 if (!obj) obj = E_OBJECT(e_border_focused_get());
174 if (obj->type != E_BORDER_TYPE) return;
175 if (!((E_Border *)obj)->lock_user_size)
176 e_border_act_resize_begin((E_Border *)obj, ev);
179 ACT_FN_GO_SIGNAL(window_resize, )
181 if (!obj) obj = E_OBJECT(e_border_focused_get());
183 if (obj->type != E_BORDER_TYPE) return;
184 if (!((E_Border *)obj)->lock_user_size)
186 if ((params) && (!strcmp(params, "end")))
187 e_border_signal_resize_end((E_Border *)obj, params, sig, src);
190 if (!params) params = "";
191 if (e_border_resizing_get((E_Border *)obj))
192 e_border_signal_resize_end((E_Border *)obj, params, sig, src);
194 e_border_signal_resize_begin((E_Border *)obj, params, sig, src);
199 ACT_FN_END(window_resize, __UNUSED__)
201 if (!obj) obj = E_OBJECT(e_border_focused_get());
203 if (obj->type != E_BORDER_TYPE) return;
204 e_border_act_resize_end((E_Border *)obj, NULL);
207 ACT_FN_END_MOUSE(window_resize, __UNUSED__)
209 if (!obj) obj = E_OBJECT(e_border_focused_get());
211 if (obj->type != E_BORDER_TYPE) return;
212 e_border_act_resize_end((E_Border *)obj, ev);
215 ACT_FN_GO_KEY(window_resize, __UNUSED__)
217 if (!obj) obj = E_OBJECT(e_border_focused_get());
219 if (obj->type != E_BORDER_TYPE)
221 obj = E_OBJECT(e_border_focused_get());
224 if (!((E_Border *)obj)->lock_user_size)
225 e_border_act_resize_keyboard((E_Border *)obj);
228 /***************************************************************************/
229 ACT_FN_GO(window_menu, __UNUSED__)
231 if (!obj) obj = E_OBJECT(e_border_focused_get());
233 if (obj->type != E_BORDER_TYPE)
235 obj = E_OBJECT(e_border_focused_get());
238 e_border_act_menu_begin((E_Border *)obj, NULL, 0);
241 ACT_FN_GO_MOUSE(window_menu, __UNUSED__)
243 if (!obj) obj = E_OBJECT(e_border_focused_get());
245 if (obj->type != E_BORDER_TYPE)
247 obj = E_OBJECT(e_border_focused_get());
250 e_border_act_menu_begin((E_Border *)obj, ev, 0);
253 ACT_FN_GO_KEY(window_menu, __UNUSED__)
255 if (!obj) obj = E_OBJECT(e_border_focused_get());
257 if (obj->type != E_BORDER_TYPE)
259 obj = E_OBJECT(e_border_focused_get());
262 e_border_act_menu_begin((E_Border *)obj, NULL, 1);
265 /***************************************************************************/
266 ACT_FN_GO(window_raise, __UNUSED__)
268 if (!obj) obj = E_OBJECT(e_border_focused_get());
270 if (obj->type != E_BORDER_TYPE)
272 obj = E_OBJECT(e_border_focused_get());
275 if (!((E_Border *)obj)->lock_user_stacking)
276 e_border_raise((E_Border *)obj);
279 /***************************************************************************/
280 ACT_FN_GO(window_lower, __UNUSED__)
282 if (!obj) obj = E_OBJECT(e_border_focused_get());
284 if (obj->type != E_BORDER_TYPE)
286 obj = E_OBJECT(e_border_focused_get());
289 if (!((E_Border *)obj)->lock_user_stacking)
290 e_border_lower((E_Border *)obj);
293 /***************************************************************************/
294 ACT_FN_GO(window_close, __UNUSED__)
296 if (!obj) obj = E_OBJECT(e_border_focused_get());
298 if (obj->type != E_BORDER_TYPE)
300 obj = E_OBJECT(e_border_focused_get());
303 if (!((E_Border *)obj)->lock_close)
304 e_border_act_close_begin((E_Border *)obj);
307 /***************************************************************************/
308 static E_Dialog *kill_dialog = NULL;
311 _e_actions_cb_kill_dialog_ok(void *data, E_Dialog *dia)
318 e_object_del(E_OBJECT(kill_dialog));
321 if ((!((E_Border *)obj)->lock_close) && (!((E_Border *)obj)->internal))
322 e_border_act_kill_begin((E_Border *)obj);
326 _e_actions_cb_kill_dialog_cancel(void *data __UNUSED__, E_Dialog *dia __UNUSED__)
328 e_object_del(E_OBJECT(kill_dialog));
333 _e_actions_cb_kill_dialog_delete(E_Win *win)
338 _e_actions_cb_kill_dialog_cancel(NULL, dia);
341 ACT_FN_GO(window_kill, __UNUSED__)
344 char dialog_text[1024];
346 if (!obj) obj = E_OBJECT(e_border_focused_get());
348 if (obj->type != E_BORDER_TYPE)
350 obj = E_OBJECT(e_border_focused_get());
353 bd = (E_Border *)obj;
354 if ((bd->lock_close) || (bd->internal)) return;
356 if (kill_dialog) e_object_del(E_OBJECT(kill_dialog));
358 if (e_config->cnfmdlg_disabled)
360 _e_actions_cb_kill_dialog_ok(obj, NULL);
364 snprintf(dialog_text, sizeof(dialog_text),
365 _("You are about to kill %s.<br><br>"
366 "Please keep in mind that all data from this window<br>"
367 "which has not yet been saved will be lost!<br><br>"
368 "Are you sure you want to kill this window?"),
369 bd->client.icccm.name);
371 kill_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()),
372 "E", "_kill_dialog");
373 if (!kill_dialog) return;
374 e_win_delete_callback_set(kill_dialog->win,
375 _e_actions_cb_kill_dialog_delete);
376 e_dialog_title_set(kill_dialog,
377 _("Are you sure you want to kill this window?"));
378 e_dialog_text_set(kill_dialog, _(dialog_text));
379 e_dialog_icon_set(kill_dialog, "application-exit", 64);
380 e_dialog_button_add(kill_dialog, _("Yes"), NULL,
381 _e_actions_cb_kill_dialog_ok, obj);
382 e_dialog_button_add(kill_dialog, _("No"), NULL,
383 _e_actions_cb_kill_dialog_cancel, NULL);
384 e_dialog_button_focus_num(kill_dialog, 1);
385 e_win_centered_set(kill_dialog->win, 1);
386 e_dialog_show(kill_dialog);
389 /***************************************************************************/
390 ACT_FN_GO(window_sticky_toggle, __UNUSED__)
392 if (!obj) obj = E_OBJECT(e_border_focused_get());
394 if (obj->type != E_BORDER_TYPE)
396 obj = E_OBJECT(e_border_focused_get());
399 if (!((E_Border *)obj)->lock_user_sticky)
403 bd = (E_Border *)obj;
404 if (bd->sticky) e_border_unstick(bd);
405 else e_border_stick(bd);
409 /***************************************************************************/
410 ACT_FN_GO(window_sticky, )
412 if (!obj) obj = E_OBJECT(e_border_focused_get());
414 if (obj->type != E_BORDER_TYPE)
416 obj = E_OBJECT(e_border_focused_get());
419 if (!((E_Border *)obj)->lock_user_sticky)
423 bd = (E_Border *)obj;
426 if (atoi(params) == 1)
428 else if (atoi(params) == 0)
429 e_border_unstick(bd);
434 /***************************************************************************/
435 ACT_FN_GO(window_iconic_toggle, __UNUSED__)
439 if (!obj) obj = E_OBJECT(e_border_focused_get());
441 if (obj->type != E_BORDER_TYPE)
443 obj = E_OBJECT(e_border_focused_get());
446 bd = (E_Border *)obj;
448 if ((!bd->lock_user_iconify) && (!bd->fullscreen) &&
449 ((bd->client.netwm.type == ECORE_X_WINDOW_TYPE_NORMAL) ||
450 (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_UNKNOWN)))
452 if (bd->iconic) e_border_uniconify(bd);
453 else e_border_iconify(bd);
457 /***************************************************************************/
458 ACT_FN_GO(window_iconic, )
460 if (!obj) obj = E_OBJECT(e_border_focused_get());
462 if (obj->type != E_BORDER_TYPE)
464 obj = E_OBJECT(e_border_focused_get());
467 if (!((E_Border *)obj)->lock_user_iconify)
471 bd = (E_Border *)obj;
474 if (atoi(params) == 1)
475 e_border_iconify(bd);
476 else if (atoi(params) == 0)
477 e_border_uniconify(bd);
482 /***************************************************************************/
483 ACT_FN_GO(window_fullscreen_toggle, )
485 if (!obj) obj = E_OBJECT(e_border_focused_get());
487 if (obj->type != E_BORDER_TYPE)
489 obj = E_OBJECT(e_border_focused_get());
492 if (!((E_Border *)obj)->lock_user_fullscreen)
496 bd = (E_Border *)obj;
498 e_border_unfullscreen(bd);
499 else if (!params || *params == '\0')
500 e_border_fullscreen(bd, e_config->fullscreen_policy);
501 else if (! strcmp(params, "resize"))
502 e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
503 else if (! strcmp(params, "zoom"))
504 e_border_fullscreen(bd, E_FULLSCREEN_ZOOM);
508 /***************************************************************************/
509 ACT_FN_GO(window_fullscreen, )
511 if (!obj) obj = E_OBJECT(e_border_focused_get());
513 if (obj->type != E_BORDER_TYPE)
515 obj = E_OBJECT(e_border_focused_get());
518 if (!((E_Border *)obj)->lock_user_fullscreen)
522 bd = (E_Border *)obj;
529 if (sscanf(params, "%i %20s", &v, buf) == 2)
534 e_border_fullscreen(bd, e_config->fullscreen_policy);
535 else if (!strcmp(buf, "resize"))
536 e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
537 else if (!strcmp(buf, "zoom"))
538 e_border_fullscreen(bd, E_FULLSCREEN_ZOOM);
541 e_border_unfullscreen(bd);
547 /***************************************************************************/
548 ACT_FN_GO(window_maximized_toggle, )
552 if (!obj) obj = E_OBJECT(e_border_focused_get());
554 if (obj->type != E_BORDER_TYPE)
556 obj = E_OBJECT(e_border_focused_get());
559 bd = (E_Border *)obj;
561 if ((!bd->lock_user_maximize) && (!bd->fullscreen) &&
562 ((bd->client.netwm.type == ECORE_X_WINDOW_TYPE_NORMAL) ||
563 (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_UNKNOWN)))
565 if ((bd->maximized & E_MAXIMIZE_TYPE) != E_MAXIMIZE_NONE)
568 e_border_unmaximize(bd, E_MAXIMIZE_BOTH);
573 max = _e_actions_maximize_parse(params);
574 max &= E_MAXIMIZE_DIRECTION;
575 if (max == E_MAXIMIZE_VERTICAL)
577 if (bd->maximized & E_MAXIMIZE_VERTICAL)
578 e_border_unmaximize(bd, E_MAXIMIZE_VERTICAL);
582 else if (max == E_MAXIMIZE_HORIZONTAL)
584 if (bd->maximized & E_MAXIMIZE_HORIZONTAL)
585 e_border_unmaximize(bd, E_MAXIMIZE_HORIZONTAL);
590 e_border_unmaximize(bd, E_MAXIMIZE_BOTH);
596 e_border_maximize(bd, _e_actions_maximize_parse(params));
600 /***************************************************************************/
601 ACT_FN_GO(window_maximized, )
603 if (!obj) obj = E_OBJECT(e_border_focused_get());
605 if (obj->type != E_BORDER_TYPE)
607 obj = E_OBJECT(e_border_focused_get());
610 if (!((E_Border *)obj)->lock_user_maximize)
614 bd = (E_Border *)obj;
621 max = (e_config->maximize_policy & E_MAXIMIZE_DIRECTION);
622 ret = sscanf(params, "%i %20s %20s", &v, s1, s2);
625 if (!strcmp(s2, "horizontal"))
626 max = E_MAXIMIZE_HORIZONTAL;
627 else if (!strcmp(s2, "vertical"))
628 max = E_MAXIMIZE_VERTICAL;
630 max = E_MAXIMIZE_BOTH;
636 if (!strcmp(s1, "fullscreen"))
637 e_border_maximize(bd, E_MAXIMIZE_FULLSCREEN | max);
638 else if (!strcmp(s1, "smart"))
639 e_border_maximize(bd, E_MAXIMIZE_SMART | max);
640 else if (!strcmp(s1, "expand"))
641 e_border_maximize(bd, E_MAXIMIZE_EXPAND | max);
642 else if (!strcmp(s1, "fill"))
643 e_border_maximize(bd, E_MAXIMIZE_FILL | max);
645 e_border_maximize(bd, (e_config->maximize_policy & E_MAXIMIZE_TYPE) | max);
648 e_border_unmaximize(bd, max);
654 /***************************************************************************/
655 ACT_FN_GO(window_shaded_toggle, )
657 if (!obj) obj = E_OBJECT(e_border_focused_get());
659 if (obj->type != E_BORDER_TYPE)
661 obj = E_OBJECT(e_border_focused_get());
664 if (!((E_Border *)obj)->lock_user_shade)
668 bd = (E_Border *)obj;
672 e_border_unshade(bd, E_DIRECTION_UP);
675 if (!strcmp(params, "up"))
676 e_border_unshade(bd, E_DIRECTION_UP);
677 else if (!strcmp(params, "down"))
678 e_border_unshade(bd, E_DIRECTION_DOWN);
679 else if (!strcmp(params, "left"))
680 e_border_unshade(bd, E_DIRECTION_LEFT);
681 else if (!strcmp(params, "right"))
682 e_border_unshade(bd, E_DIRECTION_RIGHT);
684 e_border_unshade(bd, E_DIRECTION_UP);
690 e_border_shade(bd, E_DIRECTION_UP);
693 if (!strcmp(params, "up"))
694 e_border_shade(bd, E_DIRECTION_UP);
695 else if (!strcmp(params, "down"))
696 e_border_shade(bd, E_DIRECTION_DOWN);
697 else if (!strcmp(params, "left"))
698 e_border_shade(bd, E_DIRECTION_LEFT);
699 else if (!strcmp(params, "right"))
700 e_border_shade(bd, E_DIRECTION_RIGHT);
702 e_border_shade(bd, E_DIRECTION_UP);
708 /***************************************************************************/
709 ACT_FN_GO(window_shaded, )
711 if (!obj) obj = E_OBJECT(e_border_focused_get());
713 if (obj->type != E_BORDER_TYPE)
715 obj = E_OBJECT(e_border_focused_get());
718 if (!((E_Border *)obj)->lock_user_shade)
722 bd = (E_Border *)obj;
728 if (sscanf(params, "%i %20s", &v, buf) == 2)
732 if (!strcmp(buf, "up"))
733 e_border_shade(bd, E_DIRECTION_UP);
734 else if (!strcmp(buf, "down"))
735 e_border_shade(bd, E_DIRECTION_DOWN);
736 else if (!strcmp(buf, "left"))
737 e_border_shade(bd, E_DIRECTION_LEFT);
738 else if (!strcmp(buf, "right"))
739 e_border_shade(bd, E_DIRECTION_RIGHT);
743 if (!strcmp(buf, "up"))
744 e_border_unshade(bd, E_DIRECTION_UP);
745 else if (!strcmp(buf, "down"))
746 e_border_unshade(bd, E_DIRECTION_DOWN);
747 else if (!strcmp(buf, "left"))
748 e_border_unshade(bd, E_DIRECTION_LEFT);
749 else if (!strcmp(buf, "right"))
750 e_border_unshade(bd, E_DIRECTION_RIGHT);
757 /***************************************************************************/
758 ACT_FN_GO(window_borderless_toggle, __UNUSED__)
760 if ((!obj) || (obj->type != E_BORDER_TYPE))
761 obj = E_OBJECT(e_border_focused_get());
763 if (!((E_Border *)obj)->lock_border)
767 bd = (E_Border *)obj;
768 bd->borderless = !bd->borderless;
770 bd->client.border.changed = 1;
775 /***************************************************************************/
776 ACT_FN_GO(window_border_set, __UNUSED__)
778 if ((!obj) || (obj->type != E_BORDER_TYPE))
779 obj = E_OBJECT(e_border_focused_get());
781 if (!((E_Border *)obj)->lock_border)
785 bd = (E_Border *)obj;
788 eina_stringshare_replace(&bd->bordername, params);
789 bd->client.border.changed = 1;
795 /***************************************************************************/
796 ACT_FN_GO(window_border_cycle, __UNUSED__)
798 if ((!obj) || (obj->type != E_BORDER_TYPE))
799 obj = E_OBJECT(e_border_focused_get());
801 if (!((E_Border *)obj)->lock_border)
805 bd = (E_Border *)obj;
810 while (*params == ' ')
815 const char *bdname = params;
817 while (bdname && (space = strchr(bdname, ' ')))
819 if (strncmp(bd->bordername, bdname, space - bdname) == 0)
822 while (*bdname == ' ')
824 space = strchr(bdname, ' ');
826 eina_stringshare_replace_length(
828 bdname, space - bdname);
830 eina_stringshare_replace(&bd->bordername, bdname);
831 bd->client.border.changed = 1;
836 while (*bdname == ' ')
841 space = strchr(params, ' ');
843 eina_stringshare_replace_length(&bd->bordername,
844 params, space - params);
846 eina_stringshare_replace(&bd->bordername, params);
847 bd->client.border.changed = 1;
853 /***************************************************************************/
854 ACT_FN_GO(window_pinned_toggle, __UNUSED__)
856 if ((!obj) || (obj->type != E_BORDER_TYPE))
857 obj = E_OBJECT(e_border_focused_get());
859 if (!((E_Border *)obj)->lock_border)
863 bd = (E_Border *)obj;
864 if ((bd->client.netwm.state.stacking == E_STACKING_BELOW) &&
865 (bd->user_skip_winlist) && (bd->borderless))
866 e_border_pinned_set(bd, 0);
868 e_border_pinned_set(bd, 1);
872 /***************************************************************************/
873 ACT_FN_GO(window_move_by, )
875 if (!obj) obj = E_OBJECT(e_border_focused_get());
877 if (obj->type != E_BORDER_TYPE)
879 obj = E_OBJECT(e_border_focused_get());
886 if (sscanf(params, "%i %i", &dx, &dy) == 2)
890 bd = (E_Border *)obj;
891 e_border_move(bd, bd->x + dx, bd->y + dy);
893 if (e_config->focus_policy != E_FOCUS_CLICK)
894 ecore_x_pointer_warp(bd->zone->container->win,
896 bd->y + (bd->h / 2));
901 /***************************************************************************/
902 ACT_FN_GO(window_move_to, )
904 if (!obj) obj = E_OBJECT(e_border_focused_get());
906 if (obj->type != E_BORDER_TYPE)
908 obj = E_OBJECT(e_border_focused_get());
914 int x, y, zx, zy, zw, zh;
917 bd = (E_Border *)obj;
918 e_zone_useful_geometry_get(bd->zone, &zx, &zy, &zw, &zh);
920 if (sscanf(params, "%c%i %c%i", &cx, &x, &cy, &y) == 4)
925 else if (sscanf(params, "* %c%i", &cy, &y) == 2)
927 /* Updated y, keep x. */
932 else if (sscanf(params, "%c%i *", &cx, &x) == 2)
934 /* Updated x, keep y. */
941 if (cx == '-') x = zw - bd->w - x + 2 * zx; /* compensate x with zx */
942 if (cy == '-') y = zh - bd->h - y + 2 * zy; /* compensate y with zy */
944 if ((x != bd->x) || (y != bd->y))
946 e_border_move(bd, x, y);
948 if (e_config->focus_policy != E_FOCUS_CLICK)
949 ecore_x_pointer_warp(bd->zone->container->win,
951 bd->y + (bd->h / 2));
956 /***************************************************************************/
957 ACT_FN_GO(window_move_to_center, __UNUSED__)
962 if (!obj) obj = E_OBJECT(e_border_focused_get());
964 if (obj->type != E_BORDER_TYPE)
966 obj = E_OBJECT(e_border_focused_get());
970 bd = (E_Border *)obj;
971 e_border_center_pos_get(bd, &x, &y);
973 if ((x != bd->x) || (y != bd->y))
975 e_border_move(bd, x, y);
977 if (e_config->focus_policy != E_FOCUS_CLICK)
978 ecore_x_pointer_warp(bd->zone->container->win,
984 /***************************************************************************/
985 ACT_FN_GO(window_resize_by, )
987 if (!obj) obj = E_OBJECT(e_border_focused_get());
989 if (obj->type != E_BORDER_TYPE)
991 obj = E_OBJECT(e_border_focused_get());
999 if (sscanf(params, "%i %i", &dw, &dh) == 2)
1003 bd = (E_Border *)obj;
1007 e_border_resize_limit(bd, &dw, &dh);
1008 e_border_resize(bd, dw, dh);
1010 if (e_config->focus_policy != E_FOCUS_CLICK)
1011 ecore_x_pointer_warp(bd->zone->container->win,
1012 bd->x + (dw / 2), bd->y + (dh / 2));
1017 /***************************************************************************/
1018 ACT_FN_GO(window_push, )
1020 if (!obj) obj = E_OBJECT(e_border_focused_get());
1022 if (obj->type != E_BORDER_TYPE)
1024 obj = E_OBJECT(e_border_focused_get());
1031 E_Border_List *bd_list;
1033 int x, y, zx, zy, zw, zh;
1035 if (strcmp(params, "left") == 0)
1040 else if (strcmp(params, "right") == 0)
1045 else if (strcmp(params, "up") == 0)
1050 else if (strcmp(params, "down") == 0)
1055 else if (strcmp(params, "up-left") == 0)
1060 else if (strcmp(params, "up-right") == 0)
1065 else if (strcmp(params, "down-left") == 0)
1070 else if (strcmp(params, "down-right") == 0)
1078 bd = (E_Border *)obj;
1079 e_zone_useful_geometry_get(bd->zone, &zx, &zy, &zw, &zh);
1081 if (hdir < 0) x = zx;
1082 else if (hdir > 0) x = zx + zw - bd->w;
1085 if (vdir < 0) y = zy;
1086 else if (vdir > 0) y = zy + zh - bd->h;
1089 bd_list = e_container_border_list_first(bd->zone->container);
1090 cur = e_container_border_list_next(bd_list);
1094 if ((bd->desk == cur->desk) && (bd != cur) && (!cur->iconic))
1097 && (cur->x + cur->w < bd->x)
1098 && (E_SPANS_COMMON(bd->y, bd->h, cur->y, cur->h)))
1099 x = MAX(x, cur->x + cur->w);
1101 && (cur->x > bd->x + bd->w)
1102 && (E_SPANS_COMMON(bd->y, bd->h, cur->y, cur->h)))
1103 x = MIN(x, zx + cur->x - bd->w);
1106 && (cur->y + cur->h < bd->y)
1107 && (E_SPANS_COMMON(bd->x, bd->w, cur->x, cur->w)))
1108 y = MAX(y, cur->y + cur->h);
1110 && (cur->y > bd->y + bd->h)
1111 && (E_SPANS_COMMON(bd->x, bd->w, cur->x, cur->w)))
1112 y = MIN(y, zy + cur->y - bd->h);
1114 cur = e_container_border_list_next(bd_list);
1116 e_container_border_list_free(bd_list);
1118 if ((x != bd->x) || (y != bd->y))
1120 e_border_move(bd, x, y);
1121 if (e_config->focus_policy != E_FOCUS_CLICK)
1122 ecore_x_pointer_warp(bd->zone->container->win,
1123 bd->x + (bd->w / 2), bd->y + (bd->h / 2));
1128 /***************************************************************************/
1129 ACT_FN_GO(window_drag_icon, __UNUSED__)
1131 if (!obj) obj = E_OBJECT(e_border_focused_get());
1133 if (obj->type != E_BORDER_TYPE)
1135 obj = E_OBJECT(e_border_focused_get());
1141 bd = (E_Border *)obj;
1148 /***************************************************************************/
1149 ACT_FN_GO(window_desk_move_by, )
1154 if (!params) return;
1155 if (!obj) obj = E_OBJECT(e_border_focused_get());
1157 if (obj->type != E_BORDER_TYPE)
1159 obj = E_OBJECT(e_border_focused_get());
1163 bd = (E_Border *)obj;
1164 if ((!bd->zone) || (!bd->desk)) return;
1165 if (sscanf(params, "%d %d", &x, &y) == 2)
1169 int to_x = 0, to_y = 0;
1171 e_desk_xy_get(bd->desk, &dx, &dy);
1175 while (!(desk = e_desk_at_xy_get(bd->zone, to_x, to_y)))
1177 /* here we are out of our desktop range */
1178 while (to_x >= bd->zone->desk_x_count)
1180 to_x -= bd->zone->desk_x_count;
1185 to_x += bd->zone->desk_x_count;
1189 while (to_y >= bd->zone->desk_y_count)
1190 to_y -= bd->zone->desk_y_count;
1192 to_y += bd->zone->desk_y_count;
1197 /* switch desktop. Quite useful from the interface point of view. */
1198 e_zone_desk_flip_by(bd->zone, to_x - dx, to_y - dy);
1199 /* send the border to the required desktop. */
1200 e_border_desk_set(bd, desk);
1201 if (!bd->lock_user_stacking)
1203 e_border_focus_set(bd, 1, 1);
1208 /***************************************************************************/
1209 ACT_FN_GO(window_desk_move_to, )
1214 if (!params) return;
1215 if (!obj) obj = E_OBJECT(e_border_focused_get());
1217 if (obj->type != E_BORDER_TYPE)
1219 obj = E_OBJECT(e_border_focused_get());
1223 bd = (E_Border *)obj;
1224 if ((!bd->zone) || (!bd->desk)) return;
1225 if (sscanf(params, "%d %d", &x, &y) == 2)
1229 desk = e_desk_at_xy_get(bd->zone, x, y);
1230 if (desk) e_border_desk_set(bd, desk);
1234 /***************************************************************************/
1236 _e_actions_zone_get(E_Object *obj)
1240 if (obj->type == E_MANAGER_TYPE)
1241 return e_util_zone_current_get((E_Manager *)obj);
1242 else if (obj->type == E_CONTAINER_TYPE)
1243 return e_util_zone_current_get(((E_Container *)obj)->manager);
1244 else if (obj->type == E_ZONE_TYPE)
1245 return e_util_zone_current_get(((E_Zone *)obj)->container->manager);
1247 return e_util_zone_current_get(e_manager_current_get());
1249 return e_util_zone_current_get(e_manager_current_get());
1252 ACT_FN_GO(desk_flip_by, )
1256 zone = _e_actions_zone_get(obj);
1263 if (sscanf(params, "%i %i", &dx, &dy) == 2)
1264 e_zone_desk_flip_by(zone, dx, dy);
1269 /***************************************************************************/
1270 ACT_FN_GO(desk_flip_to, )
1274 zone = _e_actions_zone_get(obj);
1281 if (sscanf(params, "%i %i", &dx, &dy) == 2)
1282 e_zone_desk_flip_to(zone, dx, dy);
1287 /***************************************************************************/
1288 #define ACT_FLIP_LEFT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || ((zone)->desk_x_current > 0))
1289 #define ACT_FLIP_RIGHT(zone) ((e_config->desk_flip_wrap && ((zone)->desk_x_count > 1)) || (((zone)->desk_x_current + 1) < (zone)->desk_x_count))
1290 #define ACT_FLIP_UP(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || ((zone)->desk_y_current > 0))
1291 #define ACT_FLIP_DOWN(zone) ((e_config->desk_flip_wrap && ((zone)->desk_y_count > 1)) || (((zone)->desk_y_current + 1) < (zone)->desk_y_count))
1292 #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)))
1293 #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)))
1294 #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)))
1295 #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)))
1297 ACT_FN_GO_EDGE(desk_flip_in_direction, )
1300 E_Desk *current = NULL;
1301 E_Event_Pointer_Warp *wev;
1302 int x, y, offset = 25;
1304 if (!ev) return; // with flip on _e_zone_cb_edge_timer we don't have ev!!!
1305 zone = _e_actions_zone_get(obj);
1306 wev = E_NEW(E_Event_Pointer_Warp, 1);
1307 if ((!wev) || (!zone)) return;
1308 ecore_x_pointer_xy_get(zone->container->win, &x, &y);
1313 if (sscanf(params, "%i", &offset) != 1)
1318 case E_ZONE_EDGE_LEFT:
1319 if (ACT_FLIP_LEFT(zone))
1321 e_zone_desk_flip_by(zone, -1, 0);
1322 ecore_x_pointer_warp(zone->container->win, zone->w - offset, y);
1324 wev->curr.x = zone->w - offset;
1327 case E_ZONE_EDGE_RIGHT:
1328 if (ACT_FLIP_RIGHT(zone))
1330 e_zone_desk_flip_by(zone, 1, 0);
1331 ecore_x_pointer_warp(zone->container->win, offset, y);
1333 wev->curr.x = offset;
1336 case E_ZONE_EDGE_TOP:
1337 if (ACT_FLIP_UP(zone))
1339 e_zone_desk_flip_by(zone, 0, -1);
1340 ecore_x_pointer_warp(zone->container->win, x, zone->h - offset);
1342 wev->curr.y = zone->h - offset;
1345 case E_ZONE_EDGE_BOTTOM:
1346 if (ACT_FLIP_DOWN(zone))
1348 e_zone_desk_flip_by(zone, 0, 1);
1349 ecore_x_pointer_warp(zone->container->win, x, offset);
1351 wev->curr.y = offset;
1354 case E_ZONE_EDGE_TOP_LEFT:
1355 if (ACT_FLIP_UP_LEFT(zone))
1357 e_zone_desk_flip_by(zone, -1, -1);
1358 ecore_x_pointer_warp(zone->container->win, zone->w - offset, zone->h - offset);
1359 wev->curr.x = zone->w - offset;
1360 wev->curr.y = zone->h - offset;
1363 case E_ZONE_EDGE_TOP_RIGHT:
1364 if (ACT_FLIP_UP_RIGHT(zone))
1366 e_zone_desk_flip_by(zone, 1, -1);
1367 ecore_x_pointer_warp(zone->container->win, offset, zone->h - offset);
1368 wev->curr.x = offset;
1369 wev->curr.y = zone->h - offset;
1372 case E_ZONE_EDGE_BOTTOM_LEFT:
1373 if (ACT_FLIP_DOWN_LEFT(zone))
1375 e_zone_desk_flip_by(zone, -1, 1);
1376 ecore_x_pointer_warp(zone->container->win, zone->w - offset, offset);
1377 wev->curr.y = offset;
1378 wev->curr.x = zone->w - offset;
1381 case E_ZONE_EDGE_BOTTOM_RIGHT:
1382 if (ACT_FLIP_DOWN_RIGHT(zone))
1384 e_zone_desk_flip_by(zone, 1, 1);
1385 ecore_x_pointer_warp(zone->container->win, offset, offset);
1386 wev->curr.y = offset;
1387 wev->curr.x = offset;
1394 current = e_desk_current_get(zone);
1396 ecore_event_add(E_EVENT_POINTER_WARP, wev, NULL, NULL);
1401 /***************************************************************************/
1402 ACT_FN_GO(desk_linear_flip_by, )
1406 zone = _e_actions_zone_get(obj);
1413 if (sscanf(params, "%i", &dx) == 1)
1414 e_zone_desk_linear_flip_by(zone, dx);
1419 /***************************************************************************/
1420 ACT_FN_GO(desk_linear_flip_to, )
1424 zone = _e_actions_zone_get(obj);
1431 if (sscanf(params, "%i", &dx) == 1)
1432 e_zone_desk_linear_flip_to(zone, dx);
1438 #define DESK_ACTION_ALL(zone, act) \
1440 Eina_List *lm, *lc, *lz; \
1444 EINA_LIST_FOREACH(e_manager_list(), lm, man) { \
1445 EINA_LIST_FOREACH(man->containers, lc, con) { \
1446 EINA_LIST_FOREACH(con->zones, lz, zone) { \
1453 /***************************************************************************/
1454 ACT_FN_GO(desk_flip_by_all, )
1460 if (sscanf(params, "%i %i", &dx, &dy) == 2)
1462 DESK_ACTION_ALL(zone, e_zone_desk_flip_by(zone, dx, dy));
1467 /***************************************************************************/
1468 ACT_FN_GO(desk_flip_to_all, )
1474 if (sscanf(params, "%i %i", &dx, &dy) == 2)
1476 DESK_ACTION_ALL(zone, e_zone_desk_flip_to(zone, dx, dy));
1481 /***************************************************************************/
1482 ACT_FN_GO(desk_linear_flip_by_all, )
1488 if (sscanf(params, "%i", &dx) == 1)
1490 DESK_ACTION_ALL(zone, e_zone_desk_linear_flip_by(zone, dx));
1495 /***************************************************************************/
1496 ACT_FN_GO(desk_linear_flip_to_all, )
1502 if (sscanf(params, "%i", &dx) == 1)
1504 DESK_ACTION_ALL(zone, e_zone_desk_linear_flip_to(zone, dx));
1509 /***************************************************************************/
1510 ACT_FN_GO(screen_send_to, )
1514 zone = _e_actions_zone_get(obj);
1515 if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
1522 if (sscanf(params, "%i", &scr) == 1)
1524 E_Zone *zone2 = NULL;
1526 if (eina_list_count(e_manager_list()) > 1)
1528 scr = scr % eina_list_count(e_manager_list());
1529 if (scr < 0) scr += eina_list_count(e_manager_list());
1530 zone2 = e_util_container_zone_number_get(scr, 0);
1534 scr = scr % eina_list_count(zone->container->zones);
1535 if (scr < 0) scr += eina_list_count(zone->container->zones);
1536 zone2 = e_util_container_zone_number_get(0, scr);
1538 if ((zone2) && (zone != zone2))
1539 ecore_x_pointer_warp(zone2->container->win,
1540 zone2->x + (zone2->w / 2),
1541 zone2->y + (zone2->h / 2));
1547 ACT_FN_GO(screen_send_by, )
1551 zone = _e_actions_zone_get(obj);
1552 if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
1559 if (sscanf(params, "%i", &scr) == 1)
1561 E_Zone *zone2 = NULL;
1563 if (eina_list_count(e_manager_list()) > 1)
1565 scr += zone->container->num;
1566 scr = scr % eina_list_count(e_manager_list());
1567 if (scr < 0) scr += eina_list_count(e_manager_list());
1568 zone2 = e_util_container_zone_number_get(scr, 0);
1573 scr = scr % eina_list_count(zone->container->zones);
1574 if (scr < 0) scr += eina_list_count(zone->container->zones);
1575 zone2 = e_util_container_zone_number_get(0, scr);
1577 if ((zone2) && (zone != zone2))
1578 ecore_x_pointer_warp(zone2->container->win,
1579 zone2->x + (zone2->w / 2),
1580 zone2->y + (zone2->h / 2));
1586 #define ZONE_DESK_ACTION(con_num, zone_num, zone, act) \
1588 if ((con_num < 0) || (zone_num < 0)) { \
1589 Eina_List *l, *ll, *lll; \
1592 if ((con_num >= 0) && (zone_num < 0)) /* con=1 zone=all */ { \
1593 con = e_util_container_number_get(con_num); \
1594 EINA_LIST_FOREACH(con->zones, l, zone) { \
1597 else if ((con_num < 0) && (zone_num >= 0)) /* con=all zone=1 */ { \
1598 EINA_LIST_FOREACH(e_manager_list(), l, man) { \
1599 EINA_LIST_FOREACH(man->containers, ll, con) { \
1600 zone = e_container_zone_number_get(con, zone_num); \
1604 else if ((con_num < 0) && (zone_num < 0)) /* con=all zone=all */ { \
1605 EINA_LIST_FOREACH(e_manager_list(), l, man) { \
1606 EINA_LIST_FOREACH(man->containers, ll, con) { \
1607 EINA_LIST_FOREACH(con->zones, lll, zone) { \
1611 zone = e_util_container_zone_number_get(con_num, zone_num); \
1615 /***************************************************************************/
1617 ACT_FN_GO(zone_desk_flip_by, )
1621 int con_num = 0, zone_num = 0;
1624 if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4)
1625 ZONE_DESK_ACTION(con_num, zone_num, zone,
1626 e_zone_desk_flip_by(zone, dx, dy));
1631 /***************************************************************************/
1633 ACT_FN_GO(zone_desk_flip_to, )
1637 int con_num = 0, zone_num = 0;
1640 if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4)
1641 ZONE_DESK_ACTION(con_num, zone_num, zone,
1642 e_zone_desk_flip_to(zone, dx, dy));
1647 /***************************************************************************/
1649 ACT_FN_GO(zone_desk_linear_flip_by, )
1653 int con_num = 0, zone_num = 0;
1656 if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3)
1657 ZONE_DESK_ACTION(con_num, zone_num, zone,
1658 e_zone_desk_linear_flip_by(zone, dx));
1663 /***************************************************************************/
1665 ACT_FN_GO(zone_desk_linear_flip_to, )
1669 int con_num = 0, zone_num = 0;
1672 if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3)
1673 ZONE_DESK_ACTION(con_num, zone_num, zone,
1674 e_zone_desk_linear_flip_to(zone, dx));
1679 /***************************************************************************/
1681 _e_actions_cb_menu_end(void *data __UNUSED__, E_Menu *m)
1683 e_object_del(E_OBJECT(m));
1687 _e_actions_menu_find(const char *name)
1689 if (!strcmp(name, "main"))
1690 return e_int_menus_main_new();
1691 else if (!strcmp(name, "favorites"))
1692 return e_int_menus_favorite_apps_new();
1693 else if (!strcmp(name, "all"))
1694 return e_int_menus_all_apps_new();
1695 else if (!strcmp(name, "clients"))
1696 return e_int_menus_clients_new();
1697 else if (!strcmp(name, "lost_clients"))
1698 return e_int_menus_lost_clients_new();
1699 else if (!strcmp(name, "configuration"))
1700 return e_int_menus_config_new();
1704 ACT_FN_GO(menu_show, )
1708 /* menu is active - abort */
1709 if (e_menu_grab_window_get()) return;
1710 zone = _e_actions_zone_get(obj);
1717 m = _e_actions_menu_find(params);
1722 /* FIXME: this is a bit of a hack... setting m->con - bad hack */
1724 ecore_x_pointer_xy_get(zone->container->win, &x, &y);
1725 e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
1726 e_menu_activate_mouse(m, zone, x, y, 1, 1,
1727 E_MENU_POP_DIRECTION_DOWN,
1728 ecore_x_current_time_get());
1734 ACT_FN_GO_MOUSE(menu_show, )
1738 /* menu is active - abort */
1739 if (e_menu_grab_window_get()) return;
1740 zone = _e_actions_zone_get(obj);
1747 m = _e_actions_menu_find(params);
1752 /* FIXME: this is a bit of a hack... setting m->con - bad hack */
1756 x -= zone->container->x;
1757 y -= zone->container->y;
1758 e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
1759 e_menu_activate_mouse(m, zone, x, y, 1, 1,
1760 E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
1766 ACT_FN_GO_KEY(menu_show, )
1770 /* menu is active - abort */
1771 if (e_menu_grab_window_get()) return;
1772 zone = _e_actions_zone_get(obj);
1779 m = _e_actions_menu_find(params);
1784 /* FIXME: this is a bit of a hack... setting m->con - bad hack */
1786 ecore_x_pointer_xy_get(zone->container->win, &x, &y);
1787 e_menu_post_deactivate_callback_set(m, _e_actions_cb_menu_end, NULL);
1788 e_menu_activate_key(m, zone, x, y, 1, 1,
1789 E_MENU_POP_DIRECTION_DOWN);
1795 /***************************************************************************/
1800 zone = _e_actions_zone_get(obj);
1804 e_exec(zone, NULL, params, NULL, "action/exec");
1808 /***************************************************************************/
1813 zone = _e_actions_zone_get(obj);
1818 Efreet_Desktop *desktop = NULL;
1821 p2 = alloca(strlen(params) + 1);
1823 p = strchr(p2, ' ');
1827 if (!strcmp(p2, "file:"))
1828 desktop = efreet_util_desktop_file_id_find(p + 1);
1829 else if (!strcmp(p2, "name:"))
1830 desktop = efreet_util_desktop_name_find(p + 1);
1831 else if (!strcmp(p2, "generic:"))
1832 desktop = efreet_util_desktop_generic_name_find(p + 1);
1833 else if (!strcmp(p2, "exe:"))
1834 desktop = efreet_util_desktop_exec_find(p + 1);
1837 e_exec(zone, desktop, NULL, NULL, "action/app");
1838 efreet_desktop_free(desktop);
1845 /***************************************************************************/
1846 ACT_FN_GO(desk_deskshow_toggle, __UNUSED__)
1850 zone = _e_actions_zone_get(obj);
1851 if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
1852 if (zone) e_desk_deskshow(zone);
1855 ACT_FN_GO(cleanup_windows, __UNUSED__)
1859 zone = _e_actions_zone_get(obj);
1860 if (!zone) zone = e_util_zone_current_get(e_manager_current_get());
1861 if (zone) e_place_zone_region_smart_cleanup(zone);
1864 /***************************************************************************/
1865 static E_Dialog *exit_dialog = NULL;
1868 _e_actions_cb_exit_dialog_ok(void *data __UNUSED__, E_Dialog *dia)
1872 e_object_del(E_OBJECT(exit_dialog));
1875 e_sys_action_do(E_SYS_EXIT, NULL);
1879 _e_actions_cb_exit_dialog_cancel(void *data __UNUSED__, E_Dialog *dia __UNUSED__)
1881 e_object_del(E_OBJECT(exit_dialog));
1886 _e_actions_cb_exit_dialog_delete(E_Win *win)
1891 _e_actions_cb_exit_dialog_cancel(NULL, dia);
1896 if ((params) && (!strcmp(params, "now")))
1898 e_sys_action_do(E_SYS_EXIT, NULL);
1901 if (exit_dialog) e_object_del(E_OBJECT(exit_dialog));
1903 if (e_config->cnfmdlg_disabled)
1905 _e_actions_cb_exit_dialog_ok(NULL, NULL);
1909 exit_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_exit_dialog");
1910 if (!exit_dialog) return;
1911 e_win_delete_callback_set(exit_dialog->win, _e_actions_cb_exit_dialog_delete);
1912 e_dialog_title_set(exit_dialog, _("Are you sure you want to exit?"));
1913 e_dialog_text_set(exit_dialog,
1914 _("You requested to exit Enlightenment.<br>"
1916 "Are you sure you want to exit?"));
1917 e_dialog_icon_set(exit_dialog, "application-exit", 64);
1918 e_dialog_button_add(exit_dialog, _("Yes"), NULL,
1919 _e_actions_cb_exit_dialog_ok, NULL);
1920 e_dialog_button_add(exit_dialog, _("No"), NULL,
1921 _e_actions_cb_exit_dialog_cancel, NULL);
1922 e_dialog_button_focus_num(exit_dialog, 1);
1923 e_win_centered_set(exit_dialog->win, 1);
1924 e_dialog_show(exit_dialog);
1927 /***************************************************************************/
1928 ACT_FN_GO(restart, __UNUSED__)
1930 e_sys_action_do(E_SYS_RESTART, NULL);
1933 /***************************************************************************/
1934 ACT_FN_GO(exit_now, __UNUSED__)
1936 e_sys_action_do(E_SYS_EXIT_NOW, NULL);
1939 /***************************************************************************/
1940 ACT_FN_GO(halt_now, __UNUSED__)
1942 e_sys_action_do(E_SYS_HALT_NOW, NULL);
1945 /***************************************************************************/
1946 ACT_FN_GO(mode_presentation_toggle, __UNUSED__)
1948 e_config->mode.presentation = !e_config->mode.presentation;
1949 e_config_mode_changed();
1950 e_config_save_queue();
1953 /***************************************************************************/
1954 ACT_FN_GO(mode_offline_toggle, __UNUSED__)
1956 e_config->mode.offline = !e_config->mode.offline;
1957 e_config_mode_changed();
1958 e_config_save_queue();
1961 /***************************************************************************/
1962 static E_Dialog *logout_dialog = NULL;
1965 _e_actions_cb_logout_dialog_ok(void *data __UNUSED__, E_Dialog *dia)
1969 e_object_del(E_OBJECT(logout_dialog));
1970 logout_dialog = NULL;
1972 e_sys_action_do(E_SYS_LOGOUT, NULL);
1976 _e_actions_cb_logout_dialog_cancel(void *data __UNUSED__, E_Dialog *dia __UNUSED__)
1978 e_object_del(E_OBJECT(logout_dialog));
1979 logout_dialog = NULL;
1983 _e_actions_cb_logout_dialog_delete(E_Win *win)
1988 _e_actions_cb_logout_dialog_cancel(NULL, dia);
1993 if ((params) && (!strcmp(params, "now")))
1995 e_sys_action_do(E_SYS_LOGOUT, NULL);
1998 if (logout_dialog) e_object_del(E_OBJECT(logout_dialog));
2000 if (e_config->cnfmdlg_disabled)
2002 _e_actions_cb_logout_dialog_ok(NULL, NULL);
2006 logout_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_logout_dialog");
2007 if (!logout_dialog) return;
2008 e_win_delete_callback_set(logout_dialog->win, _e_actions_cb_logout_dialog_delete);
2009 e_dialog_title_set(logout_dialog, _("Are you sure you want to log out?"));
2010 e_dialog_text_set(logout_dialog,
2011 _("You are about to log out.<br>"
2013 "Are you sure you want to do this?"));
2014 e_dialog_icon_set(logout_dialog, "system-log-out", 64);
2015 e_dialog_button_add(logout_dialog, _("Yes"), NULL,
2016 _e_actions_cb_logout_dialog_ok, NULL);
2017 e_dialog_button_add(logout_dialog, _("No"), NULL,
2018 _e_actions_cb_logout_dialog_cancel, NULL);
2019 e_dialog_button_focus_num(logout_dialog, 1);
2020 e_win_centered_set(logout_dialog->win, 1);
2021 e_dialog_show(logout_dialog);
2024 /***************************************************************************/
2025 static E_Dialog *halt_dialog = NULL;
2028 _e_actions_cb_halt_dialog_ok(void *data __UNUSED__, E_Dialog *dia)
2032 e_object_del(E_OBJECT(halt_dialog));
2035 e_sys_action_do(E_SYS_HALT, NULL);
2039 _e_actions_cb_halt_dialog_cancel(void *data __UNUSED__, E_Dialog *dia __UNUSED__)
2041 e_object_del(E_OBJECT(halt_dialog));
2046 _e_actions_cb_halt_dialog_delete(E_Win *win)
2051 _e_actions_cb_halt_dialog_cancel(NULL, dia);
2056 if ((params) && (!strcmp(params, "now")))
2058 e_sys_action_do(E_SYS_HALT, NULL);
2061 if (halt_dialog) e_object_del(E_OBJECT(halt_dialog));
2063 if (e_config->cnfmdlg_disabled)
2065 _e_actions_cb_halt_dialog_ok(NULL, NULL);
2069 halt_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_halt_dialog");
2070 if (!halt_dialog) return;
2071 e_win_delete_callback_set(halt_dialog->win, _e_actions_cb_halt_dialog_delete);
2072 e_dialog_title_set(halt_dialog, _("Are you sure you want to turn off?"));
2073 e_dialog_text_set(halt_dialog,
2074 _("You requested to turn off your Computer.<br>"
2076 "Are you sure you want to shut down?"));
2077 e_dialog_icon_set(halt_dialog, "system-shutdown", 64);
2078 e_dialog_button_add(halt_dialog, _("Yes"), NULL,
2079 _e_actions_cb_halt_dialog_ok, NULL);
2080 e_dialog_button_add(halt_dialog, _("No"), NULL,
2081 _e_actions_cb_halt_dialog_cancel, NULL);
2082 e_dialog_button_focus_num(halt_dialog, 1);
2083 e_win_centered_set(halt_dialog->win, 1);
2084 e_dialog_show(halt_dialog);
2087 /***************************************************************************/
2088 static E_Dialog *reboot_dialog = NULL;
2091 _e_actions_cb_reboot_dialog_ok(void *data __UNUSED__, E_Dialog *dia)
2095 e_object_del(E_OBJECT(reboot_dialog));
2096 reboot_dialog = NULL;
2098 e_sys_action_do(E_SYS_REBOOT, NULL);
2102 _e_actions_cb_reboot_dialog_cancel(void *data __UNUSED__, E_Dialog *dia __UNUSED__)
2104 e_object_del(E_OBJECT(reboot_dialog));
2105 reboot_dialog = NULL;
2109 _e_actions_cb_reboot_dialog_delete(E_Win *win)
2114 _e_actions_cb_reboot_dialog_cancel(NULL, dia);
2119 if ((params) && (!strcmp(params, "now")))
2121 e_sys_action_do(E_SYS_REBOOT, NULL);
2124 if (reboot_dialog) e_object_del(E_OBJECT(reboot_dialog));
2126 if (e_config->cnfmdlg_disabled)
2128 _e_actions_cb_reboot_dialog_ok(NULL, NULL);
2132 reboot_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_reboot_dialog");
2133 if (!reboot_dialog) return;
2134 e_win_delete_callback_set(reboot_dialog->win, _e_actions_cb_reboot_dialog_delete);
2135 e_dialog_title_set(reboot_dialog, _("Are you sure you want to reboot?"));
2136 e_dialog_text_set(reboot_dialog,
2137 _("You requested to reboot your Computer.<br>"
2139 "Are you sure you want to restart it?"));
2140 e_dialog_icon_set(reboot_dialog, "system-restart", 64);
2141 e_dialog_button_add(reboot_dialog, _("Yes"), NULL,
2142 _e_actions_cb_reboot_dialog_ok, NULL);
2143 e_dialog_button_add(reboot_dialog, _("No"), NULL,
2144 _e_actions_cb_reboot_dialog_cancel, NULL);
2145 e_dialog_button_focus_num(reboot_dialog, 1);
2146 e_win_centered_set(reboot_dialog->win, 1);
2147 e_dialog_show(reboot_dialog);
2150 /***************************************************************************/
2151 static E_Dialog *suspend_dialog = NULL;
2154 _e_actions_cb_suspend_dialog_ok(void *data __UNUSED__, E_Dialog *dia)
2158 e_object_del(E_OBJECT(suspend_dialog));
2159 suspend_dialog = NULL;
2161 e_sys_action_do(E_SYS_SUSPEND, NULL);
2165 _e_actions_cb_suspend_dialog_cancel(void *data __UNUSED__, E_Dialog *dia __UNUSED__)
2167 e_object_del(E_OBJECT(suspend_dialog));
2168 suspend_dialog = NULL;
2172 _e_actions_cb_suspend_dialog_delete(E_Win *win)
2177 _e_actions_cb_suspend_dialog_cancel(NULL, dia);
2180 ACT_FN_GO(suspend_now, __UNUSED__)
2182 e_sys_action_do(E_SYS_SUSPEND, NULL);
2185 ACT_FN_GO(suspend, )
2187 if ((params) && (!strcmp(params, "now")))
2189 e_sys_action_do(E_SYS_SUSPEND, NULL);
2192 if (suspend_dialog) e_object_del(E_OBJECT(suspend_dialog));
2194 if (e_config->cnfmdlg_disabled)
2196 _e_actions_cb_suspend_dialog_ok(NULL, NULL);
2200 suspend_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_suspend_dialog");
2201 if (!suspend_dialog) return;
2202 e_win_delete_callback_set(suspend_dialog->win, _e_actions_cb_suspend_dialog_delete);
2203 e_dialog_title_set(suspend_dialog, _("Are you sure you want to turn off?"));
2204 e_dialog_text_set(suspend_dialog,
2205 _("You requested to suspend your Computer.<br>"
2207 "Are you sure you want to suspend?"));
2208 e_dialog_icon_set(suspend_dialog, "system-suspend", 64);
2209 e_dialog_button_add(suspend_dialog, _("Yes"), NULL,
2210 _e_actions_cb_suspend_dialog_ok, NULL);
2211 e_dialog_button_add(suspend_dialog, _("No"), NULL,
2212 _e_actions_cb_suspend_dialog_cancel, NULL);
2213 e_dialog_button_focus_num(suspend_dialog, 1);
2214 e_win_centered_set(suspend_dialog->win, 1);
2215 e_dialog_show(suspend_dialog);
2218 /***************************************************************************/
2219 static E_Dialog *hibernate_dialog = NULL;
2222 _e_actions_cb_hibernate_dialog_ok(void *data __UNUSED__, E_Dialog *dia)
2226 e_object_del(E_OBJECT(hibernate_dialog));
2227 hibernate_dialog = NULL;
2229 e_sys_action_do(E_SYS_HIBERNATE, NULL);
2233 _e_actions_cb_hibernate_dialog_cancel(void *data __UNUSED__, E_Dialog *dia __UNUSED__)
2235 e_object_del(E_OBJECT(hibernate_dialog));
2236 hibernate_dialog = NULL;
2240 _e_actions_cb_hibernate_dialog_delete(E_Win *win)
2245 _e_actions_cb_hibernate_dialog_cancel(NULL, dia);
2248 ACT_FN_GO(hibernate, )
2250 if ((params) && (!strcmp(params, "now")))
2252 e_sys_action_do(E_SYS_HIBERNATE, NULL);
2255 if (hibernate_dialog) e_object_del(E_OBJECT(hibernate_dialog));
2257 if (e_config->cnfmdlg_disabled)
2259 _e_actions_cb_hibernate_dialog_ok(NULL, NULL);
2263 hibernate_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_hibernate_dialog");
2264 if (!hibernate_dialog) return;
2265 e_win_delete_callback_set(hibernate_dialog->win, _e_actions_cb_hibernate_dialog_delete);
2266 e_dialog_title_set(hibernate_dialog, _("Are you sure you want to hibernate?"));
2267 e_dialog_text_set(hibernate_dialog,
2268 _("You requested to hibernate your Computer.<br>"
2270 "Are you sure you want to suspend to disk?"));
2271 e_dialog_icon_set(hibernate_dialog, "system-suspend-hibernate", 64);
2272 e_dialog_button_add(hibernate_dialog, _("Yes"), NULL,
2273 _e_actions_cb_hibernate_dialog_ok, NULL);
2274 e_dialog_button_add(hibernate_dialog, _("No"), NULL,
2275 _e_actions_cb_hibernate_dialog_cancel, NULL);
2276 e_dialog_button_focus_num(hibernate_dialog, 1);
2277 e_win_centered_set(hibernate_dialog->win, 1);
2278 e_dialog_show(hibernate_dialog);
2281 /***************************************************************************/
2282 ACT_FN_GO(pointer_resize_push, )
2285 if (obj->type == E_BORDER_TYPE)
2289 bd = (E_Border *)obj;
2290 if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) ||
2291 (bd->fullscreen) || ((bd->maximized) && (!e_config->allow_manip)))
2293 e_pointer_type_push(bd->pointer, bd, params);
2297 /***************************************************************************/
2298 ACT_FN_GO(pointer_resize_pop, )
2301 if (obj->type == E_BORDER_TYPE)
2305 bd = (E_Border *)obj;
2306 if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) ||
2307 (bd->fullscreen) || ((bd->maximized) && (!e_config->allow_manip)))
2309 e_pointer_type_pop(bd->pointer, bd, params);
2313 /***************************************************************************/
2314 ACT_FN_GO(desk_lock, __UNUSED__)
2318 zone = _e_actions_zone_get(obj);
2323 /***************************************************************************/
2324 ACT_FN_GO(shelf_show, )
2331 for (; *params != '\0'; params++)
2332 if (!isspace(*params))
2334 if (*params == '\0')
2338 EINA_LIST_FOREACH(e_shelf_list(), l, es)
2340 if ((!params) || (params && (fnmatch(params, es->name, 0) == 0)))
2342 e_shelf_toggle(es, 1);
2343 e_shelf_toggle(es, 0);
2347 /***************************************************************************/
2348 #define ACT_SHELF_SHOW(params, es) \
2349 if ((!params) || (params && (fnmatch(params, es->name, 0) == 0))) \
2351 e_shelf_toggle(es, 1); \
2352 e_shelf_toggle(es, 0); \
2355 ACT_FN_GO_EDGE(shelf_show, )
2362 for (; *params != '\0'; params++)
2364 if (!isspace(*params))
2367 if (*params == '\0')
2371 EINA_LIST_FOREACH(e_shelf_list(), l, es)
2375 case E_ZONE_EDGE_LEFT:
2376 if ((es->gadcon->orient == E_GADCON_ORIENT_LEFT ||
2377 es->gadcon->orient == E_GADCON_ORIENT_CORNER_LT ||
2378 es->gadcon->orient == E_GADCON_ORIENT_CORNER_LB) &&
2379 (ev->y >= es->y) && (ev->y <= (es->y + es->h)))
2380 ACT_SHELF_SHOW(params, es);
2382 case E_ZONE_EDGE_RIGHT:
2383 if ((es->gadcon->orient == E_GADCON_ORIENT_RIGHT ||
2384 es->gadcon->orient == E_GADCON_ORIENT_CORNER_RT ||
2385 es->gadcon->orient == E_GADCON_ORIENT_CORNER_RB) &&
2386 (ev->y >= es->y) && (ev->y <= (es->y + es->h)))
2387 ACT_SHELF_SHOW(params, es);
2389 case E_ZONE_EDGE_TOP:
2390 if ((es->gadcon->orient == E_GADCON_ORIENT_TOP ||
2391 es->gadcon->orient == E_GADCON_ORIENT_CORNER_TL ||
2392 es->gadcon->orient == E_GADCON_ORIENT_CORNER_TR) &&
2393 (ev->x >= es->x) && (ev->x <= (es->x + es->w)))
2394 ACT_SHELF_SHOW(params, es);
2396 case E_ZONE_EDGE_BOTTOM:
2397 if ((es->gadcon->orient == E_GADCON_ORIENT_BOTTOM ||
2398 es->gadcon->orient == E_GADCON_ORIENT_CORNER_BL ||
2399 es->gadcon->orient == E_GADCON_ORIENT_CORNER_BR) &&
2400 (ev->x >= es->x) && (ev->x <= (es->x + es->w)))
2401 ACT_SHELF_SHOW(params, es);
2408 #undef ACT_SHELF_SHOW
2410 /***************************************************************************/
2411 typedef struct _Delayed_Action Delayed_Action;
2413 struct _Delayed_Action
2416 const char *keyname;
2421 const char *action, *params;
2425 static Eina_List *_delayed_actions = NULL;
2428 _delayed_action_free(Delayed_Action *da)
2430 if (da->obj) e_object_unref(da->obj);
2431 if (da->keyname) eina_stringshare_del(da->keyname);
2432 if (da->timer) ecore_timer_del(da->timer);
2433 if (da->def.action) eina_stringshare_del(da->def.action);
2434 if (da->def.params) eina_stringshare_del(da->def.params);
2435 if (da->delayed.action) eina_stringshare_del(da->delayed.action);
2436 if (da->delayed.params) eina_stringshare_del(da->delayed.params);
2441 _delayed_action_cb_timer(void *data)
2448 act = e_action_find(da->delayed.action);
2451 if (act->func.go) act->func.go(da->obj, da->delayed.params);
2453 _delayed_actions = eina_list_remove(_delayed_actions, da);
2454 _delayed_action_free(da);
2455 return ECORE_CALLBACK_CANCEL;
2459 _delayed_action_do(Delayed_Action *da)
2463 act = e_action_find(da->def.action);
2466 if (act->func.go) act->func.go(da->obj, da->def.params);
2471 _delayed_action_list_parse_action(const char *str, double *delay, const char **action, const char **params)
2478 sscanf(str, "%10s %1000s", fbuf, buf);
2479 *action = eina_stringshare_add(buf);
2480 *delay = atof(fbuf);
2481 p = strchr(str, ' ');
2489 *params = eina_stringshare_add(p);
2495 _delayed_action_list_parse(Delayed_Action *da, const char *params)
2498 const char *p, *a1start = NULL, *a1stop = NULL;
2499 const char *a2start = NULL, *a2stop = NULL;
2501 // FORMAT: "[0.0 default_action param1 param2] [x.x action2 param1 param2]"
2505 if ((*p == '[') && ((p == params) || ((p > params) && (p[-1] != '\\')))) {a1start = p + 1; break;}
2510 if ((*p == ']') && ((p == params) || ((p > params) && (p[-1] != '\\')))) {a1stop = p; break;}
2515 if ((*p == '[') && ((p == params) || ((p > params) && (p[-1] != '\\')))) {a2start = p + 1; break;}
2520 if ((*p == ']') && ((p == params) || ((p > params) && (p[-1] != '\\')))) {a2stop = p; break;}
2523 if ((a1start) && (a2start) && (a1stop) && (a2stop))
2526 const char *action, *params;
2528 a1 = alloca(a1stop - a1start + 1);
2529 eina_strlcpy(a1, a1start, a1stop - a1start + 1);
2532 _delayed_action_list_parse_action(a1, &delay, &da->def.action, &da->def.params);
2534 a2 = alloca(a1stop - a1start + 1);
2535 eina_strlcpy(a2, a2start, a2stop - a2start + 1);
2536 _delayed_action_list_parse_action(a2, &delay, &da->delayed.action, &da->delayed.params);
2538 da->timer = ecore_timer_add(delay, _delayed_action_cb_timer, da);
2542 _delayed_action_key_add(E_Object *obj, const char *params, Ecore_Event_Key *ev)
2546 da = E_NEW(Delayed_Action, 1);
2551 e_object_ref(da->obj);
2554 da->keyname = eina_stringshare_add(ev->keyname);
2555 if (params) _delayed_action_list_parse(da, params);
2556 _delayed_actions = eina_list_append(_delayed_actions, da);
2560 _delayed_action_key_del(E_Object *obj, const char *params __UNUSED__, Ecore_Event_Key *ev)
2565 EINA_LIST_FOREACH(_delayed_actions, l, da)
2567 if ((da->obj == obj) && (!da->mouse) &&
2568 (!strcmp(da->keyname, ev->keyname)))
2570 _delayed_action_do(da);
2571 _delayed_action_free(da);
2572 _delayed_actions = eina_list_remove_list(_delayed_actions, l);
2579 _delayed_action_mouse_add(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev)
2583 da = E_NEW(Delayed_Action, 1);
2588 e_object_ref(da->obj);
2591 da->button = ev->buttons;
2592 if (params) _delayed_action_list_parse(da, params);
2593 _delayed_actions = eina_list_append(_delayed_actions, da);
2597 _delayed_action_mouse_del(E_Object *obj, const char *params __UNUSED__, Ecore_Event_Mouse_Button *ev)
2602 EINA_LIST_FOREACH(_delayed_actions, l, da)
2604 if ((da->obj == obj) && (da->mouse) &&
2605 ((int) ev->buttons == da->button))
2607 _delayed_action_do(da);
2608 _delayed_action_free(da);
2609 _delayed_actions = eina_list_remove_list(_delayed_actions, l);
2615 // obj , params , ev
2616 ACT_FN_GO_KEY(delayed_action, )
2618 _delayed_action_key_add(obj, params, ev);
2621 ACT_FN_GO_MOUSE(delayed_action, )
2623 _delayed_action_mouse_add(obj, params, ev);
2626 ACT_FN_END_KEY(delayed_action, )
2628 _delayed_action_key_del(obj, params, ev);
2631 ACT_FN_END_MOUSE(delayed_action, )
2633 _delayed_action_mouse_del(obj, params, ev);
2636 ACT_FN_GO_ACPI(dim_screen, __UNUSED__)
2638 printf("Dim Screen\n");
2641 ACT_FN_GO_ACPI(undim_screen, __UNUSED__)
2643 printf("Undim Screen\n");
2646 /* local subsystem globals */
2647 static Eina_Hash *actions = NULL;
2648 static Eina_List *action_list = NULL;
2649 static Eina_List *action_names = NULL;
2650 static Eina_List *action_groups = NULL;
2652 /* externally accessible functions */
2655 e_actions_init(void)
2659 actions = eina_hash_string_superfast_new(NULL);
2660 ACT_GO(window_move);
2661 e_action_predef_name_set(N_("Window : Actions"), N_("Move"),
2662 "window_move", NULL, NULL, 0);
2664 ACT_GO_MOUSE(window_move);
2665 ACT_GO_SIGNAL(window_move);
2666 ACT_END(window_move);
2667 ACT_END_MOUSE(window_move);
2668 ACT_GO_KEY(window_move);
2671 ACT_GO(window_resize);
2672 e_action_predef_name_set(N_("Window : Actions"), N_("Resize"),
2673 "window_resize", NULL, NULL, 0);
2675 ACT_GO_MOUSE(window_resize);
2676 ACT_GO_SIGNAL(window_resize);
2677 ACT_END(window_resize);
2678 ACT_END_MOUSE(window_resize);
2679 ACT_GO_KEY(window_resize);
2682 ACT_GO(window_menu);
2683 e_action_predef_name_set(N_("Menu"), N_("Window Menu"),
2684 "window_menu", NULL, NULL, 0);
2686 ACT_GO_MOUSE(window_menu);
2687 ACT_GO_KEY(window_menu);
2690 ACT_GO(window_raise);
2691 e_action_predef_name_set(N_("Window : Actions"), N_("Raise"),
2692 "window_raise", NULL, NULL, 0);
2695 ACT_GO(window_lower);
2696 e_action_predef_name_set(N_("Window : Actions"), N_("Lower"),
2697 "window_lower", NULL, NULL, 0);
2700 ACT_GO(window_close);
2701 e_action_predef_name_set(N_("Window : Actions"), N_("Close"),
2702 "window_close", NULL, NULL, 0);
2705 ACT_GO(window_kill);
2706 e_action_predef_name_set(N_("Window : Actions"), N_("Kill"),
2707 "window_kill", NULL, NULL, 0);
2709 /* window_sticky_toggle */
2710 ACT_GO(window_sticky_toggle);
2711 e_action_predef_name_set(N_("Window : State"), N_("Sticky Mode Toggle"),
2712 "window_sticky_toggle", NULL, NULL, 0);
2714 ACT_GO(window_sticky);
2716 /* window_iconic_toggle */
2717 ACT_GO(window_iconic_toggle);
2718 e_action_predef_name_set(N_("Window : State"), N_("Iconic Mode Toggle"),
2719 "window_iconic_toggle", NULL, NULL, 0);
2721 ACT_GO(window_iconic);
2723 /* window_fullscreen_toggle */
2724 ACT_GO(window_fullscreen_toggle);
2725 e_action_predef_name_set(N_("Window : State"), N_("Fullscreen Mode Toggle"),
2726 "window_fullscreen_toggle", NULL, NULL, 0);
2728 ACT_GO(window_fullscreen);
2730 /* window_maximized_toggle */
2731 ACT_GO(window_maximized_toggle);
2732 e_action_predef_name_set(N_("Window : State"), N_("Maximize"),
2733 "window_maximized_toggle", NULL, NULL, 0);
2734 e_action_predef_name_set(N_("Window : State"), N_("Maximize Vertically"),
2735 "window_maximized_toggle", "default vertical",
2737 e_action_predef_name_set(N_("Window : State"), N_("Maximize Horizontally"),
2738 "window_maximized_toggle", "default horizontal",
2740 e_action_predef_name_set(N_("Window : State"), N_("Maximize Fullscreen"),
2741 "window_maximized_toggle", "fullscreen", NULL, 0);
2742 e_action_predef_name_set(N_("Window : State"), N_("Maximize Mode \"Smart\""),
2743 "window_maximized_toggle", "smart", NULL, 0);
2744 e_action_predef_name_set(N_("Window : State"), N_("Maximize Mode \"Expand\""),
2745 "window_maximized_toggle", "expand", NULL, 0);
2746 e_action_predef_name_set(N_("Window : State"), N_("Maximize Mode \"Fill\""),
2747 "window_maximized_toggle", "fill", NULL, 0);
2749 ACT_GO(window_maximized);
2751 /* window_shaded_toggle */
2752 ACT_GO(window_shaded_toggle);
2753 e_action_predef_name_set(N_("Window : State"), N_("Shade Up Mode Toggle"),
2754 "window_shaded_toggle", "up", NULL, 0);
2755 e_action_predef_name_set(N_("Window : State"), N_("Shade Down Mode Toggle"),
2756 "window_shaded_toggle", "down", NULL, 0);
2757 e_action_predef_name_set(N_("Window : State"), N_("Shade Left Mode Toggle"),
2758 "window_shaded_toggle", "left", NULL, 0);
2759 e_action_predef_name_set(N_("Window : State"), N_("Shade Right Mode Toggle"),
2760 "window_shaded_toggle", "right", NULL, 0);
2761 e_action_predef_name_set(N_("Window : State"), N_("Shade Mode Toggle"),
2762 "window_shaded_toggle", NULL, NULL, 0);
2764 ACT_GO(window_shaded);
2766 /* window_borderless_toggle */
2767 ACT_GO(window_borderless_toggle);
2768 e_action_predef_name_set(N_("Window : State"), N_("Toggle Borderless State"),
2769 "window_borderless_toggle", NULL, NULL, 0);
2771 /* window_border_set */
2772 ACT_GO(window_border_set);
2773 e_action_predef_name_set(N_("Window : State"), N_("Set Border"),
2774 "window_border_set", NULL,
2775 "syntax: BorderName, example: pixel", 1);
2777 /* window_border_cycle */
2778 ACT_GO(window_border_cycle);
2779 e_action_predef_name_set(N_("Window : State"), N_("Cycle between Borders"),
2780 "window_border_cycle", NULL,
2781 "syntax: BorderNames, example: default pixel", 1);
2783 /* window_pinned_toggle */
2784 ACT_GO(window_pinned_toggle);
2785 e_action_predef_name_set(N_("Window : State"), N_("Toggle Pinned State"),
2786 "window_pinned_toggle", NULL, NULL, 0);
2789 ACT_GO(desk_flip_by);
2790 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Left"),
2791 "desk_flip_by", "-1 0", NULL, 0);
2792 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Right"),
2793 "desk_flip_by", "1 0", NULL, 0);
2794 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Up"),
2795 "desk_flip_by", "0 -1", NULL, 0);
2796 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Down"),
2797 "desk_flip_by", "0 1", NULL, 0);
2798 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop By..."),
2799 "desk_flip_by", NULL,
2800 "syntax: X-offset Y-offset, example: -1 0", 1);
2802 /* desk_deskshow_toggle */
2803 ACT_GO(desk_deskshow_toggle);
2804 e_action_predef_name_set(N_("Desktop"), N_("Show The Desktop"),
2805 "desk_deskshow_toggle", NULL, NULL, 0);
2809 ACT_GO_EDGE(shelf_show);
2810 e_action_predef_name_set(N_("Desktop"), N_("Show The Shelf"), "shelf_show",
2811 NULL, "shelf name glob: Shelf-* ", 1);
2813 /* desk_linear_flip_to */
2814 ACT_GO(desk_flip_to);
2815 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop To..."),
2816 "desk_flip_to", NULL,
2817 "syntax: X Y, example: 1 2", 1);
2819 /* desk_linear_flip_by */
2820 ACT_GO(desk_linear_flip_by);
2821 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Linearly..."),
2822 "desk_linear_flip_by",
2823 NULL, "syntax: N-offset, example: -2", 1);
2825 /* desk_linear_flip_to */
2826 ACT_GO(desk_linear_flip_to);
2827 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 0"),
2828 "desk_linear_flip_to", "0", NULL, 0);
2829 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 1"),
2830 "desk_linear_flip_to", "1", NULL, 0);
2831 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 2"),
2832 "desk_linear_flip_to", "2", NULL, 0);
2833 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 3"),
2834 "desk_linear_flip_to", "3", NULL, 0);
2835 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 4"),
2836 "desk_linear_flip_to", "4", NULL, 0);
2837 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 5"),
2838 "desk_linear_flip_to", "5", NULL, 0);
2839 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 6"),
2840 "desk_linear_flip_to", "6", NULL, 0);
2841 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 7"),
2842 "desk_linear_flip_to", "7", NULL, 0);
2843 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 8"),
2844 "desk_linear_flip_to", "8", NULL, 0);
2845 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 9"),
2846 "desk_linear_flip_to", "9", NULL, 0);
2847 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 10"),
2848 "desk_linear_flip_to", "10", NULL, 0);
2849 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 11"),
2850 "desk_linear_flip_to", "11", NULL, 0);
2851 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop..."),
2852 "desk_linear_flip_to", NULL,
2853 "syntax: N, example: 1", 1);
2855 /* desk_flip_by_all */
2856 ACT_GO(desk_flip_by_all);
2857 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Left (All Screens)"),
2858 "desk_flip_by_all", "-1 0", NULL, 0);
2859 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Right (All Screens)"),
2860 "desk_flip_by_all", "1 0", NULL, 0);
2861 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Up (All Screens)"),
2862 "desk_flip_by_all", "0 -1", NULL, 0);
2863 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Down (All Screens)"),
2864 "desk_flip_by_all", "0 1", NULL, 0);
2865 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop By... (All Screens)"),
2866 "desk_flip_by_all", NULL,
2867 "syntax: X-offset Y-offset, example: -1 0", 1);
2869 /* desk_flip_to_all */
2870 ACT_GO(desk_flip_to_all);
2871 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop To... (All Screens)"),
2872 "desk_flip_to_all", NULL,
2873 "syntax: X Y, example: 1 2", 1);
2875 /* desk_linear_flip_by_all */
2876 ACT_GO(desk_linear_flip_by_all);
2877 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop Linearly... (All Screens)"),
2878 "desk_linear_flip_by_all",
2879 NULL, "syntax: N-offset, example: -2", 1);
2881 /* desk_flip_in_direction */
2882 ACT_GO_EDGE(desk_flip_in_direction);
2883 e_action_predef_name_set(N_("Desktop"), N_("Flip Desktop In Direction..."),
2884 "desk_flip_in_direction", NULL, "syntax: N-pixel-offset, example: 25", 1);
2886 /* desk_linear_flip_to_all */
2887 ACT_GO(desk_linear_flip_to_all);
2888 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 0 (All Screens)"),
2889 "desk_linear_flip_to_all", "0", NULL, 0);
2890 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 1 (All Screens)"),
2891 "desk_linear_flip_to_all", "1", NULL, 0);
2892 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 2 (All Screens)"),
2893 "desk_linear_flip_to_all", "2", NULL, 0);
2894 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 3 (All Screens)"),
2895 "desk_linear_flip_to_all", "3", NULL, 0);
2896 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 4 (All Screens)"),
2897 "desk_linear_flip_to_all", "4", NULL, 0);
2898 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 5 (All Screens)"),
2899 "desk_linear_flip_to_all", "5", NULL, 0);
2900 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 6 (All Screens)"),
2901 "desk_linear_flip_to_all", "6", NULL, 0);
2902 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 7 (All Screens)"),
2903 "desk_linear_flip_to_all", "7", NULL, 0);
2904 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 8 (All Screens)"),
2905 "desk_linear_flip_to_all", "8", NULL, 0);
2906 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 9 (All Screens)"),
2907 "desk_linear_flip_to_all", "9", NULL, 0);
2908 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 10 (All Screens)"),
2909 "desk_linear_flip_to_all", "10", NULL, 0);
2910 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop 11 (All Screens)"),
2911 "desk_linear_flip_to_all", "11", NULL, 0);
2912 e_action_predef_name_set(N_("Desktop"), N_("Switch To Desktop... (All Screens)"),
2913 "desk_linear_flip_to_all", NULL,
2914 "syntax: N, example: 1", 1);
2916 /* screen_send_to */
2917 ACT_GO(screen_send_to);
2918 e_action_predef_name_set(N_("Screen"), N_("Send Mouse To Screen 0"),
2919 "screen_send_to", "0", NULL, 0);
2920 e_action_predef_name_set(N_("Screen"), N_("Send Mouse To Screen 1"),
2921 "screen_send_to", "1", NULL, 0);
2922 e_action_predef_name_set(N_("Screen"), N_("Send Mouse To Screen..."),
2923 "screen_send_to", NULL,
2924 "syntax: N, example: 0", 1);
2926 /* screen_send_by */
2927 ACT_GO(screen_send_by);
2928 e_action_predef_name_set(N_("Screen"), N_("Send Mouse Forward 1 Screen"),
2929 "screen_send_by", "1", NULL, 0);
2930 e_action_predef_name_set(N_("Screen"), N_("Send Mouse Back 1 Screen"),
2931 "screen_send_by", "-1", NULL, 0);
2932 e_action_predef_name_set(N_("Screen"), N_("Send Mouse Forward/Back Screens..."),
2933 "screen_send_by", NULL,
2934 "syntax: N-offset, example: -2", 1);
2936 /* window_move_to_center */
2937 ACT_GO(window_move_to_center);
2938 e_action_predef_name_set(N_("Window : Actions"), N_("Move To Center"),
2939 "window_move_to_center", NULL, NULL, 0);
2940 /* window_move_to */
2941 ACT_GO(window_move_to);
2942 e_action_predef_name_set(N_("Window : Actions"), N_("Move To..."),
2943 "window_move_to", NULL,
2944 "syntax: [+,-]X [+,-]Y or * [+,-]Y or [+,-]X *, example: -1 +1", 1);
2945 /* window_move_by */
2946 ACT_GO(window_move_by);
2947 e_action_predef_name_set(N_("Window : Actions"), N_("Move By..."),
2948 "window_move_by", NULL,
2949 "syntax: X-offset Y-offset, example: -1 0", 1);
2951 /* window_resize_by */
2952 ACT_GO(window_resize_by);
2953 e_action_predef_name_set(N_("Window : Actions"), N_("Resize By..."),
2954 "window_resize_by", NULL,
2955 "syntax: W H, example: 100 150", 1);
2958 ACT_GO(window_push);
2959 e_action_predef_name_set(N_("Window : Actions"), N_("Push in Direction..."),
2960 "window_push", NULL,
2961 "syntax: direction, example: up, down, left, right, up-left, up-right, down-left, down-right", 1);
2963 /* window_drag_icon */
2964 ACT_GO(window_drag_icon);
2965 e_action_predef_name_set(N_("Window : Actions"), N_("Drag Icon..."),
2966 "window_drag_icon", NULL, NULL, 0);
2968 /* window_desk_move_by */
2969 ACT_GO(window_desk_move_by);
2970 e_action_predef_name_set(N_("Window : Moving"), N_("To Next Desktop"),
2971 "window_desk_move_by", "1 0", NULL, 0);
2972 e_action_predef_name_set(N_("Window : Moving"), N_("To Previous Desktop"),
2973 "window_desk_move_by", "-1 0", NULL, 0);
2974 e_action_predef_name_set(N_("Window : Moving"), N_("By Desktop #..."),
2975 "window_desk_move_by", NULL,
2976 "syntax: X-offset Y-offset, example: -2 2", 1);
2978 /* window_desk_move_to */
2979 ACT_GO(window_desk_move_to);
2980 e_action_predef_name_set(N_("Window : Moving"), N_("To Desktop..."),
2981 "window_desk_move_to", NULL,
2982 "syntax: X Y, example: 0 1", 1);
2986 e_action_predef_name_set(N_("Menu"), N_("Show Main Menu"),
2987 "menu_show", "main", NULL, 0);
2988 e_action_predef_name_set(N_("Menu"), N_("Show Favorites Menu"), "menu_show",
2989 "favorites", NULL, 0);
2990 e_action_predef_name_set(N_("Menu"), N_("Show All Applications Menu"),
2991 "menu_show", "all", NULL, 0);
2992 e_action_predef_name_set(N_("Menu"), N_("Show Clients Menu"), "menu_show",
2993 "clients", NULL, 0);
2994 e_action_predef_name_set(N_("Menu"), N_("Show Menu..."), "menu_show", NULL,
2995 "syntax: MenuName, example: MyMenu", 1);
2996 ACT_GO_MOUSE(menu_show);
2997 ACT_GO_KEY(menu_show);
3001 e_action_predef_name_set(N_("Launch"), N_("Command"), "exec", NULL,
3002 "syntax: CommandName, example: /usr/bin/xmms", 1);
3006 e_action_predef_name_set(N_("Launch"), N_("Application"), "app", NULL,
3007 "syntax: , example:", 1);
3010 e_action_predef_name_set(N_("Enlightenment"), N_("Restart"), "restart",
3014 e_action_predef_name_set(N_("Enlightenment"), N_("Exit"), "exit",
3018 e_action_predef_name_set(N_("Enlightenment"), N_("Exit Now"),
3019 "exit_now", NULL, NULL, 0);
3021 ACT_GO(mode_presentation_toggle);
3022 e_action_predef_name_set(N_("Enlightenment : Mode"),
3023 N_("Presentation Mode Toggle"),
3024 "mode_presentation_toggle", NULL, NULL, 0);
3026 ACT_GO(mode_offline_toggle);
3027 e_action_predef_name_set(N_("Enlightenment : Mode"),
3028 N_("Offline Mode Toggle"),
3029 "mode_offline_toggle", NULL, NULL, 0);
3032 e_action_predef_name_set(N_("System"), N_("Log Out"), "logout",
3036 e_action_predef_name_set(N_("System"), N_("Power Off Now"),
3037 "halt_now", NULL, NULL, 0);
3040 e_action_predef_name_set(N_("System"), N_("Power Off"), "halt",
3044 e_action_predef_name_set(N_("System"), N_("Reboot"), "reboot",
3047 ACT_GO(suspend_now);
3048 e_action_predef_name_set(N_("System"), N_("Suspend Now"), "suspend_now",
3052 e_action_predef_name_set(N_("System"), N_("Suspend"), "suspend",
3056 e_action_predef_name_set(N_("System"), N_("Hibernate"), "hibernate",
3059 ACT_GO(pointer_resize_push);
3060 ACT_GO(pointer_resize_pop);
3064 e_action_predef_name_set(N_("Desktop"), N_("Lock"), "desk_lock",
3067 /* cleanup_windows */
3068 ACT_GO(cleanup_windows);
3069 e_action_predef_name_set(N_("Desktop"), N_("Cleanup Windows"),
3070 "cleanup_windows", NULL, NULL, 0);
3072 /* delayed_action */
3073 ACT_GO_KEY(delayed_action);
3074 e_action_predef_name_set(N_("Generic : Actions"), N_("Delayed Action"),
3075 "delayed_action", NULL, "[0.0 exec xterm] [0.3 exec xev]", 1);
3076 ACT_GO_MOUSE(delayed_action);
3077 ACT_END_KEY(delayed_action);
3078 ACT_END_MOUSE(delayed_action);
3080 ACT_GO_ACPI(dim_screen);
3081 e_action_predef_name_set(N_("Acpi"), N_("Dim Screen"), "dim_screen",
3084 ACT_GO_ACPI(undim_screen);
3085 e_action_predef_name_set(N_("Acpi"), N_("Undim Screen"), "undim_screen",
3092 e_actions_shutdown(void)
3094 e_action_predef_name_all_del();
3096 E_FREE_LIST(action_list, e_object_del);
3098 action_names = eina_list_free(action_names);
3099 eina_hash_free(actions);
3106 e_action_name_list(void)
3108 return action_names;
3112 e_action_add(const char *name)
3116 act = e_action_find(name);
3119 act = E_OBJECT_ALLOC(E_Action, E_ACTION_TYPE, _e_action_free);
3120 if (!act) return NULL;
3122 eina_hash_direct_add(actions, act->name, act);
3123 action_names = eina_list_append(action_names, name);
3124 action_list = eina_list_append(action_list, act);
3130 e_action_del(const char *name)
3134 act = eina_hash_find(actions, name);
3135 if (act) _e_action_free(act);
3139 e_action_find(const char *name)
3143 act = eina_hash_find(actions, name);
3148 e_action_predef_label_get(const char *action, const char *params)
3150 E_Action_Group *actg = NULL;
3151 E_Action_Description *actd = NULL;
3154 EINA_LIST_FOREACH(action_groups, l, actg)
3156 EINA_LIST_FOREACH(actg->acts, l2, actd)
3158 if (!strcmp(actd->act_cmd, action))
3160 if ((params) && (actd->act_params))
3162 if (!strcmp(params, actd->act_params))
3163 return actd->act_name;
3165 else return actd->act_name;
3169 if (params) return e_action_predef_label_get(action, NULL);
3174 e_action_predef_name_set(const char *act_grp, const char *act_name, const char *act_cmd, const char *act_params, const char *param_example, int editable)
3176 E_Action_Group *actg = NULL;
3177 E_Action_Description *actd = NULL;
3180 if ((!act_grp) || (!act_name)) return;
3182 EINA_LIST_FOREACH(action_groups, l, actg)
3184 if (!strcmp(actg->act_grp, act_grp)) break;
3190 actg = E_NEW(E_Action_Group, 1);
3193 actg->act_grp = eina_stringshare_add(act_grp);
3196 action_groups = eina_list_append(action_groups, actg);
3198 eina_list_sort(action_groups, -1, _action_groups_sort_cb);
3201 EINA_LIST_FOREACH(actg->acts, l, actd)
3203 if (!strcmp(actd->act_name, act_name)) break;
3209 actd = E_NEW(E_Action_Description, 1);
3212 actd->act_name = eina_stringshare_add(act_name);
3213 actd->act_cmd = !act_cmd ? NULL : eina_stringshare_add(act_cmd);
3214 actd->act_params = !act_params ? NULL : eina_stringshare_add(act_params);
3215 actd->param_example = !param_example ? NULL : eina_stringshare_add(param_example);
3216 actd->editable = editable;
3218 actg->acts = eina_list_append(actg->acts, actd);
3222 e_action_predef_name_del(const char *act_grp, const char *act_name)
3224 E_Action_Group *actg = NULL;
3225 E_Action_Description *actd = NULL;
3228 EINA_LIST_FOREACH(action_groups, l, actg)
3230 if (!strcmp(actg->act_grp, act_grp)) break;
3236 EINA_LIST_FOREACH(actg->acts, l, actd)
3238 if (!strcmp(actd->act_name, act_name))
3240 actg->acts = eina_list_remove(actg->acts, actd);
3242 if (actd->act_name) eina_stringshare_del(actd->act_name);
3243 if (actd->act_cmd) eina_stringshare_del(actd->act_cmd);
3244 if (actd->act_params) eina_stringshare_del(actd->act_params);
3245 if (actd->param_example) eina_stringshare_del(actd->param_example);
3249 if (!eina_list_count(actg->acts))
3251 action_groups = eina_list_remove(action_groups, actg);
3252 if (actg->act_grp) eina_stringshare_del(actg->act_grp);
3261 e_action_predef_name_all_del(void)
3263 E_Action_Group *actg = NULL;
3264 E_Action_Description *actd = NULL;
3266 EINA_LIST_FREE(action_groups, actg)
3268 EINA_LIST_FREE(actg->acts, actd)
3270 if (actd->act_name) eina_stringshare_del(actd->act_name);
3271 if (actd->act_cmd) eina_stringshare_del(actd->act_cmd);
3272 if (actd->act_params) eina_stringshare_del(actd->act_params);
3273 if (actd->param_example) eina_stringshare_del(actd->param_example);
3277 if (actg->act_grp) eina_stringshare_del(actg->act_grp);
3280 action_groups = NULL;
3284 e_action_groups_get(void)
3286 return action_groups;
3289 /* local subsystem functions */
3292 _e_action_free(E_Action *act)
3294 eina_hash_del(actions, act->name, act);
3295 action_names = eina_list_remove(action_names, act->name);
3296 action_list = eina_list_remove(action_list, act);
3301 _e_actions_maximize_parse(const char *params)
3305 char s1[32], s2[32];
3307 if (!params) return e_config->maximize_policy;
3308 ret = sscanf(params, "%20s %20s", s1, s2);
3311 if (!strcmp(s2, "horizontal"))
3312 max = E_MAXIMIZE_HORIZONTAL;
3313 else if (!strcmp(s2, "vertical"))
3314 max = E_MAXIMIZE_VERTICAL;
3316 max = E_MAXIMIZE_BOTH;
3320 if (!strcmp(s1, "fullscreen"))
3321 max |= E_MAXIMIZE_FULLSCREEN;
3322 else if (!strcmp(s1, "smart"))
3323 max |= E_MAXIMIZE_SMART;
3324 else if (!strcmp(s1, "expand"))
3325 max |= E_MAXIMIZE_EXPAND;
3326 else if (!strcmp(s1, "fill"))
3327 max |= E_MAXIMIZE_FILL;
3329 max |= (e_config->maximize_policy & E_MAXIMIZE_TYPE);
3332 max = e_config->maximize_policy;
3337 _action_groups_sort_cb(const void *d1, const void *d2)
3339 const E_Action_Group *g1, *g2;
3341 if (!(g1 = d1)) return 1;
3342 if (!(g2 = d2)) return -1;
3343 return strcmp(g1->act_grp, g2->act_grp);