From ca3605ea664834acdf712e691be8f0358b1c6b6f Mon Sep 17 00:00:00 2001 From: "Bocklage, Jens" Date: Fri, 24 Jun 2016 16:19:10 +0200 Subject: [PATCH] v0.1.0 06/24/2016 - reworked status bar - reviewed D-Bus interfaces, now using signals instead of methods for day/night mode - created new home screen simulator app - license changed to Apache 2.0 - put D-Bus introspections in one central place - disabled "only one instance allowed" for development --- HomeScreen.pro | 164 +---------- HomeScreen/HomeScreen.pro | 137 +++++++++ LICENSE => HomeScreen/LICENSE | 0 HomeScreen/README.md | 61 ++++ .../resources}/controlbarwidget.ui | 6 +- {resources => HomeScreen/resources}/homescreen.qrc | 0 .../resources}/images/backgrounds/bg_blue_day.png | Bin .../images/backgrounds/bg_blue_night.png | Bin .../resources}/images/backgrounds/bg_green_day.png | Bin .../images/backgrounds/bg_green_night.png | Bin .../images/backgrounds/bg_stripes_day.png | Bin 0 -> 6509 bytes .../images/backgrounds/bg_stripes_night.png | Bin 0 -> 4601 bytes .../resources}/images/icons/Black/01.Home.png | Bin .../resources}/images/icons/Black/02.Shop.png | Bin .../resources}/images/icons/Black/03.Office.png | Bin .../resources}/images/icons/Black/04.Bank.png | Bin .../resources}/images/icons/Black/05.Tag.png | Bin .../resources}/images/icons/Black/06.Tags.png | Bin .../resources}/images/icons/Black/07.Wallet.png | Bin .../images/icons/Black/08.Credit-Card.png | Bin .../resources}/images/icons/Black/09.Handbag.png | Bin .../resources}/images/icons/Black/10.Folder.png | Bin .../resources}/images/icons/Black/11.Notebook.png | Bin .../resources}/images/icons/Black/12.File.png | Bin .../resources}/images/icons/Black/13.Clipboard.png | Bin .../resources}/images/icons/Black/14.News.png | Bin .../resources}/images/icons/Black/15.Pencil.png | Bin .../resources}/images/icons/Black/16.Pen.png | Bin .../resources}/images/icons/Black/17.Brush.png | Bin .../images/icons/Black/18.Pictures-Day.png | Bin .../images/icons/Black/19.Pictures-Night.png | Bin .../resources}/images/icons/Black/20.Photos.png | Bin .../resources}/images/icons/Black/21.Music.png | Bin .../images/icons/Black/22.Music-Playlist.png | Bin .../resources}/images/icons/Black/23.Videos.png | Bin .../resources}/images/icons/Black/24.TV.png | Bin .../images/icons/Black/25.Camera-Front.png | Bin .../images/icons/Black/26.Camera-Back.png | Bin .../resources}/images/icons/Black/27.Phone.png | Bin .../resources}/images/icons/Black/28.Tablet.png | Bin .../resources}/images/icons/Black/29.Mac.png | Bin .../resources}/images/icons/Black/30.User.png | Bin .../images/icons/Black/31.ID-Horizontal.png | Bin .../images/icons/Black/32.ID-Vertical.png | Bin .../resources}/images/icons/Black/33.Thumbs-Up.png | Bin .../images/icons/Black/34.Thumbs-Down.png | Bin .../images/icons/Black/35.Alarm-Clock.png | Bin .../resources}/images/icons/Black/36.Watch.png | Bin .../resources}/images/icons/Black/37.Stopwatch.png | Bin .../images/icons/Black/38.Location-Pin.png | Bin .../resources}/images/icons/Black/39.Heart.png | Bin .../resources}/images/icons/Black/40.Cloud.png | Bin .../resources}/images/icons/Black/41.Trophy.png | Bin .../resources}/images/icons/Black/42.Badge.png | Bin .../resources}/images/icons/Black/43.Bell.png | Bin .../resources}/images/icons/Black/44.Share.png | Bin .../resources}/images/icons/Black/45.Settings.png | Bin .../resources}/images/icons/Black/46.Calender.png | Bin .../resources}/images/icons/Black/47.Explore.png | Bin .../resources}/images/icons/Black/48.Dashboard.png | Bin .../resources}/images/icons/White/01.Home.png | Bin .../resources}/images/icons/White/02.Shop.png | Bin .../resources}/images/icons/White/03.Office.png | Bin .../resources}/images/icons/White/04.Bank.png | Bin .../resources}/images/icons/White/05.Tag.png | Bin .../resources}/images/icons/White/06.Tags.png | Bin .../resources}/images/icons/White/07.Wallet.png | Bin .../images/icons/White/08.Credit-Card.png | Bin .../resources}/images/icons/White/09.Handbag.png | Bin .../resources}/images/icons/White/10.Folder.png | Bin .../resources}/images/icons/White/11.Notebook.png | Bin .../resources}/images/icons/White/12.File.png | Bin .../resources}/images/icons/White/13.Clipboard.png | Bin .../resources}/images/icons/White/14.News.png | Bin .../resources}/images/icons/White/15.Pencil.png | Bin .../resources}/images/icons/White/16.Pen.png | Bin .../resources}/images/icons/White/17.Brush.png | Bin .../images/icons/White/18.Pictures-Day.png | Bin .../images/icons/White/19.Pictures-Night.png | Bin .../resources}/images/icons/White/20.Photos.png | Bin .../resources}/images/icons/White/21.Music.png | Bin .../images/icons/White/22.Music-Playlist.png | Bin .../resources}/images/icons/White/23.Videos.png | Bin .../resources}/images/icons/White/24.TV.png | Bin .../images/icons/White/25.Camera-Front.png | Bin .../images/icons/White/26.Camera-Back.png | Bin .../resources}/images/icons/White/27.Phone.png | Bin .../resources}/images/icons/White/28.Tablet.png | Bin .../resources}/images/icons/White/29.Mac.png | Bin .../resources}/images/icons/White/30.User.png | Bin .../images/icons/White/31.ID-Horizontal.png | Bin .../images/icons/White/32.ID-Vertical.png | Bin .../resources}/images/icons/White/33.Thumbs-Up.png | Bin .../images/icons/White/34.Thumbs-Down.png | Bin .../images/icons/White/35.Alarm-Clock.png | Bin .../resources}/images/icons/White/36.Watch.png | Bin .../resources}/images/icons/White/37.Stopwatch.png | Bin .../images/icons/White/38.Location-Pin.png | Bin .../resources}/images/icons/White/39.Heart.png | Bin .../resources}/images/icons/White/40.Cloud.png | Bin .../resources}/images/icons/White/41.Trophy.png | Bin .../resources}/images/icons/White/42.Badge.png | Bin .../resources}/images/icons/White/43.Bell.png | Bin .../resources}/images/icons/White/44.Share.png | Bin .../resources}/images/icons/White/45.Settings.png | Bin .../resources}/images/icons/White/46.Calender.png | Bin .../resources}/images/icons/White/47.Explore.png | Bin .../resources}/images/icons/White/48.Dashboard.png | Bin .../resources}/images/transparency.png | Bin HomeScreen/resources/mainwindow.ui | 59 ++++ {resources => HomeScreen/resources}/popupwidget.ui | 8 +- .../resources}/settingswidget.ui | 78 ++--- .../resources}/statusbarwidget.ui | 75 +---- .../resources/translations/homescreen_de_DE.qm | Bin 0 -> 98 bytes .../resources/translations/homescreen_de_DE.ts | 52 ++++ .../resources/translations/homescreen_en_US.qm | Bin 0 -> 100 bytes .../resources/translations/homescreen_en_US.ts | 52 ++++ .../resources/translations/homescreen_ja_JP.qm | Bin 0 -> 127 bytes .../resources/translations/homescreen_ja_JP.ts | 88 ++++++ {src => HomeScreen/src}/controlbarwidget.cpp | 38 +-- {src => HomeScreen/src}/controlbarwidget.h | 14 +- HomeScreen/src/main.cpp | 54 ++++ {src => HomeScreen/src}/mainwindow.cpp | 87 ++---- {src => HomeScreen/src}/mainwindow.h | 26 +- HomeScreen/src/popupwidget.cpp | 103 +++++++ {src => HomeScreen/src}/popupwidget.h | 13 +- {src => HomeScreen/src}/settingswidget.cpp | 18 +- {src => HomeScreen/src}/settingswidget.h | 15 +- HomeScreen/src/statusbarwidget.cpp | 205 ++++++++++++++ {src => HomeScreen/src}/statusbarwidget.h | 26 +- HomeScreenSimulator/HomeScreenSimulator.pro | 122 ++++++++ HomeScreenSimulator/LICENSE | 54 ++++ HomeScreenSimulator/README.md | 20 ++ HomeScreenSimulator/resources/mainwindow.ui | 315 +++++++++++++++++++++ {src => HomeScreenSimulator/src}/main.cpp | 26 +- HomeScreenSimulator/src/mainwindow.cpp | 146 ++++++++++ .../src/mainwindow.h | 44 ++- README.md | 48 +--- SampleAppTimeDate/LICENSE | 54 ++++ SampleAppTimeDate/README.md | 12 + SampleAppTimeDate/SampleAppTimeDate.pro | 45 +++ SampleAppTimeDate/src/main.cpp | 12 + SampleAppTimeDate/src/timedateprovider.cpp | 77 +++++ SampleAppTimeDate/src/timedateprovider.h | 27 ++ dbus-introspections/inputevent.xml | 23 -- dbus-introspections/statusbar.xml | 22 -- include/inputevent.h | 36 --- {include => interfaces}/daynightmode.h | 0 .../daynightmode.xml | 9 +- {include => interfaces}/popup.h | 0 {dbus-introspections => interfaces}/popup.xml | 0 interfaces/statusbar.xml | 38 +++ resources/images/backgrounds/bg_stripes_day.png | Bin 7228 -> 0 bytes resources/images/backgrounds/bg_stripes_night.png | Bin 1757 -> 0 bytes resources/inputdevicesimulator.ui | 163 ----------- resources/mainwindow.ui | 187 ------------ resources/systemsettingssimulator.ui | 83 ------ resources/translations/homescreen_de_DE.qm | Bin 168 -> 0 bytes resources/translations/homescreen_de_DE.ts | 90 ------ resources/translations/homescreen_en_US.qm | Bin 164 -> 0 bytes resources/translations/homescreen_en_US.ts | 90 ------ resources/translations/homescreen_ja_JP.qm | Bin 819 -> 0 bytes resources/translations/homescreen_ja_JP.ts | 86 ------ src/inputdevicesimulator.cpp | 56 ---- src/inputdevicesimulator.h | 44 --- src/inputeventdistributor.cpp | 50 ---- src/inputeventdistributor.h | 41 --- src/popupwidget.cpp | 49 ---- src/statusbarwidget.cpp | 118 -------- src/systemsettingssimulator.cpp | 74 ----- 170 files changed, 1919 insertions(+), 1721 deletions(-) create mode 100644 HomeScreen/HomeScreen.pro rename LICENSE => HomeScreen/LICENSE (100%) create mode 100644 HomeScreen/README.md rename {resources => HomeScreen/resources}/controlbarwidget.ui (97%) rename {resources => HomeScreen/resources}/homescreen.qrc (100%) rename {resources => HomeScreen/resources}/images/backgrounds/bg_blue_day.png (100%) rename {resources => HomeScreen/resources}/images/backgrounds/bg_blue_night.png (100%) rename {resources => HomeScreen/resources}/images/backgrounds/bg_green_day.png (100%) rename {resources => HomeScreen/resources}/images/backgrounds/bg_green_night.png (100%) create mode 100755 HomeScreen/resources/images/backgrounds/bg_stripes_day.png create mode 100755 HomeScreen/resources/images/backgrounds/bg_stripes_night.png rename {resources => HomeScreen/resources}/images/icons/Black/01.Home.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/02.Shop.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/03.Office.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/04.Bank.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/05.Tag.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/06.Tags.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/07.Wallet.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/08.Credit-Card.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/09.Handbag.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/10.Folder.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/11.Notebook.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/12.File.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/13.Clipboard.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/14.News.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/15.Pencil.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/16.Pen.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/17.Brush.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/18.Pictures-Day.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/19.Pictures-Night.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/20.Photos.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/21.Music.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/22.Music-Playlist.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/23.Videos.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/24.TV.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/25.Camera-Front.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/26.Camera-Back.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/27.Phone.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/28.Tablet.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/29.Mac.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/30.User.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/31.ID-Horizontal.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/32.ID-Vertical.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/33.Thumbs-Up.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/34.Thumbs-Down.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/35.Alarm-Clock.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/36.Watch.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/37.Stopwatch.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/38.Location-Pin.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/39.Heart.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/40.Cloud.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/41.Trophy.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/42.Badge.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/43.Bell.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/44.Share.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/45.Settings.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/46.Calender.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/47.Explore.png (100%) rename {resources => HomeScreen/resources}/images/icons/Black/48.Dashboard.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/01.Home.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/02.Shop.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/03.Office.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/04.Bank.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/05.Tag.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/06.Tags.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/07.Wallet.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/08.Credit-Card.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/09.Handbag.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/10.Folder.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/11.Notebook.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/12.File.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/13.Clipboard.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/14.News.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/15.Pencil.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/16.Pen.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/17.Brush.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/18.Pictures-Day.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/19.Pictures-Night.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/20.Photos.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/21.Music.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/22.Music-Playlist.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/23.Videos.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/24.TV.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/25.Camera-Front.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/26.Camera-Back.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/27.Phone.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/28.Tablet.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/29.Mac.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/30.User.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/31.ID-Horizontal.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/32.ID-Vertical.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/33.Thumbs-Up.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/34.Thumbs-Down.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/35.Alarm-Clock.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/36.Watch.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/37.Stopwatch.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/38.Location-Pin.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/39.Heart.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/40.Cloud.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/41.Trophy.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/42.Badge.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/43.Bell.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/44.Share.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/45.Settings.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/46.Calender.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/47.Explore.png (100%) rename {resources => HomeScreen/resources}/images/icons/White/48.Dashboard.png (100%) rename {resources => HomeScreen/resources}/images/transparency.png (100%) create mode 100644 HomeScreen/resources/mainwindow.ui rename {resources => HomeScreen/resources}/popupwidget.ui (96%) rename {resources => HomeScreen/resources}/settingswidget.ui (59%) rename {resources => HomeScreen/resources}/statusbarwidget.ui (68%) create mode 100644 HomeScreen/resources/translations/homescreen_de_DE.qm create mode 100644 HomeScreen/resources/translations/homescreen_de_DE.ts create mode 100644 HomeScreen/resources/translations/homescreen_en_US.qm create mode 100644 HomeScreen/resources/translations/homescreen_en_US.ts create mode 100644 HomeScreen/resources/translations/homescreen_ja_JP.qm create mode 100644 HomeScreen/resources/translations/homescreen_ja_JP.ts rename {src => HomeScreen/src}/controlbarwidget.cpp (68%) rename {src => HomeScreen/src}/controlbarwidget.h (83%) create mode 100644 HomeScreen/src/main.cpp rename {src => HomeScreen/src}/mainwindow.cpp (51%) rename {src => HomeScreen/src}/mainwindow.h (72%) create mode 100644 HomeScreen/src/popupwidget.cpp rename {src => HomeScreen/src}/popupwidget.h (78%) rename {src => HomeScreen/src}/settingswidget.cpp (88%) rename {src => HomeScreen/src}/settingswidget.h (82%) create mode 100644 HomeScreen/src/statusbarwidget.cpp rename {src => HomeScreen/src}/statusbarwidget.h (69%) create mode 100644 HomeScreenSimulator/HomeScreenSimulator.pro create mode 100644 HomeScreenSimulator/LICENSE create mode 100644 HomeScreenSimulator/README.md create mode 100644 HomeScreenSimulator/resources/mainwindow.ui rename {src => HomeScreenSimulator/src}/main.cpp (70%) create mode 100644 HomeScreenSimulator/src/mainwindow.cpp rename src/systemsettingssimulator.h => HomeScreenSimulator/src/mainwindow.h (52%) create mode 100644 SampleAppTimeDate/LICENSE create mode 100644 SampleAppTimeDate/README.md create mode 100644 SampleAppTimeDate/SampleAppTimeDate.pro create mode 100644 SampleAppTimeDate/src/main.cpp create mode 100644 SampleAppTimeDate/src/timedateprovider.cpp create mode 100644 SampleAppTimeDate/src/timedateprovider.h delete mode 100644 dbus-introspections/inputevent.xml delete mode 100644 dbus-introspections/statusbar.xml delete mode 100644 include/inputevent.h rename {include => interfaces}/daynightmode.h (100%) rename {dbus-introspections => interfaces}/daynightmode.xml (81%) rename {include => interfaces}/popup.h (100%) rename {dbus-introspections => interfaces}/popup.xml (100%) create mode 100644 interfaces/statusbar.xml delete mode 100755 resources/images/backgrounds/bg_stripes_day.png delete mode 100755 resources/images/backgrounds/bg_stripes_night.png delete mode 100644 resources/inputdevicesimulator.ui delete mode 100644 resources/mainwindow.ui delete mode 100644 resources/systemsettingssimulator.ui delete mode 100644 resources/translations/homescreen_de_DE.qm delete mode 100644 resources/translations/homescreen_de_DE.ts delete mode 100644 resources/translations/homescreen_en_US.qm delete mode 100644 resources/translations/homescreen_en_US.ts delete mode 100644 resources/translations/homescreen_ja_JP.qm delete mode 100644 resources/translations/homescreen_ja_JP.ts delete mode 100644 src/inputdevicesimulator.cpp delete mode 100644 src/inputdevicesimulator.h delete mode 100644 src/inputeventdistributor.cpp delete mode 100644 src/inputeventdistributor.h delete mode 100644 src/popupwidget.cpp delete mode 100644 src/statusbarwidget.cpp delete mode 100644 src/systemsettingssimulator.cpp diff --git a/HomeScreen.pro b/HomeScreen.pro index 3a80fab..00d5a7f 100644 --- a/HomeScreen.pro +++ b/HomeScreen.pro @@ -1,162 +1,6 @@ -# Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +TEMPLATE = subdirs -#TODO: compile switches for ARM/x86 architecture - -QT += core gui dbus - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -TARGET = HomeScreen -TEMPLATE = app - - -SOURCES += \ - src/main.cpp \ - src/mainwindow.cpp \ - src/inputdevicesimulator.cpp \ - src/systemsettingssimulator.cpp \ - $$OUT_PWD/daynightmode_adapter.cpp \ #generated dbus adapter - $$OUT_PWD/daynightmode_proxy.cpp \ #generated dbus proxy - $$OUT_PWD/popup_adapter.cpp \ #generated dbus adapter - $$OUT_PWD/popup_proxy.cpp \ #generated dbus proxy - $$OUT_PWD/inputevent_adapter.cpp \ #generated dbus adapter - $$OUT_PWD/inputevent_proxy.cpp \ #generated dbus proxy - $$OUT_PWD/statusbar_adapter.cpp \ #generated dbus adapter - $$OUT_PWD/statusbar_proxy.cpp \ #generated dbus proxy - src/settingswidget.cpp \ - src/popupwidget.cpp \ - src/inputeventdistributor.cpp \ - src/controlbarwidget.cpp \ - src/statusbarwidget.cpp - -HEADERS += \ - include/daynightmode.h \ - include/inputevent.h \ - include/popup.h \ - src/mainwindow.h \ - src/inputdevicesimulator.h \ - src/systemsettingssimulator.h \ - $$OUT_PWD/daynightmode_adapter.h \ #generated dbus adapter - $$OUT_PWD/daynightmode_proxy.h \ #generated dbus proxy - $$OUT_PWD/popup_adapter.h \ #generated dbus adapter - $$OUT_PWD/popup_proxy.h \ #generated dbus proxy - $$OUT_PWD/inputevent_adapter.h \ #generated dbus adapter - $$OUT_PWD/inputevent_proxy.h \ #generated dbus proxy - $$OUT_PWD/statusbar_adapter.h \ #generated dbus adapter - $$OUT_PWD/statusbar_proxy.h \ #generated dbus proxy - src/settingswidget.h \ - src/popupwidget.h \ - src/inputeventdistributor.h \ - src/controlbarwidget.h \ - src/statusbarwidget.h - -FORMS += \ - resources/mainwindow.ui \ - resources/inputdevicesimulator.ui \ - resources/systemsettingssimulator.ui \ - resources/settingswidget.ui \ - resources/popupwidget.ui \ - resources/controlbarwidget.ui \ - resources/statusbarwidget.ui - -TRANSLATIONS = \ - resources/translations/homescreen_en_US.ts \ - resources/translations/homescreen_de_DE.ts \ - resources/translations/homescreen_ja_JP.ts - -OTHER_FILES += \ - dbus-introspections/daynightmode.xml \ - dbus-introspections/inputevent.xml \ - dbus-introspections/popup.xml \ - dbus-introspections/statusbar.xml - -RESOURCES += \ - resources/homescreen.qrc - -# remove generated files -QMAKE_CLEAN += -r \ - $$OUT_PWD/HomeScreen \ - $$OUT_PWD/Makefile \ - $$OUT_PWD/daynightmode_adapter.h \ - $$OUT_PWD/daynightmode_adapter.cpp \ - $$OUT_PWD/daynightmode_adapter.moc \ - $$OUT_PWD/daynightmode_proxy.h \ - $$OUT_PWD/daynightmode_proxy.cpp \ - $$OUT_PWD/daynightmode_proxy.moc \ - $$OUT_PWD/popup_adapter.h \ - $$OUT_PWD/popup_adapter.cpp \ - $$OUT_PWD/popup_adapter.moc \ - $$OUT_PWD/popup_proxy.h \ - $$OUT_PWD/popup_proxy.cpp \ - $$OUT_PWD/popup_proxy.moc \ - $$OUT_PWD/inputevent_adapter.h \ - $$OUT_PWD/inputevent_adapter.cpp \ - $$OUT_PWD/inputevent_adapter.moc \ - $$OUT_PWD/inputevent_proxy.h \ - $$OUT_PWD/inputevent_proxy.cpp \ - $$OUT_PWD/inputevent_proxy.moc \ - $$OUT_PWD/statusbar_adapter.h \ - $$OUT_PWD/statusbar_adapter.cpp \ - $$OUT_PWD/statusbar_adapter.moc \ - $$OUT_PWD/statusbar_proxy.h \ - $$OUT_PWD/statusbar_proxy.cpp \ - $$OUT_PWD/statusbar_proxy.moc - -# Create custom targets for generating dbus proxy and adapter -# for daynightmode -daynightmodegenerateadapter.target = $$OUT_PWD/daynightmode_adapter.cpp -unix:daynightmodegenerateadapter.commands = "qdbusxml2cpp -m -a daynightmode_adapter $$_PRO_FILE_PWD_/dbus-introspections/daynightmode.xml; moc $$OUT_PWD/daynightmode_adapter.h -o $$OUT_PWD/daynightmode_adapter.moc" -daynightmodegenerateproxy.target = $$OUT_PWD/daynightmode_proxy.cpp -unix:daynightmodegenerateproxy.commands = "qdbusxml2cpp -m -p daynightmode_proxy $$_PRO_FILE_PWD_/dbus-introspections/daynightmode.xml; moc $$OUT_PWD/daynightmode_proxy.h -o $$OUT_PWD/daynightmode_proxy.moc" -PRE_TARGETDEPS += \ - $$OUT_PWD/daynightmode_adapter.cpp \ - $$OUT_PWD/daynightmode_proxy.cpp -QMAKE_EXTRA_TARGETS += \ - daynightmodegenerateadapter \ - daynightmodegenerateproxy -# for popup -popupgenerateadapter.target = $$OUT_PWD/popup_adapter.cpp -unix:popupgenerateadapter.commands = "qdbusxml2cpp -m -a popup_adapter $$_PRO_FILE_PWD_/dbus-introspections/popup.xml; moc $$OUT_PWD/popup_adapter.h -o $$OUT_PWD/popup_adapter.moc" -popupgenerateproxy.target = $$OUT_PWD/popup_proxy.cpp -unix:popupgenerateproxy.commands = "qdbusxml2cpp -m -p popup_proxy $$_PRO_FILE_PWD_/dbus-introspections/popup.xml; moc $$OUT_PWD/popup_proxy.h -o $$OUT_PWD/popup_proxy.moc" -PRE_TARGETDEPS += \ - $$OUT_PWD/popup_adapter.cpp \ - $$OUT_PWD/popup_proxy.cpp -QMAKE_EXTRA_TARGETS += \ - popupgenerateadapter \ - popupgenerateproxy -# for inputevent -inputeventgenerateadapter.target = $$OUT_PWD/inputevent_adapter.cpp -unix:inputeventgenerateadapter.commands = "qdbusxml2cpp -m -a inputevent_adapter $$_PRO_FILE_PWD_/dbus-introspections/inputevent.xml; moc $$OUT_PWD/inputevent_adapter.h -o $$OUT_PWD/inputevent_adapter.moc" -inputeventgenerateproxy.target = $$OUT_PWD/inputevent_proxy.cpp -unix:inputeventgenerateproxy.commands = "qdbusxml2cpp -m -p inputevent_proxy $$_PRO_FILE_PWD_/dbus-introspections/inputevent.xml; moc $$OUT_PWD/inputevent_proxy.h -o $$OUT_PWD/inputevent_proxy.moc" -PRE_TARGETDEPS += \ - $$OUT_PWD/inputevent_adapter.cpp \ - $$OUT_PWD/inputevent_proxy.cpp -QMAKE_EXTRA_TARGETS += \ - inputeventgenerateadapter \ - inputeventgenerateproxy -# for statusbar -statusbargenerateadapter.target = $$OUT_PWD/statusbar_adapter.cpp -unix:statusbargenerateadapter.commands = "qdbusxml2cpp -m -a statusbar_adapter $$_PRO_FILE_PWD_/dbus-introspections/statusbar.xml; moc $$OUT_PWD/statusbar_adapter.h -o $$OUT_PWD/statusbar_adapter.moc" -statusbargenerateproxy.target = $$OUT_PWD/statusbar_proxy.cpp -unix:statusbargenerateproxy.commands = "qdbusxml2cpp -m -p statusbar_proxy $$_PRO_FILE_PWD_/dbus-introspections/statusbar.xml; moc $$OUT_PWD/statusbar_proxy.h -o $$OUT_PWD/statusbar_proxy.moc" -PRE_TARGETDEPS += \ - $$OUT_PWD/statusbar_adapter.cpp \ - $$OUT_PWD/statusbar_proxy.cpp -QMAKE_EXTRA_TARGETS += \ - statusbargenerateadapter \ - statusbargenerateproxy +SUBDIRS = HomeScreen \ + HomeScreenSimulator \ + SampleAppTimeDate diff --git a/HomeScreen/HomeScreen.pro b/HomeScreen/HomeScreen.pro new file mode 100644 index 0000000..01e5ace --- /dev/null +++ b/HomeScreen/HomeScreen.pro @@ -0,0 +1,137 @@ +# Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#TODO: compile switches for ARM/x86 architecture + +QT += core gui dbus + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = HomeScreen +TEMPLATE = app + + +SOURCES += \ + src/main.cpp \ + src/mainwindow.cpp \ + $$OUT_PWD/daynightmode_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/daynightmode_proxy.cpp \ #generated dbus proxy + $$OUT_PWD/popup_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/popup_proxy.cpp \ #generated dbus proxy + $$OUT_PWD/statusbar_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/statusbar_proxy.cpp \ #generated dbus proxy + src/settingswidget.cpp \ + src/popupwidget.cpp \ + src/controlbarwidget.cpp \ + src/statusbarwidget.cpp + +HEADERS += \ + ../interfaces/daynightmode.h \ + ../interfaces/popup.h \ + src/mainwindow.h \ + $$OUT_PWD/daynightmode_adapter.h \ #generated dbus adapter + $$OUT_PWD/daynightmode_proxy.h \ #generated dbus proxy + $$OUT_PWD/popup_adapter.h \ #generated dbus adapter + $$OUT_PWD/popup_proxy.h \ #generated dbus proxy + $$OUT_PWD/statusbar_adapter.h \ #generated dbus adapter + $$OUT_PWD/statusbar_proxy.h \ #generated dbus proxy + src/settingswidget.h \ + src/popupwidget.h \ + src/controlbarwidget.h \ + src/statusbarwidget.h + +FORMS += \ + resources/mainwindow.ui \ + resources/settingswidget.ui \ + resources/popupwidget.ui \ + resources/controlbarwidget.ui \ + resources/statusbarwidget.ui + +TRANSLATIONS = \ + resources/translations/homescreen_en_US.ts \ + resources/translations/homescreen_de_DE.ts \ + resources/translations/homescreen_ja_JP.ts + +OTHER_FILES += \ + ../interfaces/daynightmode.xml \ + ../interfaces/inputevent.xml \ + ../interfaces/popup.xml \ + ../interfaces/statusbar.xml \ + README.md + +RESOURCES += \ + resources/homescreen.qrc + +# remove generated files +QMAKE_CLEAN += -r \ + $$OUT_PWD/HomeScreen \ + $$OUT_PWD/Makefile \ + $$OUT_PWD/daynightmode_adapter.h \ + $$OUT_PWD/daynightmode_adapter.cpp \ + $$OUT_PWD/daynightmode_adapter.moc \ + $$OUT_PWD/daynightmode_proxy.h \ + $$OUT_PWD/daynightmode_proxy.cpp \ + $$OUT_PWD/daynightmode_proxy.moc \ + $$OUT_PWD/popup_adapter.h \ + $$OUT_PWD/popup_adapter.cpp \ + $$OUT_PWD/popup_adapter.moc \ + $$OUT_PWD/popup_proxy.h \ + $$OUT_PWD/popup_proxy.cpp \ + $$OUT_PWD/popup_proxy.moc \ + $$OUT_PWD/statusbar_adapter.h \ + $$OUT_PWD/statusbar_adapter.cpp \ + $$OUT_PWD/statusbar_adapter.moc \ + $$OUT_PWD/statusbar_proxy.h \ + $$OUT_PWD/statusbar_proxy.cpp \ + $$OUT_PWD/statusbar_proxy.moc + +# Create custom targets for generating dbus proxy and adapter +# OE_QMAKE_PATH_EXTERNAL_HOST_BINS is only defined in the yocto environment +isEmpty(OE_QMAKE_PATH_EXTERNAL_HOST_BINS){ + OE_QMAKE_PATH_EXTERNAL_HOST_BINS = "/" +} +# for daynightmode +daynightmodegenerateadapter.target = $$OUT_PWD/daynightmode_adapter.cpp +unix:daynightmodegenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a daynightmode_adapter $$_PRO_FILE_PWD_/../interfaces/daynightmode.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/daynightmode_adapter.h -o $$OUT_PWD/daynightmode_adapter.moc" +daynightmodegenerateproxy.target = $$OUT_PWD/daynightmode_proxy.cpp +unix:daynightmodegenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p daynightmode_proxy $$_PRO_FILE_PWD_/../interfaces/daynightmode.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/daynightmode_proxy.h -o $$OUT_PWD/daynightmode_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/daynightmode_adapter.cpp \ + $$OUT_PWD/daynightmode_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + daynightmodegenerateadapter \ + daynightmodegenerateproxy +# for popup +popupgenerateadapter.target = $$OUT_PWD/popup_adapter.cpp +unix:popupgenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a popup_adapter $$_PRO_FILE_PWD_/../interfaces/popup.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/popup_adapter.h -o $$OUT_PWD/popup_adapter.moc" +popupgenerateproxy.target = $$OUT_PWD/popup_proxy.cpp +unix:popupgenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p popup_proxy $$_PRO_FILE_PWD_/../interfaces/popup.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/popup_proxy.h -o $$OUT_PWD/popup_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/popup_adapter.cpp \ + $$OUT_PWD/popup_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + popupgenerateadapter \ + popupgenerateproxy +# for statusbar +statusbargenerateadapter.target = $$OUT_PWD/statusbar_adapter.cpp +unix:statusbargenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a statusbar_adapter $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/statusbar_adapter.h -o $$OUT_PWD/statusbar_adapter.moc" +statusbargenerateproxy.target = $$OUT_PWD/statusbar_proxy.cpp +unix:statusbargenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p statusbar_proxy $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/statusbar_proxy.h -o $$OUT_PWD/statusbar_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/statusbar_adapter.cpp \ + $$OUT_PWD/statusbar_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + statusbargenerateadapter \ + statusbargenerateproxy + diff --git a/LICENSE b/HomeScreen/LICENSE similarity index 100% rename from LICENSE rename to HomeScreen/LICENSE diff --git a/HomeScreen/README.md b/HomeScreen/README.md new file mode 100644 index 0000000..b896bfa --- /dev/null +++ b/HomeScreen/README.md @@ -0,0 +1,61 @@ +AGL Home Screen reference implementation + + +AGL repo for source code: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen + + +v0.1.0 +06/24/2016 + +#changes +- reworked status bar +- reviewed D-Bus interfaces, now using signals instead of methods for day/night mode +- created new home screen simulator app +- license changed to Apache 2.0 +- put D-Bus introspections in one central place +- disabled "only one instance allowed" for development + +v0.0.2 +06/13/2016 + +#changes +- created layout 1. Changed home screen app size to 1080x1920 + +v0.0.1 +06/01/2016 + +#new features +- initial version +- first implementation of home screen +- fix HMI layout (will be configurable in the future) +- dBus as IPC (may change in the future) +- no interaction with application manager so far +- multi-lanuage support +- day/night mode support +- initial status bar implementation (interface will be enhanced in the future) +- initial control bar implementation +- MPLv2.0 license +- input device simulator for developer build (not functional right now) +- system settings simulator for developer build (day/night mode switch functional right now) +- using QSettings for local app setting storage (may change in the future) +- first popup implementation (single popup support for now; multiple popup not defined; interface will change) +- only one instance of the app allowed + +#TODOs +- define and implement control bar D-Bus-interface +- many settings have to be read from the system somewhere during app startup. This is not available right now +- interaction with application manager +- interaction with wayland compositor +- define and implement input device event handler +- replace my HMI design with the official AGL design (graphics/icons...) +- implement example HMI layouts +- fix font issues on target +- more documentation ;) +- add animations +- much more... + +Thanks to Umar Irshad for his free iconset available here: +https://dribbble.com/shots/1569128-Freebie-48-Bubbles-Iconset + + diff --git a/resources/controlbarwidget.ui b/HomeScreen/resources/controlbarwidget.ui similarity index 97% rename from resources/controlbarwidget.ui rename to HomeScreen/resources/controlbarwidget.ui index bcbe95c..9696a49 100644 --- a/resources/controlbarwidget.ui +++ b/HomeScreen/resources/controlbarwidget.ui @@ -6,7 +6,7 @@ 0 0 - 800 + 1080 60 @@ -18,7 +18,7 @@ 0 0 - 800 + 1080 60 @@ -58,7 +58,7 @@ border-image: url(:/images/transparency.png); - 380 + 60 10 40 40 diff --git a/resources/homescreen.qrc b/HomeScreen/resources/homescreen.qrc similarity index 100% rename from resources/homescreen.qrc rename to HomeScreen/resources/homescreen.qrc diff --git a/resources/images/backgrounds/bg_blue_day.png b/HomeScreen/resources/images/backgrounds/bg_blue_day.png similarity index 100% rename from resources/images/backgrounds/bg_blue_day.png rename to HomeScreen/resources/images/backgrounds/bg_blue_day.png diff --git a/resources/images/backgrounds/bg_blue_night.png b/HomeScreen/resources/images/backgrounds/bg_blue_night.png similarity index 100% rename from resources/images/backgrounds/bg_blue_night.png rename to HomeScreen/resources/images/backgrounds/bg_blue_night.png diff --git a/resources/images/backgrounds/bg_green_day.png b/HomeScreen/resources/images/backgrounds/bg_green_day.png similarity index 100% rename from resources/images/backgrounds/bg_green_day.png rename to HomeScreen/resources/images/backgrounds/bg_green_day.png diff --git a/resources/images/backgrounds/bg_green_night.png b/HomeScreen/resources/images/backgrounds/bg_green_night.png similarity index 100% rename from resources/images/backgrounds/bg_green_night.png rename to HomeScreen/resources/images/backgrounds/bg_green_night.png diff --git a/HomeScreen/resources/images/backgrounds/bg_stripes_day.png b/HomeScreen/resources/images/backgrounds/bg_stripes_day.png new file mode 100755 index 0000000000000000000000000000000000000000..e2fdadda4e520bf2665e2a105f3332003bba87b2 GIT binary patch literal 6509 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 + + MainWindow + + + + 0 + 0 + 1080 + 1920 + + + + Qt::NoFocus + + + + + + + + + + + + 0 + 60 + 1080 + 1800 + + + + Qt::NoFocus + + + background-image: url(:/images/backgrounds/bg_blue_day.png) + + + + + + -40 + 1640 + 200 + 200 + + + + border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch; + + + + + + + + + + diff --git a/resources/popupwidget.ui b/HomeScreen/resources/popupwidget.ui similarity index 96% rename from resources/popupwidget.ui rename to HomeScreen/resources/popupwidget.ui index ac43e09..5bda98b 100644 --- a/resources/popupwidget.ui +++ b/HomeScreen/resources/popupwidget.ui @@ -9,8 +9,8 @@ 0 0 - 800 - 600 + 1080 + 1920 @@ -19,8 +19,8 @@ - 200 - 200 + 350 + 430 400 200 diff --git a/resources/settingswidget.ui b/HomeScreen/resources/settingswidget.ui similarity index 59% rename from resources/settingswidget.ui rename to HomeScreen/resources/settingswidget.ui index 2f33087..2ec5076 100644 --- a/resources/settingswidget.ui +++ b/HomeScreen/resources/settingswidget.ui @@ -6,8 +6,8 @@ 0 0 - 800 - 480 + 1080 + 1800 @@ -18,34 +18,33 @@ 0 0 - 800 - 480 + 1080 + 1800 background-image: url(:/images/backgrounds/bg_blue_day.png); - - - - - 390 - 20 - 400 - 60 - - - - - 22 - - - - Qt::NoFocus - - - QComboBox { + + + + 660 + 20 + 400 + 60 + + + + + 22 + + + + Qt::NoFocus + + + QComboBox { border: 1px solid #D3D3D3; border-radius: 8px; background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(242, 242, 249, 255), stop:1 rgba(255, 255, 255, 255)); @@ -62,7 +61,22 @@ border-radius: 0px; QComboBox::down-arrow:on { } - + + + + + + -40 + 1640 + 200 + 200 + + + + border-image: url(:/icons/settings_day.png) 0 0 0 0 stretch stretch; + + + @@ -82,20 +96,6 @@ QComboBox::down-arrow:on { Language - - - - -40 - 320 - 200 - 200 - - - - border-image: url(:/icons/settings_day.png) 0 0 0 0 stretch stretch; - - - diff --git a/resources/statusbarwidget.ui b/HomeScreen/resources/statusbarwidget.ui similarity index 68% rename from resources/statusbarwidget.ui rename to HomeScreen/resources/statusbarwidget.ui index 1a9ff41..d0747ab 100644 --- a/resources/statusbarwidget.ui +++ b/HomeScreen/resources/statusbarwidget.ui @@ -6,22 +6,19 @@ 0 0 - 800 + 1080 60 - - - 0 0 - 800 + 1080 60 @@ -33,7 +30,7 @@ 20 10 - 100 + 200 40 @@ -55,9 +52,9 @@ background-image: url(:/images/transparency.png); - 130 + 230 10 - 100 + 200 40 @@ -79,9 +76,9 @@ background-image: url(:/images/transparency.png); - 240 + 440 10 - 100 + 200 40 @@ -100,12 +97,12 @@ background-image: url(:/images/transparency.png); Qt::AlignCenter - + - 350 + 650 10 - 100 + 200 40 @@ -127,57 +124,9 @@ background-image: url(:/images/transparency.png); - 460 - 10 - 100 - 40 - - - - - 12 - 75 - true - - - - color: rgb(238, 238, 238); -background-image: url(:/images/transparency.png); - - - Qt::AlignCenter - - - - - - 570 - 10 - 100 - 40 - - - - - 12 - 75 - true - - - - color: rgb(238, 238, 238); -background-image: url(:/images/transparency.png); - - - Qt::AlignCenter - - - - - - 680 + 860 10 - 100 + 200 40 diff --git a/HomeScreen/resources/translations/homescreen_de_DE.qm b/HomeScreen/resources/translations/homescreen_de_DE.qm new file mode 100644 index 0000000000000000000000000000000000000000..bf2aa8c063d69535e0366ca530df8826f002dbc6 GIT binary patch literal 98 zcmcE7ks@*G{hX<16=n7(EZlq7iGhKEgTrsrS0K%h3B;DnK!T4Un4y57h#`?7nIVHA rl>;Qn2E-gbiFxUziRr2AAVtBcB_)}8>BZrhDe0*tj2%ERCPqd8LNyo= literal 0 HcmV?d00001 diff --git a/HomeScreen/resources/translations/homescreen_de_DE.ts b/HomeScreen/resources/translations/homescreen_de_DE.ts new file mode 100644 index 0000000..d512aaf --- /dev/null +++ b/HomeScreen/resources/translations/homescreen_de_DE.ts @@ -0,0 +1,52 @@ + + + + + ControlBarWidget + + + Form + + + + + MainWindow + + Exit + Beenden + + + + PopupWidget + + + Form + + + + + OK + + + + + SettingsWidget + + + Form + + + + + Language + Sprache + + + + SystemSettingsSimulator + + Exit + Beenden + + + diff --git a/HomeScreen/resources/translations/homescreen_en_US.qm b/HomeScreen/resources/translations/homescreen_en_US.qm new file mode 100644 index 0000000000000000000000000000000000000000..ce75d11f77073b114bd9d595e6c912d3429ea8b3 GIT binary patch literal 100 zcmcE7ks@*G{hX<16=n7(EZlq7iGhKEgTrsrS0K%h3B=aSKth1Qhar(6k0G6*6iBBt tq;i0y*?^eCCowO*G%-Du9mwGePAw_P%u6p0&rC^AEn(~ciZL-V0swGd7;*pr literal 0 HcmV?d00001 diff --git a/HomeScreen/resources/translations/homescreen_en_US.ts b/HomeScreen/resources/translations/homescreen_en_US.ts new file mode 100644 index 0000000..07199a4 --- /dev/null +++ b/HomeScreen/resources/translations/homescreen_en_US.ts @@ -0,0 +1,52 @@ + + + + + ControlBarWidget + + + Form + + + + + MainWindow + + Exit + Exit + + + + PopupWidget + + + Form + + + + + OK + + + + + SettingsWidget + + + Form + + + + + Language + Language + + + + SystemSettingsSimulator + + Exit + Exit + + + diff --git a/HomeScreen/resources/translations/homescreen_ja_JP.qm b/HomeScreen/resources/translations/homescreen_ja_JP.qm new file mode 100644 index 0000000000000000000000000000000000000000..8e662d85ee85869ea8d2bd1b76f8df8032143112 GIT binary patch literal 127 zcmcE7ks@*G{hX<16=n7(EZlq7iGhJZfPsP48b~v6_-* + + + + ControlBarWidget + + + Form + + + + + InputDeviceSimulator + + Input Device Simulator + 入力デバイスシミュレータ + + + Up + アップ + + + Left + 左 + + + Right + 右 + + + Down + ダウン + + + OK + OK + + + + PopupWidget + + + Form + + + + + OK + OK + + + + SettingsWidget + + + Form + + + + + Language + 言語 + + + + SystemSettingsSimulator + + System Settings + システム設定 + + + Exit + 出口 + + + Day/Night Mode + 昼/夜モード + + + Night Mode + ナイトモード + + + Day Mode + デイモード + + + diff --git a/src/controlbarwidget.cpp b/HomeScreen/src/controlbarwidget.cpp similarity index 68% rename from src/controlbarwidget.cpp rename to HomeScreen/src/controlbarwidget.cpp index 4627a7b..e01fe26 100644 --- a/src/controlbarwidget.cpp +++ b/HomeScreen/src/controlbarwidget.cpp @@ -21,34 +21,30 @@ ControlBarWidget::ControlBarWidget(QWidget *parent) : QWidget(parent), mp_ui(new Ui::ControlBarWidget), mp_settingsWidget(0), - mp_dBusDayNightMode_SettingsWidget(0), m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system - mp_daynightmodeAdaptor(0) + mp_dayNightModeProxy(0) { - // publish dbus day night mode interface - mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this); - QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/ControlBarWidget", this); - dbus.registerService("org.agl.mainwindow"); + // this has to be adopted to the system setup + mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider" + "/", + QDBusConnection::sessionBus(), + 0); + QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int))); mp_ui->setupUi(this); } ControlBarWidget::~ControlBarWidget() { - delete mp_daynightmodeAdaptor; + delete mp_dayNightModeProxy; if (0 != mp_settingsWidget) { delete mp_settingsWidget; } - if (0 == mp_dBusDayNightMode_SettingsWidget) - { - delete mp_dBusDayNightMode_SettingsWidget; - } delete mp_ui; } -void ControlBarWidget::setDayNightMode(int mode) +void ControlBarWidget::dayNightModeSlot(int mode) { QIcon icon; switch (mode) @@ -74,12 +70,6 @@ void ControlBarWidget::setDayNightMode(int mode) default: m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; } - - // settings widget if present - if (0 != mp_dBusDayNightMode_SettingsWidget) - { - mp_dBusDayNightMode_SettingsWidget->setDayNightMode(m_dayNightMode); - } } void ControlBarWidget::on_pushButton_Settings_clicked() @@ -91,16 +81,6 @@ void ControlBarWidget::on_pushButton_Settings_clicked() mp_settingsWidget->move(0, 60); mp_settingsWidget->show(); - - if (0 == mp_dBusDayNightMode_SettingsWidget) - { - // connect to the dBus interface provided by the settings widget - mp_dBusDayNightMode_SettingsWidget = new org::agl::daynightmode("org.agl.mainwindow", - "/SettingsWidget", - QDBusConnection::sessionBus(), - 0); - mp_dBusDayNightMode_SettingsWidget->setDayNightMode(m_dayNightMode); - } } void ControlBarWidget::on_pushButton_Home_clicked() diff --git a/src/controlbarwidget.h b/HomeScreen/src/controlbarwidget.h similarity index 83% rename from src/controlbarwidget.h rename to HomeScreen/src/controlbarwidget.h index 9d4fa7f..618fa35 100644 --- a/src/controlbarwidget.h +++ b/HomeScreen/src/controlbarwidget.h @@ -18,8 +18,7 @@ #define CONTROLBARWIDGET_H #include -#include "include/daynightmode.h" -#include "daynightmode_adapter.h" +#include "../interfaces/daynightmode.h" #include "daynightmode_proxy.h" #include "settingswidget.h" @@ -35,13 +34,9 @@ public: explicit ControlBarWidget(QWidget *parent = 0); ~ControlBarWidget(); -// from daynightmode_adapter.h +// day/night mode public Q_SLOTS: - void setDayNightMode(int mode); - inline int getDayNightMode() - { - return (int)m_dayNightMode; - } + void dayNightModeSlot(int mode); private slots: void on_pushButton_Settings_clicked(); @@ -53,8 +48,9 @@ private: SettingsWidget *mp_settingsWidget; org::agl::daynightmode *mp_dBusDayNightMode_SettingsWidget; + // D-Bus day/night SystemDayNight::eDayNightMode m_dayNightMode; - DaynightmodeAdaptor *mp_daynightmodeAdaptor; + org::agl::daynightmode *mp_dayNightModeProxy; }; #endif // CONTROLBARWIDGET_H diff --git a/HomeScreen/src/main.cpp b/HomeScreen/src/main.cpp new file mode 100644 index 0000000..9108c35 --- /dev/null +++ b/HomeScreen/src/main.cpp @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mainwindow.h" +#include +#include +#include + +int main(int argc, char *argv[]) +{ + // allow only one instance of this application + /*QSharedMemory appInstance; + appInstance.setKey("HomeScreen"); + if (!appInstance.create(1)) + { + qDebug("Only one instance of the Home Screen App allowed!"); + exit(-1); + }*/ + + QApplication a(argc, argv); + + // used for application settings (QSettings) + QCoreApplication::setOrganizationDomain("LinuxFoundation"); + QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); + QCoreApplication::setApplicationName("HomeScreen"); + QCoreApplication::setApplicationVersion("0.1.0"); + + MainWindow w; + w.move(0, 0); + w.show(); + + +#ifdef __arm__ + qDebug("Running on ARM architecture"); +#endif +#ifdef __i386__ + qDebug("Running on x86 architecture"); +#endif + + return a.exec(); +} diff --git a/src/mainwindow.cpp b/HomeScreen/src/mainwindow.cpp similarity index 51% rename from src/mainwindow.cpp rename to HomeScreen/src/mainwindow.cpp index 40189b3..e2b55a9 100644 --- a/src/mainwindow.cpp +++ b/HomeScreen/src/mainwindow.cpp @@ -21,25 +21,23 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), mp_ui(new Ui::MainWindow), mp_statusBarWidget(0), - mp_dBusDayNightMode_StatusBarWidget(0), mp_controlBarWidget(0), - mp_dBusDayNightMode_ControlBarWidget(0), m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system - mp_daynightmodeAdaptor(0), - mp_popupAdaptor(0), - mp_dBusPopup(0), + mp_dayNightModeProxy(0), mp_popupWidget(0) { + // this has to be adopted to the system setup + mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider" + "/", + QDBusConnection::sessionBus(), + 0); + QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int))); + // dbus setup QDBusConnection dbus = QDBusConnection::sessionBus(); - // publish dbus day night mode interface - mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this); - // publish dbus popup interface - mp_popupAdaptor = new PopupAdaptor((QObject*)this); - dbus.registerObject("/MainWindow", this); - dbus.registerService("org.agl.mainwindow"); + dbus.registerService("org.agl.homescreen"); // no window decoration setWindowFlags(Qt::FramelessWindowHint); @@ -48,47 +46,30 @@ MainWindow::MainWindow(QWidget *parent) : mp_statusBarWidget = new StatusBarWidget(this); mp_statusBarWidget->raise(); // apply layout - mp_statusBarWidget->setGeometry(0, 0, 800, 60); - // connect to the dBus interface provided by the status bar widget - mp_dBusDayNightMode_StatusBarWidget = new org::agl::daynightmode("org.agl.mainwindow", - "/StatusBarWidget", - QDBusConnection::sessionBus(), - 0); + mp_statusBarWidget->move(0, 0); mp_controlBarWidget = new ControlBarWidget(this); mp_controlBarWidget->raise(); // apply layout - mp_controlBarWidget->setGeometry(0, 540, 800, 60); - // connect to the dBus interface provided by the control bar widget - mp_dBusDayNightMode_ControlBarWidget = new org::agl::daynightmode("org.agl.mainwindow", - "/ControlBarWidget", - QDBusConnection::sessionBus(), - 0); + mp_controlBarWidget->move(0, 1920-60); + + mp_popupWidget = new PopupWidget(this); + mp_controlBarWidget->raise(); + // apply layout + mp_popupWidget->move(0, 0); + + setWindowIcon(QIcon(":/icons/home_day.png")); } MainWindow::~MainWindow() { - delete mp_dBusDayNightMode_ControlBarWidget; - delete mp_dBusDayNightMode_StatusBarWidget; - - if (0 == mp_dBusPopup) - { - delete mp_dBusPopup; - } - if (0 != mp_popupWidget) - { - delete mp_popupWidget; - } - - - - delete mp_popupAdaptor; - delete mp_daynightmodeAdaptor; + delete mp_popupWidget; + delete mp_dayNightModeProxy; delete mp_statusBarWidget; delete mp_ui; } -void MainWindow::setDayNightMode(int mode) +void MainWindow::dayNightModeSlot(int mode) { switch (mode) { @@ -109,32 +90,6 @@ void MainWindow::setDayNightMode(int mode) default: m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; } - - mp_dBusDayNightMode_StatusBarWidget->setDayNightMode(m_dayNightMode); - mp_dBusDayNightMode_ControlBarWidget->setDayNightMode(m_dayNightMode); -} - -void MainWindow::showPopup(int type, const QString &text) -{ - if (0 == mp_popupWidget) - { - qDebug("0 == mp_popupWidget"); - mp_popupWidget = new PopupWidget(this); - } - - mp_popupWidget->move(0, 0); - mp_popupWidget->show(); - - if (0 == mp_dBusPopup) - { - qDebug("0 == mp_dBusPopup"); - // connect to the dBus interface provided by the popup widget - mp_dBusPopup = new org::agl::popup("org.agl.mainwindow", - "/PopupWidget", - QDBusConnection::sessionBus(), - 0); - } - mp_dBusPopup->showPopup(type, text); } void MainWindow::changeEvent(QEvent* event) diff --git a/src/mainwindow.h b/HomeScreen/src/mainwindow.h similarity index 72% rename from src/mainwindow.h rename to HomeScreen/src/mainwindow.h index a87d88d..af725fd 100644 --- a/src/mainwindow.h +++ b/HomeScreen/src/mainwindow.h @@ -18,13 +18,10 @@ #define MAINWINDOW_H #include -#include "include/daynightmode.h" -#include "daynightmode_adapter.h" +#include "../interfaces/daynightmode.h" #include "daynightmode_proxy.h" + #include "popupwidget.h" -#include "include/popup.h" -#include "popup_adapter.h" -#include "popup_proxy.h" #include "statusbarwidget.h" #include "controlbarwidget.h" @@ -41,17 +38,9 @@ public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); -// from daynightmode_adapter.h +// day/night mode public Q_SLOTS: - void setDayNightMode(int mode); - inline int getDayNightMode() - { - return (int)m_dayNightMode; - } - -// from popup_adapter.h -public Q_SLOTS: // METHODS - void showPopup(int type, const QString &text); + void dayNightModeSlot(int mode); protected: // called when the translator loaded a new language set @@ -65,13 +54,8 @@ private: ControlBarWidget *mp_controlBarWidget; org::agl::daynightmode *mp_dBusDayNightMode_ControlBarWidget; - // dbus daynightmode SystemDayNight::eDayNightMode m_dayNightMode; - DaynightmodeAdaptor *mp_daynightmodeAdaptor; - - // dbus popup - PopupAdaptor *mp_popupAdaptor; - org::agl::popup *mp_dBusPopup; + org::agl::daynightmode *mp_dayNightModeProxy; PopupWidget *mp_popupWidget; }; diff --git a/HomeScreen/src/popupwidget.cpp b/HomeScreen/src/popupwidget.cpp new file mode 100644 index 0000000..81ffdf7 --- /dev/null +++ b/HomeScreen/src/popupwidget.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "popupwidget.h" +#include "ui_popupwidget.h" + +PopupWidget::PopupWidget(QWidget *parent) : + QWidget(parent), + mp_ui(new Ui::PopupWidget), + m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system + mp_dayNightModeProxy(0), + mp_popupAdaptor(0) +{ + // this has to be adopted to the system setup + mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider" + "/", + QDBusConnection::sessionBus(), + 0); + QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int))); + + // publish dbus popup interface + mp_popupAdaptor = new PopupAdaptor((QObject*)this); + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/Popup", this); + dbus.registerService("org.agl.homescreen"); + + mp_ui->setupUi(this); + this->close(); +} + +PopupWidget::~PopupWidget() +{ + delete mp_dayNightModeProxy; + delete mp_popupAdaptor; + delete mp_ui; +} + +void PopupWidget::dayNightModeSlot(int mode) +{ + switch (mode) + { + case SystemDayNight::DAYNIGHTMODE_DAY: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_DAY; + mp_ui->widget_Popup->setStyleSheet(QString("QWidget { \ + border: 1px solid #D3D3D3; \ + border-radius: 8px; \ + background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(242, 242, 249, 255), stop:1 rgba(255, 255, 255, 255)); \ + color: #333; \ + padding: 0px; \ + } \ + QWidget:on { \ + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); \ + }")); + mp_ui->label_Text->setStyleSheet(QString("background-color: rgba(109, 109, 109, 0); \ + background-image: url(:/images/transparency.png); \ + border-image: url(:/images/transparency.png);")); + break; + case SystemDayNight::DAYNIGHTMODE_NIGHT: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_NIGHT; + mp_ui->widget_Popup->setStyleSheet(QString("QWidget { \ + border: 1px solid #D3D3D3; \ + border-radius: 8px; \ + background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(147, 147, 151, 255), stop:1 rgba(255, 255, 255, 255)); \ + color: #333; \ + padding: 0px; \ + } \ + QWidget:on { \ + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); \ + }")); + mp_ui->label_Text->setStyleSheet(QString("background-color: rgba(109, 109, 109, 0); \ + background-image: url(:/images/transparency.png); \ + border-image: url(:/images/transparency.png);")); + break; + default: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; + } +} + +void PopupWidget::showPopup(int type, const QString &text) +{ + this->show(); + this->raise(); + qDebug("PopupWidget::showPopup: type %d, text %s", type, text.toStdString().c_str()); + mp_ui->label_Text->setText(text); +} + +void PopupWidget::on_pushButton_OK_clicked() +{ + this->close(); +} diff --git a/src/popupwidget.h b/HomeScreen/src/popupwidget.h similarity index 78% rename from src/popupwidget.h rename to HomeScreen/src/popupwidget.h index 201cbc3..a876576 100644 --- a/src/popupwidget.h +++ b/HomeScreen/src/popupwidget.h @@ -18,8 +18,11 @@ #define POPUPWIDGET_H #include -#include "include/popup.h" +#include "../interfaces/popup.h" #include "popup_adapter.h" +#include "../interfaces/daynightmode.h" +#include "daynightmode_proxy.h" + namespace Ui { class PopupWidget; @@ -33,7 +36,11 @@ public: explicit PopupWidget(QWidget *parent = 0); ~PopupWidget(); -// from popup_adapter.h +// day/night mode +public Q_SLOTS: + void dayNightModeSlot(int mode); + + // from popup_adapter.h public Q_SLOTS: // METHODS void showPopup(int type, const QString &text); @@ -43,6 +50,8 @@ private slots: private: Ui::PopupWidget *mp_ui; + SystemDayNight::eDayNightMode m_dayNightMode; + org::agl::daynightmode *mp_dayNightModeProxy; PopupAdaptor *mp_popupAdaptor; }; diff --git a/src/settingswidget.cpp b/HomeScreen/src/settingswidget.cpp similarity index 88% rename from src/settingswidget.cpp rename to HomeScreen/src/settingswidget.cpp index 24085e8..039b99f 100644 --- a/src/settingswidget.cpp +++ b/HomeScreen/src/settingswidget.cpp @@ -16,21 +16,21 @@ #include "settingswidget.h" #include "ui_settingswidget.h" -#include "include/daynightmode.h" #include SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent), mp_ui(new Ui::SettingsWidget), m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system - mp_daynightmodeAdaptor(0), + mp_dayNightModeProxy(0), mp_translator(0) { - // publish dbus day night mode interface - mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this); - QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/SettingsWidget", this); - dbus.registerService("org.agl.mainwindow"); + // this has to be adopted to the system setup + mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider" + "/", + QDBusConnection::sessionBus(), + 0); + QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int))); // multi-language support mp_translator = new QTranslator(); @@ -50,14 +50,14 @@ SettingsWidget::SettingsWidget(QWidget *parent) : SettingsWidget::~SettingsWidget() { delete mp_translator; - delete mp_daynightmodeAdaptor; + delete mp_dayNightModeProxy; QSettings settings; settings.setValue("systemsettings/language", mp_ui->comboBoxLanguage->currentIndex()); delete mp_ui; } -void SettingsWidget::setDayNightMode(int mode) +void SettingsWidget::dayNightModeSlot(int mode) { switch (mode) { diff --git a/src/settingswidget.h b/HomeScreen/src/settingswidget.h similarity index 82% rename from src/settingswidget.h rename to HomeScreen/src/settingswidget.h index f49da8d..15b24bd 100644 --- a/src/settingswidget.h +++ b/HomeScreen/src/settingswidget.h @@ -19,8 +19,9 @@ #include #include -#include "include/daynightmode.h" -#include "daynightmode_adapter.h" +#include "../interfaces/daynightmode.h" +#include "daynightmode_proxy.h" + namespace Ui { class SettingsWidget; @@ -34,13 +35,9 @@ public: explicit SettingsWidget(QWidget *parent = 0); ~SettingsWidget(); -// from daynightmode_adapter.h +// day/night mode public Q_SLOTS: - void setDayNightMode(int mode); - inline int getDayNightMode() - { - return (int)m_dayNightMode; - } + void dayNightModeSlot(int mode); protected: // called when the translator loaded a new language set @@ -53,7 +50,7 @@ private: Ui::SettingsWidget *mp_ui; SystemDayNight::eDayNightMode m_dayNightMode; - DaynightmodeAdaptor *mp_daynightmodeAdaptor; + org::agl::daynightmode *mp_dayNightModeProxy; QTranslator *mp_translator; }; diff --git a/HomeScreen/src/statusbarwidget.cpp b/HomeScreen/src/statusbarwidget.cpp new file mode 100644 index 0000000..af144c5 --- /dev/null +++ b/HomeScreen/src/statusbarwidget.cpp @@ -0,0 +1,205 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "statusbarwidget.h" +#include "ui_statusbarwidget.h" + +StatusBarWidget::StatusBarWidget(QWidget *parent) : + QWidget(parent), + mp_ui(new Ui::StatusBarWidget), + m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system + mp_dayNightModeProxy(0), + mp_statusbarAdaptor(0), + mp_statusbarIconURIs(new QMap) +{ + // this has to be adopted to the system setup + mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider" + "/", + QDBusConnection::sessionBus(), + 0); + QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int))); + + // publish statusbar interface + mp_statusbarAdaptor = new StatusbarAdaptor((QObject*)this); + + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/StatusBar", this); + dbus.registerService("org.agl.homescreen"); + + mp_ui->setupUi(this); +} + +StatusBarWidget::~StatusBarWidget() +{ + delete mp_statusbarAdaptor; + delete mp_dayNightModeProxy; + delete mp_ui; +} + +void StatusBarWidget::dayNightModeSlot(int mode) +{ + switch (mode) + { + case SystemDayNight::DAYNIGHTMODE_DAY: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_DAY; + mp_ui->widget->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_stripes_day.png)")); + mp_ui->label_1->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(1) + QString("); background-repeat: no-repeat;")); + mp_ui->label_2->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(2) + QString("); background-repeat: no-repeat;")); + mp_ui->label_3->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(3) + QString("); background-repeat: no-repeat;")); + mp_ui->label_4->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(4) + QString("); background-repeat: no-repeat;")); + mp_ui->label_5->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(5) + QString("); background-repeat: no-repeat;")); + break; + case SystemDayNight::DAYNIGHTMODE_NIGHT: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_NIGHT; + mp_ui->widget->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_stripes_night.png)")); + mp_ui->label_1->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(1) + QString("); background-repeat: no-repeat;")); + mp_ui->label_2->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(2) + QString("); background-repeat: no-repeat;")); + mp_ui->label_3->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(3) + QString("); background-repeat: no-repeat;")); + mp_ui->label_4->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(4) + QString("); background-repeat: no-repeat;")); + mp_ui->label_5->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(5) + QString("); background-repeat: no-repeat;")); + break; + default: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; + } +} + +QList StatusBarWidget::getAvailablePlaceholders() +{ + QList result; + + // for now, all are available + result.append(1); + result.append(2); + result.append(3); + result.append(4); + result.append(5); + + return result; +} + +QString StatusBarWidget::getStatusIcon(int placeholderIndex) +{ + return mp_statusbarIconURIs->value(placeholderIndex); +} + +QString StatusBarWidget::getStatusText(int placeholderIndex) +{ + QString result = ""; + + switch (placeholderIndex) + { + case 1: + result = mp_ui->label_1->text(); + break; + case 2: + result = mp_ui->label_2->text(); + break; + case 3: + result = mp_ui->label_3->text(); + break; + case 4: + result = mp_ui->label_4->text(); + break; + case 5: + result = mp_ui->label_5->text(); + break; + default: + break; + } + + return result; +} + +void StatusBarWidget::setStatusIcon(int placeholderIndex, const QString &iconURI) +{ + mp_statusbarIconURIs->insert(placeholderIndex, iconURI); + + switch (m_dayNightMode) + { + case SystemDayNight::DAYNIGHTMODE_DAY: + switch (placeholderIndex) + { + case 1: + mp_ui->label_1->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + case 2: + mp_ui->label_2->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + case 3: + mp_ui->label_3->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + case 4: + mp_ui->label_4->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + case 5: + mp_ui->label_5->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + default: + break; + } + break; + case SystemDayNight::DAYNIGHTMODE_NIGHT: + switch (placeholderIndex) + { + case 1: + mp_ui->label_1->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + case 2: + mp_ui->label_2->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + case 3: + mp_ui->label_3->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + case 4: + mp_ui->label_4->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + case 5: + mp_ui->label_5->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;")); + break; + default: + break; + } + break; + default: + break; + } +} + +void StatusBarWidget::setStatusText(int placeholderIndex, const QString &text) +{ + switch (placeholderIndex) + { + case 1: + mp_ui->label_1->setText(text); + break; + case 2: + mp_ui->label_2->setText(text); + break; + case 3: + mp_ui->label_3->setText(text); + break; + case 4: + mp_ui->label_4->setText(text); + break; + case 5: + mp_ui->label_5->setText(text); + break; + default: + break; + } +} + + diff --git a/src/statusbarwidget.h b/HomeScreen/src/statusbarwidget.h similarity index 69% rename from src/statusbarwidget.h rename to HomeScreen/src/statusbarwidget.h index 2547d34..e17f13e 100644 --- a/src/statusbarwidget.h +++ b/HomeScreen/src/statusbarwidget.h @@ -18,8 +18,9 @@ #define STATUSBARWIDGET_H #include -#include "include/daynightmode.h" -#include "daynightmode_adapter.h" +#include "../interfaces/daynightmode.h" +#include "daynightmode_proxy.h" + #include "statusbar_adapter.h" namespace Ui { @@ -34,29 +35,26 @@ public: explicit StatusBarWidget(QWidget *parent = 0); ~StatusBarWidget(); -// from daynightmode_adapter.h +// day/night mode public Q_SLOTS: - void setDayNightMode(int mode); - inline int getDayNightMode() - { - return (int)m_dayNightMode; - } + void dayNightModeSlot(int mode); // from statusbar_adapter.h public Q_SLOTS: // METHODS - void setStatus(int index, const QString &text); - -protected: - void timerEvent(QTimerEvent *e); + QList getAvailablePlaceholders(); + QString getStatusIcon(int placeholderIndex); + QString getStatusText(int placeholderIndex); + void setStatusIcon(int placeholderIndex, const QString &iconURI); + void setStatusText(int placeholderIndex, const QString &text); private: Ui::StatusBarWidget *mp_ui; SystemDayNight::eDayNightMode m_dayNightMode; - DaynightmodeAdaptor *mp_daynightmodeAdaptor; + org::agl::daynightmode *mp_dayNightModeProxy; StatusbarAdaptor *mp_statusbarAdaptor; - int m_secondsTimerId; + QMap *mp_statusbarIconURIs; }; #endif // STATUSBARWIDGET_H diff --git a/HomeScreenSimulator/HomeScreenSimulator.pro b/HomeScreenSimulator/HomeScreenSimulator.pro new file mode 100644 index 0000000..3d8d7f0 --- /dev/null +++ b/HomeScreenSimulator/HomeScreenSimulator.pro @@ -0,0 +1,122 @@ +# Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +QT += core gui dbus + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = HomeScreenSimulator +TEMPLATE = app + + +SOURCES += \ + src/main.cpp \ + src/mainwindow.cpp \ + $$OUT_PWD/daynightmode_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/daynightmode_proxy.cpp \ #generated dbus proxy + $$OUT_PWD/popup_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/popup_proxy.cpp \ #generated dbus proxy + $$OUT_PWD/statusbar_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/statusbar_proxy.cpp #generated dbus proxy + +HEADERS += \ + ../interfaces/daynightmode.h \ + ../interfaces/popup.h \ + src/mainwindow.h \ + $$OUT_PWD/daynightmode_adapter.h \ #generated dbus adapter + $$OUT_PWD/daynightmode_proxy.h \ #generated dbus proxy + $$OUT_PWD/popup_adapter.h \ #generated dbus adapter + $$OUT_PWD/popup_proxy.h \ #generated dbus proxy + $$OUT_PWD/statusbar_adapter.h \ #generated dbus adapter + $$OUT_PWD/statusbar_proxy.h #generated dbus proxy + +FORMS += \ + resources/mainwindow.ui + +OTHER_FILES += \ + interfaces/daynightmode.xml \ + interfaces/popup.xml \ + interfaces/statusbar.xml \ + README.md + +RESOURCES += + +# remove generated files +QMAKE_CLEAN += -r \ + $$OUT_PWD/HomeScreen \ + $$OUT_PWD/Makefile \ + $$OUT_PWD/daynightmode_adapter.h \ + $$OUT_PWD/daynightmode_adapter.cpp \ + $$OUT_PWD/daynightmode_adapter.moc \ + $$OUT_PWD/daynightmode_proxy.h \ + $$OUT_PWD/daynightmode_proxy.cpp \ + $$OUT_PWD/daynightmode_proxy.moc \ + $$OUT_PWD/popup_adapter.h \ + $$OUT_PWD/popup_adapter.cpp \ + $$OUT_PWD/popup_adapter.moc \ + $$OUT_PWD/popup_proxy.h \ + $$OUT_PWD/popup_proxy.cpp \ + $$OUT_PWD/popup_proxy.moc \ + $$OUT_PWD/inputevent_adapter.h \ + $$OUT_PWD/inputevent_adapter.cpp \ + $$OUT_PWD/inputevent_adapter.moc \ + $$OUT_PWD/inputevent_proxy.h \ + $$OUT_PWD/inputevent_proxy.cpp \ + $$OUT_PWD/inputevent_proxy.moc \ + $$OUT_PWD/statusbar_adapter.h \ + $$OUT_PWD/statusbar_adapter.cpp \ + $$OUT_PWD/statusbar_adapter.moc \ + $$OUT_PWD/statusbar_proxy.h \ + $$OUT_PWD/statusbar_proxy.cpp \ + $$OUT_PWD/statusbar_proxy.moc + +# Create custom targets for generating dbus proxy and adapter +# OE_QMAKE_PATH_EXTERNAL_HOST_BINS is only defined in the yocto environment +isEmpty(OE_QMAKE_PATH_EXTERNAL_HOST_BINS){ + OE_QMAKE_PATH_EXTERNAL_HOST_BINS = "/" +} +# for daynightmode +daynightmodegenerateadapter.target = $$OUT_PWD/daynightmode_adapter.cpp +unix:daynightmodegenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a daynightmode_adapter $$_PRO_FILE_PWD_/../interfaces/daynightmode.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/daynightmode_adapter.h -o $$OUT_PWD/daynightmode_adapter.moc" +daynightmodegenerateproxy.target = $$OUT_PWD/daynightmode_proxy.cpp +unix:daynightmodegenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p daynightmode_proxy $$_PRO_FILE_PWD_/../interfaces/daynightmode.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/daynightmode_proxy.h -o $$OUT_PWD/daynightmode_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/daynightmode_adapter.cpp \ + $$OUT_PWD/daynightmode_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + daynightmodegenerateadapter \ + daynightmodegenerateproxy +# for popup +popupgenerateadapter.target = $$OUT_PWD/popup_adapter.cpp +unix:popupgenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a popup_adapter $$_PRO_FILE_PWD_/../interfaces/popup.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/popup_adapter.h -o $$OUT_PWD/popup_adapter.moc" +popupgenerateproxy.target = $$OUT_PWD/popup_proxy.cpp +unix:popupgenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p popup_proxy $$_PRO_FILE_PWD_/../interfaces/popup.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/popup_proxy.h -o $$OUT_PWD/popup_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/popup_adapter.cpp \ + $$OUT_PWD/popup_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + popupgenerateadapter \ + popupgenerateproxy +# for statusbar +statusbargenerateadapter.target = $$OUT_PWD/statusbar_adapter.cpp +unix:statusbargenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a statusbar_adapter $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/statusbar_adapter.h -o $$OUT_PWD/statusbar_adapter.moc" +statusbargenerateproxy.target = $$OUT_PWD/statusbar_proxy.cpp +unix:statusbargenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p statusbar_proxy $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/statusbar_proxy.h -o $$OUT_PWD/statusbar_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/statusbar_adapter.cpp \ + $$OUT_PWD/statusbar_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + statusbargenerateadapter \ + statusbargenerateproxy + diff --git a/HomeScreenSimulator/LICENSE b/HomeScreenSimulator/LICENSE new file mode 100644 index 0000000..31c692a --- /dev/null +++ b/HomeScreenSimulator/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/HomeScreenSimulator/README.md b/HomeScreenSimulator/README.md new file mode 100644 index 0000000..55152cd --- /dev/null +++ b/HomeScreenSimulator/README.md @@ -0,0 +1,20 @@ +AGL Home Screen Simulator for development + + +AGL repo for source code: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen + + +v0.1.0 +06/24/2016 + +#new features +- initial version +- set status bar texts and icons +- set day/night mode +- call popups + +#TODOs +- define and implement input device event handler +- more documentation ;) +- much more... diff --git a/HomeScreenSimulator/resources/mainwindow.ui b/HomeScreenSimulator/resources/mainwindow.ui new file mode 100644 index 0000000..dc03c7a --- /dev/null +++ b/HomeScreenSimulator/resources/mainwindow.ui @@ -0,0 +1,315 @@ + + + MainWindow + + + + 0 + 0 + 731 + 507 + + + + Qt::NoFocus + + + + + + + + + + + + 10 + 10 + 711 + 451 + + + + 0 + + + + Status Bar + + + + + 20 + 380 + 221 + 27 + + + + Read from Home Screen App + + + + + + 20 + 20 + 681 + 341 + + + + + + + 550 + 380 + 141 + 27 + + + + Icon-Example + + + + + + Popup + + + + + 600 + 380 + 99 + 27 + + + + Send + + + + + + 10 + 10 + 681 + 361 + + + + + + + Day/Night Mode + + + + + 30 + 30 + 161 + 91 + + + + Day/Night Mode + + + + + 10 + 50 + 117 + 22 + + + + Qt::NoFocus + + + Night Mode + + + + + + 10 + 30 + 117 + 22 + + + + Qt::NoFocus + + + Day Mode + + + true + + + + + + + Future features + + + + false + + + + 250 + 160 + 71 + 71 + + + + Qt::NoFocus + + + Right + + + + + false + + + + 170 + 160 + 71 + 71 + + + + Qt::NoFocus + + + OK + + + + + false + + + + 90 + 160 + 71 + 71 + + + + Qt::NoFocus + + + Left + + + + + false + + + + 170 + 240 + 71 + 71 + + + + Qt::NoFocus + + + Down + + + + + false + + + + 170 + 80 + 71 + 71 + + + + Qt::NoFocus + + + Up + + + + + + 120 + 20 + 181 + 51 + + + + under development +not functional right now + + + + + false + + + + 90 + 240 + 71 + 71 + + + + Qt::NoFocus + + + Cancel/ +Back? + + + + + + + + 620 + 470 + 99 + 27 + + + + Exit + + + + + + About + + + + + + + diff --git a/src/main.cpp b/HomeScreenSimulator/src/main.cpp similarity index 70% rename from src/main.cpp rename to HomeScreenSimulator/src/main.cpp index fac6e2f..9c5a108 100644 --- a/src/main.cpp +++ b/HomeScreenSimulator/src/main.cpp @@ -15,43 +15,35 @@ */ #include "mainwindow.h" -#include "include/daynightmode.h" #include #include #include -#include "inputeventdistributor.h" - -#ifdef __i386__ -#include "inputdevicesimulator.h" -#include "systemsettingssimulator.h" -#endif - int main(int argc, char *argv[]) { // allow only one instance of this application - QSharedMemory appInstance; + /*QSharedMemory appInstance; appInstance.setKey("AGLHomeScreenApp"); if (!appInstance.create(1)) { qDebug("Only one instance of the Home Screen App allowed!"); exit(-1); - } + }*/ QApplication a(argc, argv); // used for application settings (QSettings) QCoreApplication::setOrganizationDomain("LinuxFoundation"); QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); - QCoreApplication::setApplicationName("HomeScreen"); - QCoreApplication::setApplicationVersion("0.0.1"); + QCoreApplication::setApplicationName("HomeScreenSimulator"); + QCoreApplication::setApplicationVersion("0.1.0"); MainWindow w; - w.move(0, 0); w.show(); - InputEventDistributor *mp_inputEventDistributor; - mp_inputEventDistributor = new InputEventDistributor(); + // TODO: input handling not defined right now... + /*InputEventDistributor *mp_inputEventDistributor; + mp_inputEventDistributor = new InputEventDistributor();*/ // start input and system settings simulator on developer PCs @@ -59,10 +51,6 @@ int main(int argc, char *argv[]) qDebug("Running on ARM architecture"); #endif #ifdef __i386__ - InputDeviceSimulator inputdevicesimulator(&w); - inputdevicesimulator.show(); - SystemSettingsSimulator systemsettingssimulator; - systemsettingssimulator.show(); qDebug("Running on x86 architecture"); #endif diff --git a/HomeScreenSimulator/src/mainwindow.cpp b/HomeScreenSimulator/src/mainwindow.cpp new file mode 100644 index 0000000..ffc5170 --- /dev/null +++ b/HomeScreenSimulator/src/mainwindow.cpp @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + mp_ui(new Ui::MainWindow), + mp_dBusDayNightModeAdapter(0), + mp_dBusStatusBarProxy(0), + mp_dBusPopupProxy(0) +{ + mp_ui->setupUi(this); + + // dbus setup + QDBusConnection dbus = QDBusConnection::sessionBus(); + + // publish dbus day night mode interface + mp_dBusDayNightModeAdapter = new DaynightmodeAdaptor((QObject*)this); + + dbus.registerService("org.agl.homescreen.simulator"); + dbus.registerObject("/", this); + + mp_dBusStatusBarProxy = new org::agl::statusbar("org.agl.homescreen", + "/StatusBar", + QDBusConnection::sessionBus(), + 0); + mp_dBusPopupProxy = new org::agl::popup("org.agl.homescreen", + "/Popup", + QDBusConnection::sessionBus(), + 0); + QSettings settings; + this->move(settings.value("homescreensimulator/pos").toPoint()); + mp_ui->radioButton_DayMode->setChecked(settings.value("homescreensimulator/daymode", true).toBool()); // if nothing is stored, use "true" + mp_ui->radioButton_NightMode->setChecked(settings.value("homescreensimulator/nightmode", false).toBool()); // if nothing is stored, use "false" +} + +MainWindow::~MainWindow() +{ + QSettings settings; + settings.setValue("homescreensimulator/pos", this->pos()); + settings.setValue("homescreensimulator/daymode", mp_ui->radioButton_DayMode->isChecked()); + settings.setValue("homescreensimulator/nightmode", mp_ui->radioButton_NightMode->isChecked()); + + delete mp_dBusPopupProxy; + delete mp_dBusStatusBarProxy; + + if (0 == mp_dBusDayNightModeAdapter) + { + delete mp_dBusDayNightModeAdapter; + } + delete mp_ui; +} + +void MainWindow::on_radioButton_DayMode_toggled(bool checked) +{ + if (checked) + { + emit(dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY)); + } +} + +void MainWindow::on_radioButton_NightMode_toggled(bool checked) +{ + if (checked) + { + emit(dayNightMode(SystemDayNight::DAYNIGHTMODE_NIGHT)); + } +} + +void MainWindow::on_pushButton_Update_clicked() +{ + QList availablePlaceholders = mp_dBusStatusBarProxy->getAvailablePlaceholders(); + mp_ui->tableWidget_Status->verticalHeader()->setVisible(false); + mp_ui->tableWidget_Status->clear(); + mp_ui->tableWidget_Status->setRowCount(availablePlaceholders.size()); + mp_ui->tableWidget_Status->setColumnCount(3); + + QList horizontalHeaderLabels; + horizontalHeaderLabels.append("Placeholder #"); + horizontalHeaderLabels.append("Text"); + horizontalHeaderLabels.append("iconURI"); + mp_ui->tableWidget_Status->setHorizontalHeaderLabels(horizontalHeaderLabels); + + // disable trigger for the update + mp_ui->tableWidget_Status->blockSignals(true); + + for (int i = 0; i < availablePlaceholders.size(); ++i) + { + mp_ui->tableWidget_Status->setItem(i, 0, new QTableWidgetItem(QString::number(availablePlaceholders[i]))); + mp_ui->tableWidget_Status->item(i, 0)->setFlags(Qt::ItemIsSelectable); + mp_ui->tableWidget_Status->setItem(i, 1, new QTableWidgetItem(mp_dBusStatusBarProxy->getStatusText(availablePlaceholders[i]))); + mp_ui->tableWidget_Status->setItem(i, 2, new QTableWidgetItem(mp_dBusStatusBarProxy->getStatusIcon(availablePlaceholders[i]))); + } + + // enable trigger again + mp_ui->tableWidget_Status->blockSignals(false); +} + +void MainWindow::on_pushButton_Exit_clicked() +{ + QApplication::exit(); +} + +void MainWindow::on_tableWidget_Status_cellChanged(int row, int column) +{ + // text + if (1 == column) + { + mp_dBusStatusBarProxy->setStatusText(mp_ui->tableWidget_Status->item(row, 0)->text().toInt(), mp_ui->tableWidget_Status->item(row, 1)->text()); + } + + // icon + if (2 == column) + { + mp_dBusStatusBarProxy->setStatusIcon(mp_ui->tableWidget_Status->item(row, 0)->text().toInt(), mp_ui->tableWidget_Status->item(row, 2)->text()); + } +} + +void MainWindow::on_pushButton_Send_clicked() +{ + mp_dBusPopupProxy->showPopup(0, mp_ui->plainTextEdit_Popup->toPlainText()); +} + +void MainWindow::on_pushButton_IconExample_clicked() +{ + on_pushButton_Update_clicked(); + + // THIS IS JUST AN EXAMPLE!!! It only works, because the alias for the pic is defined in the + // Home Screen app resources... + mp_ui->tableWidget_Status->setItem(0, 2, new QTableWidgetItem(":/icons/home_day.png")); +} diff --git a/src/systemsettingssimulator.h b/HomeScreenSimulator/src/mainwindow.h similarity index 52% rename from src/systemsettingssimulator.h rename to HomeScreenSimulator/src/mainwindow.h index cba7a14..2eb6e11 100644 --- a/src/systemsettingssimulator.h +++ b/HomeScreenSimulator/src/mainwindow.h @@ -14,34 +14,52 @@ * limitations under the License. */ -#ifndef SYSTEMSETTINGSSIMULATOR_H -#define SYSTEMSETTINGSSIMULATOR_H +#ifndef MAINWINDOW_H +#define MAINWINDOW_H -#include -#include "include/daynightmode.h" -#include "daynightmode_proxy.h" +#include +#include "../interfaces/daynightmode.h" +#include "daynightmode_adapter.h" + +#include "statusbar_proxy.h" +#include "popup_proxy.h" namespace Ui { -class SystemSettingsSimulator; +class MainWindow; } -class SystemSettingsSimulator : public QDialog +class MainWindow : public QMainWindow { Q_OBJECT public: - explicit SystemSettingsSimulator(QWidget *parent = 0); - ~SystemSettingsSimulator(); + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +// day/night mode +Q_SIGNALS: + void dayNightMode(int mode); private slots: - void on_pushButton_Exit_clicked(); void on_radioButton_DayMode_toggled(bool checked); void on_radioButton_NightMode_toggled(bool checked); + void on_pushButton_Update_clicked(); + + void on_pushButton_Exit_clicked(); + + void on_tableWidget_Status_cellChanged(int row, int column); + + void on_pushButton_Send_clicked(); + + void on_pushButton_IconExample_clicked(); + private: - Ui::SystemSettingsSimulator *mp_ui; - org::agl::daynightmode *mp_dBusDayNightMode; + Ui::MainWindow *mp_ui; + DaynightmodeAdaptor *mp_dBusDayNightModeAdapter; + org::agl::statusbar *mp_dBusStatusBarProxy; + org::agl::popup *mp_dBusPopupProxy; }; -#endif // SYSTEMSETTINGSSIMULATOR_H +#endif // MAINWINDOW_H diff --git a/README.md b/README.md index b3845aa..253ffa2 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,10 @@ -AGL Home Screen reference implementation +This project contains: + +HomeScreen: AGL Home Screen reference implementation +HomeScreenSimulator: AGL Home Screen Simulator for development +SampleAppTimeDate: AGL Sample Application for Home Screen Statusbar 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-hmi/homescreen - - - -v0.0.1 -06/01/2016 - -#new features -- initial version -- first implementation of home screen -- fix HMI layout (will be configurable in the future) -- dBus as IPC (may change in the future) -- no interaction with application manager so far -- multi-lanuage support -- day/night mode support -- initial status bar implementation (interface will be enhanced in the future) -- initial control bar implementation -- MPLv2.0 license -- input device simulator for developer build (not functional right now) -- system settings simulator for developer build (day/night mode switch functional right now) -- using QSettings for local app setting storage (may change in the future) -- first popup implementation (single popup support for now; multiple popup not defined; interface will change) -- only one instance of the app allowed - -#TODOs -- many settings have to be read from the system somewhere during app startup. This is not available right now -- interaction with application manager -- interaction with wayland compositor -- define and implement input device event handler -- replace my HMI design with the official AGL design (graphics/icons...) -- implement example HMI layouts -- rename dBus objects (internal/external) -- fix font issues on target -- more documentation ;) -- add animations -- much more... - -Thanks to Umar Irshad for his free iconset available here: -https://dribbble.com/shots/1569128-Freebie-48-Bubbles-Iconset - diff --git a/SampleAppTimeDate/LICENSE b/SampleAppTimeDate/LICENSE new file mode 100644 index 0000000..31c692a --- /dev/null +++ b/SampleAppTimeDate/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/SampleAppTimeDate/README.md b/SampleAppTimeDate/README.md new file mode 100644 index 0000000..5016865 --- /dev/null +++ b/SampleAppTimeDate/README.md @@ -0,0 +1,12 @@ +AGL Sample Application for Home Screen Statusbar +This application simply shows the current time in the home screen status bar + +AGL repo for source code: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen + + +v0.1.0 +06/24/2016 + +#new features +- initial version diff --git a/SampleAppTimeDate/SampleAppTimeDate.pro b/SampleAppTimeDate/SampleAppTimeDate.pro new file mode 100644 index 0000000..0bf4736 --- /dev/null +++ b/SampleAppTimeDate/SampleAppTimeDate.pro @@ -0,0 +1,45 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2016-06-21T13:46:39 +# +#------------------------------------------------- + +QT += core dbus + +QT -= gui + +TARGET = SampleAppTimeDate +CONFIG += console +CONFIG -= app_bundle + +TEMPLATE = app + + +SOURCES += src/main.cpp \ + $$OUT_PWD/statusbar_proxy.cpp \ #generated dbus proxy + src/timedateprovider.cpp + +HEADERS += \ + $$OUT_PWD/statusbar_proxy.h \ #generated dbus proxy + src/timedateprovider.h + +OTHER_FILES += \ + interfaces/statusbar.xml \ + README.md + +# remove generated files +QMAKE_CLEAN += -r \ + $$OUT_PWD/HomeScreen \ + $$OUT_PWD/Makefile \ + $$OUT_PWD/statusbar_proxy.h \ + $$OUT_PWD/statusbar_proxy.cpp \ + $$OUT_PWD/statusbar_proxy.moc + +# Create custom targets for generating dbus proxy +# for statusbar +statusbargenerateproxy.target = $$OUT_PWD/statusbar_proxy.cpp +unix:statusbargenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p statusbar_proxy $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/statusbar_proxy.h -o $$OUT_PWD/statusbar_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/statusbar_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + statusbargenerateproxy diff --git a/SampleAppTimeDate/src/main.cpp b/SampleAppTimeDate/src/main.cpp new file mode 100644 index 0000000..d432cba --- /dev/null +++ b/SampleAppTimeDate/src/main.cpp @@ -0,0 +1,12 @@ +#include +#include "timedateprovider.h" + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + + TimeDateProvider *tdp = new TimeDateProvider(); + tdp->start(); + + return a.exec(); +} diff --git a/SampleAppTimeDate/src/timedateprovider.cpp b/SampleAppTimeDate/src/timedateprovider.cpp new file mode 100644 index 0000000..91d5e30 --- /dev/null +++ b/SampleAppTimeDate/src/timedateprovider.cpp @@ -0,0 +1,77 @@ +#include "timedateprovider.h" +#include + +TimeDateProvider::TimeDateProvider(QObject *parent) : + QObject(parent), + m_secondsTimerId(-1), + mp_dBusStatusBarProxy(0), + m_statusBarPlaceholder(-1) +{ + qDebug("D-Bus: register as org.agl.SampleAppTimeDate"); + // dbus setup + QDBusConnection dbus = QDBusConnection::sessionBus(); + + dbus.registerObject("/", this); + dbus.registerService("org.agl.sampleapptimedate"); + + + qDebug("D-Bus: connect to org.agl.mainwindow /StatusBar"); + mp_dBusStatusBarProxy = new org::agl::statusbar("org.agl.homescreen", + "/StatusBar", + QDBusConnection::sessionBus(), + 0); +} + +TimeDateProvider::~TimeDateProvider() +{ + stop(); + + if (0 != mp_dBusStatusBarProxy) + { + qDebug("x"); + mp_dBusStatusBarProxy->setStatusText(1, ""); + delete mp_dBusStatusBarProxy; + } +} + +void TimeDateProvider::start() +{ + qDebug("trying to start timer (if this lasts long, maybe the Home Screen Application is not launched."); + if ((-1 == m_statusBarPlaceholder) && (0 != mp_dBusStatusBarProxy)) + { + QList availablePlaceholder = mp_dBusStatusBarProxy->getAvailablePlaceholders(); + if (availablePlaceholder.size() > 0) + { + // just take the first available placeholder + m_statusBarPlaceholder = availablePlaceholder[0]; + qDebug("- using statusbar placeholder %d", m_statusBarPlaceholder); + + qDebug("- timer started"); + // callback every second + m_secondsTimerId = startTimer(1000); + } + } +} + +void TimeDateProvider::stop() +{ + if (-1 != m_secondsTimerId) + { + killTimer(m_secondsTimerId); + m_secondsTimerId = -1; + m_statusBarPlaceholder = -1; + } +} + +void TimeDateProvider::timerEvent(QTimerEvent *e) +{ + if (e->timerId() == m_secondsTimerId) + { + if (0 != mp_dBusStatusBarProxy) + { + QString toDisplay = QDateTime::currentDateTime().toString("hh:mm"); + qDebug("%s", toDisplay.toStdString().c_str()); + mp_dBusStatusBarProxy->setStatusText(m_statusBarPlaceholder, toDisplay); + } + } +} diff --git a/SampleAppTimeDate/src/timedateprovider.h b/SampleAppTimeDate/src/timedateprovider.h new file mode 100644 index 0000000..039104a --- /dev/null +++ b/SampleAppTimeDate/src/timedateprovider.h @@ -0,0 +1,27 @@ +#ifndef TIMEDATEPROVIDER_H +#define TIMEDATEPROVIDER_H + +#include +#include "statusbar_proxy.h" + +class TimeDateProvider : public QObject +{ + Q_OBJECT +public: + explicit TimeDateProvider(QObject *parent = 0); + ~TimeDateProvider(); + void start(); + void stop(); +protected: + void timerEvent(QTimerEvent *e); +private: + int m_secondsTimerId; + org::agl::statusbar *mp_dBusStatusBarProxy; + int m_statusBarPlaceholder; +signals: + +public slots: + +}; + +#endif // TIMEDATEPROVIDER_H diff --git a/dbus-introspections/inputevent.xml b/dbus-introspections/inputevent.xml deleted file mode 100644 index 4d8dfc5..0000000 --- a/dbus-introspections/inputevent.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - diff --git a/dbus-introspections/statusbar.xml b/dbus-introspections/statusbar.xml deleted file mode 100644 index fcfe939..0000000 --- a/dbus-introspections/statusbar.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - diff --git a/include/inputevent.h b/include/inputevent.h deleted file mode 100644 index 730ac57..0000000 --- a/include/inputevent.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef INPUTEVENT_H -#define INPUTEVENT_H - -namespace SystemInputEvent -{ - typedef enum InputEventType - { - INPUTEVENTTYPE_UNDEFINED, - INPUTEVENTTYPE_KEY_PRESSED - } eInputEventType; - - typedef enum InputEventZone - { - INPUTEVENTZONE_UNDEFINED, - INPUTEVENTZONE_1, - INPUTEVENTZONE_2 - } eInputEventZone; -} - -#endif // INPUTEVENT_H diff --git a/include/daynightmode.h b/interfaces/daynightmode.h similarity index 100% rename from include/daynightmode.h rename to interfaces/daynightmode.h diff --git a/dbus-introspections/daynightmode.xml b/interfaces/daynightmode.xml similarity index 81% rename from dbus-introspections/daynightmode.xml rename to interfaces/daynightmode.xml index b88f0ca..f95adcd 100644 --- a/dbus-introspections/daynightmode.xml +++ b/interfaces/daynightmode.xml @@ -14,11 +14,8 @@ limitations under the License. --> - - - - - - + + + diff --git a/include/popup.h b/interfaces/popup.h similarity index 100% rename from include/popup.h rename to interfaces/popup.h diff --git a/dbus-introspections/popup.xml b/interfaces/popup.xml similarity index 100% rename from dbus-introspections/popup.xml rename to interfaces/popup.xml diff --git a/interfaces/statusbar.xml b/interfaces/statusbar.xml new file mode 100644 index 0000000..934cf27 --- /dev/null +++ b/interfaces/statusbar.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/backgrounds/bg_stripes_day.png b/resources/images/backgrounds/bg_stripes_day.png deleted file mode 100755 index a9978bbfba5cef566b84e2760d81a92f3c02c72d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7228 zcmeHM{ZEru6n``+8!bI$Xe z=bYS}7PBMwtjE8JM-XH^Bb*k6Ag{a&-b0)n!MEEqg9;uFSy6kaNb}9N%wVzRXxP3m z1i4)1Vo7!aYg|V7{wxG}?Hc?z+z_b`gH3{%&J#zAj)*@^&J-YfG6jNTSt%lMVvI95 z;?>Hag>kbJwL`f-Peed;jYvNlWqOvU7TiZzD0pU<$Qv3FKNOlt-oK z72`EVe3jlbKBv92X{%@peCR!);*FsFg2Fs2{d585Ap2{-V9=mw)2qphSqddpA zH>oqeYnHPhpmeOe8kleG17Y?9C-ZFyDXChulq&d@@G#XOQY-QE@vge8mS#GU1{8jU zH3x^C9uMfa;nd(m9GnRsp(b-8ISws7yCsy;2tTl&odcenaH?cZMZgowU8~1}MtY)N zSwyF4jdU^=>@q;#b_)%|0=nwjs1a2MJ06i^SRVwDq*U%vWt}w z+4loWFY}Ss>D5w#%xB;zMb;2IwQpO4VY9!I&B2jMQ0H4k9Gnciaz=J5GA{@NkiZJ| zFTjpcMd+1BGna;XXwMI|sq09K~u<|cv|z;<@mZ~S za6Wps*TljlJ966(X0pGM=8b!H*9G`Qc4H*&?o{#l_1&S;~L=)SwI08=6jA-V6m*=g_cfj`hhDb_G?t-{%@n z0|}uSU{lkJgZ{=HKY*~(nUG~bQu77rD8aOmh?J%c%wMsw|593Z3JT8znp|Vd4QHU< zz$Qp`?}b`QZvr>FK}w}R7xQ%Phm$x?6(f{>rMwcUH6j)1`PlCU@aP*|u)U0U(0{f{23^=_-W;6os#{K>qWD9AO$RqlF| z7ZE236=>Y5MX(<2r4Rc7EVFWUjRE*{IypGx!f8`_W12-SZQ^NxhCS{ zXamKCp}qxc2W=0Lp^uihyO_`Nc&n`!bPA0nBY#NH$^?Xeh zJ$mI3Vx|mW;4!mzf=tsqHR3cSqSQJ163gukB%-2=b>os#r-m3T0&&5)^M?gYrp4V zH(cz7dl$RmVmDmuhKr39u#o~bQou$E*hm2zDPS{PY=(=?aIqQg|Icurwpq-T%WJFf Ww9X@ZK`Z!k4`I+FY0cDw1^)o>yK|}l diff --git a/resources/images/backgrounds/bg_stripes_night.png b/resources/images/backgrounds/bg_stripes_night.png deleted file mode 100755 index 1ba1c39ba7d3a91f8c877abd625353325824c751..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1757 zcmcgtjZ>0$9A~xpp5a`Nkd;Yk+xh4)r)QVF=t)YMxnA_4mC1{_u$1UUU0Peh(qP&& zbH1Fcx6>;Ma7SWTn}`^txn*HZsPLujdcn3dM>^g2dE)Fp*m1nv=RW-Sy#0>iq{O&c zZgbs8B+@KqeC$RNY34%s9OW_tUcGG07$0G;#dEupxdNPhL$$1oA|LULMf}LlKiWH{s%EvPE z;XA3H_E(Nn6$h@WH`?{(eTv&PjER#gH$^p%KVXIQ7rg1zlx;_65BwWg@I+ST*E9G6 zD`T}RAD?jU)#e@~_iB#?q-b*wlT*}XKIh9=1H7>K2yNt3+Oo-;yw$(d?3vf?S1WJY zyR>w4q`Y!PpzO+D`~@<8Kz+}KknH~5-%r@SYA(ae)BkZ8}m-xVVNmU z^J;XtXi=f&alTV%a#q+48qbS^B5Z7j%HT9=s-Rz1f(4fokr-08F&e15br>3hoZd<1 zvgHUIEU!?ygd!3$SLMPIQPzQewAO*_asosGhfX7e>|f{OES}eEK}Vxt_##!0HFqrp zNw|7;K|8H814XQl@e-3U%@-Q5?>@HG72Mtz5&pUsLS4adFc!qdqwmwR6u@15l{`G z{@c+x61ogng*n0Cjcv`crb=KEnE_}_SDH8BFT9ZA&Q+(uGN1-LDk51uRvnG7tqugw z6<75RaVKQka25zUwj5gA0r}nB1Jw}fJ)Q+2?3KWB9^MMxbUKUf8UmB(g+*1j1`^AG zVIl^8D?|e|;879D7O7xbI-LW-b0y|CjUa?<3(f*TvvZ)u>yTeXA5=r^f?`TRb@{;Z ze5eL*VzE|yDA>>_P{5+X3)d6=?s~xZ?;QoZPy=2xkt`W*B15 zmq^y%fKSVPi37oNC45dJgzWttIEy7(Vg6q(_T-FclBZ?%Ck7_`5s{dT#MsL*X-EG9 DZHoP^ diff --git a/resources/inputdevicesimulator.ui b/resources/inputdevicesimulator.ui deleted file mode 100644 index eb8d006..0000000 --- a/resources/inputdevicesimulator.ui +++ /dev/null @@ -1,163 +0,0 @@ - - - InputDeviceSimulator - - - - 0 - 0 - 300 - 600 - - - - - 300 - 600 - - - - - 300 - 600 - - - - Qt::NoFocus - - - Input Device Simulator - - - - false - - - - 110 - 60 - 71 - 71 - - - - Qt::NoFocus - - - Up - - - - - false - - - - 30 - 140 - 71 - 71 - - - - Qt::NoFocus - - - Left - - - - - false - - - - 190 - 140 - 71 - 71 - - - - Qt::NoFocus - - - Right - - - - - false - - - - 110 - 220 - 71 - 71 - - - - Qt::NoFocus - - - Down - - - - - false - - - - 110 - 140 - 71 - 71 - - - - Qt::NoFocus - - - OK - - - - - - 60 - 0 - 181 - 51 - - - - under development -not functional right now - - - - - false - - - - 30 - 220 - 71 - 71 - - - - Qt::NoFocus - - - Cancel/ -Back? - - - - - - diff --git a/resources/mainwindow.ui b/resources/mainwindow.ui deleted file mode 100644 index 69c5a08..0000000 --- a/resources/mainwindow.ui +++ /dev/null @@ -1,187 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - Qt::NoFocus - - - - - - - - - - - - 0 - 60 - 800 - 480 - - - - Qt::NoFocus - - - background-image: url(:/images/backgrounds/bg_blue_day.png) - - - - - - -40 - 320 - 200 - 200 - - - - border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch; - - - - - - - 40 - 40 - 150 - 150 - - - - Qt::NoFocus - - - App 1 (dummy entry!) - - - - - - 230 - 40 - 150 - 150 - - - - Qt::NoFocus - - - App 1 (dummy entry!) - - - - - - 430 - 40 - 150 - 150 - - - - Qt::NoFocus - - - App 1 (dummy entry!) - - - - - - 620 - 40 - 150 - 150 - - - - Qt::NoFocus - - - App 1 (dummy entry!) - - - - - - 620 - 250 - 150 - 150 - - - - Qt::NoFocus - - - App 1 (dummy entry!) - - - - - - 440 - 250 - 150 - 150 - - - - Qt::NoFocus - - - App 1 (dummy entry!) - - - - - - 40 - 250 - 150 - 150 - - - - Qt::NoFocus - - - App 1 (dummy entry!) - - - - - - 240 - 250 - 150 - 150 - - - - Qt::NoFocus - - - App 1 (dummy entry!) - - - - - - - - - diff --git a/resources/systemsettingssimulator.ui b/resources/systemsettingssimulator.ui deleted file mode 100644 index c4f72cc..0000000 --- a/resources/systemsettingssimulator.ui +++ /dev/null @@ -1,83 +0,0 @@ - - - SystemSettingsSimulator - - - - 0 - 0 - 400 - 300 - - - - System Settings - - - - - 290 - 260 - 99 - 27 - - - - Qt::NoFocus - - - Exit - - - - - - 20 - 20 - 161 - 91 - - - - Day/Night Mode - - - - - 10 - 50 - 117 - 22 - - - - Qt::NoFocus - - - Night Mode - - - - - - 10 - 30 - 117 - 22 - - - - Qt::NoFocus - - - Day Mode - - - true - - - - - - - diff --git a/resources/translations/homescreen_de_DE.qm b/resources/translations/homescreen_de_DE.qm deleted file mode 100644 index 3a9c77f06d4f78beeeaff286d126f2f73c71cfd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 168 zcmcE7ks@*G{hX<16=n7(EZlq7iGhJZfPv*a3y`+t@Z0niNHb&taXB-P;A048C}1dJ zNMuN6$Y4n2077*dTI$HM57Z!DiG!|q<~1c lMi$qK%o30$@!-nhlGI$7*5J(C(wxMS{36B - - - - InputDeviceSimulator - - - Input Device Simulator - - - - - Up - - - - - Left - - - - - Right - - - - - Down - - - - - OK - - - - - MainWindow - - Exit - Beenden - - - - 00:00 - - - - - SettingsWidget - - - Form - - - - - Language - Sprache - - - - SystemSettingsSimulator - - - System Settings - - - - - Exit - Beenden - - - - Day/Night Mode - - - - - Night Mode - - - - - Day Mode - - - - diff --git a/resources/translations/homescreen_en_US.qm b/resources/translations/homescreen_en_US.qm deleted file mode 100644 index c77ee402141de17bf3b073c90f6f4a6220ef4a51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 164 zcmcE7ks@*G{hX<16=n7(EZlq7iGhJZfPv*a3y`+v@Z0niNHb&taWONH5Mc0ONMy)k zNM|So(&-GT93W{nAm;E%%u6p#OiyJ8a`=K%OG+~H(u>10Q_@pQ7(rS&7+e`DfF_l| lwXnEWWR`%Giw9R0m!#&xGzDkomgXdu - - - - InputDeviceSimulator - - - Input Device Simulator - - - - - Up - - - - - Left - - - - - Right - - - - - Down - - - - - OK - - - - - MainWindow - - Exit - Exit - - - - 00:00 - - - - - SettingsWidget - - - Form - - - - - Language - Language - - - - SystemSettingsSimulator - - - System Settings - - - - - Exit - Exit - - - - Day/Night Mode - - - - - Night Mode - - - - - Day Mode - - - - diff --git a/resources/translations/homescreen_ja_JP.qm b/resources/translations/homescreen_ja_JP.qm deleted file mode 100644 index 8d336bc450632183a8a003e10116cf3af232ac07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 819 zcmcE7ks@*G{hX<16=n7(EZlq7iGhJ3fq{Y58c6R1(gzqA7$q23w%r5r85mg3vjF*j z7+AHh0C`;u5r4k`=@)E*S;Y(tOhxP=)kZ+RG5f;4t3Y+zIQ%w!1=5}zTOC<}bOnD> zS1C}PK_-yc$qZD7Ky;rpxFk;4K5fgG1zIa-Qd2#Q-e1Ke+>4+4G{zDRe)$#fa}I@EK}?=xB)Ca zsc9wnm9sGTGkC)_F!_7qSI!iS@FQzbW_ktzcn)rfKOG+~H(u>10Q_@pQz=6mG48SD@kAT5;5~0Z@u~NY|KLxBwJh-yB zBsCYN6&{FS-8^YF4Em8WX!`kp`t|)lek0BlmcU=ZkKwknxK?C>0|md$2B(1TK7nR4 i7YVlV0F%s4gJT8{x^$yw!ENV - - - - InputDeviceSimulator - - - Input Device Simulator - 入力デバイスシミュレータ - - - - Up - アップ - - - - Left - 左 - - - - Right - 右 - - - - Down - ダウン - - - - OK - OK - - - - MainWindow - - - 00:00 - - - - - SettingsWidget - - - Form - - - - - Language - 言語 - - - - SystemSettingsSimulator - - - System Settings - システム設定 - - - - Exit - 出口 - - - - Day/Night Mode - 昼/夜モード - - - - Night Mode - ナイトモード - - - - Day Mode - デイモード - - - diff --git a/src/inputdevicesimulator.cpp b/src/inputdevicesimulator.cpp deleted file mode 100644 index fcadbc6..0000000 --- a/src/inputdevicesimulator.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "inputdevicesimulator.h" -#include "ui_inputdevicesimulator.h" -#include - - -InputDeviceSimulator::InputDeviceSimulator(QWidget *parent) : - QDialog(parent), - mp_ui(new Ui::InputDeviceSimulator), - mp_dBusInputevent(0) -{ - mp_ui->setupUi(this); - - // connect to the dBus interface provided by the input device distributor - mp_dBusInputevent = new org::agl::inputevent("org.agl.main", - "/InputEventDistributor", - QDBusConnection::sessionBus(), - 0); - - QSettings settings; - this->restoreGeometry(settings.value("inputdevicesimulator/geometry").toByteArray()); -} - -InputDeviceSimulator::~InputDeviceSimulator() -{ - QSettings settings; - settings.setValue("inputdevicesimulator/geometry", saveGeometry()); - - if (0 == mp_dBusInputevent) - { - delete mp_dBusInputevent; - } - - delete mp_ui; -} - -void InputDeviceSimulator::on_pushButtonRight_clicked() -{ - qDebug("right"); - mp_dBusInputevent->keyEvent(SystemInputEvent::INPUTEVENTTYPE_KEY_PRESSED, SystemInputEvent::INPUTEVENTZONE_1, Qt::Key_Right); -} diff --git a/src/inputdevicesimulator.h b/src/inputdevicesimulator.h deleted file mode 100644 index e22beee..0000000 --- a/src/inputdevicesimulator.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef INPUTDEVICESIMULATOR_H -#define INPUTDEVICESIMULATOR_H - -#include -#include "include/inputevent.h" -#include "inputevent_proxy.h" - -namespace Ui { -class InputDeviceSimulator; -} - -class InputDeviceSimulator : public QDialog -{ - Q_OBJECT - -public: - explicit InputDeviceSimulator(QWidget *parent = 0); - ~InputDeviceSimulator(); - -private slots: - void on_pushButtonRight_clicked(); - -private: - Ui::InputDeviceSimulator *mp_ui; - org::agl::inputevent *mp_dBusInputevent; -}; - -#endif // INPUTDEVICESIMULATOR_H diff --git a/src/inputeventdistributor.cpp b/src/inputeventdistributor.cpp deleted file mode 100644 index 911b90f..0000000 --- a/src/inputeventdistributor.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "inputeventdistributor.h" -#include - -InputEventDistributor::InputEventDistributor(QObject *parent) : - QObject(parent), - mp_inputEventAdaptor(0) -{ - // publish dbus popup interface - mp_inputEventAdaptor = new InputeventAdaptor((QObject*)this); - QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/InputEventDistributor", this); - dbus.registerService("org.agl.main"); -} - -InputEventDistributor::~InputEventDistributor() -{ - delete mp_inputEventAdaptor; -} - -void InputEventDistributor::keyEvent(int type, int zone, int key) -{ - qDebug("InputEventDistributor::keyEvent type 0x%x, key 0x%x", type, key); - - //QEvent *event; - switch (type) - { - case SystemInputEvent::INPUTEVENTTYPE_KEY_PRESSED: - - break; - default: - qDebug("InputEventDistributor::keyEvent: Type 0x%x undefined", type); - } - -} diff --git a/src/inputeventdistributor.h b/src/inputeventdistributor.h deleted file mode 100644 index fe8ed89..0000000 --- a/src/inputeventdistributor.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef INPUTEVENTDISTRIBUTOR_H -#define INPUTEVENTDISTRIBUTOR_H - -#include -#include "include/inputevent.h" -#include "inputevent_adapter.h" - - -class InputEventDistributor : public QObject -{ - Q_OBJECT -public: - explicit InputEventDistributor(QObject *parent = 0); - ~InputEventDistributor(); - -signals: - -public slots: -public Q_SLOTS: // METHODS - void keyEvent(int type, int zone, int key); -private: - InputeventAdaptor *mp_inputEventAdaptor; -}; - -#endif // INPUTEVENTDISTRIBUTOR_H diff --git a/src/popupwidget.cpp b/src/popupwidget.cpp deleted file mode 100644 index 54573ad..0000000 --- a/src/popupwidget.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "popupwidget.h" -#include "ui_popupwidget.h" - -PopupWidget::PopupWidget(QWidget *parent) : - QWidget(parent), - mp_ui(new Ui::PopupWidget), - mp_popupAdaptor(0) -{ - mp_ui->setupUi(this); - - // publish dbus popup interface - mp_popupAdaptor = new PopupAdaptor((QObject*)this); - QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/PopupWidget", this); - dbus.registerService("org.agl.mainwindow"); -} - -PopupWidget::~PopupWidget() -{ - delete mp_popupAdaptor; - delete mp_ui; -} - -void PopupWidget::showPopup(int type, const QString &text) -{ - qDebug("PopupWidget::showPopup: type %d, text %s", type, text.toStdString().c_str()); - mp_ui->label_Text->setText(text); -} - -void PopupWidget::on_pushButton_OK_clicked() -{ - this->close(); -} diff --git a/src/statusbarwidget.cpp b/src/statusbarwidget.cpp deleted file mode 100644 index 775a9ec..0000000 --- a/src/statusbarwidget.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "statusbarwidget.h" -#include "ui_statusbarwidget.h" - -StatusBarWidget::StatusBarWidget(QWidget *parent) : - QWidget(parent), - mp_ui(new Ui::StatusBarWidget), - m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system - mp_daynightmodeAdaptor(0), - mp_statusbarAdaptor(0), - m_secondsTimerId(-1) -{ - // publish dbus day night mode interface - mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this); - // publish statusbar interface - mp_statusbarAdaptor = new StatusbarAdaptor((QObject*)this); - - QDBusConnection dbus = QDBusConnection::sessionBus(); - dbus.registerObject("/StatusBarWidget", this); - dbus.registerService("org.agl.mainwindow"); - - mp_ui->setupUi(this); - - // callback every second - m_secondsTimerId = startTimer(1000); -} - -StatusBarWidget::~StatusBarWidget() -{ - delete mp_statusbarAdaptor; - delete mp_daynightmodeAdaptor; - delete mp_ui; -} - -void StatusBarWidget::setDayNightMode(int mode) -{ - switch (mode) - { - case SystemDayNight::DAYNIGHTMODE_DAY: - m_dayNightMode = SystemDayNight::DAYNIGHTMODE_DAY; - mp_ui->widget->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_stripes_day.png)")); - mp_ui->label_1->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); - mp_ui->label_2->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); - mp_ui->label_3->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); - mp_ui->label_4_Time->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); - mp_ui->label_5->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); - mp_ui->label_6->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); - mp_ui->label_7->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); - break; - case SystemDayNight::DAYNIGHTMODE_NIGHT: - m_dayNightMode = SystemDayNight::DAYNIGHTMODE_NIGHT; - mp_ui->widget->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_stripes_night.png)")); - mp_ui->label_1->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); - mp_ui->label_2->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); - mp_ui->label_3->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); - mp_ui->label_4_Time->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); - mp_ui->label_5->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); - mp_ui->label_6->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); - mp_ui->label_7->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); - break; - default: - m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; - } -} - -void StatusBarWidget::setStatus(int index, const QString &text) -{ - switch (index) - { - case 1: - mp_ui->label_1->setText(text); - break; - case 2: - mp_ui->label_2->setText(text); - break; - case 3: - mp_ui->label_3->setText(text); - break; - case 4: - qDebug("reserved for the time status"); - break; - case 5: - mp_ui->label_5->setText(text); - break; - case 6: - mp_ui->label_6->setText(text); - break; - case 7: - mp_ui->label_7->setText(text); - break; - default: - break; - } -} - -void StatusBarWidget::timerEvent(QTimerEvent *e) -{ - if (e->timerId() == m_secondsTimerId) - { - mp_ui->label_4_Time->setText(QDateTime::currentDateTime().toString("hh:mm")); - } -} - diff --git a/src/systemsettingssimulator.cpp b/src/systemsettingssimulator.cpp deleted file mode 100644 index b1ed6b3..0000000 --- a/src/systemsettingssimulator.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "systemsettingssimulator.h" -#include "ui_systemsettingssimulator.h" -#include "include/daynightmode.h" -#include - -SystemSettingsSimulator::SystemSettingsSimulator(QWidget *parent) : - QDialog(parent), - mp_ui(new Ui::SystemSettingsSimulator), - mp_dBusDayNightMode(0) -{ - mp_ui->setupUi(this); - - // connect to the dBus interface provided by the main window - mp_dBusDayNightMode = new org::agl::daynightmode("org.agl.mainwindow", - "/MainWindow", - QDBusConnection::sessionBus(), - 0); - - QSettings settings; - this->restoreGeometry(settings.value("systemsettingssimulator/geometry").toByteArray()); - mp_ui->radioButton_DayMode->setChecked(settings.value("systemsettingssimulator/daymode", true).toBool()); // if nothing is stored, use "true" - mp_ui->radioButton_NightMode->setChecked(settings.value("systemsettingssimulator/nightmode", false).toBool()); // if nothing is stored, use "false" -} - -SystemSettingsSimulator::~SystemSettingsSimulator() -{ - QSettings settings; - settings.setValue("systemsettingssimulator/geometry", saveGeometry()); - settings.setValue("systemsettingssimulator/daymode", mp_ui->radioButton_DayMode->isChecked()); - settings.setValue("systemsettingssimulator/nightmode", mp_ui->radioButton_NightMode->isChecked()); - - if (0 == mp_dBusDayNightMode) - { - delete mp_dBusDayNightMode; - } - delete mp_ui; -} - -void SystemSettingsSimulator::on_pushButton_Exit_clicked() -{ - QApplication::exit(); -} - -void SystemSettingsSimulator::on_radioButton_DayMode_toggled(bool checked) -{ - if (checked) - { - mp_dBusDayNightMode->setDayNightMode(SystemDayNight::DAYNIGHTMODE_DAY); - } -} - -void SystemSettingsSimulator::on_radioButton_NightMode_toggled(bool checked) -{ - if (checked) - { - mp_dBusDayNightMode->setDayNightMode(SystemDayNight::DAYNIGHTMODE_NIGHT); - } -} -- 2.16.6