2 * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <QCoreApplication>
18 #include <QCommandLineParser>
19 #include "windowmanager.hpp"
22 void noOutput(QtMsgType, const QMessageLogContext &, const QString &)
26 int main(int argc, char *argv[])
28 QCoreApplication a(argc, argv);
30 QCoreApplication::setOrganizationDomain("LinuxFoundation");
31 QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
32 QCoreApplication::setApplicationName("WindowManager");
33 QCoreApplication::setApplicationVersion("0.7.0");
35 QCommandLineParser parser;
36 parser.setApplicationDescription("AGL WindowManager - see wwww... for more details");
37 parser.addHelpOption();
38 parser.addVersionOption();
39 QCommandLineOption quietOption(QStringList() << "q" << "quiet",
40 QCoreApplication::translate("main", "Be quiet. No outputs."));
41 parser.addOption(quietOption);
42 QCommandLineOption displayOption(QStringList() << "d" << "display-id",
43 QCoreApplication::translate("main", "The display with this <id> to manage. Default=0"),
44 QCoreApplication::translate("main", "id"));
45 parser.addOption(displayOption);
48 if (parser.isSet(quietOption))
50 qInstallMessageHandler(noOutput);
54 if (parser.isSet(displayOption))
56 displayId = parser.value(displayOption).toInt();
58 qDebug() << "Using display" << displayId;
60 qDBusRegisterMetaType<SimplePoint>();
61 qDBusRegisterMetaType<QList<SimplePoint> >();
62 qDBusRegisterMetaType<LayoutArea>();
63 qDBusRegisterMetaType<QList<LayoutArea> >();
64 qDBusRegisterMetaType<Layout>();
65 qDBusRegisterMetaType<QList<Layout> >();
67 WindowManager *windowManager = new WindowManager(displayId);
68 windowManager->start();
71 qDebug("Running on ARM architecture");
74 qDebug("Running on x86 architecture");