diff options
| author | Manolo Gouy <Manolo> | 2016-03-31 11:01:07 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-31 11:01:07 +0000 |
| commit | 56e145a1c8cafea814f03cec951bde2753d234f5 (patch) | |
| tree | c774b9e1b5f4822a0c1297b2b9a1a61f629917de | |
| parent | 3ca402b609deca8872bab22e379a4131e3ba41ba (diff) | |
Complete removing platform-dependent code from the Fl.H header file.
Type FL_SOCKET is now declared in Fl_System_Driver.H with all other
platform-dependent public types.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11484 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/Fl.H | 18 | ||||
| -rw-r--r-- | FL/Fl_System_Driver.H | 13 | ||||
| -rw-r--r-- | src/Fl_System_Driver.cxx | 5 | ||||
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/Posix/Fl_Posix_System_Driver.H | 1 |
5 files changed, 19 insertions, 19 deletions
@@ -23,6 +23,7 @@ #ifndef Fl_H # define Fl_H +#include <FL/Fl_System_Driver.H> #ifdef FLTK_HAVE_CAIRO # include <FL/Fl_Cairo.H> #endif @@ -48,23 +49,6 @@ class Fl_Image; struct Fl_Label; class Fl_Screen_Driver; -// Keep avoiding having the socket deps at that level but mke sure it will work in both 32 & 64 bit builds -#if defined(WIN32) && !defined(__CYGWIN__) -# if defined(_WIN64) -# define FL_SOCKET unsigned __int64 -# else -# define FL_SOCKET int -# endif -#elif defined(__APPLE__) // PORTME: Fl_System_Driver - socket types -# define FL_SOCKET int -#elif defined(FL_PORTING) -# pragma message "FL_PORTING: define a type for FL_SOCKET" -# define FL_SOCKET int // default if not ported -# undef check -#else -# define FL_SOCKET int -#endif - // Pointers you can use to change FLTK to a foreign language. // Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx diff --git a/FL/Fl_System_Driver.H b/FL/Fl_System_Driver.H index 902e8bc70..9d6bf3220 100644 --- a/FL/Fl_System_Driver.H +++ b/FL/Fl_System_Driver.H @@ -25,30 +25,39 @@ #define FL_SYSTEM_DRIVER_H #include <FL/Fl_Export.H> -#include <FL/Fl.H> +#include <stdio.h> #include <stdarg.h> +// platform-dependent types are declared here #ifdef __APPLE__ typedef struct CGContext* Fl_Offscreen; typedef struct CGImage* Fl_Bitmask; typedef struct flCocoaRegion* Fl_Region; +typedef int FL_SOCKET; #elif defined(WIN32) typedef struct HBITMAP__ *HBITMAP; typedef HBITMAP Fl_Offscreen; typedef HBITMAP Fl_Bitmask; typedef struct HRGN__ *Fl_Region; +# if defined(_WIN64) +typedef unsigned __int64 FL_SOCKET; +# else +typedef int FL_SOCKET; +# endif #elif defined(FL_PORTING) # pragma message "FL_PORTING: define OS-dependent types" typedef void* Fl_Offscreen; typedef void* Fl_Bitmask; typedef void *Fl_Region; +typedef int FL_SOCKET; #else typedef unsigned long Fl_Offscreen; typedef unsigned long Fl_Bitmask; typedef struct _XRegion *Fl_Region; +typedef int FL_SOCKET; #endif // __APPLE__ @@ -91,7 +100,7 @@ public: // implement so text-editing widgets support dead keys virtual int compose(int &del) {del = 0; return 0;} // default implementation may be enough - virtual void compose_reset() { Fl::compose_state = 0; } + virtual void compose_reset(); // implement to support drag-n-drop. use_selection = 1 means the GUI is welcome to display // the selected text during the D&D operation virtual int dnd(int use_selection = 0) {return 0;} diff --git a/src/Fl_System_Driver.cxx b/src/Fl_System_Driver.cxx index 686d03ecb..60406bc09 100644 --- a/src/Fl_System_Driver.cxx +++ b/src/Fl_System_Driver.cxx @@ -18,6 +18,7 @@ #include <FL/Fl_System_Driver.H> +#include <FL/Fl.H> #include <FL/fl_utf8.h> #include <stdlib.h> #include <stdio.h> @@ -371,6 +372,10 @@ int Fl_System_Driver::clocale_printf(FILE *output, const char *format, va_list a return vfprintf(output, format, args); } +void Fl_System_Driver::compose_reset() { + Fl::compose_state = 0; +} + // // End of "$Id$". // diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H index 29a658d5f..6926487ba 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H @@ -26,6 +26,7 @@ #define FL_DARWIN_SYSTEM_DRIVER_H #include <FL/Fl_System_Driver.H> +#include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.H b/src/drivers/Posix/Fl_Posix_System_Driver.H index dc5fe83a2..c1f9988f5 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.H +++ b/src/drivers/Posix/Fl_Posix_System_Driver.H @@ -26,6 +26,7 @@ #define FL_POSIX_SYSTEM_DRIVER_H #include <FL/Fl_System_Driver.H> +#include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> |
