summaryrefslogtreecommitdiff
path: root/src/Fl_Shared_Image.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-01-27 18:11:20 +0000
committerManolo Gouy <Manolo>2016-01-27 18:11:20 +0000
commit8e3f66073f8e30e874eb3e6cf76ab0a614c39aad (patch)
treede1aaad8e102b792439c7cdef6dbb826d6d1ae90 /src/Fl_Shared_Image.cxx
parent1c4661c4816d9e9b8cc37165a554a4d60c5339da (diff)
1) Added a new way to detect whether the drawing operation is using the platform's native driver
and whether we are printing: virtual int Fl_Graphics_Driver::has_feature(driver_feature feature) This is also because it is not convenient to derive a printer-specific driver with its own implementation of virtual functions when this implementation differs only in one line of code. 2) Solved the problem of inclusion of non public header by the public header FL/Fl_Device.H: bracket this with #if FL_LIBRARY / #endif so this non public header is included only when building FLTK itself. 3) Removed several (but not all) of the FLTK_ABI_VERSION guards that are no longer useful for code targeting FLTK 1.4. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11063 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Shared_Image.cxx')
-rw-r--r--src/Fl_Shared_Image.cxx15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx
index 13a0eb5bc..757c51b42 100644
--- a/src/Fl_Shared_Image.cxx
+++ b/src/Fl_Shared_Image.cxx
@@ -90,9 +90,7 @@ Fl_Shared_Image::Fl_Shared_Image() : Fl_Image(0,0,0) {
original_ = 0;
image_ = 0;
alloc_image_ = 0;
-#if FLTK_ABI_VERSION >= 10304
scaled_image_= 0;
-#endif
}
@@ -113,9 +111,7 @@ Fl_Shared_Image::Fl_Shared_Image(const char *n, // I - Filename
image_ = img;
alloc_image_ = !img;
original_ = 1;
-#if FLTK_ABI_VERSION >= 10304
scaled_image_= 0;
-#endif
if (!img) reload();
else update();
@@ -177,9 +173,7 @@ Fl_Shared_Image::update() {
Fl_Shared_Image::~Fl_Shared_Image() {
if (name_) delete[] (char *)name_;
if (alloc_image_) delete image_;
-#if FLTK_ABI_VERSION >= 10304
delete scaled_image_;
-#endif
}
@@ -328,7 +322,6 @@ Fl_Shared_Image::desaturate() {
// 'Fl_Shared_Image::draw()' - Draw a shared image...
//
void Fl_Shared_Image::draw(int X, int Y, int W, int H, int cx, int cy) {
-#if FLTK_ABI_VERSION >= 10304
if (!image_) {
Fl_Image::draw(X, Y, W, H, cx, cy);
return;
@@ -357,10 +350,6 @@ void Fl_Shared_Image::draw(int X, int Y, int W, int H, int cx, int cy) {
scaled_image_->draw(X-cx, Y-cy, scaled_image_->w(), scaled_image_->h(), 0, 0);
}
fl_pop_clip();
-#else
- if (image_) image_->draw(X, Y, W, H, cx, cy);
- else Fl_Image::draw(X, Y, W, H, cx, cy);
-#endif // FLTK_ABI_VERSION
}
/** Sets the drawing size of the shared image.
@@ -375,7 +364,7 @@ void Fl_Shared_Image::draw(int X, int Y, int W, int H, int cx, int cy) {
\param proportional if not null, keep the width and height of the shared image proportional to those of its original image
\param can_expand if null, the width and height of the shared image will not exceed those of the original image
- \version 1.3.4 and requires compiling with FLTK_ABI_VERSION = 10304
+ \version 1.3.4 and requires compiling with FL_ABI_VERSION = 10304
Example code: scale an image to fit in a box
\code
@@ -388,7 +377,6 @@ void Fl_Shared_Image::draw(int X, int Y, int W, int H, int cx, int cy) {
*/
void Fl_Shared_Image::scale(int width, int height, int proportional, int can_expand)
{
-#if FLTK_ABI_VERSION >= 10304
w(width);
h(height);
if (!image_) return;
@@ -404,7 +392,6 @@ void Fl_Shared_Image::scale(int width, int height, int proportional, int can_exp
}
w(image_->w() / fw);
h(image_->h() / fh);
-#endif
}