diff options
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/mac.H | 26 | ||||
| -rw-r--r-- | FL/win32.H | 48 | ||||
| -rw-r--r-- | FL/x.H | 61 |
3 files changed, 35 insertions, 100 deletions
@@ -95,35 +95,11 @@ typedef float CGFloat; #endif #endif // CGFLOAT_DEFINED -// This object contains all mac-specific stuff about a window: -// WARNING: this object is highly subject to change! -class Fl_X { -public: - Window xid; // pointer to the Cocoa window object (FLWindow*) - Fl_Window *w; // FLTK window for - Fl_Region region; - Fl_X *next; // chain of mapped windows - static Fl_X* first; - static Fl_X* i(const Fl_Window* w) {return (Fl_X*)w->i;} -}; - -extern Window fl_window; - #endif // FL_LIBRARY || FL_INTERNALS extern CGContextRef fl_gc; -extern Window fl_xid(const Fl_Window*); -extern Fl_Window* fl_find(Window xid); - -extern Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data); -extern Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data); -extern void fl_delete_bitmask(Fl_Bitmask bm); - -extern int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b); -extern void fl_open_display(); - #endif // FL_DOXYGEN /** \file Mac OS X-specific symbols. @@ -134,11 +110,13 @@ extern void fl_open_display(); \sa \ref osissues_macos @{ */ +#ifdef FL_DOXYGEN /** @brief Register a function called for each file dropped onto an application icon. \e cb will be called with a single Unix-style file name and path. If multiple files were dropped, \e cb will be called multiple times. */ extern void fl_open_callback(void (*cb)(const char *)); +#endif /** * \brief Attaches a callback to the "About myprog" item of the system application menu. diff --git a/FL/win32.H b/FL/win32.H index d1296ef28..b27eafc54 100644 --- a/FL/win32.H +++ b/FL/win32.H @@ -44,19 +44,6 @@ typedef HWND Window; #define VK_APPS 0x5D #endif -// this object contains all win32-specific stuff about a window: -// Warning: this object is highly subject to change! -class FL_EXPORT Fl_X { -public: - // member variables - add new variables only at the end of this block - Window xid; - 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* w) {return (Fl_X*)w->i;} -}; extern FL_EXPORT UINT fl_wake_msg; extern FL_EXPORT char fl_override_redirect; // hack into Fl_Window::make_xid() extern FL_EXPORT int fl_background_pixel; // hack into Fl_Window::make_xid() @@ -64,16 +51,8 @@ extern FL_EXPORT HPALETTE fl_palette; // non-zero only on 8-bit displays! extern FL_EXPORT void fl_release_dc(HWND w, HDC dc); extern FL_EXPORT void fl_save_dc( HWND w, HDC dc); -inline Window fl_xid(const Fl_Window* w) { Fl_X *temp = Fl_X::i(w); return temp ? temp->xid : 0; } - -extern FL_EXPORT void fl_open_display(); - -#else -FL_EXPORT Window fl_xid_(const Fl_Window* w); -#define fl_xid(w) fl_xid_(w) #endif // FL_LIBRARY || FL_INTERNALS -FL_EXPORT Fl_Window* fl_find(Window xid); // most recent fl_color() or fl_rgbcolor() points at one of these: extern FL_EXPORT struct Fl_XMap { @@ -87,38 +66,13 @@ FL_EXPORT HBRUSH fl_brush(); // allocates a brush if necessary FL_EXPORT HBRUSH fl_brush_action(int); // now does the real work extern FL_EXPORT HINSTANCE fl_display; -extern FL_EXPORT Window fl_window; extern FL_EXPORT HDC fl_gc; extern FL_EXPORT MSG fl_msg; extern FL_EXPORT HDC fl_GetDC(Window); extern FL_EXPORT HDC fl_makeDC(HBITMAP); -/*#define fl_create_offscreen(w, h) \ - CreateCompatibleBitmap( (fl_graphics_driver->gc() ? (HDC)fl_graphics_driver->gc() : fl_GetDC(0) ) , w, h) - -# define fl_begin_offscreen(b) \ - void* _sgc=fl_graphics_driver->gc(); Window _sw=fl_window; \ - Fl_Surface_Device *_ss = Fl_Surface_Device::surface(); \ -HDC _tmp_gc = fl_makeDC(b); int _savedc = SaveDC(_tmp_gc); \ -Fl_Display_Device::display_device()->set_current(); \ - fl_graphics_driver->gc(_tmp_gc); fl_window=(HWND)b; fl_push_no_clip() - -# define fl_end_offscreen() \ - fl_pop_clip(); RestoreDC((HDC)fl_graphics_driver->gc(), _savedc); DeleteDC((HDC)fl_graphics_driver->gc()); _ss->set_current(); fl_window=_sw; fl_graphics_driver->gc(_sgc); - -#define fl_delete_offscreen(bitmap) DeleteObject(bitmap)*/ - -// Bitmap masks - -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); - -// Dummy function to register a function for opening files via the window manager... -inline void fl_open_callback(void (*)(const char *)) {} - -extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b); #endif // FL_DOXYGEN + // // End of "$Id$". // @@ -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$". |
