summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx6
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx14
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx6
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx7
4 files changed, 30 insertions, 3 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index 45144c9a1..15defb9eb 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -144,6 +144,12 @@ 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) {
+ Fl_Region R = XRectangleRegion(X, Y, W, H);
+ CombineRgn(r, r, R, RGN_OR);
+ XDestroyRegion(R);
+}
+
//
// End of "$Id$".
//
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
index f1b159960..6fdc3461e 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
@@ -18,7 +18,7 @@
#include "../../config_lib.h"
-#include "Fl_Quartz_Graphics_Driver.h"
+#include "Fl_Quartz_Graphics_Driver.H"
/* Reference to the current CGContext
For back-compatibility only. The preferred procedure to get this reference is
@@ -70,6 +70,18 @@ void Fl_Quartz_Graphics_Driver::copy_offscreen(int x,int y,int w,int h,Fl_Offscr
CGDataProviderRelease(src_bytes);
}
+void Fl_Graphics_Driver::add_rectangle_to_region(Fl_Region r, int X, int Y, int W, int H) {
+ CGRect arg = fl_cgrectmake_cocoa(X, Y, W, H);
+ int j; // don't add a rectangle totally inside the Fl_Region
+ for(j = 0; j < r->count; j++) {
+ if(CGRectContainsRect(r->rects[j], arg)) break;
+ }
+ if( j >= r->count) {
+ r->rects = (CGRect*)realloc(r->rects, (++(r->count)) * sizeof(CGRect));
+ r->rects[r->count - 1] = arg;
+ }
+}
+
//
// End of "$Id$".
//
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx
index 48e2c8f19..7e0b22dec 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx
@@ -580,7 +580,8 @@ if (fl_mac_os_version >= Fl_X::CoreText_threshold) {
// activate the current GC
iSize = sizeof(CGContextRef);
iTag = kATSUCGContextTag;
- iValuePtr = &gc_;
+ CGContextRef value = (CGContextRef)fl_graphics_driver->gc();
+ iValuePtr = &value;
ATSUSetLayoutControls(layout, 1, &iTag, &iSize, &iValuePtr);
// now measure the bounding box
err = ATSUSetTextPointerLocation(layout, txt, kATSUFromTextBeginning, n, n);
@@ -657,7 +658,8 @@ else {
// activate the current GC
iSize = sizeof(CGContextRef);
iTag = kATSUCGContextTag;
- iValuePtr = &gc_;
+ CGContextRef value = (CGContextRef)gc();
+ iValuePtr = &value;
ATSUSetLayoutControls(layout, 1, &iTag, &iSize, &iValuePtr);
// now measure the bounding box
err = ATSUSetTextPointerLocation(layout, txt, kATSUFromTextBeginning, n, n);
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
index 83103c7e4..967712490 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
@@ -98,6 +98,13 @@ void Fl_Xlib_Graphics_Driver::copy_offscreen_with_alpha(int x, int y, int w, int
}
#endif
+
+void Fl_Graphics_Driver::add_rectangle_to_region(Fl_Region r, int X, int Y, int W, int H) {
+ XRectangle R;
+ R.x = X; R.y = Y; R.width = W; R.height = H;
+ XUnionRectWithRegion(&R, r, r);
+}
+
//
// End of "$Id$".
//