summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-demo/recipes-appfw
diff options
context:
space:
mode:
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>2018-04-24 15:13:18 +0200
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>2018-04-28 00:28:55 +0200
commit4ac99c3a1447119363935fb986f5d9c05f032362 (patch)
treed4fdce1f65606af5111e6e4d5d21b198de9f2bf2 /meta-agl-profile-demo/recipes-appfw
parentbb0882c5dad030f676e424265ebcd869bb3ff899 (diff)
2nd part of the layer/profile rework [1/2]
Main goal of this is to move the agl-service-* bindings into the core and to unify common recipes like wayland/weston into meta-agl-profile-graphical. As a placeholder for recipes is meta-agl-profile-demo which are being reshuffled. TLDR: agl-service move to meta-agl-profile-core. wayland/weston moves to meta-agl-profile-graphical. This patchset needs the 2nd patchset of the series to build (meta-agl-demo). Bug-AGL: SPEC-145 , SPEC-876 , SPEC-877 v2: rebase including udiscs patches from meta-agl-demo Change-Id: I5e33f72d01707fa8b826d382bccaca3addcbbc47 Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-agl-profile-demo/recipes-appfw')
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-agl.bb16
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-automotive.bb16
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-connectivity.bb28
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-graphics.bb17
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-multimedia.bb15
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-native.bb17
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-navi-lbs.bb17
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-security.bb16
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-speech-services.bb16
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-web.bb16
-rw-r--r--meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw.bb25
11 files changed, 199 insertions, 0 deletions
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-agl.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-agl.bb
new file mode 100644
index 000000000..cc923fd4a
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-agl.bb
@@ -0,0 +1,16 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+AGL App Fw Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-agl \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-automotive.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-automotive.bb
new file mode 100644
index 000000000..333195b74
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-automotive.bb
@@ -0,0 +1,16 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Automotive Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-automotive \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-connectivity.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-connectivity.bb
new file mode 100644
index 000000000..fa45c97d6
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-connectivity.bb
@@ -0,0 +1,28 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Connectivity Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-connectivity \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ "
+
+AGL_APPS = " \
+ "
+# restricted due to dependency on Kernel >= 4.8 which is not available in all repositories
+AGL_APPS_append_m3ulcb = " agl-service-can-low-level "
+AGL_APPS_append_intel-corei7-64 = " agl-service-can-low-level "
+AGL_APPS_append_qemux86-64 = " agl-service-can-low-level "
+
+RDEPENDS_${PN}_append = " \
+ ${AGL_APPS} \
+ "
+
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-graphics.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-graphics.bb
new file mode 100644
index 000000000..1e707ce46
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-graphics.bb
@@ -0,0 +1,17 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Graphics Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-graphics \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ opencv \
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-multimedia.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-multimedia.bb
new file mode 100644
index 000000000..ed395f4f0
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-multimedia.bb
@@ -0,0 +1,15 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Multimedia Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-multimedia \
+ "
+
+RDEPENDS_${PN} += "\
+ agl-service-mediaplayer \
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-native.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-native.bb
new file mode 100644
index 000000000..a31c666ca
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-native.bb
@@ -0,0 +1,17 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Native App Fw Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-native \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ packagegroup-agl-appfw-native-qt5 \
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-navi-lbs.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-navi-lbs.bb
new file mode 100644
index 000000000..3e5c9b396
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-navi-lbs.bb
@@ -0,0 +1,17 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Navigation and Location-Based Services Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-navi-lbs \
+ "
+
+RDEPENDS_${PN} += "\
+ agl-service-gps \
+ agl-service-geoclue \
+ agl-service-geofence \
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-security.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-security.bb
new file mode 100644
index 000000000..3806899da
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-security.bb
@@ -0,0 +1,16 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Security Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-security \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-speech-services.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-speech-services.bb
new file mode 100644
index 000000000..5f716c21e
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-speech-services.bb
@@ -0,0 +1,16 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Speech Services Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-speech-services \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-web.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-web.bb
new file mode 100644
index 000000000..6da656573
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw-web.bb
@@ -0,0 +1,16 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework which required by \
+Web App Fw Subsystem"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw-web \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ "
diff --git a/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw.bb b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw.bb
new file mode 100644
index 000000000..cb5636bfd
--- /dev/null
+++ b/meta-agl-profile-demo/recipes-appfw/packagegroups/packagegroup-agl-appfw.bb
@@ -0,0 +1,25 @@
+SUMMARY = "The software for application framework of AGL IVI profile"
+DESCRIPTION = "A set of packages belong to AGL application framework"
+
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-agl-appfw \
+ "
+
+ALLOW_EMPTY_${PN} = "1"
+
+RDEPENDS_${PN} += "\
+ packagegroup-agl-appfw-automotive \
+ packagegroup-agl-appfw-connectivity \
+ packagegroup-agl-appfw-graphics \
+ packagegroup-agl-appfw-multimedia \
+ packagegroup-agl-appfw-navi-lbs \
+ packagegroup-agl-appfw-agl \
+ packagegroup-agl-appfw-native \
+ packagegroup-agl-appfw-web \
+ packagegroup-agl-appfw-security \
+ packagegroup-agl-appfw-speech-services \
+ "
"kt">char *app_id, const char *app_data, uint32_t app_state, uint32_t app_role) { (void) app_data; (void) agl_shell_desktop; Shell *aglShell = static_cast<Shell *>(data); qDebug() << "app_id " << app_id << " app_state " << app_state << " app_role " << app_role; /* ignore others apps */ if (app_role != AGL_SHELL_DESKTOP_APP_ROLE_POPUP && strcmp(app_id, my_app_id.toStdString().c_str())) return; if (app_state == AGL_SHELL_DESKTOP_APP_STATE_ACTIVATED) { /* if we've been already started */ if (started) return; /* we de-activate ourselves the first time we start, as we * start as visible: 'false' * * application_id event will not be sufficient to handle this * because at that time there might be a chance that we weren't * really 'activated'; meaning that we send the deactivate request, * before the compositor activated us; so we wait until we get * the activation event here, as at this stage we are sure we * are activated. * * Later activations of the alexa-viewer will end up here as * well, but we guard that with a local variable; also * de-activation will generate the event one more time, this * time with the AGL_SHELL_DESKTOP_APP_STATE_DEACTIVATED * app_state. */ started = true; qDebug() << "appplication " << app_id << " de-activated"; aglShell->deactivate_app(my_app_id); } } static const struct agl_shell_desktop_listener agl_shell_desk_listener = { application_id_event, application_id_state, }; static struct agl_shell_desktop * register_agl_shell_desktop(void) { struct wl_display *wl; struct wl_registry *registry; struct agl_shell_desktop *shell = nullptr; QPlatformNativeInterface *native = qApp->platformNativeInterface(); wl = static_cast<struct wl_display *>(native->nativeResourceForIntegration("display")); registry = wl_display_get_registry(wl); wl_registry_add_listener(registry, &registry_listener, &shell); // Roundtrip to get all globals advertised by the compositor wl_display_roundtrip(wl); wl_registry_destroy(registry); return shell; } bool check_template_supported(json_object *data) { json_object *jtype = NULL; json_object_object_get_ex(data, "type", &jtype); if(!jtype) { qWarning("render_template event missing type element"); return false; } const char *type_value = json_object_get_string(jtype); if(!type_value) { qWarning("render_template event type element not parsed"); return false; } // We only handle BodyTemplate[12] and WeatherTemplate, ignore // others if(!(strcmp(type_value, "BodyTemplate1") && strcmp(type_value, "BodyTemplate2") && strcmp(type_value, "WeatherTemplate"))) return true; return false; } void async_event_cb(const char *event, json_object *data, void *closure) { Shell *aglShell; if(!data) return; if (!closure) return; aglShell = static_cast<Shell *>(closure); qDebug() << "got async_event_cb()"; if(!strcmp(event, "vshl-capabilities/setDestination")) { // Slight hack here, there's currently no convenient place to hook up raising // the navigation app when a route is set by Alexa, so do so here for now. aglShell->activate_app(nullptr, "navigation", nullptr); } else if(!strcmp(event, "vshl-capabilities/render_template")) { // Raise ourselves, the UI code will receive the event as well and render it if(!check_template_supported(data)) { qDebug() << "Unsupported template type, ignoring!"; return; } aglShell->activate_app(nullptr, my_app_id, nullptr); } else if(!strcmp(event, "vshl-capabilities/clear_template")) { // Hide ourselves aglShell->deactivate_app(my_app_id); } } void subscribe_async_events(AfbClient &client) { const char *vshl_capabilities_nav_events[] = { "setDestination", NULL, }; const char **tmp = vshl_capabilities_nav_events; json_object *args = json_object_new_object(); json_object *actions = json_object_new_array(); while (*tmp) { json_object_array_add(actions, json_object_new_string(*tmp++)); } json_object_object_add(args, "actions", actions); if(json_object_array_length(actions)) { client.subscribe("vshl-capabilities", args, "navigation/subscribe"); } else { json_object_put(args); } // NOTE: Not subscribing to "clear_template", as it will be passed to // the app QML to handle by the libqtappfw wrapper. const char *vshl_capabilities_guimetadata_events[] = { "render_template", NULL, }; tmp = vshl_capabilities_guimetadata_events; args = json_object_new_object(); actions = json_object_new_array(); while (*tmp) { json_object_array_add(actions, json_object_new_string(*tmp++)); } json_object_object_add(args, "actions", actions); if(json_object_array_length(actions)) { client.subscribe("vshl-capabilities", args, "guimetadata/subscribe"); } else { json_object_put(args); } } int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); app.setDesktopFileName(my_app_id); QCommandLineParser parser; parser.addPositionalArgument("port", app.translate("main", "port for binding")); parser.addPositionalArgument("secret", app.translate("main", "secret for binding")); parser.addHelpOption(); parser.addVersionOption(); parser.process(app); QStringList positionalArguments = parser.positionalArguments(); QUrl bindingAddress; int port = 0; QString token; if (positionalArguments.length() == 2) { port = positionalArguments.takeFirst().toInt(); token = positionalArguments.takeFirst(); bindingAddress.setScheme(QStringLiteral("ws")); bindingAddress.setHost(QStringLiteral("localhost")); bindingAddress.setPort(port); bindingAddress.setPath(QStringLiteral("/api")); QUrlQuery query; query.addQueryItem(QStringLiteral("token"), token); bindingAddress.setQuery(query); } struct agl_shell_desktop *shell = register_agl_shell_desktop(); if (!shell) { qDebug() << "agl_shell_desktop extension missing"; exit(EXIT_FAILURE); } std::shared_ptr<struct agl_shell_desktop> agl_shell{shell, agl_shell_desktop_destroy}; Shell *aglShell = new Shell(agl_shell, &app); agl_shell_desktop_add_listener(shell, &agl_shell_desk_listener, aglShell); // before loading the QML we can tell the compositor that we'd like to // be a pop-up kind of window: we need to do this before creating the // window itself (either engine load or any of the comp.create()), or // we can use/designate another application to behave like that // // note that x and y initial positioning values have to be specified // here (the last two args) aglShell->set_window_props(nullptr, my_app_id, AGL_SHELL_DESKTOP_APP_ROLE_POPUP, 0, 0, 0, 0, 0, 0); // Load qml QQmlApplicationEngine engine; QQmlContext *context = engine.rootContext(); context->setContextProperty("homescreen", aglShell); context->setContextProperty("GuiMetadata", new GuiMetadata(bindingAddress, context)); QQmlComponent component(&engine, QUrl(QStringLiteral("qrc:/Main.qml"))); QObject *object = component.create(); // Update window position based on component (x, y) int x = QQmlProperty::read(object, "x").toInt(); int y = QQmlProperty::read(object, "y").toInt(); aglShell->set_window_props(nullptr, my_app_id, AGL_SHELL_DESKTOP_APP_ROLE_POPUP, x, y, 0, 0, 0, 0); // Create app framework client to handle events when window is not visible AfbClient client(port, token.toStdString()); client.set_event_callback(async_event_cb, static_cast<void *>(aglShell)); subscribe_async_events(client); return app.exec(); }