25 #ifndef VISIBLEAREA_H_
26 #define VISIBLEAREA_H_
53 _bounds(block[0], block[1], block[2], block[3]),
54 _scroll(block[4], block[5])
82 int work_x(
int scr_x)
const {
return scr_x - (_bounds.
min.
x - _scroll.
x);}
87 int work_y(
int scr_y)
const {
return scr_y - (_bounds.
max.
y - _scroll.
y);}
98 work_pt.
x = scr_pt.
x - (_bounds.
min.
x - _scroll.
x);
99 work_pt.
y = scr_pt.
y - (_bounds.
max.
y - _scroll.
y);
160 scr_pt.
x = work_pt.
x + (_bounds.
min.
x - _scroll.
x);
161 scr_pt.
y = work_pt.
y + (_bounds.
max.
y - _scroll.
y);
BBox work(const BBox &scr_box) const
Convert bounding box from screen coordinates to work area coordinates.
Definition: visiblearea.h:133
Point screen(const Point &work_pt) const
Convert point from work area coordinates to screen coordinates.
Definition: visiblearea.h:172
int x
Definition: point.h:59
Class to represent a two dimensional bounding box.
Definition: bbox.h:37
BBox & bounds()
The visible area of the window on the screen.
Definition: visiblearea.h:67
int screen_x(int work_x) const
Convert work area x coordinate to screen.
Definition: visiblearea.h:144
BBox & screen(const BBox &work_box, BBox &scr_box) const
Convert bounding box from work area coordinates to screen coordinates.
Definition: visiblearea.h:182
const Point & scroll() const
The scroll offset of the work area within the window.
Definition: visiblearea.h:72
BBox screen(const BBox &work_box) const
Convert bounding box from work area coordinates to screen coordinates.
Definition: visiblearea.h:195
Point min
Minimum coordinate of the bounding box.
Definition: bbox.h:68
VisibleArea()
Construct an uninitialised visible area.
Definition: visiblearea.h:46
int y
Definition: point.h:60
BBox & work(const BBox &scr_box, BBox &work_box) const
Convert bounding box from screen coordinates to work area coordinates.
Definition: visiblearea.h:120
Class to represent a position in two dimensional space.
Definition: point.h:36
Point work(const Point &scr_pt) const
Convert point from screen coordinates to work area coordinates.
Definition: visiblearea.h:110
Point & scroll()
The scroll offset of the work area within the window.
Definition: visiblearea.h:77
Class to store information for the Visible area of a window and provide work area to screen conversio...
Definition: visiblearea.h:36
Point max
Maximum coordinate of the bounding box.
Definition: bbox.h:72
VisibleArea(int *block)
Construct a visible area from an array of 6 integers as provided by Wimp calls.
Definition: visiblearea.h:52
Point & work(const Point &scr_pt, Point &work_pt) const
Convert point from screen coordinates to work area coordinates.
Definition: visiblearea.h:96
int work_y(int scr_y) const
Convert screen y coordinate to work area.
Definition: visiblearea.h:87
Point & screen(const Point &work_pt, Point &scr_pt) const
Convert point from work coordinates to screen area coordinates.
Definition: visiblearea.h:158
int screen_y(int work_y) const
Convert work area y coordinate to screen area.
Definition: visiblearea.h:149
int work_x(int scr_x) const
Convert screen x coordinate to work area.
Definition: visiblearea.h:82
const BBox & bounds() const
The visible area of the window on the screen.
Definition: visiblearea.h:61