- QCoreApplication::setApplicationVersion("0.3.4");
-
- qDebug("%s, v%s", QCoreApplication::applicationName().toStdString().c_str(), QCoreApplication::applicationVersion().toStdString().c_str());
-
- MainWindow w;
- w.show();
-#ifdef __arm__
- // the WindowManager positions the surface correctly
-#endif
-#ifdef __i386__
- w.move(0, 0);
-#endif
-
-
-#ifdef __arm__
- qDebug("Running on ARM architecture");
-#endif
-#ifdef __i386__
- qDebug("Running on x86 architecture");
-#endif
+ QCoreApplication::setApplicationVersion("0.7.0");
+
+ QCommandLineParser parser;
+ parser.setApplicationDescription("AGL HomeScreen - see wwww... for more details");
+ parser.addHelpOption();
+ parser.addVersionOption();
+ QCommandLineOption quietOption(QStringList() << "q" << "quiet",
+ QCoreApplication::translate("main", "Be quiet. No outputs."));
+ parser.addOption(quietOption);
+ parser.process(a);
+
+ if (parser.isSet(quietOption))
+ {
+ qInstallMessageHandler(noOutput);
+ }
+
+ qDBusRegisterMetaType<AppInfo>();
+ qDBusRegisterMetaType<QList<AppInfo> >();
+
+ qmlRegisterType<ApplicationLauncher>("HomeScreen", 1, 0, "ApplicationLauncher");
+ qmlRegisterType<ApplicationModel>("Home", 1, 0, "ApplicationModel");
+ qmlRegisterType<StatusBarModel>("HomeScreen", 1, 0, "StatusBarModel");
+
+ QQmlApplicationEngine engine;
+
+ LayoutHandler* layoutHandler = new LayoutHandler();
+
+ HomeScreenControlInterface* hsci = new HomeScreenControlInterface();
+ QObject::connect(hsci, SIGNAL(newRequestGetSurfaceStatus(int)), layoutHandler, SLOT(requestGetSurfaceStatus(int)));
+ QObject::connect(hsci, SIGNAL(newRequestsToBeVisibleApp(int)), layoutHandler, SLOT(makeMeVisible(int)));
+ QObject::connect(hsci, SIGNAL(newRequestRenderSurfaceToArea(int, int)), layoutHandler, SLOT(requestRenderSurfaceToArea(int,int)));
+ QObject::connect(hsci, SIGNAL(newRequestRenderSurfaceToAreaAllowed(int, int)), layoutHandler, SLOT(requestRenderSurfaceToAreaAllowed(int,int)));
+ QObject::connect(hsci, SIGNAL(newRequestSurfaceIdToFullScreen(int)), layoutHandler, SLOT(requestSurfaceIdToFullScreen(int)));
+
+ engine.rootContext()->setContextProperty("layoutHandler", layoutHandler);
+
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));