author | alwin <alwin> | 2005-03-23 19:28:15 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-23 19:28:15 (UTC) |
commit | 7f2338c33a3dd22d7f851909fb023a9364fdafd0 (patch) (unidiff) | |
tree | d39ed1ff22f535c43b6c43f097c3b9eb02ad3b37 /noncore/multimedia/showimg | |
parent | 76ea5ee6e306a4ee9fe6831dbe4c13ee53f6cdf5 (diff) | |
download | opie-7f2338c33a3dd22d7f851909fb023a9364fdafd0.zip opie-7f2338c33a3dd22d7f851909fb023a9364fdafd0.tar.gz opie-7f2338c33a3dd22d7f851909fb023a9364fdafd0.tar.bz2 |
showimg -> unsupported
-rw-r--r-- | noncore/multimedia/showimg/.cvsignore | 4 | ||||
-rw-r--r-- | noncore/multimedia/showimg/ImageFileSelector.cpp | 262 | ||||
-rw-r--r-- | noncore/multimedia/showimg/ImageFileSelector.h | 134 | ||||
-rw-r--r-- | noncore/multimedia/showimg/README | 14 | ||||
-rw-r--r-- | noncore/multimedia/showimg/config.in | 4 | ||||
-rw-r--r-- | noncore/multimedia/showimg/main.cpp | 28 | ||||
-rw-r--r-- | noncore/multimedia/showimg/opie-showimg.control | 11 | ||||
-rw-r--r-- | noncore/multimedia/showimg/settingsdialog.cpp | 86 | ||||
-rw-r--r-- | noncore/multimedia/showimg/settingsdialog.h | 49 | ||||
-rw-r--r-- | noncore/multimedia/showimg/settingsdialogbase.cpp | 102 | ||||
-rw-r--r-- | noncore/multimedia/showimg/settingsdialogbase.h | 45 | ||||
-rw-r--r-- | noncore/multimedia/showimg/showimg.cpp | 1242 | ||||
-rw-r--r-- | noncore/multimedia/showimg/showimg.h | 289 | ||||
-rw-r--r-- | noncore/multimedia/showimg/showimg.pro | 9 |
14 files changed, 0 insertions, 2279 deletions
diff --git a/noncore/multimedia/showimg/.cvsignore b/noncore/multimedia/showimg/.cvsignore deleted file mode 100644 index 93b952d..0000000 --- a/noncore/multimedia/showimg/.cvsignore +++ b/dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | Makefile* | ||
2 | moc_* | ||
3 | .moc | ||
4 | .obj | ||
diff --git a/noncore/multimedia/showimg/ImageFileSelector.cpp b/noncore/multimedia/showimg/ImageFileSelector.cpp deleted file mode 100644 index 53cc883..0000000 --- a/noncore/multimedia/showimg/ImageFileSelector.cpp +++ b/dev/null | |||
@@ -1,262 +0,0 @@ | |||
1 | #include "ImageFileSelector.h" | ||
2 | |||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | #include <qpe/qpeapplication.h> | ||
6 | using namespace Opie::Core; | ||
7 | |||
8 | /* QT */ | ||
9 | #include <qlabel.h> | ||
10 | #include <qfileinfo.h> | ||
11 | |||
12 | /* STD */ | ||
13 | #include <stdlib.h> | ||
14 | |||
15 | ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w) | ||
16 | : QWidget( parent ),fl(f) | ||
17 | { | ||
18 | setBackgroundMode(NoBackground); | ||
19 | if ( w!=-1 ) | ||
20 | setMinimumSize(w,p.height()+24); | ||
21 | else | ||
22 | setMinimumSize(p.width(),p.height()+24); | ||
23 | description=new QLabel(text,this); | ||
24 | description->setBackgroundColor(colorGroup().base()); | ||
25 | description->setAlignment(AlignCenter); | ||
26 | description->setGeometry(0,height()-24,width(),24); | ||
27 | pixmap=p; | ||
28 | } | ||
29 | |||
30 | void ThumbWidget::resizeEvent(QResizeEvent *) | ||
31 | { | ||
32 | description->setGeometry(0,height()-24,width(),24); | ||
33 | } | ||
34 | |||
35 | void ThumbWidget::paintEvent( QPaintEvent *e ) | ||
36 | { | ||
37 | QPainter painter(this); | ||
38 | |||
39 | painter.setClipRect(e->rect()); | ||
40 | painter.fillRect(0,0,width(),height(),QColor(255,255,255)); | ||
41 | painter.drawPixmap((width() - pixmap.width()) / 2,0, pixmap); | ||
42 | |||
43 | } | ||
44 | |||
45 | void ThumbWidget::mouseReleaseEvent(QMouseEvent* ) | ||
46 | { | ||
47 | emit clicked(fl); | ||
48 | } | ||
49 | |||
50 | |||
51 | |||
52 | ImageFileSelectorItem::ImageFileSelectorItem( QListView *parent, const DocLnk &f) | ||
53 | : QListViewItem( parent ), fl( f ) | ||
54 | { | ||
55 | setText( 0, f.name() ); | ||
56 | QFileInfo fi(f.file()); | ||
57 | setText( 1, (fi.extension()).upper() ); | ||
58 | setPixmap( 0, f.pixmap() ); | ||
59 | |||
60 | |||
61 | } | ||
62 | |||
63 | |||
64 | ImageFileSelectorItem::~ImageFileSelectorItem() | ||
65 | { | ||
66 | |||
67 | } | ||
68 | |||
69 | |||
70 | ImageFileSelector::ImageFileSelector( CURRENT_VIEW scv,QWidget *parent,const char * ) | ||
71 | : QWidgetStack(parent) | ||
72 | { | ||
73 | |||
74 | detailed=new QListView(this); | ||
75 | |||
76 | detailed->addColumn (tr("Title")); | ||
77 | detailed->addColumn (tr("Type")); | ||
78 | detailed->setAllColumnsShowFocus( true ); | ||
79 | |||
80 | tList.setAutoDelete(true); | ||
81 | |||
82 | thumb =new QScrollView(this); | ||
83 | thumb->setVScrollBarMode (QScrollView::Auto ); | ||
84 | thumb->viewport()->setBackgroundColor(colorGroup().base()); | ||
85 | |||
86 | background=new QWidget(0); | ||
87 | background->setBackgroundColor(colorGroup().base()); | ||
88 | thumb->addChild(background); | ||
89 | gl = new QGridLayout(background,1,2,4,4); | ||
90 | |||
91 | |||
92 | |||
93 | connect( detailed, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ), | ||
94 | this, SLOT( fileClicked(int,QListViewItem*,const QPoint&,int) ) ); | ||
95 | connect( detailed, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ), | ||
96 | this, SLOT( filePressed(int,QListViewItem*,const QPoint&,int) ) ); | ||
97 | connect( detailed, SIGNAL( returnPressed(QListViewItem*) ), | ||
98 | this, SLOT( fileClicked(QListViewItem*) ) ); | ||
99 | |||
100 | cView=UNKNOWN; | ||
101 | setView(scv); | ||
102 | reread(); | ||
103 | |||
104 | } | ||
105 | ImageFileSelector::~ImageFileSelector() | ||
106 | { | ||
107 | |||
108 | } | ||
109 | |||
110 | |||
111 | void ImageFileSelector::switchView() | ||
112 | { | ||
113 | CURRENT_VIEW v=cView; | ||
114 | |||
115 | if ( v==DETAILED ) | ||
116 | v=THUMBNAIL; | ||
117 | else | ||
118 | v=DETAILED; | ||
119 | setView(v); | ||
120 | } | ||
121 | |||
122 | void ImageFileSelector::setView(CURRENT_VIEW v) | ||
123 | { | ||
124 | |||
125 | if ( v==cView ) | ||
126 | return; | ||
127 | cView=v; | ||
128 | |||
129 | if ( cView!=DETAILED ) | ||
130 | { | ||
131 | raiseWidget(thumb); | ||
132 | updateSizes(); | ||
133 | } | ||
134 | else | ||
135 | { | ||
136 | raiseWidget(detailed); | ||
137 | updateSizes(); | ||
138 | } | ||
139 | |||
140 | |||
141 | } | ||
142 | |||
143 | void ImageFileSelector::resizeEvent(QResizeEvent *) | ||
144 | { | ||
145 | updateSizes(); | ||
146 | } | ||
147 | |||
148 | void ImageFileSelector::updateSizes() | ||
149 | { | ||
150 | int ww=(detailed->width()-detailed->frameWidth()*2); | ||
151 | double w=(double)ww*0.70; | ||
152 | detailed->setColumnWidth(0,(int)w); | ||
153 | detailed->setColumnWidth(1,ww-(int)w); | ||
154 | background->setMinimumWidth(thumb->visibleWidth()); | ||
155 | thumb->updateScrollBars(); | ||
156 | } | ||
157 | |||
158 | void ImageFileSelector::reread(bool) | ||
159 | { | ||
160 | // odebug << "reread" << oendl; | ||
161 | ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem(); | ||
162 | QString oldFile; | ||
163 | if ( item ) | ||
164 | oldFile = item->file().file(); | ||
165 | detailed->clear(); | ||
166 | tList.clear(); | ||
167 | DocLnkSet files; | ||
168 | Global::findDocuments(&files, "image/*"); | ||
169 | count = files.children().count(); | ||
170 | QListIterator<DocLnk> dit( files.children() ); | ||
171 | // int y=0; | ||
172 | // int x=4; | ||
173 | // int totalHeight=4; | ||
174 | ThumbWidget *l=0; | ||
175 | int width=80; | ||
176 | gl->expand(dit.count()/2,2); | ||
177 | int i,j; | ||
178 | i=j=0; | ||
179 | detailed->setUpdatesEnabled(false); | ||
180 | thumb->setUpdatesEnabled(false); | ||
181 | |||
182 | for ( ; dit.current(); ++dit ) { | ||
183 | item = new ImageFileSelectorItem( detailed, **dit ); | ||
184 | if ( item->file().file() == oldFile ) | ||
185 | detailed->setCurrentItem( item ); | ||
186 | } | ||
187 | |||
188 | QListViewItemIterator it( detailed ); | ||
189 | ImageFileSelectorItem *ii; | ||
190 | // iterate through all items of the listview | ||
191 | for ( ; it.current(); ++it ) { | ||
192 | ii=(ImageFileSelectorItem *)it.current(); | ||
193 | QImage img( ii->file().file() ); | ||
194 | if( !img.isNull()) { | ||
195 | img=img.smoothScale(64,64); | ||
196 | QPixmap pix; | ||
197 | pix.convertFromImage(img); | ||
198 | l=new ThumbWidget(pix,ii->file().name(),ii->file(),background,width); | ||
199 | l->setBackgroundColor(colorGroup().base()); | ||
200 | gl->addWidget(l,j,i); | ||
201 | i++; | ||
202 | if ( i==2 ) { | ||
203 | i=0; | ||
204 | j++; | ||
205 | } | ||
206 | tList.append(l); | ||
207 | connect(l,SIGNAL(clicked(const DocLnk&)),this,SLOT(thumbClicked(const DocLnk&))); | ||
208 | } | ||
209 | } | ||
210 | |||
211 | if ( !detailed->selectedItem() ) | ||
212 | detailed->setCurrentItem( detailed->firstChild() ); | ||
213 | |||
214 | detailed->setUpdatesEnabled(true); | ||
215 | thumb->setUpdatesEnabled(true); | ||
216 | detailed->update(); | ||
217 | thumb->update(); | ||
218 | } | ||
219 | |||
220 | int ImageFileSelector::fileCount() | ||
221 | { | ||
222 | return count; | ||
223 | } | ||
224 | const DocLnk * ImageFileSelector::selected() | ||
225 | { | ||
226 | odebug << "image selected" << oendl; | ||
227 | ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem(); | ||
228 | if ( item ) | ||
229 | return new DocLnk( item->file() ); | ||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | |||
234 | |||
235 | void ImageFileSelector::fileClicked( int button, QListViewItem *i, const QPoint &, int ) | ||
236 | { | ||
237 | if ( !i ) | ||
238 | return; | ||
239 | if ( button == Qt::LeftButton ) | ||
240 | { | ||
241 | fileClicked( i ); | ||
242 | } | ||
243 | } | ||
244 | // pressed to get 'right down' | ||
245 | void ImageFileSelector::filePressed( int, QListViewItem *, const QPoint &, int ) | ||
246 | { | ||
247 | |||
248 | } | ||
249 | void ImageFileSelector::fileClicked( QListViewItem *i) | ||
250 | { | ||
251 | if ( !i ) | ||
252 | return; | ||
253 | emit fileSelected( ( (ImageFileSelectorItem*)i )->file() ); | ||
254 | emit closeMe(); | ||
255 | } | ||
256 | |||
257 | void ImageFileSelector::thumbClicked(const DocLnk &f) | ||
258 | { | ||
259 | emit fileSelected( f ); | ||
260 | emit closeMe(); | ||
261 | } | ||
262 | |||
diff --git a/noncore/multimedia/showimg/ImageFileSelector.h b/noncore/multimedia/showimg/ImageFileSelector.h deleted file mode 100644 index 798ebcc..0000000 --- a/noncore/multimedia/showimg/ImageFileSelector.h +++ b/dev/null | |||
@@ -1,134 +0,0 @@ | |||
1 | #ifndef IMAGEFILE_SELECTOR_H | ||
2 | #define IMAGEFILE_SELECTOR_H | ||
3 | |||
4 | |||
5 | #include <qtoolbutton.h> | ||
6 | #include <qlistview.h> | ||
7 | #include <qwidgetstack.h> | ||
8 | #include <qlayout.h> | ||
9 | |||
10 | #include "qpe/filemanager.h" | ||
11 | #include "qpe/applnk.h" | ||
12 | |||
13 | class QScrollView; | ||
14 | class QLabel; | ||
15 | //class QValueList; | ||
16 | |||
17 | class ThumbWidget : public QWidget | ||
18 | { | ||
19 | Q_OBJECT | ||
20 | public: | ||
21 | ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent=0,int width=-1); | ||
22 | ~ThumbWidget() { } | ||
23 | |||
24 | DocLnk file() const { | ||
25 | return fl; | ||
26 | } | ||
27 | |||
28 | |||
29 | signals: | ||
30 | void clicked(const DocLnk &); | ||
31 | |||
32 | protected: | ||
33 | void paintEvent( QPaintEvent * ); | ||
34 | void resizeEvent(QResizeEvent *); | ||
35 | |||
36 | void mouseReleaseEvent(QMouseEvent* event); | ||
37 | |||
38 | private: | ||
39 | QPixmap pixmap; | ||
40 | QLabel *description; | ||
41 | DocLnk fl; | ||
42 | }; | ||
43 | |||
44 | |||
45 | |||
46 | |||
47 | class ImageFileSelectorItem : public QListViewItem | ||
48 | { | ||
49 | public: | ||
50 | ImageFileSelectorItem( QListView *parent, const DocLnk& f ); | ||
51 | ~ImageFileSelectorItem(); | ||
52 | |||
53 | DocLnk file() const { | ||
54 | return fl; | ||
55 | } | ||
56 | private: | ||
57 | DocLnk fl; | ||
58 | }; | ||
59 | |||
60 | class ImageFileSelector : public QWidgetStack | ||
61 | { | ||
62 | Q_OBJECT | ||
63 | |||
64 | public: | ||
65 | |||
66 | enum CURRENT_VIEW { | ||
67 | THUMBNAIL, | ||
68 | DETAILED, | ||
69 | UNKNOWN | ||
70 | }; | ||
71 | |||
72 | |||
73 | ImageFileSelector(CURRENT_VIEW scv=DETAILED, QWidget *parent=0, const char *name=0 ); | ||
74 | ~ImageFileSelector(); | ||
75 | |||
76 | void reread(bool purgeCache=false); | ||
77 | int fileCount(); | ||
78 | const DocLnk *selected(); | ||
79 | |||
80 | void setView(CURRENT_VIEW v); | ||
81 | |||
82 | CURRENT_VIEW view() { | ||
83 | return cView; | ||
84 | } | ||
85 | |||
86 | QValueList<DocLnk> fileList() const { | ||
87 | ((ImageFileSelector*)this)->fileCount(); // ensure all loaded when this is extended | ||
88 | QValueList<DocLnk> list; | ||
89 | ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->firstChild(); | ||
90 | while (item) { | ||
91 | list.append(item->file()); | ||
92 | item = (ImageFileSelectorItem *)item->nextSibling(); | ||
93 | } | ||
94 | return list; | ||
95 | } | ||
96 | |||
97 | public slots: | ||
98 | |||
99 | void switchView(); | ||
100 | |||
101 | signals: | ||
102 | void fileSelected( const DocLnk & ); | ||
103 | void closeMe(); | ||
104 | |||
105 | protected: | ||
106 | |||
107 | void resizeEvent(QResizeEvent *); | ||
108 | |||
109 | |||
110 | private slots: | ||
111 | void fileClicked( int, QListViewItem *, const QPoint &, int ); | ||
112 | // pressed to get 'right down' | ||
113 | void filePressed( int, QListViewItem *, const QPoint &, int ); | ||
114 | void fileClicked( QListViewItem *); | ||
115 | void thumbClicked(const DocLnk &); | ||
116 | |||
117 | private: | ||
118 | |||
119 | void updateSizes(); | ||
120 | |||
121 | |||
122 | CURRENT_VIEW cView; | ||
123 | int count; | ||
124 | |||
125 | QListView *detailed; | ||
126 | QScrollView *thumb; | ||
127 | QList<ThumbWidget> tList; | ||
128 | QWidget *background; | ||
129 | QGridLayout *gl; | ||
130 | |||
131 | }; | ||
132 | #endif // IMAGEFILE_SELECTOR_H | ||
133 | |||
134 | |||
diff --git a/noncore/multimedia/showimg/README b/noncore/multimedia/showimg/README deleted file mode 100644 index a6c9ca9..0000000 --- a/noncore/multimedia/showimg/README +++ b/dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | This example demonstrates how to read in and display images, and the | ||
2 | conversion facilities available. The CuteWidget can read a file into | ||
3 | a pixmap and resizes the displayed pixmap when the widget is resized. | ||
4 | |||
5 | Note that the function CuteWidget::paintEvent uses the drawPixmap function | ||
6 | of QPainter to display the pixmap, the bitBlt function can also be used to | ||
7 | display pixmaps. | ||
8 | |||
9 | If you have installed the Qt imageio extension (see extensions/imageio | ||
10 | in your Qt directory), you can build using that extension. | ||
11 | |||
12 | Some of the conversion options will have no effect, depending on the | ||
13 | display hardware used. Generally, these are disabled. | ||
14 | |||
diff --git a/noncore/multimedia/showimg/config.in b/noncore/multimedia/showimg/config.in deleted file mode 100644 index 808c841..0000000 --- a/noncore/multimedia/showimg/config.in +++ b/dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | config SHOWIMG | ||
2 | boolean "opie-showimg (image viewer)" | ||
3 | default "y" | ||
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI | ||
diff --git a/noncore/multimedia/showimg/main.cpp b/noncore/multimedia/showimg/main.cpp deleted file mode 100644 index b7ea071..0000000 --- a/noncore/multimedia/showimg/main.cpp +++ b/dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include "showimg.h" | ||
22 | |||
23 | |||
24 | #include <opie2/oapplicationfactory.h> | ||
25 | |||
26 | using namespace Opie::Core; | ||
27 | using namespace Opie::Core; | ||
28 | OPIE_EXPORT_APP( OApplicationFactory<ImageViewer> ) | ||
diff --git a/noncore/multimedia/showimg/opie-showimg.control b/noncore/multimedia/showimg/opie-showimg.control deleted file mode 100644 index 2fbfabc..0000000 --- a/noncore/multimedia/showimg/opie-showimg.control +++ b/dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | Package: opie-showimg | ||
2 | Files: plugins/application/libshowimg.so* bin/showimg apps/Applications/showimg.desktop pics/imageviewer | ||
3 | Priority: optional | ||
4 | Section: opie/applications | ||
5 | Maintainer: Opie Team <opie@handhelds.org> | ||
6 | Architecture: arm | ||
7 | Depends: task-opie-minimal,libopiecore2, libopieui2 | ||
8 | Description: Image Viewer | ||
9 | The image viewer for the Opie environment. Supports | ||
10 | all graphics formats are compiled into Qt/Embedded (eg. PNG). | ||
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/multimedia/showimg/settingsdialog.cpp b/noncore/multimedia/showimg/settingsdialog.cpp deleted file mode 100644 index 202bd0c..0000000 --- a/noncore/multimedia/showimg/settingsdialog.cpp +++ b/dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include "settingsdialog.h" | ||
22 | #include <qslider.h> | ||
23 | #include <qlabel.h> | ||
24 | #include <qcheckbox.h> | ||
25 | |||
26 | SettingsDialog::SettingsDialog( QWidget *parent, const char *name, bool modal, WFlags f ) | ||
27 | : SettingsDialogBase( parent, name, modal, f ) | ||
28 | { | ||
29 | connect( delaySlider, SIGNAL(valueChanged(int)), this, SLOT(delayChanged(int)) ); | ||
30 | } | ||
31 | |||
32 | void SettingsDialog::setDelay( int d ) | ||
33 | { | ||
34 | delaySlider->setValue( d ); | ||
35 | delayChanged( d ); | ||
36 | } | ||
37 | |||
38 | int SettingsDialog::delay() const | ||
39 | { | ||
40 | return delaySlider->value(); | ||
41 | } | ||
42 | |||
43 | void SettingsDialog::setRepeat( bool r ) | ||
44 | { | ||
45 | repeatCheck->setChecked( r ); | ||
46 | } | ||
47 | |||
48 | bool SettingsDialog::repeat() const | ||
49 | { | ||
50 | return repeatCheck->isChecked(); | ||
51 | } | ||
52 | |||
53 | void SettingsDialog::delayChanged( int d ) | ||
54 | { | ||
55 | delayText->setText( QString::number( d ) + " s" ); | ||
56 | } | ||
57 | |||
58 | void SettingsDialog::setReverse(bool r) | ||
59 | { | ||
60 | reverseCheck->setChecked(r); | ||
61 | } | ||
62 | |||
63 | bool SettingsDialog::reverse() const | ||
64 | { | ||
65 | return reverseCheck->isChecked(); | ||
66 | } | ||
67 | |||
68 | void SettingsDialog::setRotate(bool r) | ||
69 | { | ||
70 | rotateCheck->setChecked(r); | ||
71 | } | ||
72 | |||
73 | bool SettingsDialog::rotate() const | ||
74 | { | ||
75 | return rotateCheck->isChecked(); | ||
76 | } | ||
77 | |||
78 | void SettingsDialog::setFastLoad(bool f) | ||
79 | { | ||
80 | fastLoadCheck->setChecked(f); | ||
81 | } | ||
82 | |||
83 | bool SettingsDialog::fastLoad() const | ||
84 | { | ||
85 | return fastLoadCheck->isChecked(); | ||
86 | } | ||
diff --git a/noncore/multimedia/showimg/settingsdialog.h b/noncore/multimedia/showimg/settingsdialog.h deleted file mode 100644 index 0f47990..0000000 --- a/noncore/multimedia/showimg/settingsdialog.h +++ b/dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef SETTINGSDIALOG_H | ||
22 | #define SETTINGSDIALOG_H | ||
23 | |||
24 | #include "settingsdialogbase.h" | ||
25 | |||
26 | class SettingsDialog : public SettingsDialogBase | ||
27 | { | ||
28 | Q_OBJECT | ||
29 | public: | ||
30 | |||
31 | SettingsDialog( QWidget * parent=0, const char * name=0, bool modal=FALSE, WFlags f=0 ); | ||
32 | |||
33 | void setDelay( int d ); | ||
34 | int delay() const; | ||
35 | void setRepeat( bool r ); | ||
36 | bool repeat() const; | ||
37 | void setReverse( bool r ); | ||
38 | bool reverse() const; | ||
39 | void setRotate(bool r); | ||
40 | bool rotate() const; | ||
41 | void setFastLoad(bool f); | ||
42 | bool fastLoad() const; | ||
43 | |||
44 | private slots: | ||
45 | void delayChanged( int ); | ||
46 | }; | ||
47 | |||
48 | |||
49 | #endif | ||
diff --git a/noncore/multimedia/showimg/settingsdialogbase.cpp b/noncore/multimedia/showimg/settingsdialogbase.cpp deleted file mode 100644 index 7a64e89..0000000 --- a/noncore/multimedia/showimg/settingsdialogbase.cpp +++ b/dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'settingsdialogbase.ui' | ||
3 | ** | ||
4 | ** Created: Sun Nov 3 07:29:03 2002 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "settingsdialogbase.h" | ||
10 | |||
11 | #include <qcheckbox.h> | ||
12 | #include <qgroupbox.h> | ||
13 | #include <qlabel.h> | ||
14 | #include <qslider.h> | ||
15 | #include <qlayout.h> | ||
16 | |||
17 | /* | ||
18 | * Constructs a SettingsDialogBase which is a child of 'parent', with the | ||
19 | * name 'name' and widget flags set to 'f' | ||
20 | * | ||
21 | * The dialog will by default be modeless, unless you set 'modal' to | ||
22 | * TRUE to construct a modal dialog. | ||
23 | */ | ||
24 | SettingsDialogBase::SettingsDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl ) | ||
25 | : QDialog( parent, name, modal, fl ) | ||
26 | { | ||
27 | if ( !name ) | ||
28 | setName( "SettingsDialogBase" ); | ||
29 | resize( 246, 201 ); | ||
30 | setCaption( tr( "Preferences" ) ); | ||
31 | SettingsDialogBaseLayout = new QVBoxLayout( this ); | ||
32 | SettingsDialogBaseLayout->setSpacing( 6 ); | ||
33 | SettingsDialogBaseLayout->setMargin( 6 ); | ||
34 | |||
35 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); | ||
36 | GroupBox1->setTitle( tr( "Slide Show" ) ); | ||
37 | GroupBox1->setColumnLayout(0, Qt::Vertical ); | ||
38 | GroupBox1->layout()->setSpacing( 0 ); | ||
39 | GroupBox1->layout()->setMargin( 0 ); | ||
40 | GroupBox1Layout = new QVBoxLayout( GroupBox1->layout() ); | ||
41 | GroupBox1Layout->setAlignment( Qt::AlignTop ); | ||
42 | GroupBox1Layout->setSpacing( 6 ); | ||
43 | GroupBox1Layout->setMargin( 11 ); | ||
44 | |||
45 | Layout3 = new QGridLayout; | ||
46 | Layout3->setSpacing( 6 ); | ||
47 | Layout3->setMargin( 0 ); | ||
48 | |||
49 | TextLabel1 = new QLabel( GroupBox1, "TextLabel1" ); | ||
50 | TextLabel1->setText( tr( "Delay between pictures" ) ); | ||
51 | |||
52 | Layout3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); | ||
53 | |||
54 | delaySlider = new QSlider( GroupBox1, "delaySlider" ); | ||
55 | delaySlider->setMinValue( 2 ); | ||
56 | delaySlider->setMaxValue( 60 ); | ||
57 | delaySlider->setLineStep( 2 ); | ||
58 | delaySlider->setOrientation( QSlider::Horizontal ); | ||
59 | delaySlider->setTickmarks( QSlider::Right ); | ||
60 | delaySlider->setTickInterval( 10); | ||
61 | |||
62 | Layout3->addWidget( delaySlider, 1, 0 ); | ||
63 | |||
64 | delayText = new QLabel( GroupBox1, "delayText" ); | ||
65 | delayText->setMinimumSize( QSize( 25, 0 ) ); | ||
66 | delayText->setText( tr( "s" ) ); | ||
67 | delayText->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | ||
68 | |||
69 | Layout3->addWidget( delayText, 1, 1 ); | ||
70 | GroupBox1Layout->addLayout( Layout3 ); | ||
71 | |||
72 | repeatCheck = new QCheckBox( GroupBox1, "repeatCheck" ); | ||
73 | repeatCheck->setText( tr( "Repeat slideshow" ) ); | ||
74 | GroupBox1Layout->addWidget( repeatCheck ); | ||
75 | |||
76 | reverseCheck = new QCheckBox( GroupBox1, "reverseCheck" ); | ||
77 | reverseCheck->setText( tr( "Show pictures in reverse" ) ); | ||
78 | GroupBox1Layout->addWidget( reverseCheck ); | ||
79 | SettingsDialogBaseLayout->addWidget( GroupBox1 ); | ||
80 | |||
81 | rotateCheck = new QCheckBox( this, "rotateCheck" ); | ||
82 | rotateCheck->setText( tr( "Load pictures rotated 90 degrees" ) ); | ||
83 | SettingsDialogBaseLayout->addWidget( rotateCheck ); | ||
84 | |||
85 | fastLoadCheck = new QCheckBox( this, "fastLoadCheck" ); | ||
86 | fastLoadCheck->setText( tr( "Fast load pictures" ) ); | ||
87 | SettingsDialogBaseLayout->addWidget( fastLoadCheck ); | ||
88 | fastLoadCheck->hide(); //FIXME | ||
89 | // QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); | ||
90 | // layout->addItem( spacer, 10, 0 ); | ||
91 | |||
92 | |||
93 | } | ||
94 | |||
95 | /* | ||
96 | * Destroys the object and frees any allocated resources | ||
97 | */ | ||
98 | SettingsDialogBase::~SettingsDialogBase() | ||
99 | { | ||
100 | // no need to delete child widgets, Qt does it all for us | ||
101 | } | ||
102 | |||
diff --git a/noncore/multimedia/showimg/settingsdialogbase.h b/noncore/multimedia/showimg/settingsdialogbase.h deleted file mode 100644 index 9594ec6..0000000 --- a/noncore/multimedia/showimg/settingsdialogbase.h +++ b/dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form interface generated from reading ui file 'settingsdialogbase.ui' | ||
3 | ** | ||
4 | ** Created: Sun Nov 3 07:29:03 2002 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #ifndef SETTINGSDIALOGBASE_H | ||
10 | #define SETTINGSDIALOGBASE_H | ||
11 | |||
12 | #include <qvariant.h> | ||
13 | #include <qdialog.h> | ||
14 | class QVBoxLayout; | ||
15 | class QHBoxLayout; | ||
16 | class QGridLayout; | ||
17 | class QCheckBox; | ||
18 | class QGroupBox; | ||
19 | class QLabel; | ||
20 | class QSlider; | ||
21 | |||
22 | class SettingsDialogBase : public QDialog | ||
23 | { | ||
24 | Q_OBJECT | ||
25 | |||
26 | public: | ||
27 | SettingsDialogBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | ||
28 | ~SettingsDialogBase(); | ||
29 | |||
30 | QGroupBox* GroupBox1; | ||
31 | QLabel* TextLabel1; | ||
32 | QSlider* delaySlider; | ||
33 | QLabel* delayText; | ||
34 | QCheckBox* repeatCheck; | ||
35 | QCheckBox* reverseCheck; | ||
36 | QCheckBox* rotateCheck; | ||
37 | QCheckBox* fastLoadCheck; | ||
38 | |||
39 | protected: | ||
40 | QVBoxLayout* SettingsDialogBaseLayout; | ||
41 | QVBoxLayout* GroupBox1Layout; | ||
42 | QGridLayout* Layout3; | ||
43 | }; | ||
44 | |||
45 | #endif // SETTINGSDIALOGBASE_H | ||
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp deleted file mode 100644 index 24377ed..0000000 --- a/noncore/multimedia/showimg/showimg.cpp +++ b/dev/null | |||
@@ -1,1242 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | // | ||
22 | // Full-screen and rotation options contributed by Robert Wittams <robert@wittams.com> | ||
23 | // | ||
24 | |||
25 | #include "showimg.h" | ||
26 | #include "ImageFileSelector.h" | ||
27 | #include "settingsdialog.h" | ||
28 | |||
29 | /* OPIE */ | ||
30 | #include <opie2/odebug.h> | ||
31 | #include <opie2/ofiledialog.h> | ||
32 | #include <qpe/qpeapplication.h> | ||
33 | #include <qpe/config.h> | ||
34 | #include <qpe/resource.h> | ||
35 | using namespace Opie::Core; | ||
36 | using namespace Opie::Ui; | ||
37 | |||
38 | /* QT */ | ||
39 | #include <qtoolbar.h> | ||
40 | #include <qaction.h> | ||
41 | #include <qfiledialog.h> | ||
42 | #include <qmenubar.h> | ||
43 | #include <qspinbox.h> | ||
44 | |||
45 | /* STD */ | ||
46 | #include <math.h> | ||
47 | |||
48 | ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) | ||
49 | : QDialog(parent,0,true) | ||
50 | { | ||
51 | setCaption(caption); | ||
52 | |||
53 | if ( parent ) { | ||
54 | setPalette(parent->palette()); | ||
55 | } | ||
56 | |||
57 | b=brightness; | ||
58 | img=image; | ||
59 | |||
60 | setMinimumSize(140,80); | ||
61 | |||
62 | QGridLayout *gl= new QGridLayout(this,2,2,4,4); | ||
63 | |||
64 | pixmap =new ImageWidget(this);; | ||
65 | QPixmap pm; | ||
66 | pm.convertFromImage(img); | ||
67 | pixmap->setPixmap(pm); | ||
68 | pixmap->setMinimumSize(pm.width(),pm.height()); | ||
69 | gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter); | ||
70 | QLabel *l=new QLabel(tr("Brightness")+":",this); | ||
71 | gl->addWidget(l,1,0,AlignLeft); | ||
72 | spb=new QSpinBox(-100,100,2,this); | ||
73 | gl->addWidget(spb,1,1,AlignRight); | ||
74 | |||
75 | spb->setValue(0); | ||
76 | |||
77 | connect(spb,SIGNAL(valueChanged(int)),this, SLOT(bValueChanged(int))); | ||
78 | |||
79 | } | ||
80 | |||
81 | void ControlsDialog::bValueChanged(int value) | ||
82 | { | ||
83 | QImage nImage=img; | ||
84 | nImage.detach(); | ||
85 | ImageViewer::intensity(nImage, (float)value/100); | ||
86 | QPixmap pm; | ||
87 | pm.convertFromImage(nImage); | ||
88 | pixmap->setPixmap(pm); | ||
89 | pixmap->repaint(false); | ||
90 | |||
91 | |||
92 | } | ||
93 | |||
94 | void ControlsDialog::accept() | ||
95 | { | ||
96 | *b=spb->value(); | ||
97 | done(1); | ||
98 | } | ||
99 | |||
100 | //=========================================================================== | ||
101 | |||
102 | InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *parent) | ||
103 | : QDialog(parent,0,true) | ||
104 | { | ||
105 | setCaption(caption); | ||
106 | |||
107 | if ( parent ) | ||
108 | { | ||
109 | setPalette(parent->palette()); | ||
110 | } | ||
111 | |||
112 | |||
113 | |||
114 | QString labels[]={ tr("File Name"),tr("Format"),tr("File Size"),tr("Size"),tr("Colors"),tr("Alpha") }; | ||
115 | |||
116 | setMinimumSize(180,80); | ||
117 | int num=ImageViewer::LAST+1; | ||
118 | if ( text[ImageViewer::ALPHA].isEmpty() ) | ||
119 | num--; | ||
120 | QGridLayout *gl= new QGridLayout(this,num,2,4,2); | ||
121 | QLabel *l; | ||
122 | int count=0; | ||
123 | for ( int i=0;i<num;i++ ) | ||
124 | { | ||
125 | if ( i==1 ) | ||
126 | { | ||
127 | QFrame *frm=new QFrame(this); | ||
128 | frm->setFrameStyle(QFrame::HLine|QFrame::Sunken); | ||
129 | gl->addMultiCellWidget(frm,i,i,0,1); | ||
130 | } | ||
131 | else | ||
132 | { | ||
133 | l=new QLabel( tr( labels[count] )+":",this); | ||
134 | gl->addWidget(l,i,0,AlignLeft); | ||
135 | l=new QLabel(text[count],this); | ||
136 | gl->addWidget(l,i,1,AlignRight); | ||
137 | count++; | ||
138 | } | ||
139 | |||
140 | } | ||
141 | |||
142 | } | ||
143 | |||
144 | void InfoDialog::displayInfo(const QString &caption, const QStringList text, QWidget *parent) | ||
145 | { | ||
146 | InfoDialog *dlg=new InfoDialog(caption,text,parent); | ||
147 | dlg->exec(); | ||
148 | delete dlg; | ||
149 | } | ||
150 | |||
151 | //=========================================================================== | ||
152 | |||
153 | |||
154 | ImagePane::ImagePane( QWidget *parent ) : QWidget( parent ) | ||
155 | { | ||
156 | vb = new QVBoxLayout( this ); | ||
157 | |||
158 | image = new QScrollView(this,0,WResizeNoErase|WNorthWestGravity); | ||
159 | pic=new ImageWidget(image); | ||
160 | image->addChild(pic); | ||
161 | |||
162 | connect(pic, SIGNAL( clicked() ), this, SLOT( imageClicked() )); | ||
163 | |||
164 | vb->addWidget( image ); | ||
165 | |||
166 | } | ||
167 | |||
168 | void ImagePane::setPixmap( const QPixmap &pm ) | ||
169 | { | ||
170 | pic->setPixmap( pm ); | ||
171 | pic->resize(pm.width(),pm.height()); | ||
172 | image->updateScrollBars (); | ||
173 | pic->repaint(false); | ||
174 | } | ||
175 | |||
176 | void ImagePane::imageClicked() | ||
177 | { | ||
178 | emit clicked(); | ||
179 | } | ||
180 | //=========================================================================== | ||
181 | /* | ||
182 | Draws the portion of the scaled pixmap that needs to be updated | ||
183 | */ | ||
184 | |||
185 | void ImageWidget::paintEvent( QPaintEvent *e ) | ||
186 | { | ||
187 | QPainter painter(this); | ||
188 | |||
189 | painter.setClipRect(e->rect()); | ||
190 | painter.fillRect(0,0,width(),height(),QColor(0,0,0)); | ||
191 | |||
192 | if ( pixmap.size() != QSize( 0, 0 ) ) | ||
193 | { // is an image loaded? | ||
194 | painter.drawPixmap((width() - pixmap.width()) / 2, (height() - pixmap.height()) / 2, pixmap); | ||
195 | } | ||
196 | } | ||
197 | |||
198 | void ImageWidget::mouseReleaseEvent(QMouseEvent *) | ||
199 | { | ||
200 | emit clicked(); | ||
201 | } | ||
202 | |||
203 | //=========================================================================== | ||
204 | |||
205 | ImageViewer::ImageViewer( QWidget *parent, const char *name, int /*wFlags*/ ) | ||
206 | : QMainWindow( parent, name, WResizeNoErase ), filename( 0 ), bFromDocView( FALSE ) | ||
207 | { | ||
208 | setCaption( tr("Image Viewer") ); | ||
209 | setIcon( Resource::loadPixmap( "ImageViewer" ) ); | ||
210 | |||
211 | |||
212 | Config cfg("Image Viewer"); | ||
213 | cfg.setGroup("Image Viewer"); | ||
214 | |||
215 | showThumbView=cfg.readBoolEntry("ShowThumbnails",false); | ||
216 | isSized=cfg.readBoolEntry("SizeToScreen",true); | ||
217 | |||
218 | isFullScreen = FALSE; | ||
219 | |||
220 | setToolBarsMovable( FALSE ); | ||
221 | |||
222 | toolBar = new QToolBar( this ); | ||
223 | toolBar->setHorizontalStretchable( TRUE ); | ||
224 | |||
225 | menuBar = new QMenuBar( toolBar ); | ||
226 | |||
227 | current=menuBar; | ||
228 | |||
229 | |||
230 | |||
231 | fileMenuFile = new QPopupMenu(this); | ||
232 | //menuBarmenubarFile->insertItem( tr("File"), fileMenu ); | ||
233 | fileMenuFile->insertItem(tr("Open"), | ||
234 | this, SLOT(openFile()), 0); | ||
235 | |||
236 | viewMenuFile = new QPopupMenu( this ); | ||
237 | //menubarFile->insertItem( tr("View"), viewMenu ); | ||
238 | viewMenuFile->insertItem( tr("Thumbnail View"), | ||
239 | this, SLOT(switchThumbView()), 0, SHOW_THUMBNAILS ); | ||
240 | |||
241 | viewMenuFile->setItemChecked ( SHOW_THUMBNAILS, showThumbView ); | ||
242 | |||
243 | |||
244 | |||
245 | |||
246 | optionsMenuFile = new QPopupMenu( this); | ||
247 | //menubarFile->insertItem( tr("Options"),optionsMenu ); | ||
248 | slideAction = new QAction( tr( "Slide show" ), Resource::loadIconSet( "slideshow" ), | ||
249 | QString::null, 0, this, 0 ); | ||
250 | slideAction->setToggleAction( TRUE ); | ||
251 | connect( slideAction, SIGNAL( toggled(bool) ), this, SLOT( slideShow(bool) ) ); | ||
252 | slideAction->addTo( optionsMenuFile); | ||
253 | // slideAction->addTo( toolBar ); | ||
254 | |||
255 | |||
256 | // optionsMenuFile->insertItem( tr("Slideshow") ); | ||
257 | optionsMenuFile->insertSeparator(); | ||
258 | optionsMenuFile->insertItem( tr("Preferences.."), this, SLOT(settings()), 0); | ||
259 | // optionsMenuFile->insertItem( tr("Help"), this, SLOT(help()), 0); | ||
260 | |||
261 | QStrList fmt = QImage::outputFormats(); | ||
262 | |||
263 | |||
264 | fileMenuView = new QPopupMenu( this ); | ||
265 | //menubarView->insertItem( tr("File"),fileMenu ); | ||
266 | fileMenuView->insertItem( tr("Image Info ..."),this, SLOT(displayInfoDialog()),0 ); | ||
267 | fileMenuView->insertSeparator(); | ||
268 | |||
269 | viewMenuView = new QPopupMenu(this ); | ||
270 | viewMenuView->setCheckable ( true ); | ||
271 | |||
272 | //menubarView->insertItem( tr("View"),viewMenu ); | ||
273 | viewMenuView->insertItem(tr("Horizontal flip"), this, SLOT(hFlip()), 0); | ||
274 | viewMenuView->insertItem(tr("Vertical flip"), this, SLOT(vFlip()), 0); | ||
275 | |||
276 | stack = new QWidgetStack( this ); | ||
277 | stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); | ||
278 | setCentralWidget( stack ); | ||
279 | |||
280 | |||
281 | imagePanel = new ImagePane( stack ); | ||
282 | connect(imagePanel, SIGNAL(clicked()), this, SLOT(normalView())); | ||
283 | |||
284 | |||
285 | ImageFileSelector::CURRENT_VIEW cv; | ||
286 | if(showThumbView) | ||
287 | cv=ImageFileSelector::THUMBNAIL; | ||
288 | else | ||
289 | cv=ImageFileSelector::DETAILED; | ||
290 | |||
291 | odebug << "cv = " << cv << "" << oendl; | ||
292 | |||
293 | fileSelector = new ImageFileSelector( cv,stack, "fs"); | ||
294 | |||
295 | //switchThumbView(); | ||
296 | |||
297 | |||
298 | //fileSelector = new ImageFileSelector("image/*", stack, "fs"); | ||
299 | //fileSelector->setNewVisible(FALSE); | ||
300 | //fileSelector->setCloseVisible(FALSE); | ||
301 | connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( closeFileSelector() ) ); | ||
302 | connect( fileSelector, SIGNAL( fileSelected(const DocLnk&) ), | ||
303 | this, SLOT( openFile(const DocLnk&) ) ); | ||
304 | |||
305 | imageList = fileSelector->fileList(); | ||
306 | slideAction->setEnabled( imageList.count() != 0); | ||
307 | |||
308 | iconToolBar = new QToolBar(this); | ||
309 | |||
310 | QAction *a; | ||
311 | |||
312 | a = new QAction( tr( "Open ..." ), Resource::loadPixmap( "fileopen" ), QString::null, 0, this, 0 ); | ||
313 | connect( a, SIGNAL( activated() ), this, SLOT( open() ) ); | ||
314 | a->addTo( fileMenuView); | ||
315 | a->addTo( iconToolBar ); | ||
316 | |||
317 | |||
318 | a = new QAction( tr( "Rotate 90"), Resource::loadPixmap( "rotate90" ), QString::null, 0, this, 0); | ||
319 | connect( a, SIGNAL( activated() ), this, SLOT( rot90() ) ); | ||
320 | a->addTo( iconToolBar ); | ||
321 | a->addTo( viewMenuView ); | ||
322 | |||
323 | a = new QAction( tr( "Rotate 180" ), Resource::loadPixmap( "repeat" ), QString::null, 0, this, 0 ); | ||
324 | connect( a, SIGNAL( activated() ), this, SLOT( rot180() ) ); | ||
325 | a->addTo( iconToolBar ); | ||
326 | a->addTo( viewMenuView ); | ||
327 | |||
328 | |||
329 | a = new QAction( tr( "Rotate 270"), Resource::loadPixmap( "rotate270" ), QString::null, 0, this, 0); | ||
330 | connect( a, SIGNAL( activated() ), this, SLOT( rot270() ) ); | ||
331 | //a->addTo( iconToolBar ); | ||
332 | a->addTo( viewMenuView ); | ||
333 | |||
334 | |||
335 | |||
336 | viewMenuView->insertSeparator(); | ||
337 | viewMenuView->insertItem(tr("Brightness ..."), this, SLOT(displayControlsDialog()), 0); | ||
338 | viewMenuView->insertItem(tr("Black And White"), this, SLOT(blackAndWhite()), 0,BLACKANDWHITE); | ||
339 | viewMenuView->insertSeparator(); | ||
340 | |||
341 | |||
342 | sss = new QAction( tr( "Scale to Screen"), Resource::loadPixmap( "scale" ), QString::null, 0, this, 0,true); | ||
343 | connect( sss, SIGNAL( activated() ), this, SLOT( switchSizeToScreen() ) ); | ||
344 | sss->addTo( iconToolBar ); | ||
345 | sss->addTo( viewMenuView ); | ||
346 | |||
347 | sss->setOn(isSized); | ||
348 | viewMenuView->insertSeparator(); | ||
349 | |||
350 | |||
351 | a = new QAction( tr( "Fullscreen" ), Resource::loadPixmap( "fullscreen" ), | ||
352 | QString::null, 0, this, 0 ); | ||
353 | connect( a, SIGNAL( activated() ), this, SLOT( fullScreen() ) ); | ||
354 | a->addTo( iconToolBar ); | ||
355 | a->addTo( viewMenuView); | ||
356 | |||
357 | a = new QAction( tr( "Stop Slideshow" ), Resource::loadPixmap( "quit_icon" ), | ||
358 | QString::null, 0, this, 0 ); | ||
359 | connect( a, SIGNAL( activated() ), this, SLOT( stopSlideShow() ) ); | ||
360 | a->addTo( iconToolBar ); | ||
361 | a->addTo( viewMenuView); | ||
362 | |||
363 | |||
364 | Config config( "ImageViewer" ); | ||
365 | config.setGroup( "SlideShow" ); | ||
366 | slideDelay = config.readNumEntry( "Delay", 2); | ||
367 | slideRepeat = config.readBoolEntry( "Repeat", FALSE ); | ||
368 | slideReverse = config.readBoolEntry("Reverse", FALSE); | ||
369 | |||
370 | config.setGroup("Default"); | ||
371 | rotateOnLoad = config.readBoolEntry("Rotate", FALSE); | ||
372 | fastLoad = config.readBoolEntry("FastLoad", TRUE); | ||
373 | slideTimer = new QTimer( this ); | ||
374 | connect( slideTimer, SIGNAL(timeout()), this, SLOT(slideUpdate()) ); | ||
375 | |||
376 | switchToFileSelector(); | ||
377 | |||
378 | setMouseTracking( TRUE ); | ||
379 | |||
380 | |||
381 | } | ||
382 | |||
383 | ImageViewer::~ImageViewer() | ||
384 | { | ||
385 | Config cfg("Image Viewer"); | ||
386 | cfg.setGroup("Image Viewer"); | ||
387 | |||
388 | cfg.writeEntry("ShowThumbnails",(int)showThumbView); | ||
389 | cfg.writeEntry("SizeToScreen",(int)isSized); | ||
390 | |||
391 | cfg.setGroup( "SlideShow" ); | ||
392 | cfg.writeEntry( "Delay", slideDelay); | ||
393 | cfg.writeEntry( "Repeat", slideRepeat ); | ||
394 | cfg.writeEntry("Reverse", slideReverse); | ||
395 | |||
396 | cfg.setGroup("Default"); | ||
397 | cfg.writeEntry("Rotate", rotateOnLoad); | ||
398 | cfg.writeEntry("FastLoad", fastLoad); | ||
399 | |||
400 | delete imagePanel; // in case it is fullscreen | ||
401 | } | ||
402 | |||
403 | void ImageViewer::help() { | ||
404 | |||
405 | } | ||
406 | |||
407 | |||
408 | void ImageViewer::settings() | ||
409 | { | ||
410 | SettingsDialog dlg( this, 0, TRUE ); | ||
411 | dlg.setDelay( slideDelay ); | ||
412 | dlg.setRepeat( slideRepeat ); | ||
413 | dlg.setReverse( slideReverse ); | ||
414 | dlg.setRotate(rotateOnLoad); | ||
415 | dlg.setFastLoad(fastLoad); | ||
416 | |||
417 | if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) { | ||
418 | odebug << "<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>" << oendl; | ||
419 | slideDelay = dlg.delay(); | ||
420 | slideRepeat = dlg.repeat(); | ||
421 | slideReverse = dlg.reverse(); | ||
422 | rotateOnLoad = dlg.rotate(); | ||
423 | fastLoad = dlg.fastLoad(); | ||
424 | |||
425 | Config config( "ImageViewer" ); | ||
426 | config.setGroup( "SlideShow" ); | ||
427 | config.writeEntry( "Delay", slideDelay ); | ||
428 | config.writeEntry( "Repeat", slideRepeat ); | ||
429 | config.writeEntry("Reverse", slideReverse); | ||
430 | |||
431 | config.setGroup("Default"); | ||
432 | config.writeEntry("Rotate", rotateOnLoad); | ||
433 | config.writeEntry("FastLoad", fastLoad); | ||
434 | } | ||
435 | } | ||
436 | |||
437 | void ImageViewer::switchSizeToScreen() | ||
438 | { | ||
439 | isSized=!isSized; | ||
440 | sss->setOn(isSized); | ||
441 | updateImage(); | ||
442 | } | ||
443 | |||
444 | void ImageViewer::updateImage() | ||
445 | { | ||
446 | if ( isSized ) { | ||
447 | imagePanel->setPixmap(pmScaled); | ||
448 | } else { | ||
449 | imagePanel->setPixmap(pm); | ||
450 | } | ||
451 | } | ||
452 | |||
453 | void ImageViewer::switchThumbView() | ||
454 | { | ||
455 | |||
456 | showThumbView=!showThumbView; | ||
457 | viewMenuFile->setItemChecked ( SHOW_THUMBNAILS, showThumbView ); | ||
458 | fileSelector->switchView(); | ||
459 | |||
460 | } | ||
461 | |||
462 | void ImageViewer::switchToFileSelector() | ||
463 | { | ||
464 | stack->raiseWidget(fileSelector); | ||
465 | menuBar->clear(); | ||
466 | menuBar->insertItem( tr("File"), fileMenuFile ); | ||
467 | menuBar->insertItem( tr("View"), viewMenuFile ); | ||
468 | menuBar->insertItem( tr("Options"), optionsMenuFile ); | ||
469 | iconToolBar->hide(); | ||
470 | imagePanel->disable(); | ||
471 | slideShow(false); | ||
472 | |||
473 | } | ||
474 | |||
475 | void ImageViewer::switchToImageView() | ||
476 | { | ||
477 | stack->raiseWidget(imagePanel); | ||
478 | |||
479 | menuBar->clear(); | ||
480 | menuBar->insertItem( tr("File"), fileMenuView ); | ||
481 | menuBar->insertItem( tr("View"), viewMenuView ); | ||
482 | viewMenuView->setItemEnabled(BLACKANDWHITE,true); | ||
483 | iconToolBar->show(); | ||
484 | |||
485 | imagePanel->setPosition(0,0); | ||
486 | |||
487 | } | ||
488 | |||
489 | |||
490 | void ImageViewer::setDocument(const QString& fileref) | ||
491 | { | ||
492 | delayLoad = fileref; | ||
493 | switchToImageView(); | ||
494 | QTimer::singleShot( 0, this, SLOT(doDelayedLoad()) ); | ||
495 | } | ||
496 | |||
497 | void ImageViewer::doDelayedLoad() | ||
498 | { | ||
499 | show(delayLoad); | ||
500 | } | ||
501 | |||
502 | void ImageViewer::show() | ||
503 | { | ||
504 | normalView(); | ||
505 | QMainWindow::show(); | ||
506 | } | ||
507 | |||
508 | void ImageViewer::show(const QString& fileref) | ||
509 | { | ||
510 | // odebug << "Show "+fileref << oendl; | ||
511 | bFromDocView = TRUE; | ||
512 | closeFileSelector(); | ||
513 | DocLnk link(fileref); | ||
514 | if ( link.isValid() ) { | ||
515 | openFile(link); | ||
516 | } else { | ||
517 | filename = fileref; | ||
518 | updateCaption( fileref ); | ||
519 | loadImage( fileref ); | ||
520 | } | ||
521 | } | ||
522 | |||
523 | void ImageViewer::openFile() { | ||
524 | MimeTypes types; | ||
525 | QStringList image; | ||
526 | image << "image/*"; | ||
527 | types.insert("Images", image); | ||
528 | |||
529 | QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); | ||
530 | DocLnk link(str); | ||
531 | // if ( link.isValid() ) | ||
532 | openFile(link); | ||
533 | |||
534 | } | ||
535 | |||
536 | void ImageViewer::openFile( const DocLnk &link ) | ||
537 | { | ||
538 | closeFileSelector(); | ||
539 | // DocLnk link(file); | ||
540 | odebug << "open "+link.name() << oendl; | ||
541 | updateCaption( link.name() ); | ||
542 | loadImage( link.file() ); | ||
543 | if (slideTimer->isActive()) { | ||
544 | slideTimer->start(slideDelay * 1000, FALSE); | ||
545 | } | ||
546 | |||
547 | } | ||
548 | |||
549 | void ImageViewer::open() | ||
550 | { | ||
551 | switchToFileSelector(); | ||
552 | } | ||
553 | |||
554 | void ImageViewer::closeFileSelector() | ||
555 | { | ||
556 | switchToImageView(); | ||
557 | } | ||
558 | |||
559 | void ImageViewer::updateCaption( QString name ) | ||
560 | { | ||
561 | int sep = name.findRev( '/' ); | ||
562 | if ( sep >= 0 ) | ||
563 | name = name.mid( sep+1 ); | ||
564 | setCaption( name + tr(" - Image Viewer") ); | ||
565 | } | ||
566 | |||
567 | /* | ||
568 | This function loads an image from a file. | ||
569 | */ | ||
570 | |||
571 | void ImageViewer::loadImage( const char *fileName ) | ||
572 | { | ||
573 | filename = fileName; | ||
574 | if ( filename ) { | ||
575 | QApplication::setOverrideCursor( waitCursor ); // this might take time | ||
576 | //imagePanel->statusLabel()->setText( tr("Loading image...") ); | ||
577 | qApp->processEvents(); | ||
578 | bool ok = image.load(filename, 0); | ||
579 | if ( ok ) { | ||
580 | ok = reconvertImage(); | ||
581 | updateImageInfo(filename); | ||
582 | } | ||
583 | if ( !ok ) { | ||
584 | pm.resize(0,0); // couldn't load image | ||
585 | update(); | ||
586 | } | ||
587 | QApplication::restoreOverrideCursor(); // restore original cursor | ||
588 | } | ||
589 | |||
590 | // fastLoad ? ", Fast" : "", | ||
591 | // fastLoad ? QMAX(imagewidth/maxsize, imageheight/maxsize) : 1); | ||
592 | |||
593 | |||
594 | // matrix.reset(); | ||
595 | rotated90 = FALSE; | ||
596 | |||
597 | if (rotateOnLoad) { | ||
598 | rotated90 = TRUE; | ||
599 | rot90(); | ||
600 | // matrix.rotate( -90.0 ); | ||
601 | } | ||
602 | |||
603 | switchToImageView(); | ||
604 | updateImage(); | ||
605 | |||
606 | } | ||
607 | |||
608 | bool ImageViewer::loadSelected() | ||
609 | { | ||
610 | bool ok = false; | ||
611 | if ( stack->visibleWidget() == fileSelector ) | ||
612 | { | ||
613 | const DocLnk *link = fileSelector->selected(); | ||
614 | if ( link ) | ||
615 | { | ||
616 | if ( link->file() != filename ) | ||
617 | { | ||
618 | updateCaption( link->name() ); | ||
619 | filename = link->file(); | ||
620 | qApp->processEvents(); | ||
621 | ok = image.load(filename, 0); | ||
622 | if ( ok ) | ||
623 | { | ||
624 | updateImageInfo(filename); | ||
625 | ok = reconvertImage(); | ||
626 | } | ||
627 | if ( !ok ) | ||
628 | pm.resize(0,0); | ||
629 | } | ||
630 | } | ||
631 | } | ||
632 | if ( !image.isNull() ) | ||
633 | { | ||
634 | ok = true; | ||
635 | closeFileSelector(); | ||
636 | } | ||
637 | |||
638 | return ok; | ||
639 | } | ||
640 | |||
641 | bool ImageViewer::reconvertImage() | ||
642 | { | ||
643 | bool success = FALSE; | ||
644 | |||
645 | if ( image.isNull() ) return FALSE; | ||
646 | |||
647 | QApplication::setOverrideCursor( waitCursor ); // this might take time | ||
648 | if ( pm.convertFromImage(image /*, conversion_flags */ ) ) | ||
649 | { | ||
650 | pmScaled = QPixmap(); | ||
651 | scale(); | ||
652 | success = TRUE; // load successful | ||
653 | } | ||
654 | else | ||
655 | { | ||
656 | pm.resize(0,0); // couldn't load image | ||
657 | } | ||
658 | QApplication::restoreOverrideCursor(); // restore original cursor | ||
659 | |||
660 | return success; // TRUE if loaded OK | ||
661 | } | ||
662 | |||
663 | |||
664 | int ImageViewer::calcHeight() | ||
665 | { | ||
666 | if ( !isFullScreen ) | ||
667 | return imagePanel->paneHeight(); | ||
668 | else | ||
669 | return qApp->desktop()->height(); | ||
670 | } | ||
671 | /* | ||
672 | This functions scales the pixmap in the member variable "pm" to fit the | ||
673 | widget size and puts the resulting pixmap in the member variable "pmScaled". | ||
674 | */ | ||
675 | void ImageViewer::scale() | ||
676 | { | ||
677 | int h = calcHeight(); | ||
678 | if ( image.isNull() ) return; | ||
679 | |||
680 | QApplication::setOverrideCursor( waitCursor ); // this might take time | ||
681 | if ( imagePanel->paneWidth() == pm.width() && h == pm.height() ) | ||
682 | { // no need to scale if widget | ||
683 | pmScaled = pm; // size equals pixmap size | ||
684 | } | ||
685 | else | ||
686 | { | ||
687 | double hs = (double)h / (double)image.height(); | ||
688 | double ws = (double)imagePanel->paneWidth() / (double)image.width(); | ||
689 | double scaleFactor = (hs > ws) ? ws : hs; | ||
690 | int smoothW = (int)(scaleFactor * image.width()); | ||
691 | int smoothH = (int)(scaleFactor * image.height()); | ||
692 | |||
693 | pmScaled.convertFromImage( image.smoothScale( smoothW, smoothH ) /*, conversion_flags */ ); | ||
694 | } | ||
695 | QApplication::restoreOverrideCursor(); // restore original cursor | ||
696 | } | ||
697 | |||
698 | /* | ||
699 | The resize event handler, if a valid pixmap was loaded it will call | ||
700 | scale() to fit the pixmap to the new widget size. | ||
701 | */ | ||
702 | |||
703 | void ImageViewer::resizeEvent( QResizeEvent * ) | ||
704 | { | ||
705 | |||
706 | if ( pm.size() == QSize( 0, 0 ) ) // we couldn't load the image | ||
707 | return; | ||
708 | |||
709 | int h = calcHeight(); | ||
710 | |||
711 | if ( imagePanel->paneWidth() != pmScaled.width() || h != pmScaled.height() ) | ||
712 | { // if new size, | ||
713 | scale(); // scale pmScaled to window | ||
714 | } | ||
715 | if ( image.hasAlphaBuffer() ) | ||
716 | erase(); | ||
717 | } | ||
718 | |||
719 | |||
720 | void ImageViewer::hFlip() | ||
721 | { | ||
722 | // matrix.scale( -1.0, 1.0 ); | ||
723 | |||
724 | setImage(image.mirror(TRUE,FALSE)); | ||
725 | } | ||
726 | |||
727 | void ImageViewer::vFlip() | ||
728 | { | ||
729 | // matrix.scale( 1.0, -1.0 ); | ||
730 | setImage(image.mirror(FALSE,TRUE)); | ||
731 | } | ||
732 | |||
733 | void ImageViewer::rot180() | ||
734 | { | ||
735 | // matrix.rotate( 180.0 ); | ||
736 | setImage(image.mirror(TRUE,TRUE)); | ||
737 | } | ||
738 | |||
739 | void ImageViewer::rot90() | ||
740 | { | ||
741 | QImage oldimage; | ||
742 | oldimage = image.convertDepth(32); | ||
743 | // matrix.rotate( -90.0 ); | ||
744 | setImage(rotate(oldimage,Rotate90)); | ||
745 | |||
746 | } | ||
747 | void ImageViewer::rot270() | ||
748 | { | ||
749 | |||
750 | QImage oldimage; | ||
751 | oldimage = image.convertDepth(32); | ||
752 | // matrix.rotate(90.0); | ||
753 | setImage(rotate(oldimage,Rotate270)); | ||
754 | |||
755 | } | ||
756 | |||
757 | void ImageViewer::blackAndWhite() | ||
758 | { | ||
759 | |||
760 | viewMenuView->setItemEnabled(BLACKANDWHITE,false); | ||
761 | setImage(toGray(image,false)); | ||
762 | } | ||
763 | |||
764 | void ImageViewer::displayControlsDialog() | ||
765 | { | ||
766 | int w=80; | ||
767 | int h=w; | ||
768 | QImage small; | ||
769 | |||
770 | if ( image.width()<w ||image.height()<h ) | ||
771 | small=image.smoothScale(w,h); | ||
772 | else | ||
773 | small=image.copy(0,0,w,h); | ||
774 | |||
775 | int newB=0; | ||
776 | ControlsDialog *dlg=new ControlsDialog("Image Viewer",small,&newB,this); | ||
777 | dlg->exec(); | ||
778 | if ( newB ) { | ||
779 | intensity(image,(float)newB/100); | ||
780 | setImage(image); | ||
781 | } | ||
782 | |||
783 | } | ||
784 | |||
785 | |||
786 | void ImageViewer::displayInfoDialog() | ||
787 | { | ||
788 | |||
789 | QStringList ls; | ||
790 | |||
791 | for ( int i=0;i<LAST;i++ ) | ||
792 | ls.append(imageInfo[i]); | ||
793 | |||
794 | InfoDialog::displayInfo("Image Viewer",ls,this); | ||
795 | } | ||
796 | void ImageViewer::normalView() | ||
797 | { | ||
798 | if ( !imagePanel->parentWidget() ) | ||
799 | { | ||
800 | |||
801 | isFullScreen = FALSE; | ||
802 | stack->addWidget( imagePanel, 1 ); | ||
803 | switchToImageView(); | ||
804 | if ( isSized ) | ||
805 | scale(); | ||
806 | |||
807 | updateImage(); | ||
808 | |||
809 | } | ||
810 | } | ||
811 | |||
812 | void ImageViewer::stopSlideShow() { | ||
813 | if (slideTimer->isActive()) | ||
814 | slideTimer->stop(); | ||
815 | } | ||
816 | |||
817 | void ImageViewer::fullScreen() | ||
818 | { | ||
819 | // Full-screen option | ||
820 | // contributed by Robert Wittams <robert@wittams.com> | ||
821 | if ( imagePanel->parentWidget() && loadSelected() ) | ||
822 | { | ||
823 | isFullScreen = TRUE; | ||
824 | imagePanel->reparent(0,QPoint(0,0)); | ||
825 | imagePanel->resize(qApp->desktop()->width(), qApp->desktop()->height()); | ||
826 | |||
827 | if ( isSized ) | ||
828 | scale(); | ||
829 | updateImage(); | ||
830 | imagePanel->showFullScreen(); | ||
831 | } | ||
832 | } | ||
833 | |||
834 | void ImageViewer::setImage(const QImage& newimage) | ||
835 | { | ||
836 | image = newimage; | ||
837 | reconvertImage(); | ||
838 | updateImage(); | ||
839 | } | ||
840 | |||
841 | void ImageViewer::updateImageInfo(QString &filePath) | ||
842 | { | ||
843 | |||
844 | for ( int i=0;i<LAST;i++ ) | ||
845 | { | ||
846 | imageInfo[i]=""; | ||
847 | } | ||
848 | |||
849 | imageInfo[FORMAT]=QImage::imageFormat (filePath ); | ||
850 | QFileInfo fi(filePath); | ||
851 | imageInfo[PATH]=fi.fileName(); | ||
852 | imageInfo[FILE_SIZE]=QString::number(fi.size())+" (bytes)"; | ||
853 | QString message("%1x%2"); | ||
854 | imageInfo[SIZE]=QString("%1x%2"); | ||
855 | imageInfo[SIZE]=imageInfo[SIZE].arg(image.width()).arg(image.height()); | ||
856 | if ( image.numColors() > 0 ) | ||
857 | { | ||
858 | imageInfo[COLORS]=tr("%1 colors").arg(image.numColors()); | ||
859 | } | ||
860 | else if ( image.depth() >= 16 ) | ||
861 | { | ||
862 | imageInfo[COLORS]=tr(" True color"); | ||
863 | } | ||
864 | if ( image.hasAlphaBuffer() ) | ||
865 | { | ||
866 | if ( image.depth() == 8 ) | ||
867 | { | ||
868 | int i; | ||
869 | bool alpha[256]; | ||
870 | int nalpha=0; | ||
871 | |||
872 | for ( i=0; i<256; i++ ) | ||
873 | alpha[i] = FALSE; | ||
874 | |||
875 | for ( i=0; i<image.numColors(); i++ ) | ||
876 | { | ||
877 | int alevel = image.color(i) >> 24; | ||
878 | if ( !alpha[alevel] ) | ||
879 | { | ||
880 | alpha[alevel] = TRUE; | ||
881 | nalpha++; | ||
882 | } | ||
883 | } | ||
884 | imageInfo[ALPHA]=tr("%1 alpha levels").arg(nalpha); | ||
885 | } | ||
886 | else | ||
887 | { | ||
888 | imageInfo[ALPHA]=tr("8-bit alpha channel"); | ||
889 | } | ||
890 | } | ||
891 | |||
892 | } | ||
893 | |||
894 | void ImageViewer::closeEvent( QCloseEvent *e ) | ||
895 | { | ||
896 | if ( stack->visibleWidget() == imagePanel && !bFromDocView ) | ||
897 | { | ||
898 | e->ignore(); | ||
899 | open(); | ||
900 | } | ||
901 | else | ||
902 | { | ||
903 | bFromDocView = FALSE; | ||
904 | e->accept(); | ||
905 | } | ||
906 | } | ||
907 | |||
908 | // Intensity,toGray and rotate code courtesy of KDE project. | ||
909 | |||
910 | |||
911 | QImage& ImageViewer::intensity(QImage &image, float percent) | ||
912 | { | ||
913 | |||
914 | int segColors = image.depth() > 8 ? 256 : image.numColors(); | ||
915 | unsigned char *segTbl = new unsigned char[segColors]; | ||
916 | int pixels = image.depth() > 8 ? image.width()*image.height() : | ||
917 | image.numColors(); | ||
918 | unsigned int *data = image.depth() > 8 ? (unsigned int *)image.bits() : | ||
919 | (unsigned int *)image.colorTable(); | ||
920 | |||
921 | bool brighten = (percent >= 0); | ||
922 | if ( percent < 0 ) | ||
923 | percent = -percent; | ||
924 | |||
925 | if ( brighten ) | ||
926 | { // keep overflow check out of loops | ||
927 | for ( int i=0; i < segColors; ++i ) | ||
928 | { | ||
929 | int tmp = (int)(i*percent); | ||
930 | if ( tmp > 255 ) | ||
931 | tmp = 255; | ||
932 | segTbl[i] = tmp; | ||
933 | } | ||
934 | } | ||
935 | else | ||
936 | { | ||
937 | for ( int i=0; i < segColors; ++i ) | ||
938 | { | ||
939 | int tmp = (int)(i*percent); | ||
940 | if ( tmp < 0 ) | ||
941 | tmp = 0; | ||
942 | segTbl[i] = tmp; | ||
943 | } | ||
944 | } | ||
945 | |||
946 | if ( brighten ) | ||
947 | { // same here | ||
948 | for ( int i=0; i < pixels; ++i ) | ||
949 | { | ||
950 | int r = qRed(data[i]); | ||
951 | int g = qGreen(data[i]); | ||
952 | int b = qBlue(data[i]); | ||
953 | int a = qAlpha(data[i]); | ||
954 | r = r + segTbl[r] > 255 ? 255 : r + segTbl[r]; | ||
955 | g = g + segTbl[g] > 255 ? 255 : g + segTbl[g]; | ||
956 | b = b + segTbl[b] > 255 ? 255 : b + segTbl[b]; | ||
957 | data[i] = qRgba(r, g, b,a); | ||
958 | } | ||
959 | } | ||
960 | else | ||
961 | { | ||
962 | for ( int i=0; i < pixels; ++i ) | ||
963 | { | ||
964 | int r = qRed(data[i]); | ||
965 | int g = qGreen(data[i]); | ||
966 | int b = qBlue(data[i]); | ||
967 | int a = qAlpha(data[i]); | ||
968 | r = r - segTbl[r] < 0 ? 0 : r - segTbl[r]; | ||
969 | g = g - segTbl[g] < 0 ? 0 : g - segTbl[g]; | ||
970 | b = b - segTbl[b] < 0 ? 0 : b - segTbl[b]; | ||
971 | data[i] = qRgba(r, g, b, a); | ||
972 | } | ||
973 | } | ||
974 | delete [] segTbl; | ||
975 | |||
976 | return image; | ||
977 | } | ||
978 | |||
979 | QImage& ImageViewer::toGray(QImage &img, bool fast) | ||
980 | { | ||
981 | if ( img.width() == 0 || img.height() == 0 ) | ||
982 | return img; | ||
983 | |||
984 | if ( fast ) | ||
985 | { | ||
986 | if ( img.depth() == 32 ) | ||
987 | { | ||
988 | register uchar * r(img.bits()); | ||
989 | register uchar * g(img.bits() + 1); | ||
990 | register uchar * b(img.bits() + 2); | ||
991 | |||
992 | uchar * end(img.bits() + img.numBytes()); | ||
993 | |||
994 | while ( r != end ) | ||
995 | { | ||
996 | |||
997 | *r = *g = *b = (((*r + *g) >> 1) + *b) >> 1; // (r + b + g) / 3 | ||
998 | |||
999 | r += 4; | ||
1000 | g += 4; | ||
1001 | b += 4; | ||
1002 | } | ||
1003 | } | ||
1004 | else | ||
1005 | { | ||
1006 | for ( int i = 0; i < img.numColors(); i++ ) | ||
1007 | { | ||
1008 | register uint r = qRed(img.color(i)); | ||
1009 | register uint g = qGreen(img.color(i)); | ||
1010 | register uint b = qBlue(img.color(i)); | ||
1011 | |||
1012 | register uint gray = (((r + g) >> 1) + b) >> 1; | ||
1013 | img.setColor(i, qRgba(gray, gray, gray, qAlpha(img.color(i)))); | ||
1014 | } | ||
1015 | } | ||
1016 | } | ||
1017 | else | ||
1018 | { | ||
1019 | int pixels = img.depth() > 8 ? img.width()*img.height() : | ||
1020 | img.numColors(); | ||
1021 | unsigned int *data = img.depth() > 8 ? (unsigned int *)img.bits() : | ||
1022 | (unsigned int *)img.colorTable(); | ||
1023 | int val, i; | ||
1024 | for ( i=0; i < pixels; ++i ) | ||
1025 | { | ||
1026 | val = qGray(data[i]); | ||
1027 | data[i] = qRgba(val, val, val, qAlpha(data[i])); | ||
1028 | } | ||
1029 | } | ||
1030 | return img; | ||
1031 | } | ||
1032 | |||
1033 | |||
1034 | QImage ImageViewer::rotate(QImage &img, RotateDirection r) | ||
1035 | { | ||
1036 | QImage dest; | ||
1037 | int x, y; | ||
1038 | if ( img.depth() > 8 ) | ||
1039 | { | ||
1040 | unsigned int *srcData, *destData; | ||
1041 | switch ( r ) | ||
1042 | { | ||
1043 | case Rotate90: | ||
1044 | dest.create(img.height(), img.width(), img.depth()); | ||
1045 | for ( y=0; y < img.height(); ++y ) | ||
1046 | { | ||
1047 | srcData = (unsigned int *)img.scanLine(y); | ||
1048 | for ( x=0; x < img.width(); ++x ) | ||
1049 | { | ||
1050 | destData = (unsigned int *)dest.scanLine(x); | ||
1051 | destData[img.height()-y-1] = srcData[x]; | ||
1052 | } | ||
1053 | } | ||
1054 | break; | ||
1055 | case Rotate180: | ||
1056 | dest.create(img.width(), img.height(), img.depth()); | ||
1057 | for ( y=0; y < img.height(); ++y ) | ||
1058 | { | ||
1059 | srcData = (unsigned int *)img.scanLine(y); | ||
1060 | destData = (unsigned int *)dest.scanLine(img.height()-y-1); | ||
1061 | for ( x=0; x < img.width(); ++x ) | ||
1062 | destData[img.width()-x-1] = srcData[x]; | ||
1063 | } | ||
1064 | break; | ||
1065 | case Rotate270: | ||
1066 | dest.create(img.height(), img.width(), img.depth()); | ||
1067 | for ( y=0; y < img.height(); ++y ) | ||
1068 | { | ||
1069 | srcData = (unsigned int *)img.scanLine(y); | ||
1070 | for ( x=0; x < img.width(); ++x ) | ||
1071 | { | ||
1072 | destData = (unsigned int *)dest.scanLine(img.width()-x-1); | ||
1073 | destData[y] = srcData[x]; | ||
1074 | } | ||
1075 | } | ||
1076 | break; | ||
1077 | default: | ||
1078 | dest = img; | ||
1079 | break; | ||
1080 | } | ||
1081 | } | ||
1082 | else | ||
1083 | { | ||
1084 | unsigned char *srcData, *destData; | ||
1085 | unsigned int *srcTable, *destTable; | ||
1086 | switch ( r ) | ||
1087 | { | ||
1088 | case Rotate90: | ||
1089 | dest.create(img.height(), img.width(), img.depth()); | ||
1090 | dest.setNumColors(img.numColors()); | ||
1091 | srcTable = (unsigned int *)img.colorTable(); | ||
1092 | destTable = (unsigned int *)dest.colorTable(); | ||
1093 | for ( x=0; x < img.numColors(); ++x ) | ||
1094 | destTable[x] = srcTable[x]; | ||
1095 | for ( y=0; y < img.height(); ++y ) | ||
1096 | { | ||
1097 | srcData = (unsigned char *)img.scanLine(y); | ||
1098 | for ( x=0; x < img.width(); ++x ) | ||
1099 | { | ||
1100 | destData = (unsigned char *)dest.scanLine(x); | ||
1101 | destData[img.height()-y-1] = srcData[x]; | ||
1102 | } | ||
1103 | } | ||
1104 | break; | ||
1105 | case Rotate180: | ||
1106 | dest.create(img.width(), img.height(), img.depth()); | ||
1107 | dest.setNumColors(img.numColors()); | ||
1108 | srcTable = (unsigned int *)img.colorTable(); | ||
1109 | destTable = (unsigned int *)dest.colorTable(); | ||
1110 | for ( x=0; x < img.numColors(); ++x ) | ||
1111 | destTable[x] = srcTable[x]; | ||
1112 | for ( y=0; y < img.height(); ++y ) | ||
1113 | { | ||
1114 | srcData = (unsigned char *)img.scanLine(y); | ||
1115 | destData = (unsigned char *)dest.scanLine(img.height()-y-1); | ||
1116 | for ( x=0; x < img.width(); ++x ) | ||
1117 | destData[img.width()-x-1] = srcData[x]; | ||
1118 | } | ||
1119 | break; | ||
1120 | case Rotate270: | ||
1121 | dest.create(img.height(), img.width(), img.depth()); | ||
1122 | dest.setNumColors(img.numColors()); | ||
1123 | srcTable = (unsigned int *)img.colorTable(); | ||
1124 | destTable = (unsigned int *)dest.colorTable(); | ||
1125 | for ( x=0; x < img.numColors(); ++x ) | ||
1126 | destTable[x] = srcTable[x]; | ||
1127 | for ( y=0; y < img.height(); ++y ) | ||
1128 | { | ||
1129 | srcData = (unsigned char *)img.scanLine(y); | ||
1130 | for ( x=0; x < img.width(); ++x ) | ||
1131 | { | ||
1132 | destData = (unsigned char *)dest.scanLine(img.width()-x-1); | ||
1133 | destData[y] = srcData[x]; | ||
1134 | } | ||
1135 | } | ||
1136 | break; | ||
1137 | default: | ||
1138 | dest = img; | ||
1139 | break; | ||
1140 | } | ||
1141 | |||
1142 | } | ||
1143 | return (dest); | ||
1144 | } | ||
1145 | |||
1146 | void ImageViewer::slideShow( bool on ) | ||
1147 | { | ||
1148 | if (on) { | ||
1149 | if (!imageList.isEmpty()) { | ||
1150 | slideTimer->start(slideDelay * 1000, FALSE); | ||
1151 | filename = ""; // force restart | ||
1152 | slideReverse ? prevImage() : nextImage(); | ||
1153 | } | ||
1154 | } else { | ||
1155 | slideTimer->stop(); | ||
1156 | slideAction->setOn( false); | ||
1157 | } | ||
1158 | } | ||
1159 | |||
1160 | void ImageViewer::slideUpdate() | ||
1161 | { | ||
1162 | bool final_image = slideReverse ? prevImage() : nextImage(); | ||
1163 | |||
1164 | if (final_image && !slideRepeat) { | ||
1165 | slideTimer->stop(); | ||
1166 | slideAction->setOn(FALSE); | ||
1167 | } | ||
1168 | } | ||
1169 | |||
1170 | // | ||
1171 | // Display the image after the current one in the image list. | ||
1172 | // Return TRUE if the next call to nextImage() will wrap around to the | ||
1173 | // first image in the list (ie. we're now viewing the last image in the list). | ||
1174 | // | ||
1175 | bool ImageViewer::nextImage(void) | ||
1176 | { | ||
1177 | int idx = 0; | ||
1178 | |||
1179 | if (imageList.count() > 0) { | ||
1180 | idx = imageIndex(); | ||
1181 | if (idx != -1) { | ||
1182 | if (idx == int(imageList.count() - 1)) { | ||
1183 | idx = 0; | ||
1184 | } else { | ||
1185 | idx++; | ||
1186 | } | ||
1187 | } else { | ||
1188 | idx = 0; | ||
1189 | } | ||
1190 | openFile(imageList[idx]); | ||
1191 | } | ||
1192 | |||
1193 | return idx == int(imageList.count() - 1) ? TRUE : FALSE; | ||
1194 | } | ||
1195 | |||
1196 | // | ||
1197 | // Display the image preceeding the current one in the image list. | ||
1198 | // Return TRUE if the next call to prevImage() will wrap around to the last | ||
1199 | // image in the list (ie. we're now viewing the first image in the list). | ||
1200 | // | ||
1201 | bool ImageViewer::prevImage(void) | ||
1202 | { | ||
1203 | int idx = -1; | ||
1204 | |||
1205 | if (imageList.count() > 0) { | ||
1206 | idx = imageIndex(); | ||
1207 | if (idx != -1) { | ||
1208 | if (idx == 0) { | ||
1209 | idx = imageList.count() - 1; | ||
1210 | } else { | ||
1211 | idx--; | ||
1212 | } | ||
1213 | } else { | ||
1214 | idx = imageList.count() - 1; | ||
1215 | } | ||
1216 | openFile(imageList[idx]); | ||
1217 | } | ||
1218 | |||
1219 | return idx == 0 ? TRUE : FALSE; | ||
1220 | } | ||
1221 | |||
1222 | // | ||
1223 | // Return the index into the imageList of the currently viewed | ||
1224 | // image (ie. ImageViewer::filename in ImageViewer::imageList). | ||
1225 | // | ||
1226 | int ImageViewer::imageIndex(void) | ||
1227 | { | ||
1228 | QValueListConstIterator<DocLnk> i; | ||
1229 | int index; | ||
1230 | |||
1231 | if (imageList.count() == 0) { | ||
1232 | return -1; | ||
1233 | } | ||
1234 | |||
1235 | for (index = 0, i = imageList.begin(); i != imageList.end(); ++i, index++) { | ||
1236 | if ((*i).file() == filename) { | ||
1237 | return index; | ||
1238 | } | ||
1239 | } | ||
1240 | |||
1241 | return -1; | ||
1242 | } | ||
diff --git a/noncore/multimedia/showimg/showimg.h b/noncore/multimedia/showimg/showimg.h deleted file mode 100644 index 9cf9bfd..0000000 --- a/noncore/multimedia/showimg/showimg.h +++ b/dev/null | |||
@@ -1,289 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef SHOWIMG_H | ||
22 | #define SHOWIMG_H | ||
23 | |||
24 | #include <qwidget.h> | ||
25 | #include <qmainwindow.h> | ||
26 | #include <qimage.h> | ||
27 | #include <qlabel.h> | ||
28 | #include <qlayout.h> | ||
29 | #include <qscrollview.h> | ||
30 | #include <qdialog.h> | ||
31 | #include <qstringlist.h> | ||
32 | #include <qvaluelist.h> | ||
33 | #include <qwmatrix.h> | ||
34 | |||
35 | |||
36 | class QAction; | ||
37 | class QToolBar; | ||
38 | class QMenuBar; | ||
39 | class QPopupMenu; | ||
40 | class QWidgetStack; | ||
41 | class FileSelector; | ||
42 | class DocLnk; | ||
43 | class QLabel; | ||
44 | class QAction; | ||
45 | class QSpinBox; | ||
46 | class ImageFileSelector; | ||
47 | class QTimer; | ||
48 | |||
49 | |||
50 | class ImageWidget : public QWidget | ||
51 | { | ||
52 | Q_OBJECT | ||
53 | public: | ||
54 | ImageWidget( QWidget *parent=0 ) | ||
55 | : QWidget( parent ) { | ||
56 | setBackgroundMode(NoBackground); | ||
57 | } | ||
58 | ~ImageWidget() { } | ||
59 | |||
60 | void setPixmap( const QPixmap &pm ) { | ||
61 | pixmap = pm; | ||
62 | show(); | ||
63 | } | ||
64 | |||
65 | signals: | ||
66 | void clicked(); | ||
67 | |||
68 | protected: | ||
69 | void paintEvent( QPaintEvent * ); | ||
70 | void mouseReleaseEvent(QMouseEvent* event); | ||
71 | |||
72 | private: | ||
73 | QPixmap pixmap; | ||
74 | }; | ||
75 | |||
76 | class InfoDialog:public QDialog | ||
77 | { | ||
78 | Q_OBJECT | ||
79 | |||
80 | public: | ||
81 | |||
82 | static void displayInfo(const QString &caption, const QStringList text, QWidget *parent); | ||
83 | |||
84 | private: | ||
85 | |||
86 | InfoDialog(const QString &caption,const QStringList text, QWidget *parent); | ||
87 | |||
88 | }; | ||
89 | |||
90 | class ControlsDialog:public QDialog | ||
91 | { | ||
92 | Q_OBJECT | ||
93 | |||
94 | public: | ||
95 | ControlsDialog(const QString &caption,const QImage image,int *brightness, QWidget *parent); | ||
96 | |||
97 | |||
98 | private slots: | ||
99 | |||
100 | void bValueChanged(int); | ||
101 | void accept(); | ||
102 | |||
103 | |||
104 | private: | ||
105 | ImageWidget *pixmap; | ||
106 | QSpinBox *spb; | ||
107 | QImage img; | ||
108 | int *b; | ||
109 | }; | ||
110 | |||
111 | |||
112 | class ImagePane : public QWidget | ||
113 | { | ||
114 | Q_OBJECT | ||
115 | public: | ||
116 | ImagePane( QWidget *parent=0 ); | ||
117 | ~ImagePane() { } | ||
118 | |||
119 | //void showStatus(); | ||
120 | //void hideStatus(); | ||
121 | //QLabel *statusLabel() | ||
122 | //{ | ||
123 | // return status; | ||
124 | //} | ||
125 | void setPixmap( const QPixmap &pm ); | ||
126 | |||
127 | |||
128 | int paneWidth() const { | ||
129 | return image->visibleWidth(); | ||
130 | } | ||
131 | |||
132 | int paneHeight() const { | ||
133 | return image->visibleHeight(); | ||
134 | } | ||
135 | |||
136 | void setPosition(int x, int y) { | ||
137 | image->setContentsPos (x,y ); | ||
138 | } | ||
139 | |||
140 | void disable() { | ||
141 | pic->hide(); | ||
142 | } | ||
143 | |||
144 | signals: | ||
145 | void clicked(); | ||
146 | |||
147 | private: | ||
148 | QScrollView *image; | ||
149 | ImageWidget *pic; | ||
150 | QVBoxLayout *vb; | ||
151 | |||
152 | private slots: | ||
153 | void imageClicked(); | ||
154 | }; | ||
155 | |||
156 | |||
157 | class ImageViewer : public QMainWindow | ||
158 | { | ||
159 | Q_OBJECT | ||
160 | public: | ||
161 | static QString appName() { return QString::fromLatin1("showimg"); } | ||
162 | ImageViewer( QWidget *parent=0, const char *name=0, int wFlags=0 ); | ||
163 | ~ImageViewer(); | ||
164 | |||
165 | void loadImage( const char *fileName ); | ||
166 | void show(const QString& fileref); | ||
167 | void show(); | ||
168 | |||
169 | |||
170 | enum INFO_STRINGS { | ||
171 | PATH, | ||
172 | FORMAT, | ||
173 | FILE_SIZE, | ||
174 | SIZE, | ||
175 | COLORS, | ||
176 | ALPHA, | ||
177 | LAST | ||
178 | }; | ||
179 | |||
180 | enum RotateDirection { | ||
181 | Rotate90, Rotate180, Rotate270 | ||
182 | }; | ||
183 | |||
184 | |||
185 | static QImage rotate(QImage &img, RotateDirection r); | ||
186 | static QImage& intensity(QImage &image, float percent); | ||
187 | static QImage& toGray(QImage &image, bool fast = false); | ||
188 | bool showThumbView; // a flag to indicate if FileSelector should be initialized with thumbnail view | ||
189 | |||
190 | protected: | ||
191 | void resizeEvent( QResizeEvent * ); | ||
192 | void closeEvent( QCloseEvent * ); | ||
193 | |||
194 | private: | ||
195 | int imageIndex(void); | ||
196 | |||
197 | void updateCaption( QString name ); | ||
198 | bool loadSelected(); | ||
199 | void scale(); | ||
200 | bool reconvertImage(); | ||
201 | int calcHeight(); | ||
202 | void setImage(const QImage& newimage); | ||
203 | void updateImageInfo(QString &filePath); | ||
204 | void switchToFileSelector(); | ||
205 | void switchToImageView(); | ||
206 | |||
207 | void updateImage(); | ||
208 | |||
209 | private slots: | ||
210 | |||
211 | void slideShow( bool on ); | ||
212 | void help(); | ||
213 | void slideUpdate(); | ||
214 | bool nextImage(); | ||
215 | bool prevImage(); | ||
216 | void settings(); | ||
217 | |||
218 | void switchThumbView(); | ||
219 | void switchSizeToScreen(); | ||
220 | void setDocument(const QString& fileref); | ||
221 | void doDelayedLoad(); | ||
222 | void openFile( const DocLnk &file ); | ||
223 | void openFile(); | ||
224 | void open(); | ||
225 | void closeFileSelector(); | ||
226 | void hFlip(); | ||
227 | void vFlip(); | ||
228 | void rot180(); | ||
229 | void rot90(); | ||
230 | void rot270(); | ||
231 | void normalView(); | ||
232 | void fullScreen(); | ||
233 | void stopSlideShow(); | ||
234 | void blackAndWhite(); | ||
235 | void displayInfoDialog(); | ||
236 | void displayControlsDialog(); | ||
237 | private: | ||
238 | QWMatrix matrix; | ||
239 | bool rotated90; | ||
240 | enum MENU_ITEMS { | ||
241 | SHOW_THUMBNAILS, | ||
242 | SIZE_TO_SCREEN, | ||
243 | BLACKANDWHITE | ||
244 | }; | ||
245 | |||
246 | QString filename; | ||
247 | QString delayLoad; | ||
248 | QImage image; // the loaded image | ||
249 | QPixmap pm; // the converted pixmap | ||
250 | QPixmap pmScaled; // the scaled pixmap | ||
251 | QToolBar *toolBar; | ||
252 | QToolBar *iconToolBar; | ||
253 | QMenuBar *menuBar; | ||
254 | QMenuBar *current; | ||
255 | |||
256 | |||
257 | QPopupMenu *fileMenuFile; | ||
258 | QPopupMenu *viewMenuFile; | ||
259 | QPopupMenu *optionsMenuFile; | ||
260 | QPopupMenu *fileMenuView; | ||
261 | QPopupMenu *viewMenuView; | ||
262 | |||
263 | QAction *sss; // scale to screen size | ||
264 | |||
265 | QLabel *lab; | ||
266 | ImagePane *imagePanel; | ||
267 | QWidgetStack *stack; | ||
268 | //FileSelector *fileSelector; | ||
269 | ImageFileSelector *fileSelector; | ||
270 | bool isFullScreen; | ||
271 | bool isSized; // true if image is to be resized to fit the window size | ||
272 | bool bFromDocView; // a flag to indicate whether or not we were | ||
273 | // launched from the document view... | ||
274 | |||
275 | int slideDelay; | ||
276 | bool slideRepeat; | ||
277 | bool slideReverse; // show slideshow in reverse order | ||
278 | bool rotateOnLoad; // rotate by 90 degrees on loading | ||
279 | bool fastLoad; | ||
280 | QTimer *slideTimer; | ||
281 | QValueList<DocLnk> imageList; | ||
282 | QAction *slideAction; | ||
283 | |||
284 | |||
285 | QString imageInfo[LAST]; | ||
286 | }; | ||
287 | |||
288 | |||
289 | #endif // SHOWIMG_H | ||
diff --git a/noncore/multimedia/showimg/showimg.pro b/noncore/multimedia/showimg/showimg.pro deleted file mode 100644 index 74eceb8..0000000 --- a/noncore/multimedia/showimg/showimg.pro +++ b/dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | CONFIG += qt warn_on quick-app | ||
2 | HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h | ||
3 | SOURCES = main.cpp showimg.cpp ImageFileSelector.cpp settingsdialog.cpp settingsdialogbase.cpp | ||
4 | TARGET = showimg | ||
5 | INCLUDEPATH += $(OPIEDIR)/include | ||
6 | DEPENDPATH += $(OPIEDIR)/include | ||
7 | LIBS += -lqpe -lopiecore2 -lopieui2 | ||
8 | |||
9 | include( $(OPIEDIR)/include.pro ) | ||