From 667605869fba31c48e61736f89efe4126d27db0c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 30 May 2016 21:05:57 +0100 Subject: move plotters header into public API --- content/content.c | 1 - content/handlers/image/bmp.c | 2 +- content/handlers/image/image.c | 2 +- content/handlers/image/nssprite.c | 2 +- content/handlers/image/rsvg.c | 2 +- content/handlers/image/svg.c | 2 +- desktop/browser.c | 2 +- desktop/browser_history.c | 2 +- desktop/knockout.c | 2 +- desktop/knockout.h | 2 +- desktop/plot_style.c | 2 +- desktop/plotters.h | 160 -------------------------- desktop/print.c | 2 +- desktop/save_pdf.c | 2 +- desktop/scrollbar.c | 2 +- desktop/selection.c | 2 +- desktop/textarea.c | 2 +- desktop/treeview.c | 2 +- frontends/amiga/clipboard.c | 2 +- frontends/amiga/dt_anim.c | 2 +- frontends/amiga/dt_picture.c | 2 +- frontends/amiga/dt_sound.c | 2 +- frontends/amiga/font.h | 2 +- frontends/amiga/history_local.c | 2 +- frontends/amiga/icon.c | 2 +- frontends/amiga/plotters.h | 2 +- frontends/amiga/plugin_hack.c | 2 +- frontends/amiga/print.c | 2 +- frontends/atari/cookies.c | 2 +- frontends/atari/font.c | 2 +- frontends/atari/plot/plot.c | 2 +- frontends/atari/rootwin.c | 2 +- frontends/atari/statusbar.c | 2 +- frontends/atari/toolbar.c | 2 +- frontends/atari/treeview.c | 2 +- frontends/beos/bitmap.cpp | 2 +- frontends/beos/cookies.cpp | 2 +- frontends/beos/plotters.cpp | 2 +- frontends/beos/scaffolding.cpp | 2 +- frontends/beos/window.cpp | 2 +- frontends/cocoa/BrowserView.m | 2 +- frontends/cocoa/HistoryView.m | 2 +- frontends/cocoa/NetsurfApp.m | 2 +- frontends/cocoa/Tree.m | 2 +- frontends/cocoa/TreeView.m | 2 +- frontends/cocoa/apple_image.m | 2 +- frontends/cocoa/bitmap.m | 2 +- frontends/cocoa/font.m | 2 +- frontends/cocoa/plotter.m | 2 +- frontends/framebuffer/bitmap.c | 2 +- frontends/framebuffer/fbtk/fbtk.c | 2 +- frontends/framebuffer/fbtk/text.c | 2 +- frontends/framebuffer/framebuffer.c | 2 +- frontends/framebuffer/gui.c | 2 +- frontends/framebuffer/localhistory.c | 2 +- frontends/gtk/bitmap.c | 2 +- frontends/gtk/plotters.c | 2 +- frontends/gtk/print.c | 2 +- frontends/gtk/scaffolding.c | 2 +- frontends/gtk/treeview.c | 2 +- frontends/gtk/window.c | 2 +- frontends/monkey/browser.c | 2 +- frontends/monkey/plot.c | 2 +- frontends/riscos/bitmap.c | 2 +- frontends/riscos/content-handlers/artworks.c | 2 +- frontends/riscos/content-handlers/draw.c | 2 +- frontends/riscos/content-handlers/sprite.c | 2 +- frontends/riscos/gui/progress_bar.c | 2 +- frontends/riscos/gui/status_bar.c | 2 +- frontends/riscos/gui/url_bar.c | 2 +- frontends/riscos/history.c | 2 +- frontends/riscos/plotters.c | 2 +- frontends/riscos/print.c | 2 +- frontends/riscos/save_draw.c | 2 +- frontends/riscos/toolbar.c | 1 - frontends/riscos/treeview.c | 2 +- frontends/riscos/window.c | 2 +- frontends/windows/bitmap.c | 2 +- frontends/windows/drawable.c | 2 +- frontends/windows/localhistory.c | 2 +- frontends/windows/plot.c | 2 +- include/netsurf/browser_window.h | 4 +- include/netsurf/plotters.h | 161 +++++++++++++++++++++++++++ render/form.c | 2 +- render/html_redraw.c | 2 +- render/textplain.c | 2 +- 86 files changed, 244 insertions(+), 245 deletions(-) delete mode 100644 desktop/plotters.h create mode 100644 include/netsurf/plotters.h diff --git a/content/content.c b/content/content.c index 36e3e7948..888202e6e 100644 --- a/content/content.c +++ b/content/content.c @@ -28,7 +28,6 @@ #include "utils/utils.h" #include "utils/log.h" #include "utils/messages.h" -#include "desktop/plotters.h" #include "desktop/knockout.h" #include "desktop/gui_internal.h" #include "netsurf/browser_window.h" diff --git a/content/handlers/image/bmp.c b/content/handlers/image/bmp.c index e108b48ac..114a551a6 100644 --- a/content/handlers/image/bmp.c +++ b/content/handlers/image/bmp.c @@ -30,7 +30,7 @@ #include "utils/messages.h" #include "content/content_protected.h" #include "desktop/gui_internal.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/bitmap.h" #include "bmp.h" diff --git a/content/handlers/image/image.c b/content/handlers/image/image.c index 487b35bcd..da5eea117 100644 --- a/content/handlers/image/image.c +++ b/content/handlers/image/image.c @@ -23,7 +23,7 @@ #include "utils/log.h" #include "utils/messages.h" #include "content/content.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/gui_internal.h" #include "netsurf/bitmap.h" diff --git a/content/handlers/image/nssprite.c b/content/handlers/image/nssprite.c index 082bf9eb1..8912f8356 100644 --- a/content/handlers/image/nssprite.c +++ b/content/handlers/image/nssprite.c @@ -30,7 +30,7 @@ #include "utils/messages.h" #include "content/content_protected.h" #include "desktop/gui_internal.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/bitmap.h" #include "nssprite.h" diff --git a/content/handlers/image/rsvg.c b/content/handlers/image/rsvg.c index dce1ea9fe..9842d459c 100644 --- a/content/handlers/image/rsvg.c +++ b/content/handlers/image/rsvg.c @@ -42,7 +42,7 @@ #include "utils/utils.h" #include "utils/messages.h" #include "content/content_protected.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/gui_internal.h" #include "netsurf/bitmap.h" diff --git a/content/handlers/image/svg.c b/content/handlers/image/svg.c index 3eff684fd..82c85ac4c 100644 --- a/content/handlers/image/svg.c +++ b/content/handlers/image/svg.c @@ -30,7 +30,7 @@ #include "utils/messages.h" #include "utils/utils.h" #include "content/content_protected.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "svg.h" diff --git a/desktop/browser.c b/desktop/browser.c index 6b3746f4a..c0db76abc 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -68,7 +68,7 @@ #include "desktop/knockout.h" #include "desktop/scrollbar.h" #include "desktop/selection.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/theme.h" #include "netsurf/misc.h" #include "netsurf/window.h" diff --git a/desktop/browser_history.c b/desktop/browser_history.c index 79a921ad1..a8c8ee041 100644 --- a/desktop/browser_history.c +++ b/desktop/browser_history.c @@ -40,7 +40,7 @@ #include "desktop/gui_internal.h" #include "desktop/browser_history.h" #include "desktop/browser_private.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #define WIDTH 100 #define HEIGHT 86 diff --git a/desktop/knockout.c b/desktop/knockout.c index a20ec28b7..b930ef673 100644 --- a/desktop/knockout.c +++ b/desktop/knockout.c @@ -74,7 +74,7 @@ #include "desktop/gui_internal.h" #include "desktop/knockout.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" /* Define to enable knockout debug */ #undef KNOCKOUT_DEBUG diff --git a/desktop/knockout.h b/desktop/knockout.h index a6b61d836..c4f1245fc 100644 --- a/desktop/knockout.h +++ b/desktop/knockout.h @@ -23,7 +23,7 @@ #ifndef _NETSURF_DESKTOP_KNOCKOUT_H_ #define _NETSURF_DESKTOP_KNOCKOUT_H_ -#include "desktop/plotters.h" +#include "netsurf/plotters.h" bool knockout_plot_start(const struct redraw_context *ctx, diff --git a/desktop/plot_style.c b/desktop/plot_style.c index 05e42baad..f9ba4bcbf 100644 --- a/desktop/plot_style.c +++ b/desktop/plot_style.c @@ -23,7 +23,7 @@ * These plot styles are globaly available and used in many places. */ -#include "desktop/plotters.h" +#include "netsurf/plotters.h" static plot_style_t plot_style_fill_white_static = { .fill_type = PLOT_OP_TYPE_SOLID, diff --git a/desktop/plotters.h b/desktop/plotters.h deleted file mode 100644 index d764de2d2..000000000 --- a/desktop/plotters.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2004 James Bursa - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** \file - * Target independent plotting (interface). - */ - -#ifndef _NETSURF_DESKTOP_PLOTTERS_H_ -#define _NETSURF_DESKTOP_PLOTTERS_H_ - -#include -#include - -#include "desktop/plot_style.h" - -struct bitmap; -struct rect; - -typedef unsigned long bitmap_flags_t; -#define BITMAPF_NONE 0 -#define BITMAPF_REPEAT_X 1 -#define BITMAPF_REPEAT_Y 2 - -enum path_command { - PLOTTER_PATH_MOVE, - PLOTTER_PATH_CLOSE, - PLOTTER_PATH_LINE, - PLOTTER_PATH_BEZIER, -}; - -/** Set of target specific plotting functions. - * - * The functions are: - * arc - Plots an arc, around (x,y), from anticlockwise from angle1 to - * angle2. Angles are measured anticlockwise from horizontal, in - * degrees. - * disc - Plots a circle, centered on (x,y), which is optionally filled. - * line - Plots a line from (x0,y0) to (x1,y1). Coordinates are at - * centre of line width/thickness. - * path - Plots a path consisting of cubic Bezier curves. Line colour is - * given by c and fill colour is given by fill. - * polygon - Plots a filled polygon with straight lines between points. - * The lines around the edge of the ploygon are not plotted. The - * polygon is filled with the non-zero winding rule. - * rectangle - Plots a rectangle outline. The line can be solid, dotted or - * dashed. Top left corner at (x0,y0) and rectangle has given - * width and height. - * fill - Plots a filled rectangle. Top left corner at (x0,y0), bottom - * right corner at (x1,y1). Note: (x0,y0) is inside filled area, - * but (x1,y1) is below and to the right. See diagram below. - * clip - Sets a clip rectangle for subsequent plots. - * text - Plots text. (x,y) is the coordinate of the left hand side of - * the text's baseline. The text is UTF-8 encoded. The colour, c, - * is the colour of the text. Background colour, bg, may be used - * optionally to attempt to provide anti-aliased text without - * screen reads. Font information is provided in the style. - * bitmap - Tiled plot of a bitmap image. (x,y) gives the top left - * coordinate of an explicitly placed tile. From this tile the - * image can repeat in all four directions -- up, down, left and - * right -- to the extents given by the current clip rectangle. - * The bitmap_flags say whether to tile in the x and y - * directions. If not tiling in x or y directions, the single - * image is plotted. The width and height give the dimensions - * the image is to be scaled to. - * group_start - Start of a group of objects. Used when plotter implements - * export to a vector graphics file format. (Optional.) - * group_end - End of the most recently started group. (Optional.) - * flush - Only used internally by the knockout code. Should be NULL in - * any front end display plotters or export plotters. - * - * Plotter options: - * option_knockout - Optimisation particularly for unaccelerated screen - * redraw. It tries to avoid plotting to the same area - * more than once. See desktop/knockout.c - * - * Coordinates are from top left of canvas and (0,0) is the top left grid - * denomination. If a "fill" is drawn from (0,0) to (4,3), the result is: - * - * 0 1 2 3 4 5 - * +-+-+-+-+-+- - * 0 |#|#|#|#| | - * +-+-+-+-+-+- - * 1 |#|#|#|#| | - * +-+-+-+-+-+- - * 2 |#|#|#|#| | - * +-+-+-+-+-+- - * 3 | | | | | | - */ -struct plotter_table { - /* clipping operations */ - bool (*clip)(const struct rect *clip); - - /* shape primatives */ - bool (*arc)(int x, int y, int radius, int angle1, int angle2, const plot_style_t *pstyle); - bool (*disc)(int x, int y, int radius, const plot_style_t *pstyle); - bool (*line)(int x0, int y0, int x1, int y1, const plot_style_t *pstyle); - bool (*rectangle)(int x0, int y0, int x1, int y1, const plot_style_t *pstyle); - bool (*polygon)(const int *p, unsigned int n, const plot_style_t *pstyle); - - /* complex path (for SVG) */ - bool (*path)(const float *p, unsigned int n, colour fill, float width, - colour c, const float transform[6]); - - /* Image */ - bool (*bitmap)(int x, int y, int width, int height, - struct bitmap *bitmap, colour bg, - bitmap_flags_t flags); - - /** - * Text. - * - * \param x x coordinate - * \param y y coordinate - * \param text UTF-8 string to plot - * \param length length of string, in bytes - * \param fstyle plot style for this text - * \return true on success, false on error and error reported - */ - bool (*text)(int x, int y, const char *text, size_t length, - const plot_font_style_t *fstyle); - - /* optional callbacks */ - bool (*group_start)(const char *name); /**< optional, may be NULL */ - bool (*group_end)(void); /**< optional, may be NULL */ - bool (*flush)(void); /**< optional, may be NULL */ - - /* flags */ - bool option_knockout; /**< set if knockout rendering is required */ -}; - - -/* Redraw context */ -struct redraw_context { - /** Redraw to show interactive features, such as active selections - * etc. Should be off for printing. */ - bool interactive; - - /** Render background images. May want it off for printing. */ - bool background_images; - - /** Current plotters, must be assigned before use. */ - const struct plotter_table *plot; -}; - -#endif diff --git a/desktop/print.c b/desktop/print.c index c3cfefc0b..8daec887c 100644 --- a/desktop/print.c +++ b/desktop/print.c @@ -35,7 +35,7 @@ #include "content/handlers/css/utils.h" #include "render/box.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/print.h" #include "desktop/printer.h" diff --git a/desktop/save_pdf.c b/desktop/save_pdf.c index 0c870b464..d303eca7c 100644 --- a/desktop/save_pdf.c +++ b/desktop/save_pdf.c @@ -62,7 +62,7 @@ #include "utils/nsoption.h" #include "netsurf/bitmap.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/print.h" #include "desktop/printer.h" diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c index 740fd33ae..b9e963a26 100644 --- a/desktop/scrollbar.c +++ b/desktop/scrollbar.c @@ -34,7 +34,7 @@ #include "desktop/system_colour.h" #include "netsurf/mouse.h" #include "desktop/scrollbar.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/plot_style.h" diff --git a/desktop/selection.c b/desktop/selection.c index 7c1d15caa..b2c7837c5 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -39,7 +39,7 @@ #include "netsurf/mouse.h" #include "desktop/browser_private.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/save_text.h" #include "desktop/selection.h" #include "netsurf/clipboard.h" diff --git a/desktop/textarea.c b/desktop/textarea.c index 8c9efe14d..5d187091d 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -35,7 +35,7 @@ #include "netsurf/mouse.h" #include "desktop/textarea.h" #include "desktop/textinput.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/scrollbar.h" #include "netsurf/clipboard.h" #include "netsurf/layout.h" diff --git a/desktop/treeview.c b/desktop/treeview.c index ead0510b8..4fa0544c5 100644 --- a/desktop/treeview.c +++ b/desktop/treeview.c @@ -29,7 +29,7 @@ #include "desktop/system_colour.h" #include "desktop/knockout.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/textarea.h" #include "desktop/treeview.h" #include "netsurf/clipboard.h" diff --git a/frontends/amiga/clipboard.c b/frontends/amiga/clipboard.c index 2d8630726..bcdc51c97 100644 --- a/frontends/amiga/clipboard.c +++ b/frontends/amiga/clipboard.c @@ -32,7 +32,7 @@ #include "utils/nsurl.h" #include "content/hlcache.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/textinput.h" #include "netsurf/window.h" #include "netsurf/clipboard.h" diff --git a/frontends/amiga/dt_anim.c b/frontends/amiga/dt_anim.c index fec707683..c177321e1 100644 --- a/frontends/amiga/dt_anim.c +++ b/frontends/amiga/dt_anim.c @@ -38,7 +38,7 @@ #include "utils/log.h" #include "utils/messages.h" #include "content/content_protected.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/bitmap.h" #include "amiga/bitmap.h" diff --git a/frontends/amiga/dt_picture.c b/frontends/amiga/dt_picture.c index aba089379..49dde5e67 100644 --- a/frontends/amiga/dt_picture.c +++ b/frontends/amiga/dt_picture.c @@ -34,7 +34,7 @@ #include "utils/log.h" #include "utils/messages.h" #include "content/content_protected.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/bitmap.h" #include "content/handlers/image/image_cache.h" diff --git a/frontends/amiga/dt_sound.c b/frontends/amiga/dt_sound.c index fe1b1fc43..04486c1fb 100644 --- a/frontends/amiga/dt_sound.c +++ b/frontends/amiga/dt_sound.c @@ -26,7 +26,7 @@ #include "amiga/filetype.h" #include "amiga/datatypes.h" #include "content/content_protected.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "render/box.h" #include "utils/log.h" #include "utils/messages.h" diff --git a/frontends/amiga/font.h b/frontends/amiga/font.h index cd526057f..5e0721167 100755 --- a/frontends/amiga/font.h +++ b/frontends/amiga/font.h @@ -19,7 +19,7 @@ #ifndef AMIGA_FONT_H #define AMIGA_FONT_H -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/errors.h" #include #include diff --git a/frontends/amiga/history_local.c b/frontends/amiga/history_local.c index a1ada5b00..3a6cbe42d 100755 --- a/frontends/amiga/history_local.c +++ b/frontends/amiga/history_local.c @@ -46,7 +46,7 @@ #include "utils/messages.h" #include "desktop/browser_history.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/window.h" #include "graphics/rpattr.h" diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c index 819879d00..201ce5f78 100644 --- a/frontends/amiga/icon.c +++ b/frontends/amiga/icon.c @@ -41,7 +41,7 @@ #include "utils/messages.h" #include "utils/utils.h" #include "utils/file.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/bitmap.h" #include "content/content_protected.h" diff --git a/frontends/amiga/plotters.h b/frontends/amiga/plotters.h index 7baa21fb5..8fa2b06ae 100644 --- a/frontends/amiga/plotters.h +++ b/frontends/amiga/plotters.h @@ -18,7 +18,7 @@ #ifndef AMIGA_PLOTTERS_H #define AMIGA_PLOTTERS_H -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include #include diff --git a/frontends/amiga/plugin_hack.c b/frontends/amiga/plugin_hack.c index 21f4da142..19fa66cd5 100644 --- a/frontends/amiga/plugin_hack.c +++ b/frontends/amiga/plugin_hack.c @@ -28,7 +28,7 @@ #include "amiga/plugin_hack.h" #include "content/content_protected.h" #include "content/hlcache.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/log.h" #include "utils/messages.h" diff --git a/frontends/amiga/print.c b/frontends/amiga/print.c index f4cd31452..007245c73 100644 --- a/frontends/amiga/print.c +++ b/frontends/amiga/print.c @@ -49,7 +49,7 @@ #include "utils/nsoption.h" #include "utils/messages.h" #include "utils/utils.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/printer.h" #include "desktop/print.h" #include "netsurf/layout.h" diff --git a/frontends/atari/cookies.c b/frontends/atari/cookies.c index eff4ad8d5..78b8d60fc 100644 --- a/frontends/atari/cookies.c +++ b/frontends/atari/cookies.c @@ -21,7 +21,7 @@ #include "utils/log.h" #include "utils/messages.h" #include "netsurf/mouse.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/cookie_manager.h" #include "desktop/core_window.h" diff --git a/frontends/atari/font.c b/frontends/atari/font.c index a90b79566..85fecced2 100644 --- a/frontends/atari/font.c +++ b/frontends/atari/font.c @@ -26,7 +26,7 @@ #include "utils/nsoption.h" #include "netsurf/layout.h" #include "netsurf/mouse.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "atari/gui.h" #include "atari/plot/fontplot.h" diff --git a/frontends/atari/plot/plot.c b/frontends/atari/plot/plot.c index 2e35bcdbd..3a8780231 100644 --- a/frontends/atari/plot/plot.c +++ b/frontends/atari/plot/plot.c @@ -30,7 +30,7 @@ #include "utils/utf8.h" #include "utils/utils.h" #include "netsurf/bitmap.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/mouse.h" #include "atari/gui.h" diff --git a/frontends/atari/rootwin.c b/frontends/atari/rootwin.c index 5a5bdcc25..d309f8dc5 100644 --- a/frontends/atari/rootwin.c +++ b/frontends/atari/rootwin.c @@ -39,7 +39,7 @@ #include "utils/log.h" #include "netsurf/browser_window.h" #include "netsurf/mouse.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/textinput.h" #include "content/content.h" #include "content/hlcache.h" diff --git a/frontends/atari/statusbar.c b/frontends/atari/statusbar.c index c05e1b4bf..3a216f9a8 100644 --- a/frontends/atari/statusbar.c +++ b/frontends/atari/statusbar.c @@ -29,7 +29,7 @@ #include "utils/log.h" #include "netsurf/mouse.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "atari/gui.h" #include "atari/statusbar.h" diff --git a/frontends/atari/toolbar.c b/frontends/atari/toolbar.c index 2a5053847..27d7b531b 100644 --- a/frontends/atari/toolbar.c +++ b/frontends/atari/toolbar.c @@ -35,7 +35,7 @@ #include "netsurf/browser_window.h" #include "netsurf/mouse.h" #include "desktop/plot_style.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/tree.h" #include "desktop/hotlist.h" #include "desktop/textarea.h" diff --git a/frontends/atari/treeview.c b/frontends/atari/treeview.c index b47429859..1048fb06f 100644 --- a/frontends/atari/treeview.c +++ b/frontends/atari/treeview.c @@ -28,7 +28,7 @@ #include "utils/messages.h" #include "utils/utils.h" #include "content/urldb.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/mouse.h" #include "desktop/treeview.h" diff --git a/frontends/beos/bitmap.cpp b/frontends/beos/bitmap.cpp index 3287fd0f7..4ce40750c 100644 --- a/frontends/beos/bitmap.cpp +++ b/frontends/beos/bitmap.cpp @@ -40,7 +40,7 @@ extern "C" { #include "utils/log.h" #include "content/content.h" #include "content/urldb.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/browser_window.h" #include "netsurf/bitmap.h" } diff --git a/frontends/beos/cookies.cpp b/frontends/beos/cookies.cpp index bf8ce51d7..d4c8e5b26 100644 --- a/frontends/beos/cookies.cpp +++ b/frontends/beos/cookies.cpp @@ -24,7 +24,7 @@ extern "C" { #include "netsurf/mouse.h" #include "utils/log.h" #include "desktop/cookie_manager.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/tree.h" #include "desktop/textinput.h" #include "content/urldb.h" diff --git a/frontends/beos/plotters.cpp b/frontends/beos/plotters.cpp index 3fd786ecd..5ba3fbbcb 100644 --- a/frontends/beos/plotters.cpp +++ b/frontends/beos/plotters.cpp @@ -31,7 +31,7 @@ #include #include extern "C" { -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/log.h" #include "utils/utils.h" #include "utils/nsoption.h" diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp index 75ef241f7..6cb9a771e 100644 --- a/frontends/beos/scaffolding.cpp +++ b/frontends/beos/scaffolding.cpp @@ -59,7 +59,7 @@ extern "C" { #include "desktop/version.h" #include "desktop/searchweb.h" #include "desktop/search.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/nsoption.h" #include "desktop/textinput.h" #include "render/form.h" diff --git a/frontends/beos/window.cpp b/frontends/beos/window.cpp index 4fd682365..237d92ab1 100644 --- a/frontends/beos/window.cpp +++ b/frontends/beos/window.cpp @@ -32,7 +32,7 @@ extern "C" { #include "netsurf/browser_window.h" #include "netsurf/mouse.h" #include "desktop/textinput.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/window.h" #include "netsurf/clipboard.h" } diff --git a/frontends/cocoa/BrowserView.m b/frontends/cocoa/BrowserView.m index 5d82c8526..db1c2492d 100644 --- a/frontends/cocoa/BrowserView.m +++ b/frontends/cocoa/BrowserView.m @@ -19,7 +19,7 @@ #import "utils/nsoption.h" #import "utils/messages.h" #import "netsurf/browser_window.h" -#import "desktop/plotters.h" +#import "netsurf/plotters.h" #import "desktop/textinput.h" #import "content/hlcache.h" diff --git a/frontends/cocoa/HistoryView.m b/frontends/cocoa/HistoryView.m index 7b192336e..bead8dbed 100644 --- a/frontends/cocoa/HistoryView.m +++ b/frontends/cocoa/HistoryView.m @@ -24,7 +24,7 @@ #import "cocoa/BrowserView.h" #import "desktop/browser_history.h" -#import "desktop/plotters.h" +#import "netsurf/plotters.h" @implementation HistoryView diff --git a/frontends/cocoa/NetsurfApp.m b/frontends/cocoa/NetsurfApp.m index c30bce07e..a8619e0ac 100644 --- a/frontends/cocoa/NetsurfApp.m +++ b/frontends/cocoa/NetsurfApp.m @@ -33,7 +33,7 @@ #import "utils/utils.h" #import "content/urldb.h" #import "utils/nsoption.h" -#import "desktop/plotters.h" +#import "netsurf/plotters.h" #import "desktop/save_complete.h" #import "desktop/textinput.h" #import "desktop/tree.h" diff --git a/frontends/cocoa/Tree.m b/frontends/cocoa/Tree.m index 5cd796ceb..359d54306 100644 --- a/frontends/cocoa/Tree.m +++ b/frontends/cocoa/Tree.m @@ -21,7 +21,7 @@ #import "cocoa/font.h" #import "cocoa/plotter.h" -#import "desktop/plotters.h" +#import "netsurf/plotters.h" #import "desktop/tree.h" @implementation Tree diff --git a/frontends/cocoa/TreeView.m b/frontends/cocoa/TreeView.m index a58a49623..71f5af450 100644 --- a/frontends/cocoa/TreeView.m +++ b/frontends/cocoa/TreeView.m @@ -19,7 +19,7 @@ #import "cocoa/TreeView.h" #import "cocoa/Tree.h" -#import "desktop/plotters.h" +#import "netsurf/plotters.h" #import "desktop/textinput.h" @interface TreeView () diff --git a/frontends/cocoa/apple_image.m b/frontends/cocoa/apple_image.m index 896cf4c72..5c82a2b3a 100644 --- a/frontends/cocoa/apple_image.m +++ b/frontends/cocoa/apple_image.m @@ -23,7 +23,7 @@ #include "utils/config.h" #include "content/content_protected.h" #include "netsurf/bitmap.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/utils.h" #import "cocoa/schedule.h" diff --git a/frontends/cocoa/bitmap.m b/frontends/cocoa/bitmap.m index f7c28f0ad..dd9e33fbe 100644 --- a/frontends/cocoa/bitmap.m +++ b/frontends/cocoa/bitmap.m @@ -24,7 +24,7 @@ #import #import "netsurf/browser_window.h" -#import "desktop/plotters.h" +#import "netsurf/plotters.h" #import "netsurf/bitmap.h" #import "content/urldb.h" #import "content/content.h" diff --git a/frontends/cocoa/font.m b/frontends/cocoa/font.m index 7b594b616..483d98933 100644 --- a/frontends/cocoa/font.m +++ b/frontends/cocoa/font.m @@ -23,7 +23,7 @@ #import "utils/nsoption.h" #import "netsurf/layout.h" -#import "desktop/plotters.h" +#import "netsurf/plotters.h" static NSLayoutManager *cocoa_prepare_layout_manager( const char *string, size_t length, diff --git a/frontends/cocoa/plotter.m b/frontends/cocoa/plotter.m index 472857dbe..2b721bfe6 100644 --- a/frontends/cocoa/plotter.m +++ b/frontends/cocoa/plotter.m @@ -21,7 +21,7 @@ #import "utils/log.h" #import "utils/utils.h" #import "netsurf/browser_window.h" -#import "desktop/plotters.h" +#import "netsurf/plotters.h" #import "desktop/plot_style.h" #import "cocoa/font.h" diff --git a/frontends/framebuffer/bitmap.c b/frontends/framebuffer/bitmap.c index df99e711d..dbe5647e3 100644 --- a/frontends/framebuffer/bitmap.c +++ b/frontends/framebuffer/bitmap.c @@ -31,7 +31,7 @@ #include "utils/log.h" #include "utils/utils.h" #include "netsurf/bitmap.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "content/content.h" #include "framebuffer/gui.h" diff --git a/frontends/framebuffer/fbtk/fbtk.c b/frontends/framebuffer/fbtk/fbtk.c index fa861b11b..c63a6d8c9 100644 --- a/frontends/framebuffer/fbtk/fbtk.c +++ b/frontends/framebuffer/fbtk/fbtk.c @@ -35,7 +35,7 @@ #include "utils/utils.h" #include "utils/log.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "framebuffer/gui.h" #include "framebuffer/fbtk.h" diff --git a/frontends/framebuffer/fbtk/text.c b/frontends/framebuffer/fbtk/text.c index 703a10b99..00dcba491 100644 --- a/frontends/framebuffer/fbtk/text.c +++ b/frontends/framebuffer/fbtk/text.c @@ -29,7 +29,7 @@ #include "utils/log.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "framebuffer/gui.h" #include "framebuffer/fbtk.h" diff --git a/frontends/framebuffer/framebuffer.c b/frontends/framebuffer/framebuffer.c index 00bd6a15a..74c72fe71 100644 --- a/frontends/framebuffer/framebuffer.c +++ b/frontends/framebuffer/framebuffer.c @@ -32,7 +32,7 @@ #include "utils/log.h" #include "utils/utf8.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/bitmap.h" #include "framebuffer/gui.h" diff --git a/frontends/framebuffer/gui.c b/frontends/framebuffer/gui.c index 7559648d5..7ef64b0f0 100644 --- a/frontends/framebuffer/gui.c +++ b/frontends/framebuffer/gui.c @@ -37,7 +37,7 @@ #include "netsurf/browser_window.h" #include "desktop/textinput.h" #include "desktop/browser_history.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "netsurf/window.h" #include "netsurf/misc.h" #include "netsurf/netsurf.h" diff --git a/frontends/framebuffer/localhistory.c b/frontends/framebuffer/localhistory.c index 1b2eb9a60..3192f0747 100644 --- a/frontends/framebuffer/localhistory.c +++ b/frontends/framebuffer/localhistory.c @@ -25,7 +25,7 @@ #include #include "desktop/browser_history.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "framebuffer/gui.h" #include "framebuffer/fbtk.h" diff --git a/frontends/gtk/bitmap.c b/frontends/gtk/bitmap.c index ff5a0c43f..1def140b8 100644 --- a/frontends/gtk/bitmap.c +++ b/frontends/gtk/bitmap.c @@ -34,7 +34,7 @@ #include "utils/log.h" #include "content/content.h" #include "netsurf/bitmap.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "gtk/scaffolding.h" #include "gtk/plotters.h" diff --git a/frontends/gtk/plotters.c b/frontends/gtk/plotters.c index 1d8c19827..1cebf58f0 100644 --- a/frontends/gtk/plotters.c +++ b/frontends/gtk/plotters.c @@ -32,7 +32,7 @@ #include "utils/log.h" #include "utils/utils.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/nsoption.h" #include "gtk/layout_pango.h" diff --git a/frontends/gtk/print.c b/frontends/gtk/print.c index a6e639996..17cb96f93 100644 --- a/frontends/gtk/print.c +++ b/frontends/gtk/print.c @@ -36,7 +36,7 @@ #include "content/content.h" #include "content/hlcache.h" #include "utils/nsoption.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/print.h" #include "desktop/printer.h" diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c index 6873b8997..38dfd2125 100644 --- a/frontends/gtk/scaffolding.c +++ b/frontends/gtk/scaffolding.c @@ -36,7 +36,7 @@ #include "desktop/browser_history.h" #include "netsurf/browser_window.h" #include "desktop/hotlist.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/print.h" #include "desktop/save_complete.h" #ifdef WITH_PDF_EXPORT diff --git a/frontends/gtk/treeview.c b/frontends/gtk/treeview.c index 9baf57b62..829e87a01 100644 --- a/frontends/gtk/treeview.c +++ b/frontends/gtk/treeview.c @@ -33,7 +33,7 @@ #include "utils/log.h" #include "utils/utf8.h" #include "desktop/tree.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "gtk/warn.h" #include "gtk/compat.h" diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c index 7cff9ee6b..dd713cb28 100644 --- a/frontends/gtk/window.c +++ b/frontends/gtk/window.c @@ -44,7 +44,7 @@ #include "desktop/searchweb.h" #include "desktop/textinput.h" #include "netsurf/window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "render/form.h" #include "gtk/warn.h" diff --git a/frontends/monkey/browser.c b/frontends/monkey/browser.c index 5c1d15723..bfabd0f88 100644 --- a/frontends/monkey/browser.c +++ b/frontends/monkey/browser.c @@ -28,7 +28,7 @@ #include "netsurf/mouse.h" #include "netsurf/window.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "content/hlcache.h" #include "monkey/browser.h" diff --git a/frontends/monkey/plot.c b/frontends/monkey/plot.c index 50f812480..bd94e7551 100644 --- a/frontends/monkey/plot.c +++ b/frontends/monkey/plot.c @@ -19,7 +19,7 @@ #include #include "utils/utils.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" static bool monkey_plot_disc(int x, int y, int radius, const plot_style_t *style) diff --git a/frontends/riscos/bitmap.c b/frontends/riscos/bitmap.c index 525a230b3..e0fd38ba8 100644 --- a/frontends/riscos/bitmap.c +++ b/frontends/riscos/bitmap.c @@ -43,7 +43,7 @@ #include "utils/filename.h" #include "utils/log.h" #include "utils/messages.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "content/content.h" #include "netsurf/bitmap.h" diff --git a/frontends/riscos/content-handlers/artworks.c b/frontends/riscos/content-handlers/artworks.c index b6f7a0d08..517a6ff16 100644 --- a/frontends/riscos/content-handlers/artworks.c +++ b/frontends/riscos/content-handlers/artworks.c @@ -37,7 +37,7 @@ #include "utils/messages.h" #include "utils/utils.h" #include "content/content_protected.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "riscos/content-handlers/artworks.h" #include "riscos/gui.h" diff --git a/frontends/riscos/content-handlers/draw.c b/frontends/riscos/content-handlers/draw.c index f2bee16dc..0b1b07215 100644 --- a/frontends/riscos/content-handlers/draw.c +++ b/frontends/riscos/content-handlers/draw.c @@ -34,7 +34,7 @@ #include "utils/messages.h" #include "utils/utils.h" #include "content/content_protected.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "riscos/content-handlers/draw.h" #include "riscos/gui.h" diff --git a/frontends/riscos/content-handlers/sprite.c b/frontends/riscos/content-handlers/sprite.c index 12fed4931..3ef48c889 100644 --- a/frontends/riscos/content-handlers/sprite.c +++ b/frontends/riscos/content-handlers/sprite.c @@ -33,7 +33,7 @@ #include "utils/messages.h" #include "utils/utils.h" #include "content/content_protected.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "riscos/gui.h" #include "riscos/image.h" diff --git a/frontends/riscos/gui/progress_bar.c b/frontends/riscos/gui/progress_bar.c index 3ec6b3aa8..c26b46c84 100644 --- a/frontends/riscos/gui/progress_bar.c +++ b/frontends/riscos/gui/progress_bar.c @@ -30,7 +30,7 @@ #include "oslib/wimp.h" #include "oslib/wimpspriteop.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/log.h" #include "utils/utils.h" diff --git a/frontends/riscos/gui/status_bar.c b/frontends/riscos/gui/status_bar.c index cbc404658..9d1bada91 100644 --- a/frontends/riscos/gui/status_bar.c +++ b/frontends/riscos/gui/status_bar.c @@ -28,7 +28,7 @@ #include "oslib/os.h" #include "oslib/wimp.h" #include "oslib/wimpspriteop.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/log.h" #include "utils/utils.h" diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c index 37c4de111..80a7b4a40 100644 --- a/frontends/riscos/gui/url_bar.c +++ b/frontends/riscos/gui/url_bar.c @@ -38,7 +38,7 @@ #include "content/hlcache.h" #include "content/content.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "riscos/gui.h" #include "riscos/hotlist.h" diff --git a/frontends/riscos/history.c b/frontends/riscos/history.c index 9d78f6ded..de3af085d 100644 --- a/frontends/riscos/history.c +++ b/frontends/riscos/history.c @@ -31,7 +31,7 @@ #include "utils/nsoption.h" #include "utils/log.h" #include "desktop/browser_history.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "riscos/dialog.h" #include "riscos/gui.h" diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c index 38fd9d74a..9c9813862 100644 --- a/frontends/riscos/plotters.c +++ b/frontends/riscos/plotters.c @@ -28,7 +28,7 @@ #include "utils/log.h" #include "utils/utils.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "riscos/bitmap.h" #include "riscos/image.h" diff --git a/frontends/riscos/print.c b/frontends/riscos/print.c index 26b50f65f..da16664ac 100644 --- a/frontends/riscos/print.c +++ b/frontends/riscos/print.c @@ -39,7 +39,7 @@ #include "content/content.h" #include "content/hlcache.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "riscos/gui.h" #include "riscos/dialog.h" diff --git a/frontends/riscos/save_draw.c b/frontends/riscos/save_draw.c index 50febf3b2..7ba2c942b 100644 --- a/frontends/riscos/save_draw.c +++ b/frontends/riscos/save_draw.c @@ -34,7 +34,7 @@ #include "utils/utils.h" #include "content/content.h" #include "content/hlcache.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "riscos/bitmap.h" #include "riscos/gui.h" diff --git a/frontends/riscos/toolbar.c b/frontends/riscos/toolbar.c index 83751a7b4..2f758f59f 100644 --- a/frontends/riscos/toolbar.c +++ b/frontends/riscos/toolbar.c @@ -41,7 +41,6 @@ #include "utils/log.h" #include "utils/nsoption.h" #include "content/content.h" -#include "desktop/plotters.h" #include "riscos/cookies.h" #include "riscos/dialog.h" diff --git a/frontends/riscos/treeview.c b/frontends/riscos/treeview.c index 83f60660f..1cae801db 100644 --- a/frontends/riscos/treeview.c +++ b/frontends/riscos/treeview.c @@ -40,7 +40,7 @@ #include "utils/messages.h" #include "utils/utils.h" #include "content/urldb.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/textinput.h" #include "desktop/tree.h" diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c index 1fc6edfbf..e99ed31e3 100644 --- a/frontends/riscos/window.c +++ b/frontends/riscos/window.c @@ -61,7 +61,7 @@ #include "desktop/scrollbar.h" #include "desktop/frames.h" #include "netsurf/mouse.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/textinput.h" #include "desktop/tree.h" #include "netsurf/window.h" diff --git a/frontends/windows/bitmap.c b/frontends/windows/bitmap.c index a50d9aa45..936b28ec5 100644 --- a/frontends/windows/bitmap.c +++ b/frontends/windows/bitmap.c @@ -31,7 +31,7 @@ #include "utils/log.h" #include "netsurf/bitmap.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "content/content.h" #include "windows/plot.h" diff --git a/frontends/windows/drawable.c b/frontends/windows/drawable.c index 9c26d8e9b..39ecee092 100644 --- a/frontends/windows/drawable.c +++ b/frontends/windows/drawable.c @@ -25,7 +25,7 @@ #include "netsurf/browser_window.h" #include "desktop/textinput.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/errors.h" #include "utils/log.h" #include "utils/utils.h" diff --git a/frontends/windows/localhistory.c b/frontends/windows/localhistory.c index 674f198a0..ce1877f6f 100644 --- a/frontends/windows/localhistory.c +++ b/frontends/windows/localhistory.c @@ -23,7 +23,7 @@ #include #include "desktop/browser_history.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "utils/utils.h" #include "utils/log.h" #include "utils/messages.h" diff --git a/frontends/windows/plot.c b/frontends/windows/plot.c index 7480bc69f..941ec419c 100644 --- a/frontends/windows/plot.c +++ b/frontends/windows/plot.c @@ -30,7 +30,7 @@ #include "utils/utils.h" #include "netsurf/mouse.h" #include "netsurf/window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "windows/bitmap.h" #include "windows/font.h" diff --git a/include/netsurf/browser_window.h b/include/netsurf/browser_window.h index 36ed65a49..482dcb92c 100644 --- a/include/netsurf/browser_window.h +++ b/include/netsurf/browser_window.h @@ -22,8 +22,8 @@ * Browser window creation and manipulation interface. */ -#ifndef _NETSURF_DESKTOP_BROWSER_H_ -#define _NETSURF_DESKTOP_BROWSER_H_ +#ifndef _NETSURF_BROWSER_WINDOW_H_ +#define _NETSURF_BROWSER_WINDOW_H_ #include #include diff --git a/include/netsurf/plotters.h b/include/netsurf/plotters.h new file mode 100644 index 000000000..b13c9b279 --- /dev/null +++ b/include/netsurf/plotters.h @@ -0,0 +1,161 @@ +/* + * Copyright 2004 James Bursa + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file + * Target independent plotting interface. + */ + +#ifndef _NETSURF_PLOTTERS_H_ +#define _NETSURF_PLOTTERS_H_ + +#include +#include + +#include "desktop/plot_style.h" + +struct bitmap; +struct rect; + +typedef unsigned long bitmap_flags_t; +#define BITMAPF_NONE 0 +#define BITMAPF_REPEAT_X 1 +#define BITMAPF_REPEAT_Y 2 + +enum path_command { + PLOTTER_PATH_MOVE, + PLOTTER_PATH_CLOSE, + PLOTTER_PATH_LINE, + PLOTTER_PATH_BEZIER, +}; + +/** Set of target specific plotting functions. + * + * The functions are: + * arc - Plots an arc, around (x,y), from anticlockwise from angle1 to + * angle2. Angles are measured anticlockwise from horizontal, in + * degrees. + * disc - Plots a circle, centered on (x,y), which is optionally filled. + * line - Plots a line from (x0,y0) to (x1,y1). Coordinates are at + * centre of line width/thickness. + * path - Plots a path consisting of cubic Bezier curves. Line colour is + * given by c and fill colour is given by fill. + * polygon - Plots a filled polygon with straight lines between points. + * The lines around the edge of the ploygon are not plotted. The + * polygon is filled with the non-zero winding rule. + * rectangle - Plots a rectangle outline. The line can be solid, dotted or + * dashed. Top left corner at (x0,y0) and rectangle has given + * width and height. + * fill - Plots a filled rectangle. Top left corner at (x0,y0), bottom + * right corner at (x1,y1). Note: (x0,y0) is inside filled area, + * but (x1,y1) is below and to the right. See diagram below. + * clip - Sets a clip rectangle for subsequent plots. + * text - Plots text. (x,y) is the coordinate of the left hand side of + * the text's baseline. The text is UTF-8 encoded. The colour, c, + * is the colour of the text. Background colour, bg, may be used + * optionally to attempt to provide anti-aliased text without + * screen reads. Font information is provided in the style. + * bitmap - Tiled plot of a bitmap image. (x,y) gives the top left + * coordinate of an explicitly placed tile. From this tile the + * image can repeat in all four directions -- up, down, left and + * right -- to the extents given by the current clip rectangle. + * The bitmap_flags say whether to tile in the x and y + * directions. If not tiling in x or y directions, the single + * image is plotted. The width and height give the dimensions + * the image is to be scaled to. + * group_start - Start of a group of objects. Used when plotter implements + * export to a vector graphics file format. (Optional.) + * group_end - End of the most recently started group. (Optional.) + * flush - Only used internally by the knockout code. Should be NULL in + * any front end display plotters or export plotters. + * + * Plotter options: + * option_knockout - Optimisation particularly for unaccelerated screen + * redraw. It tries to avoid plotting to the same area + * more than once. See desktop/knockout.c + * + * Coordinates are from top left of canvas and (0,0) is the top left grid + * denomination. If a "fill" is drawn from (0,0) to (4,3), the result is: + * + * 0 1 2 3 4 5 + * +-+-+-+-+-+- + * 0 |#|#|#|#| | + * +-+-+-+-+-+- + * 1 |#|#|#|#| | + * +-+-+-+-+-+- + * 2 |#|#|#|#| | + * +-+-+-+-+-+- + * 3 | | | | | | + */ +struct plotter_table { + /* clipping operations */ + bool (*clip)(const struct rect *clip); + + /* shape primatives */ + bool (*arc)(int x, int y, int radius, int angle1, int angle2, const plot_style_t *pstyle); + bool (*disc)(int x, int y, int radius, const plot_style_t *pstyle); + bool (*line)(int x0, int y0, int x1, int y1, const plot_style_t *pstyle); + bool (*rectangle)(int x0, int y0, int x1, int y1, const plot_style_t *pstyle); + bool (*polygon)(const int *p, unsigned int n, const plot_style_t *pstyle); + + /* complex path (for SVG) */ + bool (*path)(const float *p, unsigned int n, colour fill, float width, + colour c, const float transform[6]); + + /* Image */ + bool (*bitmap)(int x, int y, int width, int height, + struct bitmap *bitmap, colour bg, + bitmap_flags_t flags); + + /** + * Text. + * + * \param x x coordinate + * \param y y coordinate + * \param text UTF-8 string to plot + * \param length length of string, in bytes + * \param fstyle plot style for this text + * \return true on success, false on error and error reported + */ + bool (*text)(int x, int y, const char *text, size_t length, + const plot_font_style_t *fstyle); + + /* optional callbacks */ + bool (*group_start)(const char *name); /**< optional, may be NULL */ + bool (*group_end)(void); /**< optional, may be NULL */ + bool (*flush)(void); /**< optional, may be NULL */ + + /* flags */ + bool option_knockout; /**< set if knockout rendering is required */ +}; + + +/* Redraw context */ +struct redraw_context { + /** Redraw to show interactive features, such as active selections + * etc. Should be off for printing. */ + bool interactive; + + /** Render background images. May want it off for printing. */ + bool background_images; + + /** Current plotters, must be assigned before use. */ + const struct plotter_table *plot; +}; + +#endif diff --git a/render/form.c b/render/form.c index b07acdb8a..af571aeed 100644 --- a/render/form.c +++ b/render/form.c @@ -47,7 +47,7 @@ #include "netsurf/mouse.h" #include "desktop/knockout.h" #include "desktop/plot_style.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/scrollbar.h" #include "desktop/textarea.h" #include "netsurf/misc.h" diff --git a/render/html_redraw.c b/render/html_redraw.c index 40783c302..01e7246c6 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -43,7 +43,7 @@ #include "content/content_protected.h" #include "content/handlers/css/utils.h" #include "netsurf/browser_window.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/selection.h" #include "desktop/print.h" #include "desktop/scrollbar.h" diff --git a/render/textplain.c b/render/textplain.c index 2323f431b..80828e738 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -42,7 +42,7 @@ #include "content/handlers/css/utils.h" #include "netsurf/browser_window.h" #include "utils/nsoption.h" -#include "desktop/plotters.h" +#include "netsurf/plotters.h" #include "desktop/search.h" #include "desktop/selection.h" #include "desktop/textinput.h" -- cgit v1.2.3