2004-12-25 14:37:35 +03:00
|
|
|
/*
|
2006-11-27 18:35:18 +03:00
|
|
|
* This file is part of NetSurf, http://netsurf-browser.org/
|
2004-12-25 14:37:35 +03:00
|
|
|
* Licensed under the GNU General Public License,
|
|
|
|
* http://www.opensource.org/licenses/gpl-license
|
|
|
|
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* Target independent plotting (interface).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NETSURF_DESKTOP_PLOTTERS_H_
|
|
|
|
#define _NETSURF_DESKTOP_PLOTTERS_H_
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2007-05-31 02:39:54 +04:00
|
|
|
#include "css/css.h"
|
2004-12-25 14:37:35 +03:00
|
|
|
|
|
|
|
|
|
|
|
struct bitmap;
|
|
|
|
|
|
|
|
|
|
|
|
/** Set of target specific plotting functions. */
|
|
|
|
struct plotter_table {
|
|
|
|
bool (*clg)(colour c);
|
|
|
|
bool (*rectangle)(int x0, int y0, int width, int height,
|
|
|
|
int line_width, colour c, bool dotted, bool dashed);
|
|
|
|
bool (*line)(int x0, int y0, int x1, int y1, int width,
|
|
|
|
colour c, bool dotted, bool dashed);
|
|
|
|
bool (*polygon)(int *p, unsigned int n, colour fill);
|
|
|
|
bool (*fill)(int x0, int y0, int x1, int y1, colour c);
|
|
|
|
bool (*clip)(int x0, int y0, int x1, int y1);
|
2005-02-20 16:17:29 +03:00
|
|
|
bool (*text)(int x, int y, struct css_style *style, const char *text,
|
2004-12-25 14:37:35 +03:00
|
|
|
size_t length, colour bg, colour c);
|
2006-03-19 22:03:07 +03:00
|
|
|
bool (*disc)(int x, int y, int radius, colour c, bool filled);
|
2006-03-21 20:22:41 +03:00
|
|
|
bool (*arc)(int x, int y, int radius, int angle1, int angle2,
|
|
|
|
colour c);
|
2004-12-25 14:37:35 +03:00
|
|
|
bool (*bitmap)(int x, int y, int width, int height,
|
|
|
|
struct bitmap *bitmap, colour bg);
|
|
|
|
bool (*bitmap_tile)(int x, int y, int width, int height,
|
|
|
|
struct bitmap *bitmap, colour bg,
|
|
|
|
bool repeat_x, bool repeat_y);
|
2006-07-10 13:52:31 +04:00
|
|
|
bool (*group_start)(const char *name); /** optional */
|
|
|
|
bool (*group_end)(void); /** optional */
|
2006-08-19 23:31:07 +04:00
|
|
|
bool (*flush)(void);
|
2007-08-07 08:00:17 +04:00
|
|
|
bool (*path)(float *p, unsigned int n, colour fill, float width,
|
|
|
|
colour c, float *transform);
|
2004-12-25 14:37:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Current plotters, must be assigned before use. */
|
|
|
|
extern struct plotter_table plot;
|
|
|
|
|
2007-08-07 08:00:17 +04:00
|
|
|
enum path_command {
|
|
|
|
PLOTTER_PATH_MOVE,
|
|
|
|
PLOTTER_PATH_CLOSE,
|
|
|
|
PLOTTER_PATH_LINE,
|
|
|
|
PLOTTER_PATH_BEZIER,
|
|
|
|
};
|
|
|
|
|
2004-12-25 14:37:35 +03:00
|
|
|
|
|
|
|
#endif
|