core: Fix for build option NO_ACTION_LAYER
[tmk_keyboard.git] / tmk_core / common / action_layer.h
CommitLineData
a074364c 1/*
2Copyright 2013 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#ifndef ACTION_LAYER_H
18#define ACTION_LAYER_H
19
20#include <stdint.h>
21#include "keyboard.h"
22#include "action.h"
23
24
25/*
26 * Default Layer
27 */
28extern uint32_t default_layer_state;
29void default_layer_debug(void);
30void default_layer_set(uint32_t state);
31
32#ifndef NO_ACTION_LAYER
33/* bitwise operation */
34void default_layer_or(uint32_t state);
35void default_layer_and(uint32_t state);
36void default_layer_xor(uint32_t state);
a074364c 37#endif
38
39
40/*
41 * Keymap Layer
42 */
43#ifndef NO_ACTION_LAYER
44extern uint32_t layer_state;
45void layer_debug(void);
46void layer_clear(void);
47void layer_move(uint8_t layer);
48void layer_on(uint8_t layer);
49void layer_off(uint8_t layer);
50void layer_invert(uint8_t layer);
51/* bitwise operation */
52void layer_or(uint32_t state);
53void layer_and(uint32_t state);
54void layer_xor(uint32_t state);
a074364c 55#endif
56
57
58/* return action depending on current layer status */
ba2883fd 59action_t layer_switch_get_action(keyevent_t key);
a074364c 60
61#endif
Imprint / Impressum