home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / Gnuplot / Source / term / object.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-02  |  5.0 KB  |  230 lines

  1. /*
  2.  * $Id: object.h 3.38.2.5 1992/11/10 02:08:00 woo Exp $
  3.  *
  4.  */
  5.  
  6. /* 
  7.  *    FIG : Facility for Interactive Generation of figures
  8.  *
  9.  *    (c) copy right 1985 by Supoj Sutanthavibul (supoj@sally.utexas.edu)
  10.  *      January 1985.
  11.  *    1st revision : Aug 1985.
  12.  *    2nd revision : Feb 1988.
  13.  *
  14.  *    %W%    %G%
  15. */
  16. #define                    DEFAULT            -1
  17.  
  18. typedef        struct f_pattern {
  19.             int            w, h;
  20.             int            *p;
  21.             }
  22.         F_pattern;
  23.  
  24. typedef        struct f_pen {
  25.             int            x, y;
  26.             int            *p;
  27.             }
  28.         F_pen;
  29.  
  30. typedef        struct f_point {
  31.             int            x, y;
  32.             struct f_point        *next;
  33.             }
  34.         F_point;
  35.  
  36. typedef        struct f_pos {
  37.             int            x, y;
  38.             }
  39.         F_pos;
  40.  
  41. typedef        struct f_arrow {
  42.             int            type;
  43.             int            style;
  44.             float            thickness;
  45.             float            wid;
  46.             float            ht;
  47.             }
  48.         F_arrow;
  49.  
  50. typedef        struct f_ellipse {
  51.             int            type;
  52. #define                    T_ELLIPSE_BY_RAD    1
  53. #define                    T_ELLIPSE_BY_DIA    2
  54. #define                    T_CIRCLE_BY_RAD        3
  55. #define                    T_CIRCLE_BY_DIA        4
  56.             int            style;
  57.             int            thickness;
  58.             int            color;
  59. #define                    BLACK            0
  60.             int            depth;
  61.             int            direction;
  62.             float            style_val;
  63.             float            angle;
  64.             struct f_pen        *pen;
  65.             struct f_pattern    *area_fill;
  66. #define                           UNFILLED    (F_pattern *)0
  67. #define                           BLACK_FILL    (F_pattern *)1
  68. #define                           DARK_GRAY_FILL    (F_pattern *)2
  69. #define                           MED_GRAY_FILL    (F_pattern *)3
  70. #define                           LIGHT_GRAY_FILL    (F_pattern *)4
  71. #define                           WHITE_FILL    (F_pattern *)4
  72.             struct f_pos        center;
  73.             struct f_pos        radiuses;
  74.             struct f_pos        start;
  75.             struct f_pos        end;
  76.             struct f_ellipse    *next;
  77.             }
  78.         F_ellipse;
  79.  
  80. typedef        struct f_arc {
  81.             int            type;
  82. #define                    T_3_POINTS_ARC        1
  83.             int            style;
  84.             int            thickness;
  85.             int            color;
  86.             int            depth;
  87.             struct f_pen        *pen;
  88.             struct f_pattern    *area_fill;
  89.             float            style_val;
  90.             int            direction;
  91.             struct f_arrow        *for_arrow;
  92.             struct f_arrow        *back_arrow;
  93.             struct {float x, y;}    center;
  94.             struct f_pos        point[3];
  95.             struct f_arc        *next;
  96.             }
  97.         F_arc;
  98.  
  99. typedef        struct f_line {
  100.             int            type;
  101. #define                    T_POLYLINE    1
  102. #define                    T_BOX        2
  103. #define                    T_POLYGON    3
  104.             int            style;
  105.             int            thickness;
  106.             int            color;
  107.             int            depth;
  108.             float            style_val;
  109.             struct f_pen        *pen;
  110.             struct f_pattern    *area_fill;
  111.             struct f_arrow        *for_arrow;
  112.             struct f_arrow        *back_arrow;
  113.             struct f_point        *points;
  114.             struct f_line        *next;
  115.             }
  116.         F_line;
  117.  
  118. typedef        struct f_text {
  119.             int            type;
  120. #define                    T_LEFT_JUSTIFIED    0
  121. #define                    T_CENTER_JUSTIFIED    1
  122. #define                    T_RIGHT_JUSTIFIED    2
  123.             int            font;
  124. #define                    DEFAULT_FONT        0
  125. #define                    ROMAN_FONT        1
  126. #define                    BOLD_FONT        2
  127. #define                    ITALIC_FONT        3
  128. #define                    MODERN_FONT        4
  129. #define                    TYPEWRITER_FONT        5
  130.             int            size;    /* point size */
  131.             int            color;
  132.             int            depth;
  133.             float            angle;    /* in radian */
  134.             int            style;
  135. #define                    PLAIN        1
  136. #define                    ITALIC        2
  137. #define                    BOLD        4
  138. #define                    OUTLINE        8
  139. #define                    SHADOW        16
  140.             int            height;    /* pixels */
  141.             int            length;    /* pixels */
  142.             int            base_x;
  143.             int            base_y;
  144.             struct f_pen        *pen;
  145.             char            *cstring;
  146.             struct f_text        *next;
  147.             }
  148.         F_text;
  149.  
  150. typedef        struct f_control {
  151.             float            lx, ly, rx, ry;
  152.             struct f_control    *next;
  153.             }
  154.         F_control;
  155.  
  156. #define        int_spline(s)        (s->type & 0x2)
  157. #define        normal_spline(s)    (!(s->type & 0x2))
  158. #define        closed_spline(s)    (s->type & 0x1)
  159. #define        open_spline(s)        (!(s->type & 0x1))
  160.  
  161. typedef        struct f_spline {
  162.             int            type;
  163. #define                    T_OPEN_NORMAL        0
  164. #define                    T_CLOSED_NORMAL        1
  165. #define                    T_OPEN_INTERPOLATED    2
  166. #define                    T_CLOSED_INTERPOLATED    3
  167.             int            style;
  168.             int            thickness;
  169.             int            color;
  170.             int            depth;
  171.             float            style_val;
  172.             struct f_pen        *pen;
  173.             struct f_pattern    *area_fill;
  174.             struct f_arrow        *for_arrow;
  175.             struct f_arrow        *back_arrow;
  176.             /*
  177.             For T_OPEN_NORMAL and T_CLOSED_NORMAL points
  178.             are control points while they are knots for
  179.             T_OPEN_INTERPOLATED and T_CLOSED_INTERPOLTED
  180.             whose control points are stored in controls.
  181.             */
  182.             struct f_point        *points;
  183.             struct f_control    *controls;
  184.             struct f_spline        *next;
  185.             }
  186.         F_spline;
  187.  
  188. typedef        struct f_compound {
  189.             struct f_pos        nwcorner;
  190.             struct f_pos        secorner;
  191.             struct f_line        *lines;
  192.             struct f_ellipse    *ellipses;
  193.             struct f_spline        *splines;
  194.             struct f_text        *texts;
  195.             struct f_arc        *arcs;
  196.             struct f_compound    *compounds;
  197.             struct f_compound    *next;
  198.             }
  199.         F_compound;
  200.  
  201. #define        ARROW_SIZE        sizeof(struct f_arrow)
  202. #define        POINT_SIZE        sizeof(struct f_point)
  203. #define        CONTROL_SIZE        sizeof(struct f_control)
  204. #define        ELLOBJ_SIZE        sizeof(struct f_ellipse)
  205. #define        ARCOBJ_SIZE        sizeof(struct f_arc)
  206. #define        LINOBJ_SIZE        sizeof(struct f_line)
  207. #define        TEXOBJ_SIZE        sizeof(struct f_text)
  208. #define        SPLOBJ_SIZE        sizeof(struct f_spline)
  209. #define        COMOBJ_SIZE        sizeof(struct f_compound)
  210.  
  211. /**********************  object codes  **********************/
  212.  
  213. #define        O_ELLIPSE        1
  214. #define        O_POLYLINE        2
  215. #define        O_SPLINE        3
  216. #define        O_TEXT            4
  217. #define        O_ARC            5
  218. #define        O_COMPOUND        6
  219. #define        O_END_COMPOUND        -O_COMPOUND
  220. #define        O_ALL_OBJECT        99
  221.  
  222. /************  object styles (except for f_text)  ************/
  223.  
  224. #define        SOLID_LINE        0
  225. #define        DASH_LINE        1
  226. #define        DOTTED_LINE        2
  227.  
  228. #define        CLOSED_PATH        0
  229. #define        OPEN_PATH        1
  230.