2 /* This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 /* ---------------------------- included header files ---------------------- */
22 #include "libs/charmap.h"
23 #include "libs/wcontext.h"
25 /* ---------------------------- local definitions -------------------------- */
27 /* ---------------------------- local macros ------------------------------- */
29 /* ---------------------------- imports ------------------------------------ */
31 /* ---------------------------- included code files ------------------------ */
33 /* ---------------------------- local types -------------------------------- */
35 /* ---------------------------- forward declarations ----------------------- */
37 /* ---------------------------- local variables ---------------------------- */
39 /* ---------------------------- exported variables (globals) --------------- */
41 /* The keys must be in lower case!
42 Put more common contexts toward the front. */
43 charmap_t win_contexts
[] =
61 {'d', C_EWMH_DESKTOP
},
64 {'>', C_F_BOTTOMRIGHT
},
65 {'v', C_F_BOTTOMLEFT
},
76 /* ---------------------------- local functions ---------------------------- */
78 /* ---------------------------- interface functions ------------------------ */
80 /* Converts the input string into a mask with bits for the contexts */
81 int wcontext_string_to_wcontext(char *in_context
, int *out_context_mask
)
85 error
= charmap_string_to_mask(
86 out_context_mask
, in_context
, win_contexts
, "bad context");
91 char wcontext_wcontext_to_char(win_context_t wcontext
)
95 c
= charmap_mask_to_char((int)wcontext
, win_contexts
);
100 win_context_t
wcontext_merge_border_wcontext(win_context_t wcontext
)
102 if (wcontext
& C_FRAME
)
106 if (wcontext
& C_SIDEBAR
)
108 wcontext
|= C_SIDEBAR
;