File: VX.h

package info (click to toggle)
via 1.6.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,480 kB
  • ctags: 2,266
  • sloc: ansic: 30,757; makefile: 101; sh: 46
file content (378 lines) | stat: -rwxr-xr-x 7,159 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
/*
 * $Id: VX.h 726 2004-03-08 13:12:45Z lohmann $
 *
 * Definitions associated with the VX library.
 */

#ifndef V_VX_h
#define V_VX_h 1

/*
 *  Copyright 1993, 1994 University of British Columbia
 *
 *  Permission to use, copy, modify, distribute, and sell this software and its
 *  documentation for any purpose is hereby granted without fee, provided that
 *  the above copyright notice appears in all copies and that both that
 *  copyright notice and this permission notice appear in supporting
 *  documentation. UBC makes no representations about the suitability of this
 *  software for any purpose. It is provided "as is" without express or
 *  implied warranty.
 *
 *  Author: Daniel Ko, UBC Laboratory for Computational Intelligence
 */

/* From Vista library: */
#include "viaio/Vlib.h"
#include "viaio/VEdges.h"
#include "viaio/VImage.h"

/* From standard C library: */
#include <stdio.h>

/* From Motif's VaSimple.h, and necessary under Motif V1.1.2 and X11R5
   to get Xm/Xm.h to compile under K&R C: */
#if !defined(__STDC__) && !defined(_NO_PROTO)
#define _NO_PROTO
#endif
#if defined(__STDC__) && defined(_NO_PROTO)
#undef _NO_PROTO
#endif

/* From Motif: */
#include <Xm/Xm.h>

/* For portability: */
#include <X11/Xfuncproto.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Symbolic constants: */
#define VXNmessageAreaNLines "messageAreaNLines"
#define VXCMessageAreaNLines "MessageAreaNLines"


/*
 *  Declarations of data structures.
 */

/*
 * VXInputType
 */
typedef enum {
    VXIkeyPress	      = 0,	/* when a key is pressed	   */
    VXIbuttonPress    = 1,	/* when a mouse button is pressed  */
    VXIbuttonRelease  = 2,	/* when a mouse button is released */
    VXIpointerMotion  = 3,	/* when the pointer is moved	   */
    VXnInputTypes     = 4
} VXInputType;

/*
 * VXModifierMask
 */
typedef enum {
    VXMshift   = ShiftMask,	/* the Shift key    */
    VXMctrl    = ControlMask,	/* the Ctrl key	    */
    VXMbutton1 = Button1Mask,	/* pointer button 1 */
    VXMbutton2 = Button2Mask,	/* pointer button 2 */
    VXMbutton3 = Button3Mask,	/* pointer button 3 */
    VXMbutton4 = Button4Mask,	/* pointer button 4 */
    VXMbutton5 = Button5Mask,	/* pointer button 5 */
    VXMmod1    = Mod1Mask,	/* modifier 1	    */
    VXMmod2    = Mod2Mask,	/* modifier 2	    */
    VXMmod3    = Mod3Mask,	/* modifier 3	    */
    VXMmod4    = Mod4Mask,	/* modifier 4	    */
    VXMmod5    = Mod5Mask	/* modifier 5	    */
} VXModifierMask;

/*
 * VXInputData
 */
typedef struct {

    VXInputType input_type;	/*
				 * - type of input that triggered the
				 *   callback
				 */

    int value;			/*
				 * - the ASCII code of the key being pressed
				 * - or the ID of the button being pressed
				 */

    VXModifierMask modifiers;	/*
				 * - the state of the buttons and
				 *   modifier keys when the input
				 *   event occurs
				 * - bit 1 means pressed and
				 *   bit 0 means un-pressed
				 */

    int row;			/*
				 * - row-coordinate of the location
				 *   where the input event occurs
				 */

    int column;			/*
				 * - column-coordinate of the location
				 *   where the input event occurs
				 */

} VXInputDataRec, *VXInputData;

/*
 * VXInputCallback
 */
typedef void (*VXInputCallback)(
#if NeedFunctionPrototypes
    VXInputData		/* input_data */,
    VPointer		/* client_data */
#endif
);

/*
 * VXMenuCallback
 */
typedef void (*VXMenuCallback)(
#if NeedFunctionPrototypes
    VPointer		/* client_data */
#endif
);

/*
 * VXAnswer
 */
typedef enum {
    VXAyes,			/* answer is yes    */
    VXAno,			/* answer is no	    */
    VXAcancel			/* answer is cancel */
} VXAnswer;


