diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2011-01-17 23:52:32 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2011-01-17 23:52:32 +0000 |
| commit | 96c410dceb2adff87f067e44310b269f51fa7e90 (patch) | |
| tree | 6271cc3ae105fdbe433b3f6176d4534abdf9661a /FL/win32.H | |
| parent | b841d90d3cdd2b27f9eeb80430a06cf73d4dd2b4 (diff) | |
Hiding the Fl_X class under WIN32 (STR #2522).
Applied Manolo's patch, modified to use FL_INTERNALS for
explicit request in user code to expose class Fl_X.
Also changed X11 and Mac OS to use FL_INTERNALS.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8289 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/win32.H')
| -rw-r--r-- | FL/win32.H | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/FL/win32.H b/FL/win32.H index fd2610708..4a95b32de 100644 --- a/FL/win32.H +++ b/FL/win32.H @@ -3,7 +3,7 @@ // // WIN32 header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2011 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -35,6 +35,12 @@ #endif // !Fl_X_H #include <windows.h> +typedef HRGN Fl_Region; +typedef HWND Window; + +// this part is included only when compiling the FLTK library or if requested explicitly +#if defined(FL_LIBRARY) || defined(FL_INTERNALS) + // In some of the distributions, the gcc header files are missing some stuff: #ifndef LPMINMAXINFO #define LPMINMAXINFO MINMAXINFO* @@ -45,14 +51,9 @@ #define VK_APPS 0x5D #endif -#include <FL/Fl_Device.H> - // some random X equivalents -typedef HWND Window; typedef POINT XPoint; struct XRectangle {int x, y, width, height;}; -typedef HRGN Fl_Region; -FL_EXPORT void fl_clip_region(Fl_Region); extern Fl_Region XRectangleRegion(int x, int y, int w, int h); inline void XDestroyRegion(Fl_Region r) {DeleteObject(r);} inline void XClipBox(Fl_Region r,XRectangle* rect) { @@ -66,7 +67,7 @@ inline void XClipBox(Fl_Region r,XRectangle* rect) { #define XMapWindow(a,b) ShowWindow(b, SW_RESTORE) #define XUnmapWindow(a,b) ShowWindow(b, SW_HIDE) -#include "Fl_Window.H" +#include <FL/Fl_Window.H> // this object contains all win32-specific stuff about a window: // Warning: this object is highly subject to change! class FL_EXPORT Fl_X { @@ -94,10 +95,17 @@ public: }; extern FL_EXPORT HCURSOR fl_default_cursor; extern FL_EXPORT UINT fl_wake_msg; -inline Window fl_xid(const Fl_Window*w) {Fl_X *temp = Fl_X::i(w); return temp ? temp->xid : 0;} -FL_EXPORT Fl_Window* fl_find(Window xid); 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() +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); + +#endif // FL_LIBRARY || FL_INTERNALS + +extern FL_EXPORT Window fl_xid(const Fl_Window*w); +FL_EXPORT Fl_Window* fl_find(Window xid); +FL_EXPORT void fl_clip_region(Fl_Region); // most recent fl_color() or fl_rgbcolor() points at one of these: extern FL_EXPORT struct Fl_XMap { @@ -113,19 +121,15 @@ 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 HPALETTE fl_palette; // non-zero only on 8-bit displays! -extern FL_EXPORT HDC fl_GetDC(Window); extern FL_EXPORT MSG fl_msg; -extern FL_EXPORT void fl_release_dc(HWND w, HDC dc); -extern FL_EXPORT void fl_save_dc( HWND w, HDC dc); +extern FL_EXPORT HDC fl_GetDC(Window); +extern FL_EXPORT HDC fl_makeDC(HBITMAP); // off-screen pixmaps: create, destroy, draw into, copy to window typedef HBITMAP Fl_Offscreen; #define fl_create_offscreen(w, h) \ CreateCompatibleBitmap( (fl_gc ? fl_gc : fl_GetDC(0) ) , w, h) -extern FL_EXPORT HDC fl_makeDC(HBITMAP); - # define fl_begin_offscreen(b) \ HDC _sgc=fl_gc; Window _sw=fl_window; \ Fl_Surface_Device *_ss = fl_surface; fl_display_device->set_current(); \ @@ -133,11 +137,11 @@ extern FL_EXPORT HDC fl_makeDC(HBITMAP); # define fl_end_offscreen() \ fl_pop_clip(); RestoreDC(fl_gc, _savedc); DeleteDC(fl_gc); _ss->set_current(); fl_window=_sw; fl_gc = _sgc - + FL_EXPORT void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy); FL_EXPORT void fl_copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy); -#define fl_delete_offscreen(bitmap) DeleteObject(bitmap); +#define fl_delete_offscreen(bitmap) DeleteObject(bitmap) // Bitmap masks typedef HBITMAP Fl_Bitmask; |
