summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiemm/oimagescrollview.cpp31
-rw-r--r--libopie2/opiemm/oimagescrollview.h13
2 files changed, 19 insertions, 25 deletions
diff --git a/libopie2/opiemm/oimagescrollview.cpp b/libopie2/opiemm/oimagescrollview.cpp
index 30a8fba..61b2062 100644
--- a/libopie2/opiemm/oimagescrollview.cpp
+++ b/libopie2/opiemm/oimagescrollview.cpp
@@ -8,5 +8,4 @@
#include <qimage.h>
#include <qlayout.h>
-#include <qpe/qcopenvelope_qws.h>
/* for usage with the bitset */
@@ -111,12 +110,5 @@ void OImageScrollView::loadJpeg(bool interncall)
}
if (real_load) {
- {
- QCopEnvelope( "QPE/System", "busy()" );
- }
_original_data = iio.read() ? iio.image() : QImage();
- {
- QCopEnvelope env( "QPE/System", "notBusy(QString)" );
- env << "Image loaded";
- }
}
}
@@ -133,15 +125,8 @@ void OImageScrollView::setImage( const QString& path ) {
loadJpeg();
} else {
- {
- QCopEnvelope( "QPE/System", "busy()" );
- }
setImageIsJpeg(false);
_original_data.load(path);
_original_data.convertDepth(QPixmap::defaultDepth());
_original_data.setAlphaBuffer(false);
- {
- QCopEnvelope env( "QPE/System", "notBusy(QString)" );
- env << "Image loaded";
- }
}
_image_data = QImage();
@@ -201,10 +186,13 @@ bool OImageScrollView::AutoRotate()const
}
+void OImageScrollView::setAutoScaleRotate(bool scale, bool rotate)
+{
+ m_states.setBit(AUTO_ROTATE,rotate);
+ setAutoScale(scale);
+}
+
void OImageScrollView::setAutoScale(bool how)
{
m_states.setBit(AUTO_SCALE,how);
- if (!how) {
- setAutoRotate(false);
- }
_image_data = QImage();
if (ImageIsJpeg() && how == false && ImageScaledLoaded()==true) {
@@ -359,7 +347,4 @@ void OImageScrollView::generateImage()
return;
}
- {
- QCopEnvelope( "QPE/System", "busy()" );
- }
if (width()>height()&&_original_data.width()<_original_data.height() ||
width()<height()&&_original_data.width()>_original_data.height()) {
@@ -409,8 +394,4 @@ void OImageScrollView::generateImage()
*/
_image_data=QImage();
- {
- QCopEnvelope env( "QPE/System", "notBusy(QString)" );
- env << "Image generated";
- }
}
diff --git a/libopie2/opiemm/oimagescrollview.h b/libopie2/opiemm/oimagescrollview.h
index 94fddb6..01a2d56 100644
--- a/libopie2/opiemm/oimagescrollview.h
+++ b/libopie2/opiemm/oimagescrollview.h
@@ -89,4 +89,17 @@ public:
virtual void setAutoScale(bool how);
/**
+ * set if the image should be scaled to the size of the viewport if larger(!)
+ * and/or rotate to best fit. You avoid double repainting when you want to switch
+ * booth values.
+ *
+ * if autoscaling is set when loading a jpeg image, it will use a feature of
+ * jpeg lib to load the image scaled to display size. If switch of later the
+ * image will reloaded.
+ *
+ * @param scale true - display image scaled down otherwise not
+ * @param rotate true - the image will rotate for best fit
+ */
+ virtual void setAutoScaleRotate(bool scale, bool rotate);
+ /**
* set if there should be displayed a small zoomer widget at the right bottom of
* the view when the image is larger than the viewport.