]> Dogcows Code - chaz/openbox/blob - openbox/action.h
move config option loading for the kernel into config.c/h
[chaz/openbox] / 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 Move {
52 Client *c;
53 int x;
54 int y;
55 gboolean final;
56 };
57
58 struct Resize {
59 Client *c;
60 int x;
61 int y;
62 gboolean final;
63 Corner corner;
64 };
65
66 struct ShowMenu {
67 Client *c;
68 char *menuName;
69 };
70
71 struct CycleWindows {
72 Client *c;
73 gboolean linear;
74 gboolean forward;
75 gboolean final;
76 gboolean cancel;
77 };
78
79 union ActionData {
80 struct AnyAction any;
81 struct Execute execute;
82 struct ClientAction client;
83 struct MoveResizeRelative relative;
84 struct SendToDesktop sendto;
85 struct SendToNextPreviousDesktop sendtonextprev;
86 struct Desktop desktop;
87 struct NextPreviousDesktop nextprevdesktop;
88 struct Move move;
89 struct Resize resize;
90 struct ShowMenu showMenu;
91 struct CycleWindows cycle;
92 };
93
94 typedef struct {
95 /* The func member acts like an enum to tell which one of the structs in
96 the data union are valid.
97 */
98 void (*func)(union ActionData *data);
99 union ActionData data;
100 } Action;
101
102 Action *action_new(void (*func)(union ActionData *data));
103
104 /* Creates a new Action from the name of the action
105 A few action types need data set after making this call still. Check if
106 the returned action's "func" is one of these.
107 action_execute - the path needs to be set
108 action_restart - the path can optionally be set
109 action_desktop - the destination desktop needs to be set
110 action_move_relative_horz - the delta
111 action_move_relative_vert - the delta
112 action_resize_relative_horz - the delta
113 action_resize_relative_vert - the delta
114 */
115 Action *action_from_string(char *name);
116 void action_free(Action *a);
117
118 /* Execute */
119 void action_execute(union ActionData *data);
120 /* ClientAction */
121 void action_focus(union ActionData *data);
122 /* ClientAction */
123 void action_unfocus(union ActionData *data);
124 /* ClientAction */
125 void action_iconify(union ActionData *data);
126 /* ClientAction */
127 void action_raise(union ActionData *data);
128 /* ClientAction */
129 void action_lower(union ActionData *data);
130 /* ClientAction */
131 void action_focusraise(union ActionData *data);
132 /* ClientAction */
133 void action_close(union ActionData *data);
134 /* ClientAction */
135 void action_kill(union ActionData *data);
136 /* ClientAction */
137 void action_shade(union ActionData *data);
138 /* ClientAction */
139 void action_shadelower(union ActionData *data);
140 /* ClientAction */
141 void action_unshaderaise(union ActionData *data);
142 /* ClientAction */
143 void action_unshade(union ActionData *data);
144 /* ClientAction */
145 void action_toggle_shade(union ActionData *data);
146 /* ClientAction */
147 void action_toggle_omnipresent(union ActionData *data);
148 /* MoveResizeRelative */
149 void action_move_relative_horz(union ActionData *data);
150 /* MoveResizeRelative */
151 void action_move_relative_vert(union ActionData *data);
152 /* MoveResizeRelative */
153 void action_resize_relative_horz(union ActionData *data);
154 /* MoveResizeRelative */
155 void action_resize_relative_vert(union ActionData *data);
156 /* ClientAction */
157 void action_maximize_full(union ActionData *data);
158 /* ClientAction */
159 void action_unmaximize_full(union ActionData *data);
160 /* ClientAction */
161 void action_toggle_maximize_full(union ActionData *data);
162 /* ClientAction */
163 void action_maximize_horz(union ActionData *data);
164 /* ClientAction */
165 void action_unmaximize_horz(union ActionData *data);
166 /* ClientAction */
167 void action_toggle_maximize_horz(union ActionData *data);
168 /* ClientAction */
169 void action_maximize_vert(union ActionData *data);
170 /* ClientAction */
171 void action_unmaximize_vert(union ActionData *data);
172 /* ClientAction */
173 void action_toggle_maximize_vert(union ActionData *data);
174 /* SendToDesktop */
175 void action_send_to_desktop(union ActionData *data);
176 /* SendToNextPreviousDesktop */
177 void action_send_to_next_desktop(union ActionData *data);
178 /* SendToNextPreviousDesktop */
179 void action_send_to_previous_desktop(union ActionData *data);
180 /* Desktop */
181 void action_desktop(union ActionData *data);
182 /* NextPreviousDesktop */
183 void action_next_desktop(union ActionData *data);
184 /* NextPreviousDesktop */
185 void action_previous_desktop(union ActionData *data);
186 /* NextPreviousDesktop */
187 void action_next_desktop_column(union ActionData *data);
188 /* NextPreviousDesktop */
189 void action_previous_desktop_column(union ActionData *data);
190 /* NextPreviousDesktop */
191 void action_next_desktop_row(union ActionData *data);
192 /* NextPreviousDesktop */
193 void action_previous_desktop_row(union ActionData *data);
194 /* ClientAction */
195 void action_toggle_decorations(union ActionData *data);
196 /* Move */
197 void action_move(union ActionData *data);
198 /* Resize */
199 void action_resize(union ActionData *data);
200 /* Execute */
201 void action_restart(union ActionData *data);
202 /* Any */
203 void action_exit(union ActionData *data);
204 /* ShowMenu */
205 void action_showmenu(union ActionData *data);
206 /* CycleWindows */
207 void action_cycle_windows(union ActionData *data);
208 #endif
This page took 0.04555 seconds and 4 git commands to generate.