25 #ifndef TBX_OSGRAPHICS_H
26 #define TBX_OSGRAPHICS_H
41 virtual void plot(
int code,
int x,
int y);
75 virtual void move(
int x,
int y);
76 virtual void point(
int x,
int y);
77 virtual void line(
int fx,
int fy,
int tx,
int ty);
78 virtual void line(
int x,
int y);
79 virtual void rectangle(
int xmin,
int ymin,
int xmax,
int ymax);
80 virtual void fill_rectangle(
int xmin,
int ymin,
int xmax,
int ymax);
81 virtual void circle(
int centre_x,
int centre_y,
int radius);
82 virtual void fill_circle(
int centre_x,
int centre_y,
int radius);
83 virtual void arc(
int centre_x,
int centre_y,
int start_x,
int start_y,
int end_x,
int end_y);
84 virtual void segment(
int centre_x,
int centre_y,
int start_x,
int start_y,
int end_x,
int end_y);
85 virtual void sector(
int centre_x,
int centre_y,
int start_x,
int start_y,
int end_x,
int end_y);
86 virtual void ellipse(
int centre_x,
int centre_y,
int intersect_x,
int intersect_y,
int high_x,
int high_y);
87 virtual void fill_ellipse(
int centre_x,
int centre_y,
int intersect_x,
int intersect_y,
int high_x,
int high_y);
89 virtual void path(
const Point *points,
int num);
93 virtual void text(
int x,
int y,
const std::string &
text);
94 virtual void text(
int x,
int y,
const std::string &
text,
const Font &font);
Class to represent a dash pattern for lines.
Definition: drawpath.h:226
virtual void segment(int centre_x, int centre_y, int start_x, int start_y, int end_x, int end_y)
Draw a segment of a circle.
Definition: osgraphics.cc:231
Class to set the cap and joins style for lines that are greater than a single pixel wide.
Definition: drawpath.h:58
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
@ ACTION_OR
Definition: osgraphics.h:45
void clear()
Clear the current graphics window to the background colour.
Definition: osgraphics.cc:428
Class to represent, display and manipulate a graphical path used by the Draw RISC OS module.
Definition: drawpath.h:465
Class to represent a standard desktop WIMP colour.
Definition: colour.h:147
virtual int logical_y(int os_y) const
Convert from OS units to logical y value.
Definition: osgraphics.h:61
virtual void wimp_foreground(WimpColour colour)
Set the graphics foreground colour to the given WIMP colour.
Definition: osgraphics.cc:101
Class to handle painting and measuring text using an outline font.
Definition: font.h:61
virtual Point os(const Point &pt) const
Convert from logical coordinates to OS units.
Definition: osgraphics.h:63
virtual void move(int x, int y)
Move graphics position.
Definition: osgraphics.cc:125
virtual void image(int x, int y, const Image &image)
Draw an image at given location.
Definition: osgraphics.cc:397
@ ACTION_AND_NOT
Definition: osgraphics.h:50
virtual void plot(int code, int x, int y)
Execute the OS_Plot swi.
Definition: osgraphics.cc:65
virtual void fill_ellipse(int centre_x, int centre_y, int intersect_x, int intersect_y, int high_x, int high_y)
Draw a filled ellipse.
Definition: osgraphics.cc:283
PlotAction
Definition: osgraphics.h:43
@ WINDING_NON_ZERO
non-zero winding number rule.
Definition: drawpath.h:42
virtual void stroke(int x, int y, const DrawPath &path, DrawFillStyle fill_style=WINDING_NON_ZERO, int flatness=1, int thickness=0, DrawCapAndJoin *cap_and_join=0, DrawDashPattern *dashes=0)
Draw lines of a draw path at the given location.
Definition: osgraphics.cc:416
virtual void text(int x, int y, const std::string &text)
Draw text in current desktop font.
Definition: osgraphics.cc:363
virtual void arc(int centre_x, int centre_y, int start_x, int start_y, int end_x, int end_y)
Draw arc around a circle.
Definition: osgraphics.cc:214
virtual void fill_circle(int centre_x, int centre_y, int radius)
Draw a filled circle.
Definition: osgraphics.cc:198
Class to draw to graphics to the screen using standard OS routines with no translation or scaling.
Definition: osgraphics.h:37
virtual void fill_polygon(const Point *points, int num)
Fill a polygon.
Definition: osgraphics.cc:345
virtual BBox os(const BBox &b) const
Convert from logical coordinates to OS units.
Definition: osgraphics.h:65
virtual void point(int x, int y)
Draw a single pixel point.
Definition: osgraphics.cc:133
virtual void fill(int x, int y, const DrawPath &path, DrawFillStyle fill_style=WINDING_NON_ZERO, int flatness=1)
Fill an draw path at the given location.
Definition: osgraphics.cc:405
int _plot_action
Stores the current Plot action.
Definition: osgraphics.h:116
Class to represent a RGB colour.
Definition: colour.h:44
virtual BBox logical(const BBox &b) const
Convert from OS units to logical coordinates.
Definition: osgraphics.h:66
Class to represent a two dimensional bounding box.
Definition: bbox.h:38
virtual void path(const Point *points, int num)
Draw a line through the specified points.
Definition: osgraphics.cc:296
Interface to drawing graphics to the screen.
Definition: graphics.h:44
Base class image classes providing a consistent interface to plot the to the screen.
Definition: image.h:45
BBox clip() const
Get the current Graphics clipping region.
Definition: osgraphics.cc:439
void plot_action(PlotAction action)
Sets the plot action.
Definition: osgraphics.cc:52
virtual void fill_rectangle(int xmin, int ymin, int xmax, int ymax)
Fill a rectangle the current foreground colour.
Definition: osgraphics.cc:172
virtual int os_x(int logical_x) const
Convert from logical x value to OS units.
Definition: osgraphics.h:58
@ ACTION_NONE
Definition: osgraphics.h:49
virtual void circle(int centre_x, int centre_y, int radius)
Draw outline of a circle.
Definition: osgraphics.cc:185
Class to represent a position in two dimensional space.
Definition: point.h:37
DrawFillStyle
Enumeration to set the fill style when filling shapes.
Definition: drawpath.h:41
@ ACTION_OVERWRITE
Definition: osgraphics.h:44
virtual int os_y(int logical_y) const
Convert from logical y value to OS units.
Definition: osgraphics.h:59
virtual void line(int fx, int fy, int tx, int ty)
Draw a line betweenn the given coordinates.
Definition: osgraphics.cc:150
virtual void rectangle(int xmin, int ymin, int xmax, int ymax)
Draw outline of a rectangle.
Definition: osgraphics.cc:159
virtual void wimp_background(WimpColour colour)
Set the graphics background colour to the given WIMP colour.
Definition: osgraphics.cc:112
virtual Point logical(const Point &pt) const
Convert from OS units to logical coordinates.
Definition: osgraphics.h:64
@ ACTION_INVERT
Definition: osgraphics.h:48
OSGraphics()
Create the graphics class with the default plot action of overwrite.
Definition: osgraphics.cc:40
virtual void text_colours(Colour foreground, Colour background)
Set the colours for the desktop font.
Definition: osgraphics.cc:380
@ ACTION_AND
Definition: osgraphics.h:46
virtual void background(Colour colour)
Set background graphics colour to the nearest match to the given colour for the current screen mode.
Definition: osgraphics.cc:90
virtual void polygon(const Point *points, int num)
Draw outline of a polygon.
Definition: osgraphics.cc:320
virtual void sector(int centre_x, int centre_y, int start_x, int start_y, int end_x, int end_y)
Draw a sector of a circle.
Definition: osgraphics.cc:248
@ ACTION_XOR
Definition: osgraphics.h:47
virtual void ellipse(int centre_x, int centre_y, int intersect_x, int intersect_y, int high_x, int high_y)
Draw the outline of an ellipse.
Definition: osgraphics.cc:265
virtual int logical_x(int os_x) const
Convert from OS units to logical x value.
Definition: osgraphics.h:60
virtual void foreground(Colour colour)
Set foreground graphics colour to the nearest match to the given colour for the current screen mode.
Definition: osgraphics.cc:76