diff options
author | Jed Barber <jjbarber@y7mail.com> | 2017-07-28 10:45:20 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2017-07-28 10:45:20 +1000 |
commit | 1e761c7b4491377fe9c91a37c438856178cc4f8e (patch) | |
tree | 2db00fc8f8179703dcf7ae6b3e3d22f6ae777b61 /src/c_fl_image.cpp | |
parent | fb37523537cdb69a31dede401a604981ce8b7b9d (diff) |
Finished up FLTK.Images and partially complete derivatives
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); +} + |