1 /*
2    Copyright (c) 2001-2002 Andrew Bird  All rights reserved.
3    Distributed by Free Software Foundation, Inc.
4 
5 This file is part of HP2xx.
6 
7 HP2xx is distributed in the hope that it will be useful, but
8 WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
9 to anyone for the consequences of using it or for whether it serves any
10 particular purpose or works at all, unless he says so in writing.  Refer
11 to the GNU General Public License, Version 2 or later, for full details.
12 
13 Everyone is granted permission to copy, modify and redistribute
14 HP2xx, but only under the conditions described in the GNU General Public
15 License.  A copy of this license is supposed to have been
16 given to you along with HP2xx so you can know your rights and
17 responsibilities.  It should be in a file named COPYING.  Among other
18 things, the copyright notice and this notice must be preserved on all
19 copies.
20 
21 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
22 */
23 
24 
25 #ifndef __LINDEF_H
26 #define __LINDEF_H
27 
28 typedef enum { LT_solid, LT_adaptive, LT_plot_at, LT_fixed } LineType;
29 
30 extern double     CurrentLinePatLen;
31 extern LineType   CurrentLineType;
32 extern signed int CurrentLinePattern;
33 
34 #define LT_MIN -8
35 #define LT_ZERO 0
36 #define LT_MAX  8
37 
38 #define LT_PATTERNS  ((LT_MIN*-1) + 1 + LT_MAX)         /* -8 .. 0 ..  +8  */
39 #define LT_ELEMENTS   20
40 
41 #define LT_PATTERN_TOL 0.005  /* 0.5% of pattern length */
42 
43 typedef signed char SCHAR;
44 
45 typedef double LINESTYLE[LT_PATTERNS][LT_ELEMENTS+1];
46 
47 extern  LINESTYLE lt;
48 
49 void set_line_style_defaults(void);
50 void set_line_style(SCHAR index, ...);
51 void set_line_style_by_UL(FILE *hd);
52 
53 void print_line_style(void);
54 
55 /* line attributes */
56 
57 typedef enum { LAE_butt          = 1,
58                LAE_square        = 2,
59                LAE_triangular    = 3,
60                LAE_round         = 4
61 } LineEnds;
62 
63 typedef enum { LAJ_plain_miter   = 1,
64                LAJ_bevel_miter   = 2,
65                LAJ_triangular    = 3,
66                LAJ_round         = 4,
67                LAJ_bevelled      = 5,
68                LAJ_nojoin        = 6
69 } LineJoins;
70 
71 typedef int LineLimit;
72 
73 typedef struct {
74    LineEnds  End;
75    LineJoins Join;
76    LineLimit Limit;
77 } LineAttr;
78 
79 typedef enum { LineAttrEnd,
80                LineAttrJoin,
81                LineAttrLimit
82 } LineAttrKind;
83 
84 extern LineAttr CurrentLineAttr;
85 extern LineEnds CurrentLineEnd;    /* used in pre tempfile context only */
86 
87 void set_line_attr_defaults(void);
88 void set_line_attr(FILE *hd);
89 void Line_Attr_to_tmpfile ( LineAttrKind kind, int value);
90 int load_line_attr(FILE *td);
91 
92 
93 #endif /* __LINDEF_H */
94