diff options
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Android/Fl_Android_Graphics_Driver.H | 31 | ||||
| -rw-r--r-- | src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx | 68 |
2 files changed, 63 insertions, 36 deletions
diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver.H b/src/drivers/Android/Fl_Android_Graphics_Driver.H index fd23e95d6..d229180c3 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Driver.H +++ b/src/drivers/Android/Fl_Android_Graphics_Driver.H @@ -79,7 +79,6 @@ private: Fl_Rect_Region& operator = (const Fl_Rect_Region& other); }; -#if 0 /** * The Fl_Complex_Region represents a clipping region of any shape. * @@ -99,23 +98,23 @@ private: class Fl_Complex_Region : public Fl_Rect_Region { public: - Fl_Complex_Region() : Fl_Rect_Region(), pSubregion(0L), pNext(0L) { } - Fl_Complex_Region(int x, int y, int w, int h) : Fl_Rect_Region(x, y, w, h), pSubregion(0L), pNext(0L) { } - ~Fl_Complex_Region(); - virtual void set(int x, int y, int w, int h); - virtual void set(Fl_Rect_Region*); - void subtract(Fl_Rect_Region*); - void intersect(Fl_Rect_Region*); - void clone(Fl_Complex_Region*); - char is_simple() { return pSubregion==0; } - char is_complex() { return pSubregion!=0; } - void print(); + Fl_Complex_Region(); + Fl_Complex_Region(const Fl_Rect_Region&); + virtual ~Fl_Complex_Region() override; +// virtual void set(int x, int y, int w, int h); +// virtual void set(Fl_Rect_Region*); +// void subtract(Fl_Rect_Region*); +// void intersect(Fl_Rect_Region*); +// void clone(Fl_Complex_Region*); + char is_simple() const { return pSubregion==0; } + char is_complex() const { return pSubregion!=0; } + virtual void print(const char*) const override; protected: - void print_data(int indent); - Fl_Complex_Region *pSubregion; - Fl_Complex_Region *pNext; + void print_data(int indent) const; + Fl_Complex_Region *pSubregion = 0L; + Fl_Complex_Region *pParent = 0L; + Fl_Complex_Region *pNext = 0L; }; -#endif /** diff --git a/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx b/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx index e3ffafc54..2e71cfb29 100644 --- a/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx +++ b/src/drivers/Android/Fl_Android_Graphics_Driver_region.cxx @@ -147,15 +147,62 @@ void Fl_Rect_Region::print(const char *label) const Fl_Android_Application::log_i("Rect %d %d %d %d", x(), y(), w(), h()); } +// ----------------------------------------------------------------------------- -#if 0 +/** + * Create an empty complex region. + */ +Fl_Complex_Region::Fl_Complex_Region() : + Fl_Rect_Region() +{ +} + +/** + * Create a complex region with the same bounds as the give rect. + * @param r region size + */ +Fl_Complex_Region::Fl_Complex_Region(const Fl_Rect_Region &r) : + Fl_Rect_Region(r) +{ +} +/** + * Delete this region, all subregions recursively, and all following regions. + */ Fl_Complex_Region::~Fl_Complex_Region() { delete pSubregion; // recursively delete all subregions delete pNext; // recursively delete all following regions } +/** + * Print the entire content of this region recursively. + */ +void Fl_Complex_Region::print(const char *label) const +{ + Fl_Android_Application::log_i("---> Fl_Complex_Region: %s", label); + print_data(0); +} + +/* + * Print the rectangular data only. + */ +void Fl_Complex_Region::print_data(int indent) const +{ + static const char *space = " "; + if (pSubregion) { + Fl_Android_Application::log_i("%sBBox %d %d %d %d", space+16-indent, x(), y(), w(), h()); + pSubregion->print_data(indent+1); + } else { + Fl_Android_Application::log_i("%sRect %d %d %d %d", space+16-indent, x(), y(), w(), h()); + } + if (pNext) { + pNext->print_data(indent+1); + } +} + + +#if 0 void Fl_Complex_Region::set(int x, int y, int w, int h) { @@ -167,7 +214,6 @@ void Fl_Complex_Region::set(int x, int y, int w, int h) Fl_Rect_Region::set(x, y, w, h); } - void Fl_Complex_Region::set(Fl_Rect *rect) { delete pSubregion; @@ -198,13 +244,11 @@ void Fl_Complex_Region::subtract(Fl_Rect *r) int x = 3; } - void Fl_Complex_Region::intersect(Fl_Rect*) { // FIXME: implement } - void Fl_Complex_Region::clone(Fl_Complex_Region *r) { // FIXME: implement @@ -220,22 +264,6 @@ void Fl_Complex_Region::clone(Fl_Complex_Region *r) } } - -void Fl_Complex_Region::print_data(int indent) -{ - static const char *space = " "; - if (pSubregion) { - Fl_Android_Application::log_i("%sBBox %d %d %d %d", space+16-indent, x(), y(), w(), h()); - pSubregion->print_data(indent+1); - } else { - Fl_Android_Application::log_i("%sRect %d %d %d %d", space+16-indent, x(), y(), w(), h()); - } - if (pNext) { - pNext->print_data(indent+1); - } -} - - void Fl_Complex_Region::print() { Fl_Android_Application::log_i("-------- begin region"); |
