Libmacro  0.2
Libmacro is an extensible macro and hotkey library.
mod_flags.h
Go to the documentation of this file.
1 /* Libmacro - A multi-platform, extendable macro and hotkey C library
2  Copyright (C) 2013 Jonathan Pelletier, New Paradigm Software
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library 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 GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
23 #ifndef MCR_BASE_MOD_FLAGS_H_
24 #define MCR_BASE_MOD_FLAGS_H_
25 
26 #include "mcr/base/types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
45  /* Alt and option are always the same here. */
46  MCR_ALT = 1,
47  MCR_OPTION = 1,
48  MCR_ALTGR = 1 << 1,
49  MCR_AMIGA = 1 << 2,
50  MCR_CMD = 1 << 3,
51  MCR_CODE = 1 << 4,
52  MCR_COMPOSE = 1 << 5,
53  MCR_CTRL = 1 << 6,
54  MCR_FN = 1 << 7,
55  MCR_FRONT = 1 << 8,
56  MCR_GRAPH = 1 << 9,
57  MCR_HYPER = 1 << 10,
58  MCR_META = 1 << 11,
59  MCR_SHIFT = 1 << 12,
60  MCR_SUPER = 1 << 13,
61  MCR_SYMBOL = 1 << 14,
62  MCR_TOP = 1 << 15,
63  MCR_WIN = 1 << 16,
64  MCR_MF_USER = MCR_WIN << 1
65 };
66 
73 MCR_API unsigned int mcr_ModFlags_combine(const unsigned int *modsArray,
74  size_t length);
81 MCR_API unsigned int mcr_ModFlags_add(unsigned int mods, unsigned int newMod);
88 MCR_API bool mcr_ModFlags_has(unsigned int mods, unsigned int modVal);
95 MCR_API unsigned int mcr_ModFlags_remove(unsigned int mods,
96  unsigned int delMod);
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif
Forward declaration of types.
MCR_API unsigned int mcr_ModFlags_combine(const unsigned int *modsArray, size_t length)
mcr_ModFlags
Definition: mod_flags.h:42
MCR_API unsigned int mcr_ModFlags_add(unsigned int mods, unsigned int newMod)
MCR_API unsigned int mcr_ModFlags_remove(unsigned int mods, unsigned int delMod)
MCR_API bool mcr_ModFlags_has(unsigned int mods, unsigned int modVal)