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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download)

1 : monnier 2 (* property-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1994 by AT&T Bell Laboratories. See COPYRIGHT file for details.
4 :     *
5 :     * An interface to the property management routines.
6 :     *)
7 :    
8 :     signature PROPERTY =
9 :     sig
10 :    
11 :     type atom (* = XProtTypes.atom *)
12 :    
13 :     (* raw data from server (in ClientMessage, property values, ...) *)
14 :     datatype raw_format = Raw8 | Raw16 | Raw32
15 :     datatype raw_data = RAW_DATA of {
16 :     format : raw_format,
17 :     data : Word8Vector.vector
18 :     }
19 :    
20 :     (* X property values. A property value has a type, which is an atom, and
21 :     * a value. The value is a sequence of 8, 16 or 32-bit items, represented
22 :     * as a format and a string.
23 :     *)
24 :     datatype prop_val = PROP_VAL of {
25 :     typ : atom,
26 :     value : raw_data
27 :     }
28 :    
29 :     exception PropAlloc
30 :     (* raised, if there is not enough space to store a property value
31 :     * on the server.
32 :     *)
33 :    
34 :     (* an abstract interface to a property on a window *)
35 :     type property
36 :    
37 :     val property : (Window.window * atom) -> property
38 :     (* return the abstract representation of the named property on
39 :     * the specified window.
40 :     *)
41 :    
42 :     val unusedProperty : Window.window -> property
43 :     (* generate a property on the specified window that is guaranteed
44 :     * to be unused. Note that once this property has been "deleted"
45 :     * its name may be reused.
46 :     * NOTE: eventually, properties will be finalized, but for the
47 :     * time being, programs should delete any allocated properties they
48 :     * are not using.
49 :     *)
50 :    
51 :     val mkProperty : (Window.window * prop_val) -> property
52 :     (* create a new property initialized to the given value *)
53 :    
54 :     val nameOfProp : property -> atom
55 :     (* return the atom that names the given property *)
56 :    
57 :     val setProperty : (property * prop_val) -> unit
58 :     (* set the value of the property *)
59 :    
60 :     val appendToProperty : (property * prop_val) -> unit
61 :     (* append the property value to the property; the types
62 :     * and formats must match.
63 :     *)
64 :    
65 :     val prependToProperty : (property * prop_val) -> unit
66 :     (* prepend the property value to the property; the types
67 :     * and formats must match.
68 :     *)
69 :    
70 :     val deleteProperty : property -> unit
71 :     (* delete the named property *)
72 :    
73 :     exception RotateProps
74 :     val rotateProperties : (property list * int) -> unit
75 :     (* rotate the list of properties; raises RotateProps if the
76 :     * properties do not belong to the same window.
77 :     *)
78 :    
79 :     val getProperty : property -> prop_val option
80 :     (* get the value of the property; if the property has not been
81 :     * set, then NONE is returned.
82 :     *)
83 :    
84 :     datatype prop_change = NewValue | Deleted
85 :    
86 :     val watchProperty : property -> (prop_change * XTime.time) CML.event
87 :     (* returns an event for monitoring changes to a property's
88 :     * state. Note that once a property has been deleted, there
89 :     * will be no more events, unless watchProperty is called again.
90 :     *)
91 :    
92 :     end;
93 :    

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