2 Copyright 2013 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef LAYER_SWITCH_H
18 #define LAYER_SWITCH_H
25 /* overlays are asigned at layer 16-31 */
26 #define OVERLAY_BIT 0x10
27 #define OVERLAY_MASK 0x0F
33 /* base layer to fall back */
34 extern uint8_t default_layer;
35 void default_layer_set(uint8_t layer);
41 #ifndef NO_ACTION_KEYMAP
42 extern uint16_t keymap_stat;
43 /* return current active layer */
44 uint8_t keymap_get_layer(void);
45 void keymap_clear(void);
46 void keymap_set(uint16_t stat);
47 void keymap_move(uint8_t layer);
48 void keymap_on(uint8_t layer);
49 void keymap_off(uint8_t layer);
50 void keymap_invert(uint8_t layer);
51 /* bitwise operation */
52 void keymap_or(uint16_t stat);
53 void keymap_and(uint16_t stat);
54 void keymap_xor(uint16_t stat);
55 void keymap_debug(void);
58 #define keymap_get_layer()
59 #define keymap_clear()
60 #define keymap_set(stat)
61 #define keymap_move(layer)
62 #define keymap_on(layer)
63 #define keymap_off(layer)
64 #define keymap_invert(layer)
65 #define keymap_or(stat)
66 #define keymap_and(stat)
67 #define keymap_xor(stat)
68 #define keymap_debug()
75 #ifndef NO_ACTION_OVERLAY
76 extern uint16_t overlay_stat;
77 /* return current active layer */
78 uint8_t overlay_get_layer(void);
79 void overlay_clear(void);
80 void overlay_set(uint16_t stat);
81 void overlay_move(uint8_t layer);
82 void overlay_on(uint8_t layer);
83 void overlay_off(uint8_t layer);
84 void overlay_invert(uint8_t layer);
85 /* bitwise operation */
86 void overlay_or(uint16_t stat);
87 void overlay_and(uint16_t stat);
88 void overlay_xor(uint16_t stat);
89 void overlay_debug(void);
91 #define overlay_stat 0
92 #define overlay_get_layer()
93 #define overlay_clear()
94 #define overlay_set(stat)
95 #define overlay_move(layer)
96 #define overlay_on(layer)
97 #define overlay_off(layer)
98 #define overlay_invert(layer)
99 #define overlay_or(stat)
100 #define overlay_and(stat)
101 #define overlay_xor(stat)
102 #define overlay_debug()
107 /* return action depending on current layer status */
108 action_t layer_switch_get_action(key_t key);