|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
2 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
3 <head> |
|
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
|
5 <title>TB9.2 Example Applications: examples/PIPS/antiword/src/draw.c Source File</title> |
|
6 <link href="tabs.css" rel="stylesheet" type="text/css"/> |
|
7 <link href="doxygen.css" rel="stylesheet" type="text/css"/> |
|
8 </head> |
|
9 <body> |
|
10 <!-- Generated by Doxygen 1.6.2 --> |
|
11 <h1>examples/PIPS/antiword/src/draw.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> |
|
12 <a name="l00002"></a>00002 <span class="comment"> * draw.c</span> |
|
13 <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GPL</span> |
|
14 <a name="l00004"></a>00004 <span class="comment"> *</span> |
|
15 <a name="l00005"></a>00005 <span class="comment"> * Description:</span> |
|
16 <a name="l00006"></a>00006 <span class="comment"> * Functions to deal with the Draw format</span> |
|
17 <a name="l00007"></a>00007 <span class="comment"> */</span> |
|
18 <a name="l00008"></a>00008 |
|
19 <a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> |
|
20 <a name="l00010"></a>00010 <span class="preprocessor">#include <ctype.h></span> |
|
21 <a name="l00011"></a>00011 <span class="preprocessor">#include <string.h></span> |
|
22 <a name="l00012"></a>00012 <span class="preprocessor">#include "DeskLib:KeyCodes.h"</span> |
|
23 <a name="l00013"></a>00013 <span class="preprocessor">#include "DeskLib:Error.h"</span> |
|
24 <a name="l00014"></a>00014 <span class="preprocessor">#include "DeskLib:Menu.h"</span> |
|
25 <a name="l00015"></a>00015 <span class="preprocessor">#include "DeskLib:Template.h"</span> |
|
26 <a name="l00016"></a>00016 <span class="preprocessor">#include "DeskLib:Window.h"</span> |
|
27 <a name="l00017"></a>00017 <span class="preprocessor">#include "DeskLib:EventMsg.h"</span> |
|
28 <a name="l00018"></a>00018 <span class="preprocessor">#include "flexlib:flex.h"</span> |
|
29 <a name="l00019"></a>00019 <span class="preprocessor">#include "drawfile.h"</span> |
|
30 <a name="l00020"></a>00020 <span class="preprocessor">#include "antiword.h"</span> |
|
31 <a name="l00021"></a>00021 |
|
32 <a name="l00022"></a>00022 <span class="comment">/* The work area must be a little bit larger than the diagram */</span> |
|
33 <a name="l00023"></a>00023 <span class="preprocessor">#define WORKAREA_EXTENSION 5</span> |
|
34 <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="comment">/* Diagram memory */</span> |
|
35 <a name="l00025"></a>00025 <span class="preprocessor">#define INITIAL_SIZE 32768 </span><span class="comment">/* 32k */</span> |
|
36 <a name="l00026"></a>00026 <span class="preprocessor">#define EXTENSION_SIZE 4096 </span><span class="comment">/* 4k */</span> |
|
37 <a name="l00027"></a>00027 <span class="comment">/* Main window title */</span> |
|
38 <a name="l00028"></a>00028 <span class="preprocessor">#define WINDOW_TITLE_LEN 28</span> |
|
39 <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FILENAME_TITLE_LEN (WINDOW_TITLE_LEN - 10)</span> |
|
40 <a name="l00030"></a>00030 <span class="preprocessor"></span> |
|
41 <a name="l00031"></a>00031 |
|
42 <a name="l00032"></a>00032 <span class="preprocessor">#if !defined(__GNUC__)</span> |
|
43 <a name="l00033"></a>00033 <span class="preprocessor"></span><span class="keywordtype">int</span> |
|
44 <a name="l00034"></a>00034 flex_alloc(flex_ptr anchor, <span class="keywordtype">int</span> n) |
|
45 <a name="l00035"></a>00035 { |
|
46 <a name="l00036"></a>00036 <span class="keywordtype">void</span> *pvTmp; |
|
47 <a name="l00037"></a>00037 |
|
48 <a name="l00038"></a>00038 TRACE_MSG(<span class="stringliteral">"flex_alloc"</span>); |
|
49 <a name="l00039"></a>00039 |
|
50 <a name="l00040"></a>00040 <span class="keywordflow">if</span> (anchor == NULL || n < 0) { |
|
51 <a name="l00041"></a>00041 <span class="keywordflow">return</span> 0; |
|
52 <a name="l00042"></a>00042 } |
|
53 <a name="l00043"></a>00043 <span class="keywordflow">if</span> (n == 0) { |
|
54 <a name="l00044"></a>00044 n = 1; |
|
55 <a name="l00045"></a>00045 } |
|
56 <a name="l00046"></a>00046 pvTmp = malloc(n); |
|
57 <a name="l00047"></a>00047 <span class="keywordflow">if</span> (pvTmp == NULL) { |
|
58 <a name="l00048"></a>00048 <span class="keywordflow">return</span> 0; |
|
59 <a name="l00049"></a>00049 } |
|
60 <a name="l00050"></a>00050 *anchor = pvTmp; |
|
61 <a name="l00051"></a>00051 <span class="keywordflow">return</span> 1; |
|
62 <a name="l00052"></a>00052 } <span class="comment">/* end of flex_alloc */</span> |
|
63 <a name="l00053"></a>00053 |
|
64 <a name="l00054"></a>00054 <span class="keywordtype">void</span> |
|
65 <a name="l00055"></a>00055 flex_free(flex_ptr anchor) |
|
66 <a name="l00056"></a>00056 { |
|
67 <a name="l00057"></a>00057 TRACE_MSG(<span class="stringliteral">"flex_free"</span>); |
|
68 <a name="l00058"></a>00058 |
|
69 <a name="l00059"></a>00059 <span class="keywordflow">if</span> (anchor == NULL || *anchor == NULL) { |
|
70 <a name="l00060"></a>00060 <span class="keywordflow">return</span>; |
|
71 <a name="l00061"></a>00061 } |
|
72 <a name="l00062"></a>00062 free(*anchor); |
|
73 <a name="l00063"></a>00063 *anchor = NULL; |
|
74 <a name="l00064"></a>00064 } <span class="comment">/* end of flex_free */</span> |
|
75 <a name="l00065"></a>00065 |
|
76 <a name="l00066"></a>00066 <span class="keywordtype">int</span> |
|
77 <a name="l00067"></a>00067 flex_extend(flex_ptr anchor, <span class="keywordtype">int</span> newsize) |
|
78 <a name="l00068"></a>00068 { |
|
79 <a name="l00069"></a>00069 <span class="keywordtype">void</span> *pvTmp; |
|
80 <a name="l00070"></a>00070 |
|
81 <a name="l00071"></a>00071 TRACE_MSG(<span class="stringliteral">"flex_extend"</span>); |
|
82 <a name="l00072"></a>00072 |
|
83 <a name="l00073"></a>00073 <span class="keywordflow">if</span> (anchor == NULL || newsize < 0) { |
|
84 <a name="l00074"></a>00074 <span class="keywordflow">return</span> 0; |
|
85 <a name="l00075"></a>00075 } |
|
86 <a name="l00076"></a>00076 <span class="keywordflow">if</span> (newsize == 0) { |
|
87 <a name="l00077"></a>00077 newsize = 1; |
|
88 <a name="l00078"></a>00078 } |
|
89 <a name="l00079"></a>00079 pvTmp = realloc(*anchor, newsize); |
|
90 <a name="l00080"></a>00080 <span class="keywordflow">if</span> (pvTmp == NULL) { |
|
91 <a name="l00081"></a>00081 <span class="keywordflow">return</span> 0; |
|
92 <a name="l00082"></a>00082 } |
|
93 <a name="l00083"></a>00083 *anchor = pvTmp; |
|
94 <a name="l00084"></a>00084 <span class="keywordflow">return</span> 1; |
|
95 <a name="l00085"></a>00085 } <span class="comment">/* end of flex_extend */</span> |
|
96 <a name="l00086"></a>00086 <span class="preprocessor">#endif </span><span class="comment">/* !__GNUC__ */</span> |
|
97 <a name="l00087"></a>00087 |
|
98 <a name="l00088"></a>00088 <span class="comment">/*</span> |
|
99 <a name="l00089"></a>00089 <span class="comment"> * vCreateMainWindow - create the Main window</span> |
|
100 <a name="l00090"></a>00090 <span class="comment"> *</span> |
|
101 <a name="l00091"></a>00091 <span class="comment"> * remark: does not return if the Main window can't be created</span> |
|
102 <a name="l00092"></a>00092 <span class="comment"> */</span> |
|
103 <a name="l00093"></a>00093 <span class="keyword">static</span> window_handle |
|
104 <a name="l00094"></a>00094 tCreateMainWindow(<span class="keywordtype">void</span>) |
|
105 <a name="l00095"></a>00095 { |
|
106 <a name="l00096"></a>00096 window_handle tMainWindow; |
|
107 <a name="l00097"></a>00097 |
|
108 <a name="l00098"></a>00098 TRACE_MSG(<span class="stringliteral">"tCreateMainWindow"</span>); |
|
109 <a name="l00099"></a>00099 |
|
110 <a name="l00100"></a>00100 tMainWindow = Window_Create(<span class="stringliteral">"MainWindow"</span>, template_TITLEMIN); |
|
111 <a name="l00101"></a>00101 <span class="keywordflow">if</span> (tMainWindow == 0) { |
|
112 <a name="l00102"></a>00102 werr(1, <span class="stringliteral">"I can't find the 'MainWindow' template"</span>); |
|
113 <a name="l00103"></a>00103 } |
|
114 <a name="l00104"></a>00104 <span class="keywordflow">return</span> tMainWindow; |
|
115 <a name="l00105"></a>00105 } <span class="comment">/* end of tCreateMainWindow */</span> |
|
116 <a name="l00106"></a>00106 |
|
117 <a name="l00107"></a>00107 <span class="comment">/*</span> |
|
118 <a name="l00108"></a>00108 <span class="comment"> * vCreateScaleWindow - create the Scale view window</span> |
|
119 <a name="l00109"></a>00109 <span class="comment"> *</span> |
|
120 <a name="l00110"></a>00110 <span class="comment"> * remark: does not return if the Scale view window can't be created</span> |
|
121 <a name="l00111"></a>00111 <span class="comment"> */</span> |
|
122 <a name="l00112"></a>00112 <span class="keyword">static</span> window_handle |
|
123 <a name="l00113"></a>00113 tCreateScaleWindow(<span class="keywordtype">void</span>) |
|
124 <a name="l00114"></a>00114 { |
|
125 <a name="l00115"></a>00115 window_handle tScaleWindow; |
|
126 <a name="l00116"></a>00116 |
|
127 <a name="l00117"></a>00117 TRACE_MSG(<span class="stringliteral">"tCreateScaleWindow"</span>); |
|
128 <a name="l00118"></a>00118 |
|
129 <a name="l00119"></a>00119 tScaleWindow = Window_Create(<span class="stringliteral">"ScaleView"</span>, template_TITLEMIN); |
|
130 <a name="l00120"></a>00120 <span class="keywordflow">if</span> (tScaleWindow == 0) { |
|
131 <a name="l00121"></a>00121 werr(1, <span class="stringliteral">"I can't find the 'ScaleView' template"</span>); |
|
132 <a name="l00122"></a>00122 } |
|
133 <a name="l00123"></a>00123 <span class="keywordflow">return</span> tScaleWindow; |
|
134 <a name="l00124"></a>00124 } <span class="comment">/* end of tCreateScaleWindow */</span> |
|
135 <a name="l00125"></a>00125 |
|
136 <a name="l00126"></a>00126 <span class="comment">/*</span> |
|
137 <a name="l00127"></a>00127 <span class="comment"> * pCreateDiagram - create and initialize a diagram</span> |
|
138 <a name="l00128"></a>00128 <span class="comment"> *</span> |
|
139 <a name="l00129"></a>00129 <span class="comment"> * remark: does not return if the diagram can't be created</span> |
|
140 <a name="l00130"></a>00130 <span class="comment"> */</span> |
|
141 <a name="l00131"></a>00131 diagram_type * |
|
142 <a name="l00132"></a>00132 pCreateDiagram(<span class="keyword">const</span> <span class="keywordtype">char</span> *szTask, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) |
|
143 <a name="l00133"></a>00133 { |
|
144 <a name="l00134"></a>00134 diagram_type *pDiag; |
|
145 <a name="l00135"></a>00135 options_type tOptions; |
|
146 <a name="l00136"></a>00136 window_handle tMainWindow, tScaleWindow; |
|
147 <a name="l00137"></a>00137 wimp_box tBox; |
|
148 <a name="l00138"></a>00138 |
|
149 <a name="l00139"></a>00139 TRACE_MSG(<span class="stringliteral">"pCreateDiagram"</span>); |
|
150 <a name="l00140"></a>00140 |
|
151 <a name="l00141"></a>00141 fail(szTask == NULL || szTask[0] == <span class="charliteral">'\0'</span>); |
|
152 <a name="l00142"></a>00142 |
|
153 <a name="l00143"></a>00143 <span class="comment">/* Create the main window */</span> |
|
154 <a name="l00144"></a>00144 tMainWindow = tCreateMainWindow(); |
|
155 <a name="l00145"></a>00145 |
|
156 <a name="l00146"></a>00146 <span class="comment">/* Create the scale view window */</span> |
|
157 <a name="l00147"></a>00147 tScaleWindow = tCreateScaleWindow(); |
|
158 <a name="l00148"></a>00148 |
|
159 <a name="l00149"></a>00149 <span class="comment">/* Get the necessary memory */</span> |
|
160 <a name="l00150"></a>00150 pDiag = xmalloc(<span class="keyword">sizeof</span>(diagram_type)); |
|
161 <a name="l00151"></a>00151 <span class="keywordflow">if</span> (flex_alloc((flex_ptr)&pDiag->tInfo.data, INITIAL_SIZE) != 1) { |
|
162 <a name="l00152"></a>00152 werr(1, <span class="stringliteral">"Memory allocation failed, unable to continue"</span>); |
|
163 <a name="l00153"></a>00153 } |
|
164 <a name="l00154"></a>00154 |
|
165 <a name="l00155"></a>00155 <span class="comment">/* Initialize the diagram */</span> |
|
166 <a name="l00156"></a>00156 vGetOptions(&tOptions); |
|
167 <a name="l00157"></a>00157 pDiag->tMainWindow = tMainWindow; |
|
168 <a name="l00158"></a>00158 pDiag->tScaleWindow = tScaleWindow; |
|
169 <a name="l00159"></a>00159 pDiag->iScaleFactorCurr = tOptions.iScaleFactor; |
|
170 <a name="l00160"></a>00160 pDiag->iScaleFactorTemp = tOptions.iScaleFactor; |
|
171 <a name="l00161"></a>00161 pDiag->tMemorySize = INITIAL_SIZE; |
|
172 <a name="l00162"></a>00162 tBox.min.x = 0; |
|
173 <a name="l00163"></a>00163 tBox.min.y = -(Drawfile_ScreenToDraw(32 + 3) * 8 + 1); |
|
174 <a name="l00164"></a>00164 tBox.max.x = Drawfile_ScreenToDraw(16) * MIN_SCREEN_WIDTH + 1; |
|
175 <a name="l00165"></a>00165 tBox.max.y = 0; |
|
176 <a name="l00166"></a>00166 Error_CheckFatal(Drawfile_CreateDiagram(&pDiag->tInfo, |
|
177 <a name="l00167"></a>00167 pDiag->tMemorySize, szTask, tBox)); |
|
178 <a name="l00168"></a>00168 DBG_DEC(pDiag->tInfo.length); |
|
179 <a name="l00169"></a>00169 pDiag->lXleft = 0; |
|
180 <a name="l00170"></a>00170 pDiag->lYtop = 0; |
|
181 <a name="l00171"></a>00171 strncpy(pDiag->szFilename, |
|
182 <a name="l00172"></a>00172 szBasename(szFilename), <span class="keyword">sizeof</span>(pDiag->szFilename) - 1); |
|
183 <a name="l00173"></a>00173 pDiag->szFilename[<span class="keyword">sizeof</span>(pDiag->szFilename) - 1] = <span class="charliteral">'\0'</span>; |
|
184 <a name="l00174"></a>00174 <span class="comment">/* Return success */</span> |
|
185 <a name="l00175"></a>00175 <span class="keywordflow">return</span> pDiag; |
|
186 <a name="l00176"></a>00176 } <span class="comment">/* end of pCreateDiagram */</span> |
|
187 <a name="l00177"></a>00177 |
|
188 <a name="l00178"></a>00178 <span class="comment">/*</span> |
|
189 <a name="l00179"></a>00179 <span class="comment"> * bDestroyDiagram - remove a diagram by freeing the memory it uses</span> |
|
190 <a name="l00180"></a>00180 <span class="comment"> */</span> |
|
191 <a name="l00181"></a>00181 BOOL |
|
192 <a name="l00182"></a>00182 bDestroyDiagram(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) |
|
193 <a name="l00183"></a>00183 { |
|
194 <a name="l00184"></a>00184 diagram_type *pDiag; |
|
195 <a name="l00185"></a>00185 window_handle tWindow; |
|
196 <a name="l00186"></a>00186 |
|
197 <a name="l00187"></a>00187 TRACE_MSG(<span class="stringliteral">"bDestroyDiagram"</span>); |
|
198 <a name="l00188"></a>00188 |
|
199 <a name="l00189"></a>00189 fail(pEvent == NULL); |
|
200 <a name="l00190"></a>00190 fail(pvReference == NULL); |
|
201 <a name="l00191"></a>00191 |
|
202 <a name="l00192"></a>00192 <span class="keywordflow">if</span> (pEvent == NULL || pvReference == NULL) { |
|
203 <a name="l00193"></a>00193 <span class="keywordflow">return</span> FALSE; |
|
204 <a name="l00194"></a>00194 } |
|
205 <a name="l00195"></a>00195 |
|
206 <a name="l00196"></a>00196 pDiag = (diagram_type *)pvReference; |
|
207 <a name="l00197"></a>00197 |
|
208 <a name="l00198"></a>00198 <span class="keywordflow">switch</span> (pEvent->type) { |
|
209 <a name="l00199"></a>00199 <span class="keywordflow">case</span> event_CLOSE: |
|
210 <a name="l00200"></a>00200 tWindow = pEvent->data.openblock.window; |
|
211 <a name="l00201"></a>00201 <span class="keywordflow">break</span>; |
|
212 <a name="l00202"></a>00202 <span class="keywordflow">case</span> event_KEY: |
|
213 <a name="l00203"></a>00203 tWindow = pEvent->data.key.caret.window; |
|
214 <a name="l00204"></a>00204 <span class="keywordflow">break</span>; |
|
215 <a name="l00205"></a>00205 <span class="keywordflow">default</span>: |
|
216 <a name="l00206"></a>00206 DBG_DEC(pEvent->type); |
|
217 <a name="l00207"></a>00207 <span class="keywordflow">return</span> FALSE; |
|
218 <a name="l00208"></a>00208 } |
|
219 <a name="l00209"></a>00209 <span class="keywordflow">if</span> (tWindow != pDiag->tMainWindow) { |
|
220 <a name="l00210"></a>00210 <span class="keywordflow">return</span> FALSE; |
|
221 <a name="l00211"></a>00211 } |
|
222 <a name="l00212"></a>00212 |
|
223 <a name="l00213"></a>00213 <span class="comment">/* Delete the main window */</span> |
|
224 <a name="l00214"></a>00214 Window_Delete(pDiag->tMainWindow); |
|
225 <a name="l00215"></a>00215 pDiag->tMainWindow = 0; |
|
226 <a name="l00216"></a>00216 |
|
227 <a name="l00217"></a>00217 <span class="comment">/* Delete the scale window */</span> |
|
228 <a name="l00218"></a>00218 Window_Delete(pDiag->tScaleWindow); |
|
229 <a name="l00219"></a>00219 pDiag->tScaleWindow = 0; |
|
230 <a name="l00220"></a>00220 |
|
231 <a name="l00221"></a>00221 <span class="preprocessor">#if defined(__GNUC__)</span> |
|
232 <a name="l00222"></a>00222 <span class="preprocessor"></span> <span class="comment">/*</span> |
|
233 <a name="l00223"></a>00223 <span class="comment"> * Remove all references to the diagram that will be free-ed</span> |
|
234 <a name="l00224"></a>00224 <span class="comment"> * by undoing the EventMsg_Claim's from within the Menu_Warn's</span> |
|
235 <a name="l00225"></a>00225 <span class="comment"> */</span> |
|
236 <a name="l00226"></a>00226 <span class="keywordflow">while</span> (EventMsg_ReleaseSpecific(message_MENUWARNING, window_ANY, |
|
237 <a name="l00227"></a>00227 bSaveTextfile, pDiag)) |
|
238 <a name="l00228"></a>00228 ; <span class="comment">/* EMPTY */</span> |
|
239 <a name="l00229"></a>00229 <span class="keywordflow">while</span> (EventMsg_ReleaseSpecific(message_MENUWARNING, window_ANY, |
|
240 <a name="l00230"></a>00230 bSaveDrawfile, pDiag)) |
|
241 <a name="l00231"></a>00231 ; <span class="comment">/* EMPTY */</span> |
|
242 <a name="l00232"></a>00232 <span class="keywordflow">while</span> (EventMsg_ReleaseSpecific(message_MENUWARNING, window_ANY, |
|
243 <a name="l00233"></a>00233 bScaleOpenAction, pDiag)) |
|
244 <a name="l00234"></a>00234 ; <span class="comment">/* EMPTY */</span> |
|
245 <a name="l00235"></a>00235 <span class="preprocessor">#endif </span><span class="comment">/* __GNUC__ */</span> |
|
246 <a name="l00236"></a>00236 |
|
247 <a name="l00237"></a>00237 <span class="comment">/* Free the memory */</span> |
|
248 <a name="l00238"></a>00238 <span class="keywordflow">if</span> (pDiag->tInfo.data != NULL && pDiag->tMemorySize != 0) { |
|
249 <a name="l00239"></a>00239 flex_free((flex_ptr)&pDiag->tInfo.data); |
|
250 <a name="l00240"></a>00240 } |
|
251 <a name="l00241"></a>00241 <span class="comment">/* Just to be on the save side */</span> |
|
252 <a name="l00242"></a>00242 pDiag->tInfo.data = NULL; |
|
253 <a name="l00243"></a>00243 pDiag->tInfo.length = 0; |
|
254 <a name="l00244"></a>00244 pDiag->tMemorySize = 0; |
|
255 <a name="l00245"></a>00245 |
|
256 <a name="l00246"></a>00246 <span class="comment">/* Destroy the diagram itself */</span> |
|
257 <a name="l00247"></a>00247 pDiag = xfree(pDiag); |
|
258 <a name="l00248"></a>00248 <span class="keywordflow">return</span> TRUE; |
|
259 <a name="l00249"></a>00249 } <span class="comment">/* end of bDestroyDiagram */</span> |
|
260 <a name="l00250"></a>00250 |
|
261 <a name="l00251"></a>00251 <span class="comment">/*</span> |
|
262 <a name="l00252"></a>00252 <span class="comment"> * vExtendDiagramSize - make sure the diagram is big enough</span> |
|
263 <a name="l00253"></a>00253 <span class="comment"> */</span> |
|
264 <a name="l00254"></a>00254 <span class="keyword">static</span> <span class="keywordtype">void</span> |
|
265 <a name="l00255"></a>00255 vExtendDiagramSize(diagram_type *pDiag, <span class="keywordtype">size_t</span> tSize) |
|
266 <a name="l00256"></a>00256 { |
|
267 <a name="l00257"></a>00257 TRACE_MSG(<span class="stringliteral">"vExtendDiagramSize"</span>); |
|
268 <a name="l00258"></a>00258 |
|
269 <a name="l00259"></a>00259 fail(pDiag == NULL || tSize % 4 != 0); |
|
270 <a name="l00260"></a>00260 |
|
271 <a name="l00261"></a>00261 <span class="keywordflow">while</span> (pDiag->tInfo.length + tSize > pDiag->tMemorySize) { |
|
272 <a name="l00262"></a>00262 <span class="keywordflow">if</span> (flex_extend((flex_ptr)&pDiag->tInfo.data, |
|
273 <a name="l00263"></a>00263 pDiag->tMemorySize + EXTENSION_SIZE) != 1) { |
|
274 <a name="l00264"></a>00264 werr(1, <span class="stringliteral">"Memory extend failed, unable to continue"</span>); |
|
275 <a name="l00265"></a>00265 } |
|
276 <a name="l00266"></a>00266 pDiag->tMemorySize += EXTENSION_SIZE; |
|
277 <a name="l00267"></a>00267 NO_DBG_DEC(pDiag->tMemorySize); |
|
278 <a name="l00268"></a>00268 } |
|
279 <a name="l00269"></a>00269 TRACE_MSG(<span class="stringliteral">"end of vExtendDiagramSize"</span>); |
|
280 <a name="l00270"></a>00270 } <span class="comment">/* end of vExtendDiagramSize */</span> |
|
281 <a name="l00271"></a>00271 |
|
282 <a name="l00272"></a>00272 <span class="comment">/*</span> |
|
283 <a name="l00273"></a>00273 <span class="comment"> * vPrologue2 - prologue part 2; add a font list to a diagram</span> |
|
284 <a name="l00274"></a>00274 <span class="comment"> */</span> |
|
285 <a name="l00275"></a>00275 <span class="keywordtype">void</span> |
|
286 <a name="l00276"></a>00276 vPrologue2(diagram_type *pDiag, <span class="keywordtype">int</span> iWordVersion) |
|
287 <a name="l00277"></a>00277 { |
|
288 <a name="l00278"></a>00278 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pNew; |
|
289 <a name="l00279"></a>00279 <span class="keyword">const</span> font_table_type *pTmp; |
|
290 <a name="l00280"></a>00280 <span class="keywordtype">char</span> *pcTmp; |
|
291 <a name="l00281"></a>00281 <span class="keywordtype">size_t</span> tRealSize, tSize; |
|
292 <a name="l00282"></a>00282 <span class="keywordtype">int</span> iCount; |
|
293 <a name="l00283"></a>00283 |
|
294 <a name="l00284"></a>00284 TRACE_MSG(<span class="stringliteral">"vPrologue2"</span>); |
|
295 <a name="l00285"></a>00285 |
|
296 <a name="l00286"></a>00286 fail(pDiag == NULL); |
|
297 <a name="l00287"></a>00287 |
|
298 <a name="l00288"></a>00288 <span class="keywordflow">if</span> (tGetFontTableLength() == 0) { |
|
299 <a name="l00289"></a>00289 <span class="keywordflow">return</span>; |
|
300 <a name="l00290"></a>00290 } |
|
301 <a name="l00291"></a>00291 tRealSize = offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data); |
|
302 <a name="l00292"></a>00292 pTmp = NULL; |
|
303 <a name="l00293"></a>00293 <span class="keywordflow">while</span> ((pTmp = pGetNextFontTableRecord(pTmp)) != NULL) { |
|
304 <a name="l00294"></a>00294 tRealSize += 2 + strlen(pTmp->szOurFontname); |
|
305 <a name="l00295"></a>00295 } |
|
306 <a name="l00296"></a>00296 DBG_DEC(tRealSize); |
|
307 <a name="l00297"></a>00297 tSize = ROUND4(tRealSize); |
|
308 <a name="l00298"></a>00298 vExtendDiagramSize(pDiag, tSize); |
|
309 <a name="l00299"></a>00299 pNew = xmalloc(tSize); |
|
310 <a name="l00300"></a>00300 memset(pNew, 0, tSize); |
|
311 <a name="l00301"></a>00301 pNew->type = drawfile_TYPE_FONT_TABLE; |
|
312 <a name="l00302"></a>00302 pNew->size = tSize; |
|
313 <a name="l00303"></a>00303 pcTmp = (<span class="keywordtype">char</span> *)&pNew->data.font_table.font_def[0].font_ref; |
|
314 <a name="l00304"></a>00304 iCount = 0; |
|
315 <a name="l00305"></a>00305 pTmp = NULL; |
|
316 <a name="l00306"></a>00306 while ((pTmp = pGetNextFontTableRecord(pTmp)) != NULL) { |
|
317 <a name="l00307"></a>00307 *pcTmp = ++iCount; |
|
318 <a name="l00308"></a>00308 pcTmp++; |
|
319 <a name="l00309"></a>00309 strcpy(pcTmp, pTmp->szOurFontname); |
|
320 <a name="l00310"></a>00310 pcTmp += 1 + strlen(pTmp->szOurFontname); |
|
321 <a name="l00311"></a>00311 } |
|
322 <a name="l00312"></a>00312 Error_CheckFatal(Drawfile_AppendObject(&pDiag->tInfo, |
|
323 <a name="l00313"></a>00313 pDiag->tMemorySize, pNew, TRUE)); |
|
324 <a name="l00314"></a>00314 pNew = xfree(pNew); |
|
325 <a name="l00315"></a>00315 } <span class="comment">/* end of vPrologue2 */</span> |
|
326 <a name="l00316"></a>00316 |
|
327 <a name="l00317"></a>00317 <span class="comment">/*</span> |
|
328 <a name="l00318"></a>00318 <span class="comment"> * vSubstring2Diagram - put a sub string into a diagram</span> |
|
329 <a name="l00319"></a>00319 <span class="comment"> */</span> |
|
330 <a name="l00320"></a>00320 <span class="keywordtype">void</span> |
|
331 <a name="l00321"></a>00321 vSubstring2Diagram(diagram_type *pDiag, |
|
332 <a name="l00322"></a>00322 <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, <span class="keywordtype">long</span> lStringWidth, |
|
333 <a name="l00323"></a>00323 UCHAR ucFontColor, USHORT usFontstyle, drawfile_fontref tFontRef, |
|
334 <a name="l00324"></a>00324 USHORT usFontSize, USHORT usMaxFontSize) |
|
335 <a name="l00325"></a>00325 { |
|
336 <a name="l00326"></a>00326 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pNew; |
|
337 <a name="l00327"></a>00327 <span class="keywordtype">long</span> lSizeX, lSizeY, lOffset, l20, lYMove; |
|
338 <a name="l00328"></a>00328 <span class="keywordtype">size_t</span> tRealSize, tSize; |
|
339 <a name="l00329"></a>00329 |
|
340 <a name="l00330"></a>00330 TRACE_MSG(<span class="stringliteral">"vSubstring2Diagram"</span>); |
|
341 <a name="l00331"></a>00331 |
|
342 <a name="l00332"></a>00332 fail(pDiag == NULL || szString == NULL); |
|
343 <a name="l00333"></a>00333 fail(pDiag->lXleft < 0); |
|
344 <a name="l00334"></a>00334 fail(tStringLength != strlen(szString)); |
|
345 <a name="l00335"></a>00335 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); |
|
346 <a name="l00336"></a>00336 fail(usMaxFontSize < MIN_FONT_SIZE || usMaxFontSize > MAX_FONT_SIZE); |
|
347 <a name="l00337"></a>00337 fail(usFontSize > usMaxFontSize); |
|
348 <a name="l00338"></a>00338 |
|
349 <a name="l00339"></a>00339 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { |
|
350 <a name="l00340"></a>00340 <span class="keywordflow">return</span>; |
|
351 <a name="l00341"></a>00341 } |
|
352 <a name="l00342"></a>00342 |
|
353 <a name="l00343"></a>00343 <span class="keywordflow">if</span> (tFontRef == 0) { |
|
354 <a name="l00344"></a>00344 lOffset = Drawfile_ScreenToDraw(2); |
|
355 <a name="l00345"></a>00345 l20 = Drawfile_ScreenToDraw(32 + 3); |
|
356 <a name="l00346"></a>00346 lSizeX = Drawfile_ScreenToDraw(16); |
|
357 <a name="l00347"></a>00347 lSizeY = Drawfile_ScreenToDraw(32); |
|
358 <a name="l00348"></a>00348 } <span class="keywordflow">else</span> { |
|
359 <a name="l00349"></a>00349 lOffset = lToBaseLine(usMaxFontSize); |
|
360 <a name="l00350"></a>00350 l20 = lWord2DrawUnits20(usMaxFontSize); |
|
361 <a name="l00351"></a>00351 lSizeX = lWord2DrawUnits00(usFontSize); |
|
362 <a name="l00352"></a>00352 lSizeY = lWord2DrawUnits00(usFontSize); |
|
363 <a name="l00353"></a>00353 } |
|
364 <a name="l00354"></a>00354 |
|
365 <a name="l00355"></a>00355 lYMove = 0; |
|
366 <a name="l00356"></a>00356 |
|
367 <a name="l00357"></a>00357 <span class="comment">/* Up for superscript */</span> |
|
368 <a name="l00358"></a>00358 <span class="keywordflow">if</span> (bIsSuperscript(usFontstyle)) { |
|
369 <a name="l00359"></a>00359 lYMove = lMilliPoints2DrawUnits((((<span class="keywordtype">long</span>)usFontSize + 1) / 2) * 375); |
|
370 <a name="l00360"></a>00360 } |
|
371 <a name="l00361"></a>00361 <span class="comment">/* Down for subscript */</span> |
|
372 <a name="l00362"></a>00362 <span class="keywordflow">if</span> (bIsSubscript(usFontstyle)) { |
|
373 <a name="l00363"></a>00363 lYMove = -lMilliPoints2DrawUnits((<span class="keywordtype">long</span>)usFontSize * 125); |
|
374 <a name="l00364"></a>00364 } |
|
375 <a name="l00365"></a>00365 |
|
376 <a name="l00366"></a>00366 tRealSize = offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data); |
|
377 <a name="l00367"></a>00367 tRealSize += <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__text.html">drawfile_text</a>) + tStringLength; |
|
378 <a name="l00368"></a>00368 tSize = ROUND4(tRealSize); |
|
379 <a name="l00369"></a>00369 vExtendDiagramSize(pDiag, tSize); |
|
380 <a name="l00370"></a>00370 pNew = xmalloc(tSize); |
|
381 <a name="l00371"></a>00371 memset(pNew, 0, tSize); |
|
382 <a name="l00372"></a>00372 pNew->type = drawfile_TYPE_TEXT; |
|
383 <a name="l00373"></a>00373 pNew->size = tSize; |
|
384 <a name="l00374"></a>00374 pNew->data.text.bbox.min.x = (int)pDiag->lXleft; |
|
385 <a name="l00375"></a>00375 pNew->data.text.bbox.min.y = (<span class="keywordtype">int</span>)(pDiag->lYtop + lYMove); |
|
386 <a name="l00376"></a>00376 pNew->data.text.bbox.max.x = (int)(pDiag->lXleft + lStringWidth); |
|
387 <a name="l00377"></a>00377 pNew->data.text.bbox.max.y = (int)(pDiag->lYtop + l20 + lYMove); |
|
388 <a name="l00378"></a>00378 pNew->data.text.fill.value = (int)ulColor2Color(ucFontColor); |
|
389 <a name="l00379"></a>00379 pNew->data.text.bg_hint.value = 0xffffff00; <span class="comment">/* White */</span> |
|
390 <a name="l00380"></a>00380 pNew->data.text.style.font_ref = tFontRef; |
|
391 <a name="l00381"></a>00381 pNew->data.text.style.reserved[0] = 0; |
|
392 <a name="l00382"></a>00382 pNew->data.text.style.reserved[1] = 0; |
|
393 <a name="l00383"></a>00383 pNew->data.text.style.reserved[2] = 0; |
|
394 <a name="l00384"></a>00384 pNew->data.text.xsize = (int)lSizeX; |
|
395 <a name="l00385"></a>00385 pNew->data.text.ysize = (int)lSizeY; |
|
396 <a name="l00386"></a>00386 pNew->data.text.base.x = (int)pDiag->lXleft; |
|
397 <a name="l00387"></a>00387 pNew->data.text.base.y = (<span class="keywordtype">int</span>)(pDiag->lYtop + lOffset + lYMove); |
|
398 <a name="l00388"></a>00388 strncpy(pNew->data.text.text, szString, tStringLength); |
|
399 <a name="l00389"></a>00389 pNew->data.text.text[tStringLength] = <span class="charliteral">'\0'</span>; |
|
400 <a name="l00390"></a>00390 Error_CheckFatal(Drawfile_AppendObject(&pDiag->tInfo, |
|
401 <a name="l00391"></a>00391 pDiag->tMemorySize, pNew, TRUE)); |
|
402 <a name="l00392"></a>00392 pNew = xfree(pNew); |
|
403 <a name="l00393"></a>00393 <span class="comment">/*draw_translateText(&pDiag->tInfo);*/</span> |
|
404 <a name="l00394"></a>00394 pDiag->lXleft += lStringWidth; |
|
405 <a name="l00395"></a>00395 TRACE_MSG(<span class="stringliteral">"leaving vSubstring2Diagram"</span>); |
|
406 <a name="l00396"></a>00396 } <span class="comment">/* end of vSubstring2Diagram */</span> |
|
407 <a name="l00397"></a>00397 |
|
408 <a name="l00398"></a>00398 <span class="comment">/*</span> |
|
409 <a name="l00399"></a>00399 <span class="comment"> * vImage2Diagram - put an image into a diagram</span> |
|
410 <a name="l00400"></a>00400 <span class="comment"> */</span> |
|
411 <a name="l00401"></a>00401 <span class="keywordtype">void</span> |
|
412 <a name="l00402"></a>00402 vImage2Diagram(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg, |
|
413 <a name="l00403"></a>00403 UCHAR *pucImage, <span class="keywordtype">size_t</span> tImageSize) |
|
414 <a name="l00404"></a>00404 { |
|
415 <a name="l00405"></a>00405 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pNew; |
|
416 <a name="l00406"></a>00406 <span class="keywordtype">long</span> lWidth, lHeight; |
|
417 <a name="l00407"></a>00407 <span class="keywordtype">size_t</span> tRealSize, tSize; |
|
418 <a name="l00408"></a>00408 |
|
419 <a name="l00409"></a>00409 TRACE_MSG(<span class="stringliteral">"vImage2Diagram"</span>); |
|
420 <a name="l00410"></a>00410 |
|
421 <a name="l00411"></a>00411 fail(pDiag == NULL); |
|
422 <a name="l00412"></a>00412 fail(pImg == NULL); |
|
423 <a name="l00413"></a>00413 fail(pDiag->lXleft < 0); |
|
424 <a name="l00414"></a>00414 fail(pImg->eImageType != imagetype_is_dib && |
|
425 <a name="l00415"></a>00415 pImg->eImageType != imagetype_is_jpeg); |
|
426 <a name="l00416"></a>00416 |
|
427 <a name="l00417"></a>00417 DBG_DEC_C(pDiag->lXleft != 0, pDiag->lXleft); |
|
428 <a name="l00418"></a>00418 |
|
429 <a name="l00419"></a>00419 lWidth = lPoints2DrawUnits(pImg->iHorSizeScaled); |
|
430 <a name="l00420"></a>00420 lHeight = lPoints2DrawUnits(pImg->iVerSizeScaled); |
|
431 <a name="l00421"></a>00421 DBG_DEC(lWidth); |
|
432 <a name="l00422"></a>00422 DBG_DEC(lHeight); |
|
433 <a name="l00423"></a>00423 |
|
434 <a name="l00424"></a>00424 pDiag->lYtop -= lHeight; |
|
435 <a name="l00425"></a>00425 |
|
436 <a name="l00426"></a>00426 tRealSize = offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data); |
|
437 <a name="l00427"></a>00427 <span class="keywordflow">switch</span> (pImg->eImageType) { |
|
438 <a name="l00428"></a>00428 <span class="keywordflow">case</span> imagetype_is_dib: |
|
439 <a name="l00429"></a>00429 tRealSize += <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__sprite.html">drawfile_sprite</a>) + tImageSize; |
|
440 <a name="l00430"></a>00430 tSize = ROUND4(tRealSize); |
|
441 <a name="l00431"></a>00431 vExtendDiagramSize(pDiag, tSize); |
|
442 <a name="l00432"></a>00432 pNew = xmalloc(tSize); |
|
443 <a name="l00433"></a>00433 memset(pNew, 0, tSize); |
|
444 <a name="l00434"></a>00434 pNew->type = drawfile_TYPE_SPRITE; |
|
445 <a name="l00435"></a>00435 pNew->size = tSize; |
|
446 <a name="l00436"></a>00436 pNew->data.sprite.bbox.min.x = (int)pDiag->lXleft; |
|
447 <a name="l00437"></a>00437 pNew->data.sprite.bbox.min.y = (<span class="keywordtype">int</span>)pDiag->lYtop; |
|
448 <a name="l00438"></a>00438 pNew->data.sprite.bbox.max.x = (int)(pDiag->lXleft + lWidth); |
|
449 <a name="l00439"></a>00439 pNew->data.sprite.bbox.max.y = (int)(pDiag->lYtop + lHeight); |
|
450 <a name="l00440"></a>00440 memcpy(&pNew->data.sprite.header, pucImage, tImageSize); |
|
451 <a name="l00441"></a>00441 <span class="keywordflow">break</span>; |
|
452 <a name="l00442"></a>00442 <span class="keywordflow">case</span> imagetype_is_jpeg: |
|
453 <a name="l00443"></a>00443 <span class="preprocessor">#if defined(DEBUG)</span> |
|
454 <a name="l00444"></a>00444 <span class="preprocessor"></span> (void)bGetJpegInfo(pucImage, tImageSize); |
|
455 <a name="l00445"></a>00445 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> |
|
456 <a name="l00446"></a>00446 tRealSize += <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__jpeg.html">drawfile_jpeg</a>) + tImageSize; |
|
457 <a name="l00447"></a>00447 tSize = ROUND4(tRealSize); |
|
458 <a name="l00448"></a>00448 vExtendDiagramSize(pDiag, tSize); |
|
459 <a name="l00449"></a>00449 pNew = xmalloc(tSize); |
|
460 <a name="l00450"></a>00450 memset(pNew, 0, tSize); |
|
461 <a name="l00451"></a>00451 pNew->type = drawfile_TYPE_JPEG; |
|
462 <a name="l00452"></a>00452 pNew->size = tSize; |
|
463 <a name="l00453"></a>00453 pNew->data.jpeg.bbox.min.x = (int)pDiag->lXleft; |
|
464 <a name="l00454"></a>00454 pNew->data.jpeg.bbox.min.y = (<span class="keywordtype">int</span>)pDiag->lYtop; |
|
465 <a name="l00455"></a>00455 pNew->data.jpeg.bbox.max.x = (int)(pDiag->lXleft + lWidth); |
|
466 <a name="l00456"></a>00456 pNew->data.jpeg.bbox.max.y = (int)(pDiag->lYtop + lHeight); |
|
467 <a name="l00457"></a>00457 pNew->data.jpeg.width = (int)lWidth; |
|
468 <a name="l00458"></a>00458 pNew->data.jpeg.height = (int)lHeight; |
|
469 <a name="l00459"></a>00459 pNew->data.jpeg.xdpi = 90; |
|
470 <a name="l00460"></a>00460 pNew->data.jpeg.ydpi = 90; |
|
471 <a name="l00461"></a>00461 pNew->data.jpeg.trfm.entries[0][0] = 0x10000; |
|
472 <a name="l00462"></a>00462 pNew->data.jpeg.trfm.entries[0][1] = 0; |
|
473 <a name="l00463"></a>00463 pNew->data.jpeg.trfm.entries[1][0] = 0; |
|
474 <a name="l00464"></a>00464 pNew->data.jpeg.trfm.entries[1][1] = 0x10000; |
|
475 <a name="l00465"></a>00465 pNew->data.jpeg.trfm.entries[2][0] = (int)pDiag->lXleft; |
|
476 <a name="l00466"></a>00466 pNew->data.jpeg.trfm.entries[2][1] = (<span class="keywordtype">int</span>)pDiag->lYtop; |
|
477 <a name="l00467"></a>00467 pNew->data.jpeg.len = tImageSize; |
|
478 <a name="l00468"></a>00468 memcpy(pNew->data.jpeg.data, pucImage, tImageSize); |
|
479 <a name="l00469"></a>00469 <span class="keywordflow">break</span>; |
|
480 <a name="l00470"></a>00470 <span class="keywordflow">default</span>: |
|
481 <a name="l00471"></a>00471 DBG_DEC(pImg->eImageType); |
|
482 <a name="l00472"></a>00472 pNew = NULL; |
|
483 <a name="l00473"></a>00473 <span class="keywordflow">break</span>; |
|
484 <a name="l00474"></a>00474 } |
|
485 <a name="l00475"></a>00475 |
|
486 <a name="l00476"></a>00476 Error_CheckFatal(Drawfile_AppendObject(&pDiag->tInfo, |
|
487 <a name="l00477"></a>00477 pDiag->tMemorySize, pNew, TRUE)); |
|
488 <a name="l00478"></a>00478 pNew = xfree(pNew); |
|
489 <a name="l00479"></a>00479 pDiag->lXleft = 0; |
|
490 <a name="l00480"></a>00480 } <span class="comment">/* end of vImage2Diagram */</span> |
|
491 <a name="l00481"></a>00481 |
|
492 <a name="l00482"></a>00482 <span class="comment">/*</span> |
|
493 <a name="l00483"></a>00483 <span class="comment"> * bAddDummyImage - add a dummy image</span> |
|
494 <a name="l00484"></a>00484 <span class="comment"> *</span> |
|
495 <a name="l00485"></a>00485 <span class="comment"> * return TRUE when successful, otherwise FALSE</span> |
|
496 <a name="l00486"></a>00486 <span class="comment"> */</span> |
|
497 <a name="l00487"></a>00487 BOOL |
|
498 <a name="l00488"></a>00488 bAddDummyImage(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg) |
|
499 <a name="l00489"></a>00489 { |
|
500 <a name="l00490"></a>00490 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pNew; |
|
501 <a name="l00491"></a>00491 <span class="keywordtype">int</span> *piTmp; |
|
502 <a name="l00492"></a>00492 <span class="keywordtype">long</span> lWidth, lHeight; |
|
503 <a name="l00493"></a>00493 <span class="keywordtype">size_t</span> tRealSize, tSize; |
|
504 <a name="l00494"></a>00494 |
|
505 <a name="l00495"></a>00495 TRACE_MSG(<span class="stringliteral">"bAddDummyImage"</span>); |
|
506 <a name="l00496"></a>00496 |
|
507 <a name="l00497"></a>00497 fail(pDiag == NULL); |
|
508 <a name="l00498"></a>00498 fail(pImg == NULL); |
|
509 <a name="l00499"></a>00499 fail(pDiag->lXleft < 0); |
|
510 <a name="l00500"></a>00500 |
|
511 <a name="l00501"></a>00501 <span class="keywordflow">if</span> (pImg->iVerSizeScaled <= 0 || pImg->iHorSizeScaled <= 0) { |
|
512 <a name="l00502"></a>00502 <span class="keywordflow">return</span> FALSE; |
|
513 <a name="l00503"></a>00503 } |
|
514 <a name="l00504"></a>00504 |
|
515 <a name="l00505"></a>00505 DBG_DEC_C(pDiag->lXleft != 0, pDiag->lXleft); |
|
516 <a name="l00506"></a>00506 |
|
517 <a name="l00507"></a>00507 lWidth = lPoints2DrawUnits(pImg->iHorSizeScaled); |
|
518 <a name="l00508"></a>00508 lHeight = lPoints2DrawUnits(pImg->iVerSizeScaled); |
|
519 <a name="l00509"></a>00509 |
|
520 <a name="l00510"></a>00510 pDiag->lYtop -= lHeight; |
|
521 <a name="l00511"></a>00511 |
|
522 <a name="l00512"></a>00512 tRealSize = offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data); |
|
523 <a name="l00513"></a>00513 tRealSize += <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__path.html">drawfile_path</a>) + (14 - 1) * <span class="keyword">sizeof</span>(int); |
|
524 <a name="l00514"></a>00514 tSize = ROUND4(tRealSize); |
|
525 <a name="l00515"></a>00515 vExtendDiagramSize(pDiag, tSize); |
|
526 <a name="l00516"></a>00516 pNew = xmalloc(tSize); |
|
527 <a name="l00517"></a>00517 memset(pNew, 0, tSize); |
|
528 <a name="l00518"></a>00518 pNew->type = drawfile_TYPE_PATH; |
|
529 <a name="l00519"></a>00519 pNew->size = tSize; |
|
530 <a name="l00520"></a>00520 pNew->data.path.bbox.min.x = (int)pDiag->lXleft; |
|
531 <a name="l00521"></a>00521 pNew->data.path.bbox.min.y = (<span class="keywordtype">int</span>)pDiag->lYtop; |
|
532 <a name="l00522"></a>00522 pNew->data.path.bbox.max.x = (int)(pDiag->lXleft + lWidth); |
|
533 <a name="l00523"></a>00523 pNew->data.path.bbox.max.y = (int)(pDiag->lYtop + lHeight); |
|
534 <a name="l00524"></a>00524 pNew->data.path.fill.value = -1; |
|
535 <a name="l00525"></a>00525 pNew->data.path.outline.value = 0x4d4d4d00; <span class="comment">/* Gray 70 percent */</span> |
|
536 <a name="l00526"></a>00526 pNew->data.path.width = (int)lMilliPoints2DrawUnits(500); |
|
537 <a name="l00527"></a>00527 pNew->data.path.style.flags = 0; |
|
538 <a name="l00528"></a>00528 pNew->data.path.style.reserved = 0; |
|
539 <a name="l00529"></a>00529 pNew->data.path.style.cap_width = 0; |
|
540 <a name="l00530"></a>00530 pNew->data.path.style.cap_length = 0; |
|
541 <a name="l00531"></a>00531 piTmp = pNew->data.path.path; |
|
542 <a name="l00532"></a>00532 *piTmp++ = drawfile_PATH_MOVE_TO; |
|
543 <a name="l00533"></a>00533 *piTmp++ = pNew->data.path.bbox.min.x; |
|
544 <a name="l00534"></a>00534 *piTmp++ = pNew->data.path.bbox.min.y; |
|
545 <a name="l00535"></a>00535 *piTmp++ = drawfile_PATH_LINE_TO; |
|
546 <a name="l00536"></a>00536 *piTmp++ = pNew->data.path.bbox.min.x; |
|
547 <a name="l00537"></a>00537 *piTmp++ = pNew->data.path.bbox.max.y; |
|
548 <a name="l00538"></a>00538 *piTmp++ = drawfile_PATH_LINE_TO; |
|
549 <a name="l00539"></a>00539 *piTmp++ = pNew->data.path.bbox.max.x; |
|
550 <a name="l00540"></a>00540 *piTmp++ = pNew->data.path.bbox.max.y; |
|
551 <a name="l00541"></a>00541 *piTmp++ = drawfile_PATH_LINE_TO; |
|
552 <a name="l00542"></a>00542 *piTmp++ = pNew->data.path.bbox.max.x; |
|
553 <a name="l00543"></a>00543 *piTmp++ = pNew->data.path.bbox.min.y; |
|
554 <a name="l00544"></a>00544 *piTmp++ = drawfile_PATH_CLOSE_LINE; |
|
555 <a name="l00545"></a>00545 *piTmp++ = drawfile_PATH_END_PATH; |
|
556 <a name="l00546"></a>00546 |
|
557 <a name="l00547"></a>00547 Error_CheckFatal(Drawfile_AppendObject(&pDiag->tInfo, |
|
558 <a name="l00548"></a>00548 pDiag->tMemorySize, pNew, TRUE)); |
|
559 <a name="l00549"></a>00549 pNew = xfree(pNew); |
|
560 <a name="l00550"></a>00550 pDiag->lXleft = 0; |
|
561 <a name="l00551"></a>00551 <span class="keywordflow">return</span> TRUE; |
|
562 <a name="l00552"></a>00552 } <span class="comment">/* end of bAddDummyImage */</span> |
|
563 <a name="l00553"></a>00553 |
|
564 <a name="l00554"></a>00554 <span class="comment">/*</span> |
|
565 <a name="l00555"></a>00555 <span class="comment"> * vMove2NextLine - move to the next line</span> |
|
566 <a name="l00556"></a>00556 <span class="comment"> */</span> |
|
567 <a name="l00557"></a>00557 <span class="keywordtype">void</span> |
|
568 <a name="l00558"></a>00558 vMove2NextLine(diagram_type *pDiag, drawfile_fontref tFontRef, |
|
569 <a name="l00559"></a>00559 USHORT usFontSize) |
|
570 <a name="l00560"></a>00560 { |
|
571 <a name="l00561"></a>00561 <span class="keywordtype">long</span> l20; |
|
572 <a name="l00562"></a>00562 |
|
573 <a name="l00563"></a>00563 TRACE_MSG(<span class="stringliteral">"vMove2NextLine"</span>); |
|
574 <a name="l00564"></a>00564 |
|
575 <a name="l00565"></a>00565 fail(pDiag == NULL); |
|
576 <a name="l00566"></a>00566 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); |
|
577 <a name="l00567"></a>00567 |
|
578 <a name="l00568"></a>00568 <span class="keywordflow">if</span> (tFontRef == 0) { |
|
579 <a name="l00569"></a>00569 l20 = Drawfile_ScreenToDraw(32 + 3); |
|
580 <a name="l00570"></a>00570 } <span class="keywordflow">else</span> { |
|
581 <a name="l00571"></a>00571 l20 = lWord2DrawUnits20(usFontSize); |
|
582 <a name="l00572"></a>00572 } |
|
583 <a name="l00573"></a>00573 pDiag->lYtop -= l20; |
|
584 <a name="l00574"></a>00574 } <span class="comment">/* end of vMove2NextLine */</span> |
|
585 <a name="l00575"></a>00575 |
|
586 <a name="l00576"></a>00576 <span class="comment">/*</span> |
|
587 <a name="l00577"></a>00577 <span class="comment"> * Create an start of paragraph (Phase 1)</span> |
|
588 <a name="l00578"></a>00578 <span class="comment"> */</span> |
|
589 <a name="l00579"></a>00579 <span class="keywordtype">void</span> |
|
590 <a name="l00580"></a>00580 vStartOfParagraph1(diagram_type *pDiag, <span class="keywordtype">long</span> lBeforeIndentation) |
|
591 <a name="l00581"></a>00581 { |
|
592 <a name="l00582"></a>00582 TRACE_MSG(<span class="stringliteral">"vStartOfParagraph1"</span>); |
|
593 <a name="l00583"></a>00583 |
|
594 <a name="l00584"></a>00584 fail(pDiag == NULL); |
|
595 <a name="l00585"></a>00585 fail(lBeforeIndentation < 0); |
|
596 <a name="l00586"></a>00586 |
|
597 <a name="l00587"></a>00587 pDiag->lXleft = 0; |
|
598 <a name="l00588"></a>00588 pDiag->lYtop -= lMilliPoints2DrawUnits(lBeforeIndentation); |
|
599 <a name="l00589"></a>00589 } <span class="comment">/* end of vStartOfParagraph1 */</span> |
|
600 <a name="l00590"></a>00590 |
|
601 <a name="l00591"></a>00591 <span class="comment">/*</span> |
|
602 <a name="l00592"></a>00592 <span class="comment"> * Create an start of paragraph (Phase 2)</span> |
|
603 <a name="l00593"></a>00593 <span class="comment"> * DUMMY function</span> |
|
604 <a name="l00594"></a>00594 <span class="comment"> */</span> |
|
605 <a name="l00595"></a>00595 <span class="keywordtype">void</span> |
|
606 <a name="l00596"></a>00596 vStartOfParagraph2(diagram_type *pDiag) |
|
607 <a name="l00597"></a>00597 { |
|
608 <a name="l00598"></a>00598 TRACE_MSG(<span class="stringliteral">"vStartOfParagraph2"</span>); |
|
609 <a name="l00599"></a>00599 } <span class="comment">/* end of vStartOfParagraph2 */</span> |
|
610 <a name="l00600"></a>00600 |
|
611 <a name="l00601"></a>00601 <span class="comment">/*</span> |
|
612 <a name="l00602"></a>00602 <span class="comment"> * Create an end of paragraph</span> |
|
613 <a name="l00603"></a>00603 <span class="comment"> */</span> |
|
614 <a name="l00604"></a>00604 <span class="keywordtype">void</span> |
|
615 <a name="l00605"></a>00605 vEndOfParagraph(diagram_type *pDiag, |
|
616 <a name="l00606"></a>00606 drawfile_fontref tFontRef, USHORT usFontSize, <span class="keywordtype">long</span> lAfterIndentation) |
|
617 <a name="l00607"></a>00607 { |
|
618 <a name="l00608"></a>00608 TRACE_MSG(<span class="stringliteral">"vEndOfParagraph"</span>); |
|
619 <a name="l00609"></a>00609 |
|
620 <a name="l00610"></a>00610 fail(pDiag == NULL); |
|
621 <a name="l00611"></a>00611 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); |
|
622 <a name="l00612"></a>00612 fail(lAfterIndentation < 0); |
|
623 <a name="l00613"></a>00613 |
|
624 <a name="l00614"></a>00614 pDiag->lXleft = 0; |
|
625 <a name="l00615"></a>00615 pDiag->lYtop -= lMilliPoints2DrawUnits(lAfterIndentation); |
|
626 <a name="l00616"></a>00616 } <span class="comment">/* end of vEndOfParagraph */</span> |
|
627 <a name="l00617"></a>00617 |
|
628 <a name="l00618"></a>00618 <span class="comment">/*</span> |
|
629 <a name="l00619"></a>00619 <span class="comment"> * Create an end of page</span> |
|
630 <a name="l00620"></a>00620 <span class="comment"> */</span> |
|
631 <a name="l00621"></a>00621 <span class="keywordtype">void</span> |
|
632 <a name="l00622"></a>00622 vEndOfPage(diagram_type *pDiag, <span class="keywordtype">long</span> lAfterIndentation, BOOL bNewSection) |
|
633 <a name="l00623"></a>00623 { |
|
634 <a name="l00624"></a>00624 TRACE_MSG(<span class="stringliteral">"vEndOfPage"</span>); |
|
635 <a name="l00625"></a>00625 |
|
636 <a name="l00626"></a>00626 fail(pDiag == NULL); |
|
637 <a name="l00627"></a>00627 fail(lAfterIndentation < 0); |
|
638 <a name="l00628"></a>00628 |
|
639 <a name="l00629"></a>00629 pDiag->lXleft = 0; |
|
640 <a name="l00630"></a>00630 pDiag->lYtop -= lMilliPoints2DrawUnits(lAfterIndentation); |
|
641 <a name="l00631"></a>00631 } <span class="comment">/* end of vEndOfPage */</span> |
|
642 <a name="l00632"></a>00632 |
|
643 <a name="l00633"></a>00633 <span class="comment">/*</span> |
|
644 <a name="l00634"></a>00634 <span class="comment"> * vSetHeaders - set the headers</span> |
|
645 <a name="l00635"></a>00635 <span class="comment"> * DUMMY function</span> |
|
646 <a name="l00636"></a>00636 <span class="comment"> */</span> |
|
647 <a name="l00637"></a>00637 <span class="keywordtype">void</span> |
|
648 <a name="l00638"></a>00638 vSetHeaders(diagram_type *pDiag, USHORT usIstd) |
|
649 <a name="l00639"></a>00639 { |
|
650 <a name="l00640"></a>00640 TRACE_MSG(<span class="stringliteral">"vSetHeaders"</span>); |
|
651 <a name="l00641"></a>00641 } <span class="comment">/* end of vSetHeaders */</span> |
|
652 <a name="l00642"></a>00642 |
|
653 <a name="l00643"></a>00643 <span class="comment">/*</span> |
|
654 <a name="l00644"></a>00644 <span class="comment"> * Create a start of list</span> |
|
655 <a name="l00645"></a>00645 <span class="comment"> * DUMMY function</span> |
|
656 <a name="l00646"></a>00646 <span class="comment"> */</span> |
|
657 <a name="l00647"></a>00647 <span class="keywordtype">void</span> |
|
658 <a name="l00648"></a>00648 vStartOfList(diagram_type *pDiag, UCHAR ucNFC, BOOL bIsEndOfTable) |
|
659 <a name="l00649"></a>00649 { |
|
660 <a name="l00650"></a>00650 TRACE_MSG(<span class="stringliteral">"vStartOfList"</span>); |
|
661 <a name="l00651"></a>00651 } <span class="comment">/* end of vStartOfList */</span> |
|
662 <a name="l00652"></a>00652 |
|
663 <a name="l00653"></a>00653 <span class="comment">/*</span> |
|
664 <a name="l00654"></a>00654 <span class="comment"> * Create an end of list</span> |
|
665 <a name="l00655"></a>00655 <span class="comment"> * DUMMY function</span> |
|
666 <a name="l00656"></a>00656 <span class="comment"> */</span> |
|
667 <a name="l00657"></a>00657 <span class="keywordtype">void</span> |
|
668 <a name="l00658"></a>00658 vEndOfList(diagram_type *pDiag) |
|
669 <a name="l00659"></a>00659 { |
|
670 <a name="l00660"></a>00660 TRACE_MSG(<span class="stringliteral">"vEndOfList"</span>); |
|
671 <a name="l00661"></a>00661 } <span class="comment">/* end of vEndOfList */</span> |
|
672 <a name="l00662"></a>00662 |
|
673 <a name="l00663"></a>00663 <span class="comment">/*</span> |
|
674 <a name="l00664"></a>00664 <span class="comment"> * Create a start of a list item</span> |
|
675 <a name="l00665"></a>00665 <span class="comment"> * DUMMY function</span> |
|
676 <a name="l00666"></a>00666 <span class="comment"> */</span> |
|
677 <a name="l00667"></a>00667 <span class="keywordtype">void</span> |
|
678 <a name="l00668"></a>00668 vStartOfListItem(diagram_type *pDiag, BOOL bNoMarks) |
|
679 <a name="l00669"></a>00669 { |
|
680 <a name="l00670"></a>00670 TRACE_MSG(<span class="stringliteral">"vStartOfListItem"</span>); |
|
681 <a name="l00671"></a>00671 } <span class="comment">/* end of vStartOfListItem */</span> |
|
682 <a name="l00672"></a>00672 |
|
683 <a name="l00673"></a>00673 <span class="comment">/*</span> |
|
684 <a name="l00674"></a>00674 <span class="comment"> * Create an end of a table</span> |
|
685 <a name="l00675"></a>00675 <span class="comment"> * DUMMY function</span> |
|
686 <a name="l00676"></a>00676 <span class="comment"> */</span> |
|
687 <a name="l00677"></a>00677 <span class="keywordtype">void</span> |
|
688 <a name="l00678"></a>00678 vEndOfTable(diagram_type *pDiag) |
|
689 <a name="l00679"></a>00679 { |
|
690 <a name="l00680"></a>00680 TRACE_MSG(<span class="stringliteral">"vEndOfTable"</span>); |
|
691 <a name="l00681"></a>00681 } <span class="comment">/* end of vEndTable */</span> |
|
692 <a name="l00682"></a>00682 |
|
693 <a name="l00683"></a>00683 <span class="comment">/*</span> |
|
694 <a name="l00684"></a>00684 <span class="comment"> * Add a table row</span> |
|
695 <a name="l00685"></a>00685 <span class="comment"> * DUMMY function</span> |
|
696 <a name="l00686"></a>00686 <span class="comment"> *</span> |
|
697 <a name="l00687"></a>00687 <span class="comment"> * Returns TRUE when conversion type is XML</span> |
|
698 <a name="l00688"></a>00688 <span class="comment"> */</span> |
|
699 <a name="l00689"></a>00689 BOOL |
|
700 <a name="l00690"></a>00690 bAddTableRow(diagram_type *pDiag, <span class="keywordtype">char</span> **aszColTxt, |
|
701 <a name="l00691"></a>00691 <span class="keywordtype">int</span> iNbrOfColumns, <span class="keyword">const</span> <span class="keywordtype">short</span> *asColumnWidth, UCHAR ucBorderInfo) |
|
702 <a name="l00692"></a>00692 { |
|
703 <a name="l00693"></a>00693 TRACE_MSG(<span class="stringliteral">"bAddTableRow"</span>); |
|
704 <a name="l00694"></a>00694 |
|
705 <a name="l00695"></a>00695 <span class="keywordflow">return</span> FALSE; |
|
706 <a name="l00696"></a>00696 } <span class="comment">/* end of bAddTableRow */</span> |
|
707 <a name="l00697"></a>00697 |
|
708 <a name="l00698"></a>00698 <span class="comment">/*</span> |
|
709 <a name="l00699"></a>00699 <span class="comment"> * vForceRedraw - force a redraw of the main window</span> |
|
710 <a name="l00700"></a>00700 <span class="comment"> */</span> |
|
711 <a name="l00701"></a>00701 <span class="keyword">static</span> <span class="keywordtype">void</span> |
|
712 <a name="l00702"></a>00702 vForceRedraw(diagram_type *pDiag) |
|
713 <a name="l00703"></a>00703 { |
|
714 <a name="l00704"></a>00704 window_state tWindowState; |
|
715 <a name="l00705"></a>00705 window_redrawblock tRedraw; |
|
716 <a name="l00706"></a>00706 <span class="keywordtype">int</span> x0, y0, x1, y1; |
|
717 <a name="l00707"></a>00707 |
|
718 <a name="l00708"></a>00708 TRACE_MSG(<span class="stringliteral">"vForceRedraw"</span>); |
|
719 <a name="l00709"></a>00709 |
|
720 <a name="l00710"></a>00710 fail(pDiag == NULL); |
|
721 <a name="l00711"></a>00711 |
|
722 <a name="l00712"></a>00712 DBG_DEC(pDiag->iScaleFactorCurr); |
|
723 <a name="l00713"></a>00713 |
|
724 <a name="l00714"></a>00714 <span class="comment">/* Read the size of the current diagram */</span> |
|
725 <a name="l00715"></a>00715 Drawfile_QueryBox(&pDiag->tInfo, &tRedraw.rect, TRUE); |
|
726 <a name="l00716"></a>00716 <span class="comment">/* Adjust the size of the work area */</span> |
|
727 <a name="l00717"></a>00717 x0 = tRedraw.rect.min.x * pDiag->iScaleFactorCurr / 100 - 1; |
|
728 <a name="l00718"></a>00718 y0 = tRedraw.rect.min.y * pDiag->iScaleFactorCurr / 100 - 1; |
|
729 <a name="l00719"></a>00719 x1 = tRedraw.rect.max.x * pDiag->iScaleFactorCurr / 100 + 1; |
|
730 <a name="l00720"></a>00720 y1 = tRedraw.rect.max.y * pDiag->iScaleFactorCurr / 100 + 1; |
|
731 <a name="l00721"></a>00721 <span class="comment">/* Work area extension */</span> |
|
732 <a name="l00722"></a>00722 x0 -= WORKAREA_EXTENSION; |
|
733 <a name="l00723"></a>00723 y0 -= WORKAREA_EXTENSION; |
|
734 <a name="l00724"></a>00724 x1 += WORKAREA_EXTENSION; |
|
735 <a name="l00725"></a>00725 y1 += WORKAREA_EXTENSION; |
|
736 <a name="l00726"></a>00726 Window_SetExtent(pDiag->tMainWindow, x0, y0, x1, y1); |
|
737 <a name="l00727"></a>00727 <span class="comment">/* Widen the box slightly to be sure all the edges are drawn */</span> |
|
738 <a name="l00728"></a>00728 x0 -= 5; |
|
739 <a name="l00729"></a>00729 y0 -= 5; |
|
740 <a name="l00730"></a>00730 x1 += 5; |
|
741 <a name="l00731"></a>00731 y1 += 5; |
|
742 <a name="l00732"></a>00732 <span class="comment">/* Force the redraw */</span> |
|
743 <a name="l00733"></a>00733 Window_ForceRedraw(pDiag->tMainWindow, x0, y0, x1, y1); |
|
744 <a name="l00734"></a>00734 <span class="comment">/* Reopen the window to show the correct size */</span> |
|
745 <a name="l00735"></a>00735 Error_CheckFatal(Wimp_GetWindowState(pDiag->tMainWindow, &tWindowState)); |
|
746 <a name="l00736"></a>00736 tWindowState.openblock.behind = -1; |
|
747 <a name="l00737"></a>00737 Error_CheckFatal(Wimp_OpenWindow(&tWindowState.openblock)); |
|
748 <a name="l00738"></a>00738 } <span class="comment">/* end of vForceRedraw */</span> |
|
749 <a name="l00739"></a>00739 |
|
750 <a name="l00740"></a>00740 <span class="comment">/*</span> |
|
751 <a name="l00741"></a>00741 <span class="comment"> * vShowDiagram - put the diagram on the screen</span> |
|
752 <a name="l00742"></a>00742 <span class="comment"> */</span> |
|
753 <a name="l00743"></a>00743 <span class="keywordtype">void</span> |
|
754 <a name="l00744"></a>00744 vShowDiagram(diagram_type *pDiag) |
|
755 <a name="l00745"></a>00745 { |
|
756 <a name="l00746"></a>00746 wimp_box tRect; |
|
757 <a name="l00747"></a>00747 <span class="keywordtype">int</span> x0, y0, x1, y1; |
|
758 <a name="l00748"></a>00748 |
|
759 <a name="l00749"></a>00749 TRACE_MSG(<span class="stringliteral">"vShowDiagram"</span>); |
|
760 <a name="l00750"></a>00750 |
|
761 <a name="l00751"></a>00751 fail(pDiag == NULL); |
|
762 <a name="l00752"></a>00752 |
|
763 <a name="l00753"></a>00753 Window_Show(pDiag->tMainWindow, open_NEARLAST); |
|
764 <a name="l00754"></a>00754 Drawfile_QueryBox(&pDiag->tInfo, &tRect, TRUE); |
|
765 <a name="l00755"></a>00755 <span class="comment">/* Work area extension */</span> |
|
766 <a name="l00756"></a>00756 x0 = tRect.min.x - WORKAREA_EXTENSION; |
|
767 <a name="l00757"></a>00757 y0 = tRect.min.y - WORKAREA_EXTENSION; |
|
768 <a name="l00758"></a>00758 x1 = tRect.max.x + WORKAREA_EXTENSION; |
|
769 <a name="l00759"></a>00759 y1 = tRect.max.y + WORKAREA_EXTENSION; |
|
770 <a name="l00760"></a>00760 Window_SetExtent(pDiag->tMainWindow, x0, y0, x1, y1); |
|
771 <a name="l00761"></a>00761 vForceRedraw(pDiag); |
|
772 <a name="l00762"></a>00762 } <span class="comment">/* end of vShowDiagram */</span> |
|
773 <a name="l00763"></a>00763 |
|
774 <a name="l00764"></a>00764 <span class="comment">/*</span> |
|
775 <a name="l00765"></a>00765 <span class="comment"> * vMainButtonClick - handle mouse buttons clicks for the main screen</span> |
|
776 <a name="l00766"></a>00766 <span class="comment"> */</span> |
|
777 <a name="l00767"></a>00767 <span class="keywordtype">void</span> |
|
778 <a name="l00768"></a>00768 vMainButtonClick(mouse_block *pMouse) |
|
779 <a name="l00769"></a>00769 { |
|
780 <a name="l00770"></a>00770 caret_block tCaret; |
|
781 <a name="l00771"></a>00771 window_state ws; |
|
782 <a name="l00772"></a>00772 |
|
783 <a name="l00773"></a>00773 TRACE_MSG(<span class="stringliteral">"vMainButtonClick"</span>); |
|
784 <a name="l00774"></a>00774 |
|
785 <a name="l00775"></a>00775 fail(pMouse == NULL); |
|
786 <a name="l00776"></a>00776 |
|
787 <a name="l00777"></a>00777 DBG_DEC(pMouse->button.data.select); |
|
788 <a name="l00778"></a>00778 DBG_DEC(pMouse->button.data.adjust); |
|
789 <a name="l00779"></a>00779 DBG_DEC(pMouse->window); |
|
790 <a name="l00780"></a>00780 DBG_DEC(pMouse->icon); |
|
791 <a name="l00781"></a>00781 |
|
792 <a name="l00782"></a>00782 <span class="keywordflow">if</span> (pMouse->window >= 0 && |
|
793 <a name="l00783"></a>00783 pMouse->icon == -1 && |
|
794 <a name="l00784"></a>00784 (pMouse->button.data.select || pMouse->button.data.adjust)) { |
|
795 <a name="l00785"></a>00785 <span class="comment">/* Get the input focus */</span> |
|
796 <a name="l00786"></a>00786 Error_CheckFatal(Wimp_GetWindowState(pMouse->window, &ws)); |
|
797 <a name="l00787"></a>00787 tCaret.window = pMouse->window; |
|
798 <a name="l00788"></a>00788 tCaret.icon = -1; |
|
799 <a name="l00789"></a>00789 tCaret.offset.x = pMouse->pos.x - ws.openblock.screenrect.min.x; |
|
800 <a name="l00790"></a>00790 tCaret.offset.y = pMouse->pos.y - ws.openblock.screenrect.max.y; |
|
801 <a name="l00791"></a>00791 tCaret.height = (int)BIT(25); |
|
802 <a name="l00792"></a>00792 tCaret.index = 0; |
|
803 <a name="l00793"></a>00793 Error_CheckFatal(Wimp_SetCaretPosition(&tCaret)); |
|
804 <a name="l00794"></a>00794 } |
|
805 <a name="l00795"></a>00795 } <span class="comment">/* end of vMainButtonClick */</span> |
|
806 <a name="l00796"></a>00796 |
|
807 <a name="l00797"></a>00797 <span class="comment">/*</span> |
|
808 <a name="l00798"></a>00798 <span class="comment"> * bMainKeyPressed - handle pressed keys for the main window</span> |
|
809 <a name="l00799"></a>00799 <span class="comment"> */</span> |
|
810 <a name="l00800"></a>00800 BOOL |
|
811 <a name="l00801"></a>00801 bMainKeyPressed(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) |
|
812 <a name="l00802"></a>00802 { |
|
813 <a name="l00803"></a>00803 diagram_type *pDiag; |
|
814 <a name="l00804"></a>00804 |
|
815 <a name="l00805"></a>00805 TRACE_MSG(<span class="stringliteral">"bMainKeyPressed"</span>); |
|
816 <a name="l00806"></a>00806 |
|
817 <a name="l00807"></a>00807 fail(pEvent == NULL); |
|
818 <a name="l00808"></a>00808 fail(pEvent->type != event_KEY); |
|
819 <a name="l00809"></a>00809 fail(pvReference == NULL); |
|
820 <a name="l00810"></a>00810 |
|
821 <a name="l00811"></a>00811 pDiag = (diagram_type *)pvReference; |
|
822 <a name="l00812"></a>00812 |
|
823 <a name="l00813"></a>00813 fail(pEvent->data.key.caret.window != pDiag->tMainWindow); |
|
824 <a name="l00814"></a>00814 |
|
825 <a name="l00815"></a>00815 |
|
826 <a name="l00816"></a>00816 <span class="keywordflow">switch</span> (pEvent->data.key.code) { |
|
827 <a name="l00817"></a>00817 <span class="keywordflow">case</span> keycode_CTRL_F2: <span class="comment">/* Ctrl F2 */</span> |
|
828 <a name="l00818"></a>00818 bDestroyDiagram(pEvent, pvReference); |
|
829 <a name="l00819"></a>00819 <span class="keywordflow">break</span>; |
|
830 <a name="l00820"></a>00820 <span class="keywordflow">case</span> keycode_F3: <span class="comment">/* F3 */</span> |
|
831 <a name="l00821"></a>00821 bSaveDrawfile(pEvent, pvReference); |
|
832 <a name="l00822"></a>00822 <span class="keywordflow">break</span>; |
|
833 <a name="l00823"></a>00823 <span class="keywordflow">case</span> keycode_SHIFT_F3: <span class="comment">/* Shift F3 */</span> |
|
834 <a name="l00824"></a>00824 bSaveTextfile(pEvent, pvReference); |
|
835 <a name="l00825"></a>00825 <span class="keywordflow">break</span>; |
|
836 <a name="l00826"></a>00826 <span class="keywordflow">default</span>: |
|
837 <a name="l00827"></a>00827 DBG_DEC(pEvent->data.key.code); |
|
838 <a name="l00828"></a>00828 Error_CheckFatal(Wimp_ProcessKey(pEvent->data.key.code)); |
|
839 <a name="l00829"></a>00829 } |
|
840 <a name="l00830"></a>00830 <span class="keywordflow">return</span> TRUE; |
|
841 <a name="l00831"></a>00831 } <span class="comment">/* end of bMainKeyPressed */</span> |
|
842 <a name="l00832"></a>00832 |
|
843 <a name="l00833"></a>00833 <span class="comment">/*</span> |
|
844 <a name="l00834"></a>00834 <span class="comment"> * bRedrawMainWindow - redraw the main window</span> |
|
845 <a name="l00835"></a>00835 <span class="comment"> */</span> |
|
846 <a name="l00836"></a>00836 BOOL |
|
847 <a name="l00837"></a>00837 bRedrawMainWindow(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) |
|
848 <a name="l00838"></a>00838 { |
|
849 <a name="l00839"></a>00839 window_redrawblock tBlock; |
|
850 <a name="l00840"></a>00840 diagram_type *pDiag; |
|
851 <a name="l00841"></a>00841 <a class="code" href="structdrawfile__info.html">drawfile_info</a> *pInfo; |
|
852 <a name="l00842"></a>00842 <span class="keywordtype">double</span> dScaleFactor; |
|
853 <a name="l00843"></a>00843 BOOL bMore; |
|
854 <a name="l00844"></a>00844 |
|
855 <a name="l00845"></a>00845 TRACE_MSG(<span class="stringliteral">"bRedrawMainWindow"</span>); |
|
856 <a name="l00846"></a>00846 |
|
857 <a name="l00847"></a>00847 fail(pEvent == NULL); |
|
858 <a name="l00848"></a>00848 fail(pEvent->type != event_REDRAW); |
|
859 <a name="l00849"></a>00849 fail(pvReference == NULL); |
|
860 <a name="l00850"></a>00850 |
|
861 <a name="l00851"></a>00851 pDiag = (diagram_type *)pvReference; |
|
862 <a name="l00852"></a>00852 |
|
863 <a name="l00853"></a>00853 fail(pDiag->tMainWindow != pEvent->data.openblock.window); |
|
864 <a name="l00854"></a>00854 fail(pDiag->iScaleFactorCurr < MIN_SCALE_FACTOR); |
|
865 <a name="l00855"></a>00855 fail(pDiag->iScaleFactorCurr > MAX_SCALE_FACTOR); |
|
866 <a name="l00856"></a>00856 |
|
867 <a name="l00857"></a>00857 dScaleFactor = (double)pDiag->iScaleFactorCurr / 100.0; |
|
868 <a name="l00858"></a>00858 pInfo = &pDiag->tInfo; |
|
869 <a name="l00859"></a>00859 |
|
870 <a name="l00860"></a>00860 tBlock.window = pEvent->data.openblock.window; |
|
871 <a name="l00861"></a>00861 Error_CheckFatal(Wimp_RedrawWindow(&tBlock, &bMore)); |
|
872 <a name="l00862"></a>00862 |
|
873 <a name="l00863"></a>00863 <span class="comment">/* If there is no real diagram just go thru the motions */</span> |
|
874 <a name="l00864"></a>00864 <span class="keywordflow">while</span> (bMore) { |
|
875 <a name="l00865"></a>00865 <span class="keywordflow">if</span> (pInfo->data != NULL && pInfo->length != 0) { |
|
876 <a name="l00866"></a>00866 Error_CheckFatal(Drawfile_RenderDiagram(pInfo, |
|
877 <a name="l00867"></a>00867 &tBlock, dScaleFactor)); |
|
878 <a name="l00868"></a>00868 } |
|
879 <a name="l00869"></a>00869 Error_CheckFatal(Wimp_GetRectangle(&tBlock, &bMore)); |
|
880 <a name="l00870"></a>00870 } |
|
881 <a name="l00871"></a>00871 <span class="keywordflow">return</span> TRUE; |
|
882 <a name="l00872"></a>00872 } <span class="comment">/* end of bRedrawMainWindow */</span> |
|
883 <a name="l00873"></a>00873 |
|
884 <a name="l00874"></a>00874 <span class="comment">/*</span> |
|
885 <a name="l00875"></a>00875 <span class="comment"> * bScaleOpenAction - action to be taken when the Scale view window opens</span> |
|
886 <a name="l00876"></a>00876 <span class="comment"> */</span> |
|
887 <a name="l00877"></a>00877 BOOL |
|
888 <a name="l00878"></a>00878 bScaleOpenAction(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) |
|
889 <a name="l00879"></a>00879 { |
|
890 <a name="l00880"></a>00880 window_state tWindowState; |
|
891 <a name="l00881"></a>00881 diagram_type *pDiag; |
|
892 <a name="l00882"></a>00882 |
|
893 <a name="l00883"></a>00883 TRACE_MSG(<span class="stringliteral">"bScaleOpenAction"</span>); |
|
894 <a name="l00884"></a>00884 |
|
895 <a name="l00885"></a>00885 fail(pEvent == NULL); |
|
896 <a name="l00886"></a>00886 fail(pEvent->type != event_SEND); |
|
897 <a name="l00887"></a>00887 fail(pEvent->data.message.header.action != message_MENUWARN); |
|
898 <a name="l00888"></a>00888 fail(pvReference == NULL); |
|
899 <a name="l00889"></a>00889 |
|
900 <a name="l00890"></a>00890 pDiag = (diagram_type *)pvReference; |
|
901 <a name="l00891"></a>00891 |
|
902 <a name="l00892"></a>00892 <span class="keywordflow">if</span> (menu_currentopen != pDiag->pSaveMenu || |
|
903 <a name="l00893"></a>00893 pEvent->data.message.data.menuwarn.selection[0] != SAVEMENU_SCALEVIEW) { |
|
904 <a name="l00894"></a>00894 <span class="keywordflow">return</span> FALSE; |
|
905 <a name="l00895"></a>00895 } |
|
906 <a name="l00896"></a>00896 |
|
907 <a name="l00897"></a>00897 Error_CheckFatal(Wimp_GetWindowState(pDiag->tScaleWindow, |
|
908 <a name="l00898"></a>00898 &tWindowState)); |
|
909 <a name="l00899"></a>00899 <span class="keywordflow">if</span> (tWindowState.flags.data.open) { |
|
910 <a name="l00900"></a>00900 <span class="comment">/* The window is already open */</span> |
|
911 <a name="l00901"></a>00901 <span class="keywordflow">return</span> TRUE; |
|
912 <a name="l00902"></a>00902 } |
|
913 <a name="l00903"></a>00903 |
|
914 <a name="l00904"></a>00904 DBG_MSG(<span class="stringliteral">"vScaleOpenAction for real"</span>); |
|
915 <a name="l00905"></a>00905 |
|
916 <a name="l00906"></a>00906 pDiag->iScaleFactorTemp = pDiag->iScaleFactorCurr; |
|
917 <a name="l00907"></a>00907 vUpdateWriteableNumber(pDiag->tScaleWindow, |
|
918 <a name="l00908"></a>00908 SCALE_SCALE_WRITEABLE, pDiag->iScaleFactorTemp); |
|
919 <a name="l00909"></a>00909 Window_Show(pDiag->tScaleWindow, open_UNDERPOINTER); |
|
920 <a name="l00910"></a>00910 <span class="keywordflow">return</span> TRUE; |
|
921 <a name="l00911"></a>00911 } <span class="comment">/* end of bScaleOpenAction */</span> |
|
922 <a name="l00912"></a>00912 |
|
923 <a name="l00913"></a>00913 <span class="comment">/*</span> |
|
924 <a name="l00914"></a>00914 <span class="comment"> * vSetTitle - set the title of a window</span> |
|
925 <a name="l00915"></a>00915 <span class="comment"> */</span> |
|
926 <a name="l00916"></a>00916 <span class="keywordtype">void</span> |
|
927 <a name="l00917"></a>00917 vSetTitle(diagram_type *pDiag) |
|
928 <a name="l00918"></a>00918 { |
|
929 <a name="l00919"></a>00919 <span class="keywordtype">char</span> szTitle[WINDOW_TITLE_LEN]; |
|
930 <a name="l00920"></a>00920 |
|
931 <a name="l00921"></a>00921 TRACE_MSG(<span class="stringliteral">"vSetTitle"</span>); |
|
932 <a name="l00922"></a>00922 |
|
933 <a name="l00923"></a>00923 fail(pDiag == NULL); |
|
934 <a name="l00924"></a>00924 fail(pDiag->szFilename[0] == <span class="charliteral">'\0'</span>); |
|
935 <a name="l00925"></a>00925 |
|
936 <a name="l00926"></a>00926 (void)sprintf(szTitle, <span class="stringliteral">"%.*s at %d%%"</span>, |
|
937 <a name="l00927"></a>00927 FILENAME_TITLE_LEN, |
|
938 <a name="l00928"></a>00928 pDiag->szFilename, |
|
939 <a name="l00929"></a>00929 pDiag->iScaleFactorCurr % 1000); |
|
940 <a name="l00930"></a>00930 <span class="keywordflow">if</span> (strlen(pDiag->szFilename) > FILENAME_TITLE_LEN) { |
|
941 <a name="l00931"></a>00931 szTitle[FILENAME_TITLE_LEN - 1] = OUR_ELLIPSIS; |
|
942 <a name="l00932"></a>00932 } |
|
943 <a name="l00933"></a>00933 |
|
944 <a name="l00934"></a>00934 Window_SetTitle(pDiag->tMainWindow, szTitle); |
|
945 <a name="l00935"></a>00935 } <span class="comment">/* end of vSetTitle */</span> |
|
946 <a name="l00936"></a>00936 |
|
947 <a name="l00937"></a>00937 <span class="comment">/*</span> |
|
948 <a name="l00938"></a>00938 <span class="comment"> * vScaleButtonClick - handle a mouse button click in the Scale view window</span> |
|
949 <a name="l00939"></a>00939 <span class="comment"> */</span> |
|
950 <a name="l00940"></a>00940 <span class="keywordtype">void</span> |
|
951 <a name="l00941"></a>00941 vScaleButtonClick(mouse_block *pMouse, diagram_type *pDiag) |
|
952 <a name="l00942"></a>00942 { |
|
953 <a name="l00943"></a>00943 BOOL bCloseWindow, bRedraw; |
|
954 <a name="l00944"></a>00944 |
|
955 <a name="l00945"></a>00945 TRACE_MSG(<span class="stringliteral">"vScaleButtonClick"</span>); |
|
956 <a name="l00946"></a>00946 |
|
957 <a name="l00947"></a>00947 fail(pMouse == NULL || pDiag == NULL); |
|
958 <a name="l00948"></a>00948 fail(pMouse->window != pDiag->tScaleWindow); |
|
959 <a name="l00949"></a>00949 |
|
960 <a name="l00950"></a>00950 bCloseWindow = FALSE; |
|
961 <a name="l00951"></a>00951 bRedraw = FALSE; |
|
962 <a name="l00952"></a>00952 <span class="keywordflow">switch</span> (pMouse->icon) { |
|
963 <a name="l00953"></a>00953 <span class="keywordflow">case</span> SCALE_CANCEL_BUTTON: |
|
964 <a name="l00954"></a>00954 bCloseWindow = TRUE; |
|
965 <a name="l00955"></a>00955 pDiag->iScaleFactorTemp = pDiag->iScaleFactorCurr; |
|
966 <a name="l00956"></a>00956 <span class="keywordflow">break</span>; |
|
967 <a name="l00957"></a>00957 <span class="keywordflow">case</span> SCALE_SCALE_BUTTON: |
|
968 <a name="l00958"></a>00958 bCloseWindow = TRUE; |
|
969 <a name="l00959"></a>00959 bRedraw = pDiag->iScaleFactorCurr != pDiag->iScaleFactorTemp; |
|
970 <a name="l00960"></a>00960 pDiag->iScaleFactorCurr = pDiag->iScaleFactorTemp; |
|
971 <a name="l00961"></a>00961 <span class="keywordflow">break</span>; |
|
972 <a name="l00962"></a>00962 <span class="keywordflow">case</span> SCALE_50_PCT: |
|
973 <a name="l00963"></a>00963 pDiag->iScaleFactorTemp = 50; |
|
974 <a name="l00964"></a>00964 <span class="keywordflow">break</span>; |
|
975 <a name="l00965"></a>00965 <span class="keywordflow">case</span> SCALE_75_PCT: |
|
976 <a name="l00966"></a>00966 pDiag->iScaleFactorTemp = 75; |
|
977 <a name="l00967"></a>00967 <span class="keywordflow">break</span>; |
|
978 <a name="l00968"></a>00968 <span class="keywordflow">case</span> SCALE_100_PCT: |
|
979 <a name="l00969"></a>00969 pDiag->iScaleFactorTemp = 100; |
|
980 <a name="l00970"></a>00970 <span class="keywordflow">break</span>; |
|
981 <a name="l00971"></a>00971 <span class="keywordflow">case</span> SCALE_150_PCT: |
|
982 <a name="l00972"></a>00972 pDiag->iScaleFactorTemp = 150; |
|
983 <a name="l00973"></a>00973 <span class="keywordflow">break</span>; |
|
984 <a name="l00974"></a>00974 <span class="keywordflow">default</span>: |
|
985 <a name="l00975"></a>00975 DBG_DEC(pMouse->icon); |
|
986 <a name="l00976"></a>00976 <span class="keywordflow">break</span>; |
|
987 <a name="l00977"></a>00977 } |
|
988 <a name="l00978"></a>00978 <span class="keywordflow">if</span> (bCloseWindow) { |
|
989 <a name="l00979"></a>00979 <span class="comment">/* Close the scale window */</span> |
|
990 <a name="l00980"></a>00980 Error_CheckFatal(Wimp_CloseWindow(pMouse->window)); |
|
991 <a name="l00981"></a>00981 <span class="keywordflow">if</span> (bRedraw) { |
|
992 <a name="l00982"></a>00982 <span class="comment">/* Redraw the main window */</span> |
|
993 <a name="l00983"></a>00983 vSetTitle(pDiag); |
|
994 <a name="l00984"></a>00984 vForceRedraw(pDiag); |
|
995 <a name="l00985"></a>00985 } |
|
996 <a name="l00986"></a>00986 } <span class="keywordflow">else</span> { |
|
997 <a name="l00987"></a>00987 vUpdateWriteableNumber(pMouse->window, |
|
998 <a name="l00988"></a>00988 SCALE_SCALE_WRITEABLE, |
|
999 <a name="l00989"></a>00989 pDiag->iScaleFactorTemp); |
|
1000 <a name="l00990"></a>00990 } |
|
1001 <a name="l00991"></a>00991 } <span class="comment">/* end of vScaleButtonClick */</span> |
|
1002 <a name="l00992"></a>00992 |
|
1003 <a name="l00993"></a>00993 <span class="comment">/*</span> |
|
1004 <a name="l00994"></a>00994 <span class="comment"> * bScaleKeyPressed - handle pressed keys for the scale window</span> |
|
1005 <a name="l00995"></a>00995 <span class="comment"> */</span> |
|
1006 <a name="l00996"></a>00996 BOOL |
|
1007 <a name="l00997"></a>00997 bScaleKeyPressed(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) |
|
1008 <a name="l00998"></a>00998 { |
|
1009 <a name="l00999"></a>00999 icon_block tIcon; |
|
1010 <a name="l01000"></a>01000 diagram_type *pDiag; |
|
1011 <a name="l01001"></a>01001 caret_block *pCaret; |
|
1012 <a name="l01002"></a>01002 <span class="keywordtype">char</span> *pcChar; |
|
1013 <a name="l01003"></a>01003 <span class="keywordtype">int</span> iTmp; |
|
1014 <a name="l01004"></a>01004 |
|
1015 <a name="l01005"></a>01005 TRACE_MSG(<span class="stringliteral">"bScaleKeyPressed"</span>); |
|
1016 <a name="l01006"></a>01006 |
|
1017 <a name="l01007"></a>01007 fail(pEvent == NULL); |
|
1018 <a name="l01008"></a>01008 fail(pEvent->type != event_KEY); |
|
1019 <a name="l01009"></a>01009 fail(pvReference == NULL); |
|
1020 <a name="l01010"></a>01010 |
|
1021 <a name="l01011"></a>01011 pCaret = &pEvent->data.key.caret; |
|
1022 <a name="l01012"></a>01012 pDiag = (diagram_type *)pvReference; |
|
1023 <a name="l01013"></a>01013 |
|
1024 <a name="l01014"></a>01014 fail(pEvent->data.key.caret.window != pDiag->tScaleWindow); |
|
1025 <a name="l01015"></a>01015 |
|
1026 <a name="l01016"></a>01016 DBG_DEC_C(pCaret->icon != SCALE_SCALE_WRITEABLE, pCaret->icon); |
|
1027 <a name="l01017"></a>01017 DBG_DEC_C(pCaret->icon == SCALE_SCALE_WRITEABLE, pEvent->data.key.code); |
|
1028 <a name="l01018"></a>01018 |
|
1029 <a name="l01019"></a>01019 <span class="keywordflow">if</span> (pEvent->data.key.code != <span class="charliteral">'\r'</span> || |
|
1030 <a name="l01020"></a>01020 pCaret->icon != SCALE_SCALE_WRITEABLE) { |
|
1031 <a name="l01021"></a>01021 Error_CheckFatal(Wimp_ProcessKey(pEvent->data.key.code)); |
|
1032 <a name="l01022"></a>01022 <span class="keywordflow">return</span> TRUE; |
|
1033 <a name="l01023"></a>01023 } |
|
1034 <a name="l01024"></a>01024 |
|
1035 <a name="l01025"></a>01025 Error_CheckFatal(Wimp_GetIconState(pCaret->window, pCaret->icon, &tIcon)); |
|
1036 <a name="l01026"></a>01026 <span class="keywordflow">if</span> (!tIcon.flags.data.text || !tIcon.flags.data.indirected) { |
|
1037 <a name="l01027"></a>01027 werr(1, <span class="stringliteral">"Icon %d must be indirected text"</span>, (<span class="keywordtype">int</span>)pCaret->icon); |
|
1038 <a name="l01028"></a>01028 } |
|
1039 <a name="l01029"></a>01029 iTmp = (int)strtol(tIcon.data.indirecttext.buffer, &pcChar, 10); |
|
1040 <a name="l01030"></a>01030 <span class="keywordflow">if</span> (*pcChar != <span class="charliteral">'\0'</span> && *pcChar != <span class="charliteral">'\r'</span>) { |
|
1041 <a name="l01031"></a>01031 DBG_DEC(*pcChar); |
|
1042 <a name="l01032"></a>01032 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iTmp < MIN_SCALE_FACTOR) { |
|
1043 <a name="l01033"></a>01033 pDiag->iScaleFactorTemp = MIN_SCALE_FACTOR; |
|
1044 <a name="l01034"></a>01034 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iTmp > MAX_SCALE_FACTOR) { |
|
1045 <a name="l01035"></a>01035 pDiag->iScaleFactorTemp = MAX_SCALE_FACTOR; |
|
1046 <a name="l01036"></a>01036 } <span class="keywordflow">else</span> { |
|
1047 <a name="l01037"></a>01037 pDiag->iScaleFactorTemp = iTmp; |
|
1048 <a name="l01038"></a>01038 } |
|
1049 <a name="l01039"></a>01039 pDiag->iScaleFactorCurr = pDiag->iScaleFactorTemp; |
|
1050 <a name="l01040"></a>01040 <span class="comment">/* Close the scale window */</span> |
|
1051 <a name="l01041"></a>01041 Error_CheckFatal(Wimp_CloseWindow(pCaret->window)); |
|
1052 <a name="l01042"></a>01042 <span class="comment">/* Redraw the main window */</span> |
|
1053 <a name="l01043"></a>01043 vSetTitle(pDiag); |
|
1054 <a name="l01044"></a>01044 vForceRedraw(pDiag); |
|
1055 <a name="l01045"></a>01045 <span class="keywordflow">return</span> TRUE; |
|
1056 <a name="l01046"></a>01046 } <span class="comment">/* end of bScaleKeyPressed */</span> |
|
1057 <a name="l01047"></a>01047 |
|
1058 </pre></div></div> |
|
1059 <hr size="1"/><address style="text-align: right;"><small>Generated by |
|
1060 <a href="http://www.doxygen.org/index.html"> |
|
1061 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> |
|
1062 </body> |
|
1063 </html> |