xref: /aosp_15_r20/external/libxkbcommon/src/text.h (revision 2b949d0487e80d67f1fda82db69e101e761f8064)
1*2b949d04SAndroid Build Coastguard Worker /*
2*2b949d04SAndroid Build Coastguard Worker  * Copyright © 2009 Dan Nicholson
3*2b949d04SAndroid Build Coastguard Worker  *
4*2b949d04SAndroid Build Coastguard Worker  * Permission is hereby granted, free of charge, to any person obtaining a
5*2b949d04SAndroid Build Coastguard Worker  * copy of this software and associated documentation files (the "Software"),
6*2b949d04SAndroid Build Coastguard Worker  * to deal in the Software without restriction, including without limitation
7*2b949d04SAndroid Build Coastguard Worker  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*2b949d04SAndroid Build Coastguard Worker  * and/or sell copies of the Software, and to permit persons to whom the
9*2b949d04SAndroid Build Coastguard Worker  * Software is furnished to do so, subject to the following conditions:
10*2b949d04SAndroid Build Coastguard Worker  *
11*2b949d04SAndroid Build Coastguard Worker  * The above copyright notice and this permission notice (including the next
12*2b949d04SAndroid Build Coastguard Worker  * paragraph) shall be included in all copies or substantial portions of the
13*2b949d04SAndroid Build Coastguard Worker  * Software.
14*2b949d04SAndroid Build Coastguard Worker  *
15*2b949d04SAndroid Build Coastguard Worker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*2b949d04SAndroid Build Coastguard Worker  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*2b949d04SAndroid Build Coastguard Worker  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18*2b949d04SAndroid Build Coastguard Worker  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19*2b949d04SAndroid Build Coastguard Worker  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20*2b949d04SAndroid Build Coastguard Worker  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21*2b949d04SAndroid Build Coastguard Worker  * DEALINGS IN THE SOFTWARE.
22*2b949d04SAndroid Build Coastguard Worker  */
23*2b949d04SAndroid Build Coastguard Worker 
24*2b949d04SAndroid Build Coastguard Worker #ifndef TEXT_H
25*2b949d04SAndroid Build Coastguard Worker #define TEXT_H
26*2b949d04SAndroid Build Coastguard Worker 
27*2b949d04SAndroid Build Coastguard Worker typedef struct {
28*2b949d04SAndroid Build Coastguard Worker     const char *name;
29*2b949d04SAndroid Build Coastguard Worker     unsigned int value;
30*2b949d04SAndroid Build Coastguard Worker } LookupEntry;
31*2b949d04SAndroid Build Coastguard Worker 
32*2b949d04SAndroid Build Coastguard Worker bool
33*2b949d04SAndroid Build Coastguard Worker LookupString(const LookupEntry tab[], const char *string,
34*2b949d04SAndroid Build Coastguard Worker               unsigned int *value_rtrn);
35*2b949d04SAndroid Build Coastguard Worker 
36*2b949d04SAndroid Build Coastguard Worker const char *
37*2b949d04SAndroid Build Coastguard Worker LookupValue(const LookupEntry tab[], unsigned int value);
38*2b949d04SAndroid Build Coastguard Worker 
39*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry ctrlMaskNames[];
40*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry modComponentMaskNames[];
41*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry groupComponentMaskNames[];
42*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry groupMaskNames[];
43*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry groupNames[];
44*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry levelNames[];
45*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry buttonNames[];
46*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry useModMapValueNames[];
47*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry actionTypeNames[];
48*2b949d04SAndroid Build Coastguard Worker extern const LookupEntry symInterpretMatchMaskNames[];
49*2b949d04SAndroid Build Coastguard Worker 
50*2b949d04SAndroid Build Coastguard Worker const char *
51*2b949d04SAndroid Build Coastguard Worker ModMaskText(struct xkb_context *ctx, const struct xkb_mod_set *mods,
52*2b949d04SAndroid Build Coastguard Worker             xkb_mod_mask_t mask);
53*2b949d04SAndroid Build Coastguard Worker 
54*2b949d04SAndroid Build Coastguard Worker const char *
55*2b949d04SAndroid Build Coastguard Worker ModIndexText(struct xkb_context *ctx, const struct xkb_mod_set *mods,
56*2b949d04SAndroid Build Coastguard Worker              xkb_mod_index_t ndx);
57*2b949d04SAndroid Build Coastguard Worker 
58*2b949d04SAndroid Build Coastguard Worker const char *
59*2b949d04SAndroid Build Coastguard Worker ActionTypeText(enum xkb_action_type type);
60*2b949d04SAndroid Build Coastguard Worker 
61*2b949d04SAndroid Build Coastguard Worker const char *
62*2b949d04SAndroid Build Coastguard Worker KeysymText(struct xkb_context *ctx, xkb_keysym_t sym);
63*2b949d04SAndroid Build Coastguard Worker 
64*2b949d04SAndroid Build Coastguard Worker const char *
65*2b949d04SAndroid Build Coastguard Worker KeyNameText(struct xkb_context *ctx, xkb_atom_t name);
66*2b949d04SAndroid Build Coastguard Worker 
67*2b949d04SAndroid Build Coastguard Worker const char *
68*2b949d04SAndroid Build Coastguard Worker SIMatchText(enum xkb_match_operation type);
69*2b949d04SAndroid Build Coastguard Worker 
70*2b949d04SAndroid Build Coastguard Worker const char *
71*2b949d04SAndroid Build Coastguard Worker LedStateMaskText(struct xkb_context *ctx, enum xkb_state_component mask);
72*2b949d04SAndroid Build Coastguard Worker 
73*2b949d04SAndroid Build Coastguard Worker const char *
74*2b949d04SAndroid Build Coastguard Worker ControlMaskText(struct xkb_context *ctx, enum xkb_action_controls mask);
75*2b949d04SAndroid Build Coastguard Worker 
76*2b949d04SAndroid Build Coastguard Worker #endif /* TEXT_H */
77