home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume31 / jgraph / part06 / jgraph.h < prev    next >
C/C++ Source or Header  |  1992-07-14  |  4KB  |  230 lines

  1. /* 
  2.  * $Source: /n/fs/vd/jsp/src/jgraph/RCS/jgraph.h,v $
  3.  * $Revision: 8.0 $
  4.  * $Date: 92/07/03 14:15:58 $
  5.  * $Author: jsp $
  6.  */
  7.  
  8. #include "list.h"
  9. #include "prio_list.h"
  10. #ifdef LCC
  11. #include <stdlib.h>
  12. #endif
  13.  
  14. #define PPI 120
  15. #define FPPI 120.0
  16. #define CPI 72.0
  17. #define FCPI 72.0
  18. #define CNULL ((char *)0)
  19. #define GMNULL ((Point)0)
  20. #define FSIG -10010.0
  21. #define HASH_SIZE 5.0
  22. #define MHASH_SIZE 2.0
  23.  
  24. typedef struct point {
  25.   struct point *flink;
  26.   struct point *blink;
  27.   float x;
  28.   float y;
  29.   char e;          /* 'x' for x_ebars, 'y' for y_ebars, 'p' for neither */
  30. } *Point;
  31.  
  32. typedef struct flist {
  33.   struct flist *flink;
  34.   struct flist *blink;
  35.   float f;
  36. } *Flist;
  37.  
  38. typedef struct label {
  39.   char *label;
  40.   float x;
  41.   float y;
  42.   float rotate;
  43.   char *font;
  44.   float fontsize;
  45.   char hj;
  46.   char vj;
  47.   float gray[3];
  48.   char graytype;
  49.   float linesep;
  50.   float xmin;
  51.   float xmax;
  52.   float ymin;
  53.   float ymax;
  54.   int nlines;
  55. } *Label;
  56.  
  57. typedef struct curve {
  58.   struct curve *flink;
  59.   struct curve *blink;
  60.   int num;
  61.   Label l;
  62.   Label lmark;
  63.   Point pts;
  64.   Point yepts;
  65.   Point xepts;
  66.   int npts;
  67.   Point general_marks;
  68.   float marksize[2];
  69.   float fill[3];
  70.   float gray[3];
  71.   float afill[3];
  72.   float pfill[3];
  73.   float linethick;
  74.   float mrotate;
  75.   Flist gen_linetype;
  76.   char graytype ;
  77.   char filltype ;
  78.   char afilltype;
  79.   char pfilltype;
  80.   char marktype;
  81.   char linetype;
  82.   char *postscript;
  83.   int postfile;
  84.   int rarrow;
  85.   int larrow;
  86.   int rarrows;
  87.   int larrows;
  88.   int bezier;
  89.   int poly;
  90.   float asize[2];
  91.   int clip;
  92. } *Curve;
  93.  
  94. typedef struct string {
  95.   struct string *flink;
  96.   struct string *blink;
  97.   int num;
  98.   Label s;
  99. } *String;
  100.  
  101. typedef struct hash {
  102.   struct hash *flink;
  103.   struct hash *blink;
  104.   float loc;
  105.   float size;
  106.   int major;
  107. } *Hash;
  108.  
  109. typedef struct deflt {
  110.   float rotate;
  111.   float fontsize;
  112.   Point general_marks;
  113.   float fill;
  114.   float linethick;
  115.   float marksize[2];
  116.   char *font;
  117.   char hj;
  118.   char vj;
  119.   char marktype;
  120. } *Default;
  121.   
  122. typedef struct axis {
  123.   Label label;
  124.   Label hl;
  125.   float max;
  126.   float min;
  127.   float pmax;
  128.   float pmin;
  129.   float logmin;
  130.   float logfactor;
  131.   float size;
  132.   float psize;
  133.   float factor;
  134.   float hash_interval;
  135.   float hash_start;
  136.   float hash_scale;
  137.   float log_base;
  138.   float draw_hash_marks_at;
  139.   float draw_hash_labels_at;
  140.   float draw_at;
  141.   float gray[3];
  142.   char graytype;
  143.   float gr_gray[3];
  144.   char gr_graytype;
  145.   float mgr_gray[3];
  146.   char mgr_graytype;
  147.   int grid_lines;
  148.   int mgrid_lines;
  149.   int draw_hash_labels;
  150.   int draw_axis_line;
  151.   int draw_hash_marks;
  152.   int draw_axis_label;
  153.   int auto_hash_labels;
  154.   int auto_hash_marks;
  155.   int minor_hashes;
  156.   int precision;
  157.   int start_given;
  158.   String hash_labels;
  159.   Hash hash_lines;
  160.   int is_x;
  161.   int is_lg;
  162. } *Axis;
  163.  
  164. typedef struct legend {
  165.   float linelength;
  166.   float linebreak;
  167.   int anylines;
  168.   float midspace;
  169.   char type; /* 'n' = off, 'u' = userdefined (use Label), 'c' = custom */
  170.   Label l;
  171. } *Legend;
  172.  
  173. typedef struct graph {
  174.   struct graph *flink;
  175.   struct graph *blink;
  176.   int num;
  177.   float xminval;
  178.   float yminval;
  179.   float xmaxval;
  180.   float ymaxval;
  181.   float x_translate;
  182.   float y_translate;
  183.   Axis x_axis;
  184.   Axis y_axis;
  185.   Curve curves;
  186.   Legend legend;
  187.   String strings;
  188.   Label title;
  189.   int clip;
  190.   int border;
  191.   Default def;
  192. } *Graph;
  193.  
  194. typedef struct graphs {
  195.   struct graphs *flink;
  196.   struct graphs *blink;
  197.   Graph g;
  198.   float height;
  199.   float width;
  200.   float bb[4]; /* Bounding box */
  201.   char *preamble; 
  202.   char *epilogue; 
  203.   int prefile;
  204.   int epifile;
  205. } *Graphs;
  206.  
  207. extern float ctop();
  208. extern float disttop();
  209. extern float intop();
  210. extern float ptoc();
  211. extern float ptodist();
  212.  
  213. extern char *getlabel();
  214. extern char *getmultiline();
  215.  
  216. /* Stuff defined in jgraph.c */
  217.  
  218. extern Curve new_line();
  219. extern Curve new_curve();
  220. extern Curve get_curve();
  221. extern Graph new_graph();
  222. extern Graph get_graph();
  223. extern String new_string();
  224. extern String get_string();
  225. extern Label new_label();
  226. extern char *MARKTYPESTRS[];
  227. extern char MARKTYPES[];
  228. extern int NMARKTYPES;
  229. extern int NORMALMARKTYPES;
  230.