summaryrefslogtreecommitdiff
path: root/src/Fl_Device.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-02-09 18:25:02 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-02-09 18:25:02 +0000
commit41e22f2f39f6b9a53d5248669e531e6c8e36a421 (patch)
tree48dd8a971667ae53be38524e3d4d27fa92ded326 /src/Fl_Device.cxx
parentdee0f5a82452da4334f269ceaee01f2d3df01bc0 (diff)
Move ifdef's in RGB_Image into driver system.
- change image caching variable types to uintptr_t - added driver function to uncache image data - cleaning up (Xlib and GDI will likely throw syntax errors. Trying to fix ASAP) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11138 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Device.cxx')
-rw-r--r--src/Fl_Device.cxx63
1 files changed, 30 insertions, 33 deletions
diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx
index efbd0712d..bfb60d789 100644
--- a/src/Fl_Device.cxx
+++ b/src/Fl_Device.cxx
@@ -19,13 +19,39 @@
#include <FL/Fl.H>
#include "config_lib.h"
#include <FL/Fl_Device.H>
-#include <FL/Fl_Image.H>
-#include <FL/fl_draw.H>
+#include <FL/Fl_Graphics_Driver.H>
+
+/* Attempt at an inheritance diagram.
+
+ Fl_Device: base class for the core device systems
+ |
+ +- Fl_Surface_Device: any kind of surface that we can draw onto -> uses an Fl_Graphics_Driver
+ |
+ +- Fl_Display_Device: some kind of video device
+ +- Fl_Copy_Surface: create an image for dnd or copy/paste
+ +- Fl_Image_Surface: create an RGB Image
+ +- Fl_Paged_Device: output to a printer or similar
+ |
+ +- Fl_..._Surface_: platform specific driver
+ +- Fl_Printer: user can instantiate this to gain access to a printer
+ +- Fl_System_Printer:
+ +- Fl_PostScript_File_Device
+ |
+ +- Fl_PostScript_Printer
+ |
+ +- Fl_Graphics_Driver
+ |
+ +- Fl_..._Graphics_Driver: platform specific graphics driver
+
+TODO:
+ Window Device to handle creation of surfaces and manage events
+ System Device to handle file system acces, standard dialogs, etc.
+
+*/
const char *Fl_Device::class_id = "Fl_Device";
const char *Fl_Surface_Device::class_id = "Fl_Surface_Device";
const char *Fl_Display_Device::class_id = "Fl_Display_Device";
-const char *Fl_Graphics_Driver::class_id = "Fl_Graphics_Driver";
bool Fl_Display_Device::high_res_window_ = false;
@@ -38,38 +64,8 @@ void Fl_Surface_Device::set_current(void)
_surface = this;
}
-FL_EXPORT Fl_Graphics_Driver *fl_graphics_driver; // the current target device of graphics operations
Fl_Surface_Device* Fl_Surface_Device::_surface; // the current target surface of graphics operations
-const Fl_Graphics_Driver::matrix Fl_Graphics_Driver::m0 = {1, 0, 0, 1, 0, 0};
-
-Fl_Graphics_Driver::Fl_Graphics_Driver() {
- font_ = 0;
- size_ = 0;
- sptr=0; rstackptr=0;
- rstack[0] = NULL;
- fl_clip_state_number=0;
- m = m0;
- fl_matrix = &m;
- p = (XPOINT *)0;
- font_descriptor_ = NULL;
- p_size = 0;
-};
-
-void Fl_Graphics_Driver::text_extents(const char*t, int n, int& dx, int& dy, int& w, int& h)
-{
- w = (int)width(t, n);
- h = - height();
- dx = 0;
- dy = descent();
-}
-
-void Fl_Graphics_Driver::focus_rect(int x, int y, int w, int h)
-{
- line_style(FL_DOT);
- rect(x, y, w, h);
- line_style(FL_SOLID);
-}
/** A constructor that sets the graphics driver used by the display */
Fl_Display_Device::Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device(graphics_driver) {
@@ -92,6 +88,7 @@ Fl_Surface_Device *Fl_Surface_Device::default_surface()
Fl_Display_Device *Fl_Display_Device::_display = Fl_Display_Device::display_device();
+
//
// End of "$Id$".
//