]> git.sur5r.net Git - cc65/blob - include/geos/ggraph.h
Removed (pretty inconsistently used) tab chars from source code base.
[cc65] / include / geos / ggraph.h
1 /*
2   GEOS graphic (non icon/menu/sprite) functions
3
4   by Maciej 'YTM/Elysium' Witkowiak
5 */
6
7 #ifndef _GGRAPH_H
8 #define _GGRAPH_H
9
10 #ifndef _GSTRUCT_H
11 #include <geos/gstruct.h>
12 #endif
13
14 void __fastcall__ SetPattern(char newpattern);
15
16 void __fastcall__ HorizontalLine(char pattern, char y, unsigned xstart, unsigned xend);
17 void __fastcall__ InvertLine(char y, unsigned xstart, unsigned xend);
18 void __fastcall__ RecoverLine(char y, unsigned xstart, unsigned xend);
19 void __fastcall__ VerticalLine(char pattern, char ystart, char yend, unsigned x);
20
21 void __fastcall__ InitDrawWindow(struct window *myRectangle);
22 void Rectangle(void);
23 void __fastcall__ FrameRectangle(char pattern);
24 void InvertRectangle(void);
25 void ImprintRectangle(void);
26 void RecoverRectangle(void);
27
28 void __fastcall__ DrawLine(char mode, struct window *topBotCoords);
29
30 void __fastcall__ DrawPoint(char mode, struct pixel *myPixel);
31 char __fastcall__ TestPoint(struct pixel *myPixel);
32
33 void __fastcall__ PutChar(char character, char y, unsigned x);
34 void __fastcall__ PutString(char *myString, char y, unsigned x);
35 void __fastcall__ PutDecimal(char style, unsigned value, char y, unsigned x);
36
37 char __fastcall__ GetCharWidth(char character);
38 void __fastcall__ LoadCharSet(struct fontdesc *myFont);
39 void UseSystemFont(void);
40
41 void __fastcall__ BitmapUp(struct iconpic *myIcon);
42 void __fastcall__ BitmapClip(char skipl, char skipr, unsigned skiptop,
43                              struct iconpic *myIcon);
44 void __fastcall__ BitOtherClip(void *proc1, void *proc2, char skipl,
45                                char skipr, unsigned skiptop,
46                                struct iconpic *myIcon);
47
48 void __fastcall__ GraphicsString(char *myGfxString);
49
50 /* VIC colour constants */
51 #define BLACK           0
52 #define WHITE           1
53 #define RED             2
54 #define CYAN            3
55 #define PURPLE          4
56 #define GREEN           5
57 #define BLUE            6
58 #define YELLOW          7
59 #define ORANGE          8
60 #define BROWN           9
61 #define LTRED           10
62 #define DKGREY          11
63 #define GREY            12
64 #define MEDGREY         12
65 #define LTGREEN         13
66 #define LTBLUE          14
67 #define LTGREY          15
68 /* VIC memory banks - lowest 2 bits of cia2base+0 */
69 #define GRBANK0         3
70 #define GRBANK1         2
71 #define GRBANK2         1
72 #define GRBANK3         0
73 /* VIC screen sizes */
74 #define VIC_X_POS_OFF   24
75 #define VIC_Y_POS_OFF   50
76 #ifdef __GEOS_CBM__
77 #define SC_BYTE_WIDTH   40
78 #define SC_PIX_HEIGHT   200
79 #define SC_PIX_WIDTH    320
80 #define SC_SIZE         8000
81 #else
82 #define SC_BYTE_WIDTH   70
83 #define SC_PIX_HEIGHT   192
84 #define SC_PIX_WIDTH    560
85 #define SC_SIZE         13440
86 #endif
87 /* VDC screen constants */
88 #define SCREENBYTEWIDTH         80
89 #define SCREENPIXELWIDTH        640
90 /* control characters for use as numbers, not characters */
91 #define BACKSPACE       8
92 #define FORWARDSPACE    9
93 #define TAB             9
94 #define LF              10
95 #define HOME            11
96 #define PAGE_BREAK      12
97 #define UPLINE          12
98 #define CR              13
99 #define ULINEON         14
100 #define ULINEOFF        15
101 #define ESC_GRAPHICS    16
102 #define ESC_RULER       17
103 #define REV_ON          18
104 #define REV_OFF         19
105 #define GOTOX           20
106 #define GOTOY           21
107 #define GOTOXY          22
108 #define NEWCARDSET      23
109 #define BOLDON          24
110 #define ITALICON        25
111 #define OUTLINEON       26
112 #define PLAINTEXT       27
113 /* control characters for use in
114    strings: eg: str[10]=CBOLDON "Hello"; */
115 #define CCR             "\015"
116 #define CULINEON        "\016"
117 #define CULINEOFF       "\017"
118 #define CREV_ON         "\022"
119 #define CREV_OFF        "\023"
120 #define CBOLDON         "\030"
121 #define CITALICON       "\031"
122 #define COUTLINEON      "\032"
123 #define CPLAINTEXT      "\033"
124
125 /*values of currentMode */
126 /* bitNumbers */
127 #define UNDERLINE_BIT   7
128 #define BOLD_BIT        6
129 #define REVERSE_BIT     5
130 #define ITALIC_BIT      4
131 #define OUTLINE_BIT     3
132 #define SUPERSCRIPT_BIT 2
133 #define SUBSCRIPT_BIT   1
134 /* bitMasks */
135 #define SET_UNDERLINE   0x80
136 #define SET_BOLD        0x40
137 #define SET_REVERSE     0x20
138 #define SET_ITALIC      0x10
139 #define SET_OUTLINE     0x08
140 #define SET_SUPERSCRIPT 0x04
141 #define SET_SUBSCRIPT   0x02
142 #define SET_PLAINTEXT   0
143 /* values of dispBufferOn */
144 #define ST_WRGS_FORE    0x20
145 #define ST_WR_BACK      0x40
146 #define ST_WR_FORE      0x80
147 /* PutDecimal parameters */
148 /* leading zeros? */
149 #define SET_NOSURPRESS  0
150 #define SET_SURPRESS    0x40
151 /* justification */
152 #define SET_RIGHTJUST   0
153 #define SET_LEFTJUST    0x80
154 /* C128 x-extension flags */
155 #define ADD1_W          0x2000
156 #define DOUBLE_B        0x80
157 #define DOUBLE_W        0x8000
158 /* DrawLine/DrawPoint mode values */
159 #define DRAW_ERASE      0x00
160 #define DRAW_DRAW       0x40
161 #define DRAW_COPY       0x80
162
163 typedef void graphicStr;
164
165 #define MOVEPENTO(x,y) (char)1, (unsigned)(x), (char)(y)
166 #define LINETO(x,y) (char)2, (unsigned)(x), (char)(y)
167 #define RECTANGLETO(x,y) (char)3, (unsigned)(x), (char)(y)
168 #define NEWPATTERN(p) (char)5, (char)(p)
169 #define FRAME_RECTO(x,y) (char)7, (unsigned)(x), (char)(y)
170 #define PEN_X_DELTA(x) (char)8, (unsigned)(x)
171 #define PEN_Y_DELTA(y) (char)9, (char)(y)
172 #define PEN_XY_DELTA(x,y) (char)10, (unsigned)(x), (char)(y)
173 #define GSTR_END (char)NULL
174 /* ESC_PUTSTRING can't be implemented - it needs text, not pointer to it
175    #define ESC_PUTSTRING(x,y,text) (char)6, (unsigned)(x), (char)(y), (text), (char)NULL
176 */
177
178 #endif