1 /**********************************************************
2  * Version $Id$
3  *********************************************************/
4 ////////////////////////////////////////////////////////////////////////////
5 // Programm    :
6 // Bibliothek  :
7 // Header-Datei: Gr_def.h
8 //
9 ////////////////////////////////////////////////////////////////////////////
10 //
11 // Autoren        :  Joerg Dolle
12 // 		     Christian Trachinow
13 // 		     Stephan Westphal
14 // Telefon-Nr.    :
15 // Mail-Adresse   :  jdolle@gwdg.de
16 //
17 ////////////////////////////////////////////////////////////////////////////
18 //
19 // Compiler       :  Borland C++   V.: 4.00
20 // Ersterstellung :  09.11.95
21 // Ueberarbeitung :  22.04.96
22 //
23 //
24 // Programmversion:  2.00
25 //
26 ////////////////////////////////////////////////////////////////////////////
27 
28 
29 /****************** Include-Dateien **************/
30 #ifndef __gr_def__
31 #define __gr_def__
32 
33 #include "gr_syst.h"
34 #include "vector.h"
35 
36 #undef  HEADER_INCLUDED__DATA
37 #define HEADER_INCLUDED__DATA
38 
39 
40 //DO *Typkonstrukte***************************************************
41 #define MIN(x,y) ((x) < (y) ? (x) : (y))
42 #define MAX(x,y) ((x) > (y) ? (x) : (y))
43 
44 typedef int G_Color;
45 
46 typedef struct {
47 	unsigned char red, green, blue;
48 } G_RgbColor;
49 
50 typedef struct {
51 	char *name;
52 	G_Color index;
53 } G_NamedColors;
54 
55 typedef struct {
56 	int NumColors;
57 	G_RgbColor *RgbColor;
58 	int NumNamedColors;
59 	G_NamedColors *NamedColor;
60 } G_ColorDef;
61 
62 typedef struct {
63   double x, y;
64 } G_Point;
65 
66 //DO * Papierformate und Ausrichtungen ******
67 enum G_PaperFormat { A0P, A0L, A1P, A1L, A2P, A2L,
68 											A3P, A3L, A4P, A4L, A5P, A5L};
69 enum G_PaperOrient { Portrait, Landscape };
70 enum G_FillType { Hollow, Blank, Filled };
71 
72 
73 //DO *RGB-Felder********************
74 #define RGBMAX_DOS 16
75 #define RGBMAX_REGENBOGEN 256
76 #define RGBMAX_ATLAS 256
77 #define RGBMAX_ATLAS_SMALL 64
78 #define RGBMAX_REGULAR 128
79 #define RGBMAX_WINDOWS 16
80 
81 extern  G_RgbColor RGBDos[RGBMAX_DOS];
82 extern  G_RgbColor RGBRegenbogen[RGBMAX_REGENBOGEN];
83 extern  G_RgbColor RGBAtlas[RGBMAX_ATLAS];
84 extern  G_RgbColor RGBAtlasSmall[RGBMAX_ATLAS_SMALL];
85 extern  G_RgbColor RGBRegular[RGBMAX_REGULAR];
86 extern  G_RgbColor RGBWindows[RGBMAX_WINDOWS];
87 
88 #define NAMEDCOLORSMAX 16
89 extern  G_NamedColors NamedColorsDos[NAMEDCOLORSMAX];
90 extern  G_NamedColors NamedColorsRegenbogen[NAMEDCOLORSMAX];
91 extern  G_NamedColors NamedColorsAtlas[NAMEDCOLORSMAX];
92 extern  G_NamedColors NamedColorsAtlasSmall[NAMEDCOLORSMAX];
93 extern  G_NamedColors NamedColorsRegular[NAMEDCOLORSMAX];
94 extern  G_NamedColors NamedColorsWindows[NAMEDCOLORSMAX];
95 
96 
97 extern  G_ColorDef ColorDefDos;
98 extern  G_ColorDef ColorDefRegenbogen;
99 extern  G_ColorDef ColorDefAtlas;
100 extern  G_ColorDef ColorDefAtlasSmall;
101 extern  G_ColorDef ColorDefRegular;
102 extern  G_ColorDef ColorDefWindows;
103 
104 
105 //DO * Textdefinitionen *****************
106 enum G_TextOrientX {Left,  HCenter, Right };
107 enum G_TextOrientY {Bottom,VCenter, Top};
108 enum G_TextFont { TimesRoman,
109 						  TimesBold,
110 						  TimesItalic,
111 						  TimesBoldItalic,
112 						  Helvetica,
113 						  HelveticaBold,
114 						  HelveticaOblique,
115 						  HelveticaBoldOblique,
116 						  Greek,
117 						  Symbol };
118 
119 //DO *** Clipping Type ******************
120 enum G_ClipType {NoClip,Clip};
121 
122 #define CS_TEXT_COLOR 1
123 #define CS_TEXT_FONT 2
124 #define CS_TEXT_ORIENT 4
125 #define CS_TEXT_ANGLE 8
126 #define CS_TEXT_HEIGHT 16
127 
128 #define CS_POLY_WIDTH 1
129 #define CS_POLY_COLOR 2
130 #define CS_POLY_FILL 4
131 
132 #define CS_POLYLINE_WIDTH 1
133 #define CS_POLYLINE_COLOR 2
134 
135 #define CS_RECT_WIDTH 1
136 #define CS_RECT_COLOR 2
137 #define CS_RECT_FILL 4
138 
139 #define CS_CIRCLE_WIDTH 1
140 #define CS_CIRCLE_RADIUS 2
141 #define CS_CIRCLE_COLOR 4
142 #define CS_CIRCLE_FILL 8
143 
144 #define CS_TRIANGLE_WIDTH 1
145 #define CS_TRIANGLE_COLOR 2
146 #define CS_TRIANGLE_FILL 4
147 
148 #define CS_LINE_WIDTH 1
149 #define CS_LINE_COLOR 2
150 
151 typedef struct
152 {
153 	unsigned Text : 5;
154 	unsigned TextVector : 5;
155 	unsigned Poly : 3;
156 	unsigned Polyline : 2;
157 	unsigned Rect : 3;
158 	unsigned Circle : 4;
159 	unsigned Triangle : 3;
160 	unsigned Line : 2;
161 	unsigned Palette : 1;
setBits__anon162436520508162 	void setBits(void)
163 	{
164 		Text = 31;
165 		TextVector = 31;
166 		Poly = 7;
167 		Polyline = 3;
168 		Rect = 7;
169 		Circle = 15;
170 		Triangle = 7;
171 		Line = 3;
172 	}
173 } ContextStatus;
174 
175 
176 //DO * RGB-Farben in einer Klasse gekapselt
177 
178 class  RGBModelle
179 {
180 public:
181 
182   RGBModelle();
183   ~RGBModelle();
184 
185 private:
186   void init_dos_colors(void);
187   void init_atlas_colors(void);
188   void init_small_atlas_colors(void);
189   void init_regenbogen_colors(void);
190   void init_regular_colors(void);
191   void init_windows_colors(void);
192 };
193 
194 
195 #undef HEADER_INCLUDED__DATA
196 #define HEADER_INCLUDED__DATA
197 
198 #endif
199 
200