VIA - Volumetric Image Analysis
VX.h
1 /*
2  * $Id: VX.h 726 2004-03-08 13:12:45Z lohmann $
3  *
4  * Definitions associated with the VX library.
5  */
6 
7 #ifndef V_VX_h
8 #define V_VX_h 1
9 
10 /*
11  * Copyright 1993, 1994 University of British Columbia
12  *
13  * Permission to use, copy, modify, distribute, and sell this software and its
14  * documentation for any purpose is hereby granted without fee, provided that
15  * the above copyright notice appears in all copies and that both that
16  * copyright notice and this permission notice appear in supporting
17  * documentation. UBC makes no representations about the suitability of this
18  * software for any purpose. It is provided "as is" without express or
19  * implied warranty.
20  *
21  * Author: Daniel Ko, UBC Laboratory for Computational Intelligence
22  */
23 
24 /* From Vista library: */
25 #include "viaio/Vlib.h"
26 #include "viaio/VEdges.h"
27 #include "viaio/VImage.h"
28 
29 /* From standard C library: */
30 #include <stdio.h>
31 
32 /* From Motif's VaSimple.h, and necessary under Motif V1.1.2 and X11R5
33  to get Xm/Xm.h to compile under K&R C: */
34 #if !defined(__STDC__) && !defined(_NO_PROTO)
35 #define _NO_PROTO
36 #endif
37 #if defined(__STDC__) && defined(_NO_PROTO)
38 #undef _NO_PROTO
39 #endif
40 
41 /* From Motif: */
42 #include <Xm/Xm.h>
43 
44 /* For portability: */
45 #include <X11/Xfuncproto.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /* Symbolic constants: */
52 #define VXNmessageAreaNLines "messageAreaNLines"
53 #define VXCMessageAreaNLines "MessageAreaNLines"
54 
55 
56 /*
57  * Declarations of data structures.
58  */
59 
60 /*
61  * VXInputType
62  */
63 typedef enum {
64  VXIkeyPress = 0, /* when a key is pressed */
65  VXIbuttonPress = 1, /* when a mouse button is pressed */
66  VXIbuttonRelease = 2, /* when a mouse button is released */
67  VXIpointerMotion = 3, /* when the pointer is moved */
68  VXnInputTypes = 4
69 } VXInputType;
70 
71 /*
72  * VXModifierMask
73  */
74 typedef enum {
75  VXMshift = ShiftMask, /* the Shift key */
76  VXMctrl = ControlMask, /* the Ctrl key */
77  VXMbutton1 = Button1Mask, /* pointer button 1 */
78  VXMbutton2 = Button2Mask, /* pointer button 2 */
79  VXMbutton3 = Button3Mask, /* pointer button 3 */
80  VXMbutton4 = Button4Mask, /* pointer button 4 */
81  VXMbutton5 = Button5Mask, /* pointer button 5 */
82  VXMmod1 = Mod1Mask, /* modifier 1 */
83  VXMmod2 = Mod2Mask, /* modifier 2 */
84  VXMmod3 = Mod3Mask, /* modifier 3 */
85  VXMmod4 = Mod4Mask, /* modifier 4 */
86  VXMmod5 = Mod5Mask /* modifier 5 */
87 } VXModifierMask;
88 
89 /*
90  * VXInputData
91  */
92 typedef struct {
93 
94  VXInputType input_type; /*
95  * - type of input that triggered the
96  * callback
97  */
98 
99  int value; /*
100  * - the ASCII code of the key being pressed
101  * - or the ID of the button being pressed
102  */
103 
104  VXModifierMask modifiers; /*
105  * - the state of the buttons and
106  * modifier keys when the input
107  * event occurs
108  * - bit 1 means pressed and
109  * bit 0 means un-pressed
110  */
111 
112  int row; /*
113  * - row-coordinate of the location
114  * where the input event occurs
115  */
116 
117  int column; /*
118  * - column-coordinate of the location
119  * where the input event occurs
120  */
121 
122 } VXInputDataRec, *VXInputData;
123 
124 /*
125  * VXInputCallback
126  */
127 typedef void (*VXInputCallback)(
128 #if NeedFunctionPrototypes
129  VXInputData /* input_data */,
130  VPointer /* client_data */
131 #endif
132 );
133 
134 /*
135  * VXMenuCallback
136  */
137 typedef void (*VXMenuCallback)(
138 #if NeedFunctionPrototypes
139  VPointer /* client_data */
140 #endif
141 );
142 
143 /*
144  * VXAnswer
145  */
146 typedef enum {
147  VXAyes, /* answer is yes */
148  VXAno, /* answer is no */
149  VXAcancel /* answer is cancel */
150 } VXAnswer;
151 
152 
153 /*
154  * VXWarning is obsolete -- use VWarning instead.
155  */
156 
157 #define VXWarning VWarning
158 
159 
160 /*
161  * Declarations of library routines.
162  */
163 
164 /* From VXDialog.c: */
165 
166 extern void VXPopupMessageBox (
167 #if NeedFunctionPrototypes
168  VStringConst /* title */,
169  VStringConst /* message */
170 #endif
171 );
172 
173 extern VString VXPopupInputBox (
174 #if NeedFunctionPrototypes
175  VStringConst /* title */,
176  VStringConst /* prompt */,
177  VStringConst /* text */
178 #endif
179 );
180 
181 extern VXAnswer VXPopupYesNoBox (
182 #if NeedFunctionPrototypes
183  VStringConst /* title */,
184  VStringConst /* question */
185 #endif
186 );
187 
188 extern void VXPopupTextBox (
189 #if NeedFunctionPrototypes
190  int /* nrows */,
191  int /* ncolumns */,
192  VStringConst /* title */,
193  VStringConst /* text */
194 #endif
195 );
196 
197 extern VString VXPopupFileBox (
198 #if NeedFunctionPrototypes
199  VStringConst /* title */
200 #endif
201 );
202 
203 /* From VXImage.c: */
204 
205 extern VBoolean VXSetImage (
206 #if NeedFunctionPrototypes
207  VImage /* image */,
208  VBand /* band */,
209  double /* zoom */,
210  int /* row_center */,
211  int /* column_center */
212 #endif
213 );
214 
215 /* From VXInit.c: */
216 
217 extern void VXInit (
218 #if NeedFunctionPrototypes
219  VStringConst /* class */,
220  VStringConst * /* default_res */,
221  int * /* argc */,
222  char ** /* argv */
223 #endif
224 );
225 
226 extern void VXAppMainLoop (
227 #if NeedFunctionPrototypes
228  void
229 #endif
230 );
231 
232 extern void VXReportValidOptions (
233 #if NeedFunctionPrototypes
234  void
235 #endif
236 );
237 
238 /* From VXInput.c: */
239 
240 extern void VXAddInputCallback (
241 #if NeedFunctionPrototypes
242  VXInputType /* input_type */,
243  VXInputCallback /* callback */,
244  VPointer /* client_data */
245 #endif
246 );
247 
248 /* From VXLine.c: */
249 
250 extern VBoolean VXSetLineColor (
251 #if NeedFunctionPrototypes
252  VStringConst /* color_name */
253 #endif
254 );
255 
256 extern void VXSetLineWidth (
257 #if NeedFunctionPrototypes
258  double /* width */
259 #endif
260 );
261 
262 extern void VXClearLines (
263 #if NeedFunctionPrototypes
264  void
265 #endif
266 );
267 
268 extern VBoolean VXDrawLine (
269 #if NeedFunctionPrototypes
270  double /* r1 */,
271  double /* c1 */,
272  double /* r2 */,
273  double /* c2 */
274 #endif
275 );
276 
277 extern VBoolean VXDrawEdges (
278 #if NeedFunctionPrototypes
279  VEdges /* edges */
280 #endif
281 );
282 
283 /* From VXMenu.c: */
284 
285 extern void VXAddMenu (
286 #if NeedVarargsPrototypes
287  VStringConst /* menu_name */,
288  ...
289 #endif
290 );
291 
292 /* From VXMisc.c: */
293 
294 extern void VXDisplayMessage (
295 #if NeedVarargsPrototypes
296  VBooleanPromoted /* overwrite */,
297  VStringConst /* format */,
298  ...
299 #endif
300 );
301 
302 extern void VXShowMessageArea (
303 #if NeedFunctionPrototypes
304  void
305 #endif
306 );
307 
308 extern void VXHideMessageArea (
309 #if NeedFunctionPrototypes
310  void
311 #endif
312 );
313 
314 extern Widget VXGetImageViewWidget (
315 #if NeedFunctionPrototypes
316  void
317 #endif
318 );
319 
320 extern Widget VXGetApplicationShell (
321 #if NeedFunctionPrototypes
322  void
323 #endif
324 );
325 
326 extern VBoolean VXIsColorDisplay (
327 #if NeedFunctionPrototypes
328  void
329 #endif
330 );
331 
332 /* From VXOverlays.c: */
333 
334 extern void VXStoreOverlays (
335 #if NeedFunctionPrototypes
336  void
337 #endif
338 );
339 
340 extern void VXRestoreOverlays (
341 #if NeedFunctionPrototypes
342  void
343 #endif
344 );
345 
346 /* From VXText.c: */
347 
348 extern VBoolean VXSetTextFont (
349 #if NeedFunctionPrototypes
350  VStringConst /* fontname */
351 #endif
352 );
353 
354 extern VBoolean VXSetTextColor (
355 #if NeedFunctionPrototypes
356  VStringConst /* color_name */
357 #endif
358 );
359 
360 extern void VXClearTexts (
361 #if NeedFunctionPrototypes
362  void
363 #endif
364 );
365 
366 extern VBoolean VXDrawText (
367 #if NeedFunctionPrototypes
368  VStringConst /* str */,
369  double /* r */,
370  double /* c */
371 #endif
372 );
373 
374 #ifdef __cplusplus
375 }
376 #endif
377 
378 #endif /* V_VX_h */