## keysym.pkg
## Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
## and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
# Compiled by:
#
src/lib/x-kit/xclient/xclient-internals.sublib# Symbolic names for the common keysyms in the X11 standard.
# This is a situation where SML doesn't really have the necessary
# features (e.g., symbolic constants), so it is pretty ugly.
### "Mathematics is no more computation
### than typing is literature."
###
### -- John Allen Paulos
package keysym {
stipulate
#
package s: (weak) api { Keysym = NO_SYMBOL
| KEYSYM Int; }
=
xtypes;
herein
#
include package s;
#
end;
void_symbol = KEYSYM 0xFFFFFF;
Char_Set
= CS_LATIN1
| CS_LATIN2
| CS_LATIN3
| CS_LATIN4
| CS_KANA
| CS_ARABIC
| CS_CYRILLIC
| CS_GREEK
| CS_TECHNICAL
| CS_SPECIAL
| CS_PUBLISHING
| CS_APL
| CS_HEBREW
| CS_KEYBOARD
| CS_VOID
;
fun char_set_of (KEYSYM 0xFFFFFF)
=>
CS_VOID;
char_set_of NO_SYMBOL
=>
CS_VOID;
char_set_of (KEYSYM ks)
=>
case (unt::bitwise_and (unt::from_int ks, 0uxff00))
0u0 => CS_LATIN1;
0u1 => CS_LATIN2;
0u2 => CS_LATIN3;
0u3 => CS_LATIN4;
0u4 => CS_KANA;
0u5 => CS_ARABIC;
0u6 => CS_CYRILLIC;
0u7 => CS_GREEK;
0u8 => CS_TECHNICAL;
0u9 => CS_SPECIAL;
0u10 => CS_PUBLISHING;
0u11 => CS_APL;
0u12 => CS_HEBREW;
0u255 => CS_KEYBOARD;
_ => xgripe::impossible "[Keysym::charSetOf: unknown character set]";
esac;
end;
}; # KeySym
## COPYRIGHT (c) 1990, 1991 by John H. Reppy. See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.