summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-26 14:36:11 +0000
committerManolo Gouy <Manolo>2016-03-26 14:36:11 +0000
commit915d6c643a8b4e31ea79fdad81761d26b42530f5 (patch)
tree8756c72f988596beb8e55382f40ff04142816057 /FL
parente86e4a6ab0e3ad8ccbb694909383f5d72b9b4c92 (diff)
Isolate the definition of the 3 public, OS-dependent types (Fl_Offscreen, Fl_Region, Fl_Bitmask).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Graphics_Driver.H29
-rw-r--r--FL/Fl_System_Driver.H18
-rw-r--r--FL/mac.H9
-rw-r--r--FL/win32.H5
-rw-r--r--FL/x.H9
5 files changed, 25 insertions, 45 deletions
diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H
index 086651314..316264264 100644
--- a/FL/Fl_Graphics_Driver.H
+++ b/FL/Fl_Graphics_Driver.H
@@ -24,7 +24,7 @@
#ifndef FL_GRAPHICS_DRIVER_H
#define FL_GRAPHICS_DRIVER_H
-#include <FL/x.H>
+#include <FL/Fl_System_Driver.H>
#include <FL/Fl_Device.H>
#include <FL/Fl_Image.H>
#include <FL/Fl_Bitmap.H>
@@ -47,25 +47,6 @@ FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
*/
typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
-// typedef what the x,y fields in a point are:
-#ifdef WIN32
-typedef int COORD_T;
-# define XPOINT XPoint
-#elif defined(__APPLE__) // PORTME: Fl_Graphics_Driver - platform specific types
-typedef float COORD_T;
-typedef struct { float x; float y; } QPoint;
-# define XPOINT QPoint
-extern float fl_quartz_line_width_;
-#elif defined(FL_PORTING)
-# pragma message "FL_PORTING: define types for COORD_T and XPOINT"
-typedef int COORD_T; // default if not ported
-typedef struct { int x; int y; } QPoint;
-# define XPOINT QPoint
-#else
-typedef short COORD_T;
-# define XPOINT XPoint
-#endif
-
#define FL_REGION_STACK_SIZE 10
#define FL_MATRIX_STACK_SIZE 32
@@ -116,8 +97,7 @@ protected:
static const int matrix_stack_size = FL_MATRIX_STACK_SIZE;
matrix stack[FL_MATRIX_STACK_SIZE];
matrix m;
- int n, p_size, gap_;
- XPOINT *p;
+ int n, gap_;
int what;
int rstackptr;
static const int region_stack_max = FL_REGION_STACK_SIZE - 1;
@@ -126,7 +106,6 @@ protected:
#ifndef FL_DOXYGEN
enum {LINE, LOOP, POLYGON, POINT_};
inline int vertex_no() { return n; }
- inline XPOINT *vertices() {return p;}
inline int vertex_kind() {return what;}
#endif
matrix *fl_matrix; /**< Points to the current coordinate transformation matrix */
@@ -134,7 +113,7 @@ protected:
// === all code below in this class has been to the reorganisation FL_PORTING process
public:
Fl_Graphics_Driver();
- virtual ~Fl_Graphics_Driver() { if (p) free(p); }
+ virtual ~Fl_Graphics_Driver() {}
virtual char can_do_alpha_blending() { return 0; }
// --- implementation is in src/fl_rect.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_rect.cxx
virtual void point(int x, int y) = 0;
@@ -261,8 +240,6 @@ public:
static void add_rectangle_to_region(Fl_Region r, int x, int y, int w, int h);
protected:
// --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx
- virtual void transformed_vertex0(COORD_T x, COORD_T y);
- virtual void fixloop();
void global_gc(void);
};
diff --git a/FL/Fl_System_Driver.H b/FL/Fl_System_Driver.H
index da2446542..ef64e700b 100644
--- a/FL/Fl_System_Driver.H
+++ b/FL/Fl_System_Driver.H
@@ -21,10 +21,25 @@
\brief declaration of classe Fl_System_Driver.
*/
+#ifdef __APPLE__
+#include <src/drivers/Darwin/Fl_Darwin_System_Driver.H>
+
+#elif defined(WIN32)
+#include <src/drivers/WinAPI/Fl_WinAPI_System_Driver.H>
+
+#elif defined(FL_PORTING)
+# pragma message "FL_PORTING: define OS-dependent types"
+typedef void* Fl_Offscreen;
+typedef void* Fl_Bitmask;
+typedef void *Fl_Region;
+#else
+
+#include <src/drivers/Posix/Fl_Posix_System_Driver.H>
+#endif // __APPLE__
+
#ifndef FL_SYSTEM_DRIVER_H
#define FL_SYSTEM_DRIVER_H
-#include <FL/Fl_Device.H>
#include <FL/Fl_Export.H>
/**
@@ -36,7 +51,6 @@ public:
virtual ~Fl_System_Driver();
};
-
#endif // FL_SYSTEM_DRIVER_H
//
diff --git a/FL/mac.H b/FL/mac.H
index a42109c18..0f4a6ae80 100644
--- a/FL/mac.H
+++ b/FL/mac.H
@@ -33,18 +33,17 @@ typedef class FLWindow *Window; // pointer to the FLWindow objective-c class
#endif // __OBJC__
#include <FL/Fl_Device.H>
+#include "src/drivers/Darwin/Fl_Darwin_System_Driver.H"
#if !(defined(FL_LIBRARY) || defined(FL_INTERNALS)) // this part is used when compiling an application program
# include <FL/Fl_Widget.H>
-typedef struct flCocoaRegion* Fl_Region;
typedef struct CGContext* CGContextRef;
typedef struct OpaquePMPrintSettings* PMPrintSettings;
typedef struct OpaquePMPageFormat* PMPageFormat;
typedef struct OpaquePMPrintSession* PMPrintSession;
typedef struct CGImage* CGImageRef;
typedef struct __CFData* CFMutableDataRef; // used in Fl_Copy_Surface.H
-typedef CGContextRef Fl_Offscreen;
#else // this part must be compiled when building the FLTK libraries
@@ -99,15 +98,14 @@ class NSOpenGLContext;
class CALayer;
#endif // __OBJC__
-typedef CGContextRef Fl_Offscreen;
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
typedef CGImageAlphaInfo CGBitmapInfo;
#endif
-typedef struct flCocoaRegion {
+struct flCocoaRegion {
int count;
CGRect *rects;
-} *Fl_Region; // a region is the union of a series of rectangles
+}; // a region is the union of a series of rectangles
# include "Fl_Window.H"
# include "../src/Fl_Font.H"
@@ -209,7 +207,6 @@ extern Window fl_window;
#endif // FL_LIBRARY || FL_INTERNALS
-typedef CGImageRef Fl_Bitmask;
extern CGContextRef fl_gc;
diff --git a/FL/win32.H b/FL/win32.H
index 87430b9b3..f4035b13c 100644
--- a/FL/win32.H
+++ b/FL/win32.H
@@ -26,9 +26,8 @@
#endif // !Fl_X_H
#include <windows.h>
-typedef HRGN Fl_Region;
+#include "src/drivers/WinAPI/Fl_WinAPI_System_Driver.H"
typedef HWND Window;
-typedef POINT XPoint;
#include <FL/Fl_Device.H>
#include <FL/Fl_Window.H>
@@ -126,7 +125,6 @@ extern FL_EXPORT MSG fl_msg;
extern FL_EXPORT HDC fl_GetDC(Window);
extern FL_EXPORT HDC fl_makeDC(HBITMAP);
-typedef HBITMAP Fl_Offscreen;
/*#define fl_create_offscreen(w, h) \
CreateCompatibleBitmap( (fl_graphics_driver->gc() ? (HDC)fl_graphics_driver->gc() : fl_GetDC(0) ) , w, h)
@@ -143,7 +141,6 @@ Fl_Display_Device::display_device()->set_current(); \
#define fl_delete_offscreen(bitmap) DeleteObject(bitmap)*/
// Bitmap masks
-typedef HBITMAP Fl_Bitmask;
extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data);
extern FL_EXPORT Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data);
diff --git a/FL/x.H b/FL/x.H
index 7cc5b4a77..3acb5a52d 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -48,8 +48,8 @@
# endif
# include <X11/Xatom.h>
# include "Fl_Window.H"
-// Mirror X definition of Region to Fl_Region, for portability...
-typedef Region Fl_Region;
+
+#include <src/drivers/Posix/Fl_Posix_System_Driver.H>
FL_EXPORT void fl_open_display();
FL_EXPORT void fl_open_display(Display*);
@@ -75,11 +75,6 @@ FL_EXPORT int fl_handle(const XEvent&);
extern FL_EXPORT const XEvent* fl_xevent;
extern FL_EXPORT ulong fl_event_time;
-typedef ulong Fl_Offscreen;
-
-// Bitmap masks
-typedef ulong Fl_Bitmask;
-
extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data);
extern FL_EXPORT Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data);
extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm);