7 #ifndef AW_POSITION_HXX
10 #ifndef AW_FONT_LIMITS_HXX
20 #if defined(DEBUG) && defined(DEBUG_GRAPHICS)
22 #define AUTO_FLUSH(device) (device)->flush()
24 #define AUTO_FLUSH(device)
27 #define AW_INT(x) ((int)(((x)>=0.0) ? ((float)(x)+.5) : ((float)(x)-.5)))
31 #define DPI_SCREEN 80 // fixed
32 #define DPI_PRINTER 1200 // default resolution of xfig 3.2
140 return (pixelsize-1)*unscale;
150 #if defined(WARN_TODO) && 0
151 #warning fix transformations
164 xout = (x+offset.
x())*scale;
165 yout = (y+offset.
y())*scale;
168 xout = x*unscale - offset.
x();
169 yout = y*unscale - offset.
y();
177 const AW_screen_area& get_screen()
const {
return common_screen; }
182 void set_cliprect_oversize(
const AW_screen_area& rect,
bool allow_oversize);
191 if (clip_rect.
b - yy < 0) code = 4;
192 else if (yy - clip_rect.
t < 0) code = 8;
193 if (clip_rect.
r - xx < 0) code |= 2;
194 else if (xx - clip_rect.
l < 0) code |= 1;
203 : common_screen(screen)
242 set_cliprect_oversize(rect,
false);
376 clip_scale_stack(
NULp),
413 virtual void specific_reset() = 0;
431 return line_impl(gc, Line, filteri);
446 return text_impl(gc, cstr, pos, alignment, filteri);
454 return text_impl(gc,
SizedCstr(str), pos, alignment, filteri);
468 return invisible_impl(pos, filteri);
472 return box_impl(gc, filled, rect, filteri);
475 return box_impl(gc, filled,
AW::Rectangle(pos, size), filteri);
482 return circle_impl(gc, filled, center, radius, filteri);
494 return arc_impl(gc, filled,
AW::Position(x0, y0),
AW::Vector(xradius, yradius), start_degrees, arc_degrees, filteri);
497 return arc_impl(gc, filled, pos, radius, start_degrees, arc_degrees, filteri);
502 for (
int n = 0; n<npoints; ++n) {
503 pos[n].
setx(points[n*2]);
504 pos[n].
sety(points[n*2+1]);
506 bool result = polygon_impl(gc, filled, npoints, pos, filteri);
511 return polygon_impl(gc, filled, npos, pos, filteri);
527 virtual void flush();
534 inline void AW_click_cd::link() {
555 void specific_reset() {}
557 int find_color_idx(
AW_rgb color);
581 void draw_text(
int gc,
const char *textBuffer,
size_t textStart,
size_t textLen,
const AW::Position& pos);
615 extend(size.
l, pos.
xpos(), size.
r);
616 extend(size.
t, pos.
ypos(), size.
b);
619 size.
l = size.
r = pos.
xpos();
620 size.
t = size.
b = pos.
ypos();
646 void specific_reset();
670 #error aw_device.hxx included twice
AW::Vector transform(const AW::Vector &vec) const
virtual void clear(AW_bitset filteri)
bool circle(int gc, AW::FillStyle filled, const AW::Rectangle &rect, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
bool allow_left_font_overlap() const
AW::Rectangle rtransform(const AW::Rectangle &rect) const
bool line(int gc, AW_pos x0, AW_pos y0, AW_pos x1, AW_pos y1, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
bool allow_right_font_overlap() const
bool is_outside_clip(AW::Position pos) const
AW::Rectangle get_size_information() const
void set_grey_level(int gc, AW_grey_level grey_level)
const AW_bitset AW_PRINTER_CLIP
bool box_clip(AW_pos x0, AW_pos y0, AW_pos x1, AW_pos y1, AW_pos &x0out, AW_pos &y0out, AW_pos &x1out, AW_pos &y1out)
const AW_bitset AW_PRINTER_EXT
const AW_bitset AW_SCREEN
AW_clipable(const AW_screen_area &screen)
const AW_screen_area & get_area_size() const
Position centroid() const
void clear_part(AW_pos x, AW_pos y, AW_pos width, AW_pos height, AW_bitset filteri)
void reduce_bottom_clip_border(int bottom)
AW::Position transform(const AW::Position &pos) const
void set_left_clip_border(int left, bool allow_oversize=false)
int reduceClipBorders(int top, int bottom, int left, int right)
void set_line_attributes(int gc, short width, AW_linestyle style)
void set_function(int gc, AW_function function)
void establish_default(int gc)
void shift(const AW::Vector &doff)
const AW_screen_area & get_cliprect() const
void reduce_left_clip_border(int left)
virtual void clear_part(const AW::Rectangle &rect, AW_bitset filteri)
bool is_below_clip(double ypos) const
void reduce_top_clip_border(int top)
void reduce_right_clip_border(int right)
MARK_NONFINAL_METHOD(AW_device, move_region,(AW_pos, AW_pos, AW_pos, AW_pos, AW_pos, AW_pos))
bool arc(int gc, AW::FillStyle filled, const AW::Position &pos, const AW::Vector &radius, int start_degrees, int arc_degrees, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
const AW_font_overlap & get_font_overlap() const
AW::Vector get_offset() const
static const AW_screen_area & get_common_screen(const AW_common *common_)
void track(const AW::Position &pos)
void set_top_clip_border(int top, bool allow_oversize=false)
bool clip(AW_pos x0, AW_pos y0, AW_pos x1, AW_pos y1, AW_pos &x0out, AW_pos &y0out, AW_pos &x1out, AW_pos &y1out)
bool generic_polygon(int gc, int npos, const AW::Position *pos, AW_bitset filteri)
AW::Rectangle transform(const AW::Rectangle &rect) const
void set_offset(const AW::Vector &off)
const AW_bitset AW_ALL_DEVICES
AW_device(class AW_common *common_)
bool polygon(int gc, AW::FillStyle filled, int npoints, const AW_pos *points, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
AW::Rectangle get_size_information_inclusive_text() const
AW_simple_device(AW_common *common_)
bool circle(int gc, AW::FillStyle filled, AW_pos x0, AW_pos y0, AW_pos xradius, AW_pos yradius, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
AW_stylable(AW_common *common_)
const AW_bitset AW_ALL_DEVICES_SCALED
AW_click_cd(AW_device *device, AW_CL CD1, AW_CL CD2)
AW::Rectangle get_size_information_unscaled() const
void sety(const double &Y)
const AW_font_limits & get_font_limits(int gc, char c) const
const AW_world & get_size() const
const AW_bitset AW_PRINTER
bool is_above_clip(double ypos) const
const Position & start() const
bool invisible(const AW::Position &pos, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
double transform_size(const double &size) const
double rtransform_size(const double &size) const
AW_bitset get_filter() const
AW::Rectangle get_size_as_Rectangle() const
void set_font(int gc, AW_font fontnr, int size, int *found_size)
void set_bottom_font_overlap(bool allow)
void transform(AW_pos x, AW_pos y, AW_pos &xout, AW_pos &yout) const
void set_foreground_color(int gc, AW_color_idx color)
int get_string_size(int gc, long textlen) const
void rotate(AW_pos angle)
bool circle(int gc, AW::FillStyle filled, const AW::Position ¢er, const AW::Vector &radius, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
const double & ypos() const
void set_bottom_clip_border(int bottom, bool allow_oversize=false)
bool line(int gc, const AW::Position &pos1, const AW::Position &pos2, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
AW_pos get_unscale() const
void set_color_mode(bool mode)
bool line(int gc, const AW::LineVector &Line, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
AW::LineVector rtransform(const AW::LineVector &lvec) const
#define __ATTR__DEPRECATED_TODO(reason)
AW::Vector rtransform(const AW::Vector &vec) const
const AW_bitset AW_CLICK_DROP
AW::Rectangle get_rtransformed_cliprect() const
bool generic_box(int gc, const AW::Rectangle &rect, AW_bitset filteri)
AW::LineVector transform(const AW::LineVector &lvec) const
bool allow_bottom_font_overlap() const
bool polygon(int gc, AW::FillStyle filled, int npos, const AW::Position *pos, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
bool text(int gc, const char *str, AW_pos x, AW_pos y, AW_pos alignment=0.0, AW_bitset filteri=AW_ALL_DEVICES_UNSCALED)
bool is_leftof_clip(double xpos) const
AW_grey_level get_grey_level(int gc)
AW_common * get_common() const
void set_bottom_clip_margin(int bottom, bool allow_oversize=false)
virtual AW_DEVICE_TYPE type()=0
void setx(const double &X)
void set_font_overlap(bool allow)
AW_borders get_unscaleable_overlap() const
bool generic_invisible(const AW::Position &pos, AW_bitset filteri)
AW_click_cd(AW_device *device, AW_CL CD1)
Rectangle bounding_box(const Rectangle &rect) const
AW_clip_scale_stack * clip_scale_stack
void set_top_font_overlap(bool allow)
const Vector & line_vector() const
void set_right_clip_border(int right, bool allow_oversize=false)
const AW_click_cd * click_cd
bool generic_circle(int gc, const AW::Position ¢er, const AW::Vector &radius, AW_bitset filteri)
void get_size_information(AW_world *ptr) const __ATTR__DEPRECATED_TODO("whole AW_world is deprecated")
bool text(int gc, const char *str, const AW::Position &pos, AW_pos alignment=0.0, AW_bitset filteri=AW_ALL_DEVICES_UNSCALED)
#define __ATTR__USERESULT
void set_cliprect(const AW_screen_area &rect)
bool box(int gc, AW::FillStyle filled, const AW::Position &pos, const AW::Vector &size, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
bool overlaps_with(const Rectangle &rect) const
void set_right_font_overlap(bool allow)
void rtransform(AW_pos x, AW_pos y, AW_pos &xout, AW_pos &yout) const
const AW_bitset AW_ALL_DEVICES_UNSCALED
const AW_bitset AW_SIZE_UNSCALED
bool(* TextOverlayCallback)(AW_device *device, int gc, const char *textBuffer, size_t textStart, size_t textLen, const AW::Position &pos, AW_CL cduser)
bool arc(int gc, AW::FillStyle filled, AW_pos x0, AW_pos y0, AW_pos xradius, AW_pos yradius, int start_degrees, int arc_degrees, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
const double & xpos() const
void set_filter(AW_bitset filteri)
AW_device_size(AW_common *common_)
virtual void move_region(AW_pos src_x, AW_pos src_y, AW_pos width, AW_pos height, AW_pos dest_x, AW_pos dest_y)
bool is_rightof_clip(double xpos) const
bool ready_to_draw(int gc)
bool force_into_clipbox(const AW::Position &pos, AW::Position &forcedPos)
bool box(int gc, AW::FillStyle filled, const AW::Rectangle &rect, AW_bitset filteri=AW_ALL_DEVICES_SCALED)
int compoutcode(AW_pos xx, AW_pos yy) const
void set_horizontal_font_overlap(bool allow)
void set_left_font_overlap(bool allow)
int get_available_fontsizes(int gc, AW_font font_nr, int *available_sizes)
double rtransform_pixelsize(int pixelsize) const
bool is_outside_clip(AW::Rectangle rect) const
AW::Position rtransform(const AW::Position &pos) const
void set_font_overlap(const AW_font_overlap &fo)
bool text(int gc, const SizedCstr &cstr, const AW::Position &pos, AW_pos alignment=0.0, AW_bitset filteri=AW_ALL_DEVICES_UNSCALED)
const AW_click_cd * get_click_cd() const
AW_device_print(AW_common *common_)
void set_vertical_font_overlap(bool allow)
bool allow_top_font_overlap() const
bool text_overlay(int gc, const SizedCstr &cstr, const AW::Position &pos, AW_pos alignment, AW_bitset filteri, TextOverlayCallback toc, AW_CL cduser=0)
bool completely_clipped() const
bool box(int gc, AW::FillStyle filled, AW_pos x0, AW_pos y0, AW_pos width, AW_pos height, AW_bitset filteri=AW_ALL_DEVICES_SCALED)