Author: manolo
Date: 2012-03-16 10:27:45 -0700 (Fri, 16 Mar 2012)
New Revision: 9287
Log:
Added function static int fltk3::SurfaceDevice::uses_display_driver();
Modified:
branches/branch-3.0/include/fltk3/Device.h
branches/branch-3.0/include/fltk3/Printer.h
branches/branch-3.0/src/fltk3/Device.cxx
branches/branch-3.0/src/fltk3/Printer.cxx
branches/branch-3.0/src/fltk3/draw_pixmap.cxx
Modified: branches/branch-3.0/include/fltk3/Device.h
===================================================================
--- branches/branch-3.0/include/fltk3/Device.h 2012-03-16 15:54:38 UTC (rev
9286)
+++ branches/branch-3.0/include/fltk3/Device.h 2012-03-16 17:27:45 UTC (rev
9287)
@@ -520,8 +520,11 @@
inline fltk3::GraphicsDriver *driver() {return _driver; };
/** \brief the surface that currently receives graphics output */
static inline fltk3::SurfaceDevice *surface() {return _surface; };
- /** returns true if the current output surface is the system's display,
and false otherwise */
- static bool to_display();
+ static int to_display();
+ virtual int has_display_driver();
+ /** returns true if the current output surface uses the same graphics
driver
+ as the platform display, and false otherwise */
+ static inline int uses_display_driver() { return
fltk3::SurfaceDevice::surface()->has_display_driver(); };
/** \brief The destructor. */
virtual ~SurfaceDevice();
};
@@ -536,6 +539,7 @@
DisplayDevice(fltk3::GraphicsDriver *graphics_driver);
/** Returns the platform display device. */
static inline DisplayDevice *display_device() {return _display;};
+ int has_display_driver();
};
/**
Modified: branches/branch-3.0/include/fltk3/Printer.h
===================================================================
--- branches/branch-3.0/include/fltk3/Printer.h 2012-03-16 15:54:38 UTC (rev
9286)
+++ branches/branch-3.0/include/fltk3/Printer.h 2012-03-16 17:27:45 UTC (rev
9287)
@@ -93,6 +93,7 @@
void untranslate(void);
int end_page (void);
void end_job (void);
+ int has_display_driver();
/** \brief The destructor */
~SystemPrinter(void);
}; // class fltk3::SystemPrinter
Modified: branches/branch-3.0/src/fltk3/Device.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Device.cxx 2012-03-16 15:54:38 UTC (rev
9286)
+++ branches/branch-3.0/src/fltk3/Device.cxx 2012-03-16 17:27:45 UTC (rev
9287)
@@ -41,10 +41,18 @@
_surface = this;
}
-bool fltk3::SurfaceDevice::to_display() {
+/** returns true if the current output surface is the platform display, and
false otherwise */
+int fltk3::SurfaceDevice::to_display() {
return fltk3::SurfaceDevice::surface() ==
fltk3::DisplayDevice::display_device();
}
+/** returns true if this surface uses the same graphics driver
+ as the platform display, and false otherwise */
+int fltk3::SurfaceDevice::has_display_driver() {
+ return 0;
+}
+
+
fltk3::SurfaceDevice::~SurfaceDevice() { }
@@ -86,6 +94,10 @@
_display = this;
};
+int fltk3::DisplayDevice::has_display_driver()
+{
+ return 1;
+}
//
// End of "$Id$".
//
Modified: branches/branch-3.0/src/fltk3/Printer.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Printer.cxx 2012-03-16 15:54:38 UTC (rev
9286)
+++ branches/branch-3.0/src/fltk3/Printer.cxx 2012-03-16 17:27:45 UTC (rev
9287)
@@ -92,6 +92,11 @@
PagedDevice::origin(x, y);
}
+int fltk3::SystemPrinter::has_display_driver()
+{
+ return 1;
+}
+
#endif
fltk3::Printer::Printer(void) {
Modified: branches/branch-3.0/src/fltk3/draw_pixmap.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/draw_pixmap.cxx 2012-03-16 15:54:38 UTC
(rev 9286)
+++ branches/branch-3.0/src/fltk3/draw_pixmap.cxx 2012-03-16 17:27:45 UTC
(rev 9287)
@@ -341,7 +341,7 @@
#endif
#ifdef __APPLE_QUARTZ__
- if ( fltk3::SurfaceDevice::to_display() ) {
+ if ( fltk3::SurfaceDevice::uses_display_driver() ) {
U32 *array = new U32[d.w * d.h], *q = array;
for (int Y = 0; Y < d.h; Y++) {
const uchar* p = data[Y];
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit