summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-02-02 12:42:47 +0000
committerManolo Gouy <Manolo>2011-02-02 12:42:47 +0000
commit18156dfb30a291ca99422bd1bbebcb390bf9d570 (patch)
tree6687d9dc49ab32d4f44f5d3725b58704ba195831 /FL
parentbb29437427d44ee47ab1039f0bab3b66fdb40b62 (diff)
Removed global variable fl_surface that was not very useful because equivalent
to Fl_Surface_Device::surface(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8360 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Device.H14
-rw-r--r--FL/win32.H2
-rw-r--r--FL/x.H4
3 files changed, 8 insertions, 12 deletions
diff --git a/FL/Fl_Device.H b/FL/Fl_Device.H
index f7c7fecbb..e47343e28 100644
--- a/FL/Fl_Device.H
+++ b/FL/Fl_Device.H
@@ -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 @@ public:
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 @@ public:
/** \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 @@ public:
\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;};
};
/**
diff --git a/FL/win32.H b/FL/win32.H
index cb19475df..ac484db6b 100644
--- a/FL/win32.H
+++ b/FL/win32.H
@@ -136,7 +136,7 @@ typedef HBITMAP Fl_Offscreen;
# 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() \
diff --git a/FL/x.H b/FL/x.H
index 587822baf..7113f4af9 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -84,13 +84,13 @@ extern FL_EXPORT ulong fl_event_time;
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()