From: Bocklage, Jens Date: Mon, 5 Dec 2016 13:19:37 +0000 (+0100) Subject: First integration of new HMI design X-Git-Tag: 3.0.0~42 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=staging%2FHomeScreen.git;a=commitdiff_plain;h=79714c0aa8fc461d77b75d6c5dae6a1a7d726954 First integration of new HMI design Using QML files and C++ integration from Qt's HomeScreenNG sample app. Signed-off-by: Bocklage, Jens --- diff --git a/HomeScreen.pro b/HomeScreen.pro index c8e96b0..da6077b 100644 --- a/HomeScreen.pro +++ b/HomeScreen.pro @@ -37,5 +37,6 @@ HomeScreenAppFrameworkBinderAGL.depends = interfaces InputEventManager.depends = interfaces SampleAppTimeDate.depends = interfaces WindowManager.depends = interfaces +HomeScreenNG.depends = interfaces SampleHomeScreenInterfaceApp.depends = libhomescreen diff --git a/HomeScreen/HomeScreen.pro b/HomeScreen/HomeScreen.pro index dae24dc..1ad42bf 100644 --- a/HomeScreen/HomeScreen.pro +++ b/HomeScreen/HomeScreen.pro @@ -14,7 +14,8 @@ TEMPLATE = app TARGET = HomeScreen -QT = widgets dbus +QT = qml quick widgets dbus +CONFIG += c++11 include(../interfaces/interfaces.pri) include(../ivi_layermanagement_api.pri) @@ -26,7 +27,7 @@ SOURCES += \ src/popupwidget.cpp \ src/controlbarwidget.cpp \ src/statusbarwidget.cpp \ - src/applauncherwidget.cpp \ + src/applauncher.cpp \ src/homescreencontrolinterface.cpp \ src/layouthandler.cpp @@ -36,7 +37,7 @@ HEADERS += \ src/popupwidget.h \ src/controlbarwidget.h \ src/statusbarwidget.h \ - src/applauncherwidget.h \ + src/applauncher.h \ src/homescreencontrolinterface.h \ src/layouthandler.h @@ -56,9 +57,30 @@ TRANSLATIONS = \ OTHER_FILES += \ README.md + +HEADERS += \ + src2/statusbarmodel.h \ + src2/statusbarserver.h \ + src2/applicationlauncher.h + +SOURCES += \ + src2/statusbarmodel.cpp \ + src2/statusbarserver.cpp \ + src2/applicationlauncher.cpp + RESOURCES += \ resources/homescreen.qrc +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 \ + qml/images/images.qrc \ + qml/qml.qrc + + copydata.commands = $(COPY_DIR) $$PWD/resources/colorschemes $$OUT_PWD HomeScreen.depends = $(HomeScreen) copydata export(HomeScreen.depends) diff --git a/HomeScreen/README.md b/HomeScreen/README.md index 6593fc7..64bccce 100644 --- a/HomeScreen/README.md +++ b/HomeScreen/README.md @@ -1,7 +1,7 @@ AGL Home Screen reference implementation -Build with QtCreator 3.0.1 +Build with QtCreator 3.5.1 AGL repo for source code: https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen diff --git a/HomeScreen/qml/MediaArea.qml b/HomeScreen/qml/MediaArea.qml new file mode 100644 index 0000000..e26a452 --- /dev/null +++ b/HomeScreen/qml/MediaArea.qml @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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 1.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 new file mode 100644 index 0000000..3d53061 --- /dev/null +++ b/HomeScreen/qml/MediaAreaBlank.qml @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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_Logo_Background-01.png' + + Image { + anchors.centerIn: parent + source: './images/Utility_Logo_Colour-01.png' + } +} diff --git a/HomeScreen/qml/MediaAreaMusic.qml b/HomeScreen/qml/MediaAreaMusic.qml new file mode 100644 index 0000000..843c53f --- /dev/null +++ b/HomeScreen/qml/MediaAreaMusic.qml @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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 1.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 new file mode 100644 index 0000000..42e2a34 --- /dev/null +++ b/HomeScreen/qml/MediaAreaRadio.qml @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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 new file mode 100644 index 0000000..1d4a7c0 --- /dev/null +++ b/HomeScreen/qml/ShortcutArea.qml @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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 HomeScreen 1.0 + +Item { + id: root + width: 785 + height: 218 + + ApplicationLauncher { + id: launcher + } + + LayoutHandler { + id: layoutHandler + } + + ListModel { + id: applicationModel + ListElement { + name: 'Home' + application: 'webapps-rabbit@0.0' + } + ListElement { + name: 'Multimedia' + application: 'smarthome@0.1' + } + ListElement { + name: 'HVAC' + application: 'hvac' + } + ListElement { + name: 'Navigation' + application: 'navigation' + } + } + + property int currentIndex: -1 // TODO: to be moved to whereever right + property int pid: -1 + + RowLayout { + anchors.fill: parent + spacing: 2 + Repeater { + model: applicationModel + delegate: ShortcutIcon { + Layout.fillWidth: true + Layout.fillHeight: true + name: model.name + active: model.index === root.currentIndex + onClicked: { + root.currentIndex = active ? -1 : model.index + pid = launcher.launch(model.application) + layoutHandler.makeMeVisible(pid) + } + } + } + } +} diff --git a/HomeScreen/qml/ShortcutIcon.qml b/HomeScreen/qml/ShortcutIcon.qml new file mode 100644 index 0000000..299f6a8 --- /dev/null +++ b/HomeScreen/qml/ShortcutIcon.qml @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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 + +MouseArea { + id: root + width: 195 + height: 216.8 + property string name: 'Home' + property bool active: false + Image { + id: icon + anchors.fill: parent + source: './images/Shortcut/HMI_Shortcut_%1-01.png'.arg(root.name) + } + Image { + anchors.fill: parent + source: './images/Shortcut/HMI_Shortcut_%1_Active-01.png'.arg(root.name) + opacity: 1.0 - icon.opacity + } + states: [ + State { + when: root.active + PropertyChanges { + target: icon + opacity: 0.0 + } + } + ] + + transitions: [ + Transition { + NumberAnimation { + properties: 'opacity' + easing.type: Easing.OutExpo + } + } + ] +} diff --git a/HomeScreen/qml/StatusArea.qml b/HomeScreen/qml/StatusArea.qml new file mode 100644 index 0000000..4ed969d --- /dev/null +++ b/HomeScreen/qml/StatusArea.qml @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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 1.0 +import HomeScreen 1.0 + +Item { + id: root + width: 295 + height: 218 + + property date now: new Date + Timer { + interval: 100; running: true; repeat: true; + onTriggered: root.now = new Date + } + + 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 + Label { + 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 +// } + } + Label { + 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 + } + RowLayout { + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 20 + Image { + source: './images/Weather/WeatherIcons_Rain-01.png' + } + Label { + 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 + Repeater { + model: StatusBarModel {} + delegate: Image { + source: model.modelData + fillMode: Image.PreserveAspectFit + } + } + } + } +} diff --git a/HomeScreen/qml/TopArea.qml b/HomeScreen/qml/TopArea.qml new file mode 100644 index 0000000..fdf5a13 --- /dev/null +++ b/HomeScreen/qml/TopArea.qml @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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 + +Image { + width: 1920 + height: 218 + source: './images/TopSection_NoText_NoIcons-01.png' + fillMode: Image.PreserveAspectCrop + + 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 + } + } +} diff --git a/HomeScreen/qml/images/AGL_HMI_Background_NoCar-01.png b/HomeScreen/qml/images/AGL_HMI_Background_NoCar-01.png new file mode 100644 index 0000000..595f742 Binary files /dev/null and b/HomeScreen/qml/images/AGL_HMI_Background_NoCar-01.png differ diff --git a/HomeScreen/qml/images/MediaMusic/AlbumArtwork.png b/HomeScreen/qml/images/MediaMusic/AlbumArtwork.png new file mode 100644 index 0000000..3716ab3 Binary files /dev/null and b/HomeScreen/qml/images/MediaMusic/AlbumArtwork.png differ diff --git a/HomeScreen/qml/images/MediaMusic/BackArrow.png b/HomeScreen/qml/images/MediaMusic/BackArrow.png new file mode 100644 index 0000000..63e38d9 Binary files /dev/null and b/HomeScreen/qml/images/MediaMusic/BackArrow.png differ diff --git a/HomeScreen/qml/images/MediaMusic/ForwardArrow.png b/HomeScreen/qml/images/MediaMusic/ForwardArrow.png new file mode 100644 index 0000000..a513705 Binary files /dev/null and b/HomeScreen/qml/images/MediaMusic/ForwardArrow.png differ diff --git a/HomeScreen/qml/images/MediaMusic/ShuffleIcon.png b/HomeScreen/qml/images/MediaMusic/ShuffleIcon.png new file mode 100644 index 0000000..30f75c5 Binary files /dev/null and b/HomeScreen/qml/images/MediaMusic/ShuffleIcon.png differ diff --git a/HomeScreen/qml/images/MediaMusic/Volume_Loud.png b/HomeScreen/qml/images/MediaMusic/Volume_Loud.png new file mode 100644 index 0000000..8ea4402 Binary files /dev/null and b/HomeScreen/qml/images/MediaMusic/Volume_Loud.png differ diff --git a/HomeScreen/qml/images/MediaMusic/Volume_Medium.png b/HomeScreen/qml/images/MediaMusic/Volume_Medium.png new file mode 100644 index 0000000..ae5c82e Binary files /dev/null and b/HomeScreen/qml/images/MediaMusic/Volume_Medium.png differ diff --git a/HomeScreen/qml/images/MediaMusic/Volume_Off.png b/HomeScreen/qml/images/MediaMusic/Volume_Off.png new file mode 100644 index 0000000..07e3353 Binary files /dev/null and b/HomeScreen/qml/images/MediaMusic/Volume_Off.png differ diff --git a/HomeScreen/qml/images/MediaMusic/mediamusic.qrc b/HomeScreen/qml/images/MediaMusic/mediamusic.qrc new file mode 100644 index 0000000..b1138c0 --- /dev/null +++ b/HomeScreen/qml/images/MediaMusic/mediamusic.qrc @@ -0,0 +1,11 @@ + + + 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 new file mode 100644 index 0000000..14a52b2 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png new file mode 100644 index 0000000..0ec1f67 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png new file mode 100644 index 0000000..bc2df1d Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png new file mode 100644 index 0000000..8d8fc02 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png new file mode 100644 index 0000000..94fe38f Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png new file mode 100644 index 0000000..12609e1 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png new file mode 100644 index 0000000..299903e Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png new file mode 100644 index 0000000..33cc700 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png new file mode 100644 index 0000000..9bdb14d Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png new file mode 100644 index 0000000..76b0fc9 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png new file mode 100644 index 0000000..c423005 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png new file mode 100644 index 0000000..beece66 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png new file mode 100644 index 0000000..eec608f Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png new file mode 100644 index 0000000..d392a90 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png new file mode 100644 index 0000000..22319c9 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png new file mode 100644 index 0000000..9fd42e2 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png new file mode 100644 index 0000000..eb61b39 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png new file mode 100644 index 0000000..de305f0 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png new file mode 100644 index 0000000..d97feec Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png new file mode 100644 index 0000000..7f6445d Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Albums_Active.png b/HomeScreen/qml/images/MediaPlayer/Albums_Active.png new file mode 100644 index 0000000..1f66e23 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Albums_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Albums_Inactive.png b/HomeScreen/qml/images/MediaPlayer/Albums_Inactive.png new file mode 100644 index 0000000..e0e7f00 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Albums_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/DividingLine.png b/HomeScreen/qml/images/MediaPlayer/DividingLine.png new file mode 100644 index 0000000..87f2122 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/DividingLine.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/GreenLine.png b/HomeScreen/qml/images/MediaPlayer/GreenLine.png new file mode 100644 index 0000000..0210b83 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/GreenLine.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Music_Active.png b/HomeScreen/qml/images/MediaPlayer/Music_Active.png new file mode 100644 index 0000000..36afac7 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Music_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Music_Inactive.png b/HomeScreen/qml/images/MediaPlayer/Music_Inactive.png new file mode 100644 index 0000000..9dae353 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Music_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Podcasts_Active.png b/HomeScreen/qml/images/MediaPlayer/Podcasts_Active.png new file mode 100644 index 0000000..fd2d2c0 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Podcasts_Active.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Podcasts_Inactive.png b/HomeScreen/qml/images/MediaPlayer/Podcasts_Inactive.png new file mode 100644 index 0000000..b76b04c Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Podcasts_Inactive.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Popup_Highlight.png b/HomeScreen/qml/images/MediaPlayer/Popup_Highlight.png new file mode 100644 index 0000000..ac63673 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Popup_Highlight.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Popup_PauseIcon.png b/HomeScreen/qml/images/MediaPlayer/Popup_PauseIcon.png new file mode 100644 index 0000000..2627add Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Popup_PauseIcon.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Popup_PlayIcon.png b/HomeScreen/qml/images/MediaPlayer/Popup_PlayIcon.png new file mode 100644 index 0000000..0483e07 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Popup_PlayIcon.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/Popup_VerticalLine.png b/HomeScreen/qml/images/MediaPlayer/Popup_VerticalLine.png new file mode 100644 index 0000000..6a9db00 Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/Popup_VerticalLine.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/X.png b/HomeScreen/qml/images/MediaPlayer/X.png new file mode 100644 index 0000000..ab392cb Binary files /dev/null and b/HomeScreen/qml/images/MediaPlayer/X.png differ diff --git a/HomeScreen/qml/images/MediaPlayer/mediaplayer.qrc b/HomeScreen/qml/images/MediaPlayer/mediaplayer.qrc new file mode 100644 index 0000000..1cb17ab --- /dev/null +++ b/HomeScreen/qml/images/MediaPlayer/mediaplayer.qrc @@ -0,0 +1,37 @@ + + + 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/HMI_Shortcut_HVAC-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC-01.png new file mode 100644 index 0000000..f5188f5 Binary files /dev/null and b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC-01.png differ diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC_Active-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC_Active-01.png new file mode 100644 index 0000000..abe92d2 Binary files /dev/null and b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_HVAC_Active-01.png differ diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home-01.png new file mode 100644 index 0000000..9aca151 Binary files /dev/null and b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home-01.png differ diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home_Active-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home_Active-01.png new file mode 100644 index 0000000..696168f Binary files /dev/null and b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Home_Active-01.png differ diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia-01.png new file mode 100644 index 0000000..229860c Binary files /dev/null and b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia-01.png differ diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia_Active-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia_Active-01.png new file mode 100644 index 0000000..b0a023c Binary files /dev/null and b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Multimedia_Active-01.png differ diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation-01.png new file mode 100644 index 0000000..34b0671 Binary files /dev/null and b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation-01.png differ diff --git a/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation_Active-01.png b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation_Active-01.png new file mode 100644 index 0000000..98e6146 Binary files /dev/null and b/HomeScreen/qml/images/Shortcut/HMI_Shortcut_Navigation_Active-01.png differ diff --git a/HomeScreen/qml/images/Shortcut/shortcut.qrc b/HomeScreen/qml/images/Shortcut/shortcut.qrc new file mode 100644 index 0000000..fe31006 --- /dev/null +++ b/HomeScreen/qml/images/Shortcut/shortcut.qrc @@ -0,0 +1,12 @@ + + + HMI_Shortcut_Home_Active-01.png + HMI_Shortcut_Home-01.png + HMI_Shortcut_HVAC_Active-01.png + HMI_Shortcut_HVAC-01.png + HMI_Shortcut_Multimedia_Active-01.png + HMI_Shortcut_Multimedia-01.png + HMI_Shortcut_Navigation_Active-01.png + HMI_Shortcut_Navigation-01.png + + diff --git a/HomeScreen/qml/images/Status/HMI_Status_Bluetooth_Inactive-01.png b/HomeScreen/qml/images/Status/HMI_Status_Bluetooth_Inactive-01.png new file mode 100644 index 0000000..10bd5a5 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Bluetooth_Inactive-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Bluetooth_On-01.png b/HomeScreen/qml/images/Status/HMI_Status_Bluetooth_On-01.png new file mode 100644 index 0000000..1ff96e1 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Bluetooth_On-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Signal_1Bars-01.png b/HomeScreen/qml/images/Status/HMI_Status_Signal_1Bars-01.png new file mode 100644 index 0000000..44ef700 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Signal_1Bars-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Signal_2Bars-01.png b/HomeScreen/qml/images/Status/HMI_Status_Signal_2Bars-01.png new file mode 100644 index 0000000..fe4e776 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Signal_2Bars-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Signal_3Bars-01.png b/HomeScreen/qml/images/Status/HMI_Status_Signal_3Bars-01.png new file mode 100644 index 0000000..892c6ec Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Signal_3Bars-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Signal_4Bars-01.png b/HomeScreen/qml/images/Status/HMI_Status_Signal_4Bars-01.png new file mode 100644 index 0000000..f4f033b Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Signal_4Bars-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Signal_Full-01.png b/HomeScreen/qml/images/Status/HMI_Status_Signal_Full-01.png new file mode 100644 index 0000000..18070b9 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Signal_Full-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Signal_NoBars-01.png b/HomeScreen/qml/images/Status/HMI_Status_Signal_NoBars-01.png new file mode 100644 index 0000000..1b77207 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Signal_NoBars-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Wifi_1Bar-01.png b/HomeScreen/qml/images/Status/HMI_Status_Wifi_1Bar-01.png new file mode 100644 index 0000000..c72461f Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Wifi_1Bar-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Wifi_2Bars-01.png b/HomeScreen/qml/images/Status/HMI_Status_Wifi_2Bars-01.png new file mode 100644 index 0000000..448dd36 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Wifi_2Bars-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Wifi_3Bars-01.png b/HomeScreen/qml/images/Status/HMI_Status_Wifi_3Bars-01.png new file mode 100644 index 0000000..3e407ad Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Wifi_3Bars-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Wifi_Full-01.png b/HomeScreen/qml/images/Status/HMI_Status_Wifi_Full-01.png new file mode 100644 index 0000000..6f95e97 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Wifi_Full-01.png differ diff --git a/HomeScreen/qml/images/Status/HMI_Status_Wifi_NoBars-01.png b/HomeScreen/qml/images/Status/HMI_Status_Wifi_NoBars-01.png new file mode 100644 index 0000000..07f4f09 Binary files /dev/null and b/HomeScreen/qml/images/Status/HMI_Status_Wifi_NoBars-01.png differ diff --git a/HomeScreen/qml/images/Status/status.qrc b/HomeScreen/qml/images/Status/status.qrc new file mode 100644 index 0000000..d29c91a --- /dev/null +++ b/HomeScreen/qml/images/Status/status.qrc @@ -0,0 +1,17 @@ + + + HMI_Status_Wifi_NoBars-01.png + HMI_Status_Bluetooth_Inactive-01.png + HMI_Status_Bluetooth_On-01.png + HMI_Status_Signal_1Bars-01.png + HMI_Status_Signal_2Bars-01.png + HMI_Status_Signal_3Bars-01.png + HMI_Status_Signal_4Bars-01.png + HMI_Status_Signal_Full-01.png + HMI_Status_Signal_NoBars-01.png + HMI_Status_Wifi_1Bar-01.png + HMI_Status_Wifi_2Bars-01.png + HMI_Status_Wifi_3Bars-01.png + HMI_Status_Wifi_Full-01.png + + diff --git a/HomeScreen/qml/images/TopSection_NoText_NoIcons-01.png b/HomeScreen/qml/images/TopSection_NoText_NoIcons-01.png new file mode 100644 index 0000000..cf9ec4e Binary files /dev/null and b/HomeScreen/qml/images/TopSection_NoText_NoIcons-01.png differ diff --git a/HomeScreen/qml/images/Utility_Logo_Background-01.png b/HomeScreen/qml/images/Utility_Logo_Background-01.png new file mode 100644 index 0000000..21a602d Binary files /dev/null and b/HomeScreen/qml/images/Utility_Logo_Background-01.png differ diff --git a/HomeScreen/qml/images/Utility_Logo_Colour-01.png b/HomeScreen/qml/images/Utility_Logo_Colour-01.png new file mode 100644 index 0000000..6519a2d Binary files /dev/null and b/HomeScreen/qml/images/Utility_Logo_Colour-01.png differ diff --git a/HomeScreen/qml/images/Utility_Music_Background-01.png b/HomeScreen/qml/images/Utility_Music_Background-01.png new file mode 100644 index 0000000..c3e9f91 Binary files /dev/null and b/HomeScreen/qml/images/Utility_Music_Background-01.png differ diff --git a/HomeScreen/qml/images/Utility_Radio_Background-01.png b/HomeScreen/qml/images/Utility_Radio_Background-01.png new file mode 100644 index 0000000..b755843 Binary files /dev/null and b/HomeScreen/qml/images/Utility_Radio_Background-01.png differ diff --git a/HomeScreen/qml/images/Weather/WeatherIcons_ALL-01.png b/HomeScreen/qml/images/Weather/WeatherIcons_ALL-01.png new file mode 100644 index 0000000..f5f8b19 Binary files /dev/null and b/HomeScreen/qml/images/Weather/WeatherIcons_ALL-01.png differ diff --git a/HomeScreen/qml/images/Weather/WeatherIcons_Cloudy-01.png b/HomeScreen/qml/images/Weather/WeatherIcons_Cloudy-01.png new file mode 100644 index 0000000..3603a55 Binary files /dev/null and b/HomeScreen/qml/images/Weather/WeatherIcons_Cloudy-01.png differ diff --git a/HomeScreen/qml/images/Weather/WeatherIcons_Moon-01.png b/HomeScreen/qml/images/Weather/WeatherIcons_Moon-01.png new file mode 100644 index 0000000..8fe1e18 Binary files /dev/null and b/HomeScreen/qml/images/Weather/WeatherIcons_Moon-01.png differ diff --git a/HomeScreen/qml/images/Weather/WeatherIcons_PartiallyCloudy-01.png b/HomeScreen/qml/images/Weather/WeatherIcons_PartiallyCloudy-01.png new file mode 100644 index 0000000..09cd84f Binary files /dev/null and b/HomeScreen/qml/images/Weather/WeatherIcons_PartiallyCloudy-01.png differ diff --git a/HomeScreen/qml/images/Weather/WeatherIcons_Rain-01.png b/HomeScreen/qml/images/Weather/WeatherIcons_Rain-01.png new file mode 100644 index 0000000..125b413 Binary files /dev/null and b/HomeScreen/qml/images/Weather/WeatherIcons_Rain-01.png differ diff --git a/HomeScreen/qml/images/Weather/WeatherIcons_Snow-01.png b/HomeScreen/qml/images/Weather/WeatherIcons_Snow-01.png new file mode 100644 index 0000000..d0a9520 Binary files /dev/null and b/HomeScreen/qml/images/Weather/WeatherIcons_Snow-01.png differ diff --git a/HomeScreen/qml/images/Weather/WeatherIcons_Sun-01.png b/HomeScreen/qml/images/Weather/WeatherIcons_Sun-01.png new file mode 100644 index 0000000..ee3a744 Binary files /dev/null and b/HomeScreen/qml/images/Weather/WeatherIcons_Sun-01.png differ diff --git a/HomeScreen/qml/images/Weather/WeatherIcons_Thunderstorm-01.png b/HomeScreen/qml/images/Weather/WeatherIcons_Thunderstorm-01.png new file mode 100644 index 0000000..f6959f4 Binary files /dev/null and b/HomeScreen/qml/images/Weather/WeatherIcons_Thunderstorm-01.png differ diff --git a/HomeScreen/qml/images/Weather/weather.qrc b/HomeScreen/qml/images/Weather/weather.qrc new file mode 100644 index 0000000..2668fec --- /dev/null +++ b/HomeScreen/qml/images/Weather/weather.qrc @@ -0,0 +1,12 @@ + + + WeatherIcons_ALL-01.png + WeatherIcons_Cloudy-01.png + WeatherIcons_Moon-01.png + WeatherIcons_PartiallyCloudy-01.png + WeatherIcons_Rain-01.png + WeatherIcons_Snow-01.png + WeatherIcons_Sun-01.png + WeatherIcons_Thunderstorm-01.png + + diff --git a/HomeScreen/qml/images/images.qrc b/HomeScreen/qml/images/images.qrc new file mode 100644 index 0000000..2d8e902 --- /dev/null +++ b/HomeScreen/qml/images/images.qrc @@ -0,0 +1,10 @@ + + + TopSection_NoText_NoIcons-01.png + Utility_Logo_Background-01.png + Utility_Logo_Colour-01.png + Utility_Music_Background-01.png + Utility_Radio_Background-01.png + AGL_HMI_Background_NoCar-01.png + + diff --git a/HomeScreen/qml/main.qml b/HomeScreen/qml/main.qml new file mode 100644 index 0000000..542f395 --- /dev/null +++ b/HomeScreen/qml/main.qml @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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.Window 2.1 +import QtQuick.Layouts 1.1 + +Window { + visible: true + flags: Qt.FramelessWindowHint + width: container.width * container.scale + height: container.height * container.scale + title: 'HomeScreen' + + Image { + id: container + anchors.centerIn: parent + width: 1080 + height: 1920 + scale: 1.0 + source: './images/AGL_HMI_Background_NoCar-01.png' + + ColumnLayout { + anchors.fill: parent + spacing: 0 + TopArea { + id: topArea + Layout.fillWidth: true + Layout.preferredHeight: 218 + } + + Item { + id: applicationArea + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 1920 - 218 - 215 + } + + MediaArea { + id: mediaArea + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 215 + } + } + } +} diff --git a/HomeScreen/qml/qml.qrc b/HomeScreen/qml/qml.qrc new file mode 100644 index 0000000..a916b03 --- /dev/null +++ b/HomeScreen/qml/qml.qrc @@ -0,0 +1,13 @@ + + + main.qml + MediaArea.qml + MediaAreaBlank.qml + MediaAreaMusic.qml + MediaAreaRadio.qml + ShortcutArea.qml + ShortcutIcon.qml + StatusArea.qml + TopArea.qml + + diff --git a/HomeScreen/src/applauncher.cpp b/HomeScreen/src/applauncher.cpp new file mode 100644 index 0000000..fd1ec94 --- /dev/null +++ b/HomeScreen/src/applauncher.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2016 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. + */ + +#include "applauncher.h" +#include +#include +#include +#ifdef __i386__ + #include +#endif + +AppLauncher::AppLauncher(QObject *parent) : + QObject(parent), + m_appList(), + mp_dBusAppFrameworkProxy() +{ + /*AppInfo ai; + for (int i = 0; i < 100; ++i) + { + ai.setName("test" + QString::number(i)); + mp_appList->append(ai); + }*/ + + qDebug("D-Bus: connect to org.agl.homescreenappframeworkbinder /AppFramework"); + mp_dBusAppFrameworkProxy = new org::agl::appframework("org.agl.homescreenappframeworkbinder", + "/AppFramework", + QDBusConnection::sessionBus(), + 0); +} + +AppLauncher::~AppLauncher() +{ + delete mp_dBusAppFrameworkProxy; +} + +void AppLauncher::updateColorScheme() +{ + QSettings settings; + QSettings settings_cs(QApplication::applicationDirPath() + + "/colorschemes/" + + settings.value("systemsettings/colorscheme", "default").toString() + + "/" + + QString::number(settings.value("systemsettings/proximityobjectdetected", false).toBool()) + + "/" + + QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) + + ".ini", + QSettings::IniFormat); + + //mp_ui->widget_background->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Background").toString()); + //mp_ui->widget_homeIcon->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Home_Icon").toString()); + + //setStyleSheet(settings_cs.value("AppLauncherWidget/common_css").toString()); +} + +void AppLauncher::populateAppList() +{ + int i; + + m_appList = mp_dBusAppFrameworkProxy->getAvailableApps(); +} + +void AppLauncher::on_tableView_clicked(int row, int col) +{ +/* if (m_appList.size() > row * APP_LIST_COLUMN_COUNT + col) + { + int pid = mp_dBusAppFrameworkProxy->launchApp(m_appList.at(row * APP_LIST_COLUMN_COUNT + col).id()); + qDebug("%d, %d: start app %s", row, col, m_appList.at(row * APP_LIST_COLUMN_COUNT + col).id().toStdString().c_str()); + qDebug("pid: %d", pid); + + // the new app wants to be visible by default + emit newRequestsToBeVisibleApp(pid); + + emit showAppLayer(); + }*/ +} diff --git a/HomeScreen/src/applauncherwidget.h b/HomeScreen/src/applauncher.h similarity index 73% rename from HomeScreen/src/applauncherwidget.h rename to HomeScreen/src/applauncher.h index d6bc615..a67c804 100644 --- a/HomeScreen/src/applauncherwidget.h +++ b/HomeScreen/src/applauncher.h @@ -14,26 +14,19 @@ * limitations under the License. */ -#ifndef APPLAUNCHERWIDGET_H -#define APPLAUNCHERWIDGET_H +#ifndef APPLAUNCHER_H +#define APPLAUNCHER_H -#include -#include -#include #include #include -namespace Ui { -class AppLauncherWidget; -} - -class AppLauncherWidget : public QWidget +class AppLauncher : public QObject { Q_OBJECT public: - explicit AppLauncherWidget(QWidget *parent = 0); - ~AppLauncherWidget(); + explicit AppLauncher(QObject *parent); + ~AppLauncher(); void populateAppList(); @@ -48,10 +41,8 @@ signals: void showAppLayer(); private: - Ui::AppLauncherWidget *mp_ui; QList m_appList; - QTableWidget *mp_appTable; org::agl::appframework *mp_dBusAppFrameworkProxy; }; -#endif // APPLAUNCHERWIDGET_H +#endif // APPLAUNCHER_H diff --git a/HomeScreen/src/applauncherwidget.cpp b/HomeScreen/src/applauncherwidget.cpp deleted file mode 100644 index 26b80a0..0000000 --- a/HomeScreen/src/applauncherwidget.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ - -#include "applauncherwidget.h" -#include "ui_applauncherwidget.h" -#include -#include -#ifdef __i386__ - #include -#endif - -#define APP_LIST_COLUMN_COUNT 5 - -AppLauncherWidget::AppLauncherWidget(QWidget *parent) : - QWidget(parent), - mp_ui(new Ui::AppLauncherWidget), - m_appList(), - mp_appTable(0), - mp_dBusAppFrameworkProxy() -{ - mp_ui->setupUi(this); - - /*AppInfo ai; - for (int i = 0; i < 100; ++i) - { - ai.setName("test" + QString::number(i)); - mp_appList->append(ai); - }*/ - - qDebug("D-Bus: connect to org.agl.homescreenappframeworkbinder /AppFramework"); - mp_dBusAppFrameworkProxy = new org::agl::appframework("org.agl.homescreenappframeworkbinder", - "/AppFramework", - QDBusConnection::sessionBus(), - 0); -} - -AppLauncherWidget::~AppLauncherWidget() -{ - delete mp_dBusAppFrameworkProxy; - if (0 != mp_appTable) - { - delete mp_appTable; - } - delete mp_ui; -} - -void AppLauncherWidget::updateColorScheme() -{ - QSettings settings; - QSettings settings_cs(QApplication::applicationDirPath() + - "/colorschemes/" + - settings.value("systemsettings/colorscheme", "default").toString() + - "/" + - QString::number(settings.value("systemsettings/proximityobjectdetected", false).toBool()) + - "/" + - QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) + - ".ini", - QSettings::IniFormat); - - mp_ui->widget_background->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Background").toString()); - mp_ui->widget_homeIcon->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Home_Icon").toString()); - - setStyleSheet(settings_cs.value("AppLauncherWidget/common_css").toString()); -} - -void AppLauncherWidget::populateAppList() -{ - if (0 == mp_appTable) - { - mp_appTable = new QTableWidget(this); - QObject::connect(mp_appTable, SIGNAL(cellClicked(int,int)), this, SLOT(on_tableView_clicked(int,int))); - } - else - { - mp_appTable->clear(); - } - - mp_appTable->setShowGrid(false); - mp_appTable->setFrameShape(QFrame::NoFrame); - mp_appTable->move(40, 40); - mp_appTable->resize(1000, 1920 - 40 - 40 - 60 - 60); - mp_appTable->horizontalHeader()->setVisible(false); - mp_appTable->verticalHeader()->setVisible(false); - mp_appTable->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - mp_appTable->setRowCount(100); - mp_appTable->setColumnCount(APP_LIST_COLUMN_COUNT); - - int i; - - m_appList = mp_dBusAppFrameworkProxy->getAvailableApps(); - - mp_appTable->setRowCount((m_appList.size() + (APP_LIST_COLUMN_COUNT - 1)) / APP_LIST_COLUMN_COUNT); - - if (m_appList.size() >= (9 * APP_LIST_COLUMN_COUNT)) - { - mp_appTable->resize(1000, 1920 - 40 - 40 - 60 - 60); - } - else - { - mp_appTable->resize(1000, mp_appTable->rowCount() * 190); - } - - - /*for (i = 0; i < (mp_appTable->rowCount() * APP_LIST_COLUMN_COUNT); i++) - { - mp_appTable->verticalHeader()->resizeSection(i, 190); - mp_appTable->horizontalHeader()->resizeSection(i, 190); - }*/ - - for (i = 0; i < m_appList.size(); i++) - { - mp_appTable->setItem(i / APP_LIST_COLUMN_COUNT, - i % APP_LIST_COLUMN_COUNT, - new QTableWidgetItem(m_appList.at(i).name())); - mp_appTable->item(i / APP_LIST_COLUMN_COUNT, - i % APP_LIST_COLUMN_COUNT)->setFlags(Qt::ItemIsEnabled); - mp_appTable->item(i / APP_LIST_COLUMN_COUNT, - i % APP_LIST_COLUMN_COUNT)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - } -} - -void AppLauncherWidget::on_tableView_clicked(int row, int col) -{ - if (m_appList.size() > row * APP_LIST_COLUMN_COUNT + col) - { - int pid = mp_dBusAppFrameworkProxy->launchApp(m_appList.at(row * APP_LIST_COLUMN_COUNT + col).id()); - qDebug("%d, %d: start app %s", row, col, m_appList.at(row * APP_LIST_COLUMN_COUNT + col).id().toStdString().c_str()); - qDebug("pid: %d", pid); - - // the new app wants to be visible by default - emit newRequestsToBeVisibleApp(pid); - - emit showAppLayer(); - } -} diff --git a/HomeScreen/src/layouthandler.cpp b/HomeScreen/src/layouthandler.cpp index 6aad54b..f8804b4 100644 --- a/HomeScreen/src/layouthandler.cpp +++ b/HomeScreen/src/layouthandler.cpp @@ -34,92 +34,40 @@ LayoutHandler::LayoutHandler(QObject *parent) : "surfaceVisibilityChanged", this, SIGNAL(surfaceVisibilityChanged(int,bool))); -} -LayoutHandler::~LayoutHandler() -{ - delete mp_dBusPopupProxy; - delete mp_dBusWindowManagerProxy; -} - -void LayoutHandler::setUpLayouts() -{ - qDebug("setUpLayouts"); QList surfaceAreas; LayoutArea surfaceArea; const int SCREEN_WIDTH = 1080; const int SCREEN_HEIGHT = 1920; - const int STATUSBAR_HEIGHT = 60; - const int STATUSBAR_WIDTH = SCREEN_WIDTH; - const int STATUSBAR_X = 0; - const int STATUSBAR_Y = 0; - const int CONTROLBAR_HEIGHT = 60; - const int CONTROLBAR_WIDTH = SCREEN_WIDTH; - const int CONTROLBAR_X = 0; - const int CONTROLBAR_Y = SCREEN_HEIGHT - CONTROLBAR_HEIGHT; + const int TOPAREA_HEIGHT = 218; + const int TOPAREA_WIDTH = SCREEN_WIDTH; + const int TOPAREA_X = 0; + const int TOPAREA_Y = 0; + const int MEDIAAREA_HEIGHT = 215; + const int MEDIAAREA_WIDTH = SCREEN_WIDTH; + const int MEDIAAREA_X = 0; + const int MEDIAAREA_Y = SCREEN_HEIGHT - MEDIAAREA_HEIGHT; // only one Layout for CES2017 needed // layout 1: // one app surface, statusbar, control bar surfaceArea.x = 0; - surfaceArea.y = STATUSBAR_HEIGHT; + surfaceArea.y = TOPAREA_HEIGHT; surfaceArea.width = SCREEN_WIDTH; - surfaceArea.height = SCREEN_HEIGHT - STATUSBAR_HEIGHT - CONTROLBAR_HEIGHT; + surfaceArea.height = SCREEN_HEIGHT - TOPAREA_HEIGHT - MEDIAAREA_HEIGHT; surfaceAreas.append(surfaceArea); mp_dBusWindowManagerProxy->addLayout(1, "one app", surfaceAreas); +} - /* - surfaceAreas.clear(); - - // layout 2: - // two app surfaces (one on top of the other), statusbar, control bar - - // top surface - surfaceArea.x = 0; - surfaceArea.y = STATUSBAR_HEIGHT; - surfaceArea.width = SCREEN_WIDTH; - surfaceArea.height = (SCREEN_HEIGHT - STATUSBAR_HEIGHT - CONTROLBAR_HEIGHT) / 2; - - surfaceAreas.append(surfaceArea); - - // bottom surface - surfaceArea.x = 0; - surfaceArea.y = SCREEN_HEIGHT / 2; - surfaceArea.width = SCREEN_WIDTH; - surfaceArea.height = (SCREEN_HEIGHT - STATUSBAR_HEIGHT - CONTROLBAR_HEIGHT) / 2; - - surfaceAreas.append(surfaceArea); - - mp_dBusWindowManagerProxy->addLayout(2, "top on bottom", surfaceAreas); - - - surfaceAreas.clear(); - - // layout 3: - // two app surfaces (one besides the other), statusbar, control bar - - // left surface - surfaceArea.x = 0; - surfaceArea.y = STATUSBAR_HEIGHT; - surfaceArea.width = SCREEN_WIDTH / 2; - surfaceArea.height = SCREEN_HEIGHT - STATUSBAR_HEIGHT - CONTROLBAR_HEIGHT; - - surfaceAreas.append(surfaceArea); - - // right surface - surfaceArea.x = SCREEN_WIDTH / 2; - surfaceArea.y = STATUSBAR_HEIGHT; - surfaceArea.width = SCREEN_WIDTH / 2; - surfaceArea.height = SCREEN_HEIGHT - STATUSBAR_HEIGHT - CONTROLBAR_HEIGHT; - - surfaceAreas.append(surfaceArea); - - mp_dBusWindowManagerProxy->addLayout(3, "side by side", surfaceAreas);*/ +LayoutHandler::~LayoutHandler() +{ + delete mp_dBusPopupProxy; + delete mp_dBusWindowManagerProxy; } void LayoutHandler::showAppLayer() diff --git a/HomeScreen/src/layouthandler.h b/HomeScreen/src/layouthandler.h index 54290ac..9ca0a9f 100644 --- a/HomeScreen/src/layouthandler.h +++ b/HomeScreen/src/layouthandler.h @@ -12,8 +12,6 @@ public: explicit LayoutHandler(QObject *parent = 0); ~LayoutHandler(); - void setUpLayouts(); - signals: public slots: diff --git a/HomeScreen/src/main.cpp b/HomeScreen/src/main.cpp index a896c2e..99f98c9 100644 --- a/HomeScreen/src/main.cpp +++ b/HomeScreen/src/main.cpp @@ -16,20 +16,17 @@ #include "mainwindow.h" #include -#include -//#include +#include +#include +#include + +#include "../src2/applicationlauncher.h" +#include "../src2/statusbarmodel.h" +#include "layouthandler.h" + int main(int argc, char *argv[]) { - // allow only one instance of this application - /*QSharedMemory appInstance; - appInstance.setKey("HomeScreen"); - if (!appInstance.create(1)) - { - qDebug("Only one instance of the Home Screen App allowed!"); - exit(-1); - }*/ - QApplication a(argc, argv); // used for application settings (QSettings) @@ -43,20 +40,13 @@ int main(int argc, char *argv[]) qDBusRegisterMetaType(); qDBusRegisterMetaType >(); - MainWindow w; - w.show(); -#ifdef HAVE_IVI_LAYERMANAGEMENT_API - // the WindowManager positions the surface correctly -#else - w.move(0, 0); -#endif - -#ifdef __arm__ - qDebug("Running on ARM architecture"); -#endif -#ifdef __i386__ - qDebug("Running on x86 architecture"); -#endif + qmlRegisterType("HomeScreen", 1, 0, "ApplicationLauncher"); + qmlRegisterType("HomeScreen", 1, 0, "StatusBarModel"); + qmlRegisterType("HomeScreen", 1, 0, "LayoutHandler"); + + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return a.exec(); } diff --git a/HomeScreen/src/mainwindow.cpp b/HomeScreen/src/mainwindow.cpp index 82336ca..0bf4b5c 100644 --- a/HomeScreen/src/mainwindow.cpp +++ b/HomeScreen/src/mainwindow.cpp @@ -24,7 +24,7 @@ MainWindow::MainWindow(QWidget *parent) : mp_statusBarWidget(0), mp_controlBarWidget(0), mp_settingsWidget(0), - mp_applauncherwidget(0), + //mp_applauncherwidget(0), mp_popupWidget(0), mp_layoutHandler(new LayoutHandler()), mp_dBusDayNightModeProxy(0), @@ -66,10 +66,10 @@ MainWindow::MainWindow(QWidget *parent) : mp_settingsWidget->move(0, 60); //mp_settingsWidget->hide(); - mp_applauncherwidget = new AppLauncherWidget(this); + /*mp_applauncherwidget = new AppLauncherWidget(this); mp_applauncherwidget->raise(); // apply layout - mp_applauncherwidget->move(0, 60); + mp_applauncherwidget->move(0, 60);*/ mp_popupWidget = new PopupWidget(); @@ -85,11 +85,11 @@ MainWindow::MainWindow(QWidget *parent) : QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_popupWidget, SLOT(updateColorScheme())); QObject::connect(mp_controlBarWidget, SIGNAL(settingsButtonPressed()), mp_settingsWidget, SLOT(raise())); - QObject::connect(mp_controlBarWidget, SIGNAL(homeButtonPressed()), mp_applauncherwidget, SLOT(raise())); + //QObject::connect(mp_controlBarWidget, SIGNAL(homeButtonPressed()), mp_applauncherwidget, SLOT(raise())); QObject::connect(mp_controlBarWidget, SIGNAL(hideAppLayer()), mp_layoutHandler, SLOT(hideAppLayer())); - QObject::connect(mp_applauncherwidget, SIGNAL(newRequestsToBeVisibleApp(int)), mp_layoutHandler, SLOT(makeMeVisible(int))); - QObject::connect(mp_applauncherwidget, SIGNAL(showAppLayer()), mp_layoutHandler, SLOT(showAppLayer())); + //QObject::connect(mp_applauncherwidget, SIGNAL(newRequestsToBeVisibleApp(int)), mp_layoutHandler, SLOT(makeMeVisible(int))); + //QObject::connect(mp_applauncherwidget, SIGNAL(showAppLayer()), mp_layoutHandler, SLOT(showAppLayer())); // apply color scheme @@ -98,8 +98,8 @@ MainWindow::MainWindow(QWidget *parent) : // this is only useful during development and will be removed later setWindowIcon(QIcon(":/icons/home_day.png")); - mp_applauncherwidget->populateAppList(); - mp_layoutHandler->setUpLayouts(); + // mp_applauncherwidget->populateAppList(); + //mp_layoutHandler->setUpLayouts(); mp_homeScreenControlInterface = new HomeScreenControlInterface(this); QObject::connect(mp_homeScreenControlInterface, SIGNAL(newRequestGetAllSurfacesOfProcess(int)), mp_layoutHandler, SLOT(requestGetAllSurfacesOfProcess(int))); @@ -121,7 +121,7 @@ MainWindow::~MainWindow() delete mp_layoutHandler; delete mp_popupWidget; - delete mp_applauncherwidget; + //delete mp_applauncherwidget; delete mp_settingsWidget; delete mp_controlBarWidget; delete mp_statusBarWidget; @@ -170,7 +170,7 @@ void MainWindow::updateColorScheme() mp_statusBarWidget->updateColorScheme(); mp_controlBarWidget->updateColorScheme(); mp_settingsWidget->updateColorScheme(); - mp_applauncherwidget->updateColorScheme(); + //mp_applauncherwidget->updateColorScheme(); mp_popupWidget->updateColorScheme(); } diff --git a/HomeScreen/src/mainwindow.h b/HomeScreen/src/mainwindow.h index 28471a0..0747e46 100644 --- a/HomeScreen/src/mainwindow.h +++ b/HomeScreen/src/mainwindow.h @@ -26,7 +26,7 @@ #include "statusbarwidget.h" #include "controlbarwidget.h" #include "settingswidget.h" -#include "applauncherwidget.h" +//#include "applauncher.h" #include "popupwidget.h" #include "layouthandler.h" @@ -68,7 +68,7 @@ private: ControlBarWidget *mp_controlBarWidget; org::agl::daynightmode *mp_dBusDayNightMode_ControlBarWidget; SettingsWidget *mp_settingsWidget; - AppLauncherWidget *mp_applauncherwidget; + //AppLauncherWidget *mp_applauncherwidget; PopupWidget *mp_popupWidget; LayoutHandler *mp_layoutHandler; diff --git a/HomeScreen/src2/applicationlauncher.cpp b/HomeScreen/src2/applicationlauncher.cpp new file mode 100644 index 0000000..0ebc9b9 --- /dev/null +++ b/HomeScreen/src2/applicationlauncher.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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. + */ + +#include "applicationlauncher.h" + +#include + +ApplicationLauncher::ApplicationLauncher(QObject *parent) + : QObject(parent), + mp_dBusAppFrameworkProxy() +{ + qDebug("D-Bus: connect to org.agl.homescreenappframeworkbinder /AppFramework"); + mp_dBusAppFrameworkProxy = new org::agl::appframework("org.agl.homescreenappframeworkbinder", + "/AppFramework", + QDBusConnection::sessionBus(), + 0); +} + +ApplicationLauncher::~ApplicationLauncher() +{ + delete mp_dBusAppFrameworkProxy; +} + +int ApplicationLauncher::launch(const QString &application) +{ + int result = -1; + qDebug() << "launch" << application; + + result = mp_dBusAppFrameworkProxy->launchApp(application); + qDebug() << "pid:" << result; + + return result; +} diff --git a/HomeScreen/src2/applicationlauncher.h b/HomeScreen/src2/applicationlauncher.h new file mode 100644 index 0000000..14acae8 --- /dev/null +++ b/HomeScreen/src2/applicationlauncher.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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. + */ + +#ifndef APPLICATIONLAUNCHER_H +#define APPLICATIONLAUNCHER_H + +#include +#include +#include + +class ApplicationLauncher : public QObject +{ + Q_OBJECT +public: + explicit ApplicationLauncher(QObject *parent = NULL); + ~ApplicationLauncher(); + +signals: + void newAppRequestsToBeVisible(int pid); + +public slots: + int launch(const QString &application); + +private: + org::agl::appframework *mp_dBusAppFrameworkProxy; +}; + +#endif // APPLICATIONLAUNCHER_H diff --git a/HomeScreen/src2/statusbarmodel.cpp b/HomeScreen/src2/statusbarmodel.cpp new file mode 100644 index 0000000..5438e89 --- /dev/null +++ b/HomeScreen/src2/statusbarmodel.cpp @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "statusbarmodel.h" +#include "statusbarserver.h" + +#include + +class StatusBarModel::Private +{ +public: + Private(StatusBarModel *parent); + +private: + StatusBarModel *q; +public: + StatusBarServer server; + QString iconList[StatusBarServer::SupportedCount]; +}; + +StatusBarModel::Private::Private(StatusBarModel *parent) + : q(parent) +{ + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/StatusBar", &server); + dbus.registerService("org.agl.homescreen"); + connect(&server, &StatusBarServer::statusIconChanged, [&](int placeholderIndex, const QString &icon) { + if (placeholderIndex < 0 || StatusBarServer::SupportedCount <= placeholderIndex) return; + if (iconList[placeholderIndex] == icon) return; + iconList[placeholderIndex] = icon; + emit q->dataChanged(q->index(placeholderIndex), q->index(placeholderIndex)); + }); + for (int i = 0; i < StatusBarServer::SupportedCount; i++) { + iconList[i] = server.getStatusIcon(i); + } +} + +StatusBarModel::StatusBarModel(QObject *parent) + : QAbstractListModel(parent) + , d(new Private(this)) +{ +} + +StatusBarModel::~StatusBarModel() +{ + delete d; +} + +int StatusBarModel::rowCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return 0; + + return StatusBarServer::SupportedCount; +} + +QVariant StatusBarModel::data(const QModelIndex &index, int role) const +{ + QVariant ret; + if (!index.isValid()) + return ret; + + switch (role) { + case Qt::DisplayRole: + ret = d->iconList[index.row()]; + break; + default: + break; + } + + return ret; +} + +QHash StatusBarModel::roleNames() const +{ + QHash roles; + roles[Qt::DisplayRole] = "icon"; + return roles; +} diff --git a/HomeScreen/src2/statusbarmodel.h b/HomeScreen/src2/statusbarmodel.h new file mode 100644 index 0000000..8d6a70b --- /dev/null +++ b/HomeScreen/src2/statusbarmodel.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef STATUSBARMODEL_H +#define STATUSBARMODEL_H + +#include + +class StatusBarModel : public QAbstractListModel +{ + Q_OBJECT +public: + explicit StatusBarModel(QObject *parent = NULL); + ~StatusBarModel(); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QHash roleNames() const override; + +private: + class Private; + Private *d; +}; + +#endif // STATUSBARMODEL_H diff --git a/HomeScreen/src2/statusbarserver.cpp b/HomeScreen/src2/statusbarserver.cpp new file mode 100644 index 0000000..bf6489d --- /dev/null +++ b/HomeScreen/src2/statusbarserver.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016 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. + */ + +#include "statusbarserver.h" +#include "statusbar_adaptor.h" + +class StatusBarServer::Private +{ +public: + Private(StatusBarServer *parent); + QString texts[SupportedCount]; + QString icons[SupportedCount]; + StatusbarAdaptor adaptor; +}; + +StatusBarServer::Private::Private(StatusBarServer *parent) + : adaptor(parent) +{ + icons[0] = QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_NoBars-01.png"); + icons[1] = QStringLiteral("qrc:/images/Status/HMI_Status_Bluetooth_Inactive-01.png"); + icons[2] = QStringLiteral("qrc:/images/Status/HMI_Status_Signal_NoBars-01.png"); +} + +StatusBarServer::StatusBarServer(QObject *parent) + : QObject(parent) + , d(new Private(this)) +{ +} + +StatusBarServer::~StatusBarServer() +{ + delete d; +} + +QList StatusBarServer::getAvailablePlaceholders() const +{ + QList ret; + for (int i = 0; i < SupportedCount; ++i) { + ret.append(i); + } + return ret; +} + +QString StatusBarServer::getStatusIcon(int placeholderIndex) const +{ + QString ret; + if (-1 < placeholderIndex && placeholderIndex < SupportedCount) + ret = d->icons[placeholderIndex]; + return ret; +} + +void StatusBarServer::setStatusIcon(int placeholderIndex, const QString &icon) +{ + if (-1 < placeholderIndex && placeholderIndex < SupportedCount) { + if (d->icons[placeholderIndex] == icon) return; + d->icons[placeholderIndex] = icon; + emit statusIconChanged(placeholderIndex, icon); + } +} + +QString StatusBarServer::getStatusText(int placeholderIndex) const +{ + QString ret; + if (-1 < placeholderIndex && placeholderIndex < SupportedCount) { + ret = d->texts[placeholderIndex]; + } + return ret; +} + +void StatusBarServer::setStatusText(int placeholderIndex, const QString &text) +{ + if (-1 < placeholderIndex && placeholderIndex < SupportedCount) { + if (d->texts[placeholderIndex] == text) return; + d->texts[placeholderIndex] = text; + emit statusTextChanged(placeholderIndex, text); + } +} diff --git a/HomeScreen/src2/statusbarserver.h b/HomeScreen/src2/statusbarserver.h new file mode 100644 index 0000000..a5b89e5 --- /dev/null +++ b/HomeScreen/src2/statusbarserver.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef STATUSBARSERVER_H +#define STATUSBARSERVER_H + +#include + +class StatusBarServer : public QObject +{ + Q_OBJECT +public: + enum { + SupportedCount = 3, + }; + explicit StatusBarServer(QObject *parent = NULL); + ~StatusBarServer(); + + Q_INVOKABLE QList getAvailablePlaceholders() const; + Q_INVOKABLE QString getStatusIcon(int placeholderIndex) const; + Q_INVOKABLE QString getStatusText(int placeholderIndex) const; + +public slots: + void setStatusIcon(int placeholderIndex, const QString &icon); + void setStatusText(int placeholderIndex, const QString &text); + +signals: + void statusIconChanged(int placeholderIndex, const QString &icon); + void statusTextChanged(int placeholderIndex, const QString &text); + +private: + class Private; + Private *d; +}; + +#endif // STATUSBARSERVER_H diff --git a/interfaces/interfaces.pri b/interfaces/interfaces.pri index f05bbe4..2483ec6 100644 --- a/interfaces/interfaces.pri +++ b/interfaces/interfaces.pri @@ -1,3 +1,18 @@ +# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2016 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. + INCLUDEPATH += $$PWD $$OUT_PWD/../interfaces/ LIBS += -L$$OUT_PWD/../interfaces/ -linterfaces diff --git a/ivi_layermanagement_api.pri b/ivi_layermanagement_api.pri index ac03c1f..65bbf99 100644 --- a/ivi_layermanagement_api.pri +++ b/ivi_layermanagement_api.pri @@ -1,3 +1,18 @@ +# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2016 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. + config_ivi_layermanagement_api { DEFINES += HAVE_IVI_LAYERMANAGEMENT_API } else {