merged kde4 into trunk (yes, this removes ksvg :)

svn path=/trunk/KDE/kdegraphics/kdvi/; revision=439692
This commit is contained in:
Stephan Kulow 2005-07-28 17:16:52 +00:00
commit 88dd6ce9b4
34 changed files with 149 additions and 96 deletions

View file

@ -225,7 +225,7 @@ void TeXFontDefinition::mark_as_used(void)
// For virtual fonts, also go through the list of referred fonts
if (flags & TeXFontDefinition::FONT_VIRTUAL) {
QIntDictIterator<TeXFontDefinition> it(vf_table);
Q3IntDictIterator<TeXFontDefinition> it(vf_table);
while( it.current() ) {
it.current()->flags |= TeXFontDefinition::FONT_IN_USE;
++it;

View file

@ -19,7 +19,7 @@ class dviRenderer;
typedef void (dviRenderer::*set_char_proc)(unsigned int, unsigned int);
#include <kprocess.h>
#include <qintdict.h>
#include <q3intdict.h>
#include <qstring.h>
#include <stdio.h>
@ -90,7 +90,7 @@ class TeXFontDefinition {
TeXFont *font;
macro *macrotable; // used by (loaded) virtual fonts
QIntDict<TeXFontDefinition> vf_table; // used by (loaded) virtual fonts, list of fonts used by this vf,
Q3IntDict<TeXFontDefinition> vf_table; // used by (loaded) virtual fonts, list of fonts used by this vf,
// acessible by number
TeXFontDefinition *first_font; // used by (loaded) virtual fonts, list of fonts used by this vf

View file

@ -56,6 +56,8 @@
#include <qfile.h>
#include <qimage.h>
#include <qpainter.h>
//Added by qt3to4:
#include <QPixmap>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View file

@ -27,7 +27,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
#endif
QFile file( parent->filename );
if ( !file.open( IO_ReadOnly ) ) {
if ( !file.open( QIODevice::ReadOnly ) ) {
kdError(4300) << "TeXFont_TFM::TeXFont_TFM(): Could not read TFM file" << endl;
return;
}

View file

@ -281,7 +281,7 @@ dvifile::dvifile(QString fname, fontPool *pool)
QFile file(fname);
filename = file.name();
file.open( IO_ReadOnly );
file.open( QIODevice::ReadOnly );
size_of_file = file.size();
dviData.resize(size_of_file);
// Sets the end pointer for the bigEndianByteReader so that the
@ -357,7 +357,7 @@ bool dvifile::saveAs(const QString &filename)
return false;
QFile out(filename);
if (out.open( IO_Raw|IO_WriteOnly ) == false)
if (out.open( QIODevice::WriteOnly ) == false)
return false;
if (out.writeBlock ( (char *)(dvi_Data()), size_of_file ) == -1)
return false;

View file

@ -13,8 +13,10 @@
#include <stdio.h>
#include <qdatastream.h>
#include <qfile.h>
#include <qintdict.h>
#include <q3intdict.h>
#include <qstring.h>
//Added by qt3to4:
#include <Q3MemArray>
#include "bigEndianByteReader.h"
@ -36,7 +38,7 @@ class dvifile : public bigEndianByteReader
QString filename;
QString generatorString;
Q_UINT16 total_pages;
QMemArray<Q_UINT32> page_offset;
Q3MemArray<Q_UINT32> page_offset;
/** Saves the DVI file. Returns true on success. */
bool saveAs(const QString &filename);
@ -68,7 +70,7 @@ class dvifile : public bigEndianByteReader
KDVI ensures that the user is only informed once. */
bool sourceSpecialMarker;
QIntDict<TeXFontDefinition> tn_table;
Q3IntDict<TeXFontDefinition> tn_table;
/** Returns the number of centimeters per DVI unit in this DVI
file. */
@ -89,7 +91,7 @@ class dvifile : public bigEndianByteReader
/** Sets new DVI data; all old data is erased. EXPERIMENTAL, use
with care. */
void setNewData(QMemArray<Q_UINT8> newData) {dviData = newData;};
void setNewData(Q3MemArray<Q_UINT8> newData) {dviData = newData;};
/** Page numbers that appear in a DVI document need not be
ordered. Worse, page numbers need not be unique. This method
@ -114,7 +116,7 @@ class dvifile : public bigEndianByteReader
double cmPerDVIunit;
QMemArray<Q_UINT8> dviData;
Q3MemArray<Q_UINT8> dviData;
};
#endif //ifndef _DVIFILE_H

View file

@ -21,9 +21,12 @@
#include <qmessagebox.h>
#include <qpaintdevice.h>
#include <qpainter.h>
#include <qptrstack.h>
#include <qurl.h>
#include <qvbox.h>
#include <q3url.h>
#include <q3vbox.h>
//Added by qt3to4:
#include <QHBoxLayout>
#include <QMouseEvent>
#include <q3ptrstack.h>
#include <kapplication.h>
#include <kmessagebox.h>
@ -188,7 +191,7 @@ void dviRenderer::drawPage(double resolution, RenderedDocumentPage *page)
colorStack.clear();
globalColor = Qt::black;
QApplication::setOverrideCursor( waitCursor );
QApplication::setOverrideCursor( Qt::WaitCursor );
foreGroundPainter = page->getPainter();
if (foreGroundPainter != 0) {
errorMsg = QString::null;
@ -242,7 +245,7 @@ void dviRenderer::showThatSourceInformationIsPresent(void)
KDialogBase *dialog= new KDialogBase(i18n("KDVI: Information"), KDialogBase::Yes, KDialogBase::Yes, KDialogBase::Yes,
parentWidget, "information", true, true,KStdGuiItem::ok() );
QVBox *topcontents = new QVBox (dialog);
Q3VBox *topcontents = new Q3VBox (dialog);
topcontents->setSpacing(KDialog::spacingHint()*2);
topcontents->setMargin(KDialog::marginHint()*2);
@ -370,7 +373,7 @@ void dviRenderer::embedPostScript(void)
bool dviRenderer::isValidFile(const QString filename)
{
QFile f(filename);
if (!f.open(IO_ReadOnly))
if (!f.open(QIODevice::ReadOnly))
return FALSE;
unsigned char test[4];
@ -436,7 +439,7 @@ bool dviRenderer::setFile(const QString &fname)
return false;
}
QApplication::setOverrideCursor( waitCursor );
QApplication::setOverrideCursor( Qt::waitCursor );
dvifile *dviFile_new = new dvifile(filename, &font_pool);
if ((dviFile == 0) || (dviFile->filename != filename))
@ -542,9 +545,9 @@ bool dviRenderer::setFile(const QString &fname)
// Generate the list of bookmarks
bookmarks.clear();
QPtrStack<Bookmark> stack;
Q3PtrStack<Bookmark> stack;
stack.setAutoDelete (false);
QValueVector<PreBookmark>::iterator it;
Q3ValueVector<PreBookmark>::iterator it;
for( it = prebookmarks.begin(); it != prebookmarks.end(); ++it ) {
Bookmark *bmk = new Bookmark((*it).title, findAnchor((*it).anchorName));
if (stack.isEmpty())
@ -641,8 +644,8 @@ Anchor dviRenderer::parseReference(const QString &reference)
// document.
bool anchorForRefFileFound = false; // Flag that is set if source file anchors for the refFileName could be found at all
QValueVector<DVI_SourceFileAnchor>::iterator bestMatch = sourceHyperLinkAnchors.end();
QValueVector<DVI_SourceFileAnchor>::iterator it;
Q3ValueVector<DVI_SourceFileAnchor>::iterator bestMatch = sourceHyperLinkAnchors.end();
Q3ValueVector<DVI_SourceFileAnchor>::iterator it;
for( it = sourceHyperLinkAnchors.begin(); it != sourceHyperLinkAnchors.end(); ++it )
if (refFileName.stripWhiteSpace() == it->fileName.stripWhiteSpace()
|| refFileName.stripWhiteSpace() == it->fileName.stripWhiteSpace() + ".tex"

View file

@ -12,12 +12,15 @@
#include <qevent.h>
#include <qintdict.h>
#include <q3intdict.h>
#include <qpainter.h>
#include <qptrvector.h>
#include <qvaluestack.h>
#include <qvaluevector.h>
#include <q3ptrvector.h>
#include <q3valuestack.h>
#include <q3valuevector.h>
#include <qwidget.h>
//Added by qt3to4:
#include <QMouseEvent>
#include <Q3PointArray>
#include <kviewpart.h>
#include "anchor.h"
@ -83,7 +86,7 @@ struct drawinf {
TeXFontDefinition *fontp;
set_char_proc set_char_p;
QIntDict<TeXFontDefinition> *fonttable;
Q3IntDict<TeXFontDefinition> *fonttable;
TeXFontDefinition *_virtual;
};
@ -196,7 +199,7 @@ private:
void prescan_setChar(unsigned int ch);
/* */
QValueVector<PreBookmark> prebookmarks;
Q3ValueVector<PreBookmark> prebookmarks;
@ -228,7 +231,7 @@ private:
// List of source-hyperlinks on all pages. This vector is generated
// when the DVI-file is first loaded, i.e. when draw_part is called
// with PostScriptOutPutString != NULL
QValueVector<DVI_SourceFileAnchor> sourceHyperLinkAnchors;
Q3ValueVector<DVI_SourceFileAnchor> sourceHyperLinkAnchors;
// If not NULL, the text currently drawn represents a source
// hyperlink to the (relative) URL given in the string;
@ -243,11 +246,11 @@ private:
/** Stack for register compounds, used for the DVI-commands PUSH/POP
as explained in section 2.5 and 2.6.2 of the DVI driver standard,
Level 0, published by the TUG DVI driver standards committee. */
QValueStack<struct framedata> stack;
Q3ValueStack<struct framedata> stack;
/** A stack where color are stored, according to the documentation of
DVIPS */
QValueStack<QColor> colorStack;
Q3ValueStack<QColor> colorStack;
/** The global color is to be used when the color stack is empty */
QColor globalColor;
@ -281,7 +284,7 @@ private:
/** Data required for handling TPIC specials */
float penWidth_in_mInch;
QPointArray TPIC_path;
Q3PointArray TPIC_path;
Q_UINT16 number_of_elements_in_path;
struct drawinf currinf;

View file

@ -69,6 +69,8 @@
#include <qimage.h>
#include <qpainter.h>
#include <qfileinfo.h>
//Added by qt3to4:
#include <QPixmap>
extern QPainter *foreGroundPainter;

View file

@ -26,6 +26,9 @@
#include <qimage.h>
#include <qpainter.h>
#include <qpaintdevice.h>
//Added by qt3to4:
#include <QTextStream>
#include <Q3MemArray>
extern QPainter foreGroundPaint;
@ -132,7 +135,7 @@ void dviRenderer::prescan_embedPS(char *cp, Q_UINT8 *beginningOfSpecialCommand)
PS.append( " @setspecial\n" );
QFile file( EPSfilename );
if ( file.open( IO_ReadOnly ) ) {
if ( file.open( QIODevice::ReadOnly ) ) {
QTextStream stream( &file );
while ( !stream.atEnd() ) {
PS += stream.readLine().section( '%', 0, 0);
@ -148,7 +151,7 @@ void dviRenderer::prescan_embedPS(char *cp, Q_UINT8 *beginningOfSpecialCommand)
Q_UINT32 lengthOfOldSpecial = command_pointer - beginningOfSpecialCommand;
Q_UINT32 lengthOfNewSpecial = PS.length()+5;
QMemArray<Q_UINT8> newDVI(dviFile->size_of_file + lengthOfNewSpecial-lengthOfOldSpecial);
Q3MemArray<Q_UINT8> newDVI(dviFile->size_of_file + lengthOfNewSpecial-lengthOfOldSpecial);
Q_UINT8 *commandPtrSav = command_pointer;
Q_UINT8 *endPtrSav = end_pointer;
@ -463,7 +466,7 @@ void dviRenderer::prescan_ParseSourceSpecial(QString cp)
// "src:123file.tex" to positions in the DVI file
// extract the file name and the numeral part from the string
Q_UINT32 j;
Q_INT32 j;
for(j=0;j<cp.length();j++)
if (!cp.at(j).isNumber())
break;

View file

@ -18,6 +18,8 @@
#include "documentWidget.h"
#include "renderedDviPagePixmap.h"
#include "selection.h"
//Added by qt3to4:
#include <QMouseEvent>
DVIWidget::DVIWidget(QWidget* parent, PageView* sv, DocumentPageCache* cache, const char* name)
: DocumentWidget(parent, sv, cache, name)
@ -43,9 +45,9 @@ void DVIWidget::mousePressEvent(QMouseEvent* e)
}
// Check if the mouse is pressed on a source-hyperlink
if ((e->button() == MidButton) && (pageData->sourceHyperLinkList.size() > 0))
if ((e->button() == Qt::MidButton) && (pageData->sourceHyperLinkList.size() > 0))
{
for(unsigned int i=0; i<pageData->sourceHyperLinkList.size(); i++)
for(int i=0; i<pageData->sourceHyperLinkList.size(); i++)
{
if (pageData->sourceHyperLinkList[i].box.contains(e->pos()))
{
@ -77,7 +79,7 @@ void DVIWidget::mouseMoveEvent(QMouseEvent* e)
}
// Check if the cursor hovers over a sourceHyperlink.
for(unsigned int i=0; i<pageData->sourceHyperLinkList.size(); i++) {
for(int i=0; i<pageData->sourceHyperLinkList.size(); i++) {
if (pageData->sourceHyperLinkList[i].box.contains(e->pos())) {
clearStatusBarTimer.stop();

View file

@ -10,6 +10,9 @@
#define _DVIWIDGET_H_
#include <qwidget.h>
//Added by qt3to4:
#include <QMouseEvent>
#include <QPaintEvent>
#include "documentWidget.h"

View file

@ -12,6 +12,8 @@
#include <kprocio.h>
#include <qfile.h>
#include <qstringlist.h>
//Added by qt3to4:
#include <QTextStream>
#include "fontEncoding.h"
@ -45,7 +47,7 @@ fontEncoding::fontEncoding(const QString &encName)
#endif
QFile file( encFileName );
if ( file.open( IO_ReadOnly ) ) {
if ( file.open( QIODevice::ReadOnly ) ) {
// Read the file (excluding comments) into the QString variable
// 'fileContent'
QTextStream stream( &file );

View file

@ -13,7 +13,7 @@
#define _FONTENCODINGPOOL_H
#include <kprocio.h>
#include <qdict.h>
#include <q3dict.h>
#include <qstring.h>
#include "fontEncoding.h"
@ -26,7 +26,7 @@ class fontEncodingPool {
fontEncoding *findByName(const QString &name);
private:
QDict<fontEncoding> dictionary;
Q3Dict<fontEncoding> dictionary;
};
#endif

View file

@ -11,6 +11,8 @@
#include <kdebug.h>
#include <kprocio.h>
#include <qfile.h>
//Added by qt3to4:
#include <QTextStream>
#include "fontMap.h"
@ -60,7 +62,7 @@ fontMap::fontMap()
}
QFile file( map_fileName );
if ( file.open( IO_ReadOnly ) ) {
if ( file.open( QIODevice::ReadOnly ) ) {
QTextStream stream( &file );
QString line;
while ( !stream.atEnd() ) {

View file

@ -16,6 +16,8 @@
#include <qfile.h>
#include <qimage.h>
#include <qpainter.h>
//Added by qt3to4:
#include <QPixmap>
#include <stdlib.h>
#include "fontpool.h"

View file

@ -9,7 +9,7 @@
#include <../config.h>
#include <qmap.h>
#include <qptrlist.h>
#include <q3ptrlist.h>
#include <qstringlist.h>
#include <qobject.h>
@ -88,7 +88,7 @@ public:
QString status();
// This is the list which actually holds pointers to the fonts
QPtrList<TeXFontDefinition> fontList;
Q3PtrList<TeXFontDefinition> fontList;
// This method marks all fonts in the fontpool as "not in use". The
// fonts are, however, not removed from memory until the method

View file

@ -11,14 +11,14 @@
#include <kprogress.h>
#include <kpushbutton.h>
#include <qapplication.h>
#include <qframe.h>
#include <q3frame.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qvbox.h>
#include <q3vbox.h>
/*
* Constructs a fontProgressDialog which is a child of 'parent', with the
@ -38,24 +38,24 @@ fontProgressDialog::fontProgressDialog( QString helpIndex, QString label, QStrin
} else
enableLinkedHelp(false);
QVBox *page = makeVBoxMainWidget();
Q3VBox *page = makeVBoxMainWidget();
TextLabel1 = new QLabel( label, page, "TextLabel2" );
TextLabel1->setAlignment( int( QLabel::AlignCenter ) );
QWhatsThis::add( TextLabel1, whatsThis );
TextLabel1->setAlignment( int( Qt::AlignCenter ) );
TextLabel1->setWhatsThis( whatsThis );
QToolTip::add( TextLabel1, ttip );
if (progressbar) {
ProgressBar1 = new KProgress( page, "ProgressBar1" );
ProgressBar1->setFormat(i18n("%v of %m"));
QWhatsThis::add( ProgressBar1, whatsThis );
ProgressBar1->setWhatsThis( whatsThis );
QToolTip::add( ProgressBar1, ttip );
} else
ProgressBar1 = NULL;
TextLabel2 = new QLabel( "", page, "TextLabel2" );
TextLabel2->setAlignment( int( QLabel::AlignCenter ) );
QWhatsThis::add( TextLabel2, whatsThis );
TextLabel2->setAlignment( int( Qt::AlignCenter ) );
TextLabel2->setWhatsThis( whatsThis );
QToolTip::add( TextLabel2, ttip );
progress = 0;

View file

@ -8,7 +8,13 @@
#define FONT_GENERATION_H
#include <kdialogbase.h>
#include <qguardedptr.h>
#include <qpointer.h>
//Added by qt3to4:
#include <QLabel>
#include <QVBoxLayout>
#include <Q3Frame>
#include <QHBoxLayout>
#include <QGridLayout>
class KProcIO;
class KProgress;
@ -16,7 +22,7 @@ class KPushButton;
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QFrame;
class Q3Frame;
class QLabel;
@ -65,7 +71,7 @@ private:
QLabel* TextLabel1;
KProgress* ProgressBar1;
int progress;
QGuardedPtr<KProcIO> procIO;
QPointer<KProcIO> procIO;
};
#endif // FONT_GENERATION_H

View file

@ -11,10 +11,13 @@
#include <qlabel.h>
#include <qlayout.h>
#include <qregexp.h>
#include <qtextview.h>
#include <q3textview.h>
#include <qtooltip.h>
#include <qvariant.h>
#include <qwhatsthis.h>
//Added by qt3to4:
#include <QVBoxLayout>
#include <Q3Frame>
#include "dviFile.h"
#include "fontpool.h"
@ -25,26 +28,26 @@ infoDialog::infoDialog( QWidget* parent )
{
QFrame *page1 = addPage( i18n("DVI File") );
QVBoxLayout *topLayout1 = new QVBoxLayout( page1, 0, 6 );
TextLabel1 = new QTextView( page1, "TextLabel1" );
TextLabel1 = new Q3TextView( page1, "TextLabel1" );
QToolTip::add( TextLabel1, i18n("Information on the currently loaded DVI-file.") );
topLayout1->addWidget( TextLabel1 );
QFrame *page2 = addPage( i18n("Fonts") );
QVBoxLayout *topLayout2 = new QVBoxLayout( page2, 0, 6 );
TextLabel2 = new QTextView( page2, "TextLabel1" );
TextLabel2 = new Q3TextView( page2, "TextLabel1" );
TextLabel2->setMinimumWidth(fontMetrics().maxWidth()*40);
TextLabel2->setMinimumHeight(fontMetrics().height()*10);
QToolTip::add( TextLabel2, i18n("Information on currently loaded fonts.") );
QWhatsThis::add( TextLabel2, i18n("This text field shows detailed information about the currently loaded fonts. "
TextLabel2->setWhatsThis( i18n("This text field shows detailed information about the currently loaded fonts. "
"This is useful for experts who want to locate problems in the setup of TeX or KDVI.") );
topLayout2->addWidget( TextLabel2 );
QFrame *page3 = addPage( i18n("External Programs") );
QVBoxLayout *topLayout3 = new QVBoxLayout( page3, 0, 6 );
TextLabel3 = new QTextView( page3, "TextLabel1" );
TextLabel3 = new Q3TextView( page3, "TextLabel1" );
TextLabel3->setText( i18n("No output from any external program received.") );
QToolTip::add( TextLabel3, i18n("Output of external programs.") );
QWhatsThis::add( TextLabel3, i18n("KDVI uses external programs, such as MetaFont, dvipdfm or dvips. "
TextLabel3->setWhatsThis( i18n("KDVI uses external programs, such as MetaFont, dvipdfm or dvips. "
"This text field shows the output of these programs. "
"That is useful for experts who want to find problems in the setup of TeX or KDVI.") );
topLayout3->addWidget( TextLabel3 );

View file

@ -8,6 +8,11 @@
#include <qstring.h>
#include <qvariant.h>
//Added by qt3to4:
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include <kdialogbase.h>
class dvifile;
@ -18,8 +23,8 @@ class QGridLayout;
class QLabel;
class KPushButton;
class QTabWidget;
class QTable;
class QTextView;
class Q3Table;
class Q3TextView;
class QWidget;
class fontPool;
@ -35,9 +40,9 @@ public:
"no file loaded" */
void setDVIData(dvifile *dviFile);
QTextView* TextLabel1;
QTextView* TextLabel2;
QTextView* TextLabel3;
Q3TextView* TextLabel1;
Q3TextView* TextLabel2;
Q3TextView* TextLabel3;
public slots:
/** This slot is called when Output from the MetaFont programm

View file

@ -13,6 +13,9 @@
#include <kstdaction.h>
#include <ktip.h>
#include <qtimer.h>
//Added by qt3to4:
#include <QMouseEvent>
#include <Q3ValueList>
#include <kparts/part.h>
#include <kparts/genericfactory.h>
@ -374,10 +377,10 @@ void KDVIMultiPage::print()
// List of pages to print.
QValueList<int> pageList = printer->pageList();
Q3ValueList<int> pageList = printer->pageList();
dvips_options += "-pp ";
int commaflag = 0;
for( QValueList<int>::ConstIterator it = pageList.begin(); it != pageList.end(); ++it ) {
for( Q3ValueList<int>::ConstIterator it = pageList.begin(); it != pageList.end(); ++it ) {
if (commaflag == 1)
dvips_options += QString(",");
else

View file

@ -32,7 +32,9 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <qapplication.h>
#include <qprogressdialog.h>
#include <q3progressdialog.h>
//Added by qt3to4:
#include <QTextStream>
#include "documentWidget.h"
#include "kdvi_multipage.h"
@ -80,10 +82,10 @@ void KDVIMultiPage::doExportText(void)
}
QFile textFile(fileName);
textFile.open( IO_WriteOnly );
textFile.open( QIODevice::WriteOnly );
QTextStream stream( &textFile );
QProgressDialog progress( i18n("Exporting to text..."), i18n("Abort"), DVIRenderer.totalPages(), scrollView(), "export_text_progress", TRUE );
Q3ProgressDialog progress( i18n("Exporting to text..."), i18n("Abort"), DVIRenderer.totalPages(), scrollView(), "export_text_progress", TRUE );
progress.setMinimumDuration(300);
RenderedDocumentPagePixmap dummyPage;
@ -100,13 +102,13 @@ void KDVIMultiPage::doExportText(void)
// qApp->processEvents();
if ( progress.wasCancelled() )
if ( progress.wasCanceled() )
break;
dummyPage.setPageNumber(page);
DVIRenderer.drawPage(100.0, &dummyPage); // We gracefully ingore any errors (bad dvi-file, etc.) which may occur during draw_page()
for(unsigned int i=0; i<dummyPage.textBoxList.size(); i++)
for(int i=0; i<dummyPage.textBoxList.size(); i++)
stream << dummyPage.textBoxList[i].text << endl;
}

View file

@ -7,6 +7,8 @@
#include <klocale.h>
#include <kaboutdata.h>
#include <qdir.h>
//Added by qt3to4:
#include <Q3CString>
#include <stdlib.h>
@ -88,24 +90,28 @@ int main(int argc, char** argv)
app.dcopClient()->attach();
// We need to register as "kviewshell" to stay compatible with existing DCOP-skripts.
QCString id = app.dcopClient()->registerAs("unique-kviewshell");
Q3CString id = app.dcopClient()->registerAs("unique-kviewshell");
if (id.isNull())
kdError(4300) << "There was an error using dcopClient()->registerAs()." << endl;
QCStringList apps = app.dcopClient()->registeredApplications();
for ( QCStringList::Iterator it = apps.begin(); it != apps.end(); ++it )
DCOPCStringList apps = app.dcopClient()->registeredApplications();
for ( DCOPCStringList::Iterator it = apps.begin(); it != apps.end(); ++it )
{
if ((*it).find("kviewshell") == 0)
{
QByteArray data, replyData;
QCString replyType;
QDataStream arg(data, IO_WriteOnly);
Q3CString replyType;
QDataStream arg(&data, QIODevice::WriteOnly);
arg.setVersion(QDataStream::Qt_3_1);
bool result;
arg << qualPath.stripWhiteSpace();
if (!app.dcopClient()->call( *it, "kmultipage", "is_file_loaded(QString)", data, replyType, replyData))
kdError(4300) << "There was an error using DCOP." << endl;
else
{
QDataStream reply(replyData, IO_ReadOnly);
QDataStream reply(&replyData, QIODevice::ReadOnly);
reply.setVersion(QDataStream::Qt_3_1);
if (replyType == "bool")
{
reply >> result;

View file

@ -10,10 +10,10 @@
#include <kcombobox.h>
#include <kdebug.h>
#include <klocale.h>
#include <qbuttongroup.h>
#include <q3buttongroup.h>
#include <qcheckbox.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "../config.h"
#include "fontpool.h"
@ -22,7 +22,7 @@
// Constructs a optionDialogWidget_base which is a child of 'parent', with
// the name 'name' and widget flags set to 'f'.
optionDialogFontsWidget::optionDialogFontsWidget( QWidget* parent, const char* name, WFlags fl )
optionDialogFontsWidget::optionDialogFontsWidget( QWidget* parent, const char* name, Qt::WFlags fl )
: optionDialogFontsWidget_base( parent, name, fl )
{
#ifndef HAVE_FREETYPE
@ -31,7 +31,7 @@ optionDialogFontsWidget::optionDialogFontsWidget( QWidget* parent, const char*
kcfg_UseFontHints->setEnabled(false);
kcfg_UseFontHints->setChecked(false);
QToolTip::add(PFB_ButtonGroup, i18n("This version of KDVI does not support type 1 fonts."));
QWhatsThis::add(PFB_ButtonGroup, i18n("KDVI needs the FreeType library to access type 1 fonts. This library "
PFB_ButtonGroup->setWhatsThis( i18n("KDVI needs the FreeType library to access type 1 fonts. This library "
"was not present when KDVI was compiled. If you want to use type 1 "
"fonts, you must either install the FreeType library and recompile KDVI "
"yourself, or find a precompiled software package for your operating "

View file

@ -17,7 +17,7 @@ class optionDialogFontsWidget : public optionDialogFontsWidget_base
Q_OBJECT
public:
optionDialogFontsWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
optionDialogFontsWidget( QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0 );
~optionDialogFontsWidget();
};

View file

@ -39,7 +39,7 @@
<cstring>spacer11</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>

View file

@ -23,7 +23,7 @@
// Constructs a optionDialogWidget_base which is a child of 'parent', with
// the name 'name' and widget flags set to 'f'.
optionDialogSpecialWidget::optionDialogSpecialWidget( QWidget* parent, const char* name, WFlags fl )
optionDialogSpecialWidget::optionDialogSpecialWidget( QWidget* parent, const char* name, Qt::WFlags fl )
: optionDialogSpecialWidget_base( parent, name, fl )
{
// Set up the list of known and supported editors
@ -55,7 +55,7 @@ optionDialogSpecialWidget::optionDialogSpecialWidget( QWidget* parent, const ch
editorCommandString += "gnuclient -q +%l %f || xemacs +%l %f";
editorDescriptionString += i18n("Click 'Help' to learn how to set up XEmacs.");
for(unsigned int i=0; i<editorNameString.count(); i++)
for(int i=0; i<editorNameString.count(); i++)
editorChoice->insertItem(editorNameString[i]);
// Set the proper editor on the "Rendering-Page", try to recognize
// the editor command from the config-file. If the editor command is

View file

@ -17,7 +17,7 @@ class optionDialogSpecialWidget : public optionDialogSpecialWidget_base
Q_OBJECT
public:
optionDialogSpecialWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
optionDialogSpecialWidget( QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0 );
~optionDialogSpecialWidget();
public slots:

View file

@ -184,7 +184,7 @@
<cstring>spacer3</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>

View file

@ -13,6 +13,8 @@
#include <kprocio.h>
#include <qdir.h>
#include <qpainter.h>
//Added by qt3to4:
#include <QPixmap>
#include <stdio.h>
#include "dviFile.h"

6
psgs.h
View file

@ -12,7 +12,7 @@
#include <ktempfile.h>
#include <qstring.h>
#include <qintdict.h>
#include <q3intdict.h>
#include "../kviewshell/pageNumber.h"
@ -78,7 +78,7 @@ public:
private:
void gs_generate_graphics_file(PageNumber page, const QString &filename, long magnification);
QIntDict<pageInfo> pageList;
Q3IntDict<pageInfo> pageList;
double resolution; // in dots per inch
int pixel_page_w; // in pixels
@ -92,7 +92,7 @@ private:
// device can be found, something is badly wrong. In that case,
// "gsDevice" is set to an empty string, and
// gs_generate_graphics_file will return immediately.
QValueListIterator<QString> gsDevice;
Q3ValueListIterator<QString> gsDevice;
// A list of known devices, set by the constructor. This includes
// "png256", "pnm". If a device is found to not work, its name is

View file

@ -41,7 +41,7 @@ class RenderedDviPagePixmap : public RenderedDocumentPagePixmap
List of source-hyperlinks in the current page. This vector is
generated when the current page is drawn.
*/
QValueVector<Hyperlink> sourceHyperLinkList;
Q3ValueVector<Hyperlink> sourceHyperLinkList;
};
#endif

View file

@ -562,7 +562,7 @@ void dviRenderer::applicationDoSpecial(char *cp)
if (special_command.startsWith("ps:SDict begin [") && special_command.endsWith(" pdfmark end")) {
if (!currentlyDrawnPage->hyperLinkList.isEmpty()) {
QString targetName = special_command.section('(', 1, 1).section(')', 0, 0);
QValueVector<Hyperlink>::iterator it;
Q3ValueVector<Hyperlink>::iterator it;
for( it = currentlyDrawnPage->hyperLinkList.begin(); it != currentlyDrawnPage->hyperLinkList.end(); ++it )
if (it->linkText == "glopglyph")
it->linkText = targetName;