diff --git a/uppsrc/CtrlCore/Ctrl.cpp b/uppsrc/CtrlCore/Ctrl.cpp index b3d8f9379..72bec0fc3 100644 --- a/uppsrc/CtrlCore/Ctrl.cpp +++ b/uppsrc/CtrlCore/Ctrl.cpp @@ -558,7 +558,7 @@ Ctrl::Ctrl() { activex = false; isdhctrl = false; #endif - backpaint = TRANSPARENTBACKPAINT; + backpaint = IsCompositedGui() ? FULLBACKPAINT : TRANSPARENTBACKPAINT; inframe = false; ignoremouse = transparent = false; caretcx = caretcy = caretx = carety = 0; diff --git a/uppsrc/CtrlCore/X11App.cpp b/uppsrc/CtrlCore/X11App.cpp index b6ca44a50..ea0cd0717 100644 --- a/uppsrc/CtrlCore/X11App.cpp +++ b/uppsrc/CtrlCore/X11App.cpp @@ -163,7 +163,10 @@ static void sPanicMessageBox(const char *title, const char *text) size_hints.height = 120; size_hints.min_width = 600; size_hints.min_height = 120; - char *h[1]; h[0] = ""; + char *h[1]; + char hh[1]; + *hh = 0; + h[0] = hh; XSetStandardProperties(display, win, title, title, None, h, 0, &size_hints); XSelectInput(display, win, ExposureMask|KeyPressMask|ButtonPressMask|StructureNotifyMask); XGCValues values; @@ -379,7 +382,7 @@ void Ctrl::InitX11(const char *display) GUI_GlobalStyle_Write(GUISTYLE_XP); GUI_DragFullWindow_Write(1); - GUI_PopUpEffect_Write(GUIEFFECT_SLIDE); + GUI_PopUpEffect_Write(IsCompositedGui() ? GUIEFFECT_NONE : GUIEFFECT_SLIDE); GUI_DropShadows_Write(1); GUI_AltAccessKeys_Write(1); GUI_AKD_Conservative_Write(0); diff --git a/uppsrc/Painter/FontX11.cpp b/uppsrc/Painter/FontX11.cpp index 17c8bfee4..827722fbf 100644 --- a/uppsrc/Painter/FontX11.cpp +++ b/uppsrc/Painter/FontX11.cpp @@ -138,6 +138,7 @@ bool RenderOutline(const FT_Outline& outline, Painter& path, double xx, double y void Painter::CharacterOp(double x, double y, int ch, Font fnt) { + PAINTER_TIMING("CharacterOp"); FontInfo fi = fnt.Info(); FT_Face face = XftLockFace(fi.GetXftFont()); int glyph_index = FT_Get_Char_Index(face, ch); diff --git a/uppsrc/Painter/Gradient.cpp b/uppsrc/Painter/Gradient.cpp index b4983ba91..0be537661 100644 --- a/uppsrc/Painter/Gradient.cpp +++ b/uppsrc/Painter/Gradient.cpp @@ -1,70 +1,71 @@ -#include "Painter.h" - -NAMESPACE_UPP - -void BufferPainter::ColorStop0(Attr& a, double pos, const RGBA& color) -{ - pos = minmax(pos, 0.0, 1.0); - int i = FindLowerBound(a.stop, pos); - a.stop.Insert(i, pos); - a.stop_color.Insert(i, color); -} - -void BufferPainter::ColorStopOp(double pos, const RGBA& color) -{ - ColorStop0(pathattr, pos, color); - if(!inpath) - ColorStop0(attr, pos, color); -} - -void BufferPainter::ClearStopsOp() -{ - pathattr.stop.Clear(); - pathattr.stop_color.Clear(); - if(!inpath) { - attr.stop.Clear(); - attr.stop_color.Clear(); - } -} - -void BufferPainter::MakeGradient(RGBA *t, RGBA color1, RGBA color2, int cx) -{ - int l = 0; - RGBA cl = color1; - for(int i = 0; i <= pathattr.stop.GetCount(); i++) { - int h; - RGBA ch; - if(i < pathattr.stop.GetCount()) { - h = (int)(pathattr.stop[i] * (cx - 1)); - ch = pathattr.stop_color[i]; - } - else { - h = cx - 1; - ch = color2; - } - int w = h - l; - for(int j = 0; j < w; j++) { - t->r = ((w - j) * cl.r + j * ch.r) / w; - t->g = ((w - j) * cl.g + j * ch.g) / w; - t->b = ((w - j) * cl.b + j * ch.b) / w; - t->a = ((w - j) * cl.a + j * ch.a) / w; - t++; - } - cl = ch; - l = h; - } - *t = cl; -} - -void BufferPainter::FillOp(double x1, double y1, const RGBA& color1, - double x2, double y2, const RGBA& color2, int style) -{ - int n = max(2, int((abs(pathrect.GetWidth()) + abs(pathrect.GetHeight())) * pathattr.mtx.scale())); - ImageBuffer ib(n, 1); - MakeGradient(ib, color1, color2, n); - Fill(ib, x1, y1, x2, y2, FILL_VPAD | FILL_FAST | - (style == GRADIENT_PAD ? FILL_HPAD : style == GRADIENT_REPEAT - ? FILL_HREPEAT : FILL_HREFLECT)); -} - -END_UPP_NAMESPACE +#include "Painter.h" + +NAMESPACE_UPP + +void BufferPainter::ColorStop0(Attr& a, double pos, const RGBA& color) +{ + pos = minmax(pos, 0.0, 1.0); + int i = FindLowerBound(a.stop, pos); + a.stop.Insert(i, pos); + a.stop_color.Insert(i, color); +} + +void BufferPainter::ColorStopOp(double pos, const RGBA& color) +{ + ColorStop0(pathattr, pos, color); + if(!inpath) + ColorStop0(attr, pos, color); +} + +void BufferPainter::ClearStopsOp() +{ + pathattr.stop.Clear(); + pathattr.stop_color.Clear(); + if(!inpath) { + attr.stop.Clear(); + attr.stop_color.Clear(); + } +} + +void BufferPainter::MakeGradient(RGBA *t, RGBA color1, RGBA color2, int cx) +{ + int l = 0; + RGBA cl = color1; + for(int i = 0; i <= pathattr.stop.GetCount(); i++) { + int h; + RGBA ch; + if(i < pathattr.stop.GetCount()) { + h = (int)(pathattr.stop[i] * (cx - 1)); + ch = pathattr.stop_color[i]; + } + else { + h = cx - 1; + ch = color2; + } + int w = h - l; + for(int j = 0; j < w; j++) { + t->r = ((w - j) * cl.r + j * ch.r) / w; + t->g = ((w - j) * cl.g + j * ch.g) / w; + t->b = ((w - j) * cl.b + j * ch.b) / w; + t->a = ((w - j) * cl.a + j * ch.a) / w; + t++; + } + cl = ch; + l = h; + } + *t = cl; +} + +void BufferPainter::FillOp(double x1, double y1, const RGBA& color1, + double x2, double y2, const RGBA& color2, int style) +{ + int n = max(2, int((fabs(pathrect.GetWidth()) + fabs(pathrect.GetHeight())) + * pathattr.mtx.scale())); + ImageBuffer ib(n, 1); + MakeGradient(ib, color1, color2, n); + Fill(ib, x1, y1, x2, y2, FILL_VPAD | FILL_FAST | + (style == GRADIENT_PAD ? FILL_HPAD : style == GRADIENT_REPEAT + ? FILL_HREPEAT : FILL_HREFLECT)); +} + +END_UPP_NAMESPACE diff --git a/uppsrc/Painter/Painter.h b/uppsrc/Painter/Painter.h index 3968ed9b5..7efeea312 100644 --- a/uppsrc/Painter/Painter.h +++ b/uppsrc/Painter/Painter.h @@ -1,263 +1,263 @@ -#ifndef _SDraw_SDraw_h -#define _SDraw_SDraw_h - -#include - -#define PAINTER_TIMING(x) RTIMING(x) - -#define AGGUPP 1 - -#include "agg_basics.h" -#include "agg_renderer_base.h" -#include "agg_renderer_scanline.h" -#include "agg_rasterizer_scanline_aa.h" -#include "agg_scanline_u.h" -#include "agg_scanline_p.h" -#include "agg_path_storage.h" -#include "agg_conv_transform.h" -#include "agg_conv_stroke.h" -#include "agg_conv_curve.h" -#include "agg_conv_dash.h" -#include "agg_span_allocator.h" -#include "agg_span_interpolator_linear.h" -#include "agg_alpha_mask_u8.h" - -NAMESPACE_UPP - -struct Matrix2D : agg::trans_affine { - Matrix2D operator*(const Matrix2D& s) const { Matrix2D x = *this; x *= s; return x; } - - void Transform(double& x, double& y) const { transform(&x, &y); } - Pointf Transformed(double x, double y) const { Transform(x, y); return Pointf(x, y); } - Pointf Transformed(Pointf p) const { Transform(p.x, p.y); return p; } - Matrix2D Inverted() const { Matrix2D h = *this; h.invert(); return h; } -}; - -Matrix2D Translate2D(double x, double y); -Matrix2D Rotate2D(double angle); -Matrix2D Scale2D(double scalex, double scaley); -Matrix2D Scale2D(double scale); -Matrix2D Sheer2D(); - -enum { - LINECAP_BUTT = agg::butt_cap, - LINECAP_SQUARE = agg::square_cap, - LINECAP_ROUND = agg::round_cap, - - LINEJOIN_MITER = agg::miter_join, - LINEJOIN_ROUND = agg::round_join, - LINEJOIN_BEVEL = agg::bevel_join, - - FILL_EXACT = 0, - - FILL_HPAD = 1, - FILL_HREPEAT = 2, - FILL_HREFLECT = 3, - - FILL_VPAD = 4, - FILL_VREPEAT = 8, - FILL_VREFLECT = 12, - - FILL_PAD = FILL_HPAD|FILL_VPAD, - FILL_REPEAT = FILL_HREPEAT|FILL_VREPEAT, - FILL_REFLECT = FILL_HREFLECT|FILL_VREFLECT, - - FILL_FAST = 128, - - GRADIENT_PAD = 0, - GRADIENT_REPEAT = 1, - GRADIENT_REFLECT = 2, -}; - -class Painting; - -class Painter : public Draw { -protected: - virtual void OffsetOp(Point p); - virtual bool ClipOp(const Rect& r); - virtual bool ClipoffOp(const Rect& r); - virtual bool ExcludeClipOp(const Rect& r); - virtual bool IntersectClipOp(const Rect& r); - virtual Rect GetClipOp() const; - virtual bool IsPaintingOp(const Rect& r) const; - - virtual void DrawRectOp(int x, int y, int cx, int cy, Color color); - virtual void DrawImageOp(int x, int y, int cx, int cy, const Image& img, const Rect& src, Color color); - virtual void DrawLineOp(int x1, int y1, int x2, int y2, int width, Color color); - - virtual void DrawPolyPolylineOp(const Point *vertices, int vertex_count, - const int *counts, int count_count, - int width, Color color, Color doxor); - virtual void DrawPolyPolyPolygonOp(const Point *vertices, int vertex_count, - const int *subpolygon_counts, int scc, - const int *disjunct_polygon_counts, int dpcc, - Color color, int width, Color outline, - uint64 pattern, Color doxor); - virtual void DrawArcOp(const Rect& rc, Point start, Point end, int width, Color color); - - virtual void DrawEllipseOp(const Rect& r, Color color, int pen, Color pencolor); - virtual void DrawTextOp(int x, int y, int angle, const wchar *text, Font font, - Color ink, int n, const int *dx); - virtual void DrawPaintingOp(const Rect& target, const Painting& w); - -protected: - virtual void ClearOp(const RGBA& color) = 0; - - virtual void MoveOp(double x, double y, bool rel) = 0; - virtual void LineOp(double x, double y, bool rel) = 0; - virtual void QuadraticOp(double x1, double y1, double x, double y, bool rel) = 0; - virtual void QuadraticOp(double x, double y, bool rel) = 0; - virtual void CubicOp(double x1, double y1, double x2, double y2, double x, double y, bool rel) = 0; - virtual void CubicOp(double x2, double y2, double x, double y, bool rel) = 0; - virtual void CloseOp() = 0; - - virtual void FillOp(const RGBA& color) = 0; - virtual void FillOp(const Image& image, const Matrix2D& transsrc, dword flags) = 0; - virtual void FillOp(double x1, double y1, const RGBA& color1, - double x2, double y2, const RGBA& color2, - int style) = 0; - virtual void FillOp(double fx, double fy, const RGBA& color1, - double x1, double y1, double r, const RGBA& color2, - int style) = 0; - - virtual void StrokeOp(double width, const RGBA& rgba) = 0; - virtual void StrokeOp(double width, const Image& image, const Matrix2D& transsrc, - dword flags) = 0; - virtual void StrokeOp(double width, double x1, double y1, const RGBA& color1, - double x2, double y2, const RGBA& color2, - int style) = 0; - virtual void StrokeOp(double width, double fx, double fy, const RGBA& color1, - double x, double y, double r, const RGBA& color2, - int style) = 0; - - virtual void ClipOp() = 0; - - virtual void CharacterOp(double x, double y, int ch, Font fnt); - virtual void TextOp(double x, double y, const wchar *text, Font fnt, int n = -1, double *dx = NULL); - - virtual void ColorStopOp(double pos, const RGBA& color) = 0; - virtual void ClearStopsOp() = 0; - - virtual void OpacityOp(double o) = 0; - virtual void LineCapOp(int linecap) = 0; - virtual void LineJoinOp(int linejoin) = 0; - virtual void MiterLimitOp(double l) = 0; - virtual void EvenOddOp(bool evenodd) = 0; - virtual void DashOp(const Vector& dash, double start = 0) = 0; - virtual void NoAAOp(bool noaa) = 0; - - virtual void TransformOp(const Matrix2D& m) = 0; - - virtual void BeginOp() = 0; - virtual void EndOp() = 0; - - virtual void BeginMaskOp() = 0; - -private: - Pointf ReadPoint(CParser& p); - void RectPath(int x, int y, int cx, int cy); - void RectPath(const Rect& r); - - static RGBA GetRGBA(StringStream& ss); - -public: - void Clear(const RGBA& color); - - Painter& Move(double x, double y, bool rel); - Painter& Line(double x, double y, bool rel); - Painter& Quadratic(double x1, double y1, double x, double y, bool rel); - Painter& Quadratic(double x, double y, bool rel); - Painter& Cubic(double x1, double y1, double x2, double y2, double x, double y, bool rel); - Painter& Cubic(double x2, double y2, double x, double y, bool rel); - - Painter& Move(double x, double y); - Painter& Line(double x, double y); - Painter& Quadratic(double x1, double y1, double x, double y); - Painter& Quadratic(double x, double y); - Painter& Cubic(double x1, double y1, double x2, double y2, double x, double y); - Painter& Cubic(double x2, double y2, double x, double y); - - Painter& RelMove(double x, double y); - Painter& RelLine(double x, double y); - Painter& RelQuadratic(double x1, double y1, double x, double y); - Painter& RelQuadratic(double x, double y); - Painter& RelCubic(double x1, double y1, double x2, double y2, double x, double y); - Painter& RelCubic(double x2, double y2, double x, double y); - - Painter& Close(); - - Painter& Fill(const RGBA& color); - Painter& Fill(const Image& image, const Matrix2D& transsrc = Matrix2D(), dword flags = 0); - Painter& Fill(const Image& image, double x1, double y1, double x2, double y2, - dword flags = 0); - Painter& Fill(double x1, double y1, const RGBA& color1, - double x2, double y2, const RGBA& color2, int style = GRADIENT_PAD); - Painter& Fill(double fx, double fy, const RGBA& color1, - double x, double y, double r, const RGBA& color2, int style = GRADIENT_PAD); - Painter& Fill(double x, double y, const RGBA& color1, - double r, const RGBA& color2, int style = GRADIENT_PAD); - - Painter& Stroke(double width, const RGBA& color); - Painter& Stroke(double width, const Image& image, const Matrix2D& transsrc, dword flags = 0); - Painter& Stroke(double width, const Image& image, double x1, double y1, double x2, double y2, - dword flags = 0); - Painter& Stroke(double width, double x1, double y1, const RGBA& color1, - double x2, double y2, const RGBA& color2, - int style = GRADIENT_PAD); - Painter& Stroke(double width, double fx, double fy, const RGBA& color1, - double x1, double y1, double r, const RGBA& color2, int style = GRADIENT_PAD); - Painter& Stroke(double width, double x1, double y1, const RGBA& color1, - double r, const RGBA& color2, int style = GRADIENT_PAD); - - Painter& Clip(); - - Painter& Character(double x, double y, int ch, Font fnt); - Painter& Text(double x, double y, const wchar *text, Font fnt, int n = -1, double *dx = NULL); - Painter& Text(double x, double y, const WString& s, Font fnt, double *dx = NULL); - Painter& Text(double x, double y, const String& s, Font fnt, double *dx = NULL); - Painter& Text(double x, double y, const char *text, Font fnt, int n = -1, double *dx = NULL); - - Painter& Path(CParser& p); - Painter& Path(const char *path); - - Painter& ColorStop(double pos, const RGBA& color); - Painter& ClearStops(); - - Painter& Opacity(double o); - Painter& LineCap(int linecap); - Painter& LineJoin(int linejoin); - Painter& MiterLimit(double l); - Painter& EvenOdd(bool evenodd); - Painter& Dash(const Vector& dash, double start = 0); - Painter& Dash(const char *dash, double start = 0); - Painter& NoAA(bool noaa = true); - - void Transform(const Matrix2D& m); - - void Begin(); - void End(); - - void BeginMask(); - - void Translate(double x, double y); - void Rotate(double a); - void Scale(double scalex, double scaley); - void Scale(double scale); - - void Paint(const Painting& p); - - Painter& Arc(double x, double y, double rx, double ry, - double start_angle, double sweep_angle, bool startline = false); - Painter& Ellipse(double x, double y, double rx, double ry); - Painter& Circle(double x, double y, double r); - Painter& Rectangle(double x, double y, double cx, double cy); -}; - -#include "BufferPainter.h" -#include "Painting.h" - -END_UPP_NAMESPACE - -#include "Painter.hpp" - -#endif +#ifndef _SDraw_SDraw_h +#define _SDraw_SDraw_h + +#include + +#define PAINTER_TIMING(x) // RTIMING(x) + +#define AGGUPP 1 + +#include "agg_basics.h" +#include "agg_renderer_base.h" +#include "agg_renderer_scanline.h" +#include "agg_rasterizer_scanline_aa.h" +#include "agg_scanline_u.h" +#include "agg_scanline_p.h" +#include "agg_path_storage.h" +#include "agg_conv_transform.h" +#include "agg_conv_stroke.h" +#include "agg_conv_curve.h" +#include "agg_conv_dash.h" +#include "agg_span_allocator.h" +#include "agg_span_interpolator_linear.h" +#include "agg_alpha_mask_u8.h" + +NAMESPACE_UPP + +struct Matrix2D : agg::trans_affine { + Matrix2D operator*(const Matrix2D& s) const { Matrix2D x = *this; x *= s; return x; } + + void Transform(double& x, double& y) const { transform(&x, &y); } + Pointf Transformed(double x, double y) const { Transform(x, y); return Pointf(x, y); } + Pointf Transformed(Pointf p) const { Transform(p.x, p.y); return p; } + Matrix2D Inverted() const { Matrix2D h = *this; h.invert(); return h; } +}; + +Matrix2D Translate2D(double x, double y); +Matrix2D Rotate2D(double angle); +Matrix2D Scale2D(double scalex, double scaley); +Matrix2D Scale2D(double scale); +Matrix2D Sheer2D(); + +enum { + LINECAP_BUTT = agg::butt_cap, + LINECAP_SQUARE = agg::square_cap, + LINECAP_ROUND = agg::round_cap, + + LINEJOIN_MITER = agg::miter_join, + LINEJOIN_ROUND = agg::round_join, + LINEJOIN_BEVEL = agg::bevel_join, + + FILL_EXACT = 0, + + FILL_HPAD = 1, + FILL_HREPEAT = 2, + FILL_HREFLECT = 3, + + FILL_VPAD = 4, + FILL_VREPEAT = 8, + FILL_VREFLECT = 12, + + FILL_PAD = FILL_HPAD|FILL_VPAD, + FILL_REPEAT = FILL_HREPEAT|FILL_VREPEAT, + FILL_REFLECT = FILL_HREFLECT|FILL_VREFLECT, + + FILL_FAST = 128, + + GRADIENT_PAD = 0, + GRADIENT_REPEAT = 1, + GRADIENT_REFLECT = 2, +}; + +class Painting; + +class Painter : public Draw { +protected: + virtual void OffsetOp(Point p); + virtual bool ClipOp(const Rect& r); + virtual bool ClipoffOp(const Rect& r); + virtual bool ExcludeClipOp(const Rect& r); + virtual bool IntersectClipOp(const Rect& r); + virtual Rect GetClipOp() const; + virtual bool IsPaintingOp(const Rect& r) const; + + virtual void DrawRectOp(int x, int y, int cx, int cy, Color color); + virtual void DrawImageOp(int x, int y, int cx, int cy, const Image& img, const Rect& src, Color color); + virtual void DrawLineOp(int x1, int y1, int x2, int y2, int width, Color color); + + virtual void DrawPolyPolylineOp(const Point *vertices, int vertex_count, + const int *counts, int count_count, + int width, Color color, Color doxor); + virtual void DrawPolyPolyPolygonOp(const Point *vertices, int vertex_count, + const int *subpolygon_counts, int scc, + const int *disjunct_polygon_counts, int dpcc, + Color color, int width, Color outline, + uint64 pattern, Color doxor); + virtual void DrawArcOp(const Rect& rc, Point start, Point end, int width, Color color); + + virtual void DrawEllipseOp(const Rect& r, Color color, int pen, Color pencolor); + virtual void DrawTextOp(int x, int y, int angle, const wchar *text, Font font, + Color ink, int n, const int *dx); + virtual void DrawPaintingOp(const Rect& target, const Painting& w); + +protected: + virtual void ClearOp(const RGBA& color) = 0; + + virtual void MoveOp(double x, double y, bool rel) = 0; + virtual void LineOp(double x, double y, bool rel) = 0; + virtual void QuadraticOp(double x1, double y1, double x, double y, bool rel) = 0; + virtual void QuadraticOp(double x, double y, bool rel) = 0; + virtual void CubicOp(double x1, double y1, double x2, double y2, double x, double y, bool rel) = 0; + virtual void CubicOp(double x2, double y2, double x, double y, bool rel) = 0; + virtual void CloseOp() = 0; + + virtual void FillOp(const RGBA& color) = 0; + virtual void FillOp(const Image& image, const Matrix2D& transsrc, dword flags) = 0; + virtual void FillOp(double x1, double y1, const RGBA& color1, + double x2, double y2, const RGBA& color2, + int style) = 0; + virtual void FillOp(double fx, double fy, const RGBA& color1, + double x1, double y1, double r, const RGBA& color2, + int style) = 0; + + virtual void StrokeOp(double width, const RGBA& rgba) = 0; + virtual void StrokeOp(double width, const Image& image, const Matrix2D& transsrc, + dword flags) = 0; + virtual void StrokeOp(double width, double x1, double y1, const RGBA& color1, + double x2, double y2, const RGBA& color2, + int style) = 0; + virtual void StrokeOp(double width, double fx, double fy, const RGBA& color1, + double x, double y, double r, const RGBA& color2, + int style) = 0; + + virtual void ClipOp() = 0; + + virtual void CharacterOp(double x, double y, int ch, Font fnt); + virtual void TextOp(double x, double y, const wchar *text, Font fnt, int n = -1, double *dx = NULL); + + virtual void ColorStopOp(double pos, const RGBA& color) = 0; + virtual void ClearStopsOp() = 0; + + virtual void OpacityOp(double o) = 0; + virtual void LineCapOp(int linecap) = 0; + virtual void LineJoinOp(int linejoin) = 0; + virtual void MiterLimitOp(double l) = 0; + virtual void EvenOddOp(bool evenodd) = 0; + virtual void DashOp(const Vector& dash, double start = 0) = 0; + virtual void NoAAOp(bool noaa) = 0; + + virtual void TransformOp(const Matrix2D& m) = 0; + + virtual void BeginOp() = 0; + virtual void EndOp() = 0; + + virtual void BeginMaskOp() = 0; + +private: + Pointf ReadPoint(CParser& p); + void RectPath(int x, int y, int cx, int cy); + void RectPath(const Rect& r); + + static RGBA GetRGBA(StringStream& ss); + +public: + void Clear(const RGBA& color); + + Painter& Move(double x, double y, bool rel); + Painter& Line(double x, double y, bool rel); + Painter& Quadratic(double x1, double y1, double x, double y, bool rel); + Painter& Quadratic(double x, double y, bool rel); + Painter& Cubic(double x1, double y1, double x2, double y2, double x, double y, bool rel); + Painter& Cubic(double x2, double y2, double x, double y, bool rel); + + Painter& Move(double x, double y); + Painter& Line(double x, double y); + Painter& Quadratic(double x1, double y1, double x, double y); + Painter& Quadratic(double x, double y); + Painter& Cubic(double x1, double y1, double x2, double y2, double x, double y); + Painter& Cubic(double x2, double y2, double x, double y); + + Painter& RelMove(double x, double y); + Painter& RelLine(double x, double y); + Painter& RelQuadratic(double x1, double y1, double x, double y); + Painter& RelQuadratic(double x, double y); + Painter& RelCubic(double x1, double y1, double x2, double y2, double x, double y); + Painter& RelCubic(double x2, double y2, double x, double y); + + Painter& Close(); + + Painter& Fill(const RGBA& color); + Painter& Fill(const Image& image, const Matrix2D& transsrc = Matrix2D(), dword flags = 0); + Painter& Fill(const Image& image, double x1, double y1, double x2, double y2, + dword flags = 0); + Painter& Fill(double x1, double y1, const RGBA& color1, + double x2, double y2, const RGBA& color2, int style = GRADIENT_PAD); + Painter& Fill(double fx, double fy, const RGBA& color1, + double x, double y, double r, const RGBA& color2, int style = GRADIENT_PAD); + Painter& Fill(double x, double y, const RGBA& color1, + double r, const RGBA& color2, int style = GRADIENT_PAD); + + Painter& Stroke(double width, const RGBA& color); + Painter& Stroke(double width, const Image& image, const Matrix2D& transsrc, dword flags = 0); + Painter& Stroke(double width, const Image& image, double x1, double y1, double x2, double y2, + dword flags = 0); + Painter& Stroke(double width, double x1, double y1, const RGBA& color1, + double x2, double y2, const RGBA& color2, + int style = GRADIENT_PAD); + Painter& Stroke(double width, double fx, double fy, const RGBA& color1, + double x1, double y1, double r, const RGBA& color2, int style = GRADIENT_PAD); + Painter& Stroke(double width, double x1, double y1, const RGBA& color1, + double r, const RGBA& color2, int style = GRADIENT_PAD); + + Painter& Clip(); + + Painter& Character(double x, double y, int ch, Font fnt); + Painter& Text(double x, double y, const wchar *text, Font fnt, int n = -1, double *dx = NULL); + Painter& Text(double x, double y, const WString& s, Font fnt, double *dx = NULL); + Painter& Text(double x, double y, const String& s, Font fnt, double *dx = NULL); + Painter& Text(double x, double y, const char *text, Font fnt, int n = -1, double *dx = NULL); + + Painter& Path(CParser& p); + Painter& Path(const char *path); + + Painter& ColorStop(double pos, const RGBA& color); + Painter& ClearStops(); + + Painter& Opacity(double o); + Painter& LineCap(int linecap); + Painter& LineJoin(int linejoin); + Painter& MiterLimit(double l); + Painter& EvenOdd(bool evenodd); + Painter& Dash(const Vector& dash, double start = 0); + Painter& Dash(const char *dash, double start = 0); + Painter& NoAA(bool noaa = true); + + void Transform(const Matrix2D& m); + + void Begin(); + void End(); + + void BeginMask(); + + void Translate(double x, double y); + void Rotate(double a); + void Scale(double scalex, double scaley); + void Scale(double scale); + + void Paint(const Painting& p); + + Painter& Arc(double x, double y, double rx, double ry, + double start_angle, double sweep_angle, bool startline = false); + Painter& Ellipse(double x, double y, double rx, double ry); + Painter& Circle(double x, double y, double r); + Painter& Rectangle(double x, double y, double cx, double cy); +}; + +#include "BufferPainter.h" +#include "Painting.h" + +END_UPP_NAMESPACE + +#include "Painter.hpp" + +#endif