X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=WindowManager%2Fsrc%2Fmain.cpp;h=5526c92689cae4ed08fc1a98c8f93dac6f23793e;hb=09f2f0036f122e49aa49e6c446d723850192a725;hp=14e0e008e758fd3e8625043e2c2ceb2877b25733;hpb=0a468d9b5ae7b3e5ba106facf17698d89b1ce200;p=staging%2FHomeScreen.git diff --git a/WindowManager/src/main.cpp b/WindowManager/src/main.cpp index 14e0e00..5526c92 100644 --- a/WindowManager/src/main.cpp +++ b/WindowManager/src/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +15,64 @@ */ #include +#include #include "windowmanager.hpp" + +void noOutput(QtMsgType, const QMessageLogContext &, const QString &) +{ +} + int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); - // used for application settings (QSettings) QCoreApplication::setOrganizationDomain("LinuxFoundation"); QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); QCoreApplication::setApplicationName("WindowManager"); - QCoreApplication::setApplicationVersion("0.2.0"); + QCoreApplication::setApplicationVersion("0.7.0"); + + QCommandLineParser parser; + parser.setApplicationDescription("AGL WindowManager - see wwww... for more details"); + parser.addHelpOption(); + parser.addVersionOption(); + QCommandLineOption quietOption(QStringList() << "q" << "quiet", + QCoreApplication::translate("main", "Be quiet. No outputs.")); + parser.addOption(quietOption); + QCommandLineOption displayOption(QStringList() << "d" << "display-id", + QCoreApplication::translate("main", "The display with this to manage. Default=0"), + QCoreApplication::translate("main", "id")); + parser.addOption(displayOption); + parser.process(a); + + if (parser.isSet(quietOption)) + { + qInstallMessageHandler(noOutput); + } + + int displayId = 0; + if (parser.isSet(displayOption)) + { + displayId = parser.value(displayOption).toInt(); + } + qDebug() << "Using display" << displayId; + + qDBusRegisterMetaType(); + qDBusRegisterMetaType >(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType >(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType >(); + + WindowManager *windowManager = new WindowManager(displayId); + windowManager->start(); - WindowManager *windowManager = new WindowManager(); +#ifdef __arm__ + qDebug("Running on ARM architecture"); +#endif +#ifdef __i386__ + qDebug("Running on x86 architecture"); +#endif return a.exec(); }