2009-01-20 08:46:12 -07:00
|
|
|
/*
|
|
|
|
Copyright 1985, 1987, 1990, 1998 The Open Group
|
|
|
|
Copyright 2008 Dan Nicholson
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
|
|
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
Except as contained in this notice, the names of the authors or their
|
|
|
|
institutions shall not be used in advertising or otherwise to promote the
|
|
|
|
sale, use or other dealings in this Software without prior written
|
|
|
|
authorization from the authors.
|
|
|
|
*/
|
|
|
|
|
2010-06-21 07:28:34 -06:00
|
|
|
/************************************************************
|
|
|
|
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this
|
|
|
|
software and its documentation for any purpose and without
|
|
|
|
fee is hereby granted, provided that the above copyright
|
|
|
|
notice appear in all copies and that both that copyright
|
|
|
|
notice and this permission notice appear in supporting
|
|
|
|
documentation, and that the name of Silicon Graphics not be
|
|
|
|
used in advertising or publicity pertaining to distribution
|
|
|
|
of the software without specific prior written permission.
|
|
|
|
Silicon Graphics makes no representation about the suitability
|
|
|
|
of this software for any purpose. It is provided "as is"
|
|
|
|
without any express or implied warranty.
|
|
|
|
|
|
|
|
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
|
|
|
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
|
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
|
|
|
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
|
|
|
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
|
|
|
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
|
|
|
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
|
|
********************************************************/
|
|
|
|
|
|
|
|
|
2009-01-20 08:46:12 -07:00
|
|
|
#ifndef _XKBCOMMON_H_
|
|
|
|
#define _XKBCOMMON_H_
|
|
|
|
|
2010-06-16 17:51:49 -06:00
|
|
|
#include <stdint.h>
|
2009-04-10 13:25:51 -06:00
|
|
|
#include <stdio.h>
|
2009-03-17 07:19:56 -06:00
|
|
|
#include <X11/Xfuncproto.h>
|
2009-04-25 02:13:24 -06:00
|
|
|
#include <X11/extensions/XKBstrcommon.h>
|
|
|
|
#include <X11/extensions/XKBrulescommon.h>
|
2009-03-19 18:16:13 -06:00
|
|
|
|
2009-04-05 16:15:20 -06:00
|
|
|
/* Action structures used in the server */
|
2010-06-16 17:51:49 -06:00
|
|
|
|
|
|
|
#define XkbcAnyActionDataSize 18
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_any_action {
|
2010-06-16 17:51:49 -06:00
|
|
|
unsigned char type;
|
|
|
|
unsigned char pad[XkbcAnyActionDataSize];
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
2010-06-16 17:51:49 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_mod_action {
|
2009-04-05 16:15:20 -06:00
|
|
|
unsigned char type;
|
2010-06-16 17:51:49 -06:00
|
|
|
uint8_t flags;
|
2010-06-23 09:25:02 -06:00
|
|
|
uint8_t real_mods;
|
2010-06-16 17:51:49 -06:00
|
|
|
uint32_t mask;
|
|
|
|
uint32_t vmods;
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
2009-04-05 16:15:20 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_group_action {
|
2009-04-05 16:15:20 -06:00
|
|
|
unsigned char type;
|
|
|
|
unsigned char flags;
|
2010-06-30 14:33:25 -06:00
|
|
|
int16_t group_XXX;
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
2009-04-05 16:15:20 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_iso_action {
|
2009-04-05 16:15:20 -06:00
|
|
|
unsigned char type;
|
2010-06-16 17:51:49 -06:00
|
|
|
uint8_t flags;
|
|
|
|
int16_t group;
|
|
|
|
uint32_t mask;
|
|
|
|
uint32_t vmods;
|
2010-06-23 09:25:02 -06:00
|
|
|
uint8_t real_mods;
|
2010-06-30 11:31:21 -06:00
|
|
|
|
|
|
|
uint8_t affect;
|
|
|
|
};
|
2009-04-05 16:15:20 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_controls_action {
|
2009-04-05 16:15:20 -06:00
|
|
|
unsigned char type;
|
2010-06-23 09:25:02 -06:00
|
|
|
uint8_t flags;
|
2010-06-16 17:51:49 -06:00
|
|
|
uint32_t ctrls;
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
2009-04-05 16:15:20 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_device_button_action {
|
2009-04-05 16:15:20 -06:00
|
|
|
unsigned char type;
|
2010-06-23 09:25:02 -06:00
|
|
|
uint8_t flags;
|
2010-06-16 17:51:49 -06:00
|
|
|
uint16_t device;
|
|
|
|
uint16_t button;
|
|
|
|
uint8_t count;
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
2010-06-16 17:51:49 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_device_valuator_action {
|
2010-06-16 17:51:49 -06:00
|
|
|
unsigned char type;
|
|
|
|
uint8_t v1_what;
|
|
|
|
uint16_t device;
|
|
|
|
uint16_t v1_index;
|
|
|
|
int16_t v1_value;
|
|
|
|
uint16_t v2_index;
|
|
|
|
int16_t v2_value;
|
|
|
|
uint8_t v2_what;
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
2010-06-16 17:51:49 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_pointer_default_action {
|
2010-06-16 17:51:49 -06:00
|
|
|
unsigned char type;
|
|
|
|
uint8_t flags;
|
|
|
|
uint8_t affect;
|
2010-06-30 14:33:25 -06:00
|
|
|
uint8_t valueXXX;
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
2010-06-16 17:51:49 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_switch_screen_action {
|
2010-06-16 17:51:49 -06:00
|
|
|
unsigned char type;
|
|
|
|
uint8_t flags;
|
2010-06-30 14:33:25 -06:00
|
|
|
uint8_t screenXXX;
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
|
|
|
|
2010-06-30 13:48:39 -06:00
|
|
|
struct xkb_redirect_key_action {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char new_key;
|
|
|
|
unsigned char mods_mask;
|
|
|
|
unsigned char mods;
|
|
|
|
unsigned char vmods_mask0;
|
|
|
|
unsigned char vmods_mask1;
|
|
|
|
unsigned char vmods0;
|
|
|
|
unsigned char vmods1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct xkb_pointer_action {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char flags;
|
|
|
|
unsigned char high_XXX;
|
|
|
|
unsigned char low_XXX;
|
|
|
|
unsigned char high_YYY;
|
|
|
|
unsigned char low_YYY;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct xkb_message_action {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char flags;
|
|
|
|
unsigned char message[6];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct xkb_pointer_button_action {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char flags;
|
|
|
|
unsigned char count;
|
|
|
|
unsigned char button;
|
|
|
|
};
|
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
union xkb_action {
|
2010-06-30 13:48:39 -06:00
|
|
|
struct xkb_any_action any;
|
|
|
|
struct xkb_mod_action mods;
|
|
|
|
struct xkb_group_action group;
|
|
|
|
struct xkb_iso_action iso;
|
|
|
|
struct xkb_controls_action ctrls;
|
|
|
|
struct xkb_device_button_action devbtn;
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_device_valuator_action devval;
|
2010-06-30 13:48:39 -06:00
|
|
|
struct xkb_pointer_default_action dflt;
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_switch_screen_action screen;
|
2010-06-30 13:48:39 -06:00
|
|
|
struct xkb_redirect_key_action redirect; /* XXX wholly unnecessary? */
|
|
|
|
struct xkb_pointer_action ptr; /* XXX delete for DeviceValuator */
|
|
|
|
struct xkb_pointer_button_action btn; /* XXX delete for DeviceBtn */
|
|
|
|
struct xkb_message_action msg; /* XXX just delete */
|
|
|
|
unsigned char type;
|
2010-06-30 11:31:21 -06:00
|
|
|
};
|
2009-04-05 16:15:20 -06:00
|
|
|
|
2010-06-23 09:25:10 -06:00
|
|
|
typedef struct _XkbcMods {
|
|
|
|
uint32_t mask; /* effective mods */
|
|
|
|
uint32_t vmods;
|
|
|
|
uint8_t real_mods;
|
|
|
|
} XkbcModsRec, *XkbcModsPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcKTMapEntry {
|
|
|
|
Bool active;
|
|
|
|
uint16_t level;
|
|
|
|
XkbcModsRec mods;
|
|
|
|
} XkbcKTMapEntryRec, *XkbcKTMapEntryPtr;
|
|
|
|
|
2010-06-21 07:28:34 -06:00
|
|
|
typedef struct _XkbcKeyType {
|
2010-06-23 09:25:10 -06:00
|
|
|
XkbcModsRec mods;
|
|
|
|
uint16_t num_levels;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned char map_count;
|
2010-06-23 09:25:10 -06:00
|
|
|
XkbcKTMapEntryPtr map;
|
|
|
|
XkbcModsPtr preserve;
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
|
|
|
uint32_t *level_names;
|
2010-06-21 07:28:34 -06:00
|
|
|
} XkbcKeyTypeRec, *XkbcKeyTypePtr;
|
|
|
|
|
2010-06-16 20:16:09 -06:00
|
|
|
typedef struct _XkbcSymInterpretRec {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t sym;
|
2010-06-16 20:16:09 -06:00
|
|
|
unsigned char flags;
|
|
|
|
unsigned char match;
|
2010-06-23 09:25:02 -06:00
|
|
|
uint8_t mods; /* XXX real or virt? */
|
|
|
|
uint32_t virtual_mod;
|
2010-06-30 11:31:21 -06:00
|
|
|
struct xkb_any_action act;
|
2010-06-21 07:28:34 -06:00
|
|
|
} XkbcSymInterpretRec, *XkbcSymInterpretPtr;
|
2010-06-16 20:16:09 -06:00
|
|
|
|
|
|
|
typedef struct _XkbcCompatMapRec {
|
|
|
|
XkbcSymInterpretPtr sym_interpret;
|
2010-06-23 09:25:10 -06:00
|
|
|
XkbcModsRec groups[XkbNumKbdGroups];
|
2010-06-16 20:16:09 -06:00
|
|
|
unsigned short num_si;
|
|
|
|
unsigned short size_si;
|
|
|
|
} XkbcCompatMapRec, *XkbcCompatMapPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcClientMapRec {
|
|
|
|
unsigned char size_types;
|
|
|
|
unsigned char num_types;
|
2010-06-21 07:28:34 -06:00
|
|
|
XkbcKeyTypePtr types;
|
2010-06-16 20:16:09 -06:00
|
|
|
|
|
|
|
unsigned short size_syms;
|
|
|
|
unsigned short num_syms;
|
|
|
|
uint32_t *syms;
|
|
|
|
XkbSymMapPtr key_sym_map;
|
|
|
|
|
|
|
|
unsigned char *modmap;
|
|
|
|
} XkbcClientMapRec, *XkbcClientMapPtr;
|
|
|
|
|
2009-04-05 16:15:20 -06:00
|
|
|
typedef struct _XkbcServerMapRec {
|
|
|
|
unsigned short num_acts;
|
|
|
|
unsigned short size_acts;
|
|
|
|
|
|
|
|
#if defined(__cplusplus) || defined(c_plusplus)
|
|
|
|
/* explicit is a C++ reserved word */
|
|
|
|
unsigned char * c_explicit;
|
|
|
|
#else
|
|
|
|
unsigned char * explicit;
|
|
|
|
#endif
|
2010-06-16 17:51:49 -06:00
|
|
|
|
2010-06-30 11:31:21 -06:00
|
|
|
union xkb_action *acts;
|
2010-06-16 17:51:49 -06:00
|
|
|
XkbBehavior *behaviors;
|
|
|
|
unsigned short *key_acts;
|
|
|
|
unsigned char *explicits;
|
|
|
|
uint32_t vmods[XkbNumVirtualMods];
|
|
|
|
uint32_t *vmodmap;
|
2009-04-05 16:15:20 -06:00
|
|
|
} XkbcServerMapRec, *XkbcServerMapPtr;
|
|
|
|
|
2010-06-21 07:28:34 -06:00
|
|
|
typedef struct _XkbcNamesRec {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t keycodes;
|
|
|
|
uint32_t geometry;
|
|
|
|
uint32_t symbols;
|
|
|
|
uint32_t types;
|
|
|
|
uint32_t compat;
|
|
|
|
uint32_t vmods[XkbNumVirtualMods];
|
|
|
|
uint32_t indicators[XkbNumIndicators];
|
|
|
|
uint32_t groups[XkbNumKbdGroups];
|
2010-06-21 07:28:34 -06:00
|
|
|
XkbKeyNamePtr keys;
|
|
|
|
XkbKeyAliasPtr key_aliases;
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t *radio_groups;
|
|
|
|
uint32_t phys_symbols;
|
2010-06-21 07:28:34 -06:00
|
|
|
|
|
|
|
unsigned char num_keys;
|
|
|
|
unsigned char num_key_aliases;
|
|
|
|
unsigned short num_rg;
|
|
|
|
} XkbcNamesRec, *XkbcNamesPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcProperty {
|
|
|
|
char *name;
|
|
|
|
char *value;
|
|
|
|
} XkbcPropertyRec, *XkbcPropertyPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcColor {
|
|
|
|
unsigned int pixel;
|
|
|
|
char * spec;
|
|
|
|
} XkbcColorRec, *XkbcColorPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcPoint {
|
|
|
|
short x;
|
|
|
|
short y;
|
|
|
|
} XkbcPointRec, *XkbcPointPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcBounds {
|
|
|
|
short x1,y1;
|
|
|
|
short x2,y2;
|
|
|
|
} XkbcBoundsRec, *XkbcBoundsPtr;
|
|
|
|
#define XkbBoundsWidth(b) (((b)->x2)-((b)->x1))
|
|
|
|
#define XkbBoundsHeight(b) (((b)->y2)-((b)->y1))
|
|
|
|
|
|
|
|
typedef struct _XkbcOutline {
|
|
|
|
unsigned short num_points;
|
|
|
|
unsigned short sz_points;
|
|
|
|
unsigned short corner_radius;
|
|
|
|
XkbcPointPtr points;
|
|
|
|
} XkbcOutlineRec, *XkbcOutlinePtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcShape {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned short num_outlines;
|
|
|
|
unsigned short sz_outlines;
|
|
|
|
XkbcOutlinePtr outlines;
|
|
|
|
XkbcOutlinePtr approx;
|
|
|
|
XkbcOutlinePtr primary;
|
|
|
|
XkbcBoundsRec bounds;
|
|
|
|
} XkbcShapeRec, *XkbcShapePtr;
|
|
|
|
#define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0]))
|
|
|
|
|
|
|
|
typedef struct _XkbcShapeDoodad {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned char type;
|
|
|
|
unsigned char priority;
|
|
|
|
short top;
|
|
|
|
short left;
|
|
|
|
short angle;
|
|
|
|
unsigned short color_ndx;
|
|
|
|
unsigned short shape_ndx;
|
|
|
|
} XkbcShapeDoodadRec, *XkbcShapeDoodadPtr;
|
|
|
|
#define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
|
|
|
|
#define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
|
|
|
|
#define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
|
|
|
|
#define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
|
|
|
|
|
|
|
|
typedef struct _XkbcTextDoodad {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned char type;
|
|
|
|
unsigned char priority;
|
|
|
|
short top;
|
|
|
|
short left;
|
|
|
|
short angle;
|
|
|
|
short width;
|
|
|
|
short height;
|
|
|
|
unsigned short color_ndx;
|
|
|
|
char * text;
|
|
|
|
char * font;
|
|
|
|
} XkbcTextDoodadRec, *XkbcTextDoodadPtr;
|
|
|
|
#define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
|
|
|
|
#define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
|
|
|
|
|
|
|
|
typedef struct _XkbcIndicatorDoodad {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned char type;
|
|
|
|
unsigned char priority;
|
|
|
|
short top;
|
|
|
|
short left;
|
|
|
|
short angle;
|
|
|
|
unsigned short shape_ndx;
|
|
|
|
unsigned short on_color_ndx;
|
|
|
|
unsigned short off_color_ndx;
|
|
|
|
} XkbcIndicatorDoodadRec, *XkbcIndicatorDoodadPtr;
|
|
|
|
#define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
|
|
|
|
#define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx])
|
|
|
|
#define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx])
|
|
|
|
#define XkbSetIndicatorDoodadOnColor(g,d,c) \
|
|
|
|
((d)->on_color_ndx= (c)-&(g)->colors[0])
|
|
|
|
#define XkbSetIndicatorDoodadOffColor(g,d,c) \
|
|
|
|
((d)->off_color_ndx= (c)-&(g)->colors[0])
|
|
|
|
#define XkbSetIndicatorDoodadShape(g,d,s) \
|
|
|
|
((d)->shape_ndx= (s)-&(g)->shapes[0])
|
|
|
|
|
|
|
|
typedef struct _XkbcLogoDoodad {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned char type;
|
|
|
|
unsigned char priority;
|
|
|
|
short top;
|
|
|
|
short left;
|
|
|
|
short angle;
|
|
|
|
unsigned short color_ndx;
|
|
|
|
unsigned short shape_ndx;
|
|
|
|
char * logo_name;
|
|
|
|
} XkbcLogoDoodadRec, *XkbcLogoDoodadPtr;
|
|
|
|
#define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx])
|
|
|
|
#define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx])
|
|
|
|
#define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0])
|
|
|
|
#define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0])
|
|
|
|
|
|
|
|
typedef struct _XkbcAnyDoodad {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned char type;
|
|
|
|
unsigned char priority;
|
|
|
|
short top;
|
|
|
|
short left;
|
|
|
|
short angle;
|
|
|
|
} XkbcAnyDoodadRec, *XkbcAnyDoodadPtr;
|
|
|
|
|
|
|
|
typedef union _XkbcDoodad {
|
|
|
|
XkbcAnyDoodadRec any;
|
|
|
|
XkbcShapeDoodadRec shape;
|
|
|
|
XkbcTextDoodadRec text;
|
|
|
|
XkbcIndicatorDoodadRec indicator;
|
|
|
|
XkbcLogoDoodadRec logo;
|
|
|
|
} XkbcDoodadRec, *XkbcDoodadPtr;
|
|
|
|
|
|
|
|
#define XkbUnknownDoodad 0
|
|
|
|
#define XkbOutlineDoodad 1
|
|
|
|
#define XkbSolidDoodad 2
|
|
|
|
#define XkbTextDoodad 3
|
|
|
|
#define XkbIndicatorDoodad 4
|
|
|
|
#define XkbLogoDoodad 5
|
|
|
|
|
|
|
|
typedef struct _XkbcKey {
|
|
|
|
XkbKeyNameRec name;
|
|
|
|
short gap;
|
|
|
|
unsigned char shape_ndx;
|
|
|
|
unsigned char color_ndx;
|
|
|
|
} XkbcKeyRec, *XkbcKeyPtr;
|
|
|
|
#define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx])
|
|
|
|
#define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx])
|
|
|
|
#define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0])
|
|
|
|
#define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0])
|
|
|
|
|
|
|
|
typedef struct _XkbRow {
|
|
|
|
short top;
|
|
|
|
short left;
|
|
|
|
unsigned short num_keys;
|
|
|
|
unsigned short sz_keys;
|
|
|
|
int vertical;
|
|
|
|
XkbcKeyPtr keys;
|
|
|
|
XkbcBoundsRec bounds;
|
|
|
|
} XkbcRowRec, *XkbcRowPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcSection {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned char priority;
|
|
|
|
short top;
|
|
|
|
short left;
|
|
|
|
unsigned short width;
|
|
|
|
unsigned short height;
|
|
|
|
short angle;
|
|
|
|
unsigned short num_rows;
|
|
|
|
unsigned short num_doodads;
|
|
|
|
unsigned short num_overlays;
|
|
|
|
unsigned short sz_rows;
|
|
|
|
unsigned short sz_doodads;
|
|
|
|
unsigned short sz_overlays;
|
|
|
|
XkbcRowPtr rows;
|
|
|
|
XkbcDoodadPtr doodads;
|
|
|
|
XkbcBoundsRec bounds;
|
|
|
|
struct _XkbOverlay *overlays;
|
|
|
|
} XkbcSectionRec, *XkbcSectionPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcOverlayKey {
|
|
|
|
XkbKeyNameRec over;
|
|
|
|
XkbKeyNameRec under;
|
|
|
|
} XkbcOverlayKeyRec, *XkbcOverlayKeyPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbOverlayRow {
|
|
|
|
unsigned short row_under;
|
|
|
|
unsigned short num_keys;
|
|
|
|
unsigned short sz_keys;
|
|
|
|
XkbcOverlayKeyPtr keys;
|
|
|
|
} XkbcOverlayRowRec, *XkbcOverlayRowPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbOverlay {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
XkbcSectionPtr section_under;
|
|
|
|
unsigned short num_rows;
|
|
|
|
unsigned short sz_rows;
|
|
|
|
XkbcOverlayRowPtr rows;
|
|
|
|
XkbcBoundsPtr bounds;
|
|
|
|
} XkbcOverlayRec, *XkbcOverlayPtr;
|
|
|
|
|
|
|
|
typedef struct _XkbcGeometry {
|
2010-06-28 04:50:12 -06:00
|
|
|
uint32_t name;
|
2010-06-21 07:28:34 -06:00
|
|
|
unsigned short width_mm;
|
|
|
|
unsigned short height_mm;
|
|
|
|
char * label_font;
|
|
|
|
XkbcColorPtr label_color;
|
|
|
|
XkbcColorPtr base_color;
|
|
|
|
unsigned short sz_properties;
|
|
|
|
unsigned short sz_colors;
|
|
|
|
unsigned short sz_shapes;
|
|
|
|
unsigned short sz_sections;
|
|
|
|
unsigned short sz_doodads;
|
|
|
|
unsigned short sz_key_aliases;
|
|
|
|
unsigned short num_properties;
|
|
|
|
unsigned short num_colors;
|
|
|
|
unsigned short num_shapes;
|
|
|
|
unsigned short num_sections;
|
|
|
|
unsigned short num_doodads;
|
|
|
|
unsigned short num_key_aliases;
|
|
|
|
XkbcPropertyPtr properties;
|
|
|
|
XkbcColorPtr colors;
|
|
|
|
XkbcShapePtr shapes;
|
|
|
|
XkbcSectionPtr sections;
|
|
|
|
XkbcDoodadPtr doodads;
|
|
|
|
XkbKeyAliasPtr key_aliases;
|
|
|
|
} XkbcGeometryRec, *XkbcGeometryPtr;
|
|
|
|
#define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0]))
|
|
|
|
|
|
|
|
#define XkbGeomPropertiesMask (1<<0)
|
|
|
|
#define XkbGeomColorsMask (1<<1)
|
|
|
|
#define XkbGeomShapesMask (1<<2)
|
|
|
|
#define XkbGeomSectionsMask (1<<3)
|
|
|
|
#define XkbGeomDoodadsMask (1<<4)
|
|
|
|
#define XkbGeomKeyAliasesMask (1<<5)
|
|
|
|
#define XkbGeomAllMask (0x3f)
|
|
|
|
|
|
|
|
typedef struct _XkbcGeometrySizes {
|
|
|
|
unsigned int which;
|
|
|
|
unsigned short num_properties;
|
|
|
|
unsigned short num_colors;
|
|
|
|
unsigned short num_shapes;
|
|
|
|
unsigned short num_sections;
|
|
|
|
unsigned short num_doodads;
|
|
|
|
unsigned short num_key_aliases;
|
|
|
|
} XkbcGeometrySizesRec, *XkbcGeometrySizesPtr;
|
|
|
|
|
2009-03-19 18:16:13 -06:00
|
|
|
/* Common keyboard description structure */
|
|
|
|
typedef struct _XkbcDesc {
|
|
|
|
unsigned int defined;
|
|
|
|
unsigned short flags;
|
|
|
|
unsigned short device_spec;
|
|
|
|
KeyCode min_key_code;
|
|
|
|
KeyCode max_key_code;
|
|
|
|
|
|
|
|
XkbControlsPtr ctrls;
|
2009-04-05 16:15:20 -06:00
|
|
|
XkbcServerMapPtr server;
|
2010-06-16 20:16:09 -06:00
|
|
|
XkbcClientMapPtr map;
|
2009-03-19 18:16:13 -06:00
|
|
|
XkbIndicatorPtr indicators;
|
2010-06-21 07:28:34 -06:00
|
|
|
XkbcNamesPtr names;
|
2010-06-16 22:56:08 -06:00
|
|
|
XkbcCompatMapPtr compat;
|
2010-06-21 07:28:34 -06:00
|
|
|
XkbcGeometryPtr geom;
|
2009-03-19 18:16:13 -06:00
|
|
|
} XkbcDescRec, *XkbcDescPtr;
|
2009-01-20 08:46:12 -07:00
|
|
|
|
2009-03-17 07:19:56 -06:00
|
|
|
_XFUNCPROTOBEGIN
|
|
|
|
|
2010-06-21 07:22:26 -06:00
|
|
|
typedef uint32_t (*InternAtomFuncPtr)(const char *val);
|
|
|
|
typedef const char *(*GetAtomValueFuncPtr)(uint32_t atom);
|
|
|
|
|
2009-04-09 15:29:32 -06:00
|
|
|
extern void
|
2010-06-21 07:22:26 -06:00
|
|
|
XkbcInitAtoms(InternAtomFuncPtr intern, GetAtomValueFuncPtr get_atom_value);
|
2009-04-09 15:29:32 -06:00
|
|
|
|
2009-03-29 09:55:18 -06:00
|
|
|
extern XkbcDescPtr
|
2009-04-08 18:59:15 -06:00
|
|
|
XkbcCompileKeymapFromRules(const XkbRMLVOSet *rmlvo);
|
2009-03-31 06:36:52 -06:00
|
|
|
|
|
|
|
extern XkbcDescPtr
|
2009-04-08 18:59:15 -06:00
|
|
|
XkbcCompileKeymapFromComponents(const XkbComponentNamesPtr ktcsg);
|
2009-03-29 09:55:18 -06:00
|
|
|
|
2009-04-10 13:25:51 -06:00
|
|
|
extern XkbcDescPtr
|
|
|
|
XkbcCompileKeymapFromFile(FILE *inputFile, const char *mapName);
|
|
|
|
|
2009-04-19 17:30:36 -06:00
|
|
|
extern XkbComponentListPtr
|
2009-04-22 00:22:25 -06:00
|
|
|
XkbcListComponents(XkbComponentNamesPtr ptrns, int *maxMatch);
|
2009-04-19 17:30:36 -06:00
|
|
|
|
2009-04-25 02:13:52 -06:00
|
|
|
/*
|
|
|
|
* Canonicalises component names by prepending the relevant component from
|
|
|
|
* 'old' to the one in 'names' when the latter has a leading '+' or '|', and
|
|
|
|
* by replacing a '%' with the relevant component, e.g.:
|
|
|
|
*
|
|
|
|
* names old output
|
|
|
|
* ------------------------------------------
|
|
|
|
* +bar foo foo+bar
|
|
|
|
* |quux baz baz|quux
|
|
|
|
* foo+%|baz bar foo+bar|baz
|
|
|
|
*
|
|
|
|
* If a component in names needs to be modified, the existing value will be
|
|
|
|
* free()d, and a new one allocated with malloc().
|
|
|
|
*/
|
|
|
|
extern void
|
|
|
|
XkbcCanonicaliseComponents(XkbComponentNamesPtr names,
|
|
|
|
const XkbComponentNamesPtr old);
|
|
|
|
|
2009-04-24 22:55:59 -06:00
|
|
|
/*
|
|
|
|
* Converts a keysym to a string; will return unknown Unicode codepoints
|
|
|
|
* as "Ua1b2", and other unknown keysyms as "0xabcd1234".
|
|
|
|
*
|
|
|
|
* The string returned may become invalidated after the next call to
|
|
|
|
* XkbcKeysymToString: if you need to preserve it, then you must
|
|
|
|
* duplicate it.
|
2010-06-16 20:16:09 -06:00
|
|
|
*
|
2010-06-28 04:50:12 -06:00
|
|
|
* This is uint32_t rather than KeySym, as KeySym changes size between
|
2010-06-16 20:16:09 -06:00
|
|
|
* client and server (no, really).
|
2009-04-24 22:55:59 -06:00
|
|
|
*/
|
2009-04-24 22:52:51 -06:00
|
|
|
extern char *
|
2010-06-28 04:50:12 -06:00
|
|
|
XkbcKeysymToString(uint32_t ks);
|
2009-04-24 22:52:51 -06:00
|
|
|
|
2009-04-24 22:55:59 -06:00
|
|
|
/*
|
|
|
|
* See XkbcKeysymToString comments: this function will accept any string
|
|
|
|
* from that function.
|
|
|
|
*/
|
2010-06-28 04:50:12 -06:00
|
|
|
extern uint32_t
|
2009-04-24 22:52:51 -06:00
|
|
|
XkbcStringToKeysym(const char *s);
|
|
|
|
|
2009-03-17 07:19:56 -06:00
|
|
|
_XFUNCPROTOEND
|
|
|
|
|
2009-01-20 08:46:12 -07:00
|
|
|
#endif /* _XKBCOMMON_H_ */
|