PageRenderTime 80ms CodeModel.GetById 2ms app.highlight 73ms RepoModel.GetById 1ms app.codeStats 0ms

/platform/unix/scaffold/graphics.d

http://github.com/wilkie/djehuty
D | 531 lines | 397 code | 104 blank | 30 comment | 4 complexity | 4c55372f1e3cf12f264b906a01fd63e4 MD5 | raw file
  1/*
  2 * graphics.d
  3 *
  4 * This Scaffold holds the Graphics implementations for the Linux platform
  5 *
  6 * Author: Dave Wilkinson
  7 *
  8 */
  9
 10module scaffold.graphics;
 11
 12import core.string;
 13import core.color;
 14import core.main;
 15import core.definitions;
 16import core.string;
 17
 18import graphics.view;
 19import graphics.graphics;
 20
 21import platform.unix.common;
 22import platform.unix.main;
 23
 24import platform.vars.view;
 25import platform.vars.region;
 26import platform.vars.brush;
 27import platform.vars.pen;
 28import platform.vars.font;
 29
 30import graphics.region;
 31
 32import math.common;
 33
 34// Shapes
 35
 36// Draw a line
 37void drawLine(ViewPlatformVars* viewVars, int x, int y, int x2, int y2) {
 38	Cairo.cairo_set_source(viewVars.cr, viewVars.curPen.handle);
 39	Cairo.cairo_set_line_width(viewVars.cr, viewVars.curPen.width);
 40	Cairo.cairo_move_to(viewVars.cr, x, y);
 41	Cairo.cairo_line_to(viewVars.cr, x2, y2);
 42	Cairo.cairo_stroke(viewVars.cr);
 43}
 44
 45// Draw a rectangle (filled with the current brush, outlined with current pen)
 46void drawRect(ViewPlatformVars* viewVars, int x, int y, int width, int height) {
 47	width--;
 48	height--;
 49	Cairo.cairo_set_source(viewVars.cr, viewVars.curBrush.handle);
 50	Cairo.cairo_rectangle(viewVars.cr, x, y, width, height);
 51	Cairo.cairo_fill_preserve(viewVars.cr);
 52	Cairo.cairo_set_source(viewVars.cr, viewVars.curPen.handle);
 53	Cairo.cairo_set_line_width(viewVars.cr, viewVars.curPen.width);
 54	Cairo.cairo_stroke(viewVars.cr);
 55}
 56
 57void fillRect(ViewPlatformVars* viewVars, int x, int y, int width, int height) {
 58	x++;
 59	width--;
 60	height--;
 61	Cairo.cairo_set_source(viewVars.cr, viewVars.curBrush.handle);
 62	Cairo.cairo_rectangle(viewVars.cr, x, y, width, height);
 63	Cairo.cairo_fill(viewVars.cr);
 64}
 65
 66void strokeRect(ViewPlatformVars* viewVars, int x, int y, int width, int height) {
 67	width--;
 68	height--;
 69	Cairo.cairo_set_source(viewVars.cr, viewVars.curPen.handle);
 70	Cairo.cairo_rectangle(viewVars.cr, x, y, width, height);
 71	Cairo.cairo_set_line_width(viewVars.cr, viewVars.curPen.width);
 72	Cairo.cairo_stroke(viewVars.cr);
 73}
 74
 75// Draw an ellipse (filled with current brush, outlined with current pen)
 76void drawOval(ViewPlatformVars* viewVars, int x, int y, int width, int height) {
 77	width--;
 78	height--;
 79	Cairo.cairo_set_source(viewVars.cr, viewVars.curBrush.handle);
 80	Cairo.cairo_save(viewVars.cr);
 81	Cairo.cairo_new_path(viewVars.cr);
 82	double cx, cy;
 83	cx = cast(double)x + cast(double)(width) / 2.0;
 84	cy = cast(double)y + cast(double)(height) / 2.0;
 85	Cairo.cairo_translate(viewVars.cr, cx, cy);
 86	Cairo.cairo_scale(viewVars.cr, cast(double)(width)/2.0, cast(double)(height)/2.0);
 87	Cairo.cairo_arc(viewVars.cr, 0, 0, 1.0, 0, 2*3.14159265);
 88	Cairo.cairo_restore(viewVars.cr);
 89	Cairo.cairo_fill_preserve(viewVars.cr);
 90	Cairo.cairo_set_source(viewVars.cr, viewVars.curPen.handle);
 91	Cairo.cairo_set_line_width(viewVars.cr, viewVars.curPen.width);
 92	Cairo.cairo_stroke(viewVars.cr);
 93}
 94
 95void fillOval(ViewPlatformVars* viewVars, int x, int y, int width, int height) {
 96	width--;
 97	height--;
 98	Cairo.cairo_set_source(viewVars.cr, viewVars.curBrush.handle);
 99	Cairo.cairo_save(viewVars.cr);
100	Cairo.cairo_new_path(viewVars.cr);
101	double cx, cy;
102	cx = cast(double)x + cast(double)(width) / 2.0;
103	cy = cast(double)y + cast(double)(height) / 2.0;
104	Cairo.cairo_translate(viewVars.cr, cx, cy);
105	Cairo.cairo_scale(viewVars.cr, cast(double)(width)/2.0, cast(double)(height)/2.0);
106	Cairo.cairo_arc(viewVars.cr, 0, 0, 1.0, 0, 2*3.14159265);
107	Cairo.cairo_restore(viewVars.cr);
108	Cairo.cairo_fill(viewVars.cr);
109}
110
111void strokeOval(ViewPlatformVars* viewVars, int x, int y, int width, int height) {
112	width--;
113	height--;
114	Cairo.cairo_save(viewVars.cr);
115	Cairo.cairo_new_path(viewVars.cr);
116	double cx, cy;
117	cx = cast(double)x + cast(double)(width) / 2.0;
118	cy = cast(double)y + cast(double)(height) / 2.0;
119	Cairo.cairo_translate(viewVars.cr, cx, cy);
120	Cairo.cairo_scale(viewVars.cr, cast(double)(width)/2.0, cast(double)(height)/2.0);
121	Cairo.cairo_arc(viewVars.cr, 0, 0, 1.0, 0, 2*3.14159265);
122	Cairo.cairo_restore(viewVars.cr);
123	Cairo.cairo_set_source(viewVars.cr, viewVars.curPen.handle);
124	Cairo.cairo_set_line_width(viewVars.cr, viewVars.curPen.width);
125	Cairo.cairo_stroke(viewVars.cr);
126}
127
128void drawPie(ViewPlatformVars* viewVars, int x, int y, int width, int height, double startAngle, double sweepAngle) {
129	width--;
130	height--;
131	Cairo.cairo_set_source(viewVars.cr, viewVars.curBrush.handle);
132	Cairo.cairo_save(viewVars.cr);
133	Cairo.cairo_new_path(viewVars.cr);
134	double cx, cy;
135	cx = cast(double)x + cast(double)(width) / 2.0;
136	cy = cast(double)y + cast(double)(height) / 2.0;
137	Cairo.cairo_translate(viewVars.cr, cx, cy);
138	Cairo.cairo_scale(viewVars.cr, cast(double)(width)/2.0, cast(double)(height)/2.0);
139	double sA, eA;
140	sA = (startAngle*3.14159265)/180.0;
141	eA = (sweepAngle*3.14159265)/180.0;
142	eA += sA;
143	Cairo.cairo_arc(viewVars.cr, 0, 0, 1.0, sA, eA);
144	Cairo.cairo_restore(viewVars.cr);
145	Cairo.cairo_line_to(viewVars.cr, cx, cy);
146	Cairo.cairo_close_path(viewVars.cr);
147	Cairo.cairo_fill_preserve(viewVars.cr);
148	Cairo.cairo_set_source(viewVars.cr, viewVars.curPen.handle);
149	Cairo.cairo_set_line_width(viewVars.cr, viewVars.curPen.width);
150	Cairo.cairo_stroke(viewVars.cr);
151}
152
153void fillPie(ViewPlatformVars* viewVars, int x, int y, int width, int height, double startAngle, double sweepAngle) {
154	width--;
155	height--;
156	Cairo.cairo_set_source(viewVars.cr, viewVars.curBrush.handle);
157	Cairo.cairo_save(viewVars.cr);
158	Cairo.cairo_new_path(viewVars.cr);
159	double cx, cy;
160	cx = cast(double)x + cast(double)(width) / 2.0;
161	cy = cast(double)y + cast(double)(height) / 2.0;
162	Cairo.cairo_translate(viewVars.cr, cx, cy);
163	Cairo.cairo_scale(viewVars.cr, cast(double)(width)/2.0, cast(double)(height)/2.0);
164	double sA, eA;
165	sA = (startAngle*3.14159265)/180.0;
166	eA = (sweepAngle*3.14159265)/180.0;
167	eA += sA;
168	Cairo.cairo_arc(viewVars.cr, 0, 0, 1.0, sA, eA);
169	Cairo.cairo_restore(viewVars.cr);
170	Cairo.cairo_line_to(viewVars.cr, cx, cy);
171	Cairo.cairo_close_path(viewVars.cr);
172	Cairo.cairo_fill(viewVars.cr);
173}
174
175void strokePie(ViewPlatformVars* viewVars, int x, int y, int width, int height, double startAngle, double sweepAngle) {
176	width--;
177	height--;
178	Cairo.cairo_set_source(viewVars.cr, viewVars.curPen.handle);
179	Cairo.cairo_save(viewVars.cr);
180	Cairo.cairo_new_path(viewVars.cr);
181	double cx, cy;
182	cx = cast(double)x + cast(double)(width) / 2.0;
183	cy = cast(double)y + cast(double)(height) / 2.0;
184	Cairo.cairo_translate(viewVars.cr, cx, cy);
185	Cairo.cairo_scale(viewVars.cr, cast(double)(width)/2.0, cast(double)(height)/2.0);
186	double sA, eA;
187	sA = (startAngle*3.14159265)/180.0;
188	eA = (sweepAngle*3.14159265)/180.0;
189	eA += sA;
190	Cairo.cairo_arc(viewVars.cr, 0, 0, 1.0, sA, eA);
191	Cairo.cairo_restore(viewVars.cr);
192	Cairo.cairo_line_to(viewVars.cr, cx, cy);
193	Cairo.cairo_close_path(viewVars.cr);
194	Cairo.cairo_set_line_width(viewVars.cr, viewVars.curPen.width);
195	Cairo.cairo_stroke(viewVars.cr);
196}
197
198
199// Fonts
200
201//void createFont(ViewPlatformVars* viewVars, out Font font, string fontname, int fontsize, int weight, bool italic, bool underline, bool strikethru)
202void createFont(FontPlatformVars* font, string fontname, int fontsize, int weight, bool italic, bool underline, bool strikethru) {
203	font.pangoFont = Pango.pango_font_description_new();
204
205	fontname = fontname.dup;
206	fontname ~= '\0';
207
208	Pango.pango_font_description_set_family(font.pangoFont, fontname.ptr);
209	Pango.pango_font_description_set_size(font.pangoFont, fontsize * Pango.PANGO_SCALE);
210
211	if (italic) {
212		Pango.pango_font_description_set_style(font.pangoFont, Pango.PangoStyle.PANGO_STYLE_ITALIC);
213	}
214	else {
215		Pango.pango_font_description_set_style(font.pangoFont, Pango.PangoStyle.PANGO_STYLE_NORMAL);
216	}
217
218	Pango.pango_font_description_set_weight(font.pangoFont, cast(Pango.PangoWeight)(weight));
219}
220
221void setFont(ViewPlatformVars* viewVars, FontPlatformVars* font) {
222	Pango.pango_layout_set_font_description(viewVars.layout, font.pangoFont);
223}
224
225void destroyFont(FontPlatformVars* font) {
226	Pango.pango_font_description_free(font.pangoFont);
227}
228
229
230
231// Text
232void drawText(ViewPlatformVars* viewVars, int x, int y, string str) {
233	Pango.pango_layout_set_text(viewVars.layout, str.ptr, str.length);
234
235	Cairo.cairo_set_source_rgb(viewVars.cr, viewVars.textclr_red, viewVars.textclr_green, viewVars.textclr_blue);
236
237	Cairo.cairo_move_to(viewVars.cr, (x), (y));
238
239	Pango.pango_cairo_show_layout(viewVars.cr, viewVars.layout);
240}
241
242void drawText(ViewPlatformVars* viewVars, int x, int y, string str, uint length) {
243	Pango.pango_layout_set_text(viewVars.layout, str.ptr, length);
244
245	Cairo.cairo_set_source_rgba(viewVars.cr, viewVars.textclr_red, viewVars.textclr_green, viewVars.textclr_blue, viewVars.textclr_alpha);
246
247	Cairo.cairo_move_to(viewVars.cr, (x), (y));
248
249	Pango.pango_cairo_show_layout(viewVars.cr, viewVars.layout);
250}
251
252// Clipped Text
253void drawClippedText(ViewPlatformVars* viewVars, int x, int y, Rect region, string str) {
254	Pango.pango_layout_set_text(viewVars.layout, str.ptr, str.length);
255
256	double xp1,yp1,xp2,yp2;
257
258	xp1 = region.left;
259	yp1 = region.top;
260	xp2 = region.right;
261	yp2 = region.bottom;
262
263	Cairo.cairo_save(viewVars.cr);
264
265	Cairo.cairo_rectangle(viewVars.cr, xp1, yp1, xp2, yp2);
266	Cairo.cairo_clip(viewVars.cr);
267
268	Cairo.cairo_set_source_rgba(viewVars.cr, viewVars.textclr_red, viewVars.textclr_green, viewVars.textclr_blue, viewVars.textclr_alpha);
269
270	Cairo.cairo_move_to(viewVars.cr, (x), (y));
271
272	Pango.pango_cairo_show_layout(viewVars.cr, viewVars.layout);
273
274	Cairo.cairo_restore(viewVars.cr);
275}
276
277void drawClippedText(ViewPlatformVars* viewVars, int x, int y, Rect region, string str, uint length) {
278	Pango.pango_layout_set_text(viewVars.layout, str.ptr, length);
279
280	double xp1,yp1,xp2,yp2;
281
282	xp1 = region.left;
283	yp1 = region.top;
284	xp2 = region.right;
285	yp2 = region.bottom;
286
287	Cairo.cairo_save(viewVars.cr);
288
289	Cairo.cairo_rectangle(viewVars.cr, xp1, yp1, xp2, yp2);
290	Cairo.cairo_clip(viewVars.cr);
291
292	Cairo.cairo_set_source_rgba(viewVars.cr, viewVars.textclr_red, viewVars.textclr_green, viewVars.textclr_blue, viewVars.textclr_alpha);
293
294	Cairo.cairo_move_to(viewVars.cr, (x), (y));
295
296	Pango.pango_cairo_show_layout(viewVars.cr, viewVars.layout);
297
298	Cairo.cairo_restore(viewVars.cr);
299}
300
301// Text Measurement
302void measureText(ViewPlatformVars* viewVars, string str, out Size sz) {
303	Pango.pango_layout_set_text(viewVars.layout,
304		str.ptr, str.length);
305
306	Pango.pango_layout_get_size(viewVars.layout, cast(int*)&sz.x, cast(int*)&sz.y);
307
308	sz.x /= Pango.PANGO_SCALE;
309	sz.y /= Pango.PANGO_SCALE;
310}
311
312void measureText(ViewPlatformVars* viewVars, string str, uint length, out Size sz) {
313	Pango.pango_layout_set_text(viewVars.layout,
314		str.ptr, length);
315
316	Pango.pango_layout_get_size(viewVars.layout, cast(int*)&sz.x, cast(int*)&sz.y);
317
318	sz.x /= Pango.PANGO_SCALE;
319	sz.y /= Pango.PANGO_SCALE;
320}
321
322// Text Colors
323void setTextBackgroundColor(ViewPlatformVars* viewVars, ref Color textColor) {
324	// Color is an INT
325	// divide
326
327	int r, g, b, a;
328
329	r = cast(int)(textColor.red * 0xffffp0);
330	g = cast(int)(textColor.green * 0xffffp0);
331	b = cast(int)(textColor.blue * 0xffffp0);
332	a = cast(int)(textColor.alpha * 0xffffp0);
333
334	viewVars.attr_bg = Pango.pango_attr_background_new(r, g, b);
335
336	viewVars.attr_bg.start_index = 0;
337	viewVars.attr_bg.end_index = -1;
338
339//Pango.pango_attr_list_insert(viewVars.attr_list_opaque, viewVars.attr_bg);
340	Pango.pango_attr_list_change(viewVars.attr_list_opaque, viewVars.attr_bg);
341
342//		Pango.pango_attribute_destroy(viewVars.attr_bg);
343}
344
345void setTextColor(ViewPlatformVars* viewVars, ref Color textColor) {
346	// Color is an INT
347	// divide
348
349	double r, g, b, a;
350
351	r = textColor.red;
352	g = textColor.green;
353	b = textColor.blue;
354	a = textColor.alpha;
355
356	viewVars.textclr_red = r;
357	viewVars.textclr_green = g;
358	viewVars.textclr_blue = b;
359	viewVars.textclr_alpha = a;
360}
361
362// Text States
363
364void setTextModeTransparent(ViewPlatformVars* viewVars) {
365	Pango.pango_layout_set_attributes(viewVars.layout, viewVars.attr_list_transparent);
366}
367
368void setTextModeOpaque(ViewPlatformVars* viewVars) {
369	Pango.pango_layout_set_attributes(viewVars.layout, viewVars.attr_list_opaque);
370}
371
372// Graphics States
373
374void setAntialias(ViewPlatformVars* viewVars, bool value) {
375	viewVars.aa = value;
376	if (viewVars.aa) {
377		Cairo.cairo_set_antialias(viewVars.cr, Cairo.cairo_antialias_t.CAIRO_ANTIALIAS_DEFAULT);
378	}
379	else {
380		Cairo.cairo_set_antialias(viewVars.cr, Cairo.cairo_antialias_t.CAIRO_ANTIALIAS_NONE);
381	}
382}
383
384// Brushes
385
386void createBrush(BrushPlatformVars* brush, in Color clr) {
387	brush.handle = Cairo.cairo_pattern_create_rgba(clr.red,clr.green,clr.blue,clr.alpha);
388}
389
390void setBrush(ViewPlatformVars* viewVars, BrushPlatformVars* brush) {
391	viewVars.curBrush = *brush;
392}
393
394void destroyBrush(BrushPlatformVars* brush) {
395	Cairo.cairo_pattern_destroy(brush.handle);
396}
397
398// BitmapBrush
399
400void createBitmapBrush(BrushPlatformVars* brush, ref ViewPlatformVars viewVarsSrc) {
401	brush.handle = Cairo.cairo_pattern_create_for_surface(viewVarsSrc.surface);
402	Cairo.cairo_pattern_set_extend(brush.handle, Cairo.cairo_extend_t.CAIRO_EXTEND_REPEAT);
403}
404
405void createGradientBrush(BrushPlatformVars* brush, double origx, double origy, double[] points, Color[] clrs, double angle, double width) {
406	double x0, y0, x1, y1;
407	x0 = origx;
408	y0 = origy;
409	x1 = origx + (cos(angle) * width);
410	y1 = origy + (sin(angle) * width);
411
412	brush.handle = Cairo.cairo_pattern_create_linear(x0, y0, x1, y1);
413	foreach(size_t i, point; points) {
414		Cairo.cairo_pattern_add_color_stop_rgba(brush.handle, point,
415				clrs[i].red, clrs[i].green, clrs[i].blue, clrs[i].alpha);
416	}
417	Cairo.cairo_pattern_set_extend(brush.handle, Cairo.cairo_extend_t.CAIRO_EXTEND_REPEAT);
418}
419
420// Pens
421
422void createPen(PenPlatformVars* pen, ref Color clr, double width) {
423	pen.handle = Cairo.cairo_pattern_create_rgba(clr.red,clr.green,clr.blue,clr.alpha);
424	pen.width = width;
425}
426
427void createPenWithBrush(PenPlatformVars* pen, ref BrushPlatformVars brush, double width) {
428	pen.handle = Cairo.cairo_pattern_reference(brush.handle);
429	pen.width = width;
430}
431
432void setPen(ViewPlatformVars* viewVars, PenPlatformVars* pen) {
433	viewVars.curPen = *pen;
434}
435
436void destroyPen(PenPlatformVars* pen) {
437	Cairo.cairo_pattern_destroy(pen.handle);
438}
439
440// View Interfacing
441
442void drawView(ref ViewPlatformVars* viewVars, ref View view, int x, int y, ref ViewPlatformVars* viewVarsSrc, ref View srcView) {
443	Cairo.cairo_set_source_surface(viewVars.cr, viewVarsSrc.surface, x, y);
444	Cairo.cairo_paint(viewVars.cr);
445}
446
447void drawView(ref ViewPlatformVars* viewVars, ref View view, int x, int y, ref ViewPlatformVars* viewVarsSrc, ref View srcView, int viewX, int viewY) {
448	Cairo.cairo_save(viewVars.cr);
449	Cairo.cairo_set_source_surface(viewVars.cr, viewVarsSrc.surface, x - viewX, y - viewY);
450	double x1,y1,x2,y2;
451	x1 = x;
452	y1 = y;
453	x2 = view.width() - viewX;
454	y2 = view.height() - viewY;
455	Cairo.cairo_rectangle(viewVars.cr, x1, y1, x2, y2);
456	Cairo.cairo_restore(viewVars.cr);
457	Cairo.cairo_fill(viewVars.cr);
458}
459
460void drawView(ref ViewPlatformVars* viewVars, ref View view, int x, int y, ref ViewPlatformVars* viewVarsSrc, ref View srcView, int viewX, int viewY, int viewWidth, int viewHeight) {
461	Cairo.cairo_save(viewVars.cr);
462	Cairo.cairo_set_source_surface(viewVars.cr, viewVarsSrc.surface, x - viewX, y - viewY);
463	double x1,y1,x2,y2;
464	x1 = x;
465	y1 = y;
466	x2 = viewWidth;
467	y2 = viewHeight;
468	Cairo.cairo_rectangle(viewVars.cr, x1, y1, x2, y2);
469	Cairo.cairo_restore(viewVars.cr);
470	Cairo.cairo_fill(viewVars.cr);
471}
472
473void drawView(ref ViewPlatformVars* viewVars, ref View view, int x, int y, ref ViewPlatformVars* viewVarsSrc, ref View srcView, double opacity) {
474	Cairo.cairo_save(viewVars.cr);
475	Cairo.cairo_set_source_surface(viewVars.cr, viewVarsSrc.surface, x, y);
476	Cairo.cairo_paint_with_alpha(viewVars.cr, opacity);
477	Cairo.cairo_restore(viewVars.cr);
478}
479
480void drawView(ref ViewPlatformVars* viewVars, ref View view, int x, int y, ref ViewPlatformVars* viewVarsSrc, ref View srcView, int viewX, int viewY, double opacity) {
481	Cairo.cairo_set_source_surface(viewVars.cr, viewVarsSrc.surface, x - viewX, y - viewY);
482	double x1,y1,x2,y2;
483	x1 = x;
484	y1 = y;
485	x2 = view.width() - viewX;
486	y2 = view.height() - viewY;
487	Cairo.cairo_save(viewVars.cr);
488	Cairo.cairo_rectangle(viewVars.cr, x1, y1, x2, y2);
489	Cairo.cairo_clip(viewVars.cr);
490	Cairo.cairo_paint_with_alpha(viewVars.cr, opacity);
491	Cairo.cairo_restore(viewVars.cr);
492}
493
494void drawView(ref ViewPlatformVars* viewVars, ref View view, int x, int y, ref ViewPlatformVars* viewVarsSrc, ref View srcView, int viewX, int viewY, int viewWidth, int viewHeight, double opacity) {
495	Cairo.cairo_set_source_surface(viewVars.cr, viewVarsSrc.surface, x - viewX, y - viewY);
496	double x1,y1,x2,y2;
497	x1 = x;
498	y1 = y;
499	x2 = viewWidth;
500	y2 = viewHeight;
501	Cairo.cairo_save(viewVars.cr);
502	Cairo.cairo_rectangle(viewVars.cr, x1, y1, x2, y2);
503	Cairo.cairo_clip(viewVars.cr);
504	Cairo.cairo_paint_with_alpha(viewVars.cr, opacity);
505	Cairo.cairo_restore(viewVars.cr);
506}
507
508void fillRegion(ViewPlatformVars* viewVars, RegionPlatformVars* rgnVars, bool rgnPlatformDirty, Region rgn, int x, int y) {
509}
510
511void strokeRegion(ViewPlatformVars* viewVars, RegionPlatformVars* rgnVars, bool rgnPlatformDirty, Region rgn, int x, int y) {
512}
513
514void drawRegion(ViewPlatformVars* viewVars, RegionPlatformVars* rgnVars, bool rgnPlatformDirty, Region rgn, int x, int y) {
515}
516
517void clipSave(ViewPlatformVars* viewVars)
518{
519}
520
521void clipRestore(ViewPlatformVars* viewVars)
522{
523}
524
525void clipRect(ViewPlatformVars* viewVars, int x, int y, int x2, int y2)
526{
527}
528
529void clipRegion(ViewPlatformVars* viewVars, Region region)
530{
531}