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/user/iccc-sig.sml
ViewVC logotype

Annotation of /sml/trunk/src/eXene/lib/user/iccc-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 704 - (view) (download)

1 : monnier 104 (* iccc.sml
2 :     *
3 :     * COPYRIGHT (c) 1990,1991 by John H. Reppy. See COPYRIGHT file for details.
4 :     *
5 :     * Types and operations to support the X Inter-Client Communications Conventions.
6 :     *)
7 :    
8 :     signature ICCC =
9 :     sig
10 :    
11 :     structure G : GEOMETRY
12 :     structure EXB : EXENE_BASE
13 :    
14 :     eqtype atom
15 :     type selection_handle
16 :    
17 :     (* Standard X atoms *)
18 :     val atom_PRIMARY : atom
19 :     val atom_SECONDARY : atom
20 :     val atom_ARC : atom
21 :     val atom_ATOM : atom
22 :     val atom_BITMAP : atom
23 :     val atom_CARDINAL : atom
24 :     val atom_COLORMAP : atom
25 :     val atom_CURSOR : atom
26 :     val atom_CUT_BUFFER0 : atom
27 :     val atom_CUT_BUFFER1 : atom
28 :     val atom_CUT_BUFFER2 : atom
29 :     val atom_CUT_BUFFER3 : atom
30 :     val atom_CUT_BUFFER4 : atom
31 :     val atom_CUT_BUFFER5 : atom
32 :     val atom_CUT_BUFFER6 : atom
33 :     val atom_CUT_BUFFER7 : atom
34 :     val atom_DRAWABLE : atom
35 :     val atom_FONT : atom
36 :     val atom_INTEGER : atom
37 :     val atom_PIXMAP : atom
38 :     val atom_POINT : atom
39 :     val atom_RECTANGLE : atom
40 :     val atom_RESOURCE_MANAGER : atom
41 :     val atom_RGB_COLOR_MAP : atom
42 :     val atom_RGB_BEST_MAP : atom
43 :     val atom_RGB_BLUE_MAP : atom
44 :     val atom_RGB_DEFAULT_MAP : atom
45 :     val atom_RGB_GRAY_MAP : atom
46 :     val atom_RGB_GREEN_MAP : atom
47 :     val atom_RGB_RED_MAP : atom
48 :     val atom_STRING : atom
49 :     val atom_VISUALID : atom
50 :     val atom_WINDOW : atom
51 :     val atom_WM_COMMAND : atom
52 :     val atom_WM_HINTS : atom
53 :     val atom_WM_CLIENT_MACHINE : atom
54 :     val atom_WM_ICON_NAME : atom
55 :     val atom_WM_ICON_SIZE : atom
56 :     val atom_WM_NAME : atom
57 :     val atom_WM_NORMAL_HINTS : atom
58 :     val atom_WM_SIZE_HINTS : atom
59 :     val atom_WM_ZOOM_HINTS : atom
60 :     val atom_MIN_SPACE : atom
61 :     val atom_NORM_SPACE : atom
62 :     val atom_MAX_SPACE : atom
63 :     val atom_END_SPACE : atom
64 :     val atom_SUPERSCRIPT_X : atom
65 :     val atom_SUPERSCRIPT_Y : atom
66 :     val atom_SUBSCRIPT_X : atom
67 :     val atom_SUBSCRIPT_Y : atom
68 :     val atom_UNDERLINE_POSITION : atom
69 :     val atom_UNDERLINE_THICKNESS : atom
70 :     val atom_STRIKEOUT_ASCENT : atom
71 :     val atom_STRIKEOUT_DESCENT : atom
72 :     val atom_ITALIC_ANGLE : atom
73 :     val atom_X_HEIGHT : atom
74 :     val atom_QUAD_WIDTH : atom
75 :     val atom_WEIGHT : atom
76 :     val atom_POINT_SIZE : atom
77 :     val atom_RESOLUTION : atom
78 :     val atom_COPYRIGHT : atom
79 :     val atom_NOTICE : atom
80 :     val atom_FONT_NAME : atom
81 :     val atom_FAMILY_NAME : atom
82 :     val atom_FULL_NAME : atom
83 :     val atom_CAP_HEIGHT : atom
84 :     val atom_WM_CLASS : atom
85 :     val atom_WM_TRANSIENT_FOR : atom
86 :    
87 :    
88 :     (** Properties **)
89 :    
90 :     (* raw data from server (in ClientMessage, property values, ...) *)
91 :     datatype raw_format = Raw8 | Raw16 | Raw32
92 :     datatype raw_data = RAW_DATA of {
93 :     format : raw_format,
94 :     data : Word8Vector.vector
95 :     }
96 :    
97 :     (* X property values. A property value has a type, which is an atom, and
98 :     * a value. The value is a sequence of 8, 16 or 32-bit items, represented
99 :     * as a format and a string.
100 :     *)
101 :     datatype prop_val = PROP_VAL of {
102 :     typ : atom,
103 :     value : raw_data
104 :     }
105 :    
106 :     exception PropAlloc
107 :     (* raised, if there is not enough space to store a property value
108 :     * on the server.
109 :     *)
110 :    
111 :     (* an abstract interface to a property on a window *)
112 :     type property
113 :    
114 : monnier 289 val property : (EXB.window * atom) -> property
115 : monnier 104 (* return the abstract representation of the named property on
116 :     * the specified window.
117 :     *)
118 :    
119 : monnier 289 val unusedProperty : EXB.window -> property
120 : monnier 104 (* generate a property on the specified window that is guaranteed
121 :     * to be unused. Note that once this property has been "deleted"
122 :     * its name may be reused.
123 :     * NOTE: eventually, properties will be finalized, but for the
124 :     * time being, programs should delete any allocated properties they
125 :     * are not using.
126 :     *)
127 :    
128 : monnier 289 val mkProperty : (EXB.window * prop_val) -> property
129 : monnier 104 (* create a new property initialized to the given value *)
130 :    
131 :     val nameOfProp : property -> atom
132 :     (* return the atom that names the given property *)
133 :    
134 :     val setProperty : (property * prop_val) -> unit
135 :     (* set the value of the property *)
136 :    
137 :     val appendToProperty : (property * prop_val) -> unit
138 :     (* append the property value to the property; the types
139 :     * and formats must match.
140 :     *)
141 :    
142 :     val prependToProperty : (property * prop_val) -> unit
143 :     (* prepend the property value to the property; the types
144 :     * and formats must match.
145 :     *)
146 :    
147 :     val deleteProperty : property -> unit
148 :     (* delete the named property *)
149 :    
150 :     exception RotateProps
151 :     val rotateProperties : (property list * int) -> unit
152 :     (* rotate the list of properties; raises RotateProps if the
153 :     * properties do not belong to the same window.
154 :     *)
155 :    
156 :     val getProperty : property -> prop_val option
157 :     (* get the value of the property; if the property has not been
158 :     * set, then NONE is returned.
159 :     *)
160 :    
161 :     datatype prop_change = NewValue | Deleted
162 :    
163 :     val watchProperty : property -> (prop_change * EXB.XTime.time) CML.event
164 :     (* returns an event for monitoring changes to a property's
165 :     * state. Note that once a property has been deleted, there
166 :     * will be no more events, unless watchProperty is called again.
167 :     *)
168 :    
169 :    
170 :     (* Hints about the window size *)
171 :     datatype size_hints
172 :     = HINT_USPosition
173 :     | HINT_PPosition
174 :     | HINT_USSize
175 :     | HINT_PSize
176 :     | HINT_PMinSize of G.size
177 :     | HINT_PMaxSize of G.size
178 :     | HINT_PResizeInc of G.size
179 :     | HINT_PAspect of { min : (int * int), max : (int * int) }
180 :     | HINT_PBaseSize of G.size
181 :     | HINT_PWinGravity of EXB.gravity
182 :    
183 :     (* Window manager hints *)
184 :     datatype wm_hints
185 :     = HINT_Input of bool (* does this application rely on the window *)
186 :     (* manager to get keyboard input? *)
187 :     (* Initial window state (choose one) *)
188 :     | HINT_WithdrawnState (* for windows that are not mapped *)
189 :     | HINT_NormalState (* most want to start this way *)
190 :     | HINT_IconicState (* application wants to start as an icon *)
191 :     | HINT_IconTile of EXB.tile (* tile to be used as icon *)
192 :     | HINT_IconPixmap of EXB.pixmap (* pixmap to be used as icon *)
193 :     | HINT_IconWindow of EXB.window (* window to be used as icon *)
194 :     | HINT_IconMask of EXB.pixmap (* icon mask bitmap *)
195 :     | HINT_IconPosition of G.point (* initial position of icon *)
196 :     | HINT_WindowGroup of EXB.window (* the group leader *)
197 :    
198 :     (** atom operations **)
199 :     val internAtom : EXB.display -> string -> atom
200 :     val lookupAtom : EXB.display -> string -> atom option
201 :     val nameOfAtom : EXB.display -> atom -> string
202 :    
203 :     (** Selection owner operations **)
204 :    
205 : monnier 289 val acquireSelection : (EXB.window * atom * EXB.XTime.time)
206 : monnier 104 -> selection_handle option
207 :     (* acquire the named selection *)
208 :    
209 :     val selectionOf : selection_handle -> atom
210 :     val timeOf : selection_handle -> EXB.XTime.time
211 :    
212 :     val selectionReqEvt : selection_handle -> {
213 :     target : atom,
214 : jhr 704 time : EXB.XTime.time option,
215 : monnier 104 reply : prop_val option -> unit
216 :     } CML.event
217 :     (* this event is enabled once for each request for the selection. The
218 :     * target field is the requested target type; the time field is the
219 :     * server-time of the gesture that caused the request, and the reply
220 : jhr 704 * field is a function for sending the reply. If the time field is
221 :     * NONE, this means a value of CurrentTime was used. Strictly speaking
222 :     * this violates the ICCC specification, but applications may choose
223 :     * to accept it.
224 : monnier 104 *)
225 :    
226 :     val selectionRelEvt : selection_handle -> unit CML.event
227 :     (* this event becomes enabled when the selection is lost; either by
228 :     * the owner releasing it, or by some other client acquiring ownership.
229 :     *)
230 :    
231 :     val releaseSelection : selection_handle -> unit
232 :     (* release ownership of the selection *)
233 :    
234 :    
235 :     (** Selection requestor operations **)
236 :    
237 :     val requestSelection : {
238 : monnier 289 win : EXB.window,
239 : monnier 104 selection : atom,
240 :     target : atom,
241 :     property : atom,
242 :     time : EXB.XTime.time
243 :     } -> prop_val option CML.event
244 :     (* request the value of the selection. the win field is the requesting
245 :     * window, the selection field is the requested selection, the target
246 :     * field is the requested target type, and the time field is the server-
247 :     * time of the gesture causing the request. This returns an event
248 :     * that will become enabled when the reply is received.
249 :     *)
250 :    
251 :     end (* signature ICCC *)

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