VIA - Volumetric Image Analysis
VXPrivate.h
1 /*
2  * $Id: VXPrivate.h 726 2004-03-08 13:12:45Z lohmann $
3  *
4  * This file contains private declarations for VX routines.
5  */
6 
7 #ifndef V_VXPrivate_h
8 #define V_VXPrivate_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 the Vista library: */
25 #include "viaio/Vlib.h"
26 #include "viaio/colormap.h"
27 #include "viaio/mu.h"
28 #include "viaio/os.h"
29 #include "viaio/VImage.h"
30 
31 /* From X11R5 Xt and Motif: */
32 #include <X11/Intrinsic.h>
33 #include <X11/StringDefs.h>
34 #include <Xm/Xm.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /* Macro(s): */
41 #define XtVCMW XtVaCreateManagedWidget
42 #define XtVCW XtVaCreateWidget
43 #define XtVGV XtVaGetValues
44 #define XtVSV XtVaSetValues
45 
46 
47 /*
48  * Data structure declarations.
49  */
50 
51 /*
52  * Type: VRec
53  *
54  * Record for storing image related data.
55  */
56 typedef struct {
57  VImage image; /* Image currently managed by VX. */
58  VBand band; /* Band of image currently managed by VX. */
59  float row_scale; /* # of screen pixel per image pixel in
60  row-dimension. */
61  float zoom_level; /* Zoom level in VXSetImage */
62 } VRec;
63 
64 
65 /*
66  * Type: XRec
67  *
68  * Record for storing widget related data.
69  */
70 typedef struct {
71  XtAppContext appContext; /* Application context. */
72  VColormap vcolormap; /* colormap, depth, visual, and colors */
73 
74  Widget topLevel; /* Application shell. */
75  Widget encloseAll;
76  Widget mainWindow; /* Main window. */
77  Widget menuBar; /* Menu bar. */
78  Widget imageViewFrame; /* Frame of imageView. */
79  Widget imageView; /* VImageView widget. */
80  Widget msgAreaFrame; /* Frame of msgArea (+ scrolled window). */
81  Widget msgArea; /* Text widget used as message area. */
82 
83  int init_width; /* Init width of imageView. */
84  int init_height; /* Init height of imageView. */
85  int cur_width; /* Current width of imageView. */
86  int cur_height; /* Current height of imageView. */
87 
88  int msg_area_nlines; /* Number of lines visible in message area. */
89 
90  Window busyWindow; /* For displaying busy cursor. */
91 } XRec;
92 
93 
94 /*
95  * Type: ORec
96  *
97  * Record for storing overlay related data.
98  */
99 typedef struct {
100  VBoolean pixmap_consistent; /* pixmap for storing overlays is valid */
101  GC gc; /* graphic context ID */
102  Pixmap pixmap; /* pixmap for storing overlays */
103  VBoolean pixmap_allocated; /* TRUE iff pixmap is allocated */
104 } ORec;
105 
106 
107 /*
108  * Type: AppRec
109  *
110  * Record for storing VX application data.
111  */
112 typedef struct {
113  VBoolean initialized; /* TRUE: VXInit() has been called */
114  VBoolean in_main_loop; /* TRUE: VXAppMainLoop() is called */
115  VRec v; /* Vista image related data */
116  XRec x; /* X widget related data */
117  ORec o; /* overlay related data */
118 } AppRec;
119 
120 
121 /*
122  * Global variables.
123  */
124 
125 extern AppRec VX_App; /* application data */
126 
127 
128 /*
129  * Declarations of routines.
130  */
131 
132 /* From the menu module: */
133 extern VBoolean VX_InitMenu (void);
134 
135 /* From the input module: */
136 extern VBoolean VX_InitInput (void);
137 
138 /* From the image module: */
139 extern void VX_Zoomed (Widget, XtPointer, XtPointer);
140 
141 /* From the line module: */
142 extern VBoolean VX_InitLine (void);
143 extern void VX_GetLineGC (void);
144 extern void VX_RedrawLines (void);
145 extern void VX_StoreLines (void);
146 extern void VX_RestoreLines(void);
147 
148 /* From the text module: */
149 extern VBoolean VX_InitText (void);
150 extern void VX_GetTextGC (void);
151 extern void VX_RedrawTexts (void);
152 extern void VX_StoreTexts (void);
153 extern void VX_RestoreTexts(void);
154 
155 /* From the overlays module: */
156 extern void VX_RedrawOverlays (Widget, XtPointer, XtPointer);
157 
158 /* From the dialog module: */
159 extern VBoolean VX_InitDialog (void);
160 extern void VX_Warning (VStringConst);
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #endif /* V_VXPrivate_h */