1 /*----------------------------------------------------------------------------
2                          col.h (definitions of color)
3                        This file is a part of topaz systems
4                   Copyright: Hisao Kawaura, All rights reserved
5                                    1997 - 98
6 
7 
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (at your option) any later version.
12 
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17 
18     You should have received a copy of the GNU General Public License
19     along with this program; if not, write to the Free Software
20     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 
22 ----------------------------------------------------------------------------*/
23 
24 #if !defined(__col_h)
25 #define __col_h
26 
27 #include <string>
28 
29 /* linecap */
30 #define LINECAPBUTT         0
31 #define LINECAPROUND        1
32 #define LINECAPPROJECTING   2
33 
34 /* linejoin */
35 #define LINEJOINMITER       0
36 #define LINEJOINROUND       1
37 #define LINEJOINBEVEL       2
38 
39 /* linestyle */
40 #define LINESTYLESOLID             0
41 #define LINESTYLEDASH              1
42 #define LINESTYLELONGDASH          2
43 #define LINESTYLESHORTDASH         3
44 #define LINESTYLEDASHDOTDASH       4
45 #define LINESTYLEDASHDOTDOTDASH    5
46 #define LINESTYLEDOT               6
47 #define LINESTYLENULL              7
48 
49 /* fillstyle */
50 #define FILLSTYLESOLID             0
51 #define FILLSTYLENULL              1
52 
53 /* fillrule */
54 #define FILLRULEEVENODD            0
55 #define FILLRULEWINDING            1
56 
57 /* fontface */
58 #define FONT_TIMESROMAN            0
59 #define FONT_TIMESBOLD             1
60 #define FONT_TIMESITALIC           2
61 #define FONT_TIMESBOLDITALIC       3
62 #define FONT_HELVETICA             4
63 #define FONT_HELVETICABOLD         5
64 #define FONT_HELVETICAOBLIQUE      6
65 #define FONT_HELVETICABOLDOBLIQUE  7
66 #define FONT_COURIER               8
67 #define FONT_COURIERBOLD           9
68 #define FONT_COURIEROBLIQUE        10
69 #define FONT_COURIERBOLDOBLIQUE    11
70 #define FONT_SYMBOL                12
71 
72 #define FONT_MINCHO                1000
73 #define FONT_GOTHIC                1004
74 
75 
76 
77 class Capcolor
78 {
79 public:
Capcolor()80   Capcolor(){init();}
81   unsigned short red;
82   unsigned short green;
83   unsigned short blue;
init()84   void init(){red = 0; green = 0; blue = 0;}
setwhite()85   void setwhite(){red = 65535; green = 65535; blue = 65535;}
setblack()86   void setblack(){red = 0; green = 0; blue = 0;}
setred()87   void setred(){red = 65535; green = 0; blue = 0;}
setgreen()88   void setgreen(){green = 65535; red = 0; blue = 0;}
setblue()89   void setblue(){blue = 65535; red = 0; green = 0;}
90 
91   Capcolor& operator = (const Capcolor& p)
92     {red = p.red; green = p.green; blue = p.blue; return *this;}
93   int operator == ( const Capcolor& obj ) const
94     { return this == &obj;}
95 };
96 
97 class Caplinestyle
98 {
99 public:
Caplinestyle()100   Caplinestyle()
101     {
102       init();
103     }
init()104   void init(){width = 0; cap = LINECAPPROJECTING; join = LINEJOINMITER; style = LINESTYLESOLID;}
105 
106   int width;
107   int cap;
108   int join;
109   int style;
110 
111   Caplinestyle& operator = (const Caplinestyle& p)
112     {width = p.width; cap = p.cap; join = p.join; style = p.style;  return *this;}
113   int operator == ( const Caplinestyle& obj ) const
114     { return this == &obj;}
115 };
116 
117 class Capfillstyle
118 {
119 public:
Capfillstyle()120   Capfillstyle()
121     {
122       init();
123     }
init()124   void init(){fillrule = FILLRULEEVENODD; style = FILLSTYLESOLID;}
125   int fillrule;
126   int style;
127 
128   Capfillstyle& operator = (const Capfillstyle& p)
129     {fillrule = p.fillrule; style = p.style;  return *this;}
130   int operator == ( const Capfillstyle& obj ) const
131     { return this == &obj;}
132 
133 };
134 
135 class Capfont
136 {
137 public:
Capfont()138   Capfont()
139     {
140       init();
141     }
142 
~Capfont()143   ~Capfont(){;}
init()144   void init(){face = FONT_TIMESROMAN; jpface = FONT_MINCHO; size = 200; angle = 0.0;}
145   int       face;
146   int       jpface;
147   int       size;
148   double    angle;
149 
150   Capfont& operator = (const Capfont& p)
151     {face = p.face; jpface = p.jpface; size = p.size; angle = p.angle;  return *this;}
152   int operator == ( const Capfont& obj ) const
153     { return this == &obj;}
154 
155 };
156 
157 
158 #endif
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
171