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/protocol/xcvtfns.sml
ViewVC logotype

Annotation of /sml/trunk/src/eXene/lib/protocol/xcvtfns.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (view) (download)

1 : monnier 2 (* xcvtfns.sml
2 :     *
3 :     * COPYRIGHT (c) 1990,1991 by John H. Reppy. See COPYRIGHT file for details.
4 :     *
5 :     * Conversion routines between X types and their representation in messages.
6 :     *)
7 :    
8 :     structure XCvtFuns : sig
9 :    
10 :     val graphOpToWire : XProtTypes.graphics_op -> word
11 :     val gravityToWire : XProtTypes.gravity -> word
12 :     val boolToWire : bool -> word
13 :     val stackModeToWire : XProtTypes.stack_mode -> word
14 :    
15 :     val doValList : int -> (word option Array.array -> 'a -> unit)
16 :     -> 'a list
17 :     -> XProtTypes.value_list
18 :    
19 :     end = struct
20 :    
21 :     structure XTy = XProtTypes
22 :    
23 :     (* Process a configuration value list, producing an value_list. *)
24 :     fun doValList n f lst = let
25 :     val arr = Array.array(n, NONE)
26 :     in
27 :     List.app (f arr) lst; XTy.VALS arr
28 :     end
29 :    
30 :     fun graphOpToWire XTy.OP_Clr = 0w0
31 :     | graphOpToWire XTy.OP_And = 0w1
32 :     | graphOpToWire XTy.OP_AndNot = 0w2
33 :     | graphOpToWire XTy.OP_Copy = 0w3
34 :     | graphOpToWire XTy.OP_AndInverted = 0w4
35 :     | graphOpToWire XTy.OP_Nop = 0w5
36 :     | graphOpToWire XTy.OP_Xor = 0w6
37 :     | graphOpToWire XTy.OP_Or = 0w7
38 :     | graphOpToWire XTy.OP_Nor = 0w8
39 :     | graphOpToWire XTy.OP_Equiv = 0w9
40 :     | graphOpToWire XTy.OP_Not = 0w10
41 :     | graphOpToWire XTy.OP_OrNot = 0w11
42 :     | graphOpToWire XTy.OP_CopyNot = 0w12
43 :     | graphOpToWire XTy.OP_OrInverted = 0w13
44 :     | graphOpToWire XTy.OP_Nand = 0w14
45 :     | graphOpToWire XTy.OP_Set = 0w15
46 :    
47 :     fun gravityToWire XTy.ForgetGravity = 0w0 (* bit gravity only *)
48 :     | gravityToWire XTy.UnmapGravity = 0w0 (* window gravity only *)
49 :     | gravityToWire XTy.NorthWestGravity = 0w1
50 :     | gravityToWire XTy.NorthGravity = 0w2
51 :     | gravityToWire XTy.NorthEastGravity = 0w3
52 :     | gravityToWire XTy.WestGravity = 0w4
53 :     | gravityToWire XTy.CenterGravity = 0w5
54 :     | gravityToWire XTy.EastGravity = 0w6
55 :     | gravityToWire XTy.SouthWestGravity = 0w7
56 :     | gravityToWire XTy.SouthGravity = 0w8
57 :     | gravityToWire XTy.SouthEastGravity = 0w9
58 :     | gravityToWire XTy.StaticGravity = 0w10
59 :    
60 :     fun boolToWire false = 0w0
61 :     | boolToWire true = 0w1
62 :    
63 :     fun stackModeToWire XTy.Above = 0w0
64 :     | stackModeToWire XTy.Below = 0w1
65 :     | stackModeToWire XTy.TopIf = 0w2
66 :     | stackModeToWire XTy.BottomIf = 0w3
67 :     | stackModeToWire XTy.Opposite = 0w4
68 :    
69 :     end (* XCvtFuns *)

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