main.cc File Reference

#include "qtcompat.h"
#include "args.h"
#include "config.h"
#include "consolewindow.h"
#include "optionwindow.h"
#include "pdfeditwindow.h"
#include "settings.h"
#include "util.h"
#include "version.h"
#include "kernel/cannotation.h"
#include "kernel/pdfedit-core-dev.h"
#include <iostream>
#include <qapplication.h>
#include <qdir.h>
#include <qtranslator.h>
#include <qstringlist.h>
#include <stdlib.h>
#include <time.h>
#include <utils/debug.h>

Functions

void saveSettings (void)
void handleHelp ()
void handleVersion ()
void handleDebug (const QString &param)
void handleScript (const QString &param)
void handleRun (const QString &param)
void handleEval (const QString &param)
void handleConsole ()
void handleScriptShort (const QString &param)
void runCmdScripts (PdfEditWindow *w)
int main (int argc, char *argv[])

Variables

QString appPath
bool consoleMode = false
QStringList runScript
QStringList runScriptParam
QApplication * q_App

Detailed Description

Main function
Handle commandline options and then open editor window(s)


Function Documentation

void handleConsole (  ) 

handle -console parameter
Run in commandline mode

References consoleMode.

Referenced by handleScriptShort(), and main().

void handleDebug ( const QString &  param  ) 

handle -d [n] parameter
Change debugging level

Parameters:
param Parameter passed

References util::setDebugLevel().

Referenced by main().

void handleEval ( const QString &  param  ) 

handle -eval [code] parameter
Evaluate script code

Parameters:
param Parameter passed

References runScript, and runScriptParam.

Referenced by main().

void handleHelp (  ) 

handle --help parameter
Print help to STDOUT and exit

References binName, util::CON, util::convertFromUnicode(), handleHelpOptions(), and printHeader().

Referenced by main().

void handleRun ( const QString &  param  ) 

handle -run [file] parameter
Run script file

Parameters:
param Parameter passed

References runScript, and runScriptParam.

Referenced by main().

void handleScript ( const QString &  param  ) 

handle -script [file] parameter
Run script file

Parameters:
param Parameter passed

References runScript, and runScriptParam.

Referenced by handleScriptShort(), and main().

void handleScriptShort ( const QString &  param  ) 

handle -s [file] parameter
Run script file + set console mode

Parameters:
param Parameter passed

References handleConsole(), and handleScript().

Referenced by main().

void handleVersion (  ) 

handle --version parameter
Print version to STDOUT and exit

References PDFEDIT_VERSION.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)
void runCmdScripts ( PdfEditWindow w  ) 

Run scripts/code specified on commandline in given editor window

Parameters:
w Editor window

References debug::DBG_DBG, gui::PdfEditWindow::eval(), guiPrintDbg, Q_OUT, gui::PdfEditWindow::run(), gui::PdfEditWindow::runFile(), runScript, and runScriptParam.

Referenced by main().

void saveSettings ( void   ) 

delete settings object (and save settings) This function is called at application exit

References gui::globalSettings.

Referenced by main().


Variable Documentation

QString appPath

Path to directory in which the binary resides

Referenced by gui::Settings::expand(), gui::Settings::initSettings(), and main().

bool consoleMode = false

run in commandline mode?

Referenced by handleConsole(), and main().

QApplication* q_App

QApplication - main application

Referenced by gui::PdfEditWindow::exitApp(), and main().

QStringList runScript

Types of scripts to run (commandline mode)

Referenced by handleEval(), handleRun(), handleScript(), main(), and runCmdScripts().

QStringList runScriptParam

Script parameters (script code/filename) (commandline mode)

Referenced by handleEval(), handleRun(), handleScript(), main(), and runCmdScripts().