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/branches/SMLNJ/src/eXene/lib/user/interact-sig.sml
ViewVC logotype

Annotation of /sml/branches/SMLNJ/src/eXene/lib/user/interact-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 105 - (view) (download)

1 : monnier 104 (* interact.sml
2 :     *
3 :     * COPYRIGHT (c) 1990,1991 by John H. Reppy. See COPYRIGHT file for details.
4 :     *
5 :     * Types and operations to support user interaction and other external
6 :     * X-events.
7 :     *)
8 :    
9 :     signature INTERACT =
10 :     sig
11 :    
12 :     structure G : GEOMETRY
13 :     structure EXB : EXENE_BASE
14 :    
15 :     (* modifier buttons *)
16 :     datatype modkey
17 :     = ShiftKey | LockKey | ControlKey
18 :     | Mod1Key | Mod2Key | Mod3Key | Mod4Key | Mod5Key
19 :     | AnyModifier
20 :    
21 :     (* modifier key states *)
22 :     eqtype modkey_state
23 :    
24 :     val mkModState : modkey list -> modkey_state
25 :    
26 :     val unionMod : (modkey_state * modkey_state) -> modkey_state
27 :     val intersectMod : (modkey_state * modkey_state) -> modkey_state
28 :    
29 :     val emptyMod : modkey_state -> bool
30 :     val shiftIsSet : modkey_state -> bool
31 :     val lockIsSet : modkey_state -> bool
32 :     val cntrlIsSet : modkey_state -> bool
33 :     val modIsSet : (modkey_state * int) -> bool
34 :    
35 :     (* keysyms and translations *)
36 :     datatype keysym = KEYSYM of int | NoSymbol
37 :    
38 :     type translation
39 :    
40 :     val defaultTranslation : translation
41 :    
42 :     val rebind : translation -> (keysym * modkey list * string)
43 :     -> translation
44 :    
45 :     exception KeysymNotFound
46 :     val lookupString : translation -> (keysym * modkey_state)
47 :     -> string
48 :    
49 :     (* mouse buttons *)
50 :     datatype mbutton = MButton of int
51 :    
52 :     (* Mouse button states *)
53 :     eqtype mbutton_state
54 :    
55 :     val mkButState : mbutton list -> mbutton_state
56 :    
57 :     val unionMBut : (mbutton_state * mbutton_state) -> mbutton_state
58 :     val intersectMBut : (mbutton_state * mbutton_state) -> mbutton_state
59 :    
60 :     val invertMBut : (mbutton_state * mbutton) -> mbutton_state
61 :    
62 :     val mbutAllClr : mbutton_state -> bool
63 :     val mbutSomeSet : mbutton_state -> bool
64 :     val mbut1IsSet : mbutton_state -> bool
65 :     val mbut2IsSet : mbutton_state -> bool
66 :     val mbut3IsSet : mbutton_state -> bool
67 :     val mbut4IsSet : mbutton_state -> bool
68 :     val mbut5IsSet : mbutton_state -> bool
69 :     val mbutIsSet : (mbutton_state * mbutton) -> bool
70 :    
71 :    
72 :     (* keyboard messages *)
73 :     datatype kbd_msg
74 :     = KEY_Press of (keysym * modkey_state)
75 :     | KEY_Release of (keysym * modkey_state)
76 :     | KEY_ConfigSync
77 :    
78 :     (* Mouse messages *)
79 :     datatype mouse_msg
80 :     = MOUSE_Motion of {
81 :     pt : G.point, (* the mouse position in window coords *)
82 :     scr_pt : G.point, (* the mouse position in screen coords *)
83 :     time : EXB.XTime.time
84 :     }
85 :     | MOUSE_FirstDown of {
86 :     but : mbutton, (* the button that is in transition *)
87 :     pt : G.point, (* the mouse position in window coords *)
88 :     scr_pt : G.point, (* the mouse position in screen coords *)
89 :     time : EXB.XTime.time
90 :     }
91 :     | MOUSE_LastUp of {
92 :     but : mbutton, (* the button that is in transition *)
93 :     pt : G.point, (* the mouse position in window coords *)
94 :     scr_pt : G.point, (* the mouse position in screen coords *)
95 :     time : EXB.XTime.time
96 :     }
97 :     | MOUSE_Down of {
98 :     but : mbutton, (* the button that is in transition *)
99 :     pt : G.point, (* the mouse position in window coords *)
100 :     scr_pt : G.point, (* the mouse position in screen coords *)
101 :     state : mbutton_state, (* the state of the mouse buttons *)
102 :     time : EXB.XTime.time
103 :     }
104 :     | MOUSE_Up of {
105 :     but : mbutton, (* the button that is in transition *)
106 :     pt : G.point, (* the mouse position in window coords *)
107 :     scr_pt : G.point, (* the mouse position in screen coords *)
108 :     state : mbutton_state, (* the state of the mouse buttons *)
109 :     time : EXB.XTime.time
110 :     }
111 :     | MOUSE_Enter of {
112 :     pt : G.point, (* the mouse position in window coords *)
113 :     scr_pt : G.point, (* the mouse position in screen coords *)
114 :     time : EXB.XTime.time
115 :     }
116 :     | MOUSE_Leave of {
117 :     pt : G.point, (* the mouse position in window coords *)
118 :     scr_pt : G.point, (* the mouse position in screen coords *)
119 :     time : EXB.XTime.time
120 :     }
121 :     | MOUSE_ConfigSync
122 :    
123 :    
124 :     (* Command/control messages from parent *)
125 :     datatype cmd_in
126 :     = CI_Redraw of G.rect list
127 :     | CI_Resize of G.rect
128 :     | CI_ChildBirth of EXB.window
129 :     | CI_ChildDeath of EXB.window
130 :     | CI_OwnDeath
131 :    
132 :     (* Command/control messages to parent (really requests) *)
133 :     datatype cmd_out
134 :     = CO_ResizeReq
135 :     | CO_KillReq
136 :    
137 :    
138 :     (* addressed messages (with sequence numbers) *)
139 :     type 'a addr_msg
140 :    
141 :     datatype 'a next_win = Here of 'a | ToChild of 'a addr_msg
142 :     val stripMsg : 'a addr_msg -> 'a next_win
143 :    
144 :     val toWindow : ('a addr_msg * EXB.window) -> bool
145 :     val addrLookup : 'a EXB.window_map -> 'b addr_msg -> 'a
146 :    
147 :     exception NoMatchWin
148 :     val whichWindow : (EXB.window * 'a) list -> 'b addr_msg -> 'a
149 :    
150 :     val beforeMsg : ('a addr_msg * 'a addr_msg) -> bool
151 :    
152 :     val msgBodyOf : 'a addr_msg -> 'a
153 :    
154 :    
155 :     (* window environments *)
156 :     datatype in_env = InEnv of { (* this is the window's view of its *)
157 :     (* environment *)
158 :     k : kbd_msg addr_msg CML.event,
159 :     m : mouse_msg addr_msg CML.event,
160 :     ci : cmd_in addr_msg CML.event,
161 :     co : cmd_out -> unit CML.event
162 :     }
163 :     datatype out_env = OutEnv of { (* this is the paren't view of one of its *)
164 :     (* children's environment. *)
165 :     k : kbd_msg addr_msg -> unit CML.event,
166 :     m : mouse_msg addr_msg -> unit CML.event,
167 :     ci : cmd_in addr_msg -> unit CML.event,
168 :     co : cmd_out CML.event
169 :     }
170 :    
171 :     val createWinEnv : unit -> (in_env * out_env)
172 :    
173 :     val replaceMouse : (in_env * mouse_msg addr_msg CML.event) -> in_env
174 :     val replaceKey : (in_env * kbd_msg addr_msg CML.event) -> in_env
175 :     val replaceCI : (in_env * cmd_in addr_msg CML.event) -> in_env
176 :    
177 :     val ignoreMouse : in_env -> in_env
178 :     val ignoreKey : in_env -> in_env
179 :     val ignoreInput : in_env -> in_env
180 :     val ignoreAll : in_env -> in_env
181 :    
182 :     val nullStream : 'a addr_msg CML.event
183 :    
184 :     val whileMouseState : (mbutton_state -> bool)
185 :     -> (mbutton_state * mouse_msg CML.event) -> unit
186 :    
187 :     end (* INTERACT *)

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