]> icculus.org git repositories - mikachu/openbox.git/blob - openbox/action.c
add the "if" action
[mikachu/openbox.git] / openbox / action.c
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    action.c for the Openbox window manager
4    Copyright (c) 2006        Mikael Magnusson
5    Copyright (c) 2003-2007   Dana Jansens
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    See the COPYING file for a copy of the GNU General Public License.
18 */
19
20 ActionString actionstrings[] =
21 {
22     {
23         "shadelower",
24         action_shadelower,
25         setup_client_action
26     },
27     {
28         "unshaderaise",
29         action_unshaderaise,
30         setup_client_action
31     },
32     {
33         NULL,
34         NULL,
35         NULL
36     }
37 };
38
39 void action_unshaderaise(union ActionData *data)
40 {
41     if (data->client.any.c->shaded)
42         action_unshade(data);
43     else
44         action_raise(data);
45 }
46
47 void action_shadelower(union ActionData *data)
48 {
49     if (data->client.any.c->shaded)
50         action_lower(data);
51     else
52         action_shade(data);
53 }