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/doc/sigs/drawing-sig.sml
ViewVC logotype

Annotation of /sml/trunk/src/eXene/doc/sigs/drawing-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 104 - (view) (download)

1 : monnier 104 (* drawing.sml
2 :     *
3 :     * COPYRIGHT (c) 1990,1991 by John H. Reppy. See COPYRIGHT file for details.
4 :     *
5 :     * This signature brings together all of the drawing related types and operations.
6 :     *)
7 :    
8 :     signature DRAWING =
9 :     sig
10 :    
11 :     structure EXB : EXENE_BASE
12 :     structure G : GEOMETRY
13 :    
14 :     type window
15 :     type pixmap
16 :     type tile
17 :     type font
18 :     type color
19 :    
20 :     (** this may belong elsewhere **)
21 :     datatype plane_mask = PLANEMASK of word
22 :    
23 :     type pen
24 :    
25 :     (* graphics functions *)
26 :     datatype graphics_op
27 :     = OP_Clr (* 0 *)
28 :     | OP_And (* src AND dst *)
29 :     | OP_AndNot (* src AND NOT dst *)
30 :     | OP_Copy (* src *)
31 :     | OP_AndInverted (* NOT src AND dst *)
32 :     | OP_Nop (* dst *)
33 :     | OP_Xor (* src XOR dst *)
34 :     | OP_Or (* src OR dst *)
35 :     | OP_Nor (* NOT src AND NOT dst *)
36 :     | OP_Equiv (* NOT src XOR dst *)
37 :     | OP_Not (* NOT dst *)
38 :     | OP_OrNot (* src OR NOT dst *)
39 :     | OP_CopyNot (* NOT src *)
40 :     | OP_OrInverted (* NOT src OR dst *)
41 :     | OP_Nand (* NOT src OR NOT dst *)
42 :     | OP_Set (* 1 *)
43 :    
44 :     datatype pen_val
45 :     = PV_Function of graphics_op
46 :     | PV_PlaneMask of plane_mask
47 :     | PV_Foreground of color
48 :     | PV_Background of color
49 :     | PV_LineWidth of int
50 :     | PV_LineStyle_Solid
51 :     | PV_LineStyle_OnOffDash
52 :     | PV_LineStyle_DoubleDash
53 :     | PV_CapStyle_NotLast
54 :     | PV_CapStyle_Butt
55 :     | PV_CapStyle_Round
56 :     | PV_CapStyle_Projecting
57 :     | PV_JoinStyle_Miter
58 :     | PV_JoinStyle_Round
59 :     | PV_JoinStyle_Bevel
60 :     | PV_FillStyle_Solid
61 :     | PV_FillStyle_Tiled
62 :     | PV_FillStyle_Stippled
63 :     | PV_FillStyle_OpaqueStippled
64 :     | PV_FillRule_EvenOdd
65 :     | PV_FillRule_Winding
66 :     | PV_ArcMode_Chord
67 :     | PV_ArcMode_PieSlice
68 :     | PV_ClipByChildren
69 :     | PV_IncludeInferiors
70 :     | PV_Tile of tile
71 :     | PV_Stipple of tile
72 :     | PV_TSOrigin of G.point
73 :     | PV_ClipOrigin of G.point
74 :     | PV_ClipMask_None
75 :     | PV_ClipMask of tile
76 :     | PV_ClipMask_UnsortedRects of G.rect list
77 :     | PV_ClipMask_YSortedRects of G.rect list
78 :     | PV_ClipMask_YXSortedRects of G.rect list
79 :     | PV_ClipMask_YXBandedRects of G.rect list
80 :     | PV_DashOffset of int
81 :     | PV_Dash_Fixed of int
82 :     | PV_Dash_List of int list
83 :    
84 :     exception BadPenParameter
85 :    
86 :     val newPen : pen_val list -> pen
87 :     val updatePen : (pen * pen_val list) -> pen
88 :     val defaultPen : pen
89 :    
90 :     (* Destinations for drawing operations *)
91 :     type drawable
92 :    
93 :     val drawableOfPM : pixmap -> drawable
94 :     val drawableOfWin : window -> drawable
95 :     val depthOfDrawable : drawable -> int
96 :    
97 :     (* drawing operations *)
98 :    
99 :     exception BadDrawParameter
100 :    
101 :     val drawPts : drawable -> pen -> G.point list -> unit
102 :     val drawPtPath : drawable -> pen -> G.point list -> unit
103 :     val drawPt : drawable -> pen -> G.point -> unit
104 :    
105 :     val drawLines : drawable -> pen -> G.point list -> unit
106 :     val drawPath : drawable -> pen -> G.point list -> unit
107 :     val drawSegs : drawable -> pen -> G.line list -> unit
108 :     val drawSeg : drawable -> pen -> G.line -> unit
109 :    
110 :     datatype shape = ComplexShape | NonconvexShape | ConvexShape
111 :     val fillPolygon : drawable -> pen -> {verts: G.point list, shape : shape} -> unit
112 :     val fillPath : drawable -> pen -> {path : G.point list, shape : shape} -> unit
113 :    
114 :     val drawRects : drawable -> pen -> G.rect list -> unit
115 :     val drawRect : drawable -> pen -> G.rect -> unit
116 :     val fillRects : drawable -> pen -> G.rect list -> unit
117 :     val fillRect : drawable -> pen -> G.rect -> unit
118 :    
119 :     val drawArcs : drawable -> pen -> G.arc list -> unit
120 :     val drawArc : drawable -> pen -> G.arc -> unit
121 :     val fillArcs : drawable -> pen -> G.arc list -> unit
122 :     val fillArc : drawable -> pen -> G.arc -> unit
123 :    
124 :     val drawCircle : drawable -> pen -> {center : G.point, rad : int} -> unit
125 :     val fillCircle : drawable -> pen -> {center : G.point, rad : int} -> unit
126 :    
127 :     (* Text drawing *)
128 :     datatype text = TEXT of (font * text_item list)
129 :     and text_item
130 :     = TXT_FONT of (font * text_item list)
131 :     | TXT_STR of string
132 :     | TXT_DELTA of int
133 :    
134 :     val drawString : drawable -> pen -> font -> G.point * string -> unit
135 :     val imageString : drawable -> pen -> font -> G.point * string -> unit
136 :     val drawText : drawable -> pen -> G.point * text -> unit
137 :    
138 :     (* Sources for bitblt operations *)
139 :     datatype draw_src
140 :     = WSRC of window
141 :     | PMSRC of pixmap
142 :     | TSRC of tile
143 :    
144 :     exception DepthMismatch
145 :     exception BadPlane
146 :    
147 :     val pixelBlt : drawable -> pen -> {
148 :     src : draw_src, src_rect : G.rect, dst_pos : G.point
149 :     } -> G.rect list
150 :     val pixelBltEvt : drawable -> pen -> {
151 :     src : draw_src, src_rect : G.rect, dst_pos : G.point
152 :     } -> G.rect list CML.event
153 :    
154 :     val bitBlt : drawable -> pen -> {
155 :     src : draw_src, src_rect : G.rect, dst_pos : G.point
156 :     } -> G.rect list
157 :     val bitBltEvt : drawable -> pen -> {
158 :     src : draw_src, src_rect : G.rect, dst_pos : G.point
159 :     } -> G.rect list CML.event
160 :    
161 :     val planeBlt : drawable -> pen -> {
162 :     src : draw_src, src_rect : G.rect, dst_pos : G.point, plane : int
163 :     } -> G.rect list
164 :     val planeBltEvt : drawable -> pen -> {
165 :     src : draw_src, src_rect : G.rect, dst_pos : G.point, plane : int
166 :     } -> G.rect list CML.event
167 :    
168 :     val tileBlt : drawable -> pen -> {src : tile, dst_pos : G.point} -> unit
169 :     val textureBlt : drawable -> pen -> {src : tile, dst_pos : G.point} -> unit
170 :    
171 :     val copyBlt : drawable -> pen -> {dst_pos : G.point, src_rect : G.rect}
172 :     -> G.rect list
173 :     val copyBltEvt : drawable -> pen
174 :     -> {dst_pos : G.point, src_rect : G.rect}
175 :     -> G.rect list CML.event
176 :    
177 :     val clearArea : drawable -> G.rect -> unit
178 :     val clearDrawable : drawable -> unit
179 :    
180 :     (* Create an unbuffered drawable. *)
181 :     val feedback : drawable -> drawable
182 :    
183 :     (* Create an overlay drawable for the given window. This provides concurrency
184 :     * control on the window and its descendents during rubber-banding (using OP_Xor).
185 :     * The first result is the overlay drawable, the second is the release operation
186 :     * for the drawable. By convention, the overlay dfrawable is unbuffered.
187 :     *)
188 :     val createOverlay : window -> {drawable : drawable, release : unit -> unit}
189 :    
190 :     end (* DRAWING *)

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