From 20cd96660d4bfb44e0be5695f71a92d5fb53a143 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Fri, 10 Dec 2021 12:28:47 +0100 Subject: Remove dependency on old application framework and wayland As the Application FW is being reworked, drop all related dependencies in order to start with a simpler initial implementation. This commit also drops wayland-related code as it won't be needed anymore with the new framework. Bug-AGL: SPEC-4159 Signed-off-by: Marius Vlad Signed-off-by: Arnaud Ferraris Change-Id: Id268e1feee363c60b85411e822103259c1071a24 --- README.md | 33 +-- autobuild/agl/autobuild | 110 ------- autobuild/linux/autobuild | 110 ------- launcher.pro | 5 +- launcher/launcher.pro | 18 +- launcher/qml/Launcher.qml | 10 +- launcher/qml/images/blank_active.svg | 133 --------- launcher/qml/images/blank_inactive.svg | 76 ----- launcher/qml/images/connectivity_active.svg | 231 --------------- launcher/qml/images/connectivity_inactive.svg | 169 ----------- launcher/qml/images/dashboard_active.svg | 174 ----------- launcher/qml/images/dashboard_inactive.svg | 94 ------ launcher/qml/images/hvac_active.svg | 411 -------------------------- launcher/qml/images/hvac_inactive.svg | 349 ---------------------- launcher/qml/images/images.qrc | 30 -- launcher/qml/images/mediaplayer_active.svg | 172 ----------- launcher/qml/images/mediaplayer_inactive.svg | 111 ------- launcher/qml/images/mixer_active.svg | 370 ----------------------- launcher/qml/images/mixer_inactive.svg | 308 ------------------- launcher/qml/images/music_active.svg | 172 ----------- launcher/qml/images/music_inactive.svg | 111 ------- launcher/qml/images/navigation_active.svg | 245 --------------- launcher/qml/images/navigation_inactive.svg | 183 ------------ launcher/qml/images/phone_active.svg | 155 ---------- launcher/qml/images/phone_inactive.svg | 93 ------ launcher/qml/images/plus_active.svg | 180 ----------- launcher/qml/images/plus_inactive.svg | 88 ------ launcher/qml/images/poi_active.svg | 352 ---------------------- launcher/qml/images/poi_inactive.svg | 314 -------------------- launcher/qml/images/radio_active.svg | 318 -------------------- launcher/qml/images/radio_inactive.svg | 255 ---------------- launcher/qml/images/settings_active.svg | 176 ----------- launcher/qml/images/settings_inactive.svg | 114 ------- launcher/qml/images/video_active.svg | 177 ----------- launcher/qml/images/video_inactive.svg | 111 ------- launcher/qml/images/webbrowser_active.svg | 231 --------------- launcher/qml/images/webbrowser_inactive.svg | 165 ----------- launcher/src/appinfo.cpp | 50 ---- launcher/src/appinfo.h | 12 - launcher/src/homescreenhandler.cpp | 181 +----------- launcher/src/homescreenhandler.h | 15 +- launcher/src/main.cpp | 36 --- launcher/src/shell-desktop.cpp | 109 ------- launcher/src/shell-desktop.h | 102 ------- package/config.xml | 17 -- package/icon.svg | 279 ----------------- package/package.pro | 27 -- 47 files changed, 30 insertions(+), 7152 deletions(-) delete mode 100755 autobuild/agl/autobuild delete mode 100644 autobuild/linux/autobuild delete mode 100644 launcher/qml/images/blank_active.svg delete mode 100644 launcher/qml/images/blank_inactive.svg delete mode 100644 launcher/qml/images/connectivity_active.svg delete mode 100644 launcher/qml/images/connectivity_inactive.svg delete mode 100644 launcher/qml/images/dashboard_active.svg delete mode 100644 launcher/qml/images/dashboard_inactive.svg delete mode 100644 launcher/qml/images/hvac_active.svg delete mode 100644 launcher/qml/images/hvac_inactive.svg delete mode 100644 launcher/qml/images/mediaplayer_active.svg delete mode 100644 launcher/qml/images/mediaplayer_inactive.svg delete mode 100644 launcher/qml/images/mixer_active.svg delete mode 100644 launcher/qml/images/mixer_inactive.svg delete mode 100644 launcher/qml/images/music_active.svg delete mode 100644 launcher/qml/images/music_inactive.svg delete mode 100644 launcher/qml/images/navigation_active.svg delete mode 100644 launcher/qml/images/navigation_inactive.svg delete mode 100644 launcher/qml/images/phone_active.svg delete mode 100644 launcher/qml/images/phone_inactive.svg delete mode 100644 launcher/qml/images/plus_active.svg delete mode 100644 launcher/qml/images/plus_inactive.svg delete mode 100644 launcher/qml/images/poi_active.svg delete mode 100644 launcher/qml/images/poi_inactive.svg delete mode 100644 launcher/qml/images/radio_active.svg delete mode 100644 launcher/qml/images/radio_inactive.svg delete mode 100644 launcher/qml/images/settings_active.svg delete mode 100644 launcher/qml/images/settings_inactive.svg delete mode 100644 launcher/qml/images/video_active.svg delete mode 100644 launcher/qml/images/video_inactive.svg delete mode 100644 launcher/qml/images/webbrowser_active.svg delete mode 100644 launcher/qml/images/webbrowser_inactive.svg delete mode 100644 launcher/src/shell-desktop.cpp delete mode 100644 launcher/src/shell-desktop.h delete mode 100644 package/config.xml delete mode 100644 package/icon.svg delete mode 100644 package/package.pro diff --git a/README.md b/README.md index 62b4130..2d0e368 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,11 @@ -**Install SDK** +AGL Launcher graphical application -Install sdk following this URL from AGL website. -``` -http://docs.automotivelinux.org/docs/getting_started/en/dev/reference/setup-sdk-environment.html -``` +`launcher` is a simple graphical application launchern. -**Download source code** +AGL repo for source code: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/apps/launcher -Download launcher source code from AGL gerrit. +You can also clone the source repository by running the following command: ``` $ git clone https://gerrit.automotivelinux.org/gerrit/apps/launcher ``` - -**Build launcher application** - -Source SDK envirment and make. -``` -$ source /xdt/sdk/environment-setup- -$ cd launcher -$ mkdir build -$ cd build -$ qmake .. -$ make -``` -**Install launcher wgt** - -``` -$ scp package/launcher.wgt root@ -$ ssh root@ -$ afm-util install launcher -``` - -Reboot target board and launcher application will start by default. diff --git a/autobuild/agl/autobuild b/autobuild/agl/autobuild deleted file mode 100755 index bbbc13e..0000000 --- a/autobuild/agl/autobuild +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/make -f -# Copyright (C) 2015 - 2018 "IoT.bzh" -# Copyright (C) 2020 Konsulko Group -# Author "Romain Forlot" -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -THISFILE := $(lastword $(MAKEFILE_LIST)) -ROOT_DIR := $(abspath $(dir $(THISFILE))/../..) - -# Build directories -# Note that the debug directory is defined in relation to the release -# directory (BUILD_DIR), this needs to be kept in mind if over-riding -# it and building that widget types, the specific widget type variable -# (e.g. BUILD_DIR_DEBUG) may also need to be specified to yield the -# desired output hierarchy. -BUILD_DIR = $(ROOT_DIR)/build -BUILD_DIR_DEBUG = $(abspath $(BUILD_DIR)/../build-debug) - -# Output directory variable for use in pattern rules. -# This is intended for internal use only, hence the explicit override -# definition. -override OUTPUT_DIR = $(BUILD_DIR) - -# Final install directory for widgets -DEST = $(OUTPUT_DIR) - -# Default build type for release builds -BUILD_TYPE = release - -.PHONY: all help update install distclean -.PHONY: clean clean-release clean-debug clean-all -.PHONY: configure configure-release configure-debug -.PHONY: build build-release build-debug build-all -.PHONY: package package-release package-debug package-all - -help: - @echo "List of targets available:" - @echo "" - @echo "- all" - @echo "- help" - @echo "- clean" - @echo "- distclean" - @echo "- configure" - @echo "- build: compilation, link and prepare files for package into a widget" - @echo "- package: output a widget file '*.wgt'" - @echo "- install: install in $(DEST) directory" - @echo "" - @echo "Usage: ./autobuild/agl/autobuild package DEST=${HOME}/opt" - @echo "Don't use your build dir as DEST as wgt file is generated at this location" - -all: package-all - -# Target specific variable over-rides so static pattern rules can be -# used for the various type-specific targets. - -configure-debug build-debug package-debug clean-debug: OUTPUT_DIR = $(BUILD_DIR_DEBUG) -configure-debug build-debug package-debug: BUILD_TYPE = debug - -clean-release clean-debug: - @if [ -d $(OUTPUT_DIR) ]; then \ - $(MAKE) -C $(OUTPUT_DIR) $(CLEAN_ARGS) clean; \ - else \ - echo Nothing to clean; \ - fi - -clean: clean-release - -clean-all: clean-release clean-debug - -distclean: clean-all - -configure-release configure-debug: - @mkdir -p $(OUTPUT_DIR) - @if [ ! -f $(OUTPUT_DIR)/Makefile ]; then \ - (cd $(OUTPUT_DIR) && qmake CONFIG+=$(BUILD_TYPE) $(CONFIGURE_ARGS) $(ROOT_DIR)); \ - fi - -configure: configure-release - -build-release build-debug: build-%: configure-% - @$(MAKE) -C $(OUTPUT_DIR) $(BUILD_ARGS) all - -build: build-release - -build-all: build-release build-debug - -package-release package-debug: package-%: build-% - @cp $(OUTPUT_DIR)/package/*.wgt $(OUTPUT_DIR)/ - @if [ "$(abspath $(DEST))" != "$(abspath $(OUTPUT_DIR))" ]; then \ - mkdir -p $(DEST) && cp $(OUTPUT_DIR)/*.wgt $(DEST); \ - fi - - -package: package-release - -package-all: package-release package-debug - -install: build - @$(MAKE) -C $(BUILD_DIR) $(INSTALL_ARGS) install diff --git a/autobuild/linux/autobuild b/autobuild/linux/autobuild deleted file mode 100644 index bbbc13e..0000000 --- a/autobuild/linux/autobuild +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/make -f -# Copyright (C) 2015 - 2018 "IoT.bzh" -# Copyright (C) 2020 Konsulko Group -# Author "Romain Forlot" -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -THISFILE := $(lastword $(MAKEFILE_LIST)) -ROOT_DIR := $(abspath $(dir $(THISFILE))/../..) - -# Build directories -# Note that the debug directory is defined in relation to the release -# directory (BUILD_DIR), this needs to be kept in mind if over-riding -# it and building that widget types, the specific widget type variable -# (e.g. BUILD_DIR_DEBUG) may also need to be specified to yield the -# desired output hierarchy. -BUILD_DIR = $(ROOT_DIR)/build -BUILD_DIR_DEBUG = $(abspath $(BUILD_DIR)/../build-debug) - -# Output directory variable for use in pattern rules. -# This is intended for internal use only, hence the explicit override -# definition. -override OUTPUT_DIR = $(BUILD_DIR) - -# Final install directory for widgets -DEST = $(OUTPUT_DIR) - -# Default build type for release builds -BUILD_TYPE = release - -.PHONY: all help update install distclean -.PHONY: clean clean-release clean-debug clean-all -.PHONY: configure configure-release configure-debug -.PHONY: build build-release build-debug build-all -.PHONY: package package-release package-debug package-all - -help: - @echo "List of targets available:" - @echo "" - @echo "- all" - @echo "- help" - @echo "- clean" - @echo "- distclean" - @echo "- configure" - @echo "- build: compilation, link and prepare files for package into a widget" - @echo "- package: output a widget file '*.wgt'" - @echo "- install: install in $(DEST) directory" - @echo "" - @echo "Usage: ./autobuild/agl/autobuild package DEST=${HOME}/opt" - @echo "Don't use your build dir as DEST as wgt file is generated at this location" - -all: package-all - -# Target specific variable over-rides so static pattern rules can be -# used for the various type-specific targets. - -configure-debug build-debug package-debug clean-debug: OUTPUT_DIR = $(BUILD_DIR_DEBUG) -configure-debug build-debug package-debug: BUILD_TYPE = debug - -clean-release clean-debug: - @if [ -d $(OUTPUT_DIR) ]; then \ - $(MAKE) -C $(OUTPUT_DIR) $(CLEAN_ARGS) clean; \ - else \ - echo Nothing to clean; \ - fi - -clean: clean-release - -clean-all: clean-release clean-debug - -distclean: clean-all - -configure-release configure-debug: - @mkdir -p $(OUTPUT_DIR) - @if [ ! -f $(OUTPUT_DIR)/Makefile ]; then \ - (cd $(OUTPUT_DIR) && qmake CONFIG+=$(BUILD_TYPE) $(CONFIGURE_ARGS) $(ROOT_DIR)); \ - fi - -configure: configure-release - -build-release build-debug: build-%: configure-% - @$(MAKE) -C $(OUTPUT_DIR) $(BUILD_ARGS) all - -build: build-release - -build-all: build-release build-debug - -package-release package-debug: package-%: build-% - @cp $(OUTPUT_DIR)/package/*.wgt $(OUTPUT_DIR)/ - @if [ "$(abspath $(DEST))" != "$(abspath $(OUTPUT_DIR))" ]; then \ - mkdir -p $(DEST) && cp $(OUTPUT_DIR)/*.wgt $(DEST); \ - fi - - -package: package-release - -package-all: package-release package-debug - -install: build - @$(MAKE) -C $(BUILD_DIR) $(INSTALL_ARGS) install diff --git a/launcher.pro b/launcher.pro index b68702e..b9c007f 100644 --- a/launcher.pro +++ b/launcher.pro @@ -16,8 +16,5 @@ TEMPLATE = subdirs load(configure) -SUBDIRS = \ - launcher \ - package +SUBDIRS = launcher -package.depends += launcher diff --git a/launcher/launcher.pro b/launcher/launcher.pro index 110aedc..d99b09c 100644 --- a/launcher/launcher.pro +++ b/launcher/launcher.pro @@ -15,10 +15,10 @@ TEMPLATE = app TARGET = launcher -QT = qml quick websockets gui-private -CONFIG += c++11 link_pkgconfig wayland-scanner -DESTDIR = $${OUT_PWD}/../package/root/bin -PKGCONFIG += libhomescreen wayland-client +QT = qml quick gui-private +CONFIG += c++11 link_pkgconfig +DESTDIR = $${OUT_PWD} +PKGCONFIG += json-c CONFIG(release, debug|release) { QMAKE_POST_LINK = $(STRIP) --strip-unneeded $(TARGET) @@ -28,13 +28,11 @@ SOURCES += \ src/main.cpp \ src/applicationmodel.cpp \ src/appinfo.cpp \ - src/shell-desktop.cpp \ src/homescreenhandler.cpp HEADERS += \ src/applicationmodel.h \ src/appinfo.h \ - src/shell-desktop.h \ src/homescreenhandler.h OTHER_FILES += \ @@ -44,6 +42,8 @@ RESOURCES += \ qml/images/images.qrc \ qml/qml.qrc -AGL_SHELL_DESKTOP_PATH = $$system(pkg-config --variable=pkgdatadir agl-compositor-0.0.19-protocols) -WAYLANDCLIENTSOURCES += \ - $$AGL_SHELL_DESKTOP_PATH/agl-shell-desktop.xml +target.path = $${PREFIX}/usr/bin +target.files += $${OUT_PWD}/$${TARGET} +target.CONFIG = no_check_exist executable + +INSTALLS += target diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml index 347cdfb..befce07 100644 --- a/launcher/qml/Launcher.qml +++ b/launcher/qml/Launcher.qml @@ -22,18 +22,18 @@ import QtQuick.Window 2.13 import AppModel 1.0 ApplicationWindow { - width: container.width * container.scale - height: container.height * container.scale - property int pid: -1 + id: root + //width: container.width + //height: container.height + flags: Qt.FramelessWindowHint + visible: true Item { id: container anchors.centerIn: parent width: Window.width height: Window.height - //scale: screenInfo.scale_factor() - scale: 1 Image { anchors.centerIn: parent diff --git a/launcher/qml/images/blank_active.svg b/launcher/qml/images/blank_active.svg deleted file mode 100644 index 10c0a89..0000000 --- a/launcher/qml/images/blank_active.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/blank_inactive.svg b/launcher/qml/images/blank_inactive.svg deleted file mode 100644 index 2e467a6..0000000 --- a/launcher/qml/images/blank_inactive.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/connectivity_active.svg b/launcher/qml/images/connectivity_active.svg deleted file mode 100644 index 39d8e50..0000000 --- a/launcher/qml/images/connectivity_active.svg +++ /dev/null @@ -1,231 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/connectivity_inactive.svg b/launcher/qml/images/connectivity_inactive.svg deleted file mode 100644 index 4cb1c45..0000000 --- a/launcher/qml/images/connectivity_inactive.svg +++ /dev/null @@ -1,169 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/dashboard_active.svg b/launcher/qml/images/dashboard_active.svg deleted file mode 100644 index a826c0c..0000000 --- a/launcher/qml/images/dashboard_active.svg +++ /dev/null @@ -1,174 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/dashboard_inactive.svg b/launcher/qml/images/dashboard_inactive.svg deleted file mode 100644 index 9c26fe3..0000000 --- a/launcher/qml/images/dashboard_inactive.svg +++ /dev/null @@ -1,94 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/hvac_active.svg b/launcher/qml/images/hvac_active.svg deleted file mode 100644 index 44d3bd5..0000000 --- a/launcher/qml/images/hvac_active.svg +++ /dev/null @@ -1,411 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/hvac_inactive.svg b/launcher/qml/images/hvac_inactive.svg deleted file mode 100644 index 67918e6..0000000 --- a/launcher/qml/images/hvac_inactive.svg +++ /dev/null @@ -1,349 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/images.qrc b/launcher/qml/images/images.qrc index cef5f21..2e81208 100644 --- a/launcher/qml/images/images.qrc +++ b/launcher/qml/images/images.qrc @@ -1,35 +1,5 @@ AGL_HMI_Blue_Background_Car-01.png - connectivity_active.svg - connectivity_inactive.svg - dashboard_active.svg - dashboard_inactive.svg - hvac_active.svg - hvac_inactive.svg - mixer_active.svg - mixer_inactive.svg - mediaplayer_active.svg - mediaplayer_inactive.svg - music_active.svg - music_inactive.svg - navigation_active.svg - navigation_inactive.svg - phone_active.svg - phone_inactive.svg - poi_active.svg - poi_inactive.svg - radio_active.svg - radio_inactive.svg - settings_active.svg - settings_inactive.svg - video_active.svg - video_inactive.svg - webbrowser_active.svg - webbrowser_inactive.svg - blank_active.svg - blank_inactive.svg - plus_active.svg - plus_inactive.svg diff --git a/launcher/qml/images/mediaplayer_active.svg b/launcher/qml/images/mediaplayer_active.svg deleted file mode 100644 index d560c3a..0000000 --- a/launcher/qml/images/mediaplayer_active.svg +++ /dev/null @@ -1,172 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/mediaplayer_inactive.svg b/launcher/qml/images/mediaplayer_inactive.svg deleted file mode 100644 index b6ec056..0000000 --- a/launcher/qml/images/mediaplayer_inactive.svg +++ /dev/null @@ -1,111 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/mixer_active.svg b/launcher/qml/images/mixer_active.svg deleted file mode 100644 index 2cb3c07..0000000 --- a/launcher/qml/images/mixer_active.svg +++ /dev/null @@ -1,370 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/mixer_inactive.svg b/launcher/qml/images/mixer_inactive.svg deleted file mode 100644 index 32e69f0..0000000 --- a/launcher/qml/images/mixer_inactive.svg +++ /dev/null @@ -1,308 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/music_active.svg b/launcher/qml/images/music_active.svg deleted file mode 100644 index d560c3a..0000000 --- a/launcher/qml/images/music_active.svg +++ /dev/null @@ -1,172 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/music_inactive.svg b/launcher/qml/images/music_inactive.svg deleted file mode 100644 index b6ec056..0000000 --- a/launcher/qml/images/music_inactive.svg +++ /dev/null @@ -1,111 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/navigation_active.svg b/launcher/qml/images/navigation_active.svg deleted file mode 100644 index dc1fcd3..0000000 --- a/launcher/qml/images/navigation_active.svg +++ /dev/null @@ -1,245 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/navigation_inactive.svg b/launcher/qml/images/navigation_inactive.svg deleted file mode 100644 index 97fcf31..0000000 --- a/launcher/qml/images/navigation_inactive.svg +++ /dev/null @@ -1,183 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/phone_active.svg b/launcher/qml/images/phone_active.svg deleted file mode 100644 index e184f26..0000000 --- a/launcher/qml/images/phone_active.svg +++ /dev/null @@ -1,155 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/phone_inactive.svg b/launcher/qml/images/phone_inactive.svg deleted file mode 100644 index 7f26834..0000000 --- a/launcher/qml/images/phone_inactive.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/plus_active.svg b/launcher/qml/images/plus_active.svg deleted file mode 100644 index b8a56eb..0000000 --- a/launcher/qml/images/plus_active.svg +++ /dev/null @@ -1,180 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/plus_inactive.svg b/launcher/qml/images/plus_inactive.svg deleted file mode 100644 index 99d52e2..0000000 --- a/launcher/qml/images/plus_inactive.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/poi_active.svg b/launcher/qml/images/poi_active.svg deleted file mode 100644 index cb4bc0e..0000000 --- a/launcher/qml/images/poi_active.svg +++ /dev/null @@ -1,352 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/poi_inactive.svg b/launcher/qml/images/poi_inactive.svg deleted file mode 100644 index 09c8890..0000000 --- a/launcher/qml/images/poi_inactive.svg +++ /dev/null @@ -1,314 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/radio_active.svg b/launcher/qml/images/radio_active.svg deleted file mode 100644 index 64b329c..0000000 --- a/launcher/qml/images/radio_active.svg +++ /dev/null @@ -1,318 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/radio_inactive.svg b/launcher/qml/images/radio_inactive.svg deleted file mode 100644 index 4baac60..0000000 --- a/launcher/qml/images/radio_inactive.svg +++ /dev/null @@ -1,255 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/settings_active.svg b/launcher/qml/images/settings_active.svg deleted file mode 100644 index 5391a08..0000000 --- a/launcher/qml/images/settings_active.svg +++ /dev/null @@ -1,176 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/settings_inactive.svg b/launcher/qml/images/settings_inactive.svg deleted file mode 100644 index 882e3c4..0000000 --- a/launcher/qml/images/settings_inactive.svg +++ /dev/null @@ -1,114 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/video_active.svg b/launcher/qml/images/video_active.svg deleted file mode 100644 index 794a441..0000000 --- a/launcher/qml/images/video_active.svg +++ /dev/null @@ -1,177 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/video_inactive.svg b/launcher/qml/images/video_inactive.svg deleted file mode 100644 index 905d46f..0000000 --- a/launcher/qml/images/video_inactive.svg +++ /dev/null @@ -1,111 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/webbrowser_active.svg b/launcher/qml/images/webbrowser_active.svg deleted file mode 100644 index 70b4617..0000000 --- a/launcher/qml/images/webbrowser_active.svg +++ /dev/null @@ -1,231 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/qml/images/webbrowser_inactive.svg b/launcher/qml/images/webbrowser_inactive.svg deleted file mode 100644 index 09f34c9..0000000 --- a/launcher/qml/images/webbrowser_inactive.svg +++ /dev/null @@ -1,165 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/launcher/src/appinfo.cpp b/launcher/src/appinfo.cpp index 78c48ed..b669845 100644 --- a/launcher/src/appinfo.cpp +++ b/launcher/src/appinfo.cpp @@ -27,32 +27,18 @@ public: Private(const Private &other); QString id; - QString version; - int width; - int height; QString name; - QString description; - QString shortname; - QString author; QString iconPath; }; AppInfo::Private::Private() - : width(-1) - , height(-1) { } AppInfo::Private::Private(const Private &other) : QSharedData(other) , id(other.id) - , version(other.version) - , width(other.width) - , height(other.height) , name(other.name) - , description(other.description) - , shortname(other.shortname) - , author(other.author) , iconPath(other.iconPath) { } @@ -90,41 +76,11 @@ QString AppInfo::id() const return d->id; } -QString AppInfo::version() const -{ - return d->version; -} - -int AppInfo::width() const -{ - return d->width; -} - -int AppInfo::height() const -{ - return d->height; -} - QString AppInfo::name() const { return d->name; } -QString AppInfo::description() const -{ - return d->description; -} - -QString AppInfo::shortname() const -{ - return d->shortname; -} - -QString AppInfo::author() const -{ - return d->author; -} - QString AppInfo::iconPath() const { return d->iconPath; @@ -133,12 +89,6 @@ QString AppInfo::iconPath() const void AppInfo::read(const QJsonObject &json) { d->id = json["id"].toString(); - d->version = json["version"].toString(); - d->width = json["width"].toInt(); - d->height = json["height"].toInt(); d->name = json["name"].toString(); - d->description = json["description"].toString(); - d->shortname = json["shortname"].toString(); - d->author = json["author"].toString(); d->iconPath = json["iconPath"].toString(); } diff --git a/launcher/src/appinfo.h b/launcher/src/appinfo.h index e1b97e6..1d1953d 100644 --- a/launcher/src/appinfo.h +++ b/launcher/src/appinfo.h @@ -26,13 +26,7 @@ class AppInfo { Q_GADGET Q_PROPERTY(QString id READ id) - Q_PROPERTY(QString version READ version) - Q_PROPERTY(int width READ width) - Q_PROPERTY(int height READ height) Q_PROPERTY(QString name READ name) - Q_PROPERTY(QString description READ description) - Q_PROPERTY(QString shortname READ shortname) - Q_PROPERTY(QString author READ author) Q_PROPERTY(QString iconPath READ iconPath) public: AppInfo(); @@ -43,13 +37,7 @@ public: void swap(AppInfo &other) { qSwap(d, other.d); } QString id() const; - QString version() const; - int width() const; - int height() const; QString name() const; - QString description() const; - QString shortname() const; - QString author() const; QString iconPath() const; void read(const QJsonObject &json); diff --git a/launcher/src/homescreenhandler.cpp b/launcher/src/homescreenhandler.cpp index 4d98414..811daa0 100644 --- a/launcher/src/homescreenhandler.cpp +++ b/launcher/src/homescreenhandler.cpp @@ -15,74 +15,9 @@ * limitations under the License. */ -#include #include "homescreenhandler.h" -#include #include "hmi-debug.h" -#include -#include -#include - -#include "shell-desktop.h" - -void* HomescreenHandler::myThis = 0; - -static struct wl_output * -getWlOutput(QPlatformNativeInterface *native, QScreen *screen) -{ - void *output = native->nativeResourceForScreen("output", screen); - return static_cast(output); -} - -static void -global_add(void *data, struct wl_registry *reg, uint32_t name, - const char *interface, uint32_t version) -{ - struct agl_shell_desktop **shell = - static_cast(data); - - if (strcmp(interface, agl_shell_desktop_interface.name) == 0) { - *shell = static_cast( - wl_registry_bind(reg, name, &agl_shell_desktop_interface, version) - ); - } -} - -static void -global_remove(void *data, struct wl_registry *reg, uint32_t id) -{ - (void) data; - (void) reg; - (void) id; -} - -static const struct wl_registry_listener registry_listener = { - global_add, - global_remove, -}; - - -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(native->nativeResourceForIntegration("display")); - registry = wl_display_get_registry(wl); - - wl_registry_add_listener(registry, ®istry_listener, &shell); - // Roundtrip to get all globals advertised by the compositor - wl_display_roundtrip(wl); - wl_registry_destroy(registry); - - return shell; -} - HomescreenHandler::HomescreenHandler(QObject *parent) : QObject(parent) { } @@ -91,124 +26,22 @@ HomescreenHandler::~HomescreenHandler() { } -void HomescreenHandler::init(int port, const char *token, QString myname) -{ - myThis = this; - m_myname = myname; - - mp_hs = new LibHomeScreen(); - mp_hs->init(port, token); - mp_hs->registerCallback(nullptr, HomescreenHandler::onRep_static); - - struct agl_shell_desktop *agl_shell = register_agl_shell_desktop(); - if (!agl_shell) { - fprintf(stderr, "agl_shell extension is not advertised. " - "Are you sure that agl-compositor is running?\n"); - exit(EXIT_FAILURE); - } - - std::shared_ptr shell{agl_shell, agl_shell_desktop_destroy}; - this->aglShell = new Shell(shell, nullptr); - - mp_hs->set_event_handler(LibHomeScreen::Event_AppListChanged,[this](json_object *object){ - HMI_DEBUG("Launcher","laucher: appListChanged [%s]\n", json_object_to_json_string(object)); - - struct json_object *obj_param, *obj_oper, *obj_data; - if(json_object_object_get_ex(object, "parameter", &obj_param) - && json_object_object_get_ex(obj_param, "operation", &obj_oper) - && json_object_object_get_ex(obj_param, "data", &obj_data)) { - QString oper = json_object_get_string(obj_oper); - if(oper == "uninstall") { - /* { "application_id": "launcher", - * "type": "application-list-changed", - * "parameter":{ - * "operation": "uninstall", - * "data": "onstestapp@0.1" - * } - * } */ - QString id = json_object_get_string(obj_data); - QStringList info; - // icon, name, id - info << "" << "" << id; - emit appListUpdate(info); - } - else if(oper == "install") { - /* { "application_id": "launcher", - * "type": "application-list-changed", - * "parameter": { - * "operation": "install", - * "data": { - * "description":"This is a demo onstestapp application", - * "name": "onstestapp", - * "shortname": "", - * "id": "onstestapp@0.1", - * "version": "0.1", - * "author": "Qt", - * "author-email": "", - * "width": "", - * "height": "", - * "icon": "\/var\/local\/lib\/afm\/applications\/onstestapp\/0.1\/icon.svg", - * "http-port": 31022 - * } - * } - * } */ - struct json_object *obj_icon, *obj_name, *obj_id; - if(json_object_object_get_ex(obj_data, "icon", &obj_icon) - && json_object_object_get_ex(obj_data, "name", &obj_name) - && json_object_object_get_ex(obj_data, "id", &obj_id)) { - QString icon = json_object_get_string(obj_icon); - QString name = json_object_get_string(obj_name); - QString id = json_object_get_string(obj_id); - QStringList info; - // icon, name, id - info << icon << name << id; - emit appListUpdate(info); - } - } - else { - HMI_ERROR("Launcher","error operation.\n"); - } - } - }); -} - void HomescreenHandler::tapShortcut(QString application_id, QString output_name) { HMI_DEBUG("Launcher","tapShortcut %s", application_id.toStdString().c_str()); - struct json_object* j_json = json_object_new_object(); - struct json_object* value; - value = json_object_new_string("normal.full"); - json_object_object_add(j_json, "area", value); - - mp_hs->showWindow(application_id.toStdString().c_str(), j_json); - if (output_name.isEmpty()) - aglShell->activate_app(nullptr, application_id, nullptr); - else - aglShell->activate_app_by_screen(output_name, application_id, nullptr); -} - -void HomescreenHandler::onRep_static(struct json_object* reply_contents) -{ - static_cast(HomescreenHandler::myThis)->onRep(reply_contents); } void HomescreenHandler::onRep(struct json_object* reply_contents) { - HMI_DEBUG("launcher","HomeScreen onReply %s", json_object_to_json_string(reply_contents)); - struct json_object *obj_res, *obj_verb; - if(json_object_object_get_ex(reply_contents, "response", &obj_res) - && json_object_object_get_ex(obj_res, "verb", &obj_verb) - && !strcasecmp("getRunnables", json_object_get_string(obj_verb))) { - struct json_object *obj_data; - if(json_object_object_get_ex(obj_res, "data", &obj_data)) { - HMI_DEBUG("launcher","HomescreenHandler emit initAppList"); - QString data = json_object_to_json_string(obj_data); - emit initAppList(data); - } - } + if (reply_contents) { + QString data = json_object_to_json_string(reply_contents); + HMI_DEBUG("Launcher", "doing an emit initAppList()"); + emit initAppList(data); + } else { + HMI_DEBUG("Launcher", "reply contents is invalid!"); + } } void HomescreenHandler::getRunnables(void) { - mp_hs->getRunnables(); } diff --git a/launcher/src/homescreenhandler.h b/launcher/src/homescreenhandler.h index 471a663..c5d46b4 100644 --- a/launcher/src/homescreenhandler.h +++ b/launcher/src/homescreenhandler.h @@ -19,10 +19,11 @@ #define HOMESCREENHANDLER_H #include -#include +#include +#include #include -#include "shell-desktop.h" +#include using namespace std; @@ -33,24 +34,14 @@ public: explicit HomescreenHandler(QObject *parent = 0); ~HomescreenHandler(); - void init(int port, const char* token, QString myname); - Q_INVOKABLE void tapShortcut(QString application_id, QString output_name); Q_INVOKABLE void getRunnables(void); void onRep(struct json_object* reply_contents); - static void* myThis; - static void onRep_static(struct json_object* reply_contents); - signals: void initAppList(QString data); void appListUpdate(QStringList info); - -private: - LibHomeScreen *mp_hs; - Shell *aglShell; - QString m_myname; }; #endif // HOMESCREENHANDLER_H diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp index 22e600e..563e883 100644 --- a/launcher/src/main.cpp +++ b/launcher/src/main.cpp @@ -28,55 +28,19 @@ #include "applicationmodel.h" #include "appinfo.h" #include "homescreenhandler.h" -#include "hmi-debug.h" -#include "shell-desktop.h" int main(int argc, char *argv[]) { QString myname = QString("launcher"); QGuiApplication a(argc, argv); - //QCoreApplication::setOrganizationDomain("LinuxFoundation"); - //QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); - //QCoreApplication::setApplicationName(myname); - //QCoreApplication::setApplicationVersion("0.1.0"); - // necessary to identify correctly by app_id a.setDesktopFileName(myname); - QCommandLineParser parser; - parser.addPositionalArgument("port", a.translate("main", "port for binding")); - parser.addPositionalArgument("secret", a.translate("main", "secret for binding")); - parser.addHelpOption(); - parser.addVersionOption(); - parser.process(a); - QStringList positionalArguments = parser.positionalArguments(); - - int port = 1700; - QString token = "wm"; - - if (positionalArguments.length() == 2) { - port = positionalArguments.takeFirst().toInt(); - token = positionalArguments.takeFirst(); - } - - HMI_DEBUG("launcher","port = %d, token = %s", port, token.toStdString().c_str()); - // import C++ class to QML qmlRegisterType("AppModel", 1, 0, "ApplicationModel"); HomescreenHandler* homescreenHandler = new HomescreenHandler(); - homescreenHandler->init(port, token.toStdString().c_str(), myname); - - QUrl bindingAddress; - 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); // mail.qml loading QQmlApplicationEngine engine; diff --git a/launcher/src/shell-desktop.cpp b/launcher/src/shell-desktop.cpp deleted file mode 100644 index 8b78f6f..0000000 --- a/launcher/src/shell-desktop.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2020 Collabora Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "shell-desktop.h" -#include -#include - -static struct wl_output * -getWlOutput(QScreen *screen) -{ - QPlatformNativeInterface *native = qApp->platformNativeInterface(); - void *output = native->nativeResourceForScreen("output", screen); - return static_cast(output); -} - -void -Shell::activate_app(QWindow *win, const QString &app_id, - const QString &app_data) -{ - QScreen *screen = nullptr; - struct wl_output *output; - - if (!win || !win->screen()) { - screen = qApp->screens().first(); - } else { - screen = win->screen(); - } - - if (!screen) - return; - - output = getWlOutput(screen); - qDebug() << "will activate app: " << app_id; - agl_shell_desktop_activate_app(this->shell.get(), - app_id.toStdString().c_str(), - app_data.toStdString().c_str(), output); -} - -void -Shell::activate_app_by_screen(const QString &screen_name, const QString &app_id, - const QString &app_data) -{ - QScreen *qscreen_to_put = nullptr; - for (auto &ss: qApp->screens()) { - if (ss->name() == screen_name) { - qscreen_to_put = ss; - break; - } - } - - /* use the primary one */ - if (!qscreen_to_put) { - qscreen_to_put = qApp->screens().first(); - } - - struct wl_output *output = getWlOutput(qscreen_to_put); - qDebug() << "will activate app: " << app_id << " on output " << - qscreen_to_put->name(); - agl_shell_desktop_activate_app(this->shell.get(), - app_id.toStdString().c_str(), - app_data.toStdString().c_str(), output); -} - -void -Shell::deactivate_app(const QString &app_id) -{ - agl_shell_desktop_deactivate_app(this->shell.get(), - app_id.toStdString().c_str()); -} - -void -Shell::set_window_props(QWindow *win, const QString &app_id, - uint32_t props, int x, int y, int bx, int by, - int bwidth, int bheight) -{ - QScreen *screen = nullptr; - struct wl_output *output; - - if (!win || !win->screen()) { - screen = qApp->screens().first(); - } else { - screen = win->screen(); - } - - if (!screen) { - return; - } - - output = getWlOutput(screen); - agl_shell_desktop_set_app_property(this->shell.get(), - app_id.toStdString().c_str(), - props, x, y, bx, by, - bwidth, bheight, output); -} diff --git a/launcher/src/shell-desktop.h b/launcher/src/shell-desktop.h deleted file mode 100644 index fbd053b..0000000 --- a/launcher/src/shell-desktop.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2020 Collabora Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SHELLDESKTOP_H -#define SHELLDESKTOP_H - -#include -#include -#include -#include -#include -#include - - -#include "wayland-agl-shell-desktop-client-protocol.h" - -static void -application_id_event(void *data, struct agl_shell_desktop *agl_shell_desktop, - const char *app_id); -static void -application_state_event(void *data, struct agl_shell_desktop *agl_shell_desktop, - const char *app_id, const char *app_data, - uint32_t app_state, uint32_t app_role); - -static const struct agl_shell_desktop_listener agl_shell_desktop_listener = { - application_id_event, - application_state_event, -}; - -class Shell : public QObject -{ -Q_OBJECT - -public: - std::shared_ptr shell; - Shell(std::shared_ptr shell, QObject *parent = nullptr) : - QObject(parent), shell(shell) - { - struct agl_shell_desktop *agl_shell_desktop = shell.get(); - agl_shell_desktop_add_listener(agl_shell_desktop, - &agl_shell_desktop_listener, this); - } - -public slots: // calls out of qml into CPP - void activate_app(QWindow *win, const QString &app_id, const QString &app_data); - void activate_app_by_screen(const QString &screen_name, - const QString &app_id, - const QString &app_data); - void deactivate_app(const QString &app_id); - void set_window_props(QWindow *win, const QString &app_id, - uint32_t props, int x, int y, int bx, int by, - int bwidth, int bheight); -}; - -static void -application_id_event(void *data, struct agl_shell_desktop *agl_shell_desktop, - const char *app_id) -{ - Shell *aglShell = static_cast(data); - (void) agl_shell_desktop; - - qInfo() << "app_id: " << app_id; - - // this ain't necessary in case the default policy API will activate - // applications by default (when they are started) but if that is not - // the case we can use this event handler to activate the application - // as this event is sent when the application is created (when the app - // surface is created that is); note this event is sent when launcher - // binds to the interface for each application present, besides being - // adevertised when the application surface is created; so the - // following will need some kind of filtering to avoid mass activation - //QString qstr_app_id = QString::fromUtf8(app_id, -1); - //aglShell->activate_app(nullptr, qstr_app_id, nullptr); -} - -static void -application_state_event(void *data, struct agl_shell_desktop *agl_shell_desktop, - const char *app_id, const char *app_data, - uint32_t app_state, uint32_t app_role) -{ - (void) data; - (void) agl_shell_desktop; - (void) app_id; - (void) app_data; - (void) app_state; - (void) app_role; -} - -#endif // SHELLDESKTOP_H diff --git a/package/config.xml b/package/config.xml deleted file mode 100644 index 39a0132..0000000 --- a/package/config.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - launcher - - - This is a demo application for launcher - TOYOTA - APL 2.0 - - - - - - - - - diff --git a/package/icon.svg b/package/icon.svg deleted file mode 100644 index 91661a7..0000000 --- a/package/icon.svg +++ /dev/null @@ -1,279 +0,0 @@ - - - -image/svg+xmlMULTIMEDIA - \ No newline at end of file diff --git a/package/package.pro b/package/package.pro deleted file mode 100644 index a9b865b..0000000 --- a/package/package.pro +++ /dev/null @@ -1,27 +0,0 @@ -DISTFILES = icon.svg config.xml - -copy_icon.target = $$OUT_PWD/root/icon.svg -copy_icon.depends = $$_PRO_FILE_PWD_/icon.svg -copy_icon.commands = $(COPY_FILE) \"$$replace(copy_icon.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_icon.target, /, $$QMAKE_DIR_SEP)\" -QMAKE_EXTRA_TARGETS += copy_icon -PRE_TARGETDEPS += $$copy_icon.target - -copy_config.target = $$OUT_PWD/root/config.xml -copy_config.depends = $$_PRO_FILE_PWD_/config.xml -copy_config.commands = $(COPY_FILE) \"$$replace(copy_config.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_config.target, /, $$QMAKE_DIR_SEP)\" -QMAKE_EXTRA_TARGETS += copy_config -PRE_TARGETDEPS += $$copy_config.target - -WGT_TYPE = -CONFIG(debug, debug|release) { - WGT_TYPE = -debug -} - -wgt.target = package -wgt.commands = wgtpkg-pack -f -o launcher$${WGT_TYPE}.wgt root - -QMAKE_EXTRA_TARGETS += wgt - -deploy.files = launcher.wgt -deploy.path = /usr/AGL/apps/autoinstall -INSTALLS += deploy -- cgit 1.2.3-korg