summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/showimg/config.in2
-rw-r--r--noncore/multimedia/showimg/main.cpp4
-rw-r--r--noncore/multimedia/showimg/opie-showimg.control2
-rw-r--r--noncore/multimedia/showimg/showimg.cpp11
-rw-r--r--noncore/multimedia/showimg/showimg.pro2
5 files changed, 11 insertions, 10 deletions
diff --git a/noncore/multimedia/showimg/config.in b/noncore/multimedia/showimg/config.in
index 36e8cf0..808c841 100644
--- a/noncore/multimedia/showimg/config.in
+++ b/noncore/multimedia/showimg/config.in
@@ -1,4 +1,4 @@
config SHOWIMG
boolean "opie-showimg (image viewer)"
default "y"
- depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI
diff --git a/noncore/multimedia/showimg/main.cpp b/noncore/multimedia/showimg/main.cpp
index 1c864e9..b61cffb 100644
--- a/noncore/multimedia/showimg/main.cpp
+++ b/noncore/multimedia/showimg/main.cpp
@@ -1,26 +1,26 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "showimg.h"
-#include <opie/oapplicationfactory.h>
+#include <opie2/oapplicationfactory.h>
-OPIE_EXPORT_APP( OApplicationFactory<ImageViewer> ) \ No newline at end of file
+OPIE_EXPORT_APP( OApplicationFactory<ImageViewer> )
diff --git a/noncore/multimedia/showimg/opie-showimg.control b/noncore/multimedia/showimg/opie-showimg.control
index 1e54383..2fbfabc 100644
--- a/noncore/multimedia/showimg/opie-showimg.control
+++ b/noncore/multimedia/showimg/opie-showimg.control
@@ -1,11 +1,11 @@
Package: opie-showimg
Files: plugins/application/libshowimg.so* bin/showimg apps/Applications/showimg.desktop pics/imageviewer
Priority: optional
Section: opie/applications
Maintainer: Opie Team <opie@handhelds.org>
Architecture: arm
-Depends: task-opie-minimal
+Depends: task-opie-minimal,libopiecore2, libopieui2
Description: Image Viewer
The image viewer for the Opie environment. Supports
all graphics formats are compiled into Qt/Embedded (eg. PNG).
Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp
index 82eac33..6c0c4db 100644
--- a/noncore/multimedia/showimg/showimg.cpp
+++ b/noncore/multimedia/showimg/showimg.cpp
@@ -1,89 +1,90 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
//
// Full-screen and rotation options contributed by Robert Wittams <robert@wittams.com>
//
#include "showimg.h"
#include "ImageFileSelector.h"
#include "settingsdialog.h"
-#include <opie/ofiledialog.h>
+#include <opie2/ofiledialog.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/resource.h>
-#include <math.h>
-#include <qmenubar.h>
#include <qpe/qpetoolbar.h>
+
#include <qaction.h>
#include <qfiledialog.h>
+#include <qmenubar.h>
#include <qspinbox.h>
+#include <math.h>
ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent)
: QDialog(parent,0,true)
{
setCaption(caption);
if ( parent ) {
setPalette(parent->palette());
}
b=brightness;
img=image;
setMinimumSize(140,80);
QGridLayout *gl= new QGridLayout(this,2,2,4,4);
pixmap =new ImageWidget(this);;
QPixmap pm;
pm.convertFromImage(img);
pixmap->setPixmap(pm);
pixmap->setMinimumSize(pm.width(),pm.height());
gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter);
QLabel *l=new QLabel(tr("Brightness")+":",this);
gl->addWidget(l,1,0,AlignLeft);
spb=new QSpinBox(-100,100,2,this);
gl->addWidget(spb,1,1,AlignRight);
spb->setValue(0);
connect(spb,SIGNAL(valueChanged(int)),this, SLOT(bValueChanged(int)));
}
void ControlsDialog::bValueChanged(int value)
{
QImage nImage=img;
nImage.detach();
ImageViewer::intensity(nImage, (float)value/100);
QPixmap pm;
pm.convertFromImage(nImage);
pixmap->setPixmap(pm);
pixmap->repaint(false);
}
@@ -153,97 +154,97 @@ ImagePane::ImagePane( QWidget *parent ) : QWidget( parent )
image = new QScrollView(this,0,WResizeNoErase|WNorthWestGravity);
pic=new ImageWidget(image);
image->addChild(pic);
connect(pic, SIGNAL( clicked() ), this, SLOT( imageClicked() ));
vb->addWidget( image );
}
void ImagePane::setPixmap( const QPixmap &pm )
{
pic->setPixmap( pm );
pic->resize(pm.width(),pm.height());
image->updateScrollBars ();
pic->repaint(false);
}
void ImagePane::imageClicked()
{
emit clicked();
}
//===========================================================================
/*
Draws the portion of the scaled pixmap that needs to be updated
*/
void ImageWidget::paintEvent( QPaintEvent *e )
{
QPainter painter(this);
painter.setClipRect(e->rect());
painter.fillRect(0,0,width(),height(),QColor(0,0,0));
if ( pixmap.size() != QSize( 0, 0 ) )
{ // is an image loaded?
painter.drawPixmap((width() - pixmap.width()) / 2, (height() - pixmap.height()) / 2, pixmap);
}
}
void ImageWidget::mouseReleaseEvent(QMouseEvent *)
{
emit clicked();
}
//===========================================================================
-ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
+ImageViewer::ImageViewer( QWidget *parent, const char *name, int /*wFlags*/ )
: QMainWindow( parent, name, WResizeNoErase ), filename( 0 ), bFromDocView( FALSE )
{
setCaption( tr("Image Viewer") );
setIcon( Resource::loadPixmap( "ImageViewer" ) );
Config cfg("Image Viewer");
cfg.setGroup("Image Viewer");
showThumbView=cfg.readBoolEntry("ShowThumbnails",false);
isSized=cfg.readBoolEntry("SizeToScreen",true);
isFullScreen = FALSE;
setToolBarsMovable( FALSE );
toolBar = new QToolBar( this );
toolBar->setHorizontalStretchable( TRUE );
menuBar = new QMenuBar( toolBar );
current=menuBar;
fileMenuFile = new QPopupMenu(this);
//menuBarmenubarFile->insertItem( tr("File"), fileMenu );
fileMenuFile->insertItem(tr("Open"),
this, SLOT(openFile()), 0);
viewMenuFile = new QPopupMenu( this );
//menubarFile->insertItem( tr("View"), viewMenu );
viewMenuFile->insertItem( tr("Thumbnail View"),
this, SLOT(switchThumbView()), 0, SHOW_THUMBNAILS );
viewMenuFile->setItemChecked ( SHOW_THUMBNAILS, showThumbView );
optionsMenuFile = new QPopupMenu( this);
//menubarFile->insertItem( tr("Options"),optionsMenu );
slideAction = new QAction( tr( "Slide show" ), Resource::loadIconSet( "slideshow" ),
QString::null, 0, this, 0 );
slideAction->setToggleAction( TRUE );
connect( slideAction, SIGNAL( toggled(bool) ), this, SLOT( slideShow(bool) ) );
slideAction->addTo( optionsMenuFile);
// slideAction->addTo( toolBar );
@@ -477,97 +478,97 @@ void ImageViewer::switchToImageView()
menuBar->insertItem( tr("View"), viewMenuView );
viewMenuView->setItemEnabled(BLACKANDWHITE,true);
iconToolBar->show();
imagePanel->setPosition(0,0);
}
void ImageViewer::setDocument(const QString& fileref)
{
delayLoad = fileref;
switchToImageView();
QTimer::singleShot( 0, this, SLOT(doDelayedLoad()) );
}
void ImageViewer::doDelayedLoad()
{
show(delayLoad);
}
void ImageViewer::show()
{
normalView();
QMainWindow::show();
}
void ImageViewer::show(const QString& fileref)
{
// qDebug("Show "+fileref);
bFromDocView = TRUE;
closeFileSelector();
DocLnk link(fileref);
if ( link.isValid() ) {
openFile(link);
} else {
filename = fileref;
updateCaption( fileref );
loadImage( fileref );
}
}
void ImageViewer::openFile() {
MimeTypes types;
QStringList image;
image << "image/*";
types.insert("Images", image);
- QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 );
+ QString str = Opie::OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 );
DocLnk link(str);
// if ( link.isValid() )
openFile(link);
}
void ImageViewer::openFile( const DocLnk &link )
{
closeFileSelector();
// DocLnk link(file);
qDebug("open "+link.name());
updateCaption( link.name() );
loadImage( link.file() );
if (slideTimer->isActive()) {
slideTimer->start(slideDelay * 1000, FALSE);
}
}
void ImageViewer::open()
{
switchToFileSelector();
}
void ImageViewer::closeFileSelector()
{
switchToImageView();
}
void ImageViewer::updateCaption( QString name )
{
int sep = name.findRev( '/' );
if ( sep >= 0 )
name = name.mid( sep+1 );
setCaption( name + tr(" - Image Viewer") );
}
/*
This function loads an image from a file.
*/
void ImageViewer::loadImage( const char *fileName )
{
filename = fileName;
if ( filename ) {
QApplication::setOverrideCursor( waitCursor ); // this might take time
//imagePanel->statusLabel()->setText( tr("Loading image...") );
qApp->processEvents();
diff --git a/noncore/multimedia/showimg/showimg.pro b/noncore/multimedia/showimg/showimg.pro
index 76b020e..94fb162 100644
--- a/noncore/multimedia/showimg/showimg.pro
+++ b/noncore/multimedia/showimg/showimg.pro
@@ -1,9 +1,9 @@
CONFIG += qt warn_on release quick-app
HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h
SOURCES = main.cpp showimg.cpp ImageFileSelector.cpp settingsdialog.cpp settingsdialogbase.cpp
TARGET = showimg
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopie
+LIBS += -lqpe -lopiecore2 -l opieui2
include ( $(OPIEDIR)/include.pro )