NetSurf
Data Fields
plotter_table Struct Reference

Plotter operations table. More...

#include <plotters.h>

Data Fields

nserror(* clip )(const struct redraw_context *ctx, const struct rect *clip)
 Sets a clip rectangle for subsequent plot operations. More...
 
nserror(* arc )(const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius, int angle1, int angle2)
 Plots an arc. More...
 
nserror(* disc )(const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius)
 Plots a circle. More...
 
nserror(* line )(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *line)
 Plots a line. More...
 
nserror(* rectangle )(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *rectangle)
 Plots a rectangle. More...
 
nserror(* polygon )(const struct redraw_context *ctx, const plot_style_t *pstyle, const int *p, unsigned int n)
 Plot a polygon. More...
 
nserror(* path )(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
 Plots a path. More...
 
nserror(* bitmap )(const struct redraw_context *ctx, struct bitmap *bitmap, int x, int y, int width, int height, colour bg, bitmap_flags_t flags)
 Plot a bitmap. More...
 
nserror(* text )(const struct redraw_context *ctx, const plot_font_style_t *fstyle, int x, int y, const char *text, size_t length)
 Text plotting. More...
 
nserror(* group_start )(const struct redraw_context *ctx, const char *name)
 Start of a group of objects. More...
 
nserror(* group_end )(const struct redraw_context *ctx)
 End of the most recently started group. More...
 
nserror(* flush )(const struct redraw_context *ctx)
 Only used internally by the knockout code. More...
 
bool option_knockout
 flag to enable knockout rendering. More...
 

Detailed Description

Plotter operations table.

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 | | | | | |

Definition at line 102 of file plotters.h.

Field Documentation

◆ arc

nserror(* plotter_table::arc) (const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius, int angle1, int angle2)

Plots an arc.

plot an arc segment around (x,y), anticlockwise from angle1 to angle2. Angles are measured anticlockwise from horizontal, in degrees.

Parameters
ctxThe current redraw context.
pstyleStyle controlling the arc plot.
xThe x coordinate of the arc.
yThe y coordinate of the arc.
radiusThe radius of the arc.
angle1The start angle of the arc.
angle2The finish angle of the arc.
Returns
NSERROR_OK on success else error code.

Definition at line 131 of file plotters.h.

Referenced by html_redraw_radio(), and knockout_plot_flush().

◆ bitmap

nserror(* plotter_table::bitmap) (const struct redraw_context *ctx, struct bitmap *bitmap, int x, int y, int width, int height, colour bg, bitmap_flags_t flags)

Plot a 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.

Parameters
ctxThe current redraw context.
bitmapThe bitmap to plot
xThe x coordinate to plot the bitmap
yThe y coordiante to plot the bitmap
widthThe width of area to plot the bitmap into
heightThe height of area to plot the bitmap into
bgthe background colour to alpha blend into
flagsthe flags controlling the type of plot operation
Returns
NSERROR_OK on success else error code.

Definition at line 257 of file plotters.h.

Referenced by html_redraw_box(), image_bitmap_plot(), knockout_plot_bitmap_recursive(), knockout_plot_flush(), nsbmp_redraw(), nssprite_redraw(), redraw_entry(), rsvg_redraw(), treeview_redraw_search(), treeview_redraw_tree(), and window_redraw_favicon().

◆ clip

nserror(* plotter_table::clip) (const struct redraw_context *ctx, const struct rect *clip)

Sets a clip rectangle for subsequent plot operations.

Parameters
ctxThe current redraw context.
clipThe rectangle to limit all subsequent plot operations within.
Returns
NSERROR_OK on success else error code.

Definition at line 111 of file plotters.h.

Referenced by browser_window_redraw(), content_scaled_redraw(), form_redraw_select_menu(), html_redraw(), html_redraw_background(), html_redraw_box(), html_redraw_inline_background(), knockout_plot_bitmap_recursive(), knockout_plot_flush(), local_history_redraw(), nsgtk_local_history_draw(), page_info_redraw(), plot_init(), plot_set_dimensions(), ro_gui_progress_bar_redraw_window(), text_draw(), text_redraw(), textarea_redraw(), treeview_redraw(), and window_redraw_content().

◆ disc

nserror(* plotter_table::disc) (const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius)

Plots a circle.

Plot a circle centered on (x,y), which is optionally filled.

Parameters
ctxThe current redraw context.
pstyleStyle controlling the circle plot.
xThe x coordinate of the circle.
yThe y coordinate of the circle.
radiusThe radius of the circle.
Returns
NSERROR_OK on success else error code.

Definition at line 152 of file plotters.h.

Referenced by html_redraw_radio(), and knockout_plot_flush().

◆ flush

nserror(* plotter_table::flush) (const struct redraw_context *ctx)

Only used internally by the knockout code.

Must be NULL in any front end display plotters or export plotters.

Parameters
ctxThe current redraw context.
Returns
NSERROR_OK on success else error code.

Definition at line 317 of file plotters.h.

◆ group_end

nserror(* plotter_table::group_end) (const struct redraw_context *ctx)

End of the most recently started group.

optional, may be NULL

Parameters
ctxThe current redraw context.
Returns
NSERROR_OK on success else error code.

Definition at line 307 of file plotters.h.

Referenced by html_redraw_box(), knockout_plot_flush(), and knockout_plot_group_end().

◆ group_start

nserror(* plotter_table::group_start) (const struct redraw_context *ctx, const char *name)

Start of a group of objects.

optional, may be NULL. Used when plotter implements export to a vector graphics file format.

Parameters
ctxThe current redraw context.
Returns
NSERROR_OK on success else error code.

Definition at line 295 of file plotters.h.

Referenced by html_redraw_box(), knockout_plot_flush(), and knockout_plot_group_start().

◆ line

nserror(* plotter_table::line) (const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *line)

Plots a line.

plot a line from (x0,y0) to (x1,y1). Coordinates are at centre of line width/thickness.

Parameters
ctxThe current redraw context.
pstyleStyle controlling the line plot.
lineA rectangle defining the line to be drawn
Returns
NSERROR_OK on success else error code.

Definition at line 170 of file plotters.h.

Referenced by html_redraw_border_plot(), html_redraw_checkbox(), html_redraw_text_decoration_block(), html_redraw_text_decoration_inline(), knockout_plot_flush(), redraw_entry(), scrollbar_rectangle(), and textarea_redraw().

◆ option_knockout

bool plotter_table::option_knockout

flag to enable knockout rendering.

Optimisation particularly for unaccelerated screen redraw. It tries to avoid plotting to the same area more than once. See desktop/knockout.c

Definition at line 328 of file plotters.h.

Referenced by browser_window_redraw(), content_scaled_redraw(), page_info_redraw(), and treeview_redraw().

◆ path

nserror(* plotter_table::path) (const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])

