FLTK Imago
Main Page | Class List | File List | Class Members | File Members

Fl_SVG_Image.H

Go to the documentation of this file.
00001 // 00002 // This file is part of the FLTK Imago project 00003 // Copyright (C) 2002-2005 Chris Osgood 00004 // https://gurumeditation.org 00005 // 00006 // "$Id: Fl_SVG_Image.H 62 2005-01-10 01:22:40Z chris $" 00007 // 00008 // SVG image header file for the Fast Light Tool Kit (FLTK). 00009 // 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Library General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2 of the License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Library General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Library General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA. 00024 // 00025 // Please report all bugs and problems to "1qp1z0e8 at duck.com" 00026 // 00027 00028 #ifndef Fl_SVG_Image_H 00029 #define Fl_SVG_Image_H 00030 00031 #include <FL/Fl_Image.H> 00032 #include <stdlib.h> 00033 00034 #ifndef IMAGO_EXPORT 00035 #define IMAGO_EXPORT 00036 #endif 00037 00038 class Fl_SVG_Image : public Fl_RGB_Image 00039 { 00040 private: 00041 void* svgcontext_; // SVG-Cairo context 00042 int pt_width_; // Image width in "points" (actual size from SVG file) 00043 int pt_height_; // Image height in "points" (actual size from SVG file) 00044 int draw_width_; // Width image was drawn at 00045 int draw_height_; // Height image was drawn at 00046 00047 public: 00048 IMAGO_EXPORT Fl_SVG_Image(const char* bits, size_t len, int W=0, int H=0); 00049 IMAGO_EXPORT Fl_SVG_Image(const char* filename, int W=0, int H=0); 00050 IMAGO_EXPORT virtual ~Fl_SVG_Image(); 00051 00052 IMAGO_EXPORT int pt_width() const { return pt_width_; } 00053 IMAGO_EXPORT int pt_height() const { return pt_height_; } 00054 IMAGO_EXPORT void size(int W, int H) { w(W); h(H); } 00055 IMAGO_EXPORT void destroy(); 00056 IMAGO_EXPORT int svgdata(const char* data, size_t len); 00057 IMAGO_EXPORT virtual void draw(int XP, int YP, int WP, int HP, int cx, int cy); 00058 IMAGO_EXPORT bool hit(int at_x, int at_y, int thresh = 1); 00059 00060 protected: 00061 static char* Fl_SVG_Image::decompGZ(const char* in, size_t size); 00062 }; 00063 00064 #endif // Fl_SVG_Image_H

Generated on Mon Jan 10 16:50:17 2005 for FLTK Imago by doxygen 1.3.7