From 290c2ec0e02bd682a69b27040c28372e026e7945 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Wed, 14 Nov 2018 12:33:11 +0900 Subject: Add homescreen for vertical mode Add homescreen source for vertical mode. Change shortcut area's hvac icon to videoplayer. Change-Id: Ic474f9cfdf4f951074f711b39975e69f273c8b35 Signed-off-by: zheng_wenlong --- demo3/README.md | 4 +- demo3/vertical/homescreen/README.md | 58 ++ demo3/vertical/homescreen/homescreen.pro | 24 + demo3/vertical/homescreen/homescreen/LICENSE | 54 ++ demo3/vertical/homescreen/homescreen/README.md | 10 + .../homescreen/homescreen/docs/homescreen_api.md | 186 +++++++ demo3/vertical/homescreen/homescreen/docs/index.md | 31 ++ .../docs/pictures/api_getAllSurfacesOfProcess.png | Bin 0 -> 10485 bytes .../docs/pictures/api_getSurfaceStatus_1.png | Bin 0 -> 10168 bytes .../docs/pictures/api_getSurfaceStatus_2.png | Bin 0 -> 9794 bytes .../docs/pictures/api_getSurfaceStatus_3.png | Bin 0 -> 19030 bytes .../docs/pictures/api_hardKeyPressed.png | Bin 0 -> 9241 bytes .../docs/pictures/api_renderSurfaceToArea.png | Bin 0 -> 9060 bytes .../pictures/api_renderSurfaceToAreaAllowed.png | Bin 0 -> 14910 bytes .../pictures/api_requestSurfaceIdToFullScreen.png | Bin 0 -> 10056 bytes .../docs/pictures/api_surfaceVisibilityChanged.png | Bin 0 -> 8882 bytes .../homescreen/docs/pictures/dashboard.png | Bin 0 -> 359145 bytes .../homescreen/docs/pictures/full/dashboard.png | Bin 0 -> 1055839 bytes .../docs/pictures/full/homescreen_applauncher.png | Bin 0 -> 1090490 bytes .../homescreen/docs/pictures/full/hvac.png | Bin 0 -> 921864 bytes .../homescreen/docs/pictures/full/phone.png | Bin 0 -> 936048 bytes .../homescreen/docs/pictures/full/settings.png | Bin 0 -> 863641 bytes .../docs/pictures/homescreen_applauncher.png | Bin 0 -> 399084 bytes .../homescreen/homescreen/docs/pictures/hvac.png | Bin 0 -> 338097 bytes .../homescreen/homescreen/docs/pictures/phone.png | Bin 0 -> 336318 bytes .../homescreen/docs/pictures/settings.png | Bin 0 -> 300437 bytes .../vertical/homescreen/homescreen/homescreen.pro | 54 ++ .../homescreen/homescreen/qml/IconItem.qml | 104 ++++ .../homescreen/homescreen/qml/MediaArea.qml | 57 ++ .../homescreen/homescreen/qml/MediaAreaBlank.qml | 121 ++++ .../homescreen/homescreen/qml/MediaAreaMusic.qml | 85 +++ .../homescreen/homescreen/qml/MediaAreaRadio.qml | 24 + .../homescreen/homescreen/qml/ShortcutArea.qml | 81 +++ .../homescreen/homescreen/qml/ShortcutIcon.qml | 100 ++++ .../homescreen/homescreen/qml/StatusArea.qml | 169 ++++++ .../vertical/homescreen/homescreen/qml/TopArea.qml | 59 ++ .../images/AGL_HMI_Blue_Background_NoCar-01.png | Bin 0 -> 951359 bytes .../qml/images/AGL_HMI_Full_Background.png | Bin 0 -> 8306 bytes .../qml/images/AGL_HMI_Normal_Background.png | Bin 0 -> 10012 bytes .../qml/images/MediaMusic/AlbumArtwork.png | Bin 0 -> 25963 bytes .../homescreen/qml/images/MediaMusic/BackArrow.png | Bin 0 -> 691 bytes .../qml/images/MediaMusic/ForwardArrow.png | Bin 0 -> 717 bytes .../qml/images/MediaMusic/ShuffleIcon.png | Bin 0 -> 927 bytes .../qml/images/MediaMusic/Volume_Loud.png | Bin 0 -> 579 bytes .../qml/images/MediaMusic/Volume_Medium.png | Bin 0 -> 882 bytes .../qml/images/MediaMusic/Volume_Off.png | Bin 0 -> 740 bytes .../qml/images/MediaMusic/mediamusic.qrc | 11 + .../MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png | Bin 0 -> 1854532 bytes .../MediaPlayer/AGL_MediaPlayer_BackArrow.png | Bin 0 -> 648 bytes .../AGL_MediaPlayer_Bluetooth_Active.png | Bin 0 -> 4637 bytes .../AGL_MediaPlayer_Bluetooth_Inactive.png | Bin 0 -> 2790 bytes .../MediaPlayer/AGL_MediaPlayer_CD_Active.png | Bin 0 -> 5581 bytes .../MediaPlayer/AGL_MediaPlayer_CD_Inactive.png | Bin 0 -> 3223 bytes .../MediaPlayer/AGL_MediaPlayer_DividingLine.png | Bin 0 -> 342 bytes .../MediaPlayer/AGL_MediaPlayer_ForwardArrow.png | Bin 0 -> 675 bytes .../MediaPlayer/AGL_MediaPlayer_Loop_Active.png | Bin 0 -> 996 bytes .../MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png | Bin 0 -> 1199 bytes .../MediaPlayer/AGL_MediaPlayer_Player_Pause.png | Bin 0 -> 3959 bytes .../MediaPlayer/AGL_MediaPlayer_Player_Play.png | Bin 0 -> 4078 bytes .../AGL_MediaPlayer_PlaylistToggle_Active.png | Bin 0 -> 2061 bytes .../AGL_MediaPlayer_PlaylistToggle_Inactive.png | Bin 0 -> 2061 bytes .../AGL_MediaPlayer_Playlist_Active.png | Bin 0 -> 4251 bytes .../AGL_MediaPlayer_Playlist_Inactive.png | Bin 0 -> 2547 bytes .../MediaPlayer/AGL_MediaPlayer_Radio_Active.png | Bin 0 -> 4673 bytes .../MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png | Bin 0 -> 2877 bytes .../MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png | Bin 0 -> 1139 bytes .../AGL_MediaPlayer_Shuffle_Inactive.png | Bin 0 -> 1379 bytes .../qml/images/MediaPlayer/Albums_Active.png | Bin 0 -> 4616 bytes .../qml/images/MediaPlayer/Albums_Inactive.png | Bin 0 -> 2965 bytes .../qml/images/MediaPlayer/DividingLine.png | Bin 0 -> 419 bytes .../qml/images/MediaPlayer/GreenLine.png | Bin 0 -> 364 bytes .../qml/images/MediaPlayer/Music_Active.png | Bin 0 -> 2567 bytes .../qml/images/MediaPlayer/Music_Inactive.png | Bin 0 -> 2692 bytes .../qml/images/MediaPlayer/Podcasts_Active.png | Bin 0 -> 3687 bytes .../qml/images/MediaPlayer/Podcasts_Inactive.png | Bin 0 -> 3014 bytes .../qml/images/MediaPlayer/Popup_Highlight.png | Bin 0 -> 780 bytes .../qml/images/MediaPlayer/Popup_PauseIcon.png | Bin 0 -> 1496 bytes .../qml/images/MediaPlayer/Popup_PlayIcon.png | Bin 0 -> 2273 bytes .../qml/images/MediaPlayer/Popup_VerticalLine.png | Bin 0 -> 364 bytes .../homescreen/qml/images/MediaPlayer/X.png | Bin 0 -> 640 bytes .../qml/images/MediaPlayer/mediaplayer.qrc | 37 ++ .../homescreen/qml/images/Shortcut/hvac.svg | 600 ++++++++++++++++++++ .../homescreen/qml/images/Shortcut/hvac_active.svg | 614 +++++++++++++++++++++ .../homescreen/qml/images/Shortcut/launcher.svg | 73 +++ .../qml/images/Shortcut/launcher_active.svg | 82 +++ .../homescreen/qml/images/Shortcut/mediaplayer.svg | 50 ++ .../qml/images/Shortcut/mediaplayer_active.svg | 63 +++ .../homescreen/qml/images/Shortcut/navigation.svg | 77 +++ .../qml/images/Shortcut/navigation_active.svg | 90 +++ .../homescreen/qml/images/Shortcut/shortcut.qrc | 14 + .../homescreen/qml/images/Shortcut/video.svg | 109 ++++ .../qml/images/Shortcut/video_active.svg | 126 +++++ .../Status/HMI_Status_Bluetooth_Inactive-01.png | Bin 0 -> 1170 bytes .../images/Status/HMI_Status_Bluetooth_On-01.png | Bin 0 -> 922 bytes .../images/Status/HMI_Status_Signal_1Bars-01.png | Bin 0 -> 570 bytes .../images/Status/HMI_Status_Signal_2Bars-01.png | Bin 0 -> 564 bytes .../images/Status/HMI_Status_Signal_3Bars-01.png | Bin 0 -> 560 bytes .../images/Status/HMI_Status_Signal_4Bars-01.png | Bin 0 -> 552 bytes .../images/Status/HMI_Status_Signal_Full-01.png | Bin 0 -> 544 bytes .../images/Status/HMI_Status_Signal_NoBars-01.png | Bin 0 -> 575 bytes .../qml/images/Status/HMI_Status_Wifi_1Bar-01.png | Bin 0 -> 1245 bytes .../qml/images/Status/HMI_Status_Wifi_2Bars-01.png | Bin 0 -> 1198 bytes .../qml/images/Status/HMI_Status_Wifi_3Bars-01.png | Bin 0 -> 1120 bytes .../qml/images/Status/HMI_Status_Wifi_Full-01.png | Bin 0 -> 995 bytes .../images/Status/HMI_Status_Wifi_NoBars-01.png | Bin 0 -> 1278 bytes .../homescreen/qml/images/Status/status.qrc | 17 + .../qml/images/TopSection_NoText_NoIcons-01.png | Bin 0 -> 2097 bytes .../qml/images/Utility_Logo_Background-01.png | Bin 0 -> 1150 bytes .../homescreen/qml/images/Utility_Logo_Grey-01.svg | 84 +++ .../qml/images/Utility_Music_Background-01.png | Bin 0 -> 711 bytes .../qml/images/Utility_Radio_Background-01.png | Bin 0 -> 920 bytes .../qml/images/Weather/WeatherIcons_ALL-01.png | Bin 0 -> 1320 bytes .../qml/images/Weather/WeatherIcons_Cloudy-01.png | Bin 0 -> 715 bytes .../qml/images/Weather/WeatherIcons_Moon-01.png | Bin 0 -> 749 bytes .../Weather/WeatherIcons_PartiallyCloudy-01.png | Bin 0 -> 900 bytes .../qml/images/Weather/WeatherIcons_Rain-01.png | Bin 0 -> 870 bytes .../qml/images/Weather/WeatherIcons_Snow-01.png | Bin 0 -> 840 bytes .../qml/images/Weather/WeatherIcons_Sun-01.png | Bin 0 -> 807 bytes .../Weather/WeatherIcons_Thunderstorm-01.png | Bin 0 -> 886 bytes .../homescreen/qml/images/Weather/weather.qrc | 12 + .../homescreen/qml/images/fullscreen.png | Bin 0 -> 1633 bytes .../homescreen/homescreen/qml/images/images.qrc | 14 + .../homescreen/homescreen/qml/images/normal.png | Bin 0 -> 1626 bytes demo3/vertical/homescreen/homescreen/qml/main.qml | 155 ++++++ demo3/vertical/homescreen/homescreen/qml/qml.qrc | 14 + .../homescreen/src/applicationlauncher.cpp | 85 +++ .../homescreen/src/applicationlauncher.h | 55 ++ .../vertical/homescreen/homescreen/src/hmi-debug.h | 70 +++ .../homescreen/src/homescreenhandler.cpp | 110 ++++ .../homescreen/homescreen/src/homescreenhandler.h | 55 ++ demo3/vertical/homescreen/homescreen/src/main.cpp | 165 ++++++ .../homescreen/homescreen/src/mastervolume.cpp | 31 ++ .../homescreen/homescreen/src/mastervolume.h | 48 ++ .../homescreen/homescreen/src/statusbarmodel.cpp | 148 +++++ .../homescreen/homescreen/src/statusbarmodel.h | 47 ++ .../homescreen/homescreen/src/statusbarserver.cpp | 91 +++ .../homescreen/homescreen/src/statusbarserver.h | 52 ++ .../homescreen/homescreen/src/toucharea.cpp | 36 ++ .../vertical/homescreen/homescreen/src/toucharea.h | 30 + demo3/vertical/homescreen/interfaces/LICENSE | 54 ++ demo3/vertical/homescreen/interfaces/README.md | 11 + .../homescreen/interfaces/afm_user_daemon.xml | 52 ++ .../homescreen/interfaces/appframework.xml | 57 ++ .../interfaces/include/afm_user_daemon.hpp | 21 + .../homescreen/interfaces/include/appframework.hpp | 66 +++ .../homescreen/interfaces/include/statusbar.hpp | 22 + .../vertical/homescreen/interfaces/interfaces.pri | 18 + .../vertical/homescreen/interfaces/interfaces.pro | 61 ++ .../homescreen/interfaces/src/appframework.cpp | 167 ++++++ demo3/vertical/homescreen/interfaces/statusbar.xml | 38 ++ demo3/vertical/homescreen/package/config.xml | 21 + demo3/vertical/homescreen/package/icon.svg | 279 ++++++++++ demo3/vertical/homescreen/package/package.pro | 22 + .../vertical/homescreen/screenshot/homescreen.png | Bin 0 -> 56015 bytes 154 files changed, 5374 insertions(+), 1 deletion(-) create mode 100644 demo3/vertical/homescreen/README.md create mode 100644 demo3/vertical/homescreen/homescreen.pro create mode 100644 demo3/vertical/homescreen/homescreen/LICENSE create mode 100644 demo3/vertical/homescreen/homescreen/README.md create mode 100644 demo3/vertical/homescreen/homescreen/docs/homescreen_api.md create mode 100644 demo3/vertical/homescreen/homescreen/docs/index.md create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_getAllSurfacesOfProcess.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_1.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_2.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_3.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_hardKeyPressed.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_renderSurfaceToArea.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_renderSurfaceToAreaAllowed.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_requestSurfaceIdToFullScreen.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/api_surfaceVisibilityChanged.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/dashboard.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/full/dashboard.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/full/homescreen_applauncher.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/full/hvac.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/full/phone.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/full/settings.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/homescreen_applauncher.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/hvac.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/phone.png create mode 100644 demo3/vertical/homescreen/homescreen/docs/pictures/settings.png create mode 100644 demo3/vertical/homescreen/homescreen/homescreen.pro create mode 100644 demo3/vertical/homescreen/homescreen/qml/IconItem.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/MediaArea.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/MediaAreaBlank.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/MediaAreaMusic.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/MediaAreaRadio.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/ShortcutArea.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/ShortcutIcon.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/StatusArea.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/TopArea.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Full_Background.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Normal_Background.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/AlbumArtwork.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/BackArrow.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/ForwardArrow.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/ShuffleIcon.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Loud.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Medium.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Off.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/mediamusic.qrc create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Albums_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Albums_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/DividingLine.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/GreenLine.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Music_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Music_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Podcasts_Active.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Podcasts_Inactive.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_Highlight.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_PauseIcon.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_PlayIcon.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_VerticalLine.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/X.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/mediaplayer.qrc create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/hvac.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/hvac_active.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/launcher.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/launcher_active.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/mediaplayer.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/mediaplayer_active.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/navigation.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/navigation_active.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/shortcut.qrc create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/video.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Shortcut/video_active.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Bluetooth_Inactive-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Bluetooth_On-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_1Bars-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_2Bars-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_3Bars-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_4Bars-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_Full-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_NoBars-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_1Bar-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_2Bars-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_3Bars-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_Full-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_NoBars-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Status/status.qrc create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/TopSection_NoText_NoIcons-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Utility_Logo_Background-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Utility_Logo_Grey-01.svg create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Utility_Music_Background-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Utility_Radio_Background-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_ALL-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Cloudy-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Moon-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_PartiallyCloudy-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Rain-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Snow-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Sun-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Thunderstorm-01.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/Weather/weather.qrc create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/fullscreen.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/images.qrc create mode 100644 demo3/vertical/homescreen/homescreen/qml/images/normal.png create mode 100644 demo3/vertical/homescreen/homescreen/qml/main.qml create mode 100644 demo3/vertical/homescreen/homescreen/qml/qml.qrc create mode 100644 demo3/vertical/homescreen/homescreen/src/applicationlauncher.cpp create mode 100644 demo3/vertical/homescreen/homescreen/src/applicationlauncher.h create mode 100644 demo3/vertical/homescreen/homescreen/src/hmi-debug.h create mode 100644 demo3/vertical/homescreen/homescreen/src/homescreenhandler.cpp create mode 100644 demo3/vertical/homescreen/homescreen/src/homescreenhandler.h create mode 100644 demo3/vertical/homescreen/homescreen/src/main.cpp create mode 100644 demo3/vertical/homescreen/homescreen/src/mastervolume.cpp create mode 100644 demo3/vertical/homescreen/homescreen/src/mastervolume.h create mode 100644 demo3/vertical/homescreen/homescreen/src/statusbarmodel.cpp create mode 100644 demo3/vertical/homescreen/homescreen/src/statusbarmodel.h create mode 100644 demo3/vertical/homescreen/homescreen/src/statusbarserver.cpp create mode 100644 demo3/vertical/homescreen/homescreen/src/statusbarserver.h create mode 100644 demo3/vertical/homescreen/homescreen/src/toucharea.cpp create mode 100644 demo3/vertical/homescreen/homescreen/src/toucharea.h create mode 100644 demo3/vertical/homescreen/interfaces/LICENSE create mode 100644 demo3/vertical/homescreen/interfaces/README.md create mode 100644 demo3/vertical/homescreen/interfaces/afm_user_daemon.xml create mode 100644 demo3/vertical/homescreen/interfaces/appframework.xml create mode 100644 demo3/vertical/homescreen/interfaces/include/afm_user_daemon.hpp create mode 100644 demo3/vertical/homescreen/interfaces/include/appframework.hpp create mode 100644 demo3/vertical/homescreen/interfaces/include/statusbar.hpp create mode 100644 demo3/vertical/homescreen/interfaces/interfaces.pri create mode 100644 demo3/vertical/homescreen/interfaces/interfaces.pro create mode 100644 demo3/vertical/homescreen/interfaces/src/appframework.cpp create mode 100644 demo3/vertical/homescreen/interfaces/statusbar.xml create mode 100644 demo3/vertical/homescreen/package/config.xml create mode 100644 demo3/vertical/homescreen/package/icon.svg create mode 100644 demo3/vertical/homescreen/package/package.pro create mode 100644 demo3/vertical/homescreen/screenshot/homescreen.png diff --git a/demo3/README.md b/demo3/README.md index f6a61ac..3241a47 100644 --- a/demo3/README.md +++ b/demo3/README.md @@ -1,11 +1,13 @@ # Readme for CES2019 demo#3 -
There are two ECU connect with each other for CES2019 demo#3. +
There are two ECU connect with each other for CES2019 demo#3. ## horizontal (Meter cluster mode) - homescreen
same source code in homescreen branch : [ces2019_horizontal](https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps/homescreen.git;a=tree;h=refs/heads/sandbox/zheng_wenlong/ces2019_horizontal;hb=refs/heads/sandbox/zheng_wenlong/ces2019_horizontal) - ... ## vertical (IVI mode) +- homescreen +
change shortcut area's hvac icon to videoplayer, same source code in homescreen branch : [ces2019_vertical](https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps%2Fhomescreen.git;a=shortlog;h=refs%2Fheads%2Fsandbox%2Fzheng_wenlong%2Fces2019_vertical) - ... ## common ones diff --git a/demo3/vertical/homescreen/README.md b/demo3/vertical/homescreen/README.md new file mode 100644 index 0000000..610164d --- /dev/null +++ b/demo3/vertical/homescreen/README.md @@ -0,0 +1,58 @@ +This project contains: + +HomeScreen: AGL Home Screen reference implementation + +**AGL repo for source code** + +``` +$ mkdir WORK +$ cd WORK +$ repo init -b dab -m dab_4.0.0_xml -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo +$ repo sync +$ git clone git clone https://gerrit.automotivelinux.org/gerrit/staging/meta-hmi-framework + +``` + +Then you can get the following recipe. + +* `meta-hmi-framework/homescreen-2017` + + +**Bitbake** + +``` +$ source meta-agl/scripts/aglsetup.sh -m m3ulcb agl-demo agl-devel agl-appfw-smack agl-hmi-framework +$ bitbake homescreen-2017 +``` + +Instructions for building HomeScreen app +---------------------------------------- + +The HomeScreen app is part of the +packagegroup-agl-demo-platform +packagegroup. + +This also includes the following apps: +- WindowManager +- HomeScreen Binder + +And the library +- libhomescreen +- libwindowmanager + + +To build all the above, follow the instrucions on the AGL +documentation website: +http://docs.automotivelinux.org/docs/getting_started/en/dev/reference/source-code.html#features-supported-by-aglsetup + +Please activate the "agl-demo" feature when running the aglsetup script: +http://docs.automotivelinux.org/docs/getting_started/en/dev/reference/source-code.html#features-supported-by-aglsetup + + +Launch HomeScreen App: + +Usage: + +``` +afm-util start homescreen-2017 +``` diff --git a/demo3/vertical/homescreen/homescreen.pro b/demo3/vertical/homescreen/homescreen.pro new file mode 100644 index 0000000..7c49383 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen.pro @@ -0,0 +1,24 @@ +# 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. + +TEMPLATE = subdirs + +load(configure) + +SUBDIRS = interfaces \ + homescreen \ + package + +homescreen.depends = interfaces +package.depends += homescreen diff --git a/demo3/vertical/homescreen/homescreen/LICENSE b/demo3/vertical/homescreen/homescreen/LICENSE new file mode 100644 index 0000000..31c692a --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/LICENSE @@ -0,0 +1,54 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + You must give any other recipients of the Work or Derivative Works a copy of this License; and + You must cause any modified files to carry prominent notices stating that You changed the files; and + You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/demo3/vertical/homescreen/homescreen/README.md b/demo3/vertical/homescreen/homescreen/README.md new file mode 100644 index 0000000..c52a7f8 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/README.md @@ -0,0 +1,10 @@ +AGL Home Screen reference implementation + + +Build with QtCreator 3.5.1 + +AGL repo for source code: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen + +AGL repo for bitbake recipe: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/homescreen/homescreen_git.bb diff --git a/demo3/vertical/homescreen/homescreen/docs/homescreen_api.md b/demo3/vertical/homescreen/homescreen/docs/homescreen_api.md new file mode 100644 index 0000000..8f7b8f4 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/docs/homescreen_api.md @@ -0,0 +1,186 @@ +# 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/demo3/vertical/homescreen/homescreen/docs/index.md b/demo3/vertical/homescreen/homescreen/docs/index.md new file mode 100644 index 0000000..4322255 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/docs/index.md @@ -0,0 +1,31 @@ +# 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/demo3/vertical/homescreen/homescreen/docs/pictures/api_getAllSurfacesOfProcess.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_getAllSurfacesOfProcess.png new file mode 100644 index 0000000..5c862d7 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_getAllSurfacesOfProcess.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_1.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_1.png new file mode 100644 index 0000000..1e18fcf Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_1.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_2.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_2.png new file mode 100644 index 0000000..e66d708 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_2.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_3.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_3.png new file mode 100644 index 0000000..50a3b10 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_getSurfaceStatus_3.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/api_hardKeyPressed.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_hardKeyPressed.png new file mode 100644 index 0000000..a8a3660 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_hardKeyPressed.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/api_renderSurfaceToArea.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_renderSurfaceToArea.png new file mode 100644 index 0000000..a61fc2f Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_renderSurfaceToArea.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/api_renderSurfaceToAreaAllowed.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_renderSurfaceToAreaAllowed.png new file mode 100644 index 0000000..35dbbcf Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_renderSurfaceToAreaAllowed.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/api_requestSurfaceIdToFullScreen.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_requestSurfaceIdToFullScreen.png new file mode 100644 index 0000000..6d2f712 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_requestSurfaceIdToFullScreen.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/api_surfaceVisibilityChanged.png b/demo3/vertical/homescreen/homescreen/docs/pictures/api_surfaceVisibilityChanged.png new file mode 100644 index 0000000..f519757 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/api_surfaceVisibilityChanged.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/dashboard.png b/demo3/vertical/homescreen/homescreen/docs/pictures/dashboard.png new file mode 100644 index 0000000..527386d Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/dashboard.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/full/dashboard.png b/demo3/vertical/homescreen/homescreen/docs/pictures/full/dashboard.png new file mode 100644 index 0000000..e947734 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/full/dashboard.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/full/homescreen_applauncher.png b/demo3/vertical/homescreen/homescreen/docs/pictures/full/homescreen_applauncher.png new file mode 100644 index 0000000..b61884a Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/full/homescreen_applauncher.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/full/hvac.png b/demo3/vertical/homescreen/homescreen/docs/pictures/full/hvac.png new file mode 100644 index 0000000..7e0399a Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/full/hvac.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/full/phone.png b/demo3/vertical/homescreen/homescreen/docs/pictures/full/phone.png new file mode 100644 index 0000000..f4cc547 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/full/phone.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/full/settings.png b/demo3/vertical/homescreen/homescreen/docs/pictures/full/settings.png new file mode 100644 index 0000000..a115ef4 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/full/settings.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/homescreen_applauncher.png b/demo3/vertical/homescreen/homescreen/docs/pictures/homescreen_applauncher.png new file mode 100644 index 0000000..e168668 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/homescreen_applauncher.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/hvac.png b/demo3/vertical/homescreen/homescreen/docs/pictures/hvac.png new file mode 100644 index 0000000..f9a6030 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/hvac.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/phone.png b/demo3/vertical/homescreen/homescreen/docs/pictures/phone.png new file mode 100644 index 0000000..e087594 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/phone.png differ diff --git a/demo3/vertical/homescreen/homescreen/docs/pictures/settings.png b/demo3/vertical/homescreen/homescreen/docs/pictures/settings.png new file mode 100644 index 0000000..c92d835 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/docs/pictures/settings.png differ diff --git a/demo3/vertical/homescreen/homescreen/homescreen.pro b/demo3/vertical/homescreen/homescreen/homescreen.pro new file mode 100644 index 0000000..9c36660 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/homescreen.pro @@ -0,0 +1,54 @@ +# Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH +# 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. + +TEMPLATE = app +TARGET = HomeScreen +QT = qml quick dbus websockets +CONFIG += c++11 link_pkgconfig +DESTDIR = $${OUT_PWD}/../package/root/bin +PKGCONFIG += qlibwindowmanager qtappfw + +LIBS += -lhomescreen + +include(../interfaces/interfaces.pri) + +SOURCES += \ + src/main.cpp \ + src/statusbarmodel.cpp \ + src/statusbarserver.cpp \ + src/applicationlauncher.cpp \ + src/mastervolume.cpp \ + src/homescreenhandler.cpp \ + src/toucharea.cpp + +HEADERS += \ + src/statusbarmodel.h \ + src/statusbarserver.h \ + src/applicationlauncher.h \ + src/mastervolume.h \ + src/homescreenhandler.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 \ + qml/images/images.qrc \ + qml/qml.qrc diff --git a/demo3/vertical/homescreen/homescreen/qml/IconItem.qml b/demo3/vertical/homescreen/homescreen/qml/IconItem.qml new file mode 100644 index 0000000..a5c032e --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/IconItem.qml @@ -0,0 +1,104 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 +import QtGraphicalEffects 1.0 + +Item { + id: main + width: 320 + height: 320 + property string icon: model.icon + + Item { + id: container + parent: loc + x: main.x + y: main.y + width: main.width + height: main.height + + Image { + id: item + anchors.top: parent.top + anchors.topMargin: 20 + anchors.horizontalCenter: parent.horizontalCenter + width: 220 + height: width + source: './images/%1_%2.svg'.arg(model.icon).arg(loc.pressed && (loc.index === model.index || loc.currentId === model.id) ? 'active' : 'inactive') + antialiasing: item.state !== '' + + property string initial: model.name.substring(0,1).toUpperCase() + + Item { + id: title + width: 125 + height: 125 + anchors.centerIn: parent + Repeater { + delegate: Label { + style: Text.Outline + styleColor: 'red' + color: 'transparent' + font.pixelSize: 125 + anchors.centerIn: parent + anchors.horizontalCenterOffset: model.index / 3 - 1 + anchors.verticalCenterOffset: model.index % 3 - 1 + text: item.initial + } + model: main.icon === 'blank' ? 9 : 0 + } + layer.enabled: true + layer.effect: LinearGradient { + gradient: Gradient { + GradientStop { position: -0.5; color: "#6BFBFF" } + GradientStop { position: +1.5; color: "#00ADDC" } + } + } + } + } + Label { + id: name + anchors.top: item.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 20 + font.pixelSize: 25 + font.letterSpacing: 5 + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignHCenter + color: "white" + text: qsTr(model.name.toUpperCase()) + } + + Behavior on x { enabled: item.state !== 'active'; NumberAnimation { duration: 400; easing.type: Easing.OutCubic } } + Behavior on y { enabled: item.state !== 'active'; NumberAnimation { duration: 400; easing.type: Easing.OutCubic } } + SequentialAnimation on rotation { + NumberAnimation { to: 5; duration: 100 } + NumberAnimation { to: -5; duration: 200 } + NumberAnimation { to: 0; duration: 100 } + running: loc.currentId !== '' && item.state !== 'active' + loops: Animation.Infinite; alwaysRunToEnd: true + } + states: [ + State { + name: 'active' + when: loc.currentId == model.id + PropertyChanges { + target: container + x: loc.mouseX - width/2 + y: loc.mouseY - height/2 + scale: 1.15 + z: 10 + } + }, + State { + when: loc.currentId !== '' + PropertyChanges { + target: container + scale: 0.85 + opacity: 0.75 + } + } + ] + transitions: Transition { NumberAnimation { properties: 'scale, opacity, x, y'; duration: 150; easing.type: Easing.OutCubic} } + } +} diff --git a/demo3/vertical/homescreen/homescreen/qml/MediaArea.qml b/demo3/vertical/homescreen/homescreen/qml/MediaArea.qml new file mode 100644 index 0000000..0447589 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/MediaArea.qml @@ -0,0 +1,57 @@ +/* + * 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/demo3/vertical/homescreen/homescreen/qml/MediaAreaBlank.qml b/demo3/vertical/homescreen/homescreen/qml/MediaAreaBlank.qml new file mode 100644 index 0000000..2b888c8 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/MediaAreaBlank.qml @@ -0,0 +1,121 @@ +/* + * 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.png' + 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 + } + + Item { + id: master_volume + anchors.fill: parent + anchors.centerIn: parent + visible: false + + Label { + font.pixelSize: 36 + anchors.horizontalCenter: parent.horizontalCenter + color: "white" + text: qsTr("Master 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: 65536 + stepSize: 256 + 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/demo3/vertical/homescreen/homescreen/qml/MediaAreaMusic.qml b/demo3/vertical/homescreen/homescreen/qml/MediaAreaMusic.qml new file mode 100644 index 0000000..c0408e6 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/MediaAreaMusic.qml @@ -0,0 +1,85 @@ +/* + * 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/demo3/vertical/homescreen/homescreen/qml/MediaAreaRadio.qml b/demo3/vertical/homescreen/homescreen/qml/MediaAreaRadio.qml new file mode 100644 index 0000000..a49f06d --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/MediaAreaRadio.qml @@ -0,0 +1,24 @@ +/* + * 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/demo3/vertical/homescreen/homescreen/qml/ShortcutArea.qml b/demo3/vertical/homescreen/homescreen/qml/ShortcutArea.qml new file mode 100644 index 0000000..a2d98c8 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/ShortcutArea.qml @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH + * 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. + */ + +import QtQuick 2.2 +import QtQuick.Layouts 1.1 + +Item { + id: root + width: 785 + height: 218 + + Timer { + id:notificationTimer + interval: 3000 + running: false + repeat: true + onTriggered: notificationItem.visible = false + } + + ListModel { + id: applicationModel + ListElement { + name: 'launcher' + application: 'launcher@0.1' + } + ListElement { + name: 'MediaPlayer' + application: 'mediaplayer@0.1' + } + ListElement { + name: 'Video' + application: 'video@0.1' + } + ListElement { + name: 'navigation' + application: 'navigation@0.1' + } + } + + 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.name === launcher.current + onClicked: { + pid = launcher.launch(model.application) + if (1 < pid) { + applicationArea.visible = true + } + else { + console.warn(model.application) + console.warn("app cannot be launched!") + } + homescreenHandler.tapShortcut(model.name, false) + } + } + } + } +} diff --git a/demo3/vertical/homescreen/homescreen/qml/ShortcutIcon.qml b/demo3/vertical/homescreen/homescreen/qml/ShortcutIcon.qml new file mode 100644 index 0000000..8dfee26 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/ShortcutIcon.qml @@ -0,0 +1,100 @@ +/* + * 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 +import QtGraphicalEffects 1.0 + +MouseArea { + id: root + width: 195 + height: 216.8 + property string name: 'Home' + property bool active: false + Item { + id: icon + property real desaturation: 0 + anchors.fill: parent + Image { + id: inactiveIcon + anchors.fill: parent + source: './images/Shortcut/%1.svg'.arg(root.name.toLowerCase()) + } + Image { + id: activeIcon + anchors.fill: parent + source: './images/Shortcut/%1_active.svg'.arg(root.name.toLowerCase()) + opacity: 0.0 + } + layer.enabled: true + layer.effect: Desaturate { + id: desaturate + desaturation: icon.desaturation + cached: true + } + } + 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(model.name.toUpperCase()) + } + states: [ + State { + when: launcher.launching + PropertyChanges { + target: root + enabled: false + } + PropertyChanges { + target: icon + desaturation: 1.0 + } + }, + State { + when: root.active + PropertyChanges { + target: inactiveIcon + opacity: 0.0 + } + PropertyChanges { + target: activeIcon + opacity: 1.0 + } + } + ] + + transitions: [ + Transition { + NumberAnimation { + properties: 'opacity' + duration: 500 + easing.type: Easing.OutExpo + } + NumberAnimation { + properties: 'desaturation' + duration: 250 + } + } + ] +} diff --git a/demo3/vertical/homescreen/homescreen/qml/StatusArea.qml b/demo3/vertical/homescreen/homescreen/qml/StatusArea.qml new file mode 100644 index 0000000..89030eb --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/StatusArea.qml @@ -0,0 +1,169 @@ +/* + * 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. + * 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: 295 + height: 218 + + property date now: new Date + Timer { + interval: 100; running: true; repeat: true; + onTriggered: root.now = new Date + } + + Connections { + target: weather + + onConditionChanged: { + var icon = '' + + if (condition.indexOf("clouds") != -1) { + icon = "WeatherIcons_Cloudy-01.png" + } else if (condition.indexOf("thunderstorm") != -1) { + icon = "WeatherIcons_Thunderstorm-01.png" + } else if (condition.indexOf("snow") != -1) { + icon = "WeatherIcons_Snow-01.png" + } else if (condition.indexOf("rain") != -1) { + icon = "WeatherIcons_Rain-01.png" + } + + condition_item.source = icon ? './images/Weather/' + icon : '' + } + + onTemperatureChanged: { + temperature_item.text = temperature.split(".")[0] + '°F' + } + } + + 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 +// } + } + 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 + } + 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 + Rectangle { + Layout.preferredWidth: 77 + Layout.preferredHeight: 55 + opacity: 0 + } + 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 + 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 + } + } + } + } + } + + Repeater { + model: StatusBarModel { objectName: "statusBar" } + delegate: Image { + Layout.preferredWidth: 77 + Layout.preferredHeight: 55 + source: model.modelData + fillMode: Image.PreserveAspectFit + } + } + } + } +} diff --git a/demo3/vertical/homescreen/homescreen/qml/TopArea.qml b/demo3/vertical/homescreen/homescreen/qml/TopArea.qml new file mode 100644 index 0000000..9cff3ed --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/TopArea.qml @@ -0,0 +1,59 @@ +/* + * 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: 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 + } + } + + 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/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png b/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png new file mode 100644 index 0000000..a4e026c Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Blue_Background_NoCar-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Full_Background.png b/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Full_Background.png new file mode 100644 index 0000000..8b11e20 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Full_Background.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Normal_Background.png b/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Normal_Background.png new file mode 100644 index 0000000..c686067 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/AGL_HMI_Normal_Background.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/AlbumArtwork.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/AlbumArtwork.png new file mode 100644 index 0000000..3716ab3 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/AlbumArtwork.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/BackArrow.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/BackArrow.png new file mode 100644 index 0000000..63e38d9 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/BackArrow.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/ForwardArrow.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/ForwardArrow.png new file mode 100644 index 0000000..a513705 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/ForwardArrow.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/ShuffleIcon.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/ShuffleIcon.png new file mode 100644 index 0000000..30f75c5 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/ShuffleIcon.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Loud.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Loud.png new file mode 100644 index 0000000..8ea4402 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Loud.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Medium.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Medium.png new file mode 100644 index 0000000..ae5c82e Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Medium.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Off.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Off.png new file mode 100644 index 0000000..07e3353 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/Volume_Off.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/mediamusic.qrc b/demo3/vertical/homescreen/homescreen/qml/images/MediaMusic/mediamusic.qrc new file mode 100644 index 0000000..b1138c0 --- /dev/null +++ b/demo3/vertical/homescreen/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/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png new file mode 100644 index 0000000..14a52b2 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_AlbumArtwork.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png new file mode 100644 index 0000000..0ec1f67 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_BackArrow.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png new file mode 100644 index 0000000..bc2df1d Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png new file mode 100644 index 0000000..8d8fc02 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Bluetooth_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png new file mode 100644 index 0000000..94fe38f Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png new file mode 100644 index 0000000..12609e1 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_CD_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png new file mode 100644 index 0000000..299903e Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_DividingLine.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png new file mode 100644 index 0000000..33cc700 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_ForwardArrow.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png new file mode 100644 index 0000000..9bdb14d Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png new file mode 100644 index 0000000..76b0fc9 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Loop_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png new file mode 100644 index 0000000..c423005 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Pause.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png new file mode 100644 index 0000000..beece66 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Player_Play.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png new file mode 100644 index 0000000..eec608f Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png new file mode 100644 index 0000000..d392a90 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_PlaylistToggle_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png new file mode 100644 index 0000000..22319c9 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png new file mode 100644 index 0000000..9fd42e2 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Playlist_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png new file mode 100644 index 0000000..eb61b39 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png new file mode 100644 index 0000000..de305f0 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Radio_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png new file mode 100644 index 0000000..d97feec Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png new file mode 100644 index 0000000..7f6445d Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/AGL_MediaPlayer_Shuffle_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Albums_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Albums_Active.png new file mode 100644 index 0000000..1f66e23 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Albums_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Albums_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Albums_Inactive.png new file mode 100644 index 0000000..e0e7f00 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Albums_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/DividingLine.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/DividingLine.png new file mode 100644 index 0000000..87f2122 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/DividingLine.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/GreenLine.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/GreenLine.png new file mode 100644 index 0000000..0210b83 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/GreenLine.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Music_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Music_Active.png new file mode 100644 index 0000000..36afac7 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Music_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Music_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Music_Inactive.png new file mode 100644 index 0000000..9dae353 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Music_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Podcasts_Active.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Podcasts_Active.png new file mode 100644 index 0000000..fd2d2c0 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Podcasts_Active.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Podcasts_Inactive.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Podcasts_Inactive.png new file mode 100644 index 0000000..b76b04c Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Podcasts_Inactive.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_Highlight.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_Highlight.png new file mode 100644 index 0000000..ac63673 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_Highlight.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_PauseIcon.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_PauseIcon.png new file mode 100644 index 0000000..2627add Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_PauseIcon.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_PlayIcon.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_PlayIcon.png new file mode 100644 index 0000000..0483e07 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_PlayIcon.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_VerticalLine.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_VerticalLine.png new file mode 100644 index 0000000..6a9db00 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/Popup_VerticalLine.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/X.png b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/X.png new file mode 100644 index 0000000..ab392cb Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/X.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/mediaplayer.qrc b/demo3/vertical/homescreen/homescreen/qml/images/MediaPlayer/mediaplayer.qrc new file mode 100644 index 0000000..1cb17ab --- /dev/null +++ b/demo3/vertical/homescreen/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/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/hvac.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/hvac.svg new file mode 100644 index 0000000..5c76e85 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/hvac.svg @@ -0,0 +1,600 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/hvac_active.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/hvac_active.svg new file mode 100644 index 0000000..46be46b --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/hvac_active.svg @@ -0,0 +1,614 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/launcher.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/launcher.svg new file mode 100644 index 0000000..b6eab24 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/launcher.svg @@ -0,0 +1,73 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/launcher_active.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/launcher_active.svg new file mode 100644 index 0000000..e85c7d8 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/launcher_active.svg @@ -0,0 +1,82 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/mediaplayer.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/mediaplayer.svg new file mode 100644 index 0000000..de7448d --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/mediaplayer.svg @@ -0,0 +1,50 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/mediaplayer_active.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/mediaplayer_active.svg new file mode 100644 index 0000000..16e3af5 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/mediaplayer_active.svg @@ -0,0 +1,63 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/navigation.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/navigation.svg new file mode 100644 index 0000000..6f6f1e0 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/navigation.svg @@ -0,0 +1,77 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/navigation_active.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/navigation_active.svg new file mode 100644 index 0000000..9076934 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/navigation_active.svg @@ -0,0 +1,90 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/shortcut.qrc b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/shortcut.qrc new file mode 100644 index 0000000..f5b3bca --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/shortcut.qrc @@ -0,0 +1,14 @@ + + + launcher.svg + launcher_active.svg + hvac.svg + hvac_active.svg + mediaplayer.svg + mediaplayer_active.svg + navigation.svg + navigation_active.svg + video.svg + video_active.svg + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/video.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/video.svg new file mode 100644 index 0000000..e368922 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/video.svg @@ -0,0 +1,109 @@ + + + + + + image/svg+xml + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/video_active.svg b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/video_active.svg new file mode 100644 index 0000000..344385f --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Shortcut/video_active.svg @@ -0,0 +1,126 @@ + + + + + + image/svg+xml + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Bluetooth_Inactive-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Bluetooth_Inactive-01.png new file mode 100644 index 0000000..10bd5a5 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Bluetooth_Inactive-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Bluetooth_On-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Bluetooth_On-01.png new file mode 100644 index 0000000..1ff96e1 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Bluetooth_On-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_1Bars-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_1Bars-01.png new file mode 100644 index 0000000..44ef700 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_1Bars-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_2Bars-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_2Bars-01.png new file mode 100644 index 0000000..fe4e776 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_2Bars-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_3Bars-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_3Bars-01.png new file mode 100644 index 0000000..892c6ec Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_3Bars-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_4Bars-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_4Bars-01.png new file mode 100644 index 0000000..f4f033b Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_4Bars-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_Full-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_Full-01.png new file mode 100644 index 0000000..18070b9 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_Full-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_NoBars-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_NoBars-01.png new file mode 100644 index 0000000..1b77207 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Signal_NoBars-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_1Bar-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_1Bar-01.png new file mode 100644 index 0000000..c72461f Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_1Bar-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_2Bars-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_2Bars-01.png new file mode 100644 index 0000000..448dd36 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_2Bars-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_3Bars-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_3Bars-01.png new file mode 100644 index 0000000..3e407ad Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_3Bars-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_Full-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_Full-01.png new file mode 100644 index 0000000..6f95e97 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_Full-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_NoBars-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_NoBars-01.png new file mode 100644 index 0000000..07f4f09 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Status/HMI_Status_Wifi_NoBars-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Status/status.qrc b/demo3/vertical/homescreen/homescreen/qml/images/Status/status.qrc new file mode 100644 index 0000000..d29c91a --- /dev/null +++ b/demo3/vertical/homescreen/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/demo3/vertical/homescreen/homescreen/qml/images/TopSection_NoText_NoIcons-01.png b/demo3/vertical/homescreen/homescreen/qml/images/TopSection_NoText_NoIcons-01.png new file mode 100644 index 0000000..cf9ec4e Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/TopSection_NoText_NoIcons-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Utility_Logo_Background-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Utility_Logo_Background-01.png new file mode 100644 index 0000000..21a602d Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Utility_Logo_Background-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Utility_Logo_Grey-01.svg b/demo3/vertical/homescreen/homescreen/qml/images/Utility_Logo_Grey-01.svg new file mode 100644 index 0000000..16ac88c --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/Utility_Logo_Grey-01.svg @@ -0,0 +1,84 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Utility_Music_Background-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Utility_Music_Background-01.png new file mode 100644 index 0000000..c3e9f91 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Utility_Music_Background-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Utility_Radio_Background-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Utility_Radio_Background-01.png new file mode 100644 index 0000000..b755843 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Utility_Radio_Background-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_ALL-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_ALL-01.png new file mode 100644 index 0000000..f5f8b19 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_ALL-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Cloudy-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Cloudy-01.png new file mode 100644 index 0000000..3603a55 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Cloudy-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Moon-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Moon-01.png new file mode 100644 index 0000000..8fe1e18 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Moon-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_PartiallyCloudy-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_PartiallyCloudy-01.png new file mode 100644 index 0000000..09cd84f Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_PartiallyCloudy-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Rain-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Rain-01.png new file mode 100644 index 0000000..125b413 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Rain-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Snow-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Snow-01.png new file mode 100644 index 0000000..d0a9520 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Snow-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Sun-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Sun-01.png new file mode 100644 index 0000000..ee3a744 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Sun-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Thunderstorm-01.png b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Thunderstorm-01.png new file mode 100644 index 0000000..f6959f4 Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/Weather/WeatherIcons_Thunderstorm-01.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/Weather/weather.qrc b/demo3/vertical/homescreen/homescreen/qml/images/Weather/weather.qrc new file mode 100644 index 0000000..2668fec --- /dev/null +++ b/demo3/vertical/homescreen/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/demo3/vertical/homescreen/homescreen/qml/images/fullscreen.png b/demo3/vertical/homescreen/homescreen/qml/images/fullscreen.png new file mode 100644 index 0000000..f56a13c Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/fullscreen.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/images/images.qrc b/demo3/vertical/homescreen/homescreen/qml/images/images.qrc new file mode 100644 index 0000000..593167c --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/images/images.qrc @@ -0,0 +1,14 @@ + + + TopSection_NoText_NoIcons-01.png + Utility_Logo_Background-01.png + 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 + fullscreen.png + normal.png + + diff --git a/demo3/vertical/homescreen/homescreen/qml/images/normal.png b/demo3/vertical/homescreen/homescreen/qml/images/normal.png new file mode 100644 index 0000000..92dee7a Binary files /dev/null and b/demo3/vertical/homescreen/homescreen/qml/images/normal.png differ diff --git a/demo3/vertical/homescreen/homescreen/qml/main.qml b/demo3/vertical/homescreen/homescreen/qml/main.qml new file mode 100644 index 0000000..b90408d --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/main.qml @@ -0,0 +1,155 @@ +/* + * 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.Window 2.1 +import QtQuick.Layouts 1.1 +import HomeScreen 1.0 + +Window { + visible: true + flags: Qt.FramelessWindowHint + width: container.width * container.scale + height: container.height * container.scale + title: 'HomeScreen' + color: "#00000000" + + Image { + id: container + anchors.centerIn: parent + width: 1080 + height: 1920 + scale: 1.0 + source: './images/AGL_HMI_Blue_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 + + visible: true + } + + MediaArea { + id: mediaArea + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 215 + } + } + + states: [ + State { + name: "normal" + PropertyChanges { + target: topArea + y: 0 + } + PropertyChanges { + target: applicationArea + y: 218 + } + PropertyChanges { + target: mediaArea + y: 1705 + } + }, + State { + name: "fullscreen" + PropertyChanges { + target: topArea + y: -220 + } + PropertyChanges { + target: applicationArea + y: -1490 + } + PropertyChanges { + target: mediaArea + y: 2135 + } + } + ] + transitions: Transition { + NumberAnimation { + target: topArea + property: "y" + easing.type: "OutQuad" + duration: 250 + } + NumberAnimation { + target: mediaArea + property: "y" + easing.type: "OutQuad" + duration: 250 + } + } + + } + Item { + id: switchBtn + anchors.right: parent.right + anchors.rightMargin: 20 + anchors.top: parent.top + anchors.topMargin: 25 + width: 35 + height: 35 + z: 1 + + MouseArea { + anchors.fill: parent + property string btnState: 'normal' + Image { + id: image + anchors.fill: parent + source: './images/normal.png' + } + onClicked: { + var appName = homescreenHandler.getCurrentApplication() + if (btnState === 'normal') { + image.source = './images/fullscreen.png' + btnState = 'fullscreen' + container.state = 'fullscreen' + touchArea.switchArea(1) + homescreenHandler.tapShortcut(appName, true) + // if (appName === 'navigation' || appName === 'browser') { + container.opacity = 0.0 + // } + } else { + image.source = './images/normal.png' + btnState = 'normal' + container.state = 'normal' + touchArea.switchArea(0) + homescreenHandler.tapShortcut(appName, false) + // if (appName === 'navigation' || appName === 'browser') { + container.opacity = 1.0 + // } + } + } + } + } +} diff --git a/demo3/vertical/homescreen/homescreen/qml/qml.qrc b/demo3/vertical/homescreen/homescreen/qml/qml.qrc new file mode 100644 index 0000000..e60ea63 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/qml/qml.qrc @@ -0,0 +1,14 @@ + + + main.qml + MediaArea.qml + MediaAreaBlank.qml + MediaAreaMusic.qml + MediaAreaRadio.qml + ShortcutArea.qml + ShortcutIcon.qml + StatusArea.qml + TopArea.qml + IconItem.qml + + diff --git a/demo3/vertical/homescreen/homescreen/src/applicationlauncher.cpp b/demo3/vertical/homescreen/homescreen/src/applicationlauncher.cpp new file mode 100644 index 0000000..5a1e2d6 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/applicationlauncher.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH + * 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 "applicationlauncher.h" + +#include "afm_user_daemon_proxy.h" + +#include "hmi-debug.h" + +extern org::AGL::afm::user *afm_user_daemon_proxy; + +ApplicationLauncher::ApplicationLauncher(QObject *parent) + : QObject(parent) + , m_launching(false) + , m_timeout(new QTimer(this)) +{ + m_timeout->setInterval(3000); + m_timeout->setSingleShot(true); + connect(m_timeout, &QTimer::timeout, [&]() { + setLaunching(false); + }); + connect(this, &ApplicationLauncher::launchingChanged, [&](bool launching) { + if (launching) + m_timeout->start(); + else + m_timeout->stop(); + }); + connect(this, &ApplicationLauncher::currentChanged, [&]() { + setLaunching(false); + }); +} + +int ApplicationLauncher::launch(const QString &application) +{ + int result = -1; + HMI_DEBUG("HomeScreen","ApplicationLauncher launch %s.", application.toStdString().c_str()); + + result = afm_user_daemon_proxy->start(application).value().toInt(); + HMI_DEBUG("HomeScreen","ApplicationLauncher pid: %d.", result); + + if (result > 1) { + setLaunching(true); + } + + return result; +} + +bool ApplicationLauncher::isLaunching() const +{ + return m_launching; +} + +void ApplicationLauncher::setLaunching(bool launching) +{ + if (m_launching == launching) return; + m_launching = launching; + launchingChanged(launching); +} + +QString ApplicationLauncher::current() const +{ + return m_current; +} + +void ApplicationLauncher::setCurrent(const QString ¤t) +{ + if (m_current == current) return; + m_current = current; + emit currentChanged(current); +} diff --git a/demo3/vertical/homescreen/homescreen/src/applicationlauncher.h b/demo3/vertical/homescreen/homescreen/src/applicationlauncher.h new file mode 100644 index 0000000..dfa5846 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/applicationlauncher.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH + * 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. + */ + +#ifndef APPLICATIONLAUNCHER_H +#define APPLICATIONLAUNCHER_H + +#include + +class QTimer; + +class ApplicationLauncher : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool launching READ isLaunching NOTIFY launchingChanged) + Q_PROPERTY(QString current READ current WRITE setCurrent NOTIFY currentChanged) +public: + explicit ApplicationLauncher(QObject *parent = NULL); + + bool isLaunching() const; + QString current() const; + +signals: + void newAppRequestsToBeVisible(int pid); + void launchingChanged(bool launching); + void currentChanged(const QString ¤t); + +public slots: + int launch(const QString &application); + void setCurrent(const QString ¤t); + +private: + void setLaunching(bool launching); + +private: + bool m_launching; + QString m_current; + QTimer *m_timeout; +}; + +#endif // APPLICATIONLAUNCHER_H diff --git a/demo3/vertical/homescreen/homescreen/src/hmi-debug.h b/demo3/vertical/homescreen/homescreen/src/hmi-debug.h new file mode 100644 index 0000000..28705f5 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/hmi-debug.h @@ -0,0 +1,70 @@ +/* + * 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. + */ + +#ifndef __HMI_DEBUG_H__ +#define __HMI_DEBUG_H__ + +#include +#include +#include +#include +#include + +enum LOG_LEVEL{ + LOG_LEVEL_NONE = 0, + LOG_LEVEL_ERROR, + LOG_LEVEL_WARNING, + LOG_LEVEL_NOTICE, + LOG_LEVEL_INFO, + LOG_LEVEL_DEBUG, + LOG_LEVEL_MAX = LOG_LEVEL_DEBUG +}; + +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) + +#define HMI_ERROR(prefix, args,...) _HMI_LOG(LOG_LEVEL_ERROR, __FILENAME__, __FUNCTION__, __LINE__, prefix, args, ##__VA_ARGS__) +#define HMI_WARNING(prefix, args,...) _HMI_LOG(LOG_LEVEL_WARNING, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__) +#define HMI_NOTICE(prefix, args,...) _HMI_LOG(LOG_LEVEL_NOTICE, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__) +#define HMI_INFO(prefix, args,...) _HMI_LOG(LOG_LEVEL_INFO, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__) +#define HMI_DEBUG(prefix, args,...) _HMI_LOG(LOG_LEVEL_DEBUG, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__) + +static char ERROR_FLAG[6][20] = {"NONE", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG"}; + +static void _HMI_LOG(enum LOG_LEVEL level, const char* file, const char* func, const int line, const char* prefix, const char* log, ...) +{ + const int log_level = (getenv("USE_HMI_DEBUG") == NULL)?LOG_LEVEL_ERROR:atoi(getenv("USE_HMI_DEBUG")); + if(log_level < level) + { + return; + } + + char *message; + struct timespec tp; + unsigned int time; + + clock_gettime(CLOCK_REALTIME, &tp); + time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000); + + va_list args; + va_start(args, log); + if (log == NULL || vasprintf(&message, log, args) < 0) + message = NULL; + fprintf(stderr, "[%10.3f] [%s %s] [%s, %s(), Line:%d] >>> %s \n", time / 1000.0, prefix, ERROR_FLAG[level], file, func, line, message); + va_end(args); + free(message); +} + +#endif //__HMI_DEBUG_H__ diff --git a/demo3/vertical/homescreen/homescreen/src/homescreenhandler.cpp b/demo3/vertical/homescreen/homescreen/src/homescreenhandler.cpp new file mode 100644 index 0000000..3a602f2 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/homescreenhandler.cpp @@ -0,0 +1,110 @@ +/* + * 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 "homescreenhandler.h" +#include +#include "hmi-debug.h" + +void* HomescreenHandler::myThis = 0; + +HomescreenHandler::HomescreenHandler(QObject *parent) : + QObject(parent), + mp_hs(NULL), + current_applciation("launcher") +{ + +} + +HomescreenHandler::~HomescreenHandler() +{ + if (mp_hs != NULL) { + delete mp_hs; + } +} + +void HomescreenHandler::init(int port, const char *token) +{ + mp_hs = new LibHomeScreen(); + mp_hs->init(port, token); + + myThis = this; + + mp_hs->registerCallback(nullptr, HomescreenHandler::onRep_static); + + mp_hs->set_event_handler(LibHomeScreen::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); + }); +} + +void HomescreenHandler::tapShortcut(QString application_name, bool is_full) +{ + HMI_DEBUG("HomeScreen","tapShortcut %s", application_name.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","tapShortcut fullscreen"); + } else { + value = json_object_new_string("normal"); + HMI_DEBUG("HomeScreen","tapShortcut normal"); + } + json_object_object_add(j_json, "area", value); + mp_hs->showWindow(application_name.toStdString().c_str(), j_json); +} + +void HomescreenHandler::setCurrentApplication(QString application_name) +{ + HMI_DEBUG("HomeScreen","setCurrentApplication %s", application_name.toStdString().c_str()); + current_applciation = application_name; +} + +QString HomescreenHandler::getCurrentApplication() +{ + HMI_DEBUG("HomeScreen","getCurrentApplication %s", current_applciation.toStdString().c_str()); + return current_applciation; +} + +void HomescreenHandler::onRep_static(struct json_object* reply_contents) +{ + static_cast(HomescreenHandler::myThis)->onRep(reply_contents); +} + +void HomescreenHandler::onEv_static(const string& event, struct json_object* event_contents) +{ + static_cast(HomescreenHandler::myThis)->onEv(event, event_contents); +} + +void HomescreenHandler::onRep(struct json_object* reply_contents) +{ + const char* str = json_object_to_json_string(reply_contents); + HMI_DEBUG("HomeScreen","HomeScreen onReply %s", str); +} + +void HomescreenHandler::onEv(const string& event, struct json_object* event_contents) +{ + const char* str = json_object_to_json_string(event_contents); + HMI_DEBUG("HomeScreen","HomeScreen onEv %s, contents: %s", event.c_str(), str); + + if (event.compare("homescreen/on_screen_message") == 0) { + struct json_object *json_data = json_object_object_get(event_contents, "data"); + struct json_object *json_display_message = json_object_object_get(json_data, "display_message"); + const char* display_message = json_object_get_string(json_display_message); + + HMI_DEBUG("HomeScreen","display_message = %s", display_message); + } +} diff --git a/demo3/vertical/homescreen/homescreen/src/homescreenhandler.h b/demo3/vertical/homescreen/homescreen/src/homescreenhandler.h new file mode 100644 index 0000000..539d380 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/homescreenhandler.h @@ -0,0 +1,55 @@ +/* + * 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. + */ + +#ifndef HOMESCREENHANDLER_H +#define HOMESCREENHANDLER_H + +#include +#include +#include + +using namespace std; + +class HomescreenHandler : public QObject +{ + Q_OBJECT +public: + explicit HomescreenHandler(QObject *parent = 0); + ~HomescreenHandler(); + + void init(int port, const char* token); + + Q_INVOKABLE void tapShortcut(QString application_name, bool is_full); + Q_INVOKABLE QString getCurrentApplication(); + void setCurrentApplication(QString application_name); + + void onRep(struct json_object* reply_contents); + void onEv(const string& event, struct json_object* event_contents); + + static void* myThis; + static void onRep_static(struct json_object* reply_contents); + static void onEv_static(const string& event, struct json_object* event_contents); + +signals: + void notification(QString id, QString icon, QString text); + void information(QString text); + +private: + LibHomeScreen *mp_hs; + QString current_applciation; +}; + +#endif // HOMESCREENHANDLER_H diff --git a/demo3/vertical/homescreen/homescreen/src/main.cpp b/demo3/vertical/homescreen/homescreen/src/main.cpp new file mode 100644 index 0000000..75faae1 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/main.cpp @@ -0,0 +1,165 @@ +/* + * 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. + * 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 +#include +#include +#include +#include +#include + +#include +#include +#include +#include "applicationlauncher.h" +#include "statusbarmodel.h" +#include "afm_user_daemon_proxy.h" +#include "mastervolume.h" +#include "homescreenhandler.h" +#include "hmi-debug.h" +#include "toucharea.h" + +// 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? +org::AGL::afm::user *afm_user_daemon_proxy; + +namespace { + +struct Cleanup { + static inline void cleanup(org::AGL::afm::user *p) { + delete p; + afm_user_daemon_proxy = Q_NULLPTR; + } +}; + +void noOutput(QtMsgType, const QMessageLogContext &, const QString &) +{ +} + +} + +int main(int argc, char *argv[]) +{ + QGuiApplication a(argc, argv); + + // use launch process + QScopedPointer afm_user_daemon_proxy(new org::AGL::afm::user("org.AGL.afm.user", + "/org/AGL/afm/user", + QDBusConnection::sessionBus(), + 0)); + ::afm_user_daemon_proxy = afm_user_daemon_proxy.data(); + + QCoreApplication::setOrganizationDomain("LinuxFoundation"); + QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); + QCoreApplication::setApplicationName("HomeScreen"); + QCoreApplication::setApplicationVersion("0.7.0"); + + QCommandLineParser parser; + parser.addPositionalArgument("port", a.translate("main", "port for binding")); + parser.addPositionalArgument("secret", a.translate("main", "secret for binding")); + parser.addHelpOption(); + parser.addVersionOption(); + parser.process(a); + QStringList positionalArguments = parser.positionalArguments(); + + int port = 1700; + QString token = "wm"; + + if (positionalArguments.length() == 2) { + port = positionalArguments.takeFirst().toInt(); + token = positionalArguments.takeFirst(); + } + + HMI_DEBUG("HomeScreen","port = %d, token = %s", port, token.toStdString().c_str()); + + // import C++ class to QML + // qmlRegisterType("HomeScreen", 1, 0, "ApplicationLauncher"); + qmlRegisterType("HomeScreen", 1, 0, "StatusBarModel"); + qmlRegisterType("MasterVolume", 1, 0, "MasterVolume"); + + ApplicationLauncher *launcher = new ApplicationLauncher(); + QLibWindowmanager* layoutHandler = new QLibWindowmanager(); + HomescreenHandler* homescreenHandler = new HomescreenHandler(); + if(layoutHandler->init(port,token) != 0){ + exit(EXIT_FAILURE); + } + + if (layoutHandler->requestSurface(QString("HomeScreen")) != 0) { + exit(EXIT_FAILURE); + } + + layoutHandler->set_event_handler(QLibWindowmanager::Event_SyncDraw, [layoutHandler](json_object *object) { + layoutHandler->endDraw(QString("HomeScreen")); + }); + + layoutHandler->set_event_handler(QLibWindowmanager::Event_ScreenUpdated, [layoutHandler, launcher, homescreenHandler](json_object *object) { + json_object *jarray = json_object_object_get(object, "ids"); + int arrLen = json_object_array_length(jarray); + for( int idx = 0; idx < arrLen; idx++) + { + QString 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); + QMetaObject::invokeMethod(launcher, "setCurrent", Qt::QueuedConnection, Q_ARG(QString, label)); + } + }); + + + QUrl bindingAddress; + bindingAddress.setScheme(QStringLiteral("ws")); + bindingAddress.setHost(QStringLiteral("localhost")); + bindingAddress.setPort(port); + bindingAddress.setPath(QStringLiteral("/api")); + + QUrlQuery query; + query.addQueryItem(QStringLiteral("token"), token); + bindingAddress.setQuery(query); + + TouchArea* touchArea = new TouchArea(); + + // mail.qml loading + QQmlApplicationEngine engine; + engine.rootContext()->setContextProperty("layoutHandler", layoutHandler); + engine.rootContext()->setContextProperty("homescreenHandler", homescreenHandler); + engine.rootContext()->setContextProperty("touchArea", touchArea); + engine.rootContext()->setContextProperty("launcher", launcher); + engine.rootContext()->setContextProperty("weather", new Weather(bindingAddress)); + engine.rootContext()->setContextProperty("bluetooth", new Bluetooth(bindingAddress)); + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + + QObject *root = engine.rootObjects().first(); + QQuickWindow *window = qobject_cast(root); + + touchArea->setWindow(window); + QThread* thread = new QThread; + touchArea->moveToThread(thread); + QObject::connect(thread, &QThread::started, touchArea, &TouchArea::init); + + thread->start(); + + QList sobjs = engine.rootObjects(); + StatusBarModel *statusBar = sobjs.first()->findChild("statusBar"); + statusBar->init(bindingAddress, engine.rootContext()); + + QObject::connect(window, SIGNAL(frameSwapped()), layoutHandler, SLOT(slotActivateSurface())); + + homescreenHandler->init(port, token.toStdString().c_str()); + + return a.exec(); +} diff --git a/demo3/vertical/homescreen/homescreen/src/mastervolume.cpp b/demo3/vertical/homescreen/homescreen/src/mastervolume.cpp new file mode 100644 index 0000000..5e1e450 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/mastervolume.cpp @@ -0,0 +1,31 @@ +/* + * 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" + +void MasterVolume::setVolume(pa_volume_t volume) +{ + int volume_delta = volume - m_volume; + m_volume = volume; + emit sliderVolumeChanged(volume_delta); + +} + +void MasterVolume::changeExternalVolume(int volume) +{ + m_volume = volume; + emit volumeChanged(); +} diff --git a/demo3/vertical/homescreen/homescreen/src/mastervolume.h b/demo3/vertical/homescreen/homescreen/src/mastervolume.h new file mode 100644 index 0000000..645968a --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/mastervolume.h @@ -0,0 +1,48 @@ +/* + * 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 + +class MasterVolume : public QObject +{ + Q_OBJECT + Q_PROPERTY (uint32_t volume READ getVolume WRITE setVolume NOTIFY volumeChanged) + + public: + MasterVolume(QObject *parent = 0) + : QObject(parent), m_volume(32768) + { + } + + ~MasterVolume() {} + + uint32_t getVolume() const { return m_volume; } + void setVolume(pa_volume_t volume); + + public slots: + void changeExternalVolume(int volume); + + signals: + void volumeChanged(void); + void sliderVolumeChanged(int volume_delta); + void externalVolumeChanged(uint32_t volume); + + private: + uint32_t m_volume; +}; diff --git a/demo3/vertical/homescreen/homescreen/src/statusbarmodel.cpp b/demo3/vertical/homescreen/homescreen/src/statusbarmodel.cpp new file mode 100644 index 0000000..0c54a67 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/statusbarmodel.cpp @@ -0,0 +1,148 @@ +/* + * 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. + * 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 +#include "hmi-debug.h" + +#include + +#include "network.h" + + +class StatusBarModel::Private +{ +public: + Private(StatusBarModel *parent); + +private: + StatusBarModel *q; +public: + StatusBarServer server; + QString iconList[StatusBarServer::SupportedCount]; + Network *network; +}; + +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; +} + +void StatusBarModel::init(QUrl &url, QQmlContext *context) +{ + HMI_DEBUG("HomeScreen", "StatusBarModel::init"); + d->network = new Network(url, context); + context->setContextProperty("network", d->network); + + QObject::connect(d->network, &Network::wifiConnectedChanged, this, &StatusBarModel::onWifiConnectedChanged); + QObject::connect(d->network, &Network::wifiEnabledChanged, this, &StatusBarModel::onWifiEnabledChanged); + QObject::connect(d->network, &Network::wifiStrengthChanged, this, &StatusBarModel::onWifiStrengthChanged); + + setWifiStatus(d->network->wifiConnected(), d->network->wifiEnabled(), d->network->wifiStrength()); +} + +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")); + else if (strength < 50) + d->server.setStatusIcon(0, QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_2Bars-01.png")); + else if (strength < 70) + d->server.setStatusIcon(0, QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_3Bars-01.png")); + else + d->server.setStatusIcon(0, QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_Full-01.png")); + else + d->server.setStatusIcon(0, QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_NoBars-01.png")); +} + +void StatusBarModel::onWifiConnectedChanged(bool connected) +{ + setWifiStatus(connected, d->network->wifiEnabled(), d->network->wifiStrength()); +} + +void StatusBarModel::onWifiEnabledChanged(bool enabled) +{ + setWifiStatus(d->network->wifiConnected(), enabled, d->network->wifiStrength()); +} + +void StatusBarModel::onWifiStrengthChanged(int strength) +{ + qInfo() << "Strength changed: " << strength; + setWifiStatus(d->network->wifiConnected(), d->network->wifiEnabled(), strength); +} + +int StatusBarModel::rowCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return 0; + + return StatusBarServer::SupportedCount - 1; +} + +QVariant StatusBarModel::data(const QModelIndex &index, int role) const +{ + QVariant ret; + if (!index.isValid()) + return ret; + + switch (role) { + case Qt::DisplayRole: + if (index.row() == 0) { + ret = d->iconList[StatusBarServer::StatusWifi]; + } else if (index.row() == 1) { + ret = d->iconList[StatusBarServer::StatusCellular]; + } + break; + default: + break; + } + + return ret; +} + +QHash StatusBarModel::roleNames() const +{ + QHash roles; + roles[Qt::DisplayRole] = "icon"; + return roles; +} diff --git a/demo3/vertical/homescreen/homescreen/src/statusbarmodel.h b/demo3/vertical/homescreen/homescreen/src/statusbarmodel.h new file mode 100644 index 0000000..4e31f19 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/statusbarmodel.h @@ -0,0 +1,47 @@ +/* + * 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 +#include + +class StatusBarModel : public QAbstractListModel +{ + Q_OBJECT +public: + explicit StatusBarModel(QObject *parent = NULL); + ~StatusBarModel(); + + void init(QUrl &url, QQmlContext *context); + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + QHash roleNames() const override; + + // slots + void onWifiConnectedChanged(bool connected); + void onWifiEnabledChanged(bool enabled); + void onWifiStrengthChanged(int strength); + +private: + class Private; + Private *d; + void setWifiStatus(bool connected, bool enabled, int strength); +}; + +#endif // STATUSBARMODEL_H diff --git a/demo3/vertical/homescreen/homescreen/src/statusbarserver.cpp b/demo3/vertical/homescreen/homescreen/src/statusbarserver.cpp new file mode 100644 index 0000000..805c582 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/statusbarserver.cpp @@ -0,0 +1,91 @@ +/* + * 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. + */ + +#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/demo3/vertical/homescreen/homescreen/src/statusbarserver.h b/demo3/vertical/homescreen/homescreen/src/statusbarserver.h new file mode 100644 index 0000000..dabf6d3 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/statusbarserver.h @@ -0,0 +1,52 @@ +/* + * 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 { + StatusWifi = 0, + StatusBluetooth = 1, + StatusCellular = 2, + 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/demo3/vertical/homescreen/homescreen/src/toucharea.cpp b/demo3/vertical/homescreen/homescreen/src/toucharea.cpp new file mode 100644 index 0000000..1cf4384 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/toucharea.cpp @@ -0,0 +1,36 @@ +#include "toucharea.h" +#include "hmi-debug.h" + +TouchArea::TouchArea() +{ +} + +TouchArea::~TouchArea() +{ + +} + +void TouchArea::setWindow(QQuickWindow *window) +{ + myWindow = window; +} + +void TouchArea::init() +{ + bitmapNormal = QPixmap(":/images/AGL_HMI_Normal_Background.png").createHeuristicMask(); + bitmapFullscreen = QPixmap(":/images/AGL_HMI_Full_Background.png").createHeuristicMask(); + myWindow->setMask(QRegion(bitmapNormal)); +} + +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/demo3/vertical/homescreen/homescreen/src/toucharea.h b/demo3/vertical/homescreen/homescreen/src/toucharea.h new file mode 100644 index 0000000..69c6872 --- /dev/null +++ b/demo3/vertical/homescreen/homescreen/src/toucharea.h @@ -0,0 +1,30 @@ +#ifndef TOUCHAREA_H +#define TOUCHAREA_H + +#include +#include + +enum { + NORMAL=0, + FULLSCREEN +}; + +class TouchArea : public QObject +{ + Q_OBJECT +public: + explicit TouchArea(); + ~TouchArea(); + + Q_INVOKABLE void switchArea(int areaType); + void setWindow(QQuickWindow* window); + +public slots: + void init(); + +private: + QBitmap bitmapNormal, bitmapFullscreen; + QQuickWindow* myWindow; +}; + +#endif // TOUCHAREA_H diff --git a/demo3/vertical/homescreen/interfaces/LICENSE b/demo3/vertical/homescreen/interfaces/LICENSE new file mode 100644 index 0000000..31c692a --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/LICENSE @@ -0,0 +1,54 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + You must give any other recipients of the Work or Derivative Works a copy of this License; and + You must cause any modified files to carry prominent notices stating that You changed the files; and + You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/demo3/vertical/homescreen/interfaces/README.md b/demo3/vertical/homescreen/interfaces/README.md new file mode 100644 index 0000000..15dfaa9 --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/README.md @@ -0,0 +1,11 @@ +AGL Home Screen reference implementation +This lib provides the needed D-Bus interfaces + +Build with QtCreator 3.0.1 + +AGL repo for source code: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen + +AGL repo for bitbake recipe: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/HomeScreen/HomeScreen_?.bb + diff --git a/demo3/vertical/homescreen/interfaces/afm_user_daemon.xml b/demo3/vertical/homescreen/interfaces/afm_user_daemon.xml new file mode 100644 index 0000000..17b7d63 --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/afm_user_daemon.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/interfaces/appframework.xml b/demo3/vertical/homescreen/interfaces/appframework.xml new file mode 100644 index 0000000..f10b3ae --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/appframework.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/interfaces/include/afm_user_daemon.hpp b/demo3/vertical/homescreen/interfaces/include/afm_user_daemon.hpp new file mode 100644 index 0000000..b9a5321 --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/include/afm_user_daemon.hpp @@ -0,0 +1,21 @@ +/* + * 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. + */ + +#ifndef AFM_USER_DAEMON_HPP +#define AFM_USER_DAEMON_HPP + + +#endif // AFM_USER_DAEMON_HPP diff --git a/demo3/vertical/homescreen/interfaces/include/appframework.hpp b/demo3/vertical/homescreen/interfaces/include/appframework.hpp new file mode 100644 index 0000000..98ec317 --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/include/appframework.hpp @@ -0,0 +1,66 @@ +/* + * 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. + */ + +#ifndef APPFRAMEWORK_HPP +#define APPFRAMEWORK_HPP + +#include +#include + +class AppInfo +{ + Q_GADGET + Q_PROPERTY(QString id READ id) + Q_PROPERTY(QString version READ version) + Q_PROPERTY(int width READ width) + Q_PROPERTY(int height READ height) + Q_PROPERTY(QString name READ name) + Q_PROPERTY(QString description READ description) + Q_PROPERTY(QString shortname READ shortname) + Q_PROPERTY(QString author READ author) + Q_PROPERTY(QString iconPath READ iconPath) +public: + AppInfo(); + AppInfo(const AppInfo &other); + virtual ~AppInfo(); + AppInfo &operator =(const AppInfo &other); + void swap(AppInfo &other) { qSwap(d, other.d); } + + QString id() const; + QString version() const; + int width() const; + int height() const; + QString name() const; + QString description() const; + QString shortname() const; + QString author() const; + QString iconPath() const; + + void read(const QJsonObject &json); + + friend QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo); + friend const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo); + +private: + class Private; + QSharedDataPointer d; +}; + +Q_DECLARE_SHARED(AppInfo) +Q_DECLARE_METATYPE(AppInfo) +Q_DECLARE_METATYPE(QList) + +#endif // APPFRAMEWORK_HPP diff --git a/demo3/vertical/homescreen/interfaces/include/statusbar.hpp b/demo3/vertical/homescreen/interfaces/include/statusbar.hpp new file mode 100644 index 0000000..ecdcede --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/include/statusbar.hpp @@ -0,0 +1,22 @@ +/* + * 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. + */ + +#ifndef STATUSBAR_H +#define STATUSBAR_H + + + +#endif // STATUSBAR_H diff --git a/demo3/vertical/homescreen/interfaces/interfaces.pri b/demo3/vertical/homescreen/interfaces/interfaces.pri new file mode 100644 index 0000000..07b9e6a --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/interfaces.pri @@ -0,0 +1,18 @@ +# 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. + +INCLUDEPATH += $$PWD $$OUT_PWD/../interfaces/ + +LIBS += -L$$OUT_PWD/../interfaces/ -linterfaces diff --git a/demo3/vertical/homescreen/interfaces/interfaces.pro b/demo3/vertical/homescreen/interfaces/interfaces.pro new file mode 100644 index 0000000..1e30bdd --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/interfaces.pro @@ -0,0 +1,61 @@ +# 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. + +TEMPLATE = lib +TARGET = interfaces +QT = dbus +CONFIG += staticlib + +HEADERS += \ + include/appframework.hpp + +SOURCES += \ + src/appframework.cpp + +XMLSOURCES = \ + afm_user_daemon.xml \ + appframework.xml \ + statusbar.xml + +gen_adaptor_cpp.input = XMLSOURCES +gen_adaptor_cpp.commands = \ + qdbusxml2cpp -i include/${QMAKE_FILE_IN_BASE}.hpp -m -a ${QMAKE_FILE_IN_BASE}_adaptor ${QMAKE_FILE_IN}; \ + moc $$OUT_PWD/${QMAKE_FILE_IN_BASE}_adaptor.h -o $$OUT_PWD/${QMAKE_FILE_IN_BASE}_adaptor.moc +gen_adaptor_cpp.output = ${QMAKE_FILE_IN_BASE}_adaptor.cpp +gen_adaptor_cpp.variable_out = SOURCES +gen_adaptor_cpp.clean = ${QMAKE_FILE_IN_BASE}_adaptor.cpp + +gen_proxy_cpp.input = XMLSOURCES +gen_proxy_cpp.commands = \ + qdbusxml2cpp -i include/${QMAKE_FILE_IN_BASE}.hpp -m -p ${QMAKE_FILE_IN_BASE}_proxy ${QMAKE_FILE_IN}; \ + moc $$OUT_PWD/${QMAKE_FILE_IN_BASE}_proxy.h -o $$OUT_PWD/${QMAKE_FILE_IN_BASE}_proxy.moc +gen_proxy_cpp.output = ${QMAKE_FILE_IN_BASE}_proxy.cpp +gen_proxy_cpp.variable_out = SOURCES +gen_proxy_cpp.clean = ${QMAKE_FILE_IN_BASE}_proxy.cpp + +gen_adaptor_h.input = XMLSOURCES +gen_adaptor_h.commands = @echo Fake making the header for ${QMAKE_FILE_IN} +gen_adaptor_h.depends = ${QMAKE_FILE_IN_BASE}_adaptor.cpp +gen_adaptor_h.output = ${QMAKE_FILE_IN_BASE}_adaptor.h +gen_adaptor_h.clean = ${QMAKE_FILE_IN_BASE}_adaptor.h + +gen_proxy_h.input = XMLSOURCES +gen_proxy_h.commands = @echo Fake making the header for ${QMAKE_FILE_IN} +gen_proxy_h.depends = ${QMAKE_FILE_IN_BASE}_proxy.cpp +gen_proxy_h.output = ${QMAKE_FILE_IN_BASE}_proxy.h +gen_proxy_h.clean = ${QMAKE_FILE_IN_BASE}_proxy.h + +QMAKE_EXTRA_COMPILERS += gen_adaptor_cpp gen_proxy_cpp gen_adaptor_h gen_proxy_h + +DISTFILES += diff --git a/demo3/vertical/homescreen/interfaces/src/appframework.cpp b/demo3/vertical/homescreen/interfaces/src/appframework.cpp new file mode 100644 index 0000000..7420642 --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/src/appframework.cpp @@ -0,0 +1,167 @@ +/* + * 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. + */ + +#include "include/appframework.hpp" + +#include + +class AppInfo::Private : public QSharedData +{ +public: + Private(); + Private(const Private &other); + + QString id; + QString version; + int width; + int height; + QString name; + QString description; + QString shortname; + QString author; + QString iconPath; +}; + +AppInfo::Private::Private() + : width(-1) + , height(-1) +{ +} + +AppInfo::Private::Private(const Private &other) + : QSharedData(other) + , id(other.id) + , version(other.version) + , width(other.width) + , height(other.height) + , name(other.name) + , description(other.description) + , shortname(other.shortname) + , author(other.author) + , iconPath(other.iconPath) +{ +} + +AppInfo::AppInfo() + : d(new Private) +{ +} + +AppInfo::AppInfo(const AppInfo &other) + : d(other.d) +{ +} + +AppInfo::~AppInfo() +{ +} + +AppInfo &AppInfo::operator =(const AppInfo &other) +{ + d = other.d; + return *this; +} + +QString AppInfo::id() const +{ + return d->id; +} + +QString AppInfo::version() const +{ + return d->version; +} + +int AppInfo::width() const +{ + return d->width; +} + +int AppInfo::height() const +{ + return d->height; +} + +QString AppInfo::name() const +{ + return d->name; +} + +QString AppInfo::description() const +{ + return d->description; +} + +QString AppInfo::shortname() const +{ + return d->shortname; +} + +QString AppInfo::author() const +{ + return d->author; +} + +QString AppInfo::iconPath() const +{ + return d->iconPath; +} + +void AppInfo::read(const QJsonObject &json) +{ + d->id = json["id"].toString(); + d->version = json["version"].toString(); + d->width = json["width"].toInt(); + d->height = json["height"].toInt(); + d->name = json["name"].toString(); + d->description = json["description"].toString(); + d->shortname = json["shortname"].toString(); + d->author = json["author"].toString(); + d->iconPath = json["iconPath"].toString(); +} + +QDBusArgument &operator <<(QDBusArgument &argument, const AppInfo &appInfo) +{ + argument.beginStructure(); + argument << appInfo.d->id; + argument << appInfo.d->version; + argument << appInfo.d->width; + argument << appInfo.d->height; + argument << appInfo.d->name; + argument << appInfo.d->description; + argument << appInfo.d->shortname; + argument << appInfo.d->author; + argument << appInfo.d->iconPath; + argument.endStructure(); + + return argument; +} + +const QDBusArgument &operator >>(const QDBusArgument &argument, AppInfo &appInfo) +{ + argument.beginStructure(); + argument >> appInfo.d->id; + argument >> appInfo.d->version; + argument >> appInfo.d->width; + argument >> appInfo.d->height; + argument >> appInfo.d->name; + argument >> appInfo.d->description; + argument >> appInfo.d->shortname; + argument >> appInfo.d->author; + argument >> appInfo.d->iconPath; + argument.endStructure(); + return argument; +} diff --git a/demo3/vertical/homescreen/interfaces/statusbar.xml b/demo3/vertical/homescreen/interfaces/statusbar.xml new file mode 100644 index 0000000..ec51be2 --- /dev/null +++ b/demo3/vertical/homescreen/interfaces/statusbar.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/package/config.xml b/demo3/vertical/homescreen/package/config.xml new file mode 100644 index 0000000..32d19fd --- /dev/null +++ b/demo3/vertical/homescreen/package/config.xml @@ -0,0 +1,21 @@ + + + homescreen + + + This is a demo application for homescreen + TOYOTA + APL 2.0 + + + + + + + + + + + + + diff --git a/demo3/vertical/homescreen/package/icon.svg b/demo3/vertical/homescreen/package/icon.svg new file mode 100644 index 0000000..91661a7 --- /dev/null +++ b/demo3/vertical/homescreen/package/icon.svg @@ -0,0 +1,279 @@ + + + +image/svg+xmlMULTIMEDIA + \ No newline at end of file diff --git a/demo3/vertical/homescreen/package/package.pro b/demo3/vertical/homescreen/package/package.pro new file mode 100644 index 0000000..09c7a01 --- /dev/null +++ b/demo3/vertical/homescreen/package/package.pro @@ -0,0 +1,22 @@ +DISTFILES = icon.svg config.xml + +copy_icon.target = $$OUT_PWD/root/icon.svg +copy_icon.depends = $$_PRO_FILE_PWD_/icon.svg +copy_icon.commands = $(COPY_FILE) \"$$replace(copy_icon.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_icon.target, /, $$QMAKE_DIR_SEP)\" +QMAKE_EXTRA_TARGETS += copy_icon +PRE_TARGETDEPS += $$copy_icon.target + +copy_config.target = $$OUT_PWD/root/config.xml +copy_config.depends = $$_PRO_FILE_PWD_/config.xml +copy_config.commands = $(COPY_FILE) \"$$replace(copy_config.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_config.target, /, $$QMAKE_DIR_SEP)\" +QMAKE_EXTRA_TARGETS += copy_config +PRE_TARGETDEPS += $$copy_config.target + +wgt.target = package +wgt.commands = wgtpkg-pack -f -o homescreen.wgt root + +QMAKE_EXTRA_TARGETS += wgt + +deploy.files = homescreen.wgt +deploy.path = /usr/AGL/apps/autoinstall +INSTALLS += deploy diff --git a/demo3/vertical/homescreen/screenshot/homescreen.png b/demo3/vertical/homescreen/screenshot/homescreen.png new file mode 100644 index 0000000..39aae15 Binary files /dev/null and b/demo3/vertical/homescreen/screenshot/homescreen.png differ -- cgit 1.2.3-korg