00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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_;
00042
int pt_width_;
00043
int pt_height_;
00044
int draw_width_;
00045
int draw_height_;
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