"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xpdf-qt/XpdfApp.cc" between
xpdf-4.01.01.tar.gz and xpdf-4.02.tar.gz

About: Xpdf is a PDF viewer for X.

XpdfApp.cc  (xpdf-4.01.01):XpdfApp.cc  (xpdf-4.02)
skipping to change at line 27 skipping to change at line 27
#include "GList.h" #include "GList.h"
#include "GlobalParams.h" #include "GlobalParams.h"
#include "XpdfViewer.h" #include "XpdfViewer.h"
#include "XpdfApp.h" #include "XpdfApp.h"
#include "gmempp.h" #include "gmempp.h"
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// command line options // command line options
//------------------------------------------------------------------------ //------------------------------------------------------------------------
static GBool openArg = gFalse;
static GBool reverseVideoArg = gFalse; static GBool reverseVideoArg = gFalse;
static char paperColorArg[256] = ""; static char paperColorArg[256] = "";
static char matteColorArg[256] = ""; static char matteColorArg[256] = "";
static char fsMatteColorArg[256] = ""; static char fsMatteColorArg[256] = "";
static char initialZoomArg[256] = ""; static char initialZoomArg[256] = "";
static char antialiasArg[16] = ""; static char antialiasArg[16] = "";
static char vectorAntialiasArg[16] = ""; static char vectorAntialiasArg[16] = "";
static char textEncArg[128] = ""; static char textEncArg[128] = "";
static char passwordArg[33] = ""; static char passwordArg[33] = "";
static GBool fullScreen = gFalse; static GBool fullScreen = gFalse;
static char remoteServerArg[256] = ""; static char remoteServerArg[256] = "";
static char tabStateFile[256] = ""; static char tabStateFile[256] = "";
static char cfgFileArg[256] = ""; static char cfgFileArg[256] = "";
static GBool printCommandsArg = gFalse; static GBool printCommandsArg = gFalse;
static GBool printVersionArg = gFalse; static GBool printVersionArg = gFalse;
static GBool printHelpArg = gFalse; static GBool printHelpArg = gFalse;
static ArgDesc argDesc[] = { static ArgDesc argDesc[] = {
{"-open", argFlag, &openArg, 0, " open file using a default remote server"},
{"-rv", argFlag, &reverseVideoArg, 0, " reverse video"}, {"-rv", argFlag, &reverseVideoArg, 0, " reverse video"},
{"-papercolor", argString, paperColorArg, sizeof(paperColorArg), " color of paper background"}, {"-papercolor", argString, paperColorArg, sizeof(paperColorArg), " color of paper background"},
{"-mattecolor", argString, matteColorArg, sizeof(matteColorArg), " color of matte background"}, {"-mattecolor", argString, matteColorArg, sizeof(matteColorArg), " color of matte background"},
{"-fsmattecolor", argString, fsMatteColorArg, sizeof(fsMatteColorArg), " color of matte background in full-screen mode"}, {"-fsmattecolor", argString, fsMatteColorArg, sizeof(fsMatteColorArg), " color of matte background in full-screen mode"},
{"-z", argString, initialZoomArg, sizeof(initialZoomArg), " initial zoom level (percent, 'page', 'width')"}, {"-z", argString, initialZoomArg, sizeof(initialZoomArg), " initial zoom level (percent, 'page', 'width')"},
{"-aa", argString, antialiasArg, sizeof(antialiasArg), " enable font anti-aliasing: yes, no"}, {"-aa", argString, antialiasArg, sizeof(antialiasArg), " enable font anti-aliasing: yes, no"},
{"-aaVector", argString, vectorAntialiasArg, sizeof(vectorAntialiasArg), " enable vector anti-aliasing: yes, no"}, {"-aaVector", argString, vectorAntialiasArg, sizeof(vectorAntialiasArg), " enable vector anti-aliasing: yes, no"},
{"-enc", argString, textEncArg, sizeof(textEncArg), " output text encoding name"}, {"-enc", argString, textEncArg, sizeof(textEncArg), " output text encoding name"},
{"-pw", argString, passwordArg, sizeof(passwordArg), " password (for encrypted files)"}, {"-pw", argString, passwordArg, sizeof(passwordArg), " password (for encrypted files)"},
{"-fullscreen", argFlag, &fullScreen, 0, " run in full-screen (presentation) mode"}, {"-fullscreen", argFlag, &fullScreen, 0, " run in full-screen (presentation) mode"},
skipping to change at line 78 skipping to change at line 80
// XpdfApp // XpdfApp
//------------------------------------------------------------------------ //------------------------------------------------------------------------
XpdfApp::XpdfApp(int &argc, char **argv): XpdfApp::XpdfApp(int &argc, char **argv):
QApplication(argc, argv) QApplication(argc, argv)
{ {
XpdfViewer *viewer; XpdfViewer *viewer;
QLocalSocket *sock; QLocalSocket *sock;
QString sockName; QString sockName;
const char *fileName, *dest; const char *fileName, *dest;
GString *color; GString *color, *cmd;
GBool ok; GBool ok;
int pg, i; int pg, i;
setApplicationName("XpdfReader"); setApplicationName("XpdfReader");
setApplicationVersion(xpdfVersion); setApplicationVersion(xpdfVersion);
ok = parseArgs(argDesc, &argc, argv); ok = parseArgs(argDesc, &argc, argv);
if (!ok || printVersionArg || printHelpArg) { if (!ok || printVersionArg || printHelpArg) {
fprintf(stderr, "xpdf version %s\n", xpdfVersion); fprintf(stderr, "xpdf version %s\n", xpdfVersion);
fprintf(stderr, "%s\n", xpdfCopyright); fprintf(stderr, "%s\n", xpdfCopyright);
skipping to change at line 186 skipping to change at line 188
} else { } else {
delete sock; delete sock;
viewer = newWindow(gFalse, remoteServerArg); viewer = newWindow(gFalse, remoteServerArg);
for (i = 1; i < argc; ++i) { for (i = 1; i < argc; ++i) {
viewer->execCmd(argv[i], NULL); viewer->execCmd(argv[i], NULL);
} }
return; return;
} }
} }
//--- default remote server
if (openArg) {
sock = new QLocalSocket(this);
sockName = "xpdf_default";
sock->connectToServer(sockName, QIODevice::WriteOnly);
if (sock->waitForConnected(5000)) {
if (argc >= 2) {
cmd = GString::format("openFileIn({0:s},tab)\n", argv[1]);
sock->write(cmd->getCString());
delete cmd;
while (sock->bytesToWrite()) {
sock->waitForBytesWritten(5000);
}
}
delete sock;
::exit(0);
} else {
delete sock;
if (argc >= 2) {
// on Windows: xpdf.cc converts command line args to UTF-8
// on Linux: command line args are in the local 8-bit charset
#ifdef _WIN32
QString qFileName = QString::fromUtf8(argv[1]);
#else
QString qFileName = QString::fromLocal8Bit(argv[1]);
#endif
openInNewWindow(qFileName, 1, "", passwordArg, fullScreen, "default");
} else {
newWindow(fullScreen, "default");
}
return;
}
}
//--- load PDF file(s) requested on the command line //--- load PDF file(s) requested on the command line
if (argc >= 2) { if (argc >= 2) {
i = 1; i = 1;
while (i < argc) { while (i < argc) {
pg = 1; pg = 1;
dest = ""; dest = "";
if (i+1 < argc && argv[i+1][0] == ':') { if (i+1 < argc && argv[i+1][0] == ':') {
fileName = argv[i]; fileName = argv[i];
pg = atoi(argv[i+1] + 1); pg = atoi(argv[i+1] + 1);
i += 2; i += 2;
skipping to change at line 244 skipping to change at line 280
XpdfViewer *viewer = new XpdfViewer(this, fullScreen); XpdfViewer *viewer = new XpdfViewer(this, fullScreen);
viewers->append(viewer); viewers->append(viewer);
if (remoteServerName) { if (remoteServerName) {
viewer->startRemoteServer(remoteServerName); viewer->startRemoteServer(remoteServerName);
} }
viewer->show(); viewer->show();
return viewer; return viewer;
} }
GBool XpdfApp::openInNewWindow(QString fileName, int page, QString dest, GBool XpdfApp::openInNewWindow(QString fileName, int page, QString dest,
QString password, GBool fullScreen) { QString password, GBool fullScreen,
const char *remoteServerName) {
XpdfViewer *viewer; XpdfViewer *viewer;
viewer = XpdfViewer::create(this, fileName, page, dest, password, fullScreen); viewer = XpdfViewer::create(this, fileName, page, dest, password, fullScreen);
if (!viewer) { if (!viewer) {
return gFalse; return gFalse;
} }
viewers->append(viewer); viewers->append(viewer);
if (remoteServerName) {
viewer->startRemoteServer(remoteServerName);
}
viewer->tweakSize(); viewer->tweakSize();
viewer->show(); viewer->show();
return gTrue; return gTrue;
} }
void XpdfApp::closeWindowOrQuit(XpdfViewer *viewer) { void XpdfApp::closeWindowOrQuit(XpdfViewer *viewer) {
int i; int i;
viewer->close(); viewer->close();
for (i = 0; i < viewers->getLength(); ++i) { for (i = 0; i < viewers->getLength(); ++i) {
 End of changes. 6 change blocks. 
2 lines changed or deleted 42 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)