00001
00002
00003
00004
00005 #include "gif_slave.h"
00006 #include "png_slave.h"
00007 #include "jpeg_slave.h"
00008 #include "thumbnailtool.h"
00009 #include "slavereciever.h"
00010
00011 #include <qpixmap.h>
00012 #include <qcopchannel_qws.h>
00013
00014 #include <opie2/oapplication.h>
00015
00016 int main( int argc, char* argv[] ) {
00017 Opie::Core::OApplication app( argc, argv,"opie-eye-slave" );
00018 SlaveReciever rec( 0 );
00019
00020 QCopChannel chan( "QPE/opie-eye_slave" );
00021 QObject::connect(&chan,SIGNAL(received(const QCString&, const QByteArray&)),
00022 &rec, SLOT(recieveAnswer(const QCString&,const QByteArray&)));
00023 QObject::connect(qApp,SIGNAL(appMessage(const QCString&, const QByteArray&)),
00024 &rec, SLOT(recieveAnswer(const QCString&,const QByteArray&)));
00025
00026 return app.exec();
00027 }
00028
00029 #ifdef DEBUG_IT
00030 int main( int argc, char* argv[] ) {
00031 QString str = QString::fromLatin1(argv[2] );
00032 QApplication app( argc, argv );
00033 GifSlave slave;
00034 owarn << str +" "+slave.iconViewName(str ) << oendl;
00035 owarn << str+" "+slave.fullImageInfo( str ) << oendl;
00036
00037 PNGSlave pngslave;
00038 owarn << str + " " + pngslave.iconViewName(str) << oendl;
00039 owarn << str + " " + pngslave.fullImageInfo(str) << oendl;
00040
00041
00042 JpegSlave jpgslave;
00043 owarn << str + " " + jpgslave.iconViewName(str ) << oendl;
00044 owarn << str + " " + jpgslave.fullImageInfo( str ) << oendl;
00045
00046 QPixmap pix = ThumbNailTool::getThumb( str, 24, 24 );
00047 if ( pix.isNull() ) {
00048 owarn << "No Thumbnail" << oendl;
00049 pix = slave.pixmap(str, 24, 24);
00050 }
00051
00052 if (!pix.isNull() ) {
00053 owarn << "Saving Thumbnail" << oendl;
00054 ThumbNailTool::putThumb( str, pix, 24, 24 );
00055 }
00056
00057 }
00058
00059 #endif