summaryrefslogtreecommitdiff
path: root/src/Fl_Device.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-05-27 17:20:18 +0000
committerManolo Gouy <Manolo>2010-05-27 17:20:18 +0000
commit26049351e09d75bdf8b35273a76cf65202583fa7 (patch)
tree010685555b9f83d071a14262e8ce346c7388f254 /src/Fl_Device.cxx
parent0a280ce591046f6834f1233087a72fa6bdd97bad (diff)
Better device hierarchy with surfaces and graphics drivers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7617 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Device.cxx')
-rw-r--r--src/Fl_Device.cxx59
1 files changed, 17 insertions, 42 deletions
diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx
index 9c76d3f6f..a7315552b 100644
--- a/src/Fl_Device.cxx
+++ b/src/Fl_Device.cxx
@@ -29,51 +29,26 @@
#include <FL/Fl_Device.H>
#include <FL/Fl_Image.H>
-/** \brief Draws an Fl_Pixmap object to the device.
- *
- Specifies a bounding box for the image, with the origin (upper left-hand corner) of
- the image offset by the cx and cy arguments.
- */
-void Fl_Device::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
- pxm->generic_device_draw(XP, YP, WP, HP, cx, cy);
-}
-
-/** \brief Draws an Fl_Bitmap object to the device.
- *
- Specifies a bounding box for the image, with the origin (upper left-hand corner) of
- the image offset by the cx and cy arguments.
- */
-void Fl_Device::draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {
- bm->generic_device_draw(XP, YP, WP, HP, cx, cy);
-}
+const char *Fl_Device::device_type = "Fl_Device";
+const char *Fl_Surface_Device::device_type = "Fl_Surface_Device";
+const char *Fl_Display_Device::device_type = "Fl_Display_Device";
+const char *Fl_Graphics_Driver::device_type = "Fl_Graphics_Driver";
+#if defined(__APPLE__) || defined(FL_DOXYGEN)
+const char *Fl_Quartz_Graphics_Driver::device_type = "Fl_Quartz_Graphics_Driver";
+#endif
+#if defined(WIN32) || defined(FL_DOXYGEN)
+const char *Fl_GDI_Graphics_Driver::device_type = "Fl_GDI_Graphics_Driver";
+#endif
+#if !(defined(__APPLE__) || defined(WIN32))
+const char *Fl_Xlib_Graphics_Driver::device_type = "Fl_Xlib_Graphics_Driver";
+#endif
-/** \brief Draws an Fl_RGB_Image object to the device.
- *
- Specifies a bounding box for the image, with the origin (upper left-hand corner) of
- the image offset by the cx and cy arguments.
- */
-void Fl_Device::draw(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP, int cx, int cy) {
- rgb->generic_device_draw(XP, YP, WP, HP, cx, cy);
-}
-
-/**
- @brief Sets this device (display, printer, local file) as the target of future graphics calls.
- *
- @return The current target device of graphics calls.
- */
-Fl_Device *Fl_Device::set_current(void)
-{
- Fl_Device *current = fl_device;
- fl_device = this;
- return current;
-}
-/**
- @brief Returns the current target device of graphics calls.
- */
-Fl_Device *Fl_Device::current(void)
+/** \brief Use this drawing surface for future graphics requests. */
+void Fl_Surface_Device::set_current(void)
{
- return fl_device;
+ fl_device = _driver;
+ fl_surface = this;
}
//