diff options
Diffstat (limited to 'src/c_fl_image.cpp')
-rw-r--r-- | src/c_fl_image.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/c_fl_image.cpp b/src/c_fl_image.cpp index 3323c25..f3daf7f 100644 --- a/src/c_fl_image.cpp +++ b/src/c_fl_image.cpp @@ -6,6 +6,14 @@ +class My_Image : public Fl_Image { + public: + friend void fl_image_draw_empty(IMAGE i, int x, int y); +}; + + + + IMAGE new_fl_image(int w, int h, int d) { Fl_Image *i = new Fl_Image(w, h, d); return i; @@ -41,6 +49,19 @@ void fl_image_inactive(IMAGE i) { reinterpret_cast<Fl_Image*>(i)->inactive(); } +int fl_image_fail(IMAGE i) { + switch (reinterpret_cast<Fl_Image*>(i)->fail()) { + case Fl_Image::ERR_NO_IMAGE: + return 1; + case Fl_Image::ERR_FILE_ACCESS: + return 2; + case Fl_Image::ERR_FORMAT: + return 3; + default: + return 0; + } +} + @@ -56,3 +77,18 @@ int fl_image_d(IMAGE i) { return reinterpret_cast<Fl_Image*>(i)->d(); } + + + +void fl_image_draw(IMAGE i, int x, int y) { + reinterpret_cast<Fl_Image*>(i)->draw(x, y); +} + +void fl_image_draw2(IMAGE i, int x, int y, int w, int h, int cx, int cy) { + reinterpret_cast<Fl_Image*>(i)->draw(x, y, w, h, cx, cy); +} + +void fl_image_draw_empty(IMAGE i, int x, int y) { + reinterpret_cast<My_Image*>(i)->draw_empty(x, y); +} + |