#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 ¶m) |
| void | handleScript (const QString ¶m) |
| void | handleRun (const QString ¶m) |
| void | handleEval (const QString ¶m) |
| void | handleConsole () |
| void | handleScriptShort (const QString ¶m) |
| void | runCmdScripts (PdfEditWindow *w) |
| int | main (int argc, char *argv[]) |
Variables | |
| QString | appPath |
| bool | consoleMode = false |
| QStringList | runScript |
| QStringList | runScriptParam |
| QApplication * | q_App |
Main function
Handle commandline options and then open editor window(s)
| 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
| param | Parameter passed |
References util::setDebugLevel().
Referenced by main().
| void handleEval | ( | const QString & | param | ) |
handle -eval [code] parameter
Evaluate script code
| 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
| param | Parameter passed |
References runScript, and runScriptParam.
Referenced by main().
| void handleScript | ( | const QString & | param | ) |
handle -script [file] parameter
Run script file
| 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
| 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[] | |||
| ) |
Main - load settings, load translation and launch main window(s) according to settings and commandline parameters
| argc | Argument count | |
| argv | Commandline arguments |
Register annotation factories
References gui::app, APP_NAME, gui::applyLookAndFeel(), appPath, gui::ConsoleWindow::call(), CONFIG_DIR, consoleMode, debug::DBG_DBG, debug::DBG_INFO, debug::DBG_PANIC, debug::DBG_WARN, gui::ConsoleWindow::eval(), util::fatalError(), gui::globalSettings, guiPrintDbg, handleConsole(), handleDebug(), handleEval(), handleHelp(), handleParams(), handleRun(), handleScript(), handleScriptShort(), handleStopOpt(), handleVersion(), gui::ConsoleWindow::init(), optionHandler(), optionHandlerParam(), pdfedit_core_dev_init(), printHeaderErr(), q_App, Q_OUT, gui::Settings::read(), gui::ConsoleWindow::run(), runCmdScripts(), gui::ConsoleWindow::runFile(), runScript, runScriptParam, saveSettings(), util::setDefaultCharset(), and gui::Settings::write().
| void runCmdScripts | ( | PdfEditWindow * | w | ) |
Run scripts/code specified on commandline in given editor window
| 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().
| 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().