Commit db09e1aa authored by Albert Astals Cid's avatar Albert Astals Cid

some more things compile, commiting so Pino has lastest

svn path=/branches/work/kde4/playground/graphics/okular/; revision=522242
parent 2ac0ac63
kde_module_LTLIBRARIES = \
libokularGenerator_poppler.la
INCLUDES = -I.. $(POPPLER_CFLAGS) $(all_includes)
INCLUDES = -I$(srcdir)/../.. $(POPPLER_CFLAGS) $(all_includes)
libokularGenerator_poppler_la_LIBADD = ../../core/liboKularcore.la ../../conf/liboKularconf.la \
$(POPPLER_LIBS) $(LIB_KDEPRINT) $(LIB_KDEUI) -lm
......
......@@ -12,20 +12,20 @@
#include <qwidget.h>
#include <qtimer.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qvbox.h>
#include <khbox.h>
#include <kvbox.h>
#include <qpixmap.h>
#include <qfont.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qpushbutton.h>
#include <qmemarray.h>
#include <qrect.h>
#include <qpainter.h>
#include <qscrollview.h>
#include <q3scrollview.h>
#include <q3cstring.h>
#include <qapplication.h>
#include <kapplication.h>
#include <ktoolinvocation.h>
#include <kglobalsettings.h>
#include <klocale.h>
#include <kconfig.h>
......@@ -58,7 +58,7 @@ class ExtendImageWidget : public QWidget
{
public:
ExtendImageWidget( const QPixmap & pix, QWidget * parent )
: QWidget( parent, "", WNoAutoErase ), m_pixmap( pix )
: QWidget( parent, "", Qt::WNoAutoErase ), m_pixmap( pix )
{
// adjust size hint
setFixedWidth( pix.width() );
......@@ -80,8 +80,8 @@ class ExtendImageWidget : public QWidget
QPainter p( this );
p.drawPixmap( pixmapRect.topLeft(), m_pixmap, pixmapRect );
// paint the tiled bottom part
QMemArray<QRect> rects = paintRegion.subtract( pixmapRect ).rects();
for ( unsigned int i = 0; i < rects.count(); i++ )
QVector<QRect> rects = paintRegion.subtract( pixmapRect ).rects();
for ( int i = 0; i < rects.count(); i++ )
{
const QRect & tileRect = rects[ i ];
p.drawTiledPixmap( tileRect, m_tile, QPoint(tileRect.left(), 0) );
......@@ -98,7 +98,7 @@ class ExtendImageWidget : public QWidget
class AvailableItem : public Entry
{
public:
typedef QValueList< AvailableItem * > List;
typedef QList< AvailableItem * > List;
enum State { Normal = 0, Installing = 1, Uninstalling = 2 };
AvailableItem( const QDomElement & element )
......@@ -324,14 +324,14 @@ class ItemsView : public KHTMLPart
// handle clicks on page links/buttons
void urlSelected( const QString & link, int, int, const QString &, KParts::URLArgs )
{
KURL url( link );
KUrl url( link );
QString urlProtocol = url.protocol();
QString urlPath = url.path();
if ( urlProtocol == "mailto" )
{
// clicked over a mail address
kapp->invokeMailer( url );
KToolInvocation::invokeMailer( url );
}
else if ( urlProtocol == "item" )
{
......@@ -400,7 +400,7 @@ struct NewStuffDialogPrivate
QMap< KIO::Job *, ItemTransferInfo > transferJobs;
// Contents
QValueList< Provider * > providers;
QList< Provider * > providers;
// gui related vars
QWidget * parentWidget;
......@@ -440,7 +440,7 @@ NewStuffDialog::NewStuffDialog( QWidget * parentWidget )
horLay->addWidget( new ExtendImageWidget( p, this ) );
// create right 'main' widget
QVBox * rightLayouter = new QVBox( this );
KVBox * rightLayouter = new KVBox( this );
rightLayouter->setSpacing( 6 );
horLay->addWidget( rightLayouter );
......@@ -488,7 +488,7 @@ NewStuffDialog::NewStuffDialog( QWidget * parentWidget )
d->itemsView = new ItemsView( this, rightLayouter );
// create bottom buttons
QHBox * bottomLine = new QHBox( rightLayouter );
KHBox * bottomLine = new KHBox( rightLayouter );
// create info label
d->messageLabel = new QLabel( bottomLine );
d->messageLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Raised );
......@@ -521,7 +521,7 @@ NewStuffDialog::~NewStuffDialog()
tIt.key()->kill();
// delete all Provider descriptors
QValueList< Provider * >::iterator it = d->providers.begin(), iEnd = d->providers.end();
QList< Provider * >::iterator it = d->providers.begin(), iEnd = d->providers.end();
for ( ; it != iEnd; ++it )
delete *it;
d->providers.clear();
......@@ -618,7 +618,7 @@ void NewStuffDialog::slotLoadProvidersList()
d->providersListJob.job->kill();
// create a job that will feed providersList data
KIO::TransferJob * job = KIO::get( KURL( PROVIDERS_URL ), false /*refetch*/, false /*progress*/ );
KIO::TransferJob * job = KIO::get( KUrl( PROVIDERS_URL ), false /*refetch*/, false /*progress*/ );
connect( job, SIGNAL( data( KIO::Job *, const QByteArray & ) ),
this, SLOT( slotProvidersListInfoData( KIO::Job *, const QByteArray & ) ) );
connect( job, SIGNAL( result( KIO::Job * ) ),
......@@ -642,7 +642,7 @@ void NewStuffDialog::slotProvidersListInfoData( KIO::Job * job, const QByteArray
return;
// append the data buffer to the 'receivedData' string
QCString str( data, data.size() + 1 );
Q3CString str( data, data.size() + 1 );
d->providersListJob.receivedData.append( QString::fromUtf8( str ) );
}
......@@ -677,7 +677,7 @@ void NewStuffDialog::slotProvidersListResult( KIO::Job * job )
}
// clear the current list of providers
QValueList< Provider * >::iterator it = d->providers.begin(), iEnd = d->providers.end();
QList< Provider * >::iterator it = d->providers.begin(), iEnd = d->providers.end();
for ( ; it != iEnd; ++it )
delete *it;
d->providers.clear();
......@@ -759,7 +759,7 @@ void NewStuffDialog::slotProviderInfoData( KIO::Job * job, const QByteArray & da
return;
// append the data buffer to the 'receivedData' string
QCString str( data, data.size() + 1 );
Q3CString str( data, data.size() + 1 );
d->providerJobs[ job ].receivedData.append( QString::fromUtf8( str ) );
}
......
This diff is collapsed.
......@@ -19,13 +19,12 @@
#ifndef _KPDF_PAGEVIEW_H_
#define _KPDF_PAGEVIEW_H_
#include <qscrollview.h>
#include <q3scrollview.h>
#include <qvector.h>
#include <qlinkedlist.h>
#include "ui/pageviewutils.h"
#include "core/observer.h"
class KURL;
class KActionCollection;
class KPDFDocument;
......@@ -36,7 +35,7 @@ class PageViewPrivate;
* @short display of course :-)
* ...
*/
class PageView : public QScrollView, public DocumentObserver
class PageView : public Q3ScrollView, public DocumentObserver
{
Q_OBJECT
......@@ -83,7 +82,7 @@ class PageView : public QScrollView, public DocumentObserver
}
signals:
void urlDropped( const KURL& );
void urlDropped( const KUrl& );
void rightClick( const KPDFPage *, const QPoint & );
protected:
......@@ -117,7 +116,7 @@ class PageView : public QScrollView, public DocumentObserver
void updateZoom( ZoomMode newZm );
// update the text on the label using global zoom value or current page's one
void updateZoomText();
void textSelection( QLinkedList<QRect> * , const QColor & );
void textSelection( QList<QRect> * , const QColor & );
void textSelectionClear();
// updates cursor
void updateCursor( const QPoint &p );
......
......@@ -138,7 +138,7 @@ class SmoothPathEngine : public AnnotatorEngine
// use engine's color for painting
painter->setPen( QPen( m_engineColor, 1 ) );
QValueList<NormalizedPoint>::iterator pIt = points.begin(), pEnd = points.end();
QLinkedList<NormalizedPoint>::iterator pIt = points.begin(), pEnd = points.end();
NormalizedPoint pA = *pIt;
++pIt;
for ( ; pIt != pEnd; ++pIt )
......@@ -198,7 +198,7 @@ class SmoothPathEngine : public AnnotatorEngine
private:
// data
QValueList<NormalizedPoint> points;
QLinkedList<NormalizedPoint> points;
NormalizedRect totalRect;
NormalizedPoint lastPoint;
};
......@@ -357,7 +357,7 @@ class TwoPointsEngine : public AnnotatorEngine
}
private:
QValueList<NormalizedPoint> points;
QList<NormalizedPoint> points;
NormalizedRect rect;
bool m_block;
};
......@@ -415,7 +415,7 @@ void PageViewAnnotator::setEnabled( bool on )
}
// create the ToolBarItems from the XML dom tree
QValueList<ToolBarItem> items;
QLinkedList<ToolBarItem> items;
QDomNode toolDescription = m_toolsDefinition.firstChild();
while ( toolDescription.isElement() )
{
......@@ -505,8 +505,8 @@ if ( !item ) return; //STRAPAAAATCH !!! FIXME
m_lastDrawnRect = paintRect;
m_lastDrawnRect.moveBy( itemRect.left(), itemRect.top() );
// 3.2. decompose paint region in rects and send paint events
QMemArray<QRect> rects = compoundRegion.unite( m_lastDrawnRect ).rects();
for ( uint i = 0; i < rects.count(); i++ )
QVector<QRect> rects = compoundRegion.unite( m_lastDrawnRect ).rects();
for ( int i = 0; i < rects.count(); i++ )
m_pageView->updateContents( rects[i] );
}
......
......@@ -13,6 +13,7 @@
#include <ktoolbar.h>
class KPDFDocument;
class KLineEdit;
class m_inputDelayTimer;
class QAction;
......
......@@ -8,7 +8,7 @@
***************************************************************************/
// qt/kde includes
#include <qheader.h>
#include <q3header.h>
#include <qlayout.h>
#include <qtimer.h>
#include <ktoolbar.h>
......@@ -42,11 +42,12 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document )
// setup 1-UPPER toolbar and searchLine
m_searchLine = new KListViewSearchLine( m_toolBar1, m_listView );
m_toolBar1->setIconSize( 16 );
m_toolBar1->setMovingEnabled( false );
m_toolBar1->setIconDimensions( 16 );
m_toolBar1->setMovable( false );
// - add Clear button
QString clearIconName = KApplication::reverseLayout() ? "clear_left" : "locationbar_erase";
m_toolBar1->insertButton( clearIconName, 1, SIGNAL( clicked() ),
#warning lots of KToolBar code to port
/* m_toolBar1->insertButton( clearIconName, 1, SIGNAL( clicked() ),
m_searchLine, SLOT( clear() ), true, i18n( "Clear Filter" ) );
// - add Search line
m_toolBar1->insertWidget( 2, 0, m_searchLine );
......@@ -54,8 +55,8 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document )
m_toolBar1->getWidget( 2 )->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored );
// setup 2-LOWER toolbar
m_toolBar2->setIconSize( 16 );
m_toolBar2->setMovingEnabled( false );
m_toolBar2->setIconDimensions( 16 );
m_toolBar2->setMovable( false );
// - add Page button
m_toolBar2->insertButton( "txt", 1, SIGNAL( toggled( bool ) ),
this, SLOT( slotPageEnabled( bool ) ), true, i18n( "Group by Page" ) );
......@@ -72,7 +73,7 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document )
m_toolBar2->insertButton( "1downarrow", 3, SIGNAL( toggled( bool ) ),
this, SLOT( slotCurrentPageOnly( bool ) ), true, i18n( "Show reviews for current page only" ) );
m_toolBar2->setToggle( 3 );
m_toolBar2->setButton( 3, KpdfSettings::currentPageOnly() );
m_toolBar2->setButton( 3, KpdfSettings::currentPageOnly() );*/
// customize listview appearance
m_listView->addColumn( i18n("Annotation") );
......@@ -82,7 +83,7 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document )
}
//BEGIN DocumentObserver Notifies -> requestListViewUpdate
void Reviews::notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged )
void Reviews::notifySetup( const QVector< KPDFPage * > & pages, bool documentChanged )
{
// grab the page array when document changes
if ( documentChanged )
......@@ -151,17 +152,17 @@ void Reviews::slotCurrentPageOnly( bool on )
//END GUI Slots
class ReviewItem : public QListViewItem
class ReviewItem : public Q3ListViewItem
{
public:
ReviewItem( QListView * parent, const QString & text )
: QListViewItem( parent, text ) {}
ReviewItem( Q3ListView * parent, const QString & text )
: Q3ListViewItem( parent, text ) {}
void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
{
QColorGroup myCg = cg;
myCg.setColor( QColorGroup::Text, Qt::red );
QListViewItem::paintCell( p, myCg, column, width, align );
Q3ListViewItem::paintCell( p, myCg, column, width, align );
}
void paintFocus( QPainter *, const QColorGroup &, const QRect & )
{
......@@ -173,7 +174,7 @@ void Reviews::slotUpdateListView()
// reset listview to default
m_listView->clear();
m_listView->setRootIsDecorated( true );
m_listView->setSelectionMode( QListView::Single );
m_listView->setSelectionMode( Q3ListView::Single );
if ( KpdfSettings::currentPageOnly() )
{
......@@ -188,7 +189,7 @@ void Reviews::slotUpdateListView()
else
{
// grab all annotations from pages
QValueVector< KPDFPage * >::iterator it = m_pages.begin(), end = m_pages.end();
QVector< KPDFPage * >::iterator it = m_pages.begin(), end = m_pages.end();
for ( ; it != end; ++it )
{
const KPDFPage * page = *it;
......@@ -201,7 +202,7 @@ void Reviews::slotUpdateListView()
if ( !m_listView->firstChild() )
{
m_listView->setRootIsDecorated( false );
m_listView->setSelectionMode( QListView::NoSelection );
m_listView->setSelectionMode( Q3ListView::NoSelection );
new ReviewItem( m_listView, i18n("<No Items>") );
}
}
......@@ -209,25 +210,25 @@ void Reviews::slotUpdateListView()
void Reviews::addContents( const KPDFPage * page )
{
// if page-grouping -> create Page subnode
QListViewItem * pageItem = 0;
Q3ListViewItem * pageItem = 0;
if ( KpdfSettings::groupByPage() )
{
QString pageText = i18n( "page %1" ).arg( page->number() + 1 );
pageItem = new QListViewItem( m_listView, pageText );
pageItem = new Q3ListViewItem( m_listView, pageText );
pageItem->setPixmap( 0, SmallIcon( "txt" ) );
pageItem->setOpen( KpdfSettings::groupByAuthor() );
}
// iterate over all annotations in this page
const QValueList< Annotation * > & annots = page->getAnnotations();
QValueList< Annotation * >::const_iterator aIt = annots.begin(), aEnd = annots.end();
const QLinkedList< Annotation * > & annots = page->getAnnotations();
QLinkedList< Annotation * >::const_iterator aIt = annots.begin(), aEnd = annots.end();
for ( ; aIt != aEnd; ++aIt )
{
// get annotation
Annotation * annotation = *aIt;
// if page-grouping -> create Author subnode
QListViewItem * authorItem = pageItem;
Q3ListViewItem * authorItem = pageItem;
if ( KpdfSettings::groupByAuthor() )
{
// get author's name
......@@ -244,18 +245,18 @@ void Reviews::addContents( const KPDFPage * page )
if ( !authorItem )
{
if ( pageItem )
authorItem = new QListViewItem( pageItem, author );
authorItem = new Q3ListViewItem( pageItem, author );
else
authorItem = new QListViewItem( m_listView, author );
authorItem = new Q3ListViewItem( m_listView, author );
QString icon = author != i18n( "Unknown" ) ? "personal" : "presence_away";
authorItem->setPixmap( 0, SmallIcon( icon ) );
}
}
// create Annotation subnode
QListViewItem * singleItem = authorItem ?
new QListViewItem( authorItem, annotation->contents ) :
new QListViewItem( m_listView, annotation->contents );
Q3ListViewItem * singleItem = authorItem ?
new Q3ListViewItem( authorItem, annotation->contents ) :
new Q3ListViewItem( m_listView, annotation->contents );
singleItem->setPixmap( 0, SmallIcon( "kpdf" ) );
}
}
......
......@@ -11,7 +11,7 @@
#define _KPDF_SIDE_REVIEWS_H_
#include <qwidget.h>
#include <qvaluevector.h>
#include <qvector.h>
#include "core/observer.h"
class KPDFDocument;
......@@ -32,7 +32,7 @@ class Reviews : public QWidget, public DocumentObserver
// [INHERITED] from DocumentObserver
uint observerId() const { return REVIEWS_ID; }
void notifySetup( const QValueVector< KPDFPage * > & pages, bool );
void notifySetup( const QVector< KPDFPage * > & pages, bool );
void notifyViewportChanged( bool smoothMove );
void notifyPageChanged( int pageNumber, int changedFlags );
......@@ -55,7 +55,7 @@ class Reviews : public QWidget, public DocumentObserver
KListViewSearchLine * m_searchLine;
// internal storage
KPDFDocument * m_document;
QValueVector< KPDFPage * > m_pages;
QVector< KPDFPage * > m_pages;
QTimer * m_delayTimer;
int m_currentPage;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment