diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2016-02-09 18:25:02 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2016-02-09 18:25:02 +0000 |
| commit | 41e22f2f39f6b9a53d5248669e531e6c8e36a421 (patch) | |
| tree | 48dd8a971667ae53be38524e3d4d27fa92ded326 /src/Fl_Graphics_Driver.cxx | |
| parent | dee0f5a82452da4334f269ceaee01f2d3df01bc0 (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_Graphics_Driver.cxx')
| -rw-r--r-- | src/Fl_Graphics_Driver.cxx | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx new file mode 100644 index 000000000..365f1df5e --- /dev/null +++ b/src/Fl_Graphics_Driver.cxx @@ -0,0 +1,69 @@ +// +// "$Id$" +// +// implementation of Fl_Device class for the Fast Light Tool Kit (FLTK). +// +// Copyright 2010-2012 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// http://www.fltk.org/COPYING.php +// +// Please report all bugs and problems to: +// +// http://www.fltk.org/str.php +// + +#include <FL/Fl.H> +#include "config_lib.h" +#include <FL/Fl_Graphics_Driver.H> +#include <FL/Fl_Image.H> +#include <FL/fl_draw.H> + +const char *Fl_Graphics_Driver::class_id = "Fl_Graphics_Driver"; + +FL_EXPORT Fl_Graphics_Driver *fl_graphics_driver; // the current target device 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); +} + +/** Draws an Fl_Image scaled to width \p W & height \p H with top-left corner at \em X,Y + \return zero when the graphics driver doesn't implement scaled drawing, non-zero if it does implement it. + */ +int Fl_Graphics_Driver::draw_scaled(Fl_Image *img, int X, int Y, int W, int H) { + return 0; +} + + +// +// End of "$Id$". +// |
