author | alwin <alwin> | 2004-04-05 14:50:26 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-05 14:50:26 (UTC) |
commit | 35c73e46c62f60596037c85a5545e13e4488b81f (patch) (side-by-side diff) | |
tree | 06de71fd29cee295b5cfccefd69ef94767b5f186 /noncore/graphics/opie-eye/gui/imagescrollview.h | |
parent | f44b1d4abe82cfb74db68bffcaf240f6f6134708 (diff) | |
download | opie-35c73e46c62f60596037c85a5545e13e4488b81f.zip opie-35c73e46c62f60596037c85a5545e13e4488b81f.tar.gz opie-35c73e46c62f60596037c85a5545e13e4488b81f.tar.bz2 |
integrated first implementation of rotation/scaling
Diffstat (limited to 'noncore/graphics/opie-eye/gui/imagescrollview.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imagescrollview.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/imagescrollview.h b/noncore/graphics/opie-eye/gui/imagescrollview.h index edea235..e25f955 100644 --- a/noncore/graphics/opie-eye/gui/imagescrollview.h +++ b/noncore/graphics/opie-eye/gui/imagescrollview.h @@ -9,29 +9,48 @@ class QPainter; class ImageScrollView:public QScrollView { Q_OBJECT public: - ImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0 ); - ImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0 ); + ImageScrollView (const QImage&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false ); + ImageScrollView (const QString&, QWidget * parent=0, const char * name=0, WFlags f=0,bool always_scale=false,bool rfit=false ); virtual ~ImageScrollView(); void setImage(const QImage&); + + enum Rotation { + Rotate0, + Rotate90, + Rotate180, + Rotate270 + }; + protected: virtual void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ); void init(); QImage _image_data; + QImage _original_data; int _mouseStartPosX,_mouseStartPosY; + bool scale_to_fit; + bool rotate_to_fit; + bool first_resize_done; + Rotation last_rot; + + void rescaleImage(int w, int h); + + void rotate_into_data(Rotation r); + protected slots: virtual void viewportMouseMoveEvent(QMouseEvent* e); virtual void contentsMousePressEvent ( QMouseEvent * e); virtual void contentsMouseReleaseEvent ( QMouseEvent * e); + virtual void resizeEvent(QResizeEvent * e); }; /* for testing */ class ImageDlg:public QDialog { Q_OBJECT |