diff options
| author | Manolo Gouy <Manolo> | 2016-04-19 20:47:25 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-19 20:47:25 +0000 |
| commit | cd4498021e9623da828b3fb8344bc4db35675efe (patch) | |
| tree | 11098f27f2a463c8d86020bc117d314d4392fa32 /FL/x.H | |
| parent | 8a910fe8fb10c5c0b84b132bb80982868992b02f (diff) | |
Have headers x.H, win32.H and mac.H share a unique definition of class Fl_X
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11667 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/x.H')
| -rw-r--r-- | FL/x.H | 61 |
1 files changed, 32 insertions, 29 deletions
@@ -29,7 +29,7 @@ # ifdef WIN32 # include "win32.H" -# elif defined(__APPLE__) // PORTME: Fl_Window_Driver - Fl_X Window Driver interface +# elif defined(__APPLE__) # include "mac.H" # elif defined(USE_SDL) # pragma message "FL_PORTING: write a header file based on this file, win32.H, or mac.H to define the FLTK core internals" @@ -38,6 +38,9 @@ # pragma message "FL_PORTING: write a header file based on this file, win32.H, or mac.H to define the FLTK core internals" # include "porting.H" # else // X11 +# ifndef USE_X11 +# define USE_X11 1 +# endif # if defined(_ABIN32) || defined(_ABI64) // fix for broken SGI Irix X .h files # pragma set woff 3322 # endif @@ -49,9 +52,7 @@ # include <X11/Xatom.h> # include "Fl_Window.H" -FL_EXPORT void fl_open_display(); FL_EXPORT void fl_open_display(Display*); -FL_EXPORT void fl_close_display(); // constant info about the X server connection: extern FL_EXPORT Display *fl_display; @@ -62,7 +63,6 @@ extern FL_EXPORT Colormap fl_colormap; // drawing functions: extern FL_EXPORT GC fl_gc; -extern FL_EXPORT Window fl_window; FL_EXPORT ulong fl_xpixel(Fl_Color i); FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b); @@ -73,10 +73,6 @@ FL_EXPORT int fl_handle(const XEvent&); extern FL_EXPORT const XEvent* fl_xevent; extern FL_EXPORT ulong fl_event_time; -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); - #if defined(FL_LIBRARY) || defined(FL_INTERNALS) extern FL_EXPORT Window fl_message_window; extern FL_EXPORT void *fl_xftfont; @@ -107,43 +103,50 @@ private: }; extern FL_EXPORT Fl_XFont_On_Demand fl_xfont; -// this object contains all X-specific stuff about a window: -// Warning: this object is highly subject to change! -// FL_LIBRARY or FL_INTERNALS must be defined to access this class. +extern FL_EXPORT char fl_override_redirect; // hack into Fl_X::make_xid() +extern FL_EXPORT int fl_background_pixel; // hack into Fl_X::make_xid() + +#endif // FL_LIBRARY || FL_INTERNALS + +# endif // X11 + +// +// cross-platform declarations +// +#if defined(FL_LIBRARY) || defined(FL_INTERNALS) + class FL_EXPORT Fl_X { public: Window xid; - Fl_Window *w; + Fl_Window* w; Fl_Region region; Fl_X *next; + // static variables, static functions and member functions static Fl_X* first; - static Fl_X* i(const Fl_Window* wi) {return wi->i;} - static void make_xid(Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap); + static Fl_X* i(const Fl_Window* w) {return (Fl_X*)w->i;} +# if USE_X11 // for backward compatibility + static void make_xid(Fl_Window*, XVisualInfo* =fl_visual, Colormap=fl_colormap); static Fl_X* set_xid(Fl_Window*, Window); +# endif }; -extern FL_EXPORT char fl_override_redirect; // hack into Fl_X::make_xid() -extern FL_EXPORT int fl_background_pixel; // hack into Fl_X::make_xid() - inline Window fl_xid(const Fl_Window* w) { Fl_X *xTemp = Fl_X::i(w); return xTemp ? xTemp->xid : 0; } - #else - extern FL_EXPORT Window fl_xid_(const Fl_Window* w); -#define fl_xid(w) fl_xid_(w) - +# define fl_xid(w) fl_xid_(w) #endif // FL_LIBRARY || FL_INTERNALS -FL_EXPORT Fl_Window* fl_find(Window xid); - - -// Dummy function to register a function for opening files via the window manager... -inline void fl_open_callback(void (*)(const char *)) {} - +extern FL_EXPORT Fl_Window* fl_find(Window xid); +extern FL_EXPORT void fl_open_display(); +extern FL_EXPORT void fl_close_display(); +extern FL_EXPORT Window fl_window; +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); extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b); +extern FL_EXPORT void fl_open_callback(void (*)(const char *)); -# endif -#endif +#endif // !Fl_X_H // // End of "$Id$". |
