From: wang_zhiqiang Date: Thu, 30 May 2019 03:40:01 +0000 (+0800) Subject: update X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;ds=sidebyside;h=387c167e310124227b2d137eafa7cca992a8eb4a;p=apps%2Fhomescreen.git update Change-Id: I04732e6f7b1c6fac93d81f0c0451cca96c6ba573 --- diff --git a/autobuild/agl/autobuild b/autobuild/agl/autobuild deleted file mode 100755 index e87a1c3..0000000 --- a/autobuild/agl/autobuild +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/make -f -# Copyright (C) 2015 - 2018 "IoT.bzh" -# 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)) -BUILD_DIR := $(abspath $(dir $(THISFILE))/../../build) -DEST := ${BUILD_DIR} - -.PHONY: all clean distclean configure build package help - -all: help - -help: - @echo "List of targets available:" - @echo "" - @echo "- all" - @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 your INSTALL_ROOT 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" - -clean: - @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} ${CLEAN_ARGS} clean) || echo Nothing to clean - -distclean: - @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} distclean) || echo Nothing to distclean - -configure: - @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} - @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && qmake ${CONFIGURE_ARGS} ..) - -build: configure - @make -C ${BUILD_DIR} ${BUILD_ARGS} all - -package: build - @if [ "${DEST}" != "${BUILD_DIR}/$@" ]; then \ - mkdir -p ${DEST} && cp ${BUILD_DIR}/$@/*.wgt ${DEST}; \ - fi - -install: build - @make -C ${BUILD_DIR} ${INSTALL_ARGS} install diff --git a/autobuild/linux/autobuild b/autobuild/linux/autobuild deleted file mode 100755 index 9ec2f6e..0000000 --- a/autobuild/linux/autobuild +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/make -f -# Copyright (C) 2015 - 2018 "IoT.bzh" -# 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)) -BUILD_DIR := $(abspath $(dir $(THISFILE))/../../build) -DEST := ${BUILD_DIR} - -.PHONY: all clean distclean configure build package help - -all: help - -help: - @echo "List of targets available:" - @echo "" - @echo "- all" - @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 your defined 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" - -clean: - @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} ${CLEAN_ARGS} clean) || echo Nothing to clean - -distclean: - @[ -d ${DEST} ] && find ${DEST} -name "*.wgt" -delete - @([ -d ${BUILD_DIR} ] && make -C ${BUILD_DIR} distclean) || echo Nothing to distclean - -configure: - @[ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR} - @[ -f ${BUILD_DIR}/Makefile ] || (cd ${BUILD_DIR} && qmake ${CONFIGURE_ARGS} ..) - -build: configure - @make -C ${BUILD_DIR} ${BUILD_ARGS} all - -package: build - @if [ "${DEST}" != "${BUILD_DIR}/$@" ]; then \ - mkdir -p ${DEST} && cp ${BUILD_DIR}/$@/*.wgt ${DEST}; \ - fi - -install: build - @if [ "${DEST}" != "${BUILD_DIR}" ]; then \ - mkdir -p ${DEST} && cp -rf ${BUILD_DIR}/package/root/* ${DEST}; \ - fi - diff --git a/homescreen/docs/api-services-book.yml b/homescreen/docs/api-services-book.yml deleted file mode 100644 index 5a0d43a..0000000 --- a/homescreen/docs/api-services-book.yml +++ /dev/null @@ -1,12 +0,0 @@ -type: books -books: -- - id: homescreen - title: HomeScreen (old) - description: Homescreen documentation - keywords: - author: "TOYOTA MOTOR CORPORATION" - version: master - chapters: - - url: homescreen_api.md - name: HomeScreen API \ No newline at end of file diff --git a/homescreen/docs/homescreen-book.yml b/homescreen/docs/homescreen-book.yml deleted file mode 100644 index acc740d..0000000 --- a/homescreen/docs/homescreen-book.yml +++ /dev/null @@ -1,12 +0,0 @@ -type: books -books: -- - id: homescreen - title: HomeScreen - description: HomeScreen documentation - keywords: - author: - version: master - chapters: - - url: index.md - name: Overview diff --git a/homescreen/docs/homescreen_api.md b/homescreen/docs/homescreen_api.md deleted file mode 100644 index 8f7b8f4..0000000 --- a/homescreen/docs/homescreen_api.md +++ /dev/null @@ -1,186 +0,0 @@ -# HomeScreen API -The HomeScreen app provides an own interface for some special use cases concerning the surfaces and user inputs. - -The interface is implemented as D-Bus interface. -This is the introspection, describing the interface: - -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -``` - -These interface will change during further development, so check back frequently. - -## User Input Events API calls - -### hardKeyPressed - -Use hardKeyPressed to inject hard key press events into the HomeScreen app. -This Interface call can be used by applications like the InputEventManager to inject hard keys into the HomeScreen application. - -#### Example - -if someone presses the Hard Key “NAV” on the target, this key may be injected using this interface to make the HomeScreen launch the navigation application. -Right now, only a few keys are defined (in inputevent.hpp): - -``` -namespace InputEvent { - typedef enum HardKey - { - HARDKEY_UNDEFINED, - HARDKEY_NAV, - HARDKEY_MEDIA - } eHardKey; -} -``` - -This will change in the future. - -![hardKeyPressed](pictures/api_hardKeyPressed.png) - -A “normal” application would not need to call this API. - -## Surface control API calls - -The normal use case when starting an application is: -The user presses a hard key or uses the app launcher to start an app. The app is then started and is shown full screen. -The org.agl.homescreen API provides some methods to get information about some status and some methods to show surfaces on the screen. - -### getSurfaceStatus - -A surface can be visible or invisible (please do not confuse “visible” and “visibility”). This function allows to request the current status. - -``` - - - - -``` - -Right now an application has to pull this information. -This is not optimal and will change in the future. There are two options: - - - The homescreen API will provide a signal that is emitted every time the visible status of surfaces changes. This would be way more efficient, because it would save time and avoid a re-occurring API call. __UPDATE:__ There is a D-Bus signal implemented in this API - - For Qt, there is already a patch available that provides this information as a base class property. See https://codereview.qt-project.org/#/c/176211/ This would be optimal for Qt widget applications. But not useful for other languages, e.g. Java. __UPDATE:__ This patch got reverted in AGL! - -#### Current implementation - -![getSurfaceStatus](pictures/api_getSurfaceStatus_1.png) - -#### Option 1 - -![getSurfaceStatus](pictures/api_getSurfaceStatus_2.png) - -#### Option 2 - -![getSurfaceStatus](pictures/api_getSurfaceStatus_3.png) - -### requestSurfaceIdToFullScreen - -This function will set the given surface to full screen. - -``` - - - -``` - -It will hide all other surfaces. - -![requestSurfaceIdToFullScreen](pictures/api_requestSurfaceIdToFullScreen.png) - -### getAllSurfacesOfProcess - -This returns all surfaces that are created by the given process ID. - -``` - - - - - -``` - -A process can create more than one surface. By default, the surface with the lowest surface ID is shown on the screen. If an application wants to know all surfaces that were created by an application, this method will provide them. - -![getAllSurfacesOfProcess](pictures/api_getAllSurfacesOfProcess.png) - -### renderSurfaceToAreaAllowed - -Before calling renderSurfaceToArea, an application can request, if it is allowed to render the surface to this area. This makes sense for an application that would begin to allocate resources to render. But if it is not allowed to render the surface, the application could avoid allocating the resources. - -``` - - - - - -``` - -The call will not affect the current setup, it will only request if it is allowed or not. - -![renderSurfaceToAreaAllowed](pictures/api_renderSurfaceToAreaAllowed.png) - -### renderSurfaceToArea - -By default, the HomeScreen application decides, where to render an applications surface. The concept of Layouts defines this. This API call can override the default behavior. An app can request to render a surface in a specific Layout Area. - -``` - - - - -``` - -The surface that was previously rendered in this Layout are will be hidden. - -![renderSurfaceToArea](pictures/api_renderSurfaceToArea.png) - -The homescreen interface functionality is not fully implemented, but the API is available. For example using the libhomescreen.so. - -### surfaceVisibilityChanged - -Whenever the visibility property of a surface changes, this signal is emitted. - -``` - - - - -``` - -Visibility here means visible. The name of the signal is from the Weston surface property “visibility”. -See here for reference: https://github.com/ntanibata/wayland-ivi-extension/blob/master/ivi-layermanagement-api/ilmCommon/include/ilm_types.h - -![surfaceVisibilityChanged](pictures/api_surfaceVisibilityChanged.png) diff --git a/homescreen/docs/index.md b/homescreen/docs/index.md deleted file mode 100644 index 4322255..0000000 --- a/homescreen/docs/index.md +++ /dev/null @@ -1,31 +0,0 @@ -# Welcome to your AGL system! -When booting up an AGL system, the first thing that your eyes will spot is this: - -![AGL HomeScreen Application Launcher](pictures/homescreen_applauncher.png) - -**The AGL HomeScreen!** - -Intended to be used with touch presses, the reference HMI provides access to all pre-installed AGL demo applications as well as in the future access to user installed apps. The list of demo apps contains some automotive applications like HVAC-control, Navigation or Dashboard, as well as some infotainment apps. Radio, Multimedia, Phone... -This applications are already available and were presented at CES 2017. - -## Here are some screenshots of the pre-installed demo applications: - -## HVAC - -![AGL HVAC](pictures/hvac.png) - -## Phone - -![AGL Phone](pictures/phone.png) - -## Dashboard - -![AGL Dashboard](pictures/dashboard.png) - -## Settings - -![AGL Settings](pictures/settings.png) - -#### Note: -* All current demos (including HomeScreen) are optimized for landscape full HD resolution (1080x1920). - diff --git a/homescreen/docs/pictures/api_getAllSurfacesOfProcess.png b/homescreen/docs/pictures/api_getAllSurfacesOfProcess.png deleted file mode 100644 index 5c862d7..0000000 Binary files a/homescreen/docs/pictures/api_getAllSurfacesOfProcess.png and /dev/null differ diff --git a/homescreen/docs/pictures/api_getSurfaceStatus_1.png b/homescreen/docs/pictures/api_getSurfaceStatus_1.png deleted file mode 100644 index 1e18fcf..0000000 Binary files a/homescreen/docs/pictures/api_getSurfaceStatus_1.png and /dev/null differ diff --git a/homescreen/docs/pictures/api_getSurfaceStatus_2.png b/homescreen/docs/pictures/api_getSurfaceStatus_2.png deleted file mode 100644 index e66d708..0000000 Binary files a/homescreen/docs/pictures/api_getSurfaceStatus_2.png and /dev/null differ diff --git a/homescreen/docs/pictures/api_getSurfaceStatus_3.png b/homescreen/docs/pictures/api_getSurfaceStatus_3.png deleted file mode 100644 index 50a3b10..0000000 Binary files a/homescreen/docs/pictures/api_getSurfaceStatus_3.png and /dev/null differ diff --git a/homescreen/docs/pictures/api_hardKeyPressed.png b/homescreen/docs/pictures/api_hardKeyPressed.png deleted file mode 100644 index a8a3660..0000000 Binary files a/homescreen/docs/pictures/api_hardKeyPressed.png and /dev/null differ diff --git a/homescreen/docs/pictures/api_renderSurfaceToArea.png b/homescreen/docs/pictures/api_renderSurfaceToArea.png deleted file mode 100644 index a61fc2f..0000000 Binary files a/homescreen/docs/pictures/api_renderSurfaceToArea.png and /dev/null differ diff --git a/homescreen/docs/pictures/api_renderSurfaceToAreaAllowed.png b/homescreen/docs/pictures/api_renderSurfaceToAreaAllowed.png deleted file mode 100644 index 35dbbcf..0000000 Binary files a/homescreen/docs/pictures/api_renderSurfaceToAreaAllowed.png and /dev/null differ diff --git a/homescreen/docs/pictures/api_requestSurfaceIdToFullScreen.png b/homescreen/docs/pictures/api_requestSurfaceIdToFullScreen.png deleted file mode 100644 index 6d2f712..0000000 Binary files a/homescreen/docs/pictures/api_requestSurfaceIdToFullScreen.png and /dev/null differ diff --git a/homescreen/docs/pictures/api_surfaceVisibilityChanged.png b/homescreen/docs/pictures/api_surfaceVisibilityChanged.png deleted file mode 100644 index f519757..0000000 Binary files a/homescreen/docs/pictures/api_surfaceVisibilityChanged.png and /dev/null differ diff --git a/homescreen/docs/pictures/dashboard.png b/homescreen/docs/pictures/dashboard.png deleted file mode 100644 index 527386d..0000000 Binary files a/homescreen/docs/pictures/dashboard.png and /dev/null differ diff --git a/homescreen/docs/pictures/full/dashboard.png b/homescreen/docs/pictures/full/dashboard.png deleted file mode 100644 index e947734..0000000 Binary files a/homescreen/docs/pictures/full/dashboard.png and /dev/null differ diff --git a/homescreen/docs/pictures/full/homescreen_applauncher.png b/homescreen/docs/pictures/full/homescreen_applauncher.png deleted file mode 100644 index b61884a..0000000 Binary files a/homescreen/docs/pictures/full/homescreen_applauncher.png and /dev/null differ diff --git a/homescreen/docs/pictures/full/hvac.png b/homescreen/docs/pictures/full/hvac.png deleted file mode 100644 index 7e0399a..0000000 Binary files a/homescreen/docs/pictures/full/hvac.png and /dev/null differ diff --git a/homescreen/docs/pictures/full/phone.png b/homescreen/docs/pictures/full/phone.png deleted file mode 100644 index f4cc547..0000000 Binary files a/homescreen/docs/pictures/full/phone.png and /dev/null differ diff --git a/homescreen/docs/pictures/full/settings.png b/homescreen/docs/pictures/full/settings.png deleted file mode 100644 index a115ef4..0000000 Binary files a/homescreen/docs/pictures/full/settings.png and /dev/null differ diff --git a/homescreen/docs/pictures/homescreen_applauncher.png b/homescreen/docs/pictures/homescreen_applauncher.png deleted file mode 100644 index e168668..0000000 Binary files a/homescreen/docs/pictures/homescreen_applauncher.png and /dev/null differ diff --git a/homescreen/docs/pictures/hvac.png b/homescreen/docs/pictures/hvac.png deleted file mode 100644 index f9a6030..0000000 Binary files a/homescreen/docs/pictures/hvac.png and /dev/null differ diff --git a/homescreen/docs/pictures/phone.png b/homescreen/docs/pictures/phone.png deleted file mode 100644 index e087594..0000000 Binary files a/homescreen/docs/pictures/phone.png and /dev/null differ diff --git a/homescreen/docs/pictures/settings.png b/homescreen/docs/pictures/settings.png deleted file mode 100644 index c92d835..0000000 Binary files a/homescreen/docs/pictures/settings.png and /dev/null differ diff --git a/homescreen/helpers b/homescreen/helpers deleted file mode 160000 index b3a54dd..0000000 --- a/homescreen/helpers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b3a54dd8653fa672650229dd2498308ffcc3e943 diff --git a/homescreen/homescreen.pro b/homescreen/homescreen.pro index 0de8e03..a443fdf 100644 --- a/homescreen/homescreen.pro +++ b/homescreen/homescreen.pro @@ -18,7 +18,9 @@ TARGET = HomeScreen QT = qml quick dbus websockets CONFIG += c++11 link_pkgconfig DESTDIR = $${OUT_PWD}/../package/root/bin -PKGCONFIG += qlibwindowmanager qlibhomescreen qtappfw afb-helpers-qt +PKGCONFIG += libwindowmanager qtappfw + +LIBS += -lqthomescreen -lwindowmanager include(../interfaces/interfaces.pri) @@ -27,26 +29,20 @@ SOURCES += \ src/statusbarmodel.cpp \ src/statusbarserver.cpp \ src/applicationlauncher.cpp \ - src/mastervolume.cpp \ src/homescreenhandler.cpp \ - src/toucharea.cpp \ - src/shortcutappmodel.cpp + src/toucharea.cpp HEADERS += \ src/statusbarmodel.h \ src/statusbarserver.h \ src/applicationlauncher.h \ - src/mastervolume.h \ src/homescreenhandler.h \ - src/toucharea.h \ - src/shortcutappmodel.h + src/toucharea.h OTHER_FILES += \ README.md RESOURCES += \ - qml/images/MediaPlayer/mediaplayer.qrc \ - qml/images/MediaMusic/mediamusic.qrc \ qml/images/Weather/weather.qrc \ qml/images/Shortcut/shortcut.qrc \ qml/images/Status/status.qrc \ diff --git a/homescreen/qml/MediaArea.qml b/homescreen/qml/MediaArea.qml deleted file mode 100644 index 0447589..0000000 --- a/homescreen/qml/MediaArea.qml +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2016 The Qt Company Ltd. - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * - * 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. - */ - -import QtQuick 2.2 -import QtQuick.Controls 2.0 - -StackView { - id: root - width: 1080 - height: 215 - - initialItem: blank - - Component { - id: blank - MediaAreaBlank { -// MouseArea { -// anchors.fill: parent -// onClicked: root.push(mouse.x < 540 ? music : radio) -// } - } - } - - Component { - id: music - MediaAreaMusic { - MouseArea { - anchors.fill: parent - onClicked: root.pop() - } - } - } - - Component { - id: radio - MediaAreaRadio { - MouseArea { - anchors.fill: parent - onClicked: root.pop() - } - } - } -} diff --git a/homescreen/qml/MediaAreaBlank.qml b/homescreen/qml/MediaAreaBlank.qml deleted file mode 100644 index 347c26a..0000000 --- a/homescreen/qml/MediaAreaBlank.qml +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2016 The Qt Company Ltd. - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * - * 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. - */ - -import QtQuick 2.2 -import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.0 -import AGL.Demo.Controls 1.0 -import MasterVolume 1.0 - -Image { - width: 1080 - height: 215 - source: './images/Utility_Logo_Background-01.svg' - property bool displayVolume: false; - - MouseArea { - anchors.fill: parent - function enableVolumeDisplay() { - if (!displayVolume) { - displayVolume = true - master_volume.visible = true - volume_timer.restart() - } - } - onClicked: enableVolumeDisplay() - } - - Image { - id: logo_image - anchors.centerIn: parent - source: './images/Utility_Logo_Grey-01.svg' - } - - Timer { - id: volume_timer - interval: 5000; running: false; repeat: false - onTriggered: displayVolume = false - } - - states: [ - State { when: displayVolume; - PropertyChanges { target: master_volume; opacity: 1.0 } - PropertyChanges { target: slider; enabled: true } - PropertyChanges { target: logo_image; opacity: 0.0 } - }, - State { when: !displayVolume; - PropertyChanges { target: master_volume; opacity: 0.0 } - PropertyChanges { target: slider; enabled: false } - PropertyChanges { target: logo_image; opacity: 1.0 } - } - ] - - transitions: Transition { - NumberAnimation { property: "opacity"; duration: 500} - } - - MasterVolume { - id: mv - objectName: "mv" - onVolumeChanged: slider.value = volume - Component.onCompleted: { - mv.open(bindingAddress); - } - } - - Item { - id: master_volume - anchors.fill: parent - anchors.centerIn: parent - visible: false - - Label { - font.pixelSize: 36 - anchors.horizontalCenter: parent.horizontalCenter - color: "white" - text: qsTr("Active Volume") - } - - RowLayout { - anchors.fill: parent - anchors.centerIn: parent - anchors.margins: 20 - spacing: 20 - Label { - font.pixelSize: 36 - color: "white" - text: "0 %" - } - Slider { - id: slider - Layout.fillWidth: true - from: 0 - to: 100 - stepSize: 1 - snapMode: Slider.SnapOnRelease - onValueChanged: mv.volume = value - Component.onCompleted: value = mv.volume - onPressedChanged: { - if (pressed) {volume_timer.stop()} - else {volume_timer.restart()} - } - } - Label { - font.pixelSize: 36 - color: "white" - text: "100 %" - } - } - } -} diff --git a/homescreen/qml/MediaAreaMusic.qml b/homescreen/qml/MediaAreaMusic.qml deleted file mode 100644 index c0408e6..0000000 --- a/homescreen/qml/MediaAreaMusic.qml +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2016 The Qt Company Ltd. - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * - * 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. - */ - -import QtQuick 2.2 -import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.0 - -Image { - width: 1080 - height: 215 - source: './images/Utility_Music_Background-01.png' - - ColumnLayout { - anchors.fill: parent - spacing: 1 - RowLayout { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.preferredHeight: 107 - spacing: 10 - Image { - source: './images/MediaMusic/AlbumArtwork.png' - width: 105.298 - height: 110.179 - fillMode: Image.PreserveAspectFit - } - Label { - text: 'Come Together - The Beatles' - font.family: 'Roboto' - font.pixelSize: 32 - color: 'white' - } - } - - RowLayout { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.preferredHeight: 107 - Image { - source: './images/MediaPlayer/AGL_MediaPlayer_BackArrow.png' - } - Image { - source: './images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png' - } - Image { - source: './images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png' - } - - ProgressBar { - Layout.fillWidth: true - Layout.preferredWidth: 2 - } - - Label { - text: '2:12/4:19' - font.family: 'Roboto' - font.pixelSize: 20 - } - Image { - source: './images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png' - } - Image { - source: './images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png' - } - ProgressBar { - Layout.fillWidth: true - Layout.preferredWidth: 1 - } - } - } -} diff --git a/homescreen/qml/MediaAreaRadio.qml b/homescreen/qml/MediaAreaRadio.qml deleted file mode 100644 index a49f06d..0000000 --- a/homescreen/qml/MediaAreaRadio.qml +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2016 The Qt Company Ltd. - * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * - * 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. - */ - -import QtQuick 2.2 - -Image { - width: 1080 - height: 215 - source: './images/Utility_Radio_Background-01.png' -} diff --git a/homescreen/qml/ShortcutArea.qml b/homescreen/qml/ShortcutArea.qml index 217aa9f..072ad0a 100644 --- a/homescreen/qml/ShortcutArea.qml +++ b/homescreen/qml/ShortcutArea.qml @@ -1,7 +1,7 @@ /* * Copyright (C) 2016 The Qt Company Ltd. * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * Copyright (c) 2017, 2018, 2019 TOYOTA MOTOR CORPORATION + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,44 +21,108 @@ import QtQuick.Layouts 1.1 Item { id: root - width: 785 - height: 218 + width: 700 + height: 110 + + Timer { + id:informationTimer + interval: 3000 + running: false + repeat: true + onTriggered: { + bottomInformation.visible = false + } + } + + + ListModel { + id: applicationModel + ListElement { + name: 'launcher' + application: 'launcher@0.1' + } + ListElement { + name: 'MediaPlayer' + application: 'mediaplayer@0.1' + } + ListElement { + name: 'navigation' + application: 'navigation@0.1' + } + ListElement { + name: 'Phone' + application: 'phone@0.1' + } + ListElement { + name: 'settings' + application: 'settings@0.1' + } + } property int pid: -1 RowLayout { anchors.fill: parent - spacing: 2 + spacing: 75 Repeater { - id: repeater - model: shortcutAppModel + model: applicationModel delegate: ShortcutIcon { - Layout.fillWidth: true - Layout.fillHeight: true - name: shortcutAppModel.getName(model.index) - icon: shortcutAppModel.getIcon(model.index) - isBlank: shortcutAppModel.isBlank(model.index) - active: shortcutAppModel.getName(model.index).toLowerCase() === launcher.current +// Layout.fillWidth: true +// Layout.fillHeight: true + width: 60 + height: 60 + name: model.name + active: model.name === launcher.current onClicked: { - console.log("launcher.current====="+homescreenHandler.getCurrentApplication()) - if(launcher.current === shortcutAppModel.getName(model.index)) { - return - } - homescreenHandler.tapShortcut(shortcutAppModel.getId(model.index), false) +// if(model.application === 'navigation@0.1') { +// pid = launcher.launch('browser@5.0') +// } else { +// pid = launcher.launch(model.application.toLowerCase()) +// } + +// if (1 < pid) { + applicationArea.visible = true +// } +// else { +// console.warn(model.application) +// console.warn("app cannot be launched!") +// } + if(model.name === 'Navigation') { + homescreenHandler.tapShortcut('browser') + } else { + homescreenHandler.tapShortcut(model.name) + } } } } } + Rectangle { + id: bottomInformation + width: parent.width + height: parent.height-20 + anchors.bottom: parent.bottom + color: "gray" + z: 1 + opacity: 0.8 + visible: false + + Text { + id: informationText + anchors.centerIn: parent + font.pixelSize: 25 + font.letterSpacing: 5 + horizontalAlignment: Text.AlignHCenter + color: "white" + text: "" + } + } Connections { - target: shortcutAppModel - onUpdateShortcut: { - for(var i = 0; i < 4; i++) { - var item = repeater.itemAt(i) - item.name = shortcutAppModel.getName(i) - item.icon = shortcutAppModel.getIcon(i) - item.isBlank = shortcutAppModel.isBlank(i) - } + target: homescreenHandler + onInformation: { + informationText.text = text + bottomInformation.visible = true + informationTimer.restart() } } } diff --git a/homescreen/qml/ShortcutIcon.qml b/homescreen/qml/ShortcutIcon.qml index e891c99..026db32 100644 --- a/homescreen/qml/ShortcutIcon.qml +++ b/homescreen/qml/ShortcutIcon.qml @@ -21,13 +21,10 @@ import QtGraphicalEffects 1.0 MouseArea { id: root - width: 195 - height: 216.8 + width: 70 + height: 70 property string name: 'Home' - property string icon:'./images/Shortcut/' property bool active: false - property bool isBlank: false - Item { id: icon property real desaturation: 0 @@ -35,42 +32,14 @@ MouseArea { Image { id: inactiveIcon anchors.fill: parent - source: './images/Shortcut/blank.svg' -// source: isBlank ? './images/Shortcut/blank.svg' : root.icon - property string initial: root.name.substring(0,1).toUpperCase() - Label { - style: Text.Outline - styleColor: '#00FFFF' - color: 'transparent' - font.pixelSize: 75 - anchors.centerIn: parent - text: inactiveIcon.initial - visible: root.isBlank - } + source: './images/Shortcut/%1.png'.arg(root.name.toLowerCase()) } Image { id: activeIcon anchors.fill: parent - source: './images/Shortcut/blank_active.svg' -// source: isBlank ? './images/Shortcut/blank_active.svg' : root.icon - property string initial: root.name.substring(0,1).toUpperCase() - Label { - style: Text.Outline - styleColor: '#00FFFF' - color: 'transparent' - font.pixelSize: 75 - anchors.centerIn: parent - text: activeIcon.initial - visible: root.isBlank - } + source: './images/Shortcut/%1_active.png'.arg(root.name.toLowerCase()) opacity: 0.0 } - Image { - id: sourceIcon - anchors.fill: parent - source: isBlank ? null : root.icon - } - layer.enabled: true layer.effect: Desaturate { id: desaturate @@ -79,30 +48,27 @@ MouseArea { } } - Label { - id: name - y: 160 - width: root.width - 10 - font.pixelSize: 15 - font.letterSpacing: 5 - // wrapMode: Text.WordWrap - anchors.horizontalCenter: parent.horizontalCenter - horizontalAlignment: Text.AlignHCenter - color: "white" - text: qsTr((root.name === "launcher" ? "home" : root.name).toUpperCase()) - } - - states: [ - State { - when: root.active - PropertyChanges { - target: inactiveIcon - opacity: 0.0 + transitions: [ + Transition { + NumberAnimation { + properties: 'opacity' + duration: 500 + easing.type: Easing.OutExpo } - PropertyChanges { - target: activeIcon - opacity: 1.0 + NumberAnimation { + properties: 'desaturation' + duration: 250 } } ] + + onPressed: { + activeIcon.opacity = 1.0 + inactiveIcon.opacity = 0.0 + } + + onReleased: { + activeIcon.opacity = 0.0 + inactiveIcon.opacity = 1.0 + } } diff --git a/homescreen/qml/StatusArea.qml b/homescreen/qml/StatusArea.qml index 961cd88..bd81767 100644 --- a/homescreen/qml/StatusArea.qml +++ b/homescreen/qml/StatusArea.qml @@ -1,7 +1,6 @@ /* * Copyright (C) 2016 The Qt Company Ltd. * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * Copyright (c) 2017, 2018 TOYOTA MOTOR CORPORATION * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +21,8 @@ import HomeScreen 1.0 Item { id: root - width: 295 - height: 218 + width: 700 + height: 80 property date now: new Date Timer { @@ -31,19 +30,27 @@ Item { onTriggered: root.now = new Date } + Timer { + id:notificationTimer + interval: 3000 + running: false + repeat: true + onTriggered: notificationItem.visible = false + } + Connections { target: weather onConditionChanged: { var icon = '' - if (condition.indexOf("clouds") != -1) { + if (condition.indexOf("clouds") !== -1) { icon = "WeatherIcons_Cloudy-01.png" - } else if (condition.indexOf("thunderstorm") != -1) { + } else if (condition.indexOf("thunderstorm") !== -1) { icon = "WeatherIcons_Thunderstorm-01.png" - } else if (condition.indexOf("snow") != -1) { + } else if (condition.indexOf("snow") !== -1) { icon = "WeatherIcons_Snow-01.png" - } else if (condition.indexOf("rain") != -1) { + } else if (condition.indexOf("rain") !== -1) { icon = "WeatherIcons_Rain-01.png" } @@ -55,105 +62,153 @@ Item { } } - RowLayout { - anchors.fill: parent - spacing: 0 - Item { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.preferredWidth: 295 - 76 - ColumnLayout { - anchors.fill: parent - anchors.margins: 40 - spacing: 0 - Text { - Layout.fillWidth: true - Layout.fillHeight: true - text: Qt.formatDate(now, 'dddd').toUpperCase() - font.family: 'Roboto' - font.pixelSize: 13 - color: 'white' - verticalAlignment: Text.AlignVCenter -// Rectangle { -// anchors.fill: parent -// anchors.margins: 5 -// color: 'red' -// border.color: 'blue' -// border.width: 1 -// z: -1 -// } + RowLayout { + anchors.fill: parent + spacing: 0 + RowLayout { + id: icons + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredWidth: 120 + spacing: -10 + + Image { + id: bt_icon + Layout.preferredWidth: 50 + Layout.preferredHeight: 50 + source: connStatus ? './images/Status/HMI_Status_Bluetooth_On-01.png' : './images/Status/HMI_Status_Bluetooth_Inactive-01.png' + fillMode: Image.PreserveAspectFit + property string deviceName: "none" + property bool connStatus: false + Connections { + target: bluetooth + onConnectionEvent: { + console.log("onConnectionEvent", data.Status) + if (data.Status === "connected") { + bt_icon.connStatus = true + } else if (data.Status === "disconnected") { + bt_icon.connStatus = false + } + } + onDeviceUpdateEvent: { + console.log("onConnectionEvent", data.Paired) + if (data.Paired === "True" && data.Connected === "True") { + bt_icon.deviceName = data.name + bt_icon.connStatus = true + } else { + if(bt_icon.deviceName === data.Name) + { + bt_icon.connStatus = false + } + } + } + } } - Text { - Layout.fillWidth: true - Layout.fillHeight: true - text: Qt.formatTime(now, 'h:mm ap').toUpperCase() - font.family: 'Roboto' - font.pixelSize: 40 - color: 'white' - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + + Repeater { + model: StatusBarModel { objectName: "statusBar" } + delegate: Image { + Layout.preferredWidth: 50 + Layout.preferredHeight: 50 + source: model.modelData + fillMode: Image.PreserveAspectFit + } } - RowLayout { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.preferredHeight: 20 - Image { - id: condition_item - source: './images/Weather/WeatherIcons_Rain-01.png' + } + Item { + anchors.left: icons.right + Layout.fillHeight: true + width: 440 + ColumnLayout { + anchors.fill: parent + anchors.margins: 17 + spacing: 0 + Text { + Layout.fillWidth: true + Layout.fillHeight: true + text: Qt.formatDate(now, 'dddd').toUpperCase() + font.family: 'Roboto' + font.pixelSize: 13 + color: 'white' + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter } Text { - id: temperature_item - text: '64°F' + Layout.fillWidth: true + Layout.fillHeight: true + text: Qt.formatTime(now, 'h:mm ap').toUpperCase() + font.family: 'Roboto' + font.pixelSize: 38 color: 'white' - font.family: 'Helvetica' - font.pixelSize: 32 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter } } - MouseArea { - anchors.fill: parent - onClicked: { - homescreenHandler.killRunningApplications() - } + } + RowLayout { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 20 + + Image { + id: condition_item + source: './images/Weather/WeatherIcons_Rain-01.png' + } + Text { + id: temperature_item + text: '64°F' + color: 'white' + font.family: 'Helvetica' + font.pixelSize: 32 } } } - ColumnLayout { - id: icons - Layout.fillWidth: true - Layout.fillHeight: true - Layout.preferredWidth: 76 - spacing: -10 + + Item { + id: notificationItem + x: 0 + y: 0 + z: 1 + width: parent.width + height: 100 + opacity: 0.8 + visible: false + Rectangle { - Layout.preferredWidth: 77 - Layout.preferredHeight: 55 - opacity: 0 - } + width: parent.width + height: parent.height + anchors.fill: parent + color: "gray" + Image { + id: notificationIcon + width: 70 + height: 70 + anchors.left: parent.left + anchors.leftMargin: 20 + anchors.verticalCenter: parent.verticalCenter + source: "" + } - Image { - id: bt_icon - Layout.preferredWidth: 77 - Layout.preferredHeight: 55 - source: connStatus ? './images/Status/HMI_Status_Bluetooth_On-01.png' : './images/Status/HMI_Status_Bluetooth_Inactive-01.png' - fillMode: Image.PreserveAspectFit - property string deviceName: "none" - property bool connStatus: false - Connections { - target: bluetooth - - onPowerChanged: { - bt_icon.connStatus = state - } + Text { + id: notificationtext + font.pixelSize: 25 + anchors.left: notificationIcon.right + anchors.leftMargin: 5 + anchors.verticalCenter: parent.verticalCenter + color: "white" + text: qsTr("") } } - Repeater { - model: StatusBarModel { objectName: "statusBar" } - delegate: Image { - Layout.preferredWidth: 77 - Layout.preferredHeight: 55 - source: model.modelData - fillMode: Image.PreserveAspectFit - } + } + + Connections { + target: homescreenHandler + onNotification: { + notificationIcon.source = './images/Shortcut/%1.svg'.arg(id) + notificationtext.text = text + notificationItem.visible = true + notificationTimer.restart() } } - } + } diff --git a/homescreen/qml/TopArea.qml b/homescreen/qml/TopArea.qml index 2a75cf8..978018c 100644 --- a/homescreen/qml/TopArea.qml +++ b/homescreen/qml/TopArea.qml @@ -19,41 +19,18 @@ import QtQuick 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 -Image { - width: 1920 - height: 218 - source: './images/TopSection_NoText_NoIcons-01.svg' - fillMode: Image.PreserveAspectCrop +Item { + width: 700 + height: 80 RowLayout { anchors.fill: parent spacing: 0 - ShortcutArea { - id: shortcutArea - Layout.fillWidth: true - Layout.fillHeight: true - Layout.preferredWidth: 785 - } StatusArea { id: statusArea Layout.fillWidth: true Layout.fillHeight: true - Layout.preferredWidth: 295 + Layout.preferredWidth: 700 } } - - Timer { - id: launching - interval: 500 - running: launcher.launching - } - - ProgressBar { - id: progressBar - anchors.verticalCenter: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - indeterminate: visible - visible: launcher.launching && !launching.running - } } diff --git a/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png b/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png deleted file mode 100644 index a4e026c..0000000 Binary files a/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png and /dev/null differ diff --git a/homescreen/qml/images/AGL_HMI_Normal_Background.png b/homescreen/qml/images/AGL_HMI_Normal_Background.png deleted file mode 100644 index c686067..0000000 Binary files a/homescreen/qml/images/AGL_HMI_Normal_Background.png and /dev/null differ diff --git a/homescreen/qml/images/MediaMusic/AlbumArtwork.png b/homescreen/qml/images/MediaMusic/AlbumArtwork.png deleted file mode 100644 index 3716ab3..0000000 Binary files a/homescreen/qml/images/MediaMusic/AlbumArtwork.png and /dev/null differ diff --git a/homescreen/qml/images/MediaMusic/BackArrow.png b/homescreen/qml/images/MediaMusic/BackArrow.png deleted file mode 100644 index 63e38d9..0000000 Binary files a/homescreen/qml/images/MediaMusic/BackArrow.png and /dev/null differ diff --git a/homescreen/qml/images/MediaMusic/ForwardArrow.png b/homescreen/qml/images/MediaMusic/ForwardArrow.png deleted file mode 100644 index a513705..0000000 Binary files a/homescreen/qml/images/MediaMusic/ForwardArrow.png and /dev/null differ diff --git a/homescreen/qml/images/MediaMusic/ShuffleIcon.png b/homescreen/qml/images/MediaMusic/ShuffleIcon.png deleted file mode 100644 index 30f75c5..0000000 Binary files a/homescreen/qml/images/MediaMusic/ShuffleIcon.png and /dev/null differ diff --git a/homescreen/qml/images/MediaMusic/Volume_Loud.png b/homescreen/qml/images/MediaMusic/Volume_Loud.png deleted file mode 100644 index 8ea4402..0000000 Binary files a/homescreen/qml/images/MediaMusic/Volume_Loud.png and /dev/null differ diff --git a/homescreen/qml/images/MediaMusic/Volume_Medium.png b/homescreen/qml/images/MediaMusic/Volume_Medium.png deleted file mode 100644 index ae5c82e..0000000 Binary files a/homescreen/qml/images/MediaMusic/Volume_Medium.png and /dev/null differ diff --git a/homescreen/qml/images/MediaMusic/Volume_Off.png b/homescreen/qml/images/MediaMusic/Volume_Off.png deleted file mode 100644 index 07e3353..0000000 Binary files a/homescreen/qml/images/MediaMusic/Volume_Off.png and /dev/null differ diff --git a/homescreen/qml/images/MediaMusic/mediamusic.qrc b/homescreen/qml/images/MediaMusic/mediamusic.qrc deleted file mode 100644 index b1138c0..0000000 --- a/homescreen/qml/images/MediaMusic/mediamusic.qrc +++ /dev/null @@ -1,11 +0,0 @@ - - - AlbumArtwork.png - BackArrow.png - ForwardArrow.png - ShuffleIcon.png - Volume_Loud.png - Volume_Medium.png - Volume_Off.png - - diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png deleted file mode 100644 index 14a52b2..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png deleted file mode 100644 index 0ec1f67..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png deleted file mode 100644 index bc2df1d..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png deleted file mode 100644 index 8d8fc02..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png deleted file mode 100644 index 94fe38f..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png deleted file mode 100644 index 12609e1..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png deleted file mode 100644 index 299903e..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png deleted file mode 100644 index 33cc700..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png deleted file mode 100644 index 9bdb14d..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png deleted file mode 100644 index 76b0fc9..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png deleted file mode 100644 index c423005..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png deleted file mode 100644 index beece66..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png deleted file mode 100644 index eec608f..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png deleted file mode 100644 index d392a90..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png deleted file mode 100644 index 22319c9..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png deleted file mode 100644 index 9fd42e2..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png deleted file mode 100644 index eb61b39..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png deleted file mode 100644 index de305f0..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png deleted file mode 100644 index d97feec..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png b/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png deleted file mode 100644 index 7f6445d..0000000 Binary files a/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Albums_Active.png b/homescreen/qml/images/MediaPlayer/Albums_Active.png deleted file mode 100644 index 1f66e23..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Albums_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Albums_Inactive.png b/homescreen/qml/images/MediaPlayer/Albums_Inactive.png deleted file mode 100644 index e0e7f00..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Albums_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/DividingLine.png b/homescreen/qml/images/MediaPlayer/DividingLine.png deleted file mode 100644 index 87f2122..0000000 Binary files a/homescreen/qml/images/MediaPlayer/DividingLine.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/GreenLine.png b/homescreen/qml/images/MediaPlayer/GreenLine.png deleted file mode 100644 index 0210b83..0000000 Binary files a/homescreen/qml/images/MediaPlayer/GreenLine.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Music_Active.png b/homescreen/qml/images/MediaPlayer/Music_Active.png deleted file mode 100644 index 36afac7..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Music_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Music_Inactive.png b/homescreen/qml/images/MediaPlayer/Music_Inactive.png deleted file mode 100644 index 9dae353..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Music_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Podcasts_Active.png b/homescreen/qml/images/MediaPlayer/Podcasts_Active.png deleted file mode 100644 index fd2d2c0..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Podcasts_Active.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Podcasts_Inactive.png b/homescreen/qml/images/MediaPlayer/Podcasts_Inactive.png deleted file mode 100644 index b76b04c..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Podcasts_Inactive.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Popup_Highlight.png b/homescreen/qml/images/MediaPlayer/Popup_Highlight.png deleted file mode 100644 index ac63673..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Popup_Highlight.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Popup_PauseIcon.png b/homescreen/qml/images/MediaPlayer/Popup_PauseIcon.png deleted file mode 100644 index 2627add..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Popup_PauseIcon.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Popup_PlayIcon.png b/homescreen/qml/images/MediaPlayer/Popup_PlayIcon.png deleted file mode 100644 index 0483e07..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Popup_PlayIcon.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/Popup_VerticalLine.png b/homescreen/qml/images/MediaPlayer/Popup_VerticalLine.png deleted file mode 100644 index 6a9db00..0000000 Binary files a/homescreen/qml/images/MediaPlayer/Popup_VerticalLine.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/X.png b/homescreen/qml/images/MediaPlayer/X.png deleted file mode 100644 index ab392cb..0000000 Binary files a/homescreen/qml/images/MediaPlayer/X.png and /dev/null differ diff --git a/homescreen/qml/images/MediaPlayer/mediaplayer.qrc b/homescreen/qml/images/MediaPlayer/mediaplayer.qrc deleted file mode 100644 index 1cb17ab..0000000 --- a/homescreen/qml/images/MediaPlayer/mediaplayer.qrc +++ /dev/null @@ -1,37 +0,0 @@ - - - AGL_MediaPlayer_AlbumArtwork.png - AGL_MediaPlayer_BackArrow.png - AGL_MediaPlayer_Bluetooth_Active.png - AGL_MediaPlayer_Bluetooth_Inactive.png - AGL_MediaPlayer_CD_Active.png - AGL_MediaPlayer_CD_Inactive.png - AGL_MediaPlayer_DividingLine.png - AGL_MediaPlayer_ForwardArrow.png - AGL_MediaPlayer_Loop_Active.png - AGL_MediaPlayer_Loop_Inactive.png - AGL_MediaPlayer_Player_Pause.png - AGL_MediaPlayer_Player_Play.png - AGL_MediaPlayer_Playlist_Active.png - AGL_MediaPlayer_Playlist_Inactive.png - AGL_MediaPlayer_PlaylistToggle_Active.png - AGL_MediaPlayer_PlaylistToggle_Inactive.png - AGL_MediaPlayer_Radio_Active.png - AGL_MediaPlayer_Radio_Inactive.png - AGL_MediaPlayer_Shuffle_Active.png - AGL_MediaPlayer_Shuffle_Inactive.png - Albums_Active.png - Albums_Inactive.png - DividingLine.png - GreenLine.png - Music_Active.png - Music_Inactive.png - Podcasts_Active.png - Podcasts_Inactive.png - Popup_Highlight.png - Popup_PauseIcon.png - Popup_PlayIcon.png - Popup_VerticalLine.png - X.png - - diff --git a/homescreen/qml/images/Shortcut/blank.svg b/homescreen/qml/images/Shortcut/blank.svg deleted file mode 100644 index 3bccdca..0000000 --- a/homescreen/qml/images/Shortcut/blank.svg +++ /dev/null @@ -1,81 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/homescreen/qml/images/Shortcut/blank_active.svg b/homescreen/qml/images/Shortcut/blank_active.svg deleted file mode 100644 index 0b63bc9..0000000 --- a/homescreen/qml/images/Shortcut/blank_active.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - -image/svg+xml - - - - - - - - - - - - - - \ No newline at end of file diff --git a/homescreen/qml/images/Shortcut/hvac.svg b/homescreen/qml/images/Shortcut/hvac.svg deleted file mode 100644 index 5c76e85..0000000 --- a/homescreen/qml/images/Shortcut/hvac.svg +++ /dev/null @@ -1,600 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Shortcut/hvac_active.svg b/homescreen/qml/images/Shortcut/hvac_active.svg deleted file mode 100644 index 46be46b..0000000 --- a/homescreen/qml/images/Shortcut/hvac_active.svg +++ /dev/null @@ -1,614 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Shortcut/launcher.png b/homescreen/qml/images/Shortcut/launcher.png new file mode 100644 index 0000000..6f91d50 Binary files /dev/null and b/homescreen/qml/images/Shortcut/launcher.png differ diff --git a/homescreen/qml/images/Shortcut/launcher.svg b/homescreen/qml/images/Shortcut/launcher.svg deleted file mode 100644 index b6eab24..0000000 --- a/homescreen/qml/images/Shortcut/launcher.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Shortcut/launcher_active.png b/homescreen/qml/images/Shortcut/launcher_active.png new file mode 100644 index 0000000..2706961 Binary files /dev/null and b/homescreen/qml/images/Shortcut/launcher_active.png differ diff --git a/homescreen/qml/images/Shortcut/launcher_active.svg b/homescreen/qml/images/Shortcut/launcher_active.svg deleted file mode 100644 index e85c7d8..0000000 --- a/homescreen/qml/images/Shortcut/launcher_active.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Shortcut/mediaplayer.png b/homescreen/qml/images/Shortcut/mediaplayer.png new file mode 100644 index 0000000..8ea7d76 Binary files /dev/null and b/homescreen/qml/images/Shortcut/mediaplayer.png differ diff --git a/homescreen/qml/images/Shortcut/mediaplayer.svg b/homescreen/qml/images/Shortcut/mediaplayer.svg deleted file mode 100644 index de7448d..0000000 --- a/homescreen/qml/images/Shortcut/mediaplayer.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Shortcut/mediaplayer_active.png b/homescreen/qml/images/Shortcut/mediaplayer_active.png new file mode 100644 index 0000000..b130b92 Binary files /dev/null and b/homescreen/qml/images/Shortcut/mediaplayer_active.png differ diff --git a/homescreen/qml/images/Shortcut/mediaplayer_active.svg b/homescreen/qml/images/Shortcut/mediaplayer_active.svg deleted file mode 100644 index 16e3af5..0000000 --- a/homescreen/qml/images/Shortcut/mediaplayer_active.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Shortcut/music.svg b/homescreen/qml/images/Shortcut/music.svg new file mode 100644 index 0000000..b6ec056 --- /dev/null +++ b/homescreen/qml/images/Shortcut/music.svg @@ -0,0 +1,111 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/homescreen/qml/images/Shortcut/navigation.png b/homescreen/qml/images/Shortcut/navigation.png new file mode 100644 index 0000000..17b347b Binary files /dev/null and b/homescreen/qml/images/Shortcut/navigation.png differ diff --git a/homescreen/qml/images/Shortcut/navigation.svg b/homescreen/qml/images/Shortcut/navigation.svg index 6f6f1e0..97fcf31 100644 --- a/homescreen/qml/images/Shortcut/navigation.svg +++ b/homescreen/qml/images/Shortcut/navigation.svg @@ -1,77 +1,183 @@ - + - - - - - - - - -]> - - \ No newline at end of file diff --git a/homescreen/qml/images/Shortcut/navigation_active.png b/homescreen/qml/images/Shortcut/navigation_active.png new file mode 100644 index 0000000..bebb23e Binary files /dev/null and b/homescreen/qml/images/Shortcut/navigation_active.png differ diff --git a/homescreen/qml/images/Shortcut/navigation_active.svg b/homescreen/qml/images/Shortcut/navigation_active.svg deleted file mode 100644 index 9076934..0000000 --- a/homescreen/qml/images/Shortcut/navigation_active.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Shortcut/phone.png b/homescreen/qml/images/Shortcut/phone.png new file mode 100644 index 0000000..d0ca0af Binary files /dev/null and b/homescreen/qml/images/Shortcut/phone.png differ diff --git a/homescreen/qml/images/Shortcut/phone_active.png b/homescreen/qml/images/Shortcut/phone_active.png new file mode 100644 index 0000000..77e45fd Binary files /dev/null and b/homescreen/qml/images/Shortcut/phone_active.png differ diff --git a/homescreen/qml/images/Shortcut/sdl_usb.svg b/homescreen/qml/images/Shortcut/sdl_usb.svg deleted file mode 100644 index 3b6a7e9..0000000 --- a/homescreen/qml/images/Shortcut/sdl_usb.svg +++ /dev/null @@ -1,311 +0,0 @@ - - - -image/svg+xml diff --git a/homescreen/qml/images/Shortcut/sdl_usb_active.svg b/homescreen/qml/images/Shortcut/sdl_usb_active.svg deleted file mode 100644 index 9584885..0000000 --- a/homescreen/qml/images/Shortcut/sdl_usb_active.svg +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Shortcut/settings.png b/homescreen/qml/images/Shortcut/settings.png new file mode 100644 index 0000000..8c36376 Binary files /dev/null and b/homescreen/qml/images/Shortcut/settings.png differ diff --git a/homescreen/qml/images/Shortcut/settings_active.png b/homescreen/qml/images/Shortcut/settings_active.png new file mode 100644 index 0000000..d863457 Binary files /dev/null and b/homescreen/qml/images/Shortcut/settings_active.png differ diff --git a/homescreen/qml/images/Shortcut/shortcut.qrc b/homescreen/qml/images/Shortcut/shortcut.qrc index 54df1ad..40462f4 100644 --- a/homescreen/qml/images/Shortcut/shortcut.qrc +++ b/homescreen/qml/images/Shortcut/shortcut.qrc @@ -1,18 +1,16 @@ - launcher.svg - launcher_active.svg - hvac.svg - hvac_active.svg - mediaplayer.svg - mediaplayer_active.svg + launcher.png + launcher_active.png + mediaplayer.png + mediaplayer_active.png + navigation.png + navigation_active.png + phone.png + phone_active.png + settings.png + settings_active.png navigation.svg - navigation_active.svg - video.svg - video_active.svg - sdl_usb.svg - sdl_usb_active.svg - blank.svg - blank_active.svg + music.svg diff --git a/homescreen/qml/images/Shortcut/video.svg b/homescreen/qml/images/Shortcut/video.svg deleted file mode 100644 index e368922..0000000 --- a/homescreen/qml/images/Shortcut/video.svg +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - image/svg+xml - - - - - - - diff --git a/homescreen/qml/images/Shortcut/video_active.svg b/homescreen/qml/images/Shortcut/video_active.svg deleted file mode 100644 index 344385f..0000000 --- a/homescreen/qml/images/Shortcut/video_active.svg +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - image/svg+xml - - - - - - - diff --git a/homescreen/qml/images/TopSection_NoText_NoIcons-01.svg b/homescreen/qml/images/TopSection_NoText_NoIcons-01.svg deleted file mode 100644 index 6841001..0000000 --- a/homescreen/qml/images/TopSection_NoText_NoIcons-01.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Utility_Logo_Background-01.svg b/homescreen/qml/images/Utility_Logo_Background-01.svg deleted file mode 100644 index c289805..0000000 --- a/homescreen/qml/images/Utility_Logo_Background-01.svg +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Utility_Logo_Grey-01.svg b/homescreen/qml/images/Utility_Logo_Grey-01.svg deleted file mode 100644 index 16ac88c..0000000 --- a/homescreen/qml/images/Utility_Logo_Grey-01.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/homescreen/qml/images/Utility_Music_Background-01.png b/homescreen/qml/images/Utility_Music_Background-01.png deleted file mode 100644 index c3e9f91..0000000 Binary files a/homescreen/qml/images/Utility_Music_Background-01.png and /dev/null differ diff --git a/homescreen/qml/images/Utility_Radio_Background-01.png b/homescreen/qml/images/Utility_Radio_Background-01.png deleted file mode 100644 index b755843..0000000 Binary files a/homescreen/qml/images/Utility_Radio_Background-01.png and /dev/null differ diff --git a/homescreen/qml/images/images.qrc b/homescreen/qml/images/images.qrc index 39f7eb6..0715215 100644 --- a/homescreen/qml/images/images.qrc +++ b/homescreen/qml/images/images.qrc @@ -1,15 +1,11 @@ - TopSection_NoText_NoIcons-01.svg - Utility_Logo_Background-01.svg - Utility_Logo_Grey-01.svg - Utility_Music_Background-01.png - Utility_Radio_Background-01.png - AGL_HMI_Blue_Background_NoCar-01.png - AGL_HMI_Full_Background.png - AGL_HMI_Normal_Background.png + menubar_background.png + menubar_normal_background.png + menubar_full_background.png fullscreen.png normal.png - normal_disable.png + split_switch.png + split_switch_disable.png diff --git a/homescreen/qml/images/menubar_background.png b/homescreen/qml/images/menubar_background.png new file mode 100644 index 0000000..bb95916 Binary files /dev/null and b/homescreen/qml/images/menubar_background.png differ diff --git a/homescreen/qml/images/AGL_HMI_Full_Background.png b/homescreen/qml/images/menubar_full_background.png similarity index 51% rename from homescreen/qml/images/AGL_HMI_Full_Background.png rename to homescreen/qml/images/menubar_full_background.png index 9631ca0..31cbfdb 100644 Binary files a/homescreen/qml/images/AGL_HMI_Full_Background.png and b/homescreen/qml/images/menubar_full_background.png differ diff --git a/homescreen/qml/images/menubar_normal_background.png b/homescreen/qml/images/menubar_normal_background.png new file mode 100644 index 0000000..25c9bcf Binary files /dev/null and b/homescreen/qml/images/menubar_normal_background.png differ diff --git a/homescreen/qml/images/normal_disable.png b/homescreen/qml/images/normal_disable.png deleted file mode 100644 index f191241..0000000 Binary files a/homescreen/qml/images/normal_disable.png and /dev/null differ diff --git a/homescreen/qml/images/split_switch.png b/homescreen/qml/images/split_switch.png new file mode 100644 index 0000000..751b2fa Binary files /dev/null and b/homescreen/qml/images/split_switch.png differ diff --git a/homescreen/qml/images/split_switch_disable.png b/homescreen/qml/images/split_switch_disable.png new file mode 100644 index 0000000..c4bfa67 Binary files /dev/null and b/homescreen/qml/images/split_switch_disable.png differ diff --git a/homescreen/qml/main.qml b/homescreen/qml/main.qml index a8d095b..b22ba06 100644 --- a/homescreen/qml/main.qml +++ b/homescreen/qml/main.qml @@ -31,69 +31,78 @@ Window { Image { id: container anchors.centerIn: parent - width: 1080 - height: 1920 - scale: screenInfo.scale_factor() - source: './images/AGL_HMI_Blue_Background_NoCar-01.png' + width: 1920 + height: 720 + scale: 1.0 + source: './images/menubar_background.png' ColumnLayout { + id: menuBar anchors.fill: parent spacing: 0 TopArea { id: topArea - Layout.fillWidth: true - Layout.preferredHeight: 218 + anchors.horizontalCenter: parent.horizontalCenter + Layout.preferredHeight: 80 + x: 640 } Item { id: applicationArea Layout.fillWidth: true Layout.fillHeight: true - Layout.preferredHeight: 1920 - 218 - 215 + Layout.preferredHeight: 510 visible: true + MouseArea { + enabled: true + } } - MediaArea { - id: mediaArea - Layout.fillWidth: true + ShortcutArea { + id: shortcutArea + anchors.horizontalCenter: parent.horizontalCenter Layout.fillHeight: true - Layout.preferredHeight: 215 + Layout.preferredHeight: 130 } } - - - state: "normal" - states: [ State { name: "normal" + PropertyChanges { + target: container + y: 0 + } PropertyChanges { target: topArea y: 0 } PropertyChanges { target: applicationArea - y: 218 + y: 80 } PropertyChanges { - target: mediaArea - y: 1705 + target: shortcutArea + y: 590 } }, State { name: "fullscreen" + PropertyChanges { + target: container + y: -720 + } PropertyChanges { target: topArea - y: -220 + y: -80 } PropertyChanges { target: applicationArea - y: -1490 + y: -510 } PropertyChanges { - target: mediaArea - y: 2135 + target: shortcutArea + y: 720 } } ] @@ -105,50 +114,79 @@ Window { duration: 250 } NumberAnimation { - target: mediaArea + target: applicationArea + property: "y" + easing.type: "OutQuad" + duration: 250 + } + NumberAnimation { + target: shortcutArea property: "y" easing.type: "OutQuad" duration: 250 } } - } + Item { id: switchBtn - width: 70 - height: 70 + width: 61 + height: 61 anchors.right: parent.right + anchors.rightMargin: 17 anchors.top: parent.top + anchors.topMargin: 2 z: 1 - property bool enableSwitchBtn: true Image { - anchors.right: parent.right - anchors.rightMargin: 20 - anchors.top: parent.top - anchors.topMargin: 25 - width: 35 - height: 35 id: image + width: 55 + height: 55 + anchors.centerIn: parent source: './images/normal.png' } MouseArea { + anchors.fill: parent + property string btnState: 'normal' + onClicked: { + if (container.state === 'normal') { + turnToFullscreen() + } else { + turnToNormal() + } + } + } + } + + Item { + id: splitSwitchBtn + width: 61 + height: 61 + anchors.right: switchBtn.left + anchors.top: parent.top + anchors.topMargin: 2 + z: 1 + property bool enableSplitSwitchBtn: false + Image { + id: splitSwitchImage + width: 55 + height: 55 + anchors.centerIn: parent + source: './images/split_switch_disable.png' + } + + MouseArea { + property bool changed : false anchors.fill: parent onClicked: { - if(switchBtn.enableSwitchBtn) { - var appName = homescreenHandler.getCurrentApplication() - if (container.state === 'normal') { - image.source = './images/fullscreen.png' - container.state = 'fullscreen' - touchArea.switchArea(1) - homescreenHandler.tapShortcut(appName, true) - container.opacity = 0.0 - } else { - image.source = './images/normal.png' - container.state = 'normal' - touchArea.switchArea(0) - homescreenHandler.tapShortcut(appName, false) - container.opacity = 1.0 + if (splitSwitchBtn.enableSplitSwitchBtn) { + if(changed) { + switchSplitArea(0) + changed = false + } + else { + switchSplitArea(1) + changed = true } } } @@ -170,127 +208,32 @@ Window { } } - function changeSwitchState(is_navigation) { - if(container.state === 'normal') { - if(is_navigation) { - switchBtn.enableSwitchBtn = true - image.source = './images/normal.png' - } else { - switchBtn.enableSwitchBtn = false - image.source = './images/normal_disable.png' - } - } - } - Connections { - target: homescreenHandler - onShowWindow: { - container.state = 'normal' - image.visible = true - touchArea.switchArea(0) - container.opacity = 1.0 - } + function turnToFullscreen() { + image.source = './images/fullscreen.png' + container.state = 'fullscreen' + container.opacity = 0.0 + touchArea.switchArea(1) } - Connections { - target: homescreenHandler - onHideWindow: { - container.state = 'fullscreen' - image.visible = false - touchArea.switchArea(1) - container.opacity = 0.0 - } + function turnToNormal() { + image.source = './images/normal.png' + container.state = 'normal' + container.opacity = 1.0 + touchArea.switchArea(0) } - Timer { - id:informationTimer - interval: 3000 - running: false - repeat: true - onTriggered: { - bottomInformation.visible = false - } + function enableSplitSwitchBtn() { + splitSwitchImage.source = './images/split_switch.png' + splitSwitchBtn.enableSplitSwitchBtn = true } - Item { - id: bottomInformation - width: parent.width - height: 215 - anchors.bottom: parent.bottom - visible: false - Text { - id: bottomText - anchors.centerIn: parent - font.pixelSize: 25 - font.letterSpacing: 5 - horizontalAlignment: Text.AlignHCenter - color: "white" - text: "" - z:1 - } + function disableSplitSwitchBtn() { + splitSwitchImage.source = './images/split_switch_disable.png' + splitSwitchBtn.enableSplitSwitchBtn = false; } - Connections { - target: homescreenHandler - onShowInformation: { - bottomText.text = info - bottomInformation.visible = true - informationTimer.restart() - } - } - - Timer { - id:notificationTimer - interval: 3000 - running: false - repeat: true - onTriggered: notificationItem.visible = false - } - - Item { - id: notificationItem - x: 0 - y: 0 - z: 1 - width: 1280 - height: 100 - opacity: 0.8 - visible: false - - Rectangle { - width: parent.width - height: parent.height - anchors.fill: parent - color: "gray" - Image { - id: notificationIcon - width: 70 - height: 70 - anchors.left: parent.left - anchors.leftMargin: 20 - anchors.verticalCenter: parent.verticalCenter - source: "" - } - - Text { - id: notificationtext - font.pixelSize: 25 - anchors.left: notificationIcon.right - anchors.leftMargin: 5 - anchors.verticalCenter: parent.verticalCenter - color: "white" - text: qsTr("") - } - } - } - - Connections { - target: homescreenHandler - onShowNotification: { - notificationIcon.source = icon_path - notificationtext.text = text - notificationItem.visible = true - notificationTimer.restart() - } + function switchSplitArea(val) { + homescreenHandler.changeLayout(val); } } diff --git a/homescreen/qml/qml.qrc b/homescreen/qml/qml.qrc index e60ea63..933a8a5 100644 --- a/homescreen/qml/qml.qrc +++ b/homescreen/qml/qml.qrc @@ -1,10 +1,6 @@ main.qml - MediaArea.qml - MediaAreaBlank.qml - MediaAreaMusic.qml - MediaAreaRadio.qml ShortcutArea.qml ShortcutIcon.qml StatusArea.qml diff --git a/homescreen/src/applicationlauncher.cpp b/homescreen/src/applicationlauncher.cpp index a72ea9f..5a1e2d6 100644 --- a/homescreen/src/applicationlauncher.cpp +++ b/homescreen/src/applicationlauncher.cpp @@ -81,6 +81,5 @@ void ApplicationLauncher::setCurrent(const QString ¤t) { if (m_current == current) return; m_current = current; - qDebug() << "setCurrent" << m_current; emit currentChanged(current); } diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp index cbf816a..251dbe9 100644 --- a/homescreen/src/homescreenhandler.cpp +++ b/homescreen/src/homescreenhandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, 2019 TOYOTA MOTOR CORPORATION + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,22 +14,20 @@ * limitations under the License. */ -#include #include "homescreenhandler.h" #include +#include +#include #include -#include -#include #include "hmi-debug.h" -#define BUF_SIZE 1024 void* HomescreenHandler::myThis = 0; HomescreenHandler::HomescreenHandler(QObject *parent) : QObject(parent), - mp_qhs(NULL), - current_application("launcher") + mp_qhs(NULL), mp_wm(NULL), m_role() { + } HomescreenHandler::~HomescreenHandler() @@ -37,164 +35,88 @@ HomescreenHandler::~HomescreenHandler() if (mp_qhs != NULL) { delete mp_qhs; } + if (mp_wm != NULL) { + delete mp_wm; + } } -void HomescreenHandler::init(int port, const char *token, QLibWindowmanager *qwm, QString myname) +void HomescreenHandler::init(const char* role, int port, const char *token) { + this->m_role = role; + + // LibWindowManager initialize + mp_wm = new LibWindowmanager(); + if(mp_wm->init(port,token) != 0){ + exit(EXIT_FAILURE); + } + + int surface = mp_wm->requestSurface(m_role.c_str()); + if (surface < 0) { + exit(EXIT_FAILURE); + } + std::string ivi_id = std::to_string(surface); + setenv("QT_IVI_SURFACE_ID", ivi_id.c_str(), true); + + // LibHomeScreen initialize mp_qhs = new QLibHomeScreen(); mp_qhs->init(port, token); myThis = this; - mp_qwm = qwm; - m_myname = myname; mp_qhs->registerCallback(nullptr, HomescreenHandler::onRep_static); - mp_qhs->set_event_handler(QLibHomeScreen::Event_ShowWindow,[this](json_object *object){ - HMI_DEBUG("Launcher","Surface launcher got Event_ShowWindow\n"); - static bool first_start = true; - if (first_start) { - first_start = false; - mp_qwm->activateWindow(m_myname); - } - else { - emit showWindow(); - } - }); - mp_qhs->set_event_handler(QLibHomeScreen::Event_OnScreenMessage, [this](json_object *object){ const char *display_message = json_object_get_string( json_object_object_get(object, "display_message")); HMI_DEBUG("HomeScreen","set_event_handler Event_OnScreenMessage display_message = %s", display_message); }); - - mp_qhs->set_event_handler(QLibHomeScreen::Event_ShowNotification,[this](json_object *object){ - json_object *p_obj = json_object_object_get(object, "parameter"); - const char *icon = json_object_get_string( - json_object_object_get(p_obj, "icon")); - const char *text = json_object_get_string( - json_object_object_get(p_obj, "text")); - const char *app_id = json_object_get_string( - json_object_object_get(p_obj, "caller")); - HMI_DEBUG("HomeScreen","Event_ShowNotification icon=%s, text=%s, caller=%s", icon, text, app_id); - QFileInfo icon_file(icon); - QString icon_path; - if (icon_file.isFile() && icon_file.exists()) { - icon_path = QString(QLatin1String(icon)); - } else { - icon_path = "./images/Utility_Logo_Grey-01.svg"; - } - - emit showNotification(QString(QLatin1String(app_id)), icon_path, QString(QLatin1String(text))); - }); - - mp_qhs->set_event_handler(QLibHomeScreen::Event_ShowInformation,[this](json_object *object){ - json_object *p_obj = json_object_object_get(object, "parameter"); - const char *info = json_object_get_string( - json_object_object_get(p_obj, "info")); - - emit showInformation(QString(QLatin1String(info))); - }); - - mp_qhs->set_event_handler(QLibHomeScreen::Event_HideWindow, [this](json_object *object) { - emit hideWindow(); - HMI_DEBUG("HomeScreen","set_event_handler Event_HideWindow"); - }); - - mp_qhs->set_event_handler(QLibHomeScreen::Event_RegisterShortcut,[this](json_object *object){ - HMI_DEBUG("HomeScreen","set_event_handler Event_RegisterShortcut"); - json_object *p_obj = json_object_object_get(object, "parameter"); - const char *shortcut_id = json_object_get_string( - json_object_object_get(p_obj, "shortcut_id")); - const char *shortcut_name = json_object_get_string( - json_object_object_get(p_obj, "shortcut_name")); - const char *position = json_object_get_string( - json_object_object_get(p_obj, "position")); - HMI_DEBUG("HomeScreen", "Event_RegisterShortcut id==%s, name==%s, position ==%s", shortcut_id, shortcut_name, position); - emit shortcutChanged(QString(QLatin1String(shortcut_id)), QString(QLatin1String(shortcut_name)), QString(QLatin1String(position))); - }); } -void HomescreenHandler::tapShortcut(QString application_id, bool is_full) -{ - HMI_DEBUG("HomeScreen","tapShortcut %s", application_id.toStdString().c_str()); - struct json_object* j_json = json_object_new_object(); - struct json_object* value; - if(is_full) { - value = json_object_new_string("fullscreen"); - HMI_DEBUG("HomeScreen","fullscreen"); - } else { - value = json_object_new_string("normal.full"); - HMI_DEBUG("HomeScreen","normal"); - } - json_object_object_add(j_json, "area", value); - mp_qhs->showWindow(application_id.section('@', 0, 0).toStdString().c_str(), j_json); +void HomescreenHandler::setWMHandler(WMHandler& h) { + h.on_sync_draw = [&](const char* role, const char* area, Rect r) { + this->mp_wm->endDraw(this->m_role.c_str()); + }; + mp_wm->setEventHandler(h); } -void HomescreenHandler::updateShortcut(QString id, struct json_object* object) +void HomescreenHandler::disconnect_frame_swapped(void) { - mp_qhs->updateShortcut(id.toStdString().c_str(), object); + qDebug("Let's start homescreen"); + QObject::disconnect(this->loading); + mp_wm->activateWindow(m_role.c_str(), "fullscreen"); } - -void HomescreenHandler::setCurrentApplication(QString application_name) +void HomescreenHandler::attach(QQmlApplicationEngine* engine) { - HMI_DEBUG("HomeScreen","setCurrentApplication %s", application_name.toStdString().c_str()); - current_application = application_name; + QQuickWindow *window = qobject_cast(engine->rootObjects().first()); +// this->loading = QObject::connect(window, SIGNAL(frameSwapped()), this, SLOT(disconnect_frame_swapped())); + mp_qhs->setQuickWindow(window); } -QString HomescreenHandler::getCurrentApplication() +void HomescreenHandler::changeLayout(int pattern) { - HMI_DEBUG("HomeScreen","getCurrentApplication %s", current_application.toStdString().c_str()); - return current_application; -} - -int HomescreenHandler::getPidOfApplication(QString application_name) { - DIR *dir = NULL; - struct dirent *dir_ent_ptr = NULL; - FILE *fp = NULL; - char file_path[50] = {0}; - char cur_task_ame[50] = {0}; - char buf[BUF_SIZE] = {0}; - int pid = -1; - - dir = opendir("/proc"); - if (dir) { - while((dir_ent_ptr = readdir(dir)) != NULL) { - if ((strcmp(dir_ent_ptr->d_name, ".") == 0) || (strcmp(dir_ent_ptr->d_name, "..") == 0) - || (DT_DIR != dir_ent_ptr->d_type)) - continue; - sprintf(file_path, "/proc/%s/status", dir_ent_ptr->d_name); - fp = fopen(file_path, "r"); - if (fp) { - if (fgets(buf, BUF_SIZE - 1, fp) == NULL) { - fclose(fp); - continue; - } - sscanf(buf, "%*s %s", cur_task_ame); - if (0 == strcmp(application_name.toStdString().c_str(), cur_task_ame)) { - pid = atoi(dir_ent_ptr->d_name); - break; - } - } - } + HMI_NOTICE("HomeScreen", "Pressed %d, %s", pattern, + (pattern == P_LEFT_METER_RIGHT_MAP) ? "left:meter, right:map": "left:map, right:meter"); + ChangeAreaReq req; + std::unordered_map map_list; + switch(pattern) { + case P_LEFT_METER_RIGHT_MAP: + map_list["split.main"] = Rect(0, 0, 1280, 720); + map_list["split.sub"] = Rect(1280, 0, 640, 720); + break; + case P_LEFT_MAP_RIGHT_METER: + map_list["split.main"] = Rect(640, 0, 1280, 720); + map_list["split.sub"] = Rect(0, 0, 640, 720); + break; + default: + break; + } + if(map_list.size() != 0) + { + req.setAreaReq(map_list); + HMI_NOTICE("Homescreen", "Change layout"); + mp_wm->changeAreaSize(req); } - - return pid; -} - -void HomescreenHandler::killRunningApplications() -{ - QProcess *proc = new QProcess; - QProcess *proc2 = new QProcess; -// int num = getPidOfApplication("afbd-video@0.1"); -// QString procNum = QString::number(num); - QString command = "/usr/bin/pkill videoplayer"; - QString command2 = "/usr/bin/pkill navigation"; - proc->start(command); - proc2->start(command2); - HMI_DEBUG("homescreen", command.toStdString().c_str()); - HMI_DEBUG("homescreen", command2.toStdString().c_str()); } void HomescreenHandler::reboot() @@ -203,6 +125,12 @@ void HomescreenHandler::reboot() QProcess::execute("reboot -f"); } +void HomescreenHandler::tapShortcut(QString application_name) +{ + HMI_DEBUG("HomeScreen","tapShortcut %s", application_name.toStdString().c_str()); + mp_qhs->tapShortcut(application_name.toStdString().c_str()); +} + void HomescreenHandler::onRep_static(struct json_object* reply_contents) { static_cast(HomescreenHandler::myThis)->onRep(reply_contents); @@ -232,8 +160,3 @@ void HomescreenHandler::onEv(const string& event, struct json_object* event_cont HMI_DEBUG("HomeScreen","display_message = %s", display_message); } } - -void HomescreenHandler::setQuickWindow(QQuickWindow *qw) -{ - mp_qhs->setQuickWindow(qw); -} diff --git a/homescreen/src/homescreenhandler.h b/homescreen/src/homescreenhandler.h index 4afbac4..69599de 100644 --- a/homescreen/src/homescreenhandler.h +++ b/homescreen/src/homescreenhandler.h @@ -18,28 +18,33 @@ #define HOMESCREENHANDLER_H #include -#include #include -#include +#include #include using namespace std; +class QQmlApplicationEngine; + class HomescreenHandler : public QObject { Q_OBJECT public: + enum CHANGE_LAYOUT_PATTERN { + P_LEFT_METER_RIGHT_MAP = 0, + P_LEFT_MAP_RIGHT_METER + }; + Q_ENUMS(CHANGE_LAYOUT_PATTERN) explicit HomescreenHandler(QObject *parent = 0); ~HomescreenHandler(); - void init(int port, const char* token, QLibWindowmanager *qwm, QString myname); + void init(const char* role, int port, const char* token); + void attach(QQmlApplicationEngine* engine); + void setWMHandler(WMHandler &handler); - Q_INVOKABLE void tapShortcut(QString application_name, bool is_full); - Q_INVOKABLE QString getCurrentApplication(); - Q_INVOKABLE void killRunningApplications(); + Q_INVOKABLE void tapShortcut(QString application_name); + Q_INVOKABLE void changeLayout(int pattern); Q_INVOKABLE void reboot(); - void setCurrentApplication(QString application_name); - int getPidOfApplication(QString application_name); void onRep(struct json_object* reply_contents); void onEv(const string& event, struct json_object* event_contents); @@ -47,23 +52,19 @@ public: static void* myThis; static void onRep_static(struct json_object* reply_contents); static void onEv_static(const string& event, struct json_object* event_contents); - void setQuickWindow(QQuickWindow *qw); signals: - void showNotification(QString application_id, QString icon_path, QString text); - void showInformation(QString info); - void shortcutChanged(QString shortcut_id, QString shortcut_name, QString position); - void showWindow(); - void hideWindow(); + void notification(QString id, QString icon, QString text); + void information(QString text); -public slots: - void updateShortcut(QString id, struct json_object* object); +private Q_SLOTS: + void disconnect_frame_swapped(void); private: QLibHomeScreen *mp_qhs; - QLibWindowmanager *mp_qwm; - QString m_myname; - QString current_application; + LibWindowmanager *mp_wm; + std::string m_role; + QMetaObject::Connection loading; }; #endif // HOMESCREENHANDLER_H diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp index 0c477fd..ba5d36a 100644 --- a/homescreen/src/main.cpp +++ b/homescreen/src/main.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH - * Copyright (c) 2017, 2018 TOYOTA MOTOR CORPORATION + * Copyright (c) 2017 TOYOTA MOTOR CORPORATION * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,17 +24,15 @@ #include #include -#include #include #include #include "applicationlauncher.h" #include "statusbarmodel.h" #include "afm_user_daemon_proxy.h" -#include "mastervolume.h" #include "homescreenhandler.h" #include "toucharea.h" -#include "shortcutappmodel.h" #include "hmi-debug.h" +#include // XXX: We want this DBus connection to be shared across the different // QML objects, is there another way to do this, a nice way, perhaps? @@ -58,6 +56,7 @@ void noOutput(QtMsgType, const QMessageLogContext &, const QString &) int main(int argc, char *argv[]) { QGuiApplication a(argc, argv); + const char* graphic_role = "homescreen"; // use launch process QScopedPointer afm_user_daemon_proxy(new org::AGL::afm::user("org.AGL.afm.user", @@ -81,7 +80,6 @@ int main(int argc, char *argv[]) int port = 1700; QString token = "wm"; - QString graphic_role = "homescreen"; // defined in layers.json in Window Manager if (positionalArguments.length() == 2) { port = positionalArguments.takeFirst().toInt(); @@ -93,22 +91,10 @@ int main(int argc, char *argv[]) // import C++ class to QML // qmlRegisterType("HomeScreen", 1, 0, "ApplicationLauncher"); qmlRegisterType("HomeScreen", 1, 0, "StatusBarModel"); - qmlRegisterType("MasterVolume", 1, 0, "MasterVolume"); - qmlRegisterType("ShortcutAppModel", 1, 0, "ShortcutAppModel"); ApplicationLauncher *launcher = new ApplicationLauncher(); - QLibWindowmanager* layoutHandler = new QLibWindowmanager(); HomescreenHandler* homescreenHandler = new HomescreenHandler(); - ShortcutAppModel* shortcutAppModel = new ShortcutAppModel(); - if(layoutHandler->init(port,token) != 0){ - exit(EXIT_FAILURE); - } - - AGLScreenInfo screenInfo(layoutHandler->get_scale_factor()); - - if (layoutHandler->requestSurface(graphic_role) != 0) { - exit(EXIT_FAILURE); - } + homescreenHandler->init(graphic_role, port, token.toStdString().c_str()); QUrl bindingAddress; bindingAddress.setScheme(QStringLiteral("ws")); @@ -121,47 +107,46 @@ int main(int argc, char *argv[]) bindingAddress.setQuery(query); TouchArea* touchArea = new TouchArea(); - homescreenHandler->init(port, token.toStdString().c_str(), layoutHandler, graphic_role); // mail.qml loading QQmlApplicationEngine engine; - engine.rootContext()->setContextProperty("bindingAddress", bindingAddress); - engine.rootContext()->setContextProperty("layoutHandler", layoutHandler); engine.rootContext()->setContextProperty("homescreenHandler", homescreenHandler); engine.rootContext()->setContextProperty("touchArea", touchArea); - engine.rootContext()->setContextProperty("shortcutAppModel", shortcutAppModel); engine.rootContext()->setContextProperty("launcher", launcher); engine.rootContext()->setContextProperty("weather", new Weather(bindingAddress)); - engine.rootContext()->setContextProperty("bluetooth", new Bluetooth(bindingAddress, engine.rootContext())); - engine.rootContext()->setContextProperty("screenInfo", &screenInfo); +// engine.rootContext()->setContextProperty("bluetooth", new Bluetooth(bindingAddress)); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); QObject *root = engine.rootObjects().first(); - QQuickWindow *window = qobject_cast(root); - homescreenHandler->setQuickWindow(window); - - layoutHandler->set_event_handler(QLibWindowmanager::Event_SyncDraw, [layoutHandler, &graphic_role](json_object *object) { - layoutHandler->endDraw(graphic_role); - }); - layoutHandler->set_event_handler(QLibWindowmanager::Event_ScreenUpdated, [layoutHandler, launcher, homescreenHandler, root](json_object *object) { - json_object *jarray = json_object_object_get(object, "ids"); - HMI_DEBUG("HomeScreen","ids=%s", json_object_to_json_string(object)); - int arrLen = json_object_array_length(jarray); + WMHandler wmh; + wmh.on_screen_updated = [launcher, root](std::vector list) { + for(const auto& i : list) { + HMI_DEBUG("HomeScreen", "ids=%s", i.c_str()); + } + int arrLen = list.size(); QString label = QString(""); for( int idx = 0; idx < arrLen; idx++) { - label = QString(json_object_get_string( json_object_array_get_idx(jarray, idx) )); - HMI_DEBUG("HomeScreen","Event_ScreenUpdated application11: %s.", label.toStdString().c_str()); - homescreenHandler->setCurrentApplication(label); + label = list[idx].c_str(); + HMI_DEBUG("HomeScreen","Event_ScreenUpdated application: %s.", label.toStdString().c_str()); QMetaObject::invokeMethod(launcher, "setCurrent", Qt::QueuedConnection, Q_ARG(QString, label)); + if(label == "launcher") { + QMetaObject::invokeMethod(root, "turnToNormal"); + } else { + QMetaObject::invokeMethod(root, "turnToFullscreen"); + } + if((arrLen == 1) && (QString("restriction") != label)) { + QMetaObject::invokeMethod(root, "disableSplitSwitchBtn"); + } else { + QMetaObject::invokeMethod(root, "enableSplitSwitchBtn"); + } } - if((arrLen == 1) && (QString("navigation") == label)){ - QMetaObject::invokeMethod(root, "changeSwitchState", Q_ARG(QVariant, true)); - }else{ - QMetaObject::invokeMethod(root, "changeSwitchState", Q_ARG(QVariant, false)); - } - }); + }; + homescreenHandler->setWMHandler(wmh); + homescreenHandler->attach(&engine); + + QQuickWindow *window = qobject_cast(root); touchArea->setWindow(window); QThread* thread = new QThread; @@ -174,10 +159,5 @@ int main(int argc, char *argv[]) StatusBarModel *statusBar = sobjs.first()->findChild("statusBar"); statusBar->init(bindingAddress, engine.rootContext()); - QObject::connect(homescreenHandler, SIGNAL(shortcutChanged(QString, QString, QString)), shortcutAppModel, SLOT(changeShortcut(QString, QString, QString))); - QObject::connect(shortcutAppModel, SIGNAL(shortcutUpdated(QString, struct json_object*)), homescreenHandler, SLOT(updateShortcut(QString, struct json_object*))); - - shortcutAppModel->screenUpdated(); - return a.exec(); } diff --git a/homescreen/src/mastervolume.cpp b/homescreen/src/mastervolume.cpp deleted file mode 100644 index 35b47fc..0000000 --- a/homescreen/src/mastervolume.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2017 Konsulko Group - * - * 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 "mastervolume.h" -#include -#include -#include - -MasterVolume::MasterVolume(QObject* parent) - : QObject(parent) - , m_volume{50} -{ - connect(&m_client, SIGNAL(connected()), this, SLOT(onClientConnected())); - connect(&m_client, SIGNAL(disconnected()), this, SLOT(onClientDisconnected())); - connect(&m_client, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onClientError(QAbstractSocket::SocketError))); - connect(&m_client, SIGNAL(eventReceived(QString, const QJsonValue&)), this, SLOT(onClientEventReceived(QString, const QJsonValue&))); -} - -void MasterVolume::open(const QUrl& url) -{ - m_url = url; - TryOpen(); -} - -qint32 MasterVolume::getVolume() const -{ - return m_volume; -} - -void MasterVolume::setVolume(qint32 volume) -{ - if (m_volume != volume) - { - m_volume = volume; - QJsonObject arg; - arg.insert("action", "volume"); - arg.insert("value", volume); - m_client.call("ahl-4a", "activerole", arg, [](bool, const QJsonValue&) { - // Nothing to do, events will update sliders - }); - } -} - -void MasterVolume::onClientConnected() -{ - // Subscribe to 4a events - m_client.call("ahl-4a", "subscribe", QJsonValue(), [this](bool r, const QJsonValue&) { - if (r) qDebug() << "MasterVolume::onClientConnected - subscribed to 4a events!"; - else qCritical () << "MasterVolume::onClientConnected - Failed to subscribe to 4a events!"; - }); -} - -void MasterVolume::onClientDisconnected() -{ - qDebug() << "MasterVolume::onClientDisconnected!"; - QTimer::singleShot(1000, this, SLOT(TryOpen())); -} - -void MasterVolume::onClientError(QAbstractSocket::SocketError se) -{ - qDebug() << "MasterVolume::onClientError: " << se; -} - -void MasterVolume::onClientEventReceived(QString name, const QJsonValue& data) -{ - qDebug() << "MasterVolume::onClientEventReceived[" << name << "]: " << data; - if (name == "ahl-4a/volume_changed") - { - QJsonObject arg = data.toObject(); - bool active = arg["active"].toBool(); - if (active) - { - // QString role = arg["role"].toString(); - int volume = arg["volume"].toInt(); - if (m_volume != volume) - { - m_volume = volume; - emit VolumeChanged(); - } - } - } -} - -void MasterVolume::TryOpen() -{ - m_client.open(m_url); -} diff --git a/homescreen/src/mastervolume.h b/homescreen/src/mastervolume.h deleted file mode 100644 index 6ae0aad..0000000 --- a/homescreen/src/mastervolume.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2017 Konsulko Group - * - * 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 "../qafbwebsocketclient.h" - -class MasterVolume - : public QObject -{ - Q_OBJECT - Q_PROPERTY (uint32_t volume READ getVolume WRITE setVolume NOTIFY VolumeChanged) - -private: - QAfbWebsocketClient m_client; - QUrl m_url; - qint32 m_volume; - -public: - MasterVolume(QObject* parent = nullptr); - ~MasterVolume() = default; - - Q_INVOKABLE void open(const QUrl& url); - Q_INVOKABLE qint32 getVolume() const; - Q_INVOKABLE void setVolume(qint32 val); - -private slots: - void onClientConnected(); - void onClientDisconnected(); - void onClientError(QAbstractSocket::SocketError se); - void onClientEventReceived(QString name, const QJsonValue& data); - void TryOpen(); - -signals: - void VolumeChanged(); -}; diff --git a/homescreen/src/shortcutappmodel.cpp b/homescreen/src/shortcutappmodel.cpp deleted file mode 100644 index 76078da..0000000 --- a/homescreen/src/shortcutappmodel.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2017 TOYOTA MOTOR CORPORATION - * - * 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 "shortcutappmodel.h" -#include "hmi-debug.h" -#include -#define SHORTCUTKEY_PATH "/var/local/lib/afm/applications/homescreen/0.1/etc/registeredApp.json" - -class ShortcutAppModel::Private -{ -public: - Private(); - - QList data; -}; - -ShortcutAppModel::Private::Private() -{ -} - - -ShortcutAppModel::ShortcutAppModel(QObject *parent) - : QAbstractListModel(parent) - , d(new Private()) -{ - getAppQueue(); -} - -ShortcutAppModel::~ShortcutAppModel() -{ - delete this->d; -} - -int ShortcutAppModel::rowCount(const QModelIndex &parent) const -{ - if (parent.isValid()) - return 0; - - return this->d->data.count(); -} - -QVariant ShortcutAppModel::data(const QModelIndex &index, int role) const -{ - QVariant ret; - if (!index.isValid()) - return ret; - - switch (role) { - case Qt::DecorationRole: - ret = this->d->data[index.row()].icon; - break; - case Qt::DisplayRole: - ret = this->d->data[index.row()].name; - break; - case Qt::UserRole: - ret = this->d->data[index.row()].id; - break; - default: - break; - } - - return ret; -} - -QHash ShortcutAppModel::roleNames() const -{ - QHash roles; - roles[Qt::DecorationRole] = "icon"; - roles[Qt::DisplayRole] = "name"; - roles[Qt::UserRole] = "id"; - return roles; -} - -void ShortcutAppModel::changeShortcut(QString id, QString name, QString position) -{ - for(int i = 1; i < d->data.size(); i++) { - if(id == d->data.at(i).id) { - return; - } - } - d->data.removeAt(position.toInt() + 1); - - RegisterApp temp; - temp.id = id; - temp.name = name; - temp.icon = temp.icon = getIconPath(temp.id); - if (temp.icon == "") { - temp.isBlank = true; - } else { - temp.isBlank = false; - } - - d->data.insert(position.toInt() + 1, temp); - setAppQueue(); - emit updateShortcut(); - struct json_object* obj = makeAppListJson(); - emit shortcutUpdated(QString("launcher"), obj); -} - -struct json_object* ShortcutAppModel::makeAppListJson() -{ - struct json_object* obj = json_object_new_object(); - struct json_object* obj_array = json_object_new_array(); - for(int i = 1; i < d->data.size(); i++) - { - struct json_object* obj_shortcut = json_object_new_object(); - json_object_object_add(obj_shortcut, "shortcut_id", json_object_new_string(d->data.at(i).id.toStdString().c_str())); - json_object_object_add(obj_shortcut, "shortcut_name", json_object_new_string(d->data.at(i).name.toStdString().c_str())); - json_object_array_add(obj_array, obj_shortcut); - } - json_object_object_add(obj, "shortcut", obj_array); - HMI_DEBUG("Homescreen", "makeAppListJson id1=%s",json_object_new_string(d->data.at(1).name.toStdString().c_str())); - return obj; -} - -QString ShortcutAppModel::getId(int index) const -{ - return d->data.at(index).id; -} - -QString ShortcutAppModel::getName(int index) const -{ - return d->data.at(index).name; -} - -QString ShortcutAppModel::getIcon(int index) const -{ - return d->data.at(index).icon; -} - -bool ShortcutAppModel::isBlank(int index) const -{ - return d->data.at(index).isBlank; -} - -QString ShortcutAppModel::getIconPath(QString id) -{ - QString name = id.section('@', 0, 0); - QString version = id.section('@', 1, 1); - QString boardIconPath = "/var/local/lib/afm/applications/" + name + "/" + version + "/icon.svg"; - QString appIconPath = ":/images/Shortcut/" + name + ".svg"; - if (QFile::exists(boardIconPath)) { - return "file://" + boardIconPath; - } else if (QFile::exists(appIconPath)) { - return appIconPath.section('/', 1, -1); - } - return ""; -} - -void ShortcutAppModel::getAppQueue() -{ - QProcess *process = new QProcess(this); - if(checkAppFile()) { - process->start("cp /var/local/lib/afm/applications/homescreen/0.1/etc/registeredApp.aaa.json /var/local/lib/afm/applications/homescreen/0.1/etc/registeredApp.json"); - } else { - process->start("cp /var/local/lib/afm/applications/homescreen/0.1/etc/registeredApp.json /var/local/lib/afm/applications/homescreen/0.1/etc/registeredApp.aaa.json"); - } - QThread::msleep(300); - - QFile file(SHORTCUTKEY_PATH); - if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QByteArray allData = file.readAll(); - QString str(allData); - if(str == "") { - file.close(); - - } - QJsonParseError json_error; - QJsonDocument jsonDoc(QJsonDocument::fromJson(allData, &json_error)); - - if(json_error.error != QJsonParseError::NoError) - { - HMI_ERROR("HomeScreen", "registeredApp.json error"); - return; - } - - QJsonObject rootObj = jsonDoc.object(); - - QJsonObject subObj = rootObj.value("1st shortcut key").toObject(); - setAppQueuePoint(subObj["id"].toString(), subObj["name"].toString()); - subObj = rootObj.value("2nd shortcut key").toObject(); - setAppQueuePoint(subObj["id"].toString(), subObj["name"].toString()); - subObj = rootObj.value("3rd shortcut key").toObject(); - setAppQueuePoint(subObj["id"].toString(), subObj["name"].toString()); - subObj = rootObj.value("4th shortcut key").toObject(); - setAppQueuePoint(subObj["id"].toString(), subObj["name"].toString()); - } - file.close(); -} - -void ShortcutAppModel::setAppQueuePoint(QString id, QString name) -{ - app.id = id; - app.icon = getIconPath(app.id); - if (app.icon == "") { - app.isBlank = true; - } else { - app.isBlank = false; - } - app.name = name; - d->data.append(app); -} - -void ShortcutAppModel::screenUpdated() -{ - struct json_object* obj = makeAppListJson(); - emit shortcutUpdated(QString("launcher"), obj); -} - -void ShortcutAppModel::setAppQueue() -{ - QFile file(SHORTCUTKEY_PATH); - if(file.open(QIODevice::WriteOnly | QIODevice::Text)) { - QJsonObject rootObj, subObj1, subObj2, subObj3, subObj4; - subObj1.insert("id", d->data.at(0).id); - subObj1.insert("name", d->data.at(0).name); - subObj2.insert("id", d->data.at(1).id); - subObj2.insert("name", d->data.at(1).name); - subObj3.insert("id", d->data.at(2).id); - subObj3.insert("name", d->data.at(2).name); - subObj4.insert("id", d->data.at(3).id); - subObj4.insert("name", d->data.at(3).name); - rootObj.insert("1st shortcut key", subObj1); - rootObj.insert("2nd shortcut key", subObj2); - rootObj.insert("3rd shortcut key", subObj3); - rootObj.insert("4th shortcut key", subObj4); - - QJsonDocument jsonDoc; - jsonDoc.setObject(rootObj); - - file.write(jsonDoc.toJson()); - } else { - HMI_ERROR("HomeScreen", "write to registeredApp.json file failed"); - } - file.flush(); - fsync(file.handle()); - file.close(); -} - -bool ShortcutAppModel::checkAppFile() -{ - bool fileError = false; - QFile file(SHORTCUTKEY_PATH); - if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QByteArray line = file.readLine(); - if(line == "\n" || line.isEmpty()) { - fileError = true; - } - } else { - fileError = true; - HMI_ERROR("HomeScreen", "registeredApp.json file open failed"); - } - file.close(); - return fileError; -} diff --git a/homescreen/src/shortcutappmodel.h b/homescreen/src/shortcutappmodel.h deleted file mode 100644 index f177a95..0000000 --- a/homescreen/src/shortcutappmodel.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef SHORTCUTAPPMODEL_H -#define SHORTCUTAPPMODEL_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct RegisterApp { - QString id; - QString name; - QString icon; - bool isBlank; -}; - -class ShortcutAppModel : public QAbstractListModel -{ - Q_OBJECT -public: - explicit ShortcutAppModel(QObject *parent = nullptr); - ~ShortcutAppModel(); - - int rowCount(const QModelIndex &parent = QModelIndex()) const override; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QHash roleNames() const override; - - Q_INVOKABLE QString getId(int index) const; - Q_INVOKABLE QString getName(int index) const; - Q_INVOKABLE QString getIcon(int index) const; - Q_INVOKABLE bool isBlank(int index) const; - - void screenUpdated(); - -public slots: - void changeShortcut(QString id, QString name, QString position); - -signals: - void updateShortcut(); - void shortcutUpdated(QString id, struct json_object* object); - -private: - void getAppQueue(); - void setAppQueue(); - bool checkAppFile(); - void setAppQueuePoint(QString id, QString name); - QString getIconPath(QString id); - struct json_object* makeAppListJson(); - - class Private; - Private *d; - RegisterApp app; - -}; - -#endif // SHORTCUTAPPMODEL_H diff --git a/homescreen/src/statusbarmodel.cpp b/homescreen/src/statusbarmodel.cpp index 5e63b7d..c093ceb 100644 --- a/homescreen/src/statusbarmodel.cpp +++ b/homescreen/src/statusbarmodel.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2016 The Qt Company Ltd. - * Copyright (C) 2017, 2018 TOYOTA MOTOR CORPORATION * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +16,14 @@ #include "statusbarmodel.h" #include "statusbarserver.h" +#include +#include "hmi-debug.h" #include #include "network.h" + class StatusBarModel::Private { public: @@ -65,6 +67,7 @@ StatusBarModel::~StatusBarModel() void StatusBarModel::init(QUrl &url, QQmlContext *context) { + HMI_DEBUG("HomeScreen", "StatusBarModel::init"); d->network = new Network(url, context); context->setContextProperty("network", d->network); @@ -77,6 +80,7 @@ void StatusBarModel::init(QUrl &url, QQmlContext *context) void StatusBarModel::setWifiStatus(bool connected, bool enabled, int strength) { + HMI_DEBUG("HomeScreen", "StatusBarModel::setWifiStatus"); if (enabled && connected) if (strength < 30) d->server.setStatusIcon(0, QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_1Bar-01.png")); @@ -111,7 +115,6 @@ int StatusBarModel::rowCount(const QModelIndex &parent) const if (parent.isValid()) return 0; - // Delete bluetooth because use agl-service-bluetooth. return StatusBarServer::SupportedCount - 1; } @@ -123,9 +126,9 @@ QVariant StatusBarModel::data(const QModelIndex &index, int role) const switch (role) { case Qt::DisplayRole: - if (index.row() == 0){ + if (index.row() == 0) { ret = d->iconList[StatusBarServer::StatusWifi]; - }else if (index.row() == 1){ + } else if (index.row() == 1) { ret = d->iconList[StatusBarServer::StatusCellular]; } break; diff --git a/homescreen/src/toucharea.cpp b/homescreen/src/toucharea.cpp index 1cf4384..aad4b1b 100644 --- a/homescreen/src/toucharea.cpp +++ b/homescreen/src/toucharea.cpp @@ -1,5 +1,4 @@ #include "toucharea.h" -#include "hmi-debug.h" TouchArea::TouchArea() { @@ -17,8 +16,8 @@ void TouchArea::setWindow(QQuickWindow *window) void TouchArea::init() { - bitmapNormal = QPixmap(":/images/AGL_HMI_Normal_Background.png").createHeuristicMask(); - bitmapFullscreen = QPixmap(":/images/AGL_HMI_Full_Background.png").createHeuristicMask(); + bitmapNormal = QPixmap(":/images/menubar_normal_background.png").createHeuristicMask(); + bitmapFullscreen = QPixmap(":/images/menubar_full_background.png").createHeuristicMask(); myWindow->setMask(QRegion(bitmapNormal)); } @@ -26,9 +25,7 @@ void TouchArea::switchArea(int areaType) { if(areaType == NORMAL) { myWindow->setMask(QRegion(bitmapNormal)); - HMI_DEBUG("HomeScreen","TouchArea switchArea: %d.", areaType); } else if (areaType == FULLSCREEN) { - HMI_DEBUG("HomeScreen","TouchArea switchArea: %d.", areaType); myWindow->setMask(QRegion(bitmapFullscreen)); } } diff --git a/package/config.xml b/package/config.xml index d1e83eb..32d19fd 100644 --- a/package/config.xml +++ b/package/config.xml @@ -12,11 +12,10 @@ - + - diff --git a/package/etc/registeredApp.aaa.json b/package/etc/registeredApp.aaa.json deleted file mode 100644 index 490b33c..0000000 --- a/package/etc/registeredApp.aaa.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "1st shortcut key": { - "id": "launcher@0.1", - "name": "launcher" - }, - "2nd shortcut key": { - "id": "sdl_usb@5.0", - "name": "sdl_usb" - }, - "3rd shortcut key": { - "id": "video@0.1", - "name": "video" - }, - "4th shortcut key": { - "id": "navigation@0.1", - "name": "navigation" - } -} diff --git a/package/etc/registeredApp.json b/package/etc/registeredApp.json deleted file mode 100644 index 490b33c..0000000 --- a/package/etc/registeredApp.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "1st shortcut key": { - "id": "launcher@0.1", - "name": "launcher" - }, - "2nd shortcut key": { - "id": "sdl_usb@5.0", - "name": "sdl_usb" - }, - "3rd shortcut key": { - "id": "video@0.1", - "name": "video" - }, - "4th shortcut key": { - "id": "navigation@0.1", - "name": "navigation" - } -} diff --git a/package/package.pro b/package/package.pro index 1f175d3..09c7a01 100644 --- a/package/package.pro +++ b/package/package.pro @@ -12,12 +12,6 @@ copy_config.commands = $(COPY_FILE) \"$$replace(copy_config.depends, /, $$QMAKE_ QMAKE_EXTRA_TARGETS += copy_config PRE_TARGETDEPS += $$copy_config.target -copy_json.target = $$OUT_PWD/root/etc -copy_json.depends = $$_PRO_FILE_PWD_/etc -copy_json.commands = $(COPY_DIR) \"$$replace(copy_json.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_json.target, /, $$QMAKE_DIR_SEP)\" -QMAKE_EXTRA_TARGETS += copy_json -PRE_TARGETDEPS += $$copy_json.target - wgt.target = package wgt.commands = wgtpkg-pack -f -o homescreen.wgt root