Plots a path.

Path plot consisting of cubic Bezier curves. Line and fill colour is controlled by the plot style.

Parameters
ctxThe current redraw context.
pstyleStyle controlling the path plot.
pelements of path
nnunber of elements on path
transformA transform to apply to the path.
Returns
NSERROR_OK on success else error code.

Definition at line 226 of file plotters.h.

Referenced by knockout_plot_path(), and svg_redraw_internal().

◆ polygon

nserror(* plotter_table::polygon) (const struct redraw_context *ctx, const plot_style_t *pstyle, const int *p, unsigned int n)

Plot a 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.

Parameters
ctxThe current redraw context.
pstyleStyle controlling the polygon plot.
pverticies of polygon
nnumber of verticies.
Returns
NSERROR_OK on success else error code.

Definition at line 207 of file plotters.h.

Referenced by html_redraw_border_plot(), knockout_plot_flush(), knockout_plot_polygon(), and scrollbar_redraw().

◆ rectangle

nserror(* plotter_table::rectangle) (const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *rectangle)

Plots a rectangle.

The rectangle can be filled an outline or both controlled by the plot style The line can be solid, dotted or dashed. Top left corner at (x0,y0) and rectangle has given width and height.

Parameters
ctxThe current redraw context.
pstyleStyle controlling the rectangle plot.
rectA rectangle defining the line to be drawn
Returns
NSERROR_OK on success else error code.

Definition at line 188 of file plotters.h.

Referenced by amiga_plugin_hack_redraw(), browser_window_redraw(), content_scaled_redraw(), form_redraw_select_menu(), html_redraw(), html_redraw_background(), html_redraw_box(), html_redraw_checkbox(), html_redraw_inline_background(), image_bitmap_plot(), knockout_plot_fill_recursive(), knockout_plot_flush(), knockout_plot_start(), local_history_redraw(), page_info_redraw(), plot_clipped_rectangle(), redraw_entry(), ro_gui_progress_bar_redraw_window(), ro_gui_status_bar_redraw(), scrollbar_redraw(), text_draw(), text_redraw(), textarea_redraw(), textplain_redraw(), treeview_redraw(), treeview_redraw_search(), and treeview_redraw_tree().

◆ text

nserror(* plotter_table::text) (const struct redraw_context *ctx, const plot_font_style_t *fstyle, int x, int y, const char *text, size_t length)

Text plotting.

Parameters
ctxThe current redraw context.
fstyleplot style for this text
xx coordinate
yy coordinate
textUTF-8 string to plot
lengthlength of string, in bytes
Returns
NSERROR_OK on success else error code.

Definition at line 278 of file plotters.h.

Referenced by amiga_plugin_hack_redraw(), fb_redraw_text(), fb_redraw_text_button(), form_redraw_select_menu(), html_redraw_box(), html_redraw_file(), knockout_plot_flush(), page_info__redraw_text_entry(), redraw_entry(), svg_redraw_internal(), text_draw(), text_redraw(), textarea_redraw(), treeview_redraw_search(), and treeview_redraw_tree().


The documentation for this struct was generated from the following file: