• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

Fl_Image_Surface.H

00001 //
00002 // "$Id$"
00003 //
00004 // Draw-to-image code for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 1998-2014 by Bill Spitzak and others.
00007 //
00008 // This library is free software. Distribution and use rights are outlined in
00009 // the file "COPYING" which should have been included with this file.  If this
00010 // file is missing or damaged, see the license at:
00011 //
00012 //     http://www.fltk.org/COPYING.php
00013 //
00014 // Please report all bugs and problems on the following page:
00015 //
00016 //     http://www.fltk.org/str.php
00017 //
00018 
00019 #ifndef Fl_Image_Surface_H
00020 #define Fl_Image_Surface_H
00021 
00022 #include <FL/Fl_Copy_Surface.H>
00023 #include <FL/Fl_Image.H>
00024 #include <FL/Fl_Shared_Image.H>
00025 
00026 
00047 class FL_EXPORT Fl_Image_Surface : public Fl_Surface_Device {
00048 private:
00049   void prepare_(int w, int h, int highres);
00050   Fl_Offscreen offscreen;
00051   int width;
00052   int height;
00053   Fl_Paged_Device *helper;
00054 #ifdef __APPLE__
00055 #elif defined(WIN32)
00056   HDC _sgc; 
00057   Window _sw; 
00058   Fl_Surface_Device *_ss;
00059   int _savedc;
00060 #else
00061   Fl_Surface_Device *previous;
00062   Window pre_window;
00063   GC gc;
00064 #endif
00065 public:
00066   static const char *class_id;
00067   const char *class_name() {return class_id;};
00068 #if FLTK_ABI_VERSION >= 10304 || defined(FL_DOXYGEN)
00069   Fl_Image_Surface(int w, int h, int highres = 0);
00070 #else
00071   Fl_Image_Surface(int w, int h, int highres);
00072   Fl_Image_Surface(int w, int h);
00073 #endif
00074   ~Fl_Image_Surface();
00075   void set_current();
00076   void draw(Fl_Widget*, int delta_x = 0, int delta_y = 0);
00077   void draw_decorated_window(Fl_Window* win, int delta_x = 0, int delta_y = 0);
00078   Fl_RGB_Image *image();
00079   Fl_Shared_Image *highres_image();
00080 };
00081 
00082 #ifdef __APPLE__
00083 /* Mac class to implement translate()/untranslate() for a flipped bitmap graphics context */
00084 class FL_EXPORT Fl_Quartz_Flipped_Surface_ : public Fl_Quartz_Surface_ {
00085 public:
00086   static const char *class_id;
00087   const char *class_name() {return class_id;};
00088   Fl_Quartz_Flipped_Surface_(int w, int h);
00089   void translate(int x, int y);
00090   void untranslate();
00091   virtual ~Fl_Quartz_Flipped_Surface_() {};
00092 };
00093 #endif 
00094 
00095 #endif // Fl_Image_Surface_H
00096 
00097 //
00098 // End of "$Id$".
00099 //
  • © 1998-2016 by Bill Spitzak and others.     FLTK

  • © 1998-2016 by Bill Spitzak and others.     FLTK

    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.