Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/eXene/lib/misc/xprint.sml
ViewVC logotype

Annotation of /sml/trunk/src/eXene/lib/misc/xprint.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (view) (download)

1 : monnier 2 (* xprint.sml
2 :     *
3 :     * COPYRIGHT (c) 1990,1991 by John H. Reppy. See COPYRIGHT file for details.
4 :     *)
5 :    
6 :     structure XPrint : sig
7 :     val xevtName : XEventTypes.xevent -> string
8 :     val xerrorKind : XErrors.xerr_kind -> string
9 :     val xerrorToString : XErrors.xerror -> string
10 :     val xidToString : XProtTypes.xid -> string
11 :     end = struct
12 :    
13 :     structure XEvt = XEventTypes
14 :     structure XErr = XErrors
15 :    
16 :     fun xidToString (XProtTypes.XID n) = Word.toString n
17 :    
18 :     fun reqCodeToString (0w1 : Word8.word) = "CreateWindow"
19 :     | reqCodeToString 0w2 = "ChangeWindowAttributes"
20 :     | reqCodeToString 0w3 = "GetWindowAttributes"
21 :     | reqCodeToString 0w4 = "DestroyWindow"
22 :     | reqCodeToString 0w5 = "DestroySubwindows"
23 :     | reqCodeToString 0w6 = "ChangeSaveSet"
24 :     | reqCodeToString 0w7 = "ReparentWindow"
25 :     | reqCodeToString 0w8 = "MapWindow"
26 :     | reqCodeToString 0w9 = "MapSubwindows"
27 :     | reqCodeToString 0w10 = "UnmapWindow"
28 :     | reqCodeToString 0w11 = "UnmapSubwindows"
29 :     | reqCodeToString 0w12 = "ConfigureWindow"
30 :     | reqCodeToString 0w13 = "CirculateWindow"
31 :     | reqCodeToString 0w14 = "GetGeometry"
32 :     | reqCodeToString 0w15 = "QueryTree"
33 :     | reqCodeToString 0w16 = "InternAtom"
34 :     | reqCodeToString 0w17 = "GetAtomName"
35 :     | reqCodeToString 0w18 = "ChangeProperty"
36 :     | reqCodeToString 0w19 = "DeleteProperty"
37 :     | reqCodeToString 0w20 = "GetProperty"
38 :     | reqCodeToString 0w21 = "ListProperties"
39 :     | reqCodeToString 0w22 = "SetSelectionOwner"
40 :     | reqCodeToString 0w23 = "GetSelectionOwner"
41 :     | reqCodeToString 0w24 = "ConvertSelection"
42 :     | reqCodeToString 0w25 = "SendEvent"
43 :     | reqCodeToString 0w26 = "GrabPointer"
44 :     | reqCodeToString 0w27 = "UngrabPointer"
45 :     | reqCodeToString 0w28 = "GrabButton"
46 :     | reqCodeToString 0w29 = "UngrabButton"
47 :     | reqCodeToString 0w30 = "ChangeActivePointerGrab"
48 :     | reqCodeToString 0w31 = "GrabKeyboard"
49 :     | reqCodeToString 0w32 = "UngrabKeyboard"
50 :     | reqCodeToString 0w33 = "GrabKey"
51 :     | reqCodeToString 0w34 = "UngrabKey"
52 :     | reqCodeToString 0w35 = "AllowEvents"
53 :     | reqCodeToString 0w36 = "GrabServer"
54 :     | reqCodeToString 0w37 = "UngrabServer"
55 :     | reqCodeToString 0w38 = "QueryPointer"
56 :     | reqCodeToString 0w39 = "GetMotionEvents"
57 :     | reqCodeToString 0w40 = "TranslateCoords"
58 :     | reqCodeToString 0w41 = "WarpPointer"
59 :     | reqCodeToString 0w42 = "SetInputFocus"
60 :     | reqCodeToString 0w43 = "GetInputFocus"
61 :     | reqCodeToString 0w44 = "QueryKeymap"
62 :     | reqCodeToString 0w45 = "OpenFont"
63 :     | reqCodeToString 0w46 = "CloseFont"
64 :     | reqCodeToString 0w47 = "QueryFont"
65 :     | reqCodeToString 0w48 = "QueryTextExtents"
66 :     | reqCodeToString 0w49 = "ListFonts"
67 :     | reqCodeToString 0w50 = "ListFontsWithInfo"
68 :     | reqCodeToString 0w51 = "SetFontPath"
69 :     | reqCodeToString 0w52 = "GetFontPath"
70 :     | reqCodeToString 0w53 = "CreatePixmap"
71 :     | reqCodeToString 0w54 = "FreePixmap"
72 :     | reqCodeToString 0w55 = "CreateGC"
73 :     | reqCodeToString 0w56 = "ChangeGC"
74 :     | reqCodeToString 0w57 = "CopyGC"
75 :     | reqCodeToString 0w58 = "SetDashes"
76 :     | reqCodeToString 0w59 = "SetClipRectangles"
77 :     | reqCodeToString 0w60 = "FreeGC"
78 :     | reqCodeToString 0w61 = "ClearArea"
79 :     | reqCodeToString 0w62 = "CopyArea"
80 :     | reqCodeToString 0w63 = "CopyPlane"
81 :     | reqCodeToString 0w64 = "PolyPoint "
82 :     | reqCodeToString 0w65 = "PolyLine"
83 :     | reqCodeToString 0w66 = "PolySegment"
84 :     | reqCodeToString 0w67 = "PolyRectangle"
85 :     | reqCodeToString 0w68 = "PolyArc"
86 :     | reqCodeToString 0w69 = "FillPoly"
87 :     | reqCodeToString 0w70 = "PolyFillRectangle"
88 :     | reqCodeToString 0w71 = "PolyFillArc"
89 :     | reqCodeToString 0w72 = "PutImage"
90 :     | reqCodeToString 0w73 = "GetImage"
91 :     | reqCodeToString 0w74 = "PolyText8"
92 :     | reqCodeToString 0w75 = "PolyText16"
93 :     | reqCodeToString 0w76 = "ImageText8"
94 :     | reqCodeToString 0w77 = "ImageText16"
95 :     | reqCodeToString 0w78 = "CreateColormap"
96 :     | reqCodeToString 0w79 = "FreeColormap"
97 :     | reqCodeToString 0w80 = "CopyColormapAndFree"
98 :     | reqCodeToString 0w81 = "InstallColormap"
99 :     | reqCodeToString 0w82 = "UninstallColormap"
100 :     | reqCodeToString 0w83 = "ListInstalledColormaps"
101 :     | reqCodeToString 0w84 = "AllocColor"
102 :     | reqCodeToString 0w85 = "AllocNamedColor"
103 :     | reqCodeToString 0w86 = "AllocColorCells"
104 :     | reqCodeToString 0w87 = "AllocColorPlanes"
105 :     | reqCodeToString 0w88 = "FreeColors"
106 :     | reqCodeToString 0w89 = "StoreColors"
107 :     | reqCodeToString 0w90 = "StoreNamedColor"
108 :     | reqCodeToString 0w91 = "QueryColors"
109 :     | reqCodeToString 0w92 = "LookupColor"
110 :     | reqCodeToString 0w93 = "CreateCursor"
111 :     | reqCodeToString 0w94 = "CreateGlyphCursor"
112 :     | reqCodeToString 0w95 = "FreeCursor"
113 :     | reqCodeToString 0w96 = "RecolorCursor"
114 :     | reqCodeToString 0w97 = "QueryBestSize"
115 :     | reqCodeToString 0w98 = "QueryExtension"
116 :     | reqCodeToString 0w99 = "ListExtensions"
117 :     | reqCodeToString 0w100 = "ChangeKeyboardMapping"
118 :     | reqCodeToString 0w101 = "GetKeyboardMapping"
119 :     | reqCodeToString 0w102 = "ChangeKeyboardControl"
120 :     | reqCodeToString 0w103 = "GetKeyboardControl"
121 :     | reqCodeToString 0w104 = "Bell"
122 :     | reqCodeToString 0w105 = "ChangePointerControl"
123 :     | reqCodeToString 0w106 = "GetPointerControl"
124 :     | reqCodeToString 0w107 = "SetScreenSaver"
125 :     | reqCodeToString 0w108 = "GetScreenSaver"
126 :     | reqCodeToString 0w109 = "ChangeHosts"
127 :     | reqCodeToString 0w110 = "ListHosts"
128 :     | reqCodeToString 0w111 = "SetAccessControl"
129 :     | reqCodeToString 0w112 = "SetCloseDownMode"
130 :     | reqCodeToString 0w113 = "KillClient"
131 :     | reqCodeToString 0w114 = "RotateProperties"
132 :     | reqCodeToString 0w115 = "ForceScreenSaver"
133 :     | reqCodeToString 0w116 = "SetPointerMapping"
134 :     | reqCodeToString 0w117 = "GetPointerMapping"
135 :     | reqCodeToString 0w118 = "SetModifierMapping"
136 :     | reqCodeToString 0w119 = "GetModifierMapping"
137 :     | reqCodeToString 0w127 = "NoOperation"
138 :     | reqCodeToString w = String.concat["CODE=", Word8.toString w]
139 :    
140 :     fun xerrorKind XErr.BadRequest = "BadRequest"
141 :     | xerrorKind (XErr.BadValue v) = ("BadValue " ^ v)
142 :     | xerrorKind (XErr.BadWindow xid) = ("BadWindow " ^ xidToString xid)
143 :     | xerrorKind (XErr.BadPixmap xid) = ("BadPixmap " ^ xidToString xid)
144 :     | xerrorKind (XErr.BadAtom xid) = ("BadAtom " ^ xidToString xid)
145 :     | xerrorKind (XErr.BadCursor xid) = ("BadCursor " ^ xidToString xid)
146 :     | xerrorKind (XErr.BadFont xid) = ("BadFont " ^ xidToString xid)
147 :     | xerrorKind XErr.BadMatch = "BadMatch"
148 :     | xerrorKind (XErr.BadDrawable xid) = ("BadDrawable " ^ xidToString xid)
149 :     | xerrorKind XErr.BadAccess = "BadAccess"
150 :     | xerrorKind XErr.BadAlloc = "BadAlloc"
151 :     | xerrorKind (XErr.BadColor xid) = ("BadColor " ^ xidToString xid)
152 :     | xerrorKind (XErr.BadGC xid) = ("BadGC " ^ xidToString xid)
153 :     | xerrorKind (XErr.BadIDChoice xid) = ("BadIDChoice " ^ xidToString xid)
154 :     | xerrorKind XErr.BadName = "BadName"
155 :     | xerrorKind XErr.BadLength = "BadLength"
156 :     | xerrorKind XErr.BadImplementation = "BadImplementation"
157 :    
158 :     fun xerrorToString (XErr.XErr{kind, major_op, minor_op}) = String.concat [
159 :     "<<", xerrorKind kind,
160 :     ", major = ", reqCodeToString major_op,
161 :     ", minor = ", Word.toString minor_op, ">>"
162 :     ]
163 :    
164 :     fun xevtName (XEvt.KeyPressXEvt _) = "KeyPress"
165 :     | xevtName (XEvt.KeyReleaseXEvt _) = "KeyRelease"
166 :     | xevtName (XEvt.ButtonPressXEvt _) = "ButtonPress"
167 :     | xevtName (XEvt.ButtonReleaseXEvt _) = "ButtonRelease"
168 :     | xevtName (XEvt.MotionNotifyXEvt _) = "MotionNotify"
169 :     | xevtName (XEvt.EnterNotifyXEvt _) = "EnterNotify"
170 :     | xevtName (XEvt.LeaveNotifyXEvt _) = "LeaveNotify"
171 :     | xevtName (XEvt.FocusInXEvt _) = "FocusIn"
172 :     | xevtName (XEvt.FocusOutXEvt _) = "FocusOut"
173 :     | xevtName (XEvt.KeymapNotifyXEvt _) = "KeymapNotify"
174 :     | xevtName (XEvt.ExposeXEvt _) = "Expose"
175 :     | xevtName (XEvt.GraphicsExposeXEvt _) = "GraphicsExpose"
176 :     | xevtName (XEvt.NoExposeXEvt _) = "NoExpose"
177 :     | xevtName (XEvt.VisibilityNotifyXEvt _) = "VisibilityNotify"
178 :     | xevtName (XEvt.CreateNotifyXEvt _) = "CreateNotify"
179 :     | xevtName (XEvt.DestroyNotifyXEvt _) = "DestroyNotify"
180 :     | xevtName (XEvt.UnmapNotifyXEvt _) = "UnmapNotify"
181 :     | xevtName (XEvt.MapNotifyXEvt _) = "MapNotify"
182 :     | xevtName (XEvt.MapRequestXEvt _) = "MapRequest"
183 :     | xevtName (XEvt.ReparentNotifyXEvt _) = "ReparentNotify"
184 :     | xevtName (XEvt.ConfigureNotifyXEvt _) = "ConfigureNotify"
185 :     | xevtName (XEvt.ConfigureRequestXEvt _) = "ConfigureRequest"
186 :     | xevtName (XEvt.GravityNotifyXEvt _) = "GravityNotify"
187 :     | xevtName (XEvt.ResizeRequestXEvt _) = "ResizeRequest"
188 :     | xevtName (XEvt.CirculateNotifyXEvt _) = "CirculateNotify"
189 :     | xevtName (XEvt.CirculateRequestXEvt _) = "CirculateRequest"
190 :     | xevtName (XEvt.PropertyNotifyXEvt _) = "PropertyNotify"
191 :     | xevtName (XEvt.SelectionClearXEvt _) = "SelectionClear"
192 :     | xevtName (XEvt.SelectionRequestXEvt _) = "SelectionRequest"
193 :     | xevtName (XEvt.SelectionNotifyXEvt _) = "SelectionNotify"
194 :     | xevtName (XEvt.ColormapNotifyXEvt _) = "ColormapNotify"
195 :     | xevtName (XEvt.ClientMessageXEvt _) = "ClientMessage"
196 :     | xevtName (XEvt.ModifierMappingNotifyXEvt ) = "ModifierMappingNotify"
197 :     | xevtName (XEvt.KeyboardMappingNotifyXEvt _) = "KeyboardMappingNotify"
198 :     | xevtName (XEvt.PointerMappingNotifyXEvt ) = "PointerMappingNotify"
199 :    
200 :     end (* XPrint *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0