1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
|
/* $Xorg: XKBlibint.h,v 1.3 2000/08/17 19:45:04 cpqbld Exp $ */
/************************************************************
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.
********************************************************/
/* $XFree86: xc/lib/X11/XKBlibint.h,v 3.4 2001/01/17 19:41:49 dawes Exp $ */
#ifndef _XKBLIBINT_H_
#define _XKBLIBINT_H_
#include <X11/Xutil.h>
#include <X11/XKBlib.h>
#define XkbMapPending (1<<0)
#define XkbXlibNewKeyboard (1<<1)
typedef int (*XkbKSToMBFunc)(
#if NeedFunctionPrototypes
XPointer /* priv */,
KeySym /* sym */,
char * /* buf */,
int /* len */,
int * /* extra_rtrn */
#endif
);
typedef KeySym (*XkbMBToKSFunc)(
#if NeedFunctionPrototypes
XPointer /* priv */,
char * /* buf */,
int /* len */,
Status * /* status */
#endif
);
typedef KeySym (*XkbToUpperFunc)(
#if NeedFunctionPrototypes
KeySym /* sym */
#endif
);
typedef struct _XkbConverters {
XkbKSToMBFunc KSToMB;
XPointer KSToMBPriv;
XkbMBToKSFunc MBToKS;
XPointer MBToKSPriv;
XkbToUpperFunc KSToUpper;
} XkbConverters;
extern XkbInternAtomFunc _XkbInternAtomFunc;
extern XkbGetAtomNameFunc _XkbGetAtomNameFunc;
typedef struct _XkbInfoRec {
unsigned flags;
unsigned xlib_ctrls;
XExtCodes *codes;
int srv_major;
int srv_minor;
unsigned selected_events;
unsigned short selected_nkn_details;
unsigned short selected_map_details;
XkbDescRec *desc;
XkbMapChangesRec changes;
Atom composeLED;
XkbConverters cvt;
XkbConverters latin1cvt;
} XkbInfoRec, *XkbInfoPtr;
#define _XkbUnavailable(d) \
(((d)->flags&XlibDisplayNoXkb) ||\
((!(d)->xkb_info || (!(d)->xkb_info->desc)) && !_XkbLoadDpy(d)))
#define _XkbCheckPendingRefresh(d,xi) {\
if ((xi)->flags&XkbXlibNewKeyboard)\
_XkbReloadDpy((d));\
else if ((xi)->flags&XkbMapPending) {\
if (XkbGetMapChanges((d),(xi)->desc, &(xi)->changes)==Success) {\
LockDisplay((d));\
(xi)->changes.changed= 0;\
UnlockDisplay((d));\
}\
}\
}
#define _XkbNeedModmap(i) ((!(i)->desc->map)||(!(i)->desc->map->modmap))
/*
* mask of the events that the "invisible" XKB support in Xlib needs
*/
#define XKB_XLIB_MAP_MASK (XkbAllClientInfoMask)
/*
* Handy helper macros
*/
#define XKB_INSURE_SIZE(f,t,nNum,oNum) {\
if ((f)==NULL) \
(f)=(t *)Xmalloc(sizeof(t)*(nNum));\
else if ((nNum)<(oNum))\
(f)=(t *)Xrealloc((f),sizeof(t)*(nNum));\
}
typedef struct _XkbReadBuffer {
int error;
int size;
char *start;
char *data;
} XkbReadBufferRec,*XkbReadBufferPtr;
#define _XkbAlloc(s) Xmalloc((s))
#define _XkbCalloc(n,s) Xcalloc((n),(s))
#define _XkbRealloc(o,s) Xrealloc((o),(s))
#define _XkbTypedAlloc(t) ((t *)Xmalloc(sizeof(t)))
#define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n),sizeof(t)))
#define _XkbTypedRealloc(o,n,t) \
((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
#define _XkbFree(p) Xfree(p)
_XFUNCPROTOBEGIN
extern void _XkbReloadDpy(
#if NeedFunctionPrototypes
Display * /* dpy */
#endif
);
extern KeySym _XKeycodeToKeysym(
#if NeedFunctionPrototypes
Display* /* display */,
KeyCode /* keycode */,
int /* index */
#endif
);
extern KeyCode _XKeysymToKeycode(
#if NeedFunctionPrototypes
Display* /* display */,
KeySym /* keysym */
#endif
);
extern KeySym _XLookupKeysym(
#if NeedFunctionPrototypes
XKeyEvent* /* key_event */,
int /* index */
#endif
);
extern int _XRefreshKeyboardMapping(
#if NeedFunctionPrototypes
XMappingEvent* /* event_map */
#endif
);
extern unsigned _XKeysymToModifiers(
#if NeedFunctionPrototypes
Display * /* dpy */,
KeySym /* ks */
#endif
);
extern int _XTranslateKey(
#if NeedFunctionPrototypes
register Display * /* dpy */,
KeyCode /* keycode */,
register unsigned int /* modifiers */,
unsigned int * /* modifiers_return */,
KeySym * /* keysym_return */
#endif
);
extern int _XTranslateKeySym(
#if NeedFunctionPrototypes
Display * /* dpy */,
register KeySym /* symbol */,
unsigned int /* modifiers */,
char * /* buffer */,
int /* nbytes */
#endif
);
extern int _XLookupString(
#if NeedFunctionPrototypes
register XKeyEvent * /* event */,
char * /* buffer */,
int /* nbytes */,
KeySym * /* keysym */,
XComposeStatus * /* status */
#endif
);
extern void _XkbNoteCoreMapChanges(
#if NeedFunctionPrototypes
XkbMapChangesRec * /* old */,
XMappingEvent * /* new */,
unsigned int /* wanted */
#endif
);
extern int _XkbInitReadBuffer(
#if NeedFunctionPrototypes
Display * /* dpy */,
XkbReadBufferPtr /* buf */,
int /* size */
#endif
);
extern int _XkbSkipReadBufferData(
#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
int /* size */
#endif
);
extern int _XkbCopyFromReadBuffer(
#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
char * /* to */,
int /* size */
#endif
);
#if defined(WORD64) || defined(LONG64)
extern int _XkbReadCopyData32(
#if NeedFunctionPrototypes
int * /* from */,
long * /* to */,
int /* num_words */
#endif
);
extern int _XkbWriteCopyData32(
#if NeedFunctionPrototypes
unsigned long * /* from */,
CARD32 * /* to */,
int /* num_words */
#endif
);
extern int _XkbReadBufferCopy32(
#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
long * /* to */,
int /* size */
#endif
);
#else
#define _XkbReadCopyData32(f,t,s) memcpy((char *)(t),(char *)(f),(s)*4)
#define _XkbWriteCopyData32(f,t,s) memcpy((char *)(t),(char *)(f),(s)*4)
#define _XkbReadBufferCopy32(f,t,s) _XkbCopyFromReadBuffer(f,(char *)t,(s)*4)
#endif
#ifndef NO_DEC_BINARY_COMPATIBILITY
#define XKB_FORCE_INT_KEYSYM 1
#endif
#ifdef XKB_FORCE_INT_KEYSYM
extern int _XkbReadCopyKeySyms(
#if NeedFunctionPrototypes
int * /* from */,
KeySym * /* to */,
int /* num_words */
#endif
);
extern int _XkbWriteCopyKeySyms(
#if NeedFunctionPrototypes
KeySym * /* from */,
CARD32 * /* to */,
int /* num_words */
#endif
);
extern int _XkbReadBufferCopyKeySyms(
#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
#ifndef NO_DEC_BUG_FIX
KeySym * /* to */,
#else
long * /* to */,
#endif
int /* size */
#endif
);
#else
#define _XkbReadCopyKeySyms(f,t,n) _XkbReadCopyData32(f,t,n)
#define _XkbWriteCopyKeySyms(f,t,n) _XkbWriteCopyData32(f,t,n)
#define _XkbReadBufferCopyKeySyms(f,t,s) _XkbReadBufferCopy32(f,t,s)
#endif
extern char *_XkbPeekAtReadBuffer(
#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
int /* size */
#endif
);
extern char *_XkbGetReadBufferPtr(
#if NeedFunctionPrototypes
XkbReadBufferPtr /* from */,
int /* size */
#endif
);
#define _XkbGetTypedRdBufPtr(b,n,t) ((t *)_XkbGetReadBufferPtr(b,(n)*SIZEOF(t)))
extern int _XkbFreeReadBuffer(
#if NeedFunctionPrototypes
XkbReadBufferPtr /* buf */
#endif
);
extern Bool
_XkbGetReadBufferCountedString(
#if NeedFunctionPrototypes
XkbReadBufferPtr /* buf */,
char ** /* rtrn */
#endif
);
extern char *_XkbGetCharset(
#if NeedFunctionPrototypes
void
#endif
);
extern int _XkbGetConverters(
#if NeedFunctionPrototypes
char * /* encoding_name */,
XkbConverters * /* cvt_rtrn */
#endif
);
#ifdef NEED_MAP_READERS
extern Status _XkbReadGetMapReply(
#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetMapReply * /* rep */,
XkbDescRec * /* xkb */,
int * /* nread_rtrn */
#endif
);
extern Status _XkbReadGetCompatMapReply(
#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetCompatMapReply * /* rep */,
XkbDescPtr /* xkb */,
int * /* nread_rtrn */
#endif
);
extern Status _XkbReadGetIndicatorMapReply(
#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetIndicatorMapReply * /* rep */,
XkbDescPtr /* xkb */,
int * /* nread_rtrn */
#endif
);
extern Status _XkbReadGetNamesReply(
#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetNamesReply * /* rep */,
XkbDescPtr /* xkb */,
int * /* nread_rtrn */
#endif
);
extern Status _XkbReadGetGeometryReply(
#if NeedFunctionPrototypes
Display * /* dpy */,
xkbGetGeometryReply * /* rep */,
XkbDescPtr /* xkb */,
int * /* nread_rtrn */
#endif
);
#endif
_XFUNCPROTOEND
#endif /* _XKBLIBINT_H_ */
|