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 QString target(getenv("AFM_APP_INSTALL_DIR"));
34 qDebug("AFM_APP_INSTALL_DIR is " + target.toLatin1());
42 load_path = target + "/imports";
43 engine.addImportPath(load_path);
44 load_path = target + "/dummyimports";
45 engine.addImportPath(load_path);
46 load_path = target + "/main.qml";
48 engine.load(QUrl(load_path));
50 std::vector<int> surfaceIdList;
52 //maybe we can't call this function...
53 //surfaceIdList = mp_libHomeScreen->getAllSurfacesOfProcess(pid);
54 if(surfaceIdList.empty())
56 qDebug("surface list is empty");
60 qDebug("surface list is contained");
61 // it will be implemented as soon as possible
62 //mp_libHomeScreen->renderSurfaceToArea(surfaceIdList.at(0),FULLSCREEN);
67 qDebug("renderAppToAreaAllowed is denied");
68 delete mp_libHomeScreen;
73 delete mp_libHomeScreen;