Author: manolo
Date: 2011-02-02 04:42:47 -0800 (Wed, 02 Feb 2011)
New Revision: 8360
Log:
Removed global variable fl_surface that was not very useful because equivalent
to Fl_Surface_Device::surface().
Modified:
branches/branch-1.3/FL/Fl_Device.H
branches/branch-1.3/FL/win32.H
branches/branch-1.3/FL/x.H
branches/branch-1.3/src/Fl_Bitmap.cxx
branches/branch-1.3/src/Fl_Device.cxx
branches/branch-1.3/src/Fl_Double_Window.cxx
branches/branch-1.3/src/Fl_Pixmap.cxx
branches/branch-1.3/src/Fl_cocoa.mm
branches/branch-1.3/src/Fl_win32.cxx
branches/branch-1.3/src/Fl_x.cxx
Modified: branches/branch-1.3/FL/Fl_Device.H
===================================================================
--- branches/branch-1.3/FL/Fl_Device.H 2011-02-02 11:29:18 UTC (rev 8359)
+++ branches/branch-1.3/FL/Fl_Device.H 2011-02-02 12:42:47 UTC (rev 8360)
@@ -40,12 +40,8 @@
#include <FL/Fl_RGB_Image.H>
class Fl_Graphics_Driver;
-class Fl_Display_Device;
-class Fl_Surface_Device;
/** \brief Points to the driver that currently receives all graphics requests
*/
FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
-/** \brief Points to the surface that currently receives all graphics requests
*/
-FL_EXPORT extern Fl_Surface_Device *fl_surface;
/**
signature of image generation callback function.
@@ -365,6 +361,7 @@
class FL_EXPORT Fl_Surface_Device : public Fl_Device {
/** \brief The graphics driver in use by this surface. */
Fl_Graphics_Driver *_driver;
+ static Fl_Surface_Device *_surface; // the surface that currently receives
graphics output
protected:
/** \brief Constructor that sets the graphics driver to use for the created
surface. */
Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {_driver =
graphics_driver; };
@@ -376,7 +373,7 @@
/** \brief Returns the graphics driver of this drawing surface. */
inline Fl_Graphics_Driver *driver() {return _driver; };
/** \brief the surface that currently receives graphics output */
- static Fl_Surface_Device *surface() {return fl_surface; };
+ static inline Fl_Surface_Device *surface() {return _surface; };
/** \brief The destructor. */
virtual ~Fl_Surface_Device() {}
};
@@ -385,14 +382,13 @@
\brief A display to which the computer can draw.
*/
class FL_EXPORT Fl_Display_Device : public Fl_Surface_Device {
+ static Fl_Display_Device *_display; // the platform display device
public:
static const char *class_id;
/** \brief A constructor that sets the graphics driver used by the display */
Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device(
graphics_driver) { class_name( class_id); };
- /**
- @brief Returns the platform's display device.
- */
- static Fl_Display_Device *display_device();
+ /** Returns the platform display device. */
+ static inline Fl_Display_Device *display_device() {return _display;};
};
/**
Modified: branches/branch-1.3/FL/win32.H
===================================================================
--- branches/branch-1.3/FL/win32.H 2011-02-02 11:29:18 UTC (rev 8359)
+++ branches/branch-1.3/FL/win32.H 2011-02-02 12:42:47 UTC (rev 8360)
@@ -136,7 +136,7 @@
# define fl_begin_offscreen(b) \
HDC _sgc=fl_gc; Window _sw=fl_window; \
- Fl_Surface_Device *_ss = fl_surface;
Fl_Display_Device::display_device()->set_current(); \
+ Fl_Surface_Device *_ss = Fl_Surface_Device::surface();
Fl_Display_Device::display_device()->set_current(); \
fl_gc=fl_makeDC(b); int _savedc = SaveDC(fl_gc); fl_window=(HWND)b;
fl_push_no_clip()
# define fl_end_offscreen() \
Modified: branches/branch-1.3/FL/x.H
===================================================================
--- branches/branch-1.3/FL/x.H 2011-02-02 11:29:18 UTC (rev 8359)
+++ branches/branch-1.3/FL/x.H 2011-02-02 12:42:47 UTC (rev 8360)
@@ -84,13 +84,13 @@
typedef ulong Fl_Offscreen;
# define fl_create_offscreen(w,h) \
XCreatePixmap(fl_display, \
- (fl_surface->class_name() == Fl_Display_Device::class_id ? \
+ (Fl_Surface_Device::surface()->class_name() ==
Fl_Display_Device::class_id ? \
fl_window : fl_xid(Fl::first_window()) ) , \
w, h, fl_visual->depth)
// begin/end are macros that save the old state in local variables:
# define fl_begin_offscreen(pixmap) \
Window _sw=fl_window; fl_window=pixmap; \
- Fl_Surface_Device *_ss = fl_surface;
Fl_Display_Device::display_device()->set_current(); \
+ Fl_Surface_Device *_ss = Fl_Surface_Device::surface();
Fl_Display_Device::display_device()->set_current(); \
fl_push_no_clip()
# define fl_end_offscreen() \
fl_pop_clip(); fl_window = _sw; _ss->set_current()
Modified: branches/branch-1.3/src/Fl_Bitmap.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Bitmap.cxx 2011-02-02 11:29:18 UTC (rev
8359)
+++ branches/branch-1.3/src/Fl_Bitmap.cxx 2011-02-02 12:42:47 UTC (rev
8360)
@@ -304,7 +304,7 @@
HDC tempdc;
int save;
BOOL use_print_algo = false;
- if (fl_surface->class_name() == Fl_Printer::class_id) {
+ if (Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) {
static HMODULE hMod = NULL;
if (!hMod) {
hMod = LoadLibrary("MSIMG32.DLL");
Modified: branches/branch-1.3/src/Fl_Device.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Device.cxx 2011-02-02 11:29:18 UTC (rev
8359)
+++ branches/branch-1.3/src/Fl_Device.cxx 2011-02-02 12:42:47 UTC (rev
8360)
@@ -48,7 +48,7 @@
void Fl_Surface_Device::set_current(void)
{
fl_graphics_driver = _driver;
- fl_surface = this;
+ _surface = this;
}
//
Modified: branches/branch-1.3/src/Fl_Double_Window.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Double_Window.cxx 2011-02-02 11:29:18 UTC
(rev 8359)
+++ branches/branch-1.3/src/Fl_Double_Window.cxx 2011-02-02 12:42:47 UTC
(rev 8360)
@@ -278,7 +278,7 @@
\param ctx the offscreen buffer.
*/
void fl_begin_offscreen(Fl_Offscreen ctx) {
- _ss = fl_surface;
+ _ss = Fl_Surface_Device::surface();
Fl_Display_Device::display_device()->set_current();
if (stack_ix<stack_max) {
stack_gc[stack_ix] = fl_gc;
Modified: branches/branch-1.3/src/Fl_Pixmap.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Pixmap.cxx 2011-02-02 11:29:18 UTC (rev
8359)
+++ branches/branch-1.3/src/Fl_Pixmap.cxx 2011-02-02 12:42:47 UTC (rev
8360)
@@ -145,7 +145,7 @@
}
fl_end_offscreen();
}
- if (fl_surface->class_name() == Fl_Printer::class_id) {
+ if (Fl_Surface_Device::surface()->class_name() == Fl_Printer::class_id) {
typedef BOOL (WINAPI* fl_transp_func)
(HDC,int,int,int,int,HDC,int,int,int,int,UINT);
static HMODULE hMod = NULL;
static fl_transp_func fl_TransparentBlt = NULL;
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-02-02 11:29:18 UTC (rev 8359)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-02-02 12:42:47 UTC (rev 8360)
@@ -99,8 +99,8 @@
static Fl_Quartz_Graphics_Driver fl_quartz_driver;
static Fl_Display_Device fl_quartz_display(&fl_quartz_driver);
FL_EXPORT Fl_Graphics_Driver *fl_graphics_driver =
(Fl_Graphics_Driver*)&fl_quartz_driver; // the current target device of
graphics operations
-FL_EXPORT Fl_Surface_Device *fl_surface =
(Fl_Surface_Device*)&fl_quartz_display; // the current target surface of
graphics operations
-Fl_Display_Device *Fl_Display_Device::display_device() { return
&fl_quartz_display; };
+Fl_Surface_Device* Fl_Surface_Device::_surface =
(Fl_Surface_Device*)&fl_quartz_display; // the current target surface of
graphics operations
+Fl_Display_Device *Fl_Display_Device::_display = &fl_quartz_display; // the
platform display
// public variables
int fl_screen;
Modified: branches/branch-1.3/src/Fl_win32.cxx
===================================================================
--- branches/branch-1.3/src/Fl_win32.cxx 2011-02-02 11:29:18 UTC (rev
8359)
+++ branches/branch-1.3/src/Fl_win32.cxx 2011-02-02 12:42:47 UTC (rev
8360)
@@ -87,8 +87,8 @@
static Fl_GDI_Graphics_Driver fl_gdi_driver;
static Fl_Display_Device fl_gdi_display(&fl_gdi_driver);
FL_EXPORT Fl_Graphics_Driver *fl_graphics_driver =
(Fl_Graphics_Driver*)&fl_gdi_driver; // the current target driver of graphics
operations
-FL_EXPORT Fl_Surface_Device *fl_surface = (Fl_Surface_Device*)&fl_gdi_display;
// the current target surface of graphics operations
-Fl_Display_Device *Fl_Display_Device::display_device() { return
&fl_gdi_display; };
+Fl_Surface_Device* Fl_Surface_Device::_surface =
(Fl_Surface_Device*)&fl_gdi_display; // the current target surface of graphics
operations
+Fl_Display_Device *Fl_Display_Device::_display = &fl_gdi_display; // the
platform display
// dynamic wsock dll handling api:
#if defined(__CYGWIN__) && !defined(SOCKET)
Modified: branches/branch-1.3/src/Fl_x.cxx
===================================================================
--- branches/branch-1.3/src/Fl_x.cxx 2011-02-02 11:29:18 UTC (rev 8359)
+++ branches/branch-1.3/src/Fl_x.cxx 2011-02-02 12:42:47 UTC (rev 8360)
@@ -54,8 +54,8 @@
static Fl_Xlib_Graphics_Driver fl_xlib_driver;
static Fl_Display_Device fl_xlib_display(&fl_xlib_driver);
FL_EXPORT Fl_Graphics_Driver *fl_graphics_driver =
(Fl_Graphics_Driver*)&fl_xlib_driver; // the current target device of graphics
operations
-FL_EXPORT Fl_Surface_Device *fl_surface =
(Fl_Surface_Device*)&fl_xlib_display; // the current target surface of graphics
operations
-Fl_Display_Device *Fl_Display_Device::display_device() { return
&fl_xlib_display; };
+Fl_Surface_Device* Fl_Surface_Device::_surface =
(Fl_Surface_Device*)&fl_xlib_display; // the current target surface of graphics
operations
+Fl_Display_Device *Fl_Display_Device::_display = &fl_xlib_display;// the
platform display
////////////////////////////////////////////////////////////////
// interface to poll/select call:
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit