]> Dogcows Code - chaz/openbox/blob - openbox/actions/shade.c
Merge branch 'master' into chaz
[chaz/openbox] / openbox / actions / shade.c
1 #include "openbox/actions.h"
2 #include "openbox/client.h"
3
4 static gboolean run_func_on(ObActionsData *data, gpointer options);
5 static gboolean run_func_off(ObActionsData *data, gpointer options);
6 static gboolean run_func_toggle(ObActionsData *data, gpointer options);
7
8 void action_shade_startup(void)
9 {
10 actions_register("Shade", NULL, NULL, run_func_on);
11 actions_register("Unshade", NULL, NULL, run_func_off);
12 actions_register("ToggleShade", NULL, NULL, run_func_toggle);
13 }
14
15 /* Always return FALSE because its not interactive */
16 static gboolean run_func_on(ObActionsData *data, gpointer options)
17 {
18 if (data->client) {
19 actions_client_move(data, TRUE);
20 client_shade(data->client, TRUE);
21 actions_client_move(data, FALSE);
22 }
23 return FALSE;
24 }
25
26 /* Always return FALSE because its not interactive */
27 static gboolean run_func_off(ObActionsData *data, gpointer options)
28 {
29 if (data->client) {
30 actions_client_move(data, TRUE);
31 client_shade(data->client, FALSE);
32 actions_client_move(data, FALSE);
33 }
34 return FALSE;
35 }
36
37 /* Always return FALSE because its not interactive */
38 static gboolean run_func_toggle(ObActionsData *data, gpointer options)
39 {
40 if (data->client) {
41 actions_client_move(data, TRUE);
42 client_shade(data->client, !data->client->shaded);
43 actions_client_move(data, FALSE);
44 }
45 return FALSE;
46 }
This page took 0.045174 seconds and 4 git commands to generate.