From f4fdf98ecdfbe148a77bcf5e8f004de2aef9cf9b Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 9 Dec 2008 21:44:02 +0000 Subject: [PATCH] syncing uppdev git-svn-id: svn://ultimatepp.org/upp/trunk@701 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppdev/SDraw/SDraw.cpp | 51 +++++++++ uppdev/SDraw/SDraw.h | 53 +++++++++ uppdev/SDraw/SDraw.upp | 7 ++ uppdev/SDraw/init | 4 + uppdev/SDrawTest/SDrawTest.upp | 10 ++ uppdev/SDrawTest/init | 5 + uppdev/SDrawTest/main.cpp | 23 ++++ uppdev/aaa/a.h | 3 - uppdev/aaa/src.tpp/aaa$en-us.tpp | 10 +- uppdev/aaa/src.tpp/aaa$en-us.tppi | 6 +- uppdev/agg_upp_bind/AggDrawer.cpp | 160 +++++++++++++-------------- uppdev/agg_upp_bind/AggDrawer.h | 84 +++++++------- uppdev/agg_upp_bind/agg_upp_bind.h | 54 +++++---- uppdev/agg_upp_bind/agg_upp_bind.upp | 2 +- uppdev/agg_upp_bind/init | 5 + uppdev/aggtest/aggtest.upp | 3 +- uppdev/aggtest/init | 1 + 17 files changed, 321 insertions(+), 160 deletions(-) create mode 100644 uppdev/SDraw/SDraw.cpp create mode 100644 uppdev/SDraw/SDraw.h create mode 100644 uppdev/SDraw/SDraw.upp create mode 100644 uppdev/SDraw/init create mode 100644 uppdev/SDrawTest/SDrawTest.upp create mode 100644 uppdev/SDrawTest/init create mode 100644 uppdev/SDrawTest/main.cpp create mode 100644 uppdev/agg_upp_bind/init diff --git a/uppdev/SDraw/SDraw.cpp b/uppdev/SDraw/SDraw.cpp new file mode 100644 index 000000000..e360ff7ae --- /dev/null +++ b/uppdev/SDraw/SDraw.cpp @@ -0,0 +1,51 @@ +#include "SDraw.h" + +NAMESPACE_UPP + +void SDraw::DrawLine(int x1, int y1, int x2, int y2, int width) +{ +// m_renb.clip_box( m_clipboxdev.x, m_clipboxdev.y, m_clipboxdev.x + m_clipboxdev.width, m_clipboxdev.y + m_clipboxdev.height); + + agg::path_storage path; + path.move_to(x1, y1); + path.line_to(x2, y2); + + agg::conv_stroke stroke(path); +// stroke.line_join(); +// stroke.line_cap(); + stroke.line_cap(agg::round_cap); +// stroke.miter_limit(); + stroke.width(width); + m_ras.add_path(stroke); +} + +void SDraw::DrawEllipse(int x1, int y1, int cx, int cy, int width) +{ + agg::ellipse el; +// el.init(double x¸ double y¸ double rx¸ double ry¸ unsigned num_steps=0¸ bool cw=false); + el.init(x1, y1, cx, cy); + + agg::conv_stroke stroke(el); + + stroke.width(width); + m_ras.add_path(stroke); +} + +Image SDraw::Render() +{ +// m_ras.filling_rule(filling_rule_e filling_rule); + agg::render_scanlines(m_ras, m_sl, m_ren); +// agg::render_scanlines_aa_solid(m_ras, m_sl, m_ren, agg::rgba(1,1,0.5) ); + return buffer; +} + +SDraw::SDraw(int cx, int cy) +{ + buffer.Create(cx, cy); + m_rbuf.attach((agg::int8u *)~buffer, cx, cy, cx * 4); + m_pixf.attach(m_rbuf); + m_renb.attach(m_pixf); //ren_base + m_ren.attach(m_renb); +} + +END_UPP_NAMESPACE diff --git a/uppdev/SDraw/SDraw.h b/uppdev/SDraw/SDraw.h new file mode 100644 index 000000000..5b6fe1ae0 --- /dev/null +++ b/uppdev/SDraw/SDraw.h @@ -0,0 +1,53 @@ +#ifndef _SDraw_SDraw_h +#define _SDraw_SDraw_h + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +NAMESPACE_UPP + +class SDraw { + Size sz; + + Rect m_r; + ImageBuffer buffer; + + agg::rendering_buffer m_rbuf; + agg::rasterizer_scanline_aa<> m_ras; + agg::scanline_p8 m_sl; + + typedef agg::renderer_base renderer_base; + typedef agg::renderer_scanline_aa_solid renderer_solid; + + renderer_base m_renb; + renderer_solid m_ren; + agg::pixfmt_bgra32 m_pixf; + + void AttachBuffers(); + +public: + void DrawLine(int x1, int y1, int x2, int y2, int width = 0); + void DrawEllipse(int x1, int y1, int cx, int cy, int width); + + void SetBackground(const agg::rgba8& ct) { m_renb.clear(ct); } + void SetBrushColor(const agg::rgba8& ct) { m_ren.color(ct); } + + Image Render(); + + SDraw(int cx, int cy); +}; + +END_UPP_NAMESPACE + +#endif + diff --git a/uppdev/SDraw/SDraw.upp b/uppdev/SDraw/SDraw.upp new file mode 100644 index 000000000..aa0414212 --- /dev/null +++ b/uppdev/SDraw/SDraw.upp @@ -0,0 +1,7 @@ +uses + agg24; + +file + SDraw.h, + SDraw.cpp; + diff --git a/uppdev/SDraw/init b/uppdev/SDraw/init new file mode 100644 index 000000000..c6fbca398 --- /dev/null +++ b/uppdev/SDraw/init @@ -0,0 +1,4 @@ +#ifndef _SDraw_icpp_init_stub +#define _SDraw_icpp_init_stub +#include "agg24/init" +#endif diff --git a/uppdev/SDrawTest/SDrawTest.upp b/uppdev/SDrawTest/SDrawTest.upp new file mode 100644 index 000000000..e5c890334 --- /dev/null +++ b/uppdev/SDrawTest/SDrawTest.upp @@ -0,0 +1,10 @@ +uses + CtrlLib, + SDraw; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/SDrawTest/init b/uppdev/SDrawTest/init new file mode 100644 index 000000000..bdc588d89 --- /dev/null +++ b/uppdev/SDrawTest/init @@ -0,0 +1,5 @@ +#ifndef _SDrawTest_icpp_init_stub +#define _SDrawTest_icpp_init_stub +#include "CtrlLib/init" +#include "SDraw/init" +#endif diff --git a/uppdev/SDrawTest/main.cpp b/uppdev/SDrawTest/main.cpp new file mode 100644 index 000000000..9c47c563e --- /dev/null +++ b/uppdev/SDrawTest/main.cpp @@ -0,0 +1,23 @@ +#include +#include + +using namespace Upp; + +struct App : TopWindow { + virtual void Paint(Draw& w) { + Size sz = GetSize(); + SDraw agd(sz.cx, sz.cy); + agd.SetBackground(agg::rgba(0, 1.0, 1.0, false)); + agd.DrawLine(0,0,100,100,10); + agd.SetBrushColor(agg::rgba(0, 0, 0)); + agd.DrawEllipse(0, 0, sz.cx, sz.cy, 3); + + w.DrawImage(0, 0, agd.Render()); + } +}; + +GUI_APP_MAIN +{ + App().Run(); +} + diff --git a/uppdev/aaa/a.h b/uppdev/aaa/a.h index fa7b0978b..e69de29bb 100644 --- a/uppdev/aaa/a.h +++ b/uppdev/aaa/a.h @@ -1,3 +0,0 @@ -/* -:operator -*/ diff --git a/uppdev/aaa/src.tpp/aaa$en-us.tpp b/uppdev/aaa/src.tpp/aaa$en-us.tpp index c6cd7e9b9..79a04f26e 100644 --- a/uppdev/aaa/src.tpp/aaa$en-us.tpp +++ b/uppdev/aaa/src.tpp/aaa$en-us.tpp @@ -24,6 +24,7 @@ topic "class aaa : public WithaaaLayout "; [s0; [R5 Hlava]&] [s0; [R5 Hlína]&] [s0; [R5 Host]&] +[s0; [R5 Hlas]&] [s0; [R5 Hloupost]&] [s0; [R5 Hlen]&] [s0; [R5 Postel]&] @@ -39,10 +40,10 @@ topic "class aaa : public WithaaaLayout "; [s0; [R5 Vlas]&] [s0; [R5 Vlak]&] [s0; [R5 Zem]&] -[s0; [R5 Když]&] -[s0; [R5 Opice]&] -[s0; [R5 DveÅ™e]&] -[s0; [R5 Chleba]&] +[s0; [R9 Když]&] +[s0; [!Comic Sans MS!5 Opice]&] +[s0; [!Comic Sans MS!5 DveÅ™e]&] +[s0; [!Comic Sans MS!5 Chleba]&] [s0; [R5 Ucho]&] [s0; [R5 DÄ›ti]&] [s0; [R5 DítÄ›]&] @@ -60,5 +61,6 @@ topic "class aaa : public WithaaaLayout "; [s0; [R5 Pánev]&] [s0; [R5 DÄ›da]&] [s0; [R5 Vzduch]&] +[s0; [R5 VÅ¡echny]&] [s0;R5 &] [s0; ] \ No newline at end of file diff --git a/uppdev/aaa/src.tpp/aaa$en-us.tppi b/uppdev/aaa/src.tpp/aaa$en-us.tppi index f2c5767ac..d19362e48 100644 --- a/uppdev/aaa/src.tpp/aaa$en-us.tppi +++ b/uppdev/aaa/src.tpp/aaa$en-us.tppi @@ -1,6 +1,6 @@ TITLE("class aaa : public WithaaaLayout ") COMPRESSED -120,156,133,82,91,106,219,64,20,221,138,193,161,31,197,148,185,243,208,140,164,159,66,13,13,164,109,66,95,31,17,162,140,237,105,173,74,150,92,75,50,164,165,217,129,23,16,242,83,47,192,116,5,201,143,236,125,245,170,21,197,87,45,68,22,50,231,204,156,59,231,220,185,17,31,156,156,176,17,27,178,7,158,96,236,62,218,58,171,226,40,145,210,132,150,171,48,61,59,247,195,86,15,168,23,26,132,81,2,36,247,240,3,2,184,226,66,130,225,190,52,66,24,22,76,51,91,150,113,148,113,99,126,139,56,138,184,86,28,180,52,210,128,208,134,163,150,51,198,153,230,10,164,48,92,5,51,87,78,227,136,225,118,129,219,125,79,248,12,24,211,0,76,112,205,132,146,0,130,99,9,174,57,48,21,184,124,22,71,167,94,216,10,100,27,74,121,104,221,195,106,82,50,172,222,202,164,0,193,184,80,224,43,47,152,184,79,73,254,191,72,234,193,72,154,5,73,229,22,93,34,43,195,199,79,85,8,40,245,70,222,80,227,177,82,225,97,126,155,72,160,140,115,79,249,160, -36,90,146,140,7,43,247,165,78,86,110,225,242,170,171,144,0,112,8,39,160,67,180,112,125,125,253,4,36,251,211,41,141,94,128,161,111,14,200,97,14,13,202,103,190,50,96,152,208,146,43,141,209,151,118,101,23,93,146,137,228,97,151,195,140,204,208,3,15,59,202,12,250,87,62,22,96,24,2,255,177,145,10,95,97,130,170,19,183,186,86,228,143,252,33,54,73,40,166,125,166,165,86,18,147,112,240,0,27,201,218,252,120,13,65,94,172,22,54,139,163,111,31,190,15,162,146,133,131,232,181,26,92,20,251,77,179,171,236,126,19,63,138,255,178,151,245,164,7,175,142,241,11,91,22,61,108,9,110,182,107,66,188,199,81,34,21,206,247,155,228,24,191,42,202,99,120,106,231,248,163,76,70,113,102,215,61,162,217,229,148,41,202,138,238,40,234,229,63,156,203,143,241,5,174,187,140,100,169,83,98,60,205,73,244,179,195,207,195,189,35,76,141,4,45,81,44,109,69,27,84,47,9,190,168,105,3,159,215,11,26,101,149,187,180,223,208,30,38,235,151,56,231,199,158,102, -87,135,123,18,99,153,76,137,235,241,218,29,110,8,243,108,158,185,9,113,241,110,58,39,217,199,251,219,138,220,226,24,39,105,127,75,219,69,20,135,59,59,105,182,41,165,154,45,61,166,101,104,24,28,167,98,118,69,239,41,93,225,204,214,159,155,29,145,254,104,118,120,163,205,221,49,249,50,41,83,114,192,27,180,73,125,189,181,56,61,135,155,126,203,167,228,200,102,155,187,117,47,255,140,142,249,215,89,61,157,119,12,226,110,41,254,5,199,177,167,130, +120,156,133,83,219,110,211,64,16,253,149,160,84,60,160,8,237,236,197,187,182,95,144,26,137,74,165,180,162,192,67,45,11,109,156,133,152,56,118,136,237,74,5,209,63,232,7,84,125,33,31,16,241,5,237,139,147,255,98,12,161,202,152,75,147,40,209,57,235,51,51,231,236,36,226,189,189,61,54,96,125,246,192,43,24,186,247,182,206,170,56,74,165,52,161,229,42,156,30,30,251,97,171,7,212,11,13,194,40,1,146,123,248,5,2,184,226,66,130,225,190,52,66,24,22,36,153,45,203,56,202,184,49,63,69,28,69,92,43,14,90,26,105,64,104,195,81,203,25,227,76,115,5,82,24,174,130,177,43,147,56,98,248,184,192,199,125,79,248,12,24,211,0,76,112,205,132,146,0,130,99,9,174,57,48,21,184,124,28,71,7,94,216,10,100,107,74,121,56,186,135,213,164,100,88,189,149,73,1,130,113,161,192,87,94,48,114,31,210,252,111,150,212,131,150,52,11,210,202,205,182,142,172,12,159,60,83,33,160,212,27,120,125,141,109,165,194,102,126,235,72,160,140,115,79,249, +160,36,142,36,25,15,22,238,83,157,46,220,204,229,213,182,66,10,192,33,28,129,14,113,132,203,203,203,167,32,217,175,164,52,206,2,12,231,230,128,28,250,208,160,124,230,43,3,134,9,45,185,210,104,125,110,23,118,182,117,50,146,60,220,250,48,3,211,247,192,195,68,153,193,249,149,143,5,24,154,192,95,12,82,225,71,152,160,218,138,91,93,43,242,7,126,31,67,18,138,105,159,105,169,149,68,39,28,60,192,32,89,235,31,175,33,200,139,197,204,102,113,244,229,221,215,94,84,178,176,23,189,82,189,147,98,125,213,172,42,187,190,138,31,199,247,236,89,61,234,192,139,93,252,194,150,69,7,91,130,155,229,57,33,222,226,42,145,10,199,235,171,116,23,191,44,202,93,120,96,39,248,166,76,70,113,102,207,59,68,179,202,41,83,148,85,71,66,155,100,69,61,255,227,25,151,239,226,19,60,119,25,241,86,79,137,145,105,78,162,56,220,124,223,220,57,194,212,72,208,18,197,220,86,52,176,122,78,240,73,77,3,125,94,207,168,181,69,238,166,221,128,59,152,156,159, +225,222,223,67,191,119,56,190,216,220,221,19,143,246,139,89,154,244,78,109,94,246,142,78,31,161,169,121,154,184,127,31,15,207,221,230,250,63,231,251,147,204,141,200,188,111,146,9,73,105,184,190,169,200,253,15,113,7,215,55,52,88,162,216,220,218,81,179,156,82,170,89,210,54,45,67,109,227,34,22,227,11,122,163,211,5,110,123,253,177,89,17,233,183,102,133,119,223,220,238,146,71,105,57,37,13,78,113,76,58,215,107,139,123,183,185,238,94,78,66,90,54,203,220,157,119,252,143,233,31,228,243,184,78,38,132,217,44,93,50,201,127,207,142,204,246,48,254,1,9,230,192,71, diff --git a/uppdev/agg_upp_bind/AggDrawer.cpp b/uppdev/agg_upp_bind/AggDrawer.cpp index a11aaf914..0588f9a8a 100644 --- a/uppdev/agg_upp_bind/AggDrawer.cpp +++ b/uppdev/agg_upp_bind/AggDrawer.cpp @@ -1,83 +1,77 @@ -#include "agg_upp_bind.h" - -NAMESPACE_UPP -//typedef agg::renderer_base renderer_base; -//typedef agg::renderer_scanline_aa_solid renderer_solid; - -void AggDrawer::DrawLine(int x1, int y1, int x2, int y2, int width) -{ -// m_renb.clip_box( m_clipboxdev.x, m_clipboxdev.y, m_clipboxdev.x + m_clipboxdev.width, m_clipboxdev.y + m_clipboxdev.height); - - agg::path_storage path; - path.move_to(x1, y1); - path.line_to(x2, y2); - - agg::conv_stroke stroke(path); -// stroke.line_join(); -// stroke.line_cap(); - stroke.line_cap(agg::round_cap); - //stroke.miter_limit(); - stroke.width(width); - m_ras.add_path(stroke); - -// RenderScanlines(); // at the end or after all same color? -} - -//void AggDrawer::DrawLine(Point p1, Point p2, color_type ct) -//{ -// m_ren.col -//agg::ellipse e1; -//} - -void AggDrawer::DrawEllipse(int x1, int y1, int cx, int cy, int width) -{ - agg::ellipse el; -// el.init(double x¸ double y¸ double rx¸ double ry¸ unsigned num_steps=0¸ bool cw=false); - el.init(x1, y1, cx, cy); - - agg::conv_stroke stroke(el); - - stroke.width(width); - m_ras.add_path(stroke); - -// agg::conv_transform tr(ellipse, mtx); -// m_ras.add_path(tr); -// ren.color( color ); - - typedef agg::wrap_mode_reflect_auto_pow2 wrap_x_type; - typedef agg::wrap_mode_reflect_auto_pow2 wrap_y_type; -// typedef agg::span_pattern_rgb span_gen_type; -// typedef agg::renderer_scanline_aa renderer_type; - -// agg::span_allocator sa; -// span_gen_type sg(sa, m_pattern_rbuf, offset_x, offset_y); -// sg.alpha(span_gen_type::value_type(m_FillOpacity)); -// renderer_type rp(renb, sg); -// agg::render_scanlines(m_ras, m_sl, rp); -// agg::render_scanlines_aa_solid(m_ras, m_sl, m_ren, agg::rgba(1,1,0.5) ); -} - - -void AggDrawer::DrawEllipse(int x1, int y1, int cx, int cy, const color_type& fill_ct, int width, const color_type& ct) -{ - -} - -void AggDrawer::RenderScanlines() -{ -// m_ras.filling_rule(filling_rule_e filling_rule); - agg::render_scanlines(m_ras, m_sl, m_ren); -// agg::render_scanlines_aa_solid(m_ras, m_sl, m_ren, agg::rgba(1,1,0.5) ); -} - - -void AggDrawer::AttachBuffers() //or better name - ConnectPipelineBuffers? -{ - m_rbuf.attach((agg::int8u *)uibuf[0], sz.cx, sz.cy, sz.cx*4); - m_pixf.attach(m_rbuf); - m_renb.attach(m_pixf); //ren_base - m_ren.attach(m_renb); -} - - -END_UPP_NAMESPACE +#include "agg_upp_bind.h" + +NAMESPACE_UPP +//typedef agg::renderer_base renderer_base; +//typedef agg::renderer_scanline_aa_solid renderer_solid; + +void AggDrawer::DrawLine(int x1, int y1, int x2, int y2, int width) +{ +// m_renb.clip_box( m_clipboxdev.x, m_clipboxdev.y, m_clipboxdev.x + m_clipboxdev.width, m_clipboxdev.y + m_clipboxdev.height); + + agg::path_storage path; + path.move_to(x1, y1); + path.line_to(x2, y2); + + agg::conv_stroke stroke(path); +// stroke.line_join(); +// stroke.line_cap(); + stroke.line_cap(agg::round_cap); + //stroke.miter_limit(); + stroke.width(width); + m_ras.add_path(stroke); + +// RenderScanlines(); // at the end or after all same color? +} + +//void AggDrawer::DrawLine(Point p1, Point p2, color_type ct) +//{ +// m_ren.col +//agg::ellipse e1; +//} + +void AggDrawer::DrawEllipse(int x1, int y1, int cx, int cy, int width) +{ + agg::ellipse el; +// el.init(double x¸ double y¸ double rx¸ double ry¸ unsigned num_steps=0¸ bool cw=false); + el.init(x1, y1, cx, cy); + + agg::conv_stroke stroke(el); + + stroke.width(width); + m_ras.add_path(stroke); + +// agg::conv_transform tr(ellipse, mtx); +// m_ras.add_path(tr); +// ren.color( color ); + +// typedef agg::wrap_mode_reflect_auto_pow2 wrap_x_type; +// typedef agg::wrap_mode_reflect_auto_pow2 wrap_y_type; +// typedef agg::span_pattern_rgb span_gen_type; +// typedef agg::renderer_scanline_aa renderer_type; + +// agg::span_allocator sa; +// span_gen_type sg(sa, m_pattern_rbuf, offset_x, offset_y); +// sg.alpha(span_gen_type::value_type(m_FillOpacity)); +// renderer_type rp(renb, sg); +// agg::render_scanlines(m_ras, m_sl, rp); +// agg::render_scanlines_aa_solid(m_ras, m_sl, m_ren, agg::rgba(1,1,0.5) ); +} + +void AggDrawer::RenderScanlines() +{ +// m_ras.filling_rule(filling_rule_e filling_rule); + agg::render_scanlines(m_ras, m_sl, m_ren); +// agg::render_scanlines_aa_solid(m_ras, m_sl, m_ren, agg::rgba(1,1,0.5) ); +} + + +void AggDrawer::AttachBuffers() //or better name - ConnectPipelineBuffers? +{ + m_rbuf.attach((agg::int8u *)uibuf[0], sz.cx, sz.cy, sz.cx*4); + m_pixf.attach(m_rbuf); + m_renb.attach(m_pixf); //ren_base + m_ren.attach(m_renb); +} + + +END_UPP_NAMESPACE diff --git a/uppdev/agg_upp_bind/AggDrawer.h b/uppdev/agg_upp_bind/AggDrawer.h index bc8bd68fe..cd75bf411 100644 --- a/uppdev/agg_upp_bind/AggDrawer.h +++ b/uppdev/agg_upp_bind/AggDrawer.h @@ -1,43 +1,41 @@ -//#ifndef _agg_upp_bind_AggDrawer_h_ -//#define _agg_upp_bind_AggDrawer_h_ - -//from DrawingDraw? -//#include "agg_upp_bind.h" - -class AggDrawer { -private: - typedef agg::renderer_base renderer_base; - typedef agg::renderer_scanline_aa_solid renderer_solid; - - Rect m_r; - Size sz; - ImagBuffer uibuf; - agg::rendering_buffer m_rbuf; - - agg::rasterizer_scanline_aa<> m_ras; - agg::scanline_p8 m_sl; - renderer_base m_renb; //renderer base - renderer_solid m_ren; //(renb); // - pixfmt m_pixf; - - void AttachBuffers(); -public: - void DrawLine(int x1, int y1, int x2, int y2, int width = 0); - void DrawLine(Point p1, Point p2, color_type ct); - void DrawEllipse(int x1, int y1, int cx, int cy, const color_type& fill_ct, int width, const color_type& ct); - void DrawEllipse(int x1, int y1, int cx, int cy, int width); - - void SetBackground(const color_type& ct) { m_renb.clear(ct); } - void SetBrushColor(const color_type& ct) { m_ren.color(ct); } - - void RenderScanlines(); - - void End(Draw& w, bool norr=false) { RenderScanlines(); uibuf.Rectangalize(w, norr); uibuf.Clear(); } - -// AggDrawer(Draw& w, const Rect& r) { m_w=w; m_r=r; sz=r.GetSize(); uibuf.Create(sz); AttachBuffers(); } - AggDrawer(const Rect& r) { m_r=r; sz=r.GetSize(); uibuf.Create(sz); AttachBuffers(); } - -//virtual ~AggDrawer() { uibuf.Rectangalize(m_w, true); uibuf.Clear(); } -}; - -//#endif +//#ifndef _agg_upp_bind_AggDrawer_h_ +//#define _agg_upp_bind_AggDrawer_h_ + +//from DrawingDraw? +//#include "agg_upp_bind.h" + +class AggDrawer { +private: + typedef agg::renderer_base renderer_base; + typedef agg::renderer_scanline_aa_solid renderer_solid; + + Rect m_r; + Size sz; + ImagBuffer uibuf; + agg::rendering_buffer m_rbuf; + + agg::rasterizer_scanline_aa<> m_ras; + agg::scanline_p8 m_sl; + renderer_base m_renb; //renderer base + renderer_solid m_ren; //(renb); // + agg::pixfmt_bgra32 m_pixf; + + void AttachBuffers(); +public: + void DrawLine(int x1, int y1, int x2, int y2, int width = 0); + void DrawEllipse(int x1, int y1, int cx, int cy, int width); + + void SetBackground(const agg::rgba8& ct) { m_renb.clear(ct); } + void SetBrushColor(const agg::rgba8& ct) { m_ren.color(ct); } + + void RenderScanlines(); + + void End(Draw& w, bool norr=false) { RenderScanlines(); uibuf.Rectangalize(w, norr); uibuf.Clear(); } + +// AggDrawer(Draw& w, const Rect& r) { m_w=w; m_r=r; sz=r.GetSize(); uibuf.Create(sz); AttachBuffers(); } + AggDrawer(const Rect& r) { m_r=r; sz=r.GetSize(); uibuf.Create(sz); AttachBuffers(); } + +//virtual ~AggDrawer() { uibuf.Rectangalize(m_w, true); uibuf.Clear(); } +}; + +//#endif diff --git a/uppdev/agg_upp_bind/agg_upp_bind.h b/uppdev/agg_upp_bind/agg_upp_bind.h index 0e2c1622c..456fb030a 100644 --- a/uppdev/agg_upp_bind/agg_upp_bind.h +++ b/uppdev/agg_upp_bind/agg_upp_bind.h @@ -1,22 +1,32 @@ -#ifndef _agg_upp_bind_agg_upp_bind_h_ -#define _agg_upp_bind_agg_upp_bind_h_ - - -//#include -//#define AGG_RGBA32 -//#define AGG_BGRA32 - -#include -#include - -NAMESPACE_UPP -//using namespace Upp; - -#include -#include -#include - -END_UPP_NAMESPACE - - -#endif +#ifndef _agg_upp_bind_agg_upp_bind_h_ +#define _agg_upp_bind_agg_upp_bind_h_ + + +//#include +//#define AGG_RGBA32 +//#define AGG_BGRA32 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +NAMESPACE_UPP +//using namespace Upp; + +#include +#include +#include + +END_UPP_NAMESPACE + + +#endif diff --git a/uppdev/agg_upp_bind/agg_upp_bind.upp b/uppdev/agg_upp_bind/agg_upp_bind.upp index 4df54407d..8323ba800 100644 --- a/uppdev/agg_upp_bind/agg_upp_bind.upp +++ b/uppdev/agg_upp_bind/agg_upp_bind.upp @@ -1,6 +1,6 @@ uses CtrlLib, - plugin/agg24; + agg24; file agg_upp_bind.h charset "UTF-8" diff --git a/uppdev/agg_upp_bind/init b/uppdev/agg_upp_bind/init new file mode 100644 index 000000000..c82a47c78 --- /dev/null +++ b/uppdev/agg_upp_bind/init @@ -0,0 +1,5 @@ +#ifndef _agg_upp_bind_icpp_init_stub +#define _agg_upp_bind_icpp_init_stub +#include "CtrlLib/init" +#include "agg24/init" +#endif diff --git a/uppdev/aggtest/aggtest.upp b/uppdev/aggtest/aggtest.upp index 47827f731..be30a58d8 100644 --- a/uppdev/aggtest/aggtest.upp +++ b/uppdev/aggtest/aggtest.upp @@ -1,6 +1,7 @@ uses CtrlLib, - AggCtrl; + AggCtrl, + SDraw; file aggtest.h, diff --git a/uppdev/aggtest/init b/uppdev/aggtest/init index 9371480d8..a494a9818 100644 --- a/uppdev/aggtest/init +++ b/uppdev/aggtest/init @@ -2,4 +2,5 @@ #define _aggtest_icpp_init_stub #include "CtrlLib/init" #include "AggCtrl/init" +#include "SDraw/init" #endif