VIA - Volumetric Image Analysis

VX.h

00001 /*
00002  * $Id: VX.h 726 2004-03-08 13:12:45Z lohmann $
00003  *
00004  * Definitions associated with the VX library.
00005  */
00006 
00007 #ifndef V_VX_h
00008 #define V_VX_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 Vista library: */
00025 #include "viaio/Vlib.h"
00026 #include "viaio/VEdges.h"
00027 #include "viaio/VImage.h"
00028 
00029 /* From standard C library: */
00030 #include <stdio.h>
00031 
00032 /* From Motif's VaSimple.h, and necessary under Motif V1.1.2 and X11R5
00033    to get Xm/Xm.h to compile under K&R C: */
00034 #if !defined(__STDC__) && !defined(_NO_PROTO)
00035 #define _NO_PROTO
00036 #endif
00037 #if defined(__STDC__) && defined(_NO_PROTO)
00038 #undef _NO_PROTO
00039 #endif
00040 
00041 /* From Motif: */
00042 #include <Xm/Xm.h>
00043 
00044 /* For portability: */
00045 #include <X11/Xfuncproto.h>
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050 
00051 /* Symbolic constants: */
00052 #define VXNmessageAreaNLines "messageAreaNLines"
00053 #define VXCMessageAreaNLines "MessageAreaNLines"
00054 
00055 
00056 /*
00057  *  Declarations of data structures.
00058  */
00059 
00060 /*
00061  * VXInputType
00062  */
00063 typedef enum {
00064     VXIkeyPress       = 0,      /* when a key is pressed           */
00065     VXIbuttonPress    = 1,      /* when a mouse button is pressed  */
00066     VXIbuttonRelease  = 2,      /* when a mouse button is released */
00067     VXIpointerMotion  = 3,      /* when the pointer is moved       */
00068     VXnInputTypes     = 4
00069 } VXInputType;
00070 
00071 /*
00072  * VXModifierMask
00073  */
00074 typedef enum {
00075     VXMshift   = ShiftMask,     /* the Shift key    */
00076     VXMctrl    = ControlMask,   /* the Ctrl key     */
00077     VXMbutton1 = Button1Mask,   /* pointer button 1 */
00078     VXMbutton2 = Button2Mask,   /* pointer button 2 */
00079     VXMbutton3 = Button3Mask,   /* pointer button 3 */
00080     VXMbutton4 = Button4Mask,   /* pointer button 4 */
00081     VXMbutton5 = Button5Mask,   /* pointer button 5 */
00082     VXMmod1    = Mod1Mask,      /* modifier 1       */
00083     VXMmod2    = Mod2Mask,      /* modifier 2       */
00084     VXMmod3    = Mod3Mask,      /* modifier 3       */
00085     VXMmod4    = Mod4Mask,      /* modifier 4       */
00086     VXMmod5    = Mod5Mask       /* modifier 5       */
00087 } VXModifierMask;
00088 
00089 /*
00090  * VXInputData
00091  */
00092 typedef struct {
00093 
00094     VXInputType input_type;     /*
00095                                  * - type of input that triggered the
00096                                  *   callback
00097                                  */
00098 
00099     int value;                  /*
00100                                  * - the ASCII code of the key being pressed
00101                                  * - or the ID of the button being pressed
00102                                  */
00103 
00104     VXModifierMask modifiers;   /*
00105                                  * - the state of the buttons and
00106                                  *   modifier keys when the input
00107                                  *   event occurs
00108                                  * - bit 1 means pressed and
00109                                  *   bit 0 means un-pressed
00110                                  */
00111 
00112     int row;                    /*
00113                                  * - row-coordinate of the location
00114                                  *   where the input event occurs
00115                                  */
00116 
00117     int column;                 /*
00118                                  * - column-coordinate of the location
00119                                  *   where the input event occurs
00120                                  */
00121 
00122 } VXInputDataRec, *VXInputData;
00123 
00124 /*
00125  * VXInputCallback
00126  */
00127 typedef void (*VXInputCallback)(
00128 #if NeedFunctionPrototypes
00129     VXInputData         /* input_data */,
00130     VPointer            /* client_data */
00131 #endif
00132 );
00133 
00134 /*
00135  * VXMenuCallback
00136  */
00137 typedef void (*VXMenuCallback)(
00138 #if NeedFunctionPrototypes
00139     VPointer            /* client_data */
00140 #endif
00141 );
00142 
00143 /*
00144  * VXAnswer
00145  */
00146 typedef enum {
00147     VXAyes,                     /* answer is yes    */
00148     VXAno,                      /* answer is no     */
00149     VXAcancel                   /* answer is cancel */
00150 } VXAnswer;
00151 
00152 
00153 /*
00154  *  VXWarning is obsolete -- use VWarning instead.
00155  */
00156 
00157 #define VXWarning VWarning
00158 
00159 
00160 /*
00161  *  Declarations of library routines.
00162  */
00163 
00164 /* From VXDialog.c: */
00165 
00166 extern void VXPopupMessageBox (
00167 #if NeedFunctionPrototypes
00168     VStringConst        /* title */,
00169     VStringConst        /* message */
00170 #endif
00171 );
00172 
00173 extern VString VXPopupInputBox (
00174 #if NeedFunctionPrototypes
00175     VStringConst        /* title */,
00176     VStringConst        /* prompt */,
00177     VStringConst        /* text */
00178 #endif
00179 );
00180 
00181 extern VXAnswer VXPopupYesNoBox (
00182 #if NeedFunctionPrototypes
00183     VStringConst        /* title */,
00184     VStringConst        /* question */
00185 #endif
00186 );
00187 
00188 extern void VXPopupTextBox (
00189 #if NeedFunctionPrototypes
00190     int                 /* nrows */,
00191     int                 /* ncolumns */,
00192     VStringConst        /* title */,
00193     VStringConst        /* text */
00194 #endif
00195 );
00196 
00197 extern VString VXPopupFileBox (
00198 #if NeedFunctionPrototypes
00199     VStringConst        /* title */
00200 #endif
00201 );
00202 
00203 /* From VXImage.c: */
00204 
00205 extern VBoolean VXSetImage (
00206 #if NeedFunctionPrototypes
00207     VImage              /* image */,
00208     VBand               /* band */,
00209     double              /* zoom */,
00210     int                 /* row_center */,
00211     int                 /* column_center */
00212 #endif
00213 );
00214 
00215 /* From VXInit.c: */
00216 
00217 extern void VXInit (
00218 #if NeedFunctionPrototypes
00219     VStringConst        /* class */,
00220     VStringConst *      /* default_res */,
00221     int *               /* argc */,
00222     char **             /* argv */
00223 #endif
00224 );
00225 
00226 extern void VXAppMainLoop (
00227 #if NeedFunctionPrototypes
00228    void
00229 #endif
00230 );
00231 
00232 extern void VXReportValidOptions (
00233 #if NeedFunctionPrototypes
00234    void
00235 #endif
00236 );
00237 
00238 /* From VXInput.c: */
00239 
00240 extern void VXAddInputCallback (
00241 #if NeedFunctionPrototypes
00242     VXInputType         /* input_type */,
00243     VXInputCallback     /* callback */,
00244     VPointer            /* client_data */
00245 #endif
00246 );
00247 
00248 /* From VXLine.c: */
00249 
00250 extern VBoolean VXSetLineColor (
00251 #if NeedFunctionPrototypes
00252     VStringConst        /* color_name */
00253 #endif
00254 );
00255 
00256 extern void VXSetLineWidth (
00257 #if NeedFunctionPrototypes
00258     double              /* width */
00259 #endif
00260 );
00261 
00262 extern void VXClearLines (
00263 #if NeedFunctionPrototypes
00264     void
00265 #endif
00266 );
00267 
00268 extern VBoolean VXDrawLine (
00269 #if NeedFunctionPrototypes
00270     double              /* r1 */,
00271     double              /* c1 */,
00272     double              /* r2 */,
00273     double              /* c2 */
00274 #endif
00275 );
00276 
00277 extern VBoolean VXDrawEdges (
00278 #if NeedFunctionPrototypes
00279    VEdges               /* edges */
00280 #endif
00281 );
00282 
00283 /* From VXMenu.c: */
00284 
00285 extern void VXAddMenu (
00286 #if NeedVarargsPrototypes
00287     VStringConst        /* menu_name */,
00288     ...
00289 #endif
00290 );
00291 
00292 /* From VXMisc.c: */
00293 
00294 extern void VXDisplayMessage (
00295 #if NeedVarargsPrototypes
00296     VBooleanPromoted    /* overwrite */,
00297     VStringConst        /* format */,
00298     ...
00299 #endif
00300 );
00301 
00302 extern void VXShowMessageArea (
00303 #if NeedFunctionPrototypes
00304     void
00305 #endif
00306 );
00307 
00308 extern void VXHideMessageArea (
00309 #if NeedFunctionPrototypes
00310     void
00311 #endif
00312 );
00313 
00314 extern Widget VXGetImageViewWidget (
00315 #if NeedFunctionPrototypes
00316     void
00317 #endif
00318 );
00319 
00320 extern Widget VXGetApplicationShell (
00321 #if NeedFunctionPrototypes
00322     void
00323 #endif
00324 );
00325 
00326 extern VBoolean VXIsColorDisplay (
00327 #if NeedFunctionPrototypes
00328     void
00329 #endif
00330 );
00331 
00332 /* From VXOverlays.c: */
00333 
00334 extern void VXStoreOverlays (
00335 #if NeedFunctionPrototypes
00336     void
00337 #endif
00338 );
00339 
00340 extern void VXRestoreOverlays (
00341 #if NeedFunctionPrototypes
00342     void
00343 #endif
00344 );
00345 
00346 /* From VXText.c: */
00347 
00348 extern VBoolean VXSetTextFont (
00349 #if NeedFunctionPrototypes
00350     VStringConst        /* fontname */
00351 #endif
00352 );
00353 
00354 extern VBoolean VXSetTextColor (
00355 #if NeedFunctionPrototypes
00356     VStringConst        /* color_name */
00357 #endif
00358 );
00359 
00360 extern void VXClearTexts (
00361 #if NeedFunctionPrototypes
00362     void
00363 #endif
00364 );
00365 
00366 extern VBoolean VXDrawText (
00367 #if NeedFunctionPrototypes
00368     VStringConst        /* str */,
00369     double              /* r */,
00370     double              /* c */
00371 #endif
00372 );
00373 
00374 #ifdef __cplusplus
00375 }
00376 #endif
00377 
00378 #endif  /* V_VX_h */