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
This commit is contained in:
Manolo Gouy 2016-03-31 11:01:07 +00:00
parent 3ca402b609
commit 56e145a1c8
5 changed files with 19 additions and 19 deletions

18
FL/Fl.H
View File

@ -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

View File

@ -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;}

View File

@ -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$".
//

View File

@ -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>

View File

@ -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>