NetSurf
|
#include <stdio.h>
#include "utils/utils.h"
#include "utils/errors.h"
#include "netsurf/plotters.h"
#include "monkey/output.h"
Go to the source code of this file.
Functions | |
static nserror | monkey_plot_clip (const struct redraw_context *ctx, const struct rect *clip) |
Sets a clip rectangle for subsequent plot operations. More... | |
static nserror | monkey_plot_arc (const struct redraw_context *ctx, const plot_style_t *style, int x, int y, int radius, int angle1, int angle2) |
Plots an arc. More... | |
static nserror | monkey_plot_disc (const struct redraw_context *ctx, const plot_style_t *style, int x, int y, int radius) |
Plots a circle. More... | |
static nserror | monkey_plot_line (const struct redraw_context *ctx, const plot_style_t *style, const struct rect *line) |
Plots a line. More... | |
static nserror | monkey_plot_rectangle (const struct redraw_context *ctx, const plot_style_t *style, const struct rect *rect) |
Plots a rectangle. More... | |
static nserror | monkey_plot_polygon (const struct redraw_context *ctx, const plot_style_t *style, const int *p, unsigned int n) |
Plot a polygon. More... | |
static nserror | monkey_plot_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... | |
static nserror | monkey_plot_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... | |
static nserror | monkey_plot_text (const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length) |
Text plotting. More... | |
Variables | |
static const struct plotter_table | plotters |
monkey plotter operations table More... | |
const struct plotter_table * | monkey_plotters = &plotters |
|
static |
Plots an arc.
plot an arc segment around (x,y), anticlockwise from angle1 to angle2. Angles are measured anticlockwise from horizontal, in degrees.
ctx | The current redraw context. |
style | Style controlling the arc plot. |
x | The x coordinate of the arc. |
y | The y coordinate of the arc. |
radius | The radius of the arc. |
angle1 | The start angle of the arc. |
angle2 | The finish angle of the arc. |
Definition at line 61 of file plot.c.
References MOUT_PLOT, moutf(), and NSERROR_OK.
|
static |
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.
ctx | The current redraw context. |
bitmap | The bitmap to plot |
x | The x coordinate to plot the bitmap |
y | The y coordiante to plot the bitmap |
width | The width of area to plot the bitmap into |
height | The height of area to plot the bitmap into |
bg | the background colour to alpha blend into |
flags | the flags controlling the type of plot operation |
Definition at line 215 of file plot.c.
References height, MOUT_PLOT, moutf(), NSERROR_OK, and width.
|
static |
Sets a clip rectangle for subsequent plot operations.
ctx | The current redraw context. |
clip | The rectangle to limit all subsequent plot operations within. |
Definition at line 36 of file plot.c.
References clip(), MOUT_PLOT, moutf(), and NSERROR_OK.
|
static |
Plots a circle.
Plot a circle centered on (x,y), which is optionally filled.
ctx | The current redraw context. |
style | Style controlling the circle plot. |
x | x coordinate of circle centre. |
y | y coordinate of circle centre. |
radius | circle radius. |
Definition at line 84 of file plot.c.
References MOUT_PLOT, moutf(), and NSERROR_OK.
|
static |
Plots a line.
plot a line from (x0,y0) to (x1,y1). Coordinates are at centre of line width/thickness.
ctx | The current redraw context. |
style | Style controlling the line plot. |
line | A rectangle defining the line to be drawn |
Definition at line 105 of file plot.c.
References line(), MOUT_PLOT, moutf(), and NSERROR_OK.
|
static |
Plots a path.
Path plot consisting of cubic Bezier curves. Line and fill colour is controlled by the plot style.
ctx | The current redraw context. |
pstyle | Style controlling the path plot. |
p | elements of path |
n | nunber of elements on path |
transform | A transform to apply to the path. |
Definition at line 178 of file plot.c.
References MOUT_PLOT, moutf(), NSERROR_OK, plot_style_fixed_to_float, and plot_style_s::stroke_width.
|
static |
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.
ctx | The current redraw context. |
style | Style controlling the polygon plot. |
p | verticies of polygon |
n | number of verticies. |
Definition at line 154 of file plot.c.
References MOUT_PLOT, moutf(), and NSERROR_OK.
|
static |
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.
ctx | The current redraw context. |
style | Style controlling the rectangle plot. |
rect | A rectangle defining the line to be drawn |
Definition at line 129 of file plot.c.
References MOUT_PLOT, moutf(), NSERROR_OK, rect::x0, rect::x1, rect::y0, and rect::y1.
|
static |
Text plotting.
ctx | The current redraw context. |
fstyle | plot style for this text |
x | x coordinate |
y | y coordinate |
text | UTF-8 string to plot |
length | length of string, in bytes |
Definition at line 241 of file plot.c.
References MOUT_PLOT, moutf(), NSERROR_OK, and text().
const struct plotter_table* monkey_plotters = &plotters |
Definition at line 267 of file plot.c.
Referenced by monkey_window_handle_redraw().
|
static |
monkey plotter operations table