]> icculus.org git repositories - dana/openbox.git/blob - openbox/actions/decorations.c
Provide operations to get the size of a ObClientSet, and get the clients in it. Also...
[dana/openbox.git] / openbox / actions / decorations.c
1 #include "openbox/action.h"
2 #include "openbox/action_list_run.h"
3 #include "openbox/client.h"
4
5 static gboolean run_func_on(const ObActionListRun *data, gpointer options);
6 static gboolean run_func_off(const ObActionListRun *data, gpointer options);
7 static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
8
9 void action_decorations_startup(void)
10 {
11     action_register("Decorate", OB_ACTION_DEFAULT_FILTER_SINGLE,
12                     NULL, NULL, run_func_on);
13     action_register("Undecorate", OB_ACTION_DEFAULT_FILTER_SINGLE,
14                     NULL, NULL, run_func_off);
15     action_register("ToggleDecorations", OB_ACTION_DEFAULT_FILTER_SINGLE,
16                     NULL, NULL, run_func_toggle);
17 }
18
19 /* Always return FALSE because its not interactive */
20 static gboolean run_func_on(const ObActionListRun *data, gpointer options)
21 {
22     if (data->target) {
23         action_client_move(data, TRUE);
24         client_set_undecorated(data->target, FALSE);
25         action_client_move(data, FALSE);
26     }
27     return FALSE;
28 }
29
30 /* Always return FALSE because its not interactive */
31 static gboolean run_func_off(const ObActionListRun *data, gpointer options)
32 {
33     if (data->target) {
34         action_client_move(data, TRUE);
35         client_set_undecorated(data->target, TRUE);
36         action_client_move(data, FALSE);
37     }
38     return FALSE;
39 }
40
41 /* Always return FALSE because its not interactive */
42 static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
43 {
44     if (data->target) {
45         action_client_move(data, TRUE);
46         client_set_undecorated(data->target, !data->target->undecorated);
47         action_client_move(data, FALSE);
48     }
49     return FALSE;
50 }