/*
 *  VXWarning is obsolete -- use VWarning instead.
 */

#define VXWarning VWarning


/*
 *  Declarations of library routines.
 */

/* From VXDialog.c: */

extern void VXPopupMessageBox (
#if NeedFunctionPrototypes
    VStringConst	/* title */,
    VStringConst	/* message */
#endif
);

extern VString VXPopupInputBox (
#if NeedFunctionPrototypes
    VStringConst	/* title */,
    VStringConst	/* prompt */,
    VStringConst	/* text */
#endif
);

extern VXAnswer VXPopupYesNoBox (
#if NeedFunctionPrototypes
    VStringConst	/* title */,
    VStringConst	/* question */
#endif
);

extern void VXPopupTextBox (
#if NeedFunctionPrototypes
    int			/* nrows */,
    int			/* ncolumns */,
    VStringConst	/* title */,
    VStringConst	/* text */
#endif
);

extern VString VXPopupFileBox (
#if NeedFunctionPrototypes
    VStringConst	/* title */
#endif
);

/* From VXImage.c: */

extern VBoolean VXSetImage (
#if NeedFunctionPrototypes
    VImage		/* image */,
    VBand		/* band */,
    double		/* zoom */,
    int			/* row_center */,
    int			/* column_center */
#endif
);

/* From VXInit.c: */

extern void VXInit (
#if NeedFunctionPrototypes
    VStringConst	/* class */,
    VStringConst *	/* default_res */,
    int *		/* argc */,
    char **		/* argv */
#endif
);

extern void VXAppMainLoop (
#if NeedFunctionPrototypes
   void
#endif
);

extern void VXReportValidOptions (
#if NeedFunctionPrototypes
   void
#endif
);

/* From VXInput.c: */

extern void VXAddInputCallback (
#if NeedFunctionPrototypes
    VXInputType		/* input_type */,
    VXInputCallback	/* callback */,
    VPointer		/* client_data */
#endif
);

/* From VXLine.c: */

extern VBoolean VXSetLineColor (
#if NeedFunctionPrototypes
    VStringConst	/* color_name */
#endif
);

extern void VXSetLineWidth (
#if NeedFunctionPrototypes
    double		/* width */
#endif
);

extern void VXClearLines (
#if NeedFunctionPrototypes
    void
#endif
);

extern VBoolean VXDrawLine (
#if NeedFunctionPrototypes
    double		/* r1 */,
    double		/* c1 */,
    double		/* r2 */,
    double		/* c2 */
#endif
);

extern VBoolean VXDrawEdges (
#if NeedFunctionPrototypes
   VEdges		/* edges */
#endif
);

/* From VXMenu.c: */

extern void VXAddMenu (
#if NeedVarargsPrototypes
    VStringConst	/* menu_name */,
    ...
#endif
);

/* From VXMisc.c: */

extern void VXDisplayMessage (
#if NeedVarargsPrototypes
    VBooleanPromoted	/* overwrite */,
    VStringConst	/* format */,
    ...
#endif
);

extern void VXShowMessageArea (
#if NeedFunctionPrototypes
    void
#endif
);

extern void VXHideMessageArea (
#if NeedFunctionPrototypes
    void
#endif
);

extern Widget VXGetImageViewWidget (
#if NeedFunctionPrototypes
    void
#endif
);

extern Widget VXGetApplicationShell (
#if NeedFunctionPrototypes
    void
#endif
);

extern VBoolean VXIsColorDisplay (
#if NeedFunctionPrototypes
    void
#endif
);

/* From VXOverlays.c: */

extern void VXStoreOverlays (
#if NeedFunctionPrototypes
    void
#endif
);

extern void VXRestoreOverlays (
#if NeedFunctionPrototypes
    void
#endif
);

/* From VXText.c: */

extern VBoolean VXSetTextFont (
#if NeedFunctionPrototypes
    VStringConst	/* fontname */
#endif
);

extern VBoolean VXSetTextColor (
#if NeedFunctionPrototypes
    VStringConst	/* color_name */
#endif
);

extern void VXClearTexts (
#if NeedFunctionPrototypes
    void
#endif
);

extern VBoolean VXDrawText (
#if NeedFunctionPrototypes
    VStringConst	/* str */,
    double		/* r */,
    double		/* c */
#endif
);

#ifdef __cplusplus
}
#endif

#endif	/* V_VX_h */