From cdf85352c42dd2f3b43703897148e8fa513c9cdc Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sun, 17 Apr 2016 15:36:23 +0000 Subject: virtualized some Region calls. There is a deeper issue here: regions should be handled by the graphics driver that is associated with the Fl_Window of this widget... . git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11643 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/GDI/Fl_GDI_Graphics_Driver.H | 3 +++ src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/drivers/GDI') diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H index fa5b517e3..eec35dea2 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -78,6 +78,9 @@ public: void copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy); #endif void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy); + void add_rectangle_to_region(Fl_Region r, int x, int y, int w, int h); + Fl_Region XRectangleRegion(int x, int y, int w, int h); + void XDestroyRegion(Fl_Region r); protected: void transformed_vertex0(int x, int y); void fixloop(); diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx index f208b979f..47cc9383c 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx @@ -144,7 +144,7 @@ void Fl_Translated_GDI_Graphics_Driver::untranslate_all() { SetWindowOrgEx((HDC)gc(), origins[depth].x, origins[depth].y, NULL); } -void Fl_Graphics_Driver::add_rectangle_to_region(Fl_Region r, int X, int Y, int W, int H) { +void Fl_GDI_Graphics_Driver::add_rectangle_to_region(Fl_Region r, int X, int Y, int W, int H) { Fl_Region R = XRectangleRegion(X, Y, W, H); CombineRgn(r, r, R, RGN_OR); XDestroyRegion(R); @@ -166,7 +166,7 @@ void Fl_GDI_Graphics_Driver::fixloop() { // remove equal points from closed pat while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--; } -Fl_Region Fl_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) { +Fl_Region Fl_GDI_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) { if (Fl_Surface_Device::surface() == Fl_Display_Device::display_device()) return CreateRectRgn(x,y,x+w,y+h); // because rotation may apply, the rectangle becomes a polygon in device coords POINT pt[4] = { {x, y}, {x + w, y}, {x + w, y + h}, {x, y + h} }; @@ -174,16 +174,16 @@ Fl_Region Fl_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) { return CreatePolygonRgn(pt, 4, ALTERNATE); } -void Fl_Graphics_Driver::XDestroyRegion(Fl_Region r) { +void Fl_GDI_Graphics_Driver::XDestroyRegion(Fl_Region r) { DeleteObject(r); } -void Fl_Graphics_Driver::reset_spot() +void Fl_GDI_Graphics_Driver::reset_spot() { } -void Fl_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win) +void Fl_GDI_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win) { if (!win) return; Fl_Window* tw = win; -- cgit v1.2.3