summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-30 20:16:40 +0000
committerManolo Gouy <Manolo>2016-03-30 20:16:40 +0000
commitd67f395031b0e9cfb266bf31a4a5e08a2d109e3b (patch)
tree6a38b9180802e79b16af5de3ff031e6d739ac16c /FL
parent7799245100a91b10b9a4ca9c6e818a3cdd8d5dc9 (diff)
Rewrite functions XRectangleRegion(), XDestroyRegion() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11479 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Graphics_Driver.H5
-rw-r--r--FL/mac.H15
-rw-r--r--FL/win32.H11
-rw-r--r--FL/x.H1
4 files changed, 5 insertions, 27 deletions
diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H
index 2ee75796a..c4bf7ec8d 100644
--- a/FL/Fl_Graphics_Driver.H
+++ b/FL/Fl_Graphics_Driver.H
@@ -240,8 +240,11 @@ public:
virtual float scale_font_for_PostScript(Fl_Font_Descriptor *desc, int s) { return float(s); }
// default implementation may be enough
virtual float scale_bitmap_for_PostScript() { return 2; }
- // each platform implements that its own way
+ // each platform implements these 3 functions its own way
static void add_rectangle_to_region(Fl_Region r, int x, int y, int w, int h);
+ static Fl_Region XRectangleRegion(int x, int y, int w, int h);
+ static void XDestroyRegion(Fl_Region r);
+
protected:
// --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
void global_gc(void);
diff --git a/FL/mac.H b/FL/mac.H
index f00fe240d..7beeba3e2 100644
--- a/FL/mac.H
+++ b/FL/mac.H
@@ -117,20 +117,7 @@ typedef float CGFloat;
#endif
#endif // CGFLOAT_DEFINED
-extern CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h);
-inline Fl_Region XRectangleRegion(int x, int y, int w, int h) {
- Fl_Region R = (Fl_Region)malloc(sizeof(*R));
- R->count = 1;
- R->rects = (CGRect *)malloc(sizeof(CGRect));
- *(R->rects) = fl_cgrectmake_cocoa(x, y, w, h);
- return R;
-}
-inline void XDestroyRegion(Fl_Region r) {
- if(r) {
- free(r->rects);
- free(r);
- }
-}
+//extern CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h);
extern NSCursor *fl_default_cursor;
// This object contains all mac-specific stuff about a window:
diff --git a/FL/win32.H b/FL/win32.H
index f4035b13c..f246a67d9 100644
--- a/FL/win32.H
+++ b/FL/win32.H
@@ -45,17 +45,6 @@ typedef HWND Window;
#define VK_APPS 0x5D
#endif
-// some random X equivalents
-struct XRectangle {int x, y, width, height;};
-extern Fl_Region XRectangleRegion(int x, int y, int w, int h);
-inline void XDestroyRegion(Fl_Region r) {DeleteObject(r);}
-inline void XClipBox(Fl_Region r,XRectangle* rect) {
- RECT win_rect; GetRgnBox(r,&win_rect);
- rect->x=win_rect.left;
- rect->y=win_rect.top;
- rect->width=win_rect.right-win_rect.left;
- rect->height=win_rect.bottom-win_rect.top;
-}
// this object contains all win32-specific stuff about a window:
// Warning: this object is highly subject to change!
class FL_EXPORT Fl_X {
diff --git a/FL/x.H b/FL/x.H
index 3acb5a52d..c47d78e78 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -82,7 +82,6 @@ extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm);
#if defined(FL_LIBRARY) || defined(FL_INTERNALS)
extern FL_EXPORT Window fl_message_window;
extern FL_EXPORT void *fl_xftfont;
-FL_EXPORT Fl_Region XRectangleRegion(int x, int y, int w, int h); // in fl_rect.cxx
// access to core fonts:
// This class provides a "smart pointer" that returns a pointer to an XFontStruct.