home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m242 / 1.ddi / HFILES.ZIP / EG_GRAFX.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-13  |  6.5 KB  |  225 lines

  1. #define EG_TYPE int
  2.  
  3. /* header file holding the needed graphics definitions */
  4. struct plotpos
  5.   {
  6.   EG_TYPE y; /* row coordinate */
  7.   EG_TYPE x; /* col coordinate */
  8.   };
  9.  
  10. struct definehc
  11.   {
  12.   int color;
  13.   int width;
  14.   };
  15.  
  16. struct definehs
  17.   {
  18.   int slant;
  19.   char style[5];
  20.   };
  21.  
  22. struct definekb 
  23.  {
  24.     int scan;
  25.     int ext;
  26.     int dir;
  27.  };
  28.  
  29. struct egstatus
  30.   {
  31.     int mode;                    /* current graphics mode    */
  32.     EG_TYPE x_res;                    /* horizontal resolution    */
  33.     EG_TYPE y_res;                    /* vertical resolution        */
  34.     int avail_colors;            /* available colors           */
  35.     int world_on;                /*    world coordinate switch */
  36.                                     /* 0 - off | 1 - on            */
  37.     EG_TYPE w_x0;                    /* world coordinates         */
  38.     EG_TYPE w_y0;
  39.     EG_TYPE w_x1;
  40.     EG_TYPE w_y1;            
  41.     EG_TYPE v_x0;                    /* viewport coordinates      */
  42.     EG_TYPE v_y0;
  43.     EG_TYPE v_x1;
  44.     EG_TYPE v_y1;
  45.     int clip_on;                /*    clipping switch            */
  46.                                     /* 0 - off | 1 - on            */
  47.     EG_TYPE clip_x0;                 /* clipping area                  */
  48.     EG_TYPE clip_y0;
  49.     EG_TYPE clip_x1;
  50.     EG_TYPE clip_y1;
  51.     int xor_on;                    /*    XORing switch                */
  52.                                     /* 0 - off | 1 - on            */
  53.     EG_TYPE    line_width;        /* current line width         */
  54.     unsigned    line_style;        /* current line style         */
  55.   };
  56.  
  57. typedef struct eggraph
  58.   {
  59.         int            graph_type;         /* graph type 
  60.                                                       0 - Line graph
  61.                                                       1 - Scatter graph
  62.                                                       2 - Hi, low, close graph
  63.                                                       3 - Bar graph
  64.                                                       4 - Stacked bar graph */
  65.         int            adjust_edges;        /* 0 - no adjustments 
  66.                                                     1 - adjust edges so that the data points 
  67.                                                          do not lie on the edge, but one 
  68.                                                          grid in    */
  69.         int             title_font;            /* font to use for title label    */
  70.         char             *title_label;        /* label for title    */
  71.         int            title_color;        /* color of title     */
  72.         int             title_loc;            /* location of title    
  73.                                                     0 - top
  74.                                                     1 - bottom
  75.                                                     2 - left
  76.                                                     3 - right            */
  77.         int            title_gap;            /* gap in pixels between title and 
  78.                                                     rest of the graph */
  79.         int            line_graph_type;     /* line graph type 
  80.                                                       0 - Line only
  81.                                                    1 - symbol only
  82.                                                     2 - Line and symbol */
  83.         int             item_color;            /* color for lines,bars, etc. */
  84.         EG_TYPE            line_width;            /* width of lines on graph      */
  85.         unsigned        line_style;            /* style of lines on graph      */
  86.         int             symbol_color;            /* symbol or point color */
  87.         int             symbol_fill;            /* fill symbol or point color */
  88.         EG_TYPE            symbol_size;            /* size of symbols
  89.                                                     -1 will auto set it */
  90.         int            stack_bars;            /*    # of bars in a stacked bar */
  91.         char             *stack_colors;        /* array of colors for the bars in a 
  92.                                                     stack */
  93.         int            bar_type;            /* VERT_BARS or HORZ_BARS */
  94.         EG_TYPE            bar_mid_value;        /* mid value for horizontal bars */
  95.         int            bar_mid_color;        /* mid color for horizontal bars */
  96.         EG_TYPE            bar_mid_width;        /* mid width for horizontal bars */
  97.         int            series_bars;        /* number of bars to draw in the series */ 
  98.         int            num_series;            /* current bar series to draw */
  99.         int             frame_type;            /* 0 - No frame
  100.                                                     1 - Half frame
  101.                                                     2 - Full frame     */
  102.         EG_TYPE            frame_width;        /*    width of frame lines */
  103.         unsigned        frame_style;        /*    style of frame lines */
  104.         int            frame_color;        /* frame color */
  105.         int            frame_back;            /* frame background color */
  106.   } GRAPH_INFO;
  107.  
  108. typedef struct eg_axis
  109.   {
  110.         EG_TYPE            low,high;            /* low and high values    */
  111.         EG_TYPE            axis_width;            /*    width of axis line    */
  112.         unsigned        axis_style;            /*    style of axis line    */
  113.         int            axis_color;            /* axis color                 */
  114.         int            num_grids;            /* number of grid lines */
  115.         int            grid_color;            /* grid color                 */
  116.         EG_TYPE            grid_width;            /*    width of grid lines     */
  117.         unsigned        grid_style;            /*    style of grid lines     */
  118.         int            num_ticks;            /* number of ticks        */
  119.         EG_TYPE            tick_size;            /* tick_size                */
  120.         int            tick_gap;            /* gap in pixels between ticks and 
  121.                                                     labels */
  122.         int            tick_color;            /*    color of tick marks */
  123.         int             descrip_font;         /* font to use for description label 
  124.                                                     along the axis */
  125.         int             descrip_color;         /* color of description label     */
  126.        char             *descrip_label;    /* description label                    */
  127.         int             axis_font;            /* font to use for axis labels    */
  128.         int             label_type;            /* 0 - use numeric labels for the X axis 
  129.                                                     1 - use supplied text labels    */
  130.         int            num_labels;            /* number of text or numeric labels */
  131.         int            label_color;          /*    color of axis labels */
  132.         char            **labels;              /* array of supplied labels for axis */
  133.         int            axis_gap;            /* gap in pixels between axis label and 
  134.                                                     grid or grid labels     */
  135.   } EG_AXIS;
  136.  
  137.  
  138.     #define VERT 800
  139.     #define WORKSIZE 1024
  140.     #define ELIPROWS 800
  141.     #define SMSPOLY 800
  142.  
  143. /* Defines for EG_GRAPH graph types */
  144.  
  145.     #define LINE_GRAPH             0
  146.     #define SCATTER_GRAPH        1
  147.     #define HI_LOW_GRAPH             2
  148.     #define BAR_GRAPH                 3
  149.     #define STACK_BAR_GRAPH         4
  150.     #define USER_GRAPH              5
  151.  
  152.     #define VERT_BARS                1
  153.     #define HORZ_BARS                2
  154.  
  155. /* Defines for EG_GRAPH line graph types */
  156.  
  157.     #define LINE_ONLY                0
  158.     #define SYMBOL_ONLY             1
  159.     #define LINE_AND_SYMBOL        2
  160.  
  161. /* grid and frame options for EG_GRAPH */
  162.  
  163.     #define WHOLE_GRAPH            0
  164.     #define DATA_ONLY              1
  165.  
  166.     #define NO_FRAME                0
  167.     #define HALF_FRAME            1
  168.     #define FULL_FRAME            2
  169.  
  170. /* locations for tiles of 3-D charts and EG_GRAPH */
  171.  
  172.     #define TOP                         0
  173.     #define BOTTOM                    1
  174.     #define LEFT                     2
  175.     #define RIGHT                    3
  176.  
  177. /* Defines for legend funtions  */
  178.  
  179.     #define TOP_CENTER             0
  180.     #define TOP_LEFT_HORZ      1
  181.     #define TOP_LEFT_VERT         2
  182.     #define TOP_RIGHT_HORZ        3
  183.     #define TOP_RIGHT_VERT         4
  184.     #define MIDDLE_LEFT             5
  185.     #define MIDDLE_RIGHT         6
  186.     #define BOT_CENTER             7
  187.     #define BOT_LEFT_HORZ      8
  188.     #define BOT_LEFT_VERT         9
  189.     #define BOT_RIGHT_HORZ        10
  190.     #define BOT_RIGHT_VERT         11
  191.  
  192. /* Defines legend borders  */
  193.  
  194.     #define NO_BORDER                 0
  195.     #define SINGLE_BORDER         1    
  196.     #define DOUBLE_BORDER        2
  197.  
  198. /* Defines for 3-D pie labels */
  199.  
  200.     #define NO_LABEL                 0
  201.     #define OUTSIDE                 1    
  202.     #define INSIDE_IF_FIT        2
  203.     #define LEGEND_ONLY            3
  204.  
  205. /* Defines for 3-D bar graph types  */
  206.  
  207.     #define BAR                         0
  208.     #define PYRAMID                 1    
  209.     #define OCTAHEDRON            2
  210.     #define STACK_BAR                 3
  211.  
  212. /* locations for labels of 3-D charts */
  213.  
  214.     #define BASE_LEFT                 0
  215.     #define BASE_RIGHT             1
  216.     #define XY_PLANE_LEFT          2
  217.     #define XY_PLANE_RIGHT         3
  218.     #define XZ_PLANE                  4
  219.     #define YZ_PLANE                  5
  220.  
  221. /* methods for setting XZ and YZ plane labels */
  222.  
  223.     #define AUTO_SET                 0
  224.     #define MANUAL_SET             1
  225.