1 #include <QGuiApplication>
2 #include <QQmlApplicationEngine>
6 #include <libhomescreen.hpp> // use libhomescreen
7 #include "calledbyqml.h"
10 #define FULLSCREEN 1 // assume 1 is "fullscreen"
13 int main(int argc, char *argv[])
15 QGuiApplication app(argc, argv);
18 To use libhomescreen, add library path in project file(.pro)
20 LibHomeScreen *mp_libHomeScreen;
21 mp_libHomeScreen = new LibHomeScreen();
23 QQmlApplicationEngine engine;
25 engine.rootContext()->setContextProperty("hsa",&call_hsa);
30 enabled = mp_libHomeScreen->renderAppToAreaAllowed(appcategory, FULLSCREEN);
33 engine.addImportPath(QStringLiteral(":/imports"));
34 engine.addImportPath(QStringLiteral(":/dummyimports"));
36 engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
38 std::vector<int> surfaceIdList;
40 //maybe we can't call this function...
41 //surfaceIdList = mp_libHomeScreen->getAllSurfacesOfProcess(pid);
42 if(surfaceIdList.empty())
44 qDebug("surface list is empty");
48 qDebug("surface list is contained");
49 // it will be implemented as soon as possible
50 //mp_libHomeScreen->renderSurfaceToArea(surfaceIdList.at(0),FULLSCREEN);
55 qDebug("renderAppToAreaAllowed is denied");
56 delete mp_libHomeScreen;
61 delete mp_libHomeScreen;