VIA - Volumetric Image Analysis
VXPrivate.h
00001 /*
00002  *  $Id: VXPrivate.h 726 2004-03-08 13:12:45Z lohmann $
00003  *
00004  *  This file contains private declarations for VX routines.
00005  */
00006 
00007 #ifndef V_VXPrivate_h
00008 #define V_VXPrivate_h 1
00009 
00010 /*
00011  *  Copyright 1993, 1994 University of British Columbia
00012  *
00013  *  Permission to use, copy, modify, distribute, and sell this software and its
00014  *  documentation for any purpose is hereby granted without fee, provided that
00015  *  the above copyright notice appears in all copies and that both that
00016  *  copyright notice and this permission notice appear in supporting
00017  *  documentation. UBC makes no representations about the suitability of this
00018  *  software for any purpose. It is provided "as is" without express or
00019  *  implied warranty.
00020  *
00021  *  Author: Daniel Ko, UBC Laboratory for Computational Intelligence
00022  */
00023 
00024 /* From the Vista library: */
00025 #include "viaio/Vlib.h"
00026 #include "viaio/colormap.h"
00027 #include "viaio/mu.h"
00028 #include "viaio/os.h"
00029 #include "viaio/VImage.h"
00030 
00031 /* From X11R5 Xt and Motif: */
00032 #include <X11/Intrinsic.h>
00033 #include <X11/StringDefs.h>
00034 #include <Xm/Xm.h>
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 /* Macro(s): */
00041 #define XtVCMW  XtVaCreateManagedWidget
00042 #define XtVCW   XtVaCreateWidget
00043 #define XtVGV   XtVaGetValues
00044 #define XtVSV   XtVaSetValues
00045 
00046 
00047 /*
00048  *  Data structure declarations.
00049  */
00050 
00051 /*
00052  * Type: VRec
00053  *
00054  * Record for storing image related data.
00055  */
00056 typedef struct {
00057     VImage image;               /* Image currently managed by VX. */
00058     VBand band;                 /* Band of image currently managed by VX. */
00059     float row_scale;            /* # of screen pixel per image pixel in
00060                                    row-dimension. */
00061     float zoom_level;           /* Zoom level in VXSetImage */
00062 } VRec;
00063 
00064 
00065 /*
00066  * Type: XRec
00067  *
00068  * Record for storing widget related data.
00069  */
00070 typedef struct {
00071     XtAppContext appContext;    /* Application context. */
00072     VColormap vcolormap;        /* colormap, depth, visual, and colors */
00073 
00074     Widget topLevel;            /* Application shell. */
00075     Widget encloseAll;
00076     Widget mainWindow;          /* Main window. */
00077     Widget menuBar;             /* Menu bar. */
00078     Widget imageViewFrame;      /* Frame of imageView. */
00079     Widget imageView;           /* VImageView widget. */
00080     Widget msgAreaFrame;        /* Frame of msgArea (+ scrolled window). */
00081     Widget msgArea;             /* Text widget used as message area. */
00082 
00083     int init_width;             /* Init width of imageView. */
00084     int init_height;            /* Init height of imageView. */
00085     int cur_width;              /* Current width of imageView. */
00086     int cur_height;             /* Current height of imageView. */
00087 
00088     int msg_area_nlines;        /* Number of lines visible in message area. */
00089 
00090     Window busyWindow;          /* For displaying busy cursor. */
00091 } XRec;
00092 
00093 
00094 /*
00095  * Type: ORec
00096  *
00097  * Record for storing overlay related data.
00098  */
00099 typedef struct {
00100     VBoolean pixmap_consistent; /* pixmap for storing overlays is valid */
00101     GC gc;                      /* graphic context ID */
00102     Pixmap pixmap;              /* pixmap for storing overlays */
00103     VBoolean pixmap_allocated;  /* TRUE iff pixmap is allocated */
00104 } ORec;
00105 
00106 
00107 /*
00108  * Type: AppRec
00109  *
00110  * Record for storing VX application data.
00111  */
00112 typedef struct {
00113     VBoolean initialized;       /* TRUE: VXInit() has been called */
00114     VBoolean in_main_loop;      /* TRUE: VXAppMainLoop() is called */
00115     VRec v;                     /* Vista image related data */
00116     XRec x;                     /* X widget related data */
00117     ORec o;                     /* overlay related data */
00118 } AppRec;
00119 
00120 
00121 /*
00122  * Global variables.
00123  */
00124 
00125 extern AppRec VX_App;           /* application data */
00126 
00127 
00128 /*
00129  *  Declarations of routines.
00130  */
00131 
00132 /* From the menu module: */
00133 extern VBoolean VX_InitMenu (void);
00134 
00135 /* From the input module: */
00136 extern VBoolean VX_InitInput (void);
00137 
00138 /* From the image module: */
00139 extern void VX_Zoomed (Widget, XtPointer, XtPointer);
00140 
00141 /* From the line module: */
00142 extern VBoolean VX_InitLine (void);
00143 extern void VX_GetLineGC (void);
00144 extern void VX_RedrawLines (void);
00145 extern void VX_StoreLines (void);
00146 extern void VX_RestoreLines(void);
00147 
00148 /* From the text module: */
00149 extern VBoolean VX_InitText (void);
00150 extern void VX_GetTextGC (void);
00151 extern void VX_RedrawTexts (void);
00152 extern void VX_StoreTexts (void);
00153 extern void VX_RestoreTexts(void);
00154 
00155 /* From the overlays module: */
00156 extern void VX_RedrawOverlays (Widget, XtPointer, XtPointer);
00157 
00158 /* From the dialog module: */
00159 extern VBoolean VX_InitDialog (void);
00160 extern void VX_Warning (VStringConst);
00161 
00162 #ifdef __cplusplus
00163 }
00164 #endif
00165 
00166 #endif /* V_VXPrivate_h */