#ifdef GUI_APP
#  include "ui.h"
#else
#  include "DocConvert.h"
#endif


extern void runTests();


int main(int argc, char* argv[])
{
/*
    // Qt MDI Example does this:
    Q_INIT_RESOURCE(mdi);
    QApplication app(argc, argv);
    QCoreApplication::setApplicationVersion(QT_VERSION_STR);
    QCommandLineParser parser;
    parser.setApplicationDescription("Qt MDI Example");
    parser.addHelpOption();
    parser.addVersionOption();
    parser.addPositionalArgument("file", "The file to open.");
    parser.process(app);

    MainWindow mainWin;
    foreach (const QString &fileName, parser.positionalArguments())
        mainWin.openFile(fileName);
    mainWin.show();
    return app.exec();
*/

#ifdef GUI_APP
    QApplication app(argc, argv);
    UiContext ui;
    ui.setupUi();
    //YQ_LOG_DEBUG("This is a test message");
    //runTests();
    app.exec();
#else
    DocConvert convertor;
    convertor.SetTitle("Test Markdown to PDF");
    convertor.SetSource("test/test.md");
    convertor.OutputHTML("test/test.html");
    convertor.OutputPDF("test/test.pdf");
#endif

/*
	fprintf(stderr, "HERE!\n\n\n");
	QApplication app2(argc, argv);
	QLabel l(0);
	l.setText("Hello!");
	l.show();
	app2.exec();
*/

	return 0;
}

