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