25 #ifndef TBX_GRAPHICS_H 26 #define TBX_GRAPHICS_H 144 virtual void move(
int x,
int y) = 0;
151 virtual void point(
int x,
int y) = 0;
160 virtual void line(
int tx,
int ty) = 0;
170 virtual void line(
int fx,
int fy,
int tx,
int ty) {
move(fx,ty);
line(tx,ty);}
179 virtual void rectangle(
int xmin,
int ymin,
int xmax,
int ymax) = 0;
188 virtual void fill_rectangle(
int xmin,
int ymin,
int xmax,
int ymax) = 0;
196 virtual void path(
const Point *points,
int num) = 0;
227 virtual void circle(
int centre_x,
int centre_y,
int radius) = 0;
235 virtual void fill_circle(
int centre_x,
int centre_y,
int radius) = 0;
246 virtual void arc(
int centre_x,
int centre_y,
int start_x,
int start_y,
int end_x,
int end_y) = 0;
257 virtual void segment(
int centre_x,
int centre_y,
int start_x,
int start_y,
int end_x,
int end_y) = 0;
268 virtual void sector(
int centre_x,
int centre_y,
int start_x,
int start_y,
int end_x,
int end_y) = 0;
279 virtual void ellipse(
int centre_x,
int centre_y,
int intersect_x,
int intersect_y,
int high_x,
int high_y) = 0;
290 virtual void fill_ellipse(
int centre_x,
int centre_y,
int intersect_x,
int intersect_y,
int high_x,
int high_y) = 0;
351 virtual void circle(
const Point ¢re_point,
int radius) {
circle(centre_point.
x, centre_point.
y, radius);}
366 virtual void arc(
const Point ¢re_point,
const Point &start_point,
const Point &end_point) {
arc(centre_point.
x, centre_point.
y, start_point.
x, start_point.
y, end_point.
x, end_point.
y);}
374 virtual void segment(
const Point ¢re_point,
const Point &start_point,
const Point &end_point) {
segment(centre_point.
x, centre_point.
y, start_point.
x, start_point.
y, end_point.
x, end_point.
y);}
382 virtual void sector(
const Point ¢re_point,
const Point &start_point,
const Point &end_point) {
sector(centre_point.
x, centre_point.
y, start_point.
x, start_point.
y, end_point.
x, end_point.
y);}
390 virtual void ellipse(
const Point ¢re_point,
const Point &intersect_point,
const Point &high_point) {
ellipse(centre_point.
x, centre_point.
y, intersect_point.
x, intersect_point.
y, high_point.
x, high_point.
y);}
408 virtual void text(
int x,
int y,
const std::string &
text) = 0;
417 virtual void text(
int x,
int y,
const std::string &text,
const Font &font) = 0;
537 stroke(pt.
x, pt.
y, path, fill_style, flatness, thickness, cap_and_join, dashes);
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
virtual void text(const Point &pt, const std::string &str, const Font &font)
Draw text at the given location in the given font.
Definition: graphics.h:447
virtual int os_x(int logical_x) const =0
Convert from logical x value to OS units.
virtual Point logical(const Point &pt)
Convert from OS units to logical coordinates.
Definition: graphics.h:92
virtual void arc(const Point ¢re_point, const Point &start_point, const Point &end_point)
Draw an arc.
Definition: graphics.h:366
DrawFillStyle
Enumeration to set the fill style when filling shapes.
Definition: drawpath.h:40
virtual int logical_y(int os_y) const =0
Convert from OS units to logical y value.
int x
Definition: point.h:59
Class to represent, display and manipulate a graphical path used by the Draw RISC OS module...
Definition: drawpath.h:464
virtual void rectangle(const BBox &r)
Draw the outline of a rectangle.
Definition: graphics.h:331
Class to represent a two dimensional bounding box.
Definition: bbox.h:37
Class to set the cap and joins style for lines that are greater than a single pixel wide...
Definition: drawpath.h:57
virtual void arc(int centre_x, int centre_y, int start_x, int start_y, int end_x, int end_y)=0
Draw arc around a circle.
virtual void polygon(const Point *points, int num)=0
Draw the outline of a polygon.
virtual BBox logical(const BBox &b)
Convert from OS units to logical coordinates.
Definition: graphics.h:106
virtual void image(int x, int y, const Image &image)=0
Draw an image.
virtual void sector(const Point ¢re_point, const Point &start_point, const Point &end_point)
Draw a sector of a circle.
Definition: graphics.h:382
virtual void point(const Point &pt)
Draw a point at the given location.
Definition: graphics.h:304
virtual void fill_polygon(const Point *points, int num)=0
Draw a filled polygon.
virtual void foreground(Colour colour)=0
Set the foreground colour for graphics.
Class to represent a standard desktop WIMP colour.
Definition: colour.h:146
virtual Point os(const Point &pt)
Convert from logical coordinates to OS units.
Definition: graphics.h:85
Point min
Minimum coordinate of the bounding box.
Definition: bbox.h:68
int y
Definition: point.h:60
Base class image classes providing a consistent interface to plot the to the screen.
Definition: image.h:44
virtual void rectangle(int xmin, int ymin, int xmax, int ymax)=0
Draw the outline of a rectangle.
virtual void line(int tx, int ty)=0
Draw a line from the last point visited to the given location.
virtual void move(const Point &point)
Move the graphics cursor to the given location.
Definition: graphics.h:298
virtual void line(const Point &to_point)
Draw a line from the last point visited to the given location.
Definition: graphics.h:311
virtual void text_colours(Colour foreground, Colour background)=0
Set the text colours for the current WIMP font.
Class to represent a dash pattern for lines.
Definition: drawpath.h:225
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)=0
Plot the lines in a path.
virtual void line(const Point &from_point, const Point &to_point)
Draw a line between the given two points.
Definition: graphics.h:318
non-zero winding number rule.
Definition: drawpath.h:42
virtual BBox os(const BBox &b)
Convert from logical coordinates to OS units.
Definition: graphics.h:99
Class to represent a position in two dimensional space.
Definition: point.h:36
virtual void wimp_background(WimpColour colour)=0
Set the background colour for graphics to one of the standard WIMP colours.
virtual void segment(const Point ¢re_point, const Point &start_point, const Point &end_point)
Draw a segment of a circle.
Definition: graphics.h:374
virtual void segment(int centre_x, int centre_y, int start_x, int start_y, int end_x, int end_y)=0
Draw a segment of a circle.
virtual void fill(const Point &pt, const DrawPath &path, DrawFillStyle fill_style=WINDING_NON_ZERO, int flatness=1)
Fill a draw path.
Definition: graphics.h:492
virtual int logical_x(int os_x) const =0
Convert from OS units to logical x value.
virtual void wimp_foreground(WimpColour colour)=0
Set the foreground colour for graphics to one of the standard WIMP colours.
Interface to drawing graphics to the screen.
Definition: graphics.h:43
Point max
Maximum coordinate of the bounding box.
Definition: bbox.h:72
virtual void background(Colour colour)=0
Set the background colour for graphics.
virtual void rectangle(const Point &min_point, const Point &max_point)
Draw the outline of a rectangle.
Definition: graphics.h:325
virtual void fill_ellipse(const Point ¢re_point, const Point &intersect_point, const Point &high_point)
Draw a filled ellipse.
Definition: graphics.h:398
virtual void fill_circle(int centre_x, int centre_y, int radius)=0
Draw a filled circle.
virtual void circle(const Point ¢re_point, int radius)
Draw the outline of a circle.
Definition: graphics.h:351
virtual void fill(int x, int y, const DrawPath &path, DrawFillStyle fill_style=WINDING_NON_ZERO, int flatness=1)=0
Fill a draw path.
Class to represent a RGB colour.
Definition: colour.h:43
virtual void circle(int centre_x, int centre_y, int radius)=0
Draw the outline of a circle.
virtual void point(int x, int y)=0
Draw a point at the given location.
virtual void fill_ellipse(int centre_x, int centre_y, int intersect_x, int intersect_y, int high_x, int high_y)=0
Draw a filled ellipse.
virtual void ellipse(int centre_x, int centre_y, int intersect_x, int intersect_y, int high_x, int high_y)=0
Draw the outline of an ellipse.
Class to handle painting and measuring text using an outline font.
Definition: font.h:60
virtual int os_y(int logical_y) const =0
Convert from logical y value to OS units.
virtual void path(const Point *points, int num)=0
Draw a path of lines connecting the given points.
virtual void fill_rectangle(const BBox &r)
Draw a filled rectangle.
Definition: graphics.h:344
virtual void text(const Point &pt, const std::string &str)
Draw text at the given location in the current WIMP font.
Definition: graphics.h:439
virtual void image(const Point &pt, const Image &im)
Draw an image.
Definition: graphics.h:464
virtual void move(int x, int y)=0
Move the graphics cursor to the given point.
virtual void fill_rectangle(int xmin, int ymin, int xmax, int ymax)=0
Draw a filled rectangle.
virtual void stroke(const Point &pt, const DrawPath &path, DrawFillStyle fill_style=WINDING_NON_ZERO, int flatness=1, int thickness=0, DrawCapAndJoin *cap_and_join=0, DrawDashPattern *dashes=0)
Plot the lines in a path.
Definition: graphics.h:534
virtual void fill_circle(const Point ¢re_point, int radius)
Draw a filled circle.
Definition: graphics.h:358
virtual void text(int x, int y, const std::string &text)=0
Draw text at the given location in the current WIMP font.
virtual void sector(int centre_x, int centre_y, int start_x, int start_y, int end_x, int end_y)=0
Draw a sector of a circle.
virtual void line(int fx, int fy, int tx, int ty)
Draw a line between the given two points.
Definition: graphics.h:170
virtual void fill_rectangle(const Point &min_point, const Point &max_point)
Draw the outline of a rectangle.
Definition: graphics.h:338
virtual void ellipse(const Point ¢re_point, const Point &intersect_point, const Point &high_point)
Draw the outline of an ellipse.
Definition: graphics.h:390