Rev 882 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
882 | serge | 1 | |
2 | |||
3 | |||
4 | { |
||
5 | int x; |
||
6 | int y; |
||
7 | }pt_t; |
||
8 | |||
9 | |||
10 | |||
11 | |||
12 | { |
||
13 | int xmin; |
||
14 | int ymin; |
||
15 | int xmax; |
||
16 | int ymax; |
||
17 | }clip_t, *PTRclip; |
||
18 | |||
19 | |||
20 | #define CLIP_BOTTOM 2 |
||
21 | #define CLIP_RIGHT 4 |
||
22 | #define CLIP_LEFT 8 |
||
23 | |||
24 | |||
25 | |||
26 | |||
27 | |||
28 | |||
29 | |||
30 | |||
31 | { |
||
32 | color_t bkcolor; |
||
33 | color_t fcolor; |
||
34 | union { |
||
35 | u32_t bmp[2]; |
||
36 | u8_t bits[8]; |
||
37 | }; |
||
38 | }brush_t; |
||
39 | |||
40 | |||
41 | #define HS_VERTICAL 1 |
||
42 | #define HS_FDIAGONAL 2 |
||
43 | #define HS_BDIAGONAL 3 |
||
44 | #define HS_CROSS 4 |
||
45 | #define HS_DIAGCROSS 5 |
||
46 | |||
47 | |||
48 | |||
49 | |||
50 | |||
51 | |||
52 | |||
53 | |||
54 | |||
55 | |||
56 | |||
57 | { |
||
58 | unsigned width; |
||
59 | unsigned height; |
||
60 | u32_t format; |
||
61 | u32_t flags; |
||
62 | unsigned pitch; |
||
63 | void *mapped; |
||
64 | u32_t handle; |
||
65 | }pixmap_t; |
||
66 | |||
67 | |||
68 | #define PX_MEM_LOCAL 1 |
||
69 | #define PX_MEM_GART 2 |
||
70 | |||
71 | |||
72 | |||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | |||
82 | int width, int height, |
||
83 | color_t dst_color, color_t border); |
||
84 | |||
85 | |||
86 | int width, int height, |
||
87 | brush_t *brush, color_t border); |
||
88 | |||
89 | |||
90 | |||
91 | |||
92 | |||
93 | |||
94 | { |
||
95 | pixmap_t *dstpix; |
||
96 | |||
97 | |||
98 | int x0; |
||
99 | int y0; |
||
100 | }; |
||
101 | union { |
||
102 | struct { |
||
103 | int x1; |
||
104 | int y1; |
||
105 | }; |
||
106 | struct { |
||
107 | int w; |
||
108 | int h; |
||
109 | }; |
||
110 | }; |
||
111 | color_t color; |
||
112 | color_t border; |
||
113 | }draw_t; |
||
114 | |||
115 | |||
116 | { |
||
117 | pixmap_t *dstpix; |
||
118 | |||
119 | |||
120 | int y; |
||
121 | int w; |
||
122 | int h; |
||
123 | |||
124 | |||
125 | color_t fcolor; |
||
126 | |||
127 | |||
128 | u32_t bmp1; |
||
129 | color_t border; |
||
130 | }fill_t; |
||
131 | |||
132 | |||
133 | { |
||
134 | int src_x; |
||
135 | int src_y; |
||
136 | int dst_x; |
||
137 | int dst_y; |
||
138 | int w; |
||
139 | int h; |
||
140 | }blit_t; |
||
141 | |||
142 | |||
143 | { |
||
144 | pixmap_t *dst_pixmap; |
||
145 | int dst_x; |
||
146 | int dst_y; |
||
147 | |||
148 | |||
149 | int src_x; |
||
150 | int src_y; |
||
151 | int w; |
||
152 | int h; |
||
153 | color_t key; |
||
1002 | serge | 154 | }pxblit_t; |
882 | serge | 155 | |
156 | |||
157 | #define PX_DESTROY 2 |
||
158 | #define PX_CLEAR 3 |
||
159 | #define PX_DRAW_RECT 4 |
||
160 | #define PX_FILL_RECT 5 |
||
161 | #define PX_LINE 6 |
||
162 | #define PX_BLIT 7 |
||
163 | #define PX_BLIT_TRANSPARENT 8 |
||
164 | #define PX_BLIT_ALPHA 9 |
||
165 | |||
166 | |||
167 | |||
168 | |||
169 | // #define DBG(x) |
||
170 | |||
171 | |||
172 | typedef struct s_cursor |
||
173 | { |
||
174 | u32_t magic; // 'CURS' |
||
175 | void (*destroy)(struct s_cursor*); // destructor |
||
176 | u32_t fd; // next object in list |
||
177 | u32_t bk; // prev object in list |
||
178 | u32_t pid; // owner id |
||
179 | |||
180 | |||
181 | u32_t hot_x; // hotspot coords |
||
182 | u32_t hot_y; |
||
183 | }cursor_t; |
||
184 | #pragma pack (pop) |
||
185 | |||
186 | |||
187 | |||
188 | u32_t x ; |
||
189 | u32_t y ; |
||
190 | } xPointFixed; |
||
191 | |||
192 | |||
193 | |||
194 | |||
195 | |||
196 | |||
197 | |||
198 | |||
199 | #define IntToxFixed(i) ((xFixed) (i) << XFIXED_BITS) |
||
200 | |||
201 | |||
202 | |||
203 | |||
204 | ((type) << 16) | \ |
||
205 | ((a) << 12) | \ |
||
206 | ((r) << 8) | \ |
||
207 | ((g) << 4) | \ |
||
208 | ((b))) |
||
209 | |||
210 | |||
211 | #define PICT_FORMAT_RGB(f) (((f) ) & 0xfff) |
||
212 | |||
213 | |||
214 | #define PICT_TYPE_A 1 |
||
215 | #define PICT_TYPE_ARGB 2 |
||
216 | #define PICT_TYPE_ABGR 3 |
||
217 | #define PICT_TYPE_COLOR 4 |
||
218 | #define PICT_TYPE_GRAY 5 |
||
219 | |||
220 | |||
221 | PICT_a8r8g8b8 = PICT_FORMAT(32,PICT_TYPE_ARGB,8,8,8,8), |
||
222 | PICT_x8r8g8b8 = PICT_FORMAT(32,PICT_TYPE_ARGB,0,8,8,8), |
||
223 | PICT_a8b8g8r8 = PICT_FORMAT(32,PICT_TYPE_ABGR,8,8,8,8), |
||
224 | PICT_x8b8g8r8 = PICT_FORMAT(32,PICT_TYPE_ABGR,0,8,8,8), |
||
225 | |||
226 | |||
227 | PICT_r8g8b8 = PICT_FORMAT(24,PICT_TYPE_ARGB,0,8,8,8), |
||
228 | PICT_b8g8r8 = PICT_FORMAT(24,PICT_TYPE_ABGR,0,8,8,8), |
||
229 | |||
230 | |||
231 | PICT_r5g6b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,6,5), |
||
232 | PICT_b5g6r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,6,5), |
||
233 | |||
234 | |||
235 | PICT_x1r5g5b5 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,5,5,5), |
||
236 | PICT_a1b5g5r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,1,5,5,5), |
||
237 | PICT_x1b5g5r5 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,5,5,5), |
||
238 | PICT_a4r4g4b4 = PICT_FORMAT(16,PICT_TYPE_ARGB,4,4,4,4), |
||
239 | PICT_x4r4g4b4 = PICT_FORMAT(16,PICT_TYPE_ARGB,0,4,4,4), |
||
240 | PICT_a4b4g4r4 = PICT_FORMAT(16,PICT_TYPE_ABGR,4,4,4,4), |
||
241 | PICT_x4b4g4r4 = PICT_FORMAT(16,PICT_TYPE_ABGR,0,4,4,4), |
||
242 | |||
243 | |||
244 | PICT_a8 = PICT_FORMAT(8,PICT_TYPE_A,8,0,0,0), |
||
245 | PICT_r3g3b2 = PICT_FORMAT(8,PICT_TYPE_ARGB,0,3,3,2), |
||
246 | PICT_b2g3r3 = PICT_FORMAT(8,PICT_TYPE_ABGR,0,3,3,2), |
||
247 | PICT_a2r2g2b2 = PICT_FORMAT(8,PICT_TYPE_ARGB,2,2,2,2), |
||
248 | PICT_a2b2g2r2 = PICT_FORMAT(8,PICT_TYPE_ABGR,2,2,2,2), |
||
249 | |||
250 | |||
251 | PICT_g8 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0), |
||
252 | |||
253 | |||
254 | |||
255 | |||
256 | PICT_x4g4 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0), |
||
257 | |||
258 | |||
259 | PICT_a4 = PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0), |
||
260 | PICT_r1g2b1 = PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1), |
||
261 | PICT_b1g2r1 = PICT_FORMAT(4,PICT_TYPE_ABGR,0,1,2,1), |
||
262 | PICT_a1r1g1b1 = PICT_FORMAT(4,PICT_TYPE_ARGB,1,1,1,1), |
||
263 | PICT_a1b1g1r1 = PICT_FORMAT(4,PICT_TYPE_ABGR,1,1,1,1), |
||
264 | |||
265 | |||
266 | PICT_g4 = PICT_FORMAT(4,PICT_TYPE_GRAY,0,0,0,0), |
||
267 | |||
268 | |||
269 | PICT_a1 = PICT_FORMAT(1,PICT_TYPE_A,1,0,0,0), |
||
270 | |||
271 | |||
272 | } PictFormatShort; |
||
273 | |||
274 | |||
275 |