]> icculus.org git repositories - mikachu/openbox.git/blob - openbox/action.h
Added a fifo_menu plugin
[mikachu/openbox.git] / openbox / action.h
1 #ifndef __action_h
2 #define __action_h
3
4 #include "client.h"
5
6 /* These have to all have a Client* at the top even if they don't use it, so
7    that I can set it blindly later on. So every function will have a Client*
8    available (possibly NULL though) if it wants it.
9 */
10
11 struct AnyAction {
12     Client *c;
13 };
14
15 struct Execute {
16     Client *c;
17     char *path;
18 };
19
20 struct ClientAction {
21     Client *c;
22 };
23
24 struct MoveResizeRelative {
25     Client *c;
26     int delta;
27 };
28
29 struct SendToDesktop {
30     Client *c;
31     guint desk;
32     gboolean follow;
33 };
34
35 struct SendToNextPreviousDesktop {
36     Client *c;
37     gboolean wrap;
38     gboolean follow;
39 };
40
41 struct Desktop {
42     Client *c;
43     guint desk;
44 };
45
46 struct NextPreviousDesktop {
47     Client *c;
48     gboolean wrap;
49 };
50
51 struct MoveResize {
52     Client *c;
53     int x;
54     int y;
55     guint32 corner; /* prop_atoms.net_wm_moveresize_* */
56     guint button;
57 };
58
59 struct ShowMenu {
60     Client *c;
61     char *name;
62     int x;
63     int y;
64 };
65
66 struct CycleWindows {
67     Client *c;
68     gboolean linear;
69     gboolean forward;
70     gboolean final;
71     gboolean cancel;
72 };
73
74 union ActionData {
75     struct AnyAction any;
76     struct Execute execute;
77     struct ClientAction client;
78     struct MoveResizeRelative relative;
79     struct SendToDesktop sendto;
80     struct SendToNextPreviousDesktop sendtonextprev;
81     struct Desktop desktop;
82     struct NextPreviousDesktop nextprevdesktop;
83     struct MoveResize moveresize;
84     struct ShowMenu showmenu;
85     struct CycleWindows cycle;
86 };
87
88 typedef struct {
89     /* The func member acts like an enum to tell which one of the structs in
90        the data union are valid.
91     */
92     void (*func)(union ActionData *data);
93     union ActionData data;
94 } Action;
95
96 Action *action_new(void (*func)(union ActionData *data));
97
98 /* Creates a new Action from the name of the action
99    A few action types need data set after making this call still. Check if
100    the returned action's "func" is one of these.
101    action_execute - the path needs to be set
102    action_restart - the path can optionally be set
103    action_desktop - the destination desktop needs to be set
104    action_move_relative_horz - the delta
105    action_move_relative_vert - the delta
106    action_resize_relative_horz - the delta
107    action_resize_relative_vert - the delta
108 */
109 Action *action_from_string(char *name);
110 void action_free(Action *a);
111
112 /* Execute */
113 void action_execute(union ActionData *data);
114 /* ClientAction */
115 void action_focus(union ActionData *data);
116 /* ClientAction */
117 void action_unfocus(union ActionData *data);
118 /* ClientAction */
119 void action_iconify(union ActionData *data);
120 /* ClientAction */
121 void action_raise(union ActionData *data);
122 /* ClientAction */
123 void action_lower(union ActionData *data);
124 /* ClientAction */
125 void action_focusraise(union ActionData *data);
126 /* ClientAction */
127 void action_close(union ActionData *data);
128 /* ClientAction */
129 void action_kill(union ActionData *data);
130 /* ClientAction */
131 void action_shade(union ActionData *data);
132 /* ClientAction */
133 void action_shadelower(union ActionData *data);
134 /* ClientAction */
135 void action_unshaderaise(union ActionData *data);
136 /* ClientAction */
137 void action_unshade(union ActionData *data);
138 /* ClientAction */
139 void action_toggle_shade(union ActionData *data);
140 /* ClientAction */
141 void action_toggle_omnipresent(union ActionData *data);
142 /* MoveResizeRelative */
143 void action_move_relative_horz(union ActionData *data);
144 /* MoveResizeRelative */
145 void action_move_relative_vert(union ActionData *data);
146 /* MoveResizeRelative */
147 void action_resize_relative_horz(union ActionData *data);
148 /* MoveResizeRelative */
149 void action_resize_relative_vert(union ActionData *data);
150 /* ClientAction */
151 void action_maximize_full(union ActionData *data);
152 /* ClientAction */
153 void action_unmaximize_full(union ActionData *data);
154 /* ClientAction */
155 void action_toggle_maximize_full(union ActionData *data);
156 /* ClientAction */
157 void action_maximize_horz(union ActionData *data);
158 /* ClientAction */
159 void action_unmaximize_horz(union ActionData *data);
160 /* ClientAction */
161 void action_toggle_maximize_horz(union ActionData *data);
162 /* ClientAction */
163 void action_maximize_vert(union ActionData *data);
164 /* ClientAction */
165 void action_unmaximize_vert(union ActionData *data);
166 /* ClientAction */
167 void action_toggle_maximize_vert(union ActionData *data);
168 /* SendToDesktop */
169 void action_send_to_desktop(union ActionData *data);
170 /* SendToNextPreviousDesktop */
171 void action_send_to_next_desktop(union ActionData *data);
172 /* SendToNextPreviousDesktop */
173 void action_send_to_previous_desktop(union ActionData *data);
174 /* Desktop */
175 void action_desktop(union ActionData *data);
176 /* NextPreviousDesktop */
177 void action_next_desktop(union ActionData *data);
178 /* NextPreviousDesktop */
179 void action_previous_desktop(union ActionData *data);
180 /* NextPreviousDesktop */
181 void action_next_desktop_column(union ActionData *data);
182 /* NextPreviousDesktop */
183 void action_previous_desktop_column(union ActionData *data);
184 /* NextPreviousDesktop */
185 void action_next_desktop_row(union ActionData *data);
186 /* NextPreviousDesktop */
187 void action_previous_desktop_row(union ActionData *data);
188 /* ClientAction */
189 void action_toggle_decorations(union ActionData *data);
190 /* MoveResize */
191 void action_moveresize(union ActionData *data);
192 /* Execute */
193 void action_restart(union ActionData *data);
194 /* Any */
195 void action_exit(union ActionData *data);
196 /* ShowMenu */
197 void action_showmenu(union ActionData *data);
198 /* CycleWindows */
199 void action_cycle_windows(union ActionData *data);
200 #endif