Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

win.h

Go to the documentation of this file.
00001 /* win.h
00002  * Biao Lu                     biao@eagle.drexel.edu
00003  */
00004 
00005 #ifndef LUX_WIN_H
00006 #define LUX_WIN_H
00007 
00008 #include <stdio.h>
00009 #include <stdlib.h>
00010 #include <X11/Xlib.h>
00011 #include <X11/Xutil.h>
00012 #include <X11/Xos.h>
00013 #include <X11/Xatom.h>
00014 #include <math.h>
00015 
00016 
00017 
00018 
00019 #define register 
00020 
00021 
00022 
00023 
00024 #define BITMAPDEPTH 1
00025 
00026 #define SMALL 1
00027 #define OK 0
00028 
00029 #define GRAPH_WINDOW    1
00030 #define POPUP_WINDOW    2
00031 #define DIALOG_WINDOW   3
00032 #define BUTTON_WINDOW   4
00033 #define INPUT_WINDOW    5
00034 #define TEXT_WINDOW     6    /* Actualy not */
00035 
00036 #define NO_TYPE         0
00037 #define OK_BUTTON       1
00038 #define CANCEL_BUTTON   2
00039 #define CHECK_BUTTON    3
00040 #define OK_KEEP_BUTTON  4
00041 
00042 /* For axis style */
00043 #define BOXED           1
00044 #define FRAMED          2
00045 #define NORMAL          3
00046 
00047 #define NOOP                  0
00048 #define DRAW_LINE             1
00049 #define DRAW_LINES            2
00050 #define DRAW_PONIT            3
00051 #define DRAW_POINTS           4
00052 #define SET_LINE_WIDTH        5
00053 #define SETUP_REGION          6
00054 #define SETUP_AXIS            7
00055 #define DRAW_AXIS             8
00056 #define DRAW_LINE_F           9
00057 #define DRAW_STRING           10
00058 #define DRAW_VSTRING          11
00059 #define DRAW_SEGMENTS_F       12
00060 #define SET_COLOR             13
00061 #define DRAW_POINT_F          14
00062 #define CLEAR_CURRENT_REGION  15
00063 #define CLEAR_WINDOW          16
00064 #define DRAW_IMAGE_STRING     17
00065 #define SET_BG_COLOR          18
00066 #define UPDATE_FOREGROUND     19
00067 #define DRAW_RECTANGLES_F     20
00068 #define DRAW_LINES_F          21
00069 #define DRAW_POINTS_F         22
00070 #define DRAW_RECTANGLE_F      23
00071 #define DRAW_ARCS_F           24
00072 #define DRAW_ARC_F            25
00073 #define FILL_ARC_F            26
00074 #define FILL_ARCS_F           27
00075 #define FILL_RECTANGLE_F      28
00076 #define FILL_RECTANGLES_F     29
00077 #define FILL_POLYGON_F        30
00078 #define SET_LINE_STYLE        31
00079 #define SET_WINDOW_BG_COLOR   32
00080 #define SET_UPDATE            33
00081 #define SET_NO_UPDATE         34
00082 #define SETUP_AXIS_STYLE      35
00083 
00084 
00085 typedef struct _lux_data {
00086   unsigned int type;
00087   union {
00088     char          *b;
00089     short         *s;
00090     int           *i;
00091     unsigned int  *u;
00092     long          *l;
00093     unsigned long *ul;
00094     float         *f;
00095     double        *d;
00096   }  data;
00097   struct  _lux_data  *next;
00098 } lux_data;
00099 
00100 typedef struct {
00101 
00102   int            type;   /* This is for checking the type of window */
00103   int            subtype;
00104 
00105   Display       *display;
00106   unsigned int   screen;
00107 
00108   unsigned int   display_width;
00109   unsigned int   display_height;
00110 
00111   unsigned int   window_depth;
00112 
00113   int            update_flag;    /* For animation  1 for update*/
00114   int            discard_flag;   /* For save data or not  0 for save*/
00115 
00116   int            x;
00117   int            y;
00118   unsigned int   width;
00119   unsigned int   height;
00120   unsigned int   old_width;      /* To determine if window size is changed*/  
00121   unsigned int   old_height;     /* or not */
00122   unsigned int   user_width;     /* This is to honor the size user specified */
00123   unsigned int   user_height;    /* The purpose is for resize */
00124   float          xresizefactor;
00125   float          yresizefactor;
00126 
00127   char          *window_name;
00128   char          *icon_name;
00129   int            window_size;    /* This is for checking the window size */
00130 
00131   Window         parent;
00132   Window         serial;         /* For item number, dialog attached window */
00133   Window         window;
00134   Pixmap         pixmap;
00135   Pixmap         icon_pixmap;
00136 
00137   XSizeHints     size_hints;
00138   GC             gc;
00139 
00140   Cursor         cursor;
00141   Colormap       colormap;
00142   char          *colormapfile;
00143   int            lux_colormap;
00144 
00145   lux_data      *data;
00146   lux_data      *currentdata;
00147   char           msg[255];          /* msg got after return from dialog */
00148 
00149 /* The following are used for drawing axis */
00150   float          fxsize, fysize;   /* This for the size of axis 
00151                                     * 10.0 same as window */
00152   float          fxorg;   /* This specify (x,y) origin in [0.0,10.0] rect */
00153   float          fyorg;   /* for axis box */
00154   float          xmin, xmax;
00155   float          ymin, ymax;
00156   float          xfactor, yfactor;  /* related to real data */
00157   int            xorg, yorg;        /* Real orgin for axis box */
00158   int            xsize, ysize;      /* size of axis in window */
00159 
00160   int            lnx, lny;          /* Log axis */
00161 
00162   int            buttonflag;  /* for after get button posion to leave or not */
00163   float          xbutton, ybutton;   /* for button position*/
00164 
00165 } lux_win;
00166 
00167 typedef struct _lux_wins {
00168   lux_win    win;
00169   struct _lux_wins  *next;
00170 } lux_wins;
00171 
00172 #endif  /*LUX_WIN_H*/

Generated at Sun Feb 24 09:57:20 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001