summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsebastien baudouin <sebastien.baudouin@windriver.com>2015-03-12 16:18:51 +0100
committerroot <sebastien.baudouin@windriver.com>2015-04-01 10:03:34 +0200
commitd381c04defc530aff90977012895b48adf104f5f (patch)
treefd07fa13173880abda6df73473fb574f699f3074
parentf7091e6850397ed52c5cac7831ff6dabeb92b3c3 (diff)
downloadgenivi-demo-platform-hmi-d381c04defc530aff90977012895b48adf104f5f.tar.gz
gdp-hmi-launcher2: Add a new enhanced Launcher
This commit is adding a new launcher base on QtQuick 2.0. It is enhanced in the way is animating application icons and using OpenGL-ES for light effects
-rw-r--r--app/gdp-hmi-launcher2/LICENSE373
-rwxr-xr-xapp/gdp-hmi-launcher2/content/ContentModel.qml62
-rwxr-xr-xapp/gdp-hmi-launcher2/content/ListItem.qml66
-rwxr-xr-xapp/gdp-hmi-launcher2/content/NMapEffect.qml97
-rwxr-xr-xapp/gdp-hmi-launcher2/content/NMapLightSource.qml46
-rwxr-xr-xapp/gdp-hmi-launcher2/content/PowerOffItem.qml54
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/arrow-right.pngbin0 -> 3284 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/background_lab.jpgbin0 -> 93438 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-1.pngbin0 -> 12360 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-1n.pngbin0 -> 24008 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-1s.pngbin0 -> 1056 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-2.pngbin0 -> 23028 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-2n.pngbin0 -> 42720 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-2s.pngbin0 -> 437 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-3.pngbin0 -> 28609 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-3n.pngbin0 -> 56391 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-3s.pngbin0 -> 318 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-4.pngbin0 -> 35910 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-4n.pngbin0 -> 63788 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-4s.pngbin0 -> 317 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-5.pngbin0 -> 9930 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-5n.pngbin0 -> 20975 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-5s.pngbin0 -> 443 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-6.pngbin0 -> 28533 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-6n.pngbin0 -> 34559 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/hmi_icons_033115-6s.pngbin0 -> 1683 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/powerOff.pngbin0 -> 92394 bytes
-rwxr-xr-xapp/gdp-hmi-launcher2/content/images/spot.pngbin0 -> 23982 bytes
-rw-r--r--app/gdp-hmi-launcher2/deployment.pri27
-rw-r--r--app/gdp-hmi-launcher2/gdp-hmi-launcher2.bb70
-rw-r--r--app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp55
-rw-r--r--app/gdp-hmi-launcher2/gdp-hmi-launcher2.h65
-rw-r--r--app/gdp-hmi-launcher2/gdp-hmi-launcher2.pro47
-rwxr-xr-xapp/gdp-hmi-launcher2/gdp-hmi-launcher2.qml168
-rwxr-xr-xapp/gdp-hmi-launcher2/main.cpp51
-rw-r--r--app/gdp-hmi-launcher2/protocol/dbus/gdp-hmi-introspect.xml29
-rw-r--r--app/gdp-hmi-launcher2/qml.qrc10
37 files changed, 1220 insertions, 0 deletions
diff --git a/app/gdp-hmi-launcher2/LICENSE b/app/gdp-hmi-launcher2/LICENSE
new file mode 100644
index 0000000..14e2f77
--- /dev/null
+++ b/app/gdp-hmi-launcher2/LICENSE
@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ (a) that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+
+ (b) that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+1.6. "Executable Form"
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+1.8. "License"
+ means this document.
+
+1.9. "Licensable"
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+1.10. "Modifications"
+ means any of the following:
+
+ (a) any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+
+ (b) any new file in Source Code Form that contains any Covered
+ Software.
+
+1.11. "Patent Claims" of a Contributor
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+1.12. "Secondary License"
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+1.13. "Source Code Form"
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+ or
+
+(b) for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+* *
+* 6. Disclaimer of Warranty *
+* ------------------------- *
+* *
+* Covered Software is provided under this License on an "as is" *
+* basis, without warranty of any kind, either expressed, implied, or *
+* statutory, including, without limitation, warranties that the *
+* Covered Software is free of defects, merchantable, fit for a *
+* particular purpose or non-infringing. The entire risk as to the *
+* quality and performance of the Covered Software is with You. *
+* Should any Covered Software prove defective in any respect, You *
+* (not any Contributor) assume the cost of any necessary servicing, *
+* repair, or correction. This disclaimer of warranty constitutes an *
+* essential part of this License. No use of any Covered Software is *
+* authorized under this License except under this disclaimer. *
+* *
+************************************************************************
+
+************************************************************************
+* *
+* 7. Limitation of Liability *
+* -------------------------- *
+* *
+* Under no circumstances and under no legal theory, whether tort *
+* (including negligence), contract, or otherwise, shall any *
+* Contributor, or anyone who distributes Covered Software as *
+* permitted above, be liable to You for any direct, indirect, *
+* special, incidental, or consequential damages of any character *
+* including, without limitation, damages for lost profits, loss of *
+* goodwill, work stoppage, computer failure or malfunction, or any *
+* and all other commercial damages or losses, even if such party *
+* shall have been informed of the possibility of such damages. This *
+* limitation of liability shall not apply to liability for death or *
+* personal injury resulting from such party's negligence to the *
+* extent applicable law prohibits such limitation. Some *
+* jurisdictions do not allow the exclusion or limitation of *
+* incidental or consequential damages, so this exclusion and *
+* limitation may not apply to You. *
+* *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
diff --git a/app/gdp-hmi-launcher2/content/ContentModel.qml b/app/gdp-hmi-launcher2/content/ContentModel.qml
new file mode 100755
index 0000000..04a895e
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/ContentModel.qml
@@ -0,0 +1,62 @@
+/**
+ * Source codes are licensed under a Creative Commons Attribution 3.0 Unported
+ * License. http://creativecommons.org/licenses/by/3.0/
+ *
+ * SPDX license identifier: CC-BY-3.0
+ *
+ * Initial code writters can be contacted at: info@quitcoding.com
+ *
+ * Copyright (C) 2015 GENIVI Alliance
+ *
+ * List of changes:
+ * 16.Mar.2015, Sebastien Baudouin, modify the file to take in account the path
+ * where icons are stored and add unit field for
+ * launching application
+ *
+ */
+import QtQuick 2.0
+
+ListModel {
+ ListElement {
+ name: "Fuel Stop Advisor"
+ sourceIcon: "file://usr/share/gdp/hmi_icons_033115-1.png"
+ normalsIcon: "file://usr/share/gdp/hmi_icons_033115-1n.png"
+ shadowIcon: "file://usr/share/gdp/hmi_icons_033115-1s.png"
+ unit: "fsa.service"
+ }
+ ListElement {
+ name: "Navigation"
+ sourceIcon: "file://usr/share/gdp/hmi_icons_033115-2.png"
+ normalsIcon: "file://usr/share/gdp/hmi_icons_033115-2n.png"
+ shadowIcon: "file://usr/share/gdp/hmi_icons_033115-2s.png"
+ unit: "EGLWLMockNavigation.service"
+ }
+ ListElement {
+ name: "Audio Manager"
+ sourceIcon: "file://usr/share/gdp/hmi_icons_033115-3.png"
+ normalsIcon: "file://usr/share/gdp/hmi_icons_033115-3n.png"
+ shadowIcon: "file://usr/share/gdp/hmi_icons_033115-3s.png"
+ unit: "AudioManager_PoC.service"
+ }
+ ListElement {
+ name: "Web Browsing"
+ sourceIcon: "file://usr/share/gdp/hmi_icons_033115-4.png"
+ normalsIcon: "file://usr/share/gdp/hmi_icons_033115-4n.png"
+ shadowIcon: "file://usr/share/gdp/hmi_icons_033115-4s.png"
+ unit: "demoui.service"
+ }
+ ListElement {
+ name: "Application"
+ sourceIcon: "file://usr/share/gdp/hmi_icons_033115-5.png"
+ normalsIcon: "file://usr/share/gdp/hmi_icons_033115-5n.png"
+ shadowIcon: "file://usr/share/gdp/hmi_icons_033115-5s.png"
+ unit: "qml-example.service"
+ }
+ ListElement {
+ name: "Media Player"
+ sourceIcon: "file://usr/share/gdp/hmi_icons_033115-6.png"
+ normalsIcon: "file://usr/share/gdp/hmi_icons_033115-6n.png"
+ shadowIcon: "file://usr/share/gdp/hmi_icons_033115-6s.png"
+ unit: "EGLWLInputEventExample.service"
+ }
+}
diff --git a/app/gdp-hmi-launcher2/content/ListItem.qml b/app/gdp-hmi-launcher2/content/ListItem.qml
new file mode 100755
index 0000000..bfa63bf
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/ListItem.qml
@@ -0,0 +1,66 @@
+/**
+ * Source codes are licensed under a Creative Commons Attribution 3.0 Unported
+ * License. http://creativecommons.org/licenses/by/3.0/
+ *
+ * SPDX license identifier: CC-BY-3.0
+ *
+ * Initial code writters can be contacted at: info@quitcoding.com
+ *
+ * Copyright (C) 2015 GENIVI Alliance
+ *
+ * List of changes:
+ * 16.Mar.2015, Sebastien Baudouin, modify the file to start the application
+ * associated to the selected item
+ *
+ */
+import QtQuick 2.0
+
+Item {
+ id: root
+ width: 256
+ height: 256
+
+ property string name: model.name
+ property bool isSelected: pathView.currentIndex === model.index
+ property real fogAmount: PathView.iconFog
+
+ z: PathView.iconZ
+ scale: PathView.iconScale
+
+ Image {
+ id: shadowSource
+ source: model.shadowIcon
+ width: nmapItem.width
+ height: nmapItem.height
+ anchors.centerIn: nmapItem
+ anchors.horizontalCenterOffset: ((root.x + root.width/2) - (lightSourceItem.width/2)) * 0.05
+ anchors.verticalCenterOffset: ((root.y + root.height/2) - (lightSourceItem.height/2)) * 0.05 + (settings.spotAnimationPosition - 25) * (0.8 - fogAmount)
+ opacity: 0.2 + (fogAmount*0.8)
+ scale: 1.2 - (fogAmount*0.4)
+ }
+
+ NMapEffect {
+ id: nmapItem
+ sourceImage: model.sourceIcon
+ normalsImage: model.normalsIcon
+ lightSource: lightSourceItem
+ switchX: true
+ switchY: true
+ elementPositionX: root.x
+ elementPositionY: root.y
+ colorizeAmount: fogAmount
+ diffuseBoost: 0.5
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (isSelected) {
+ // Open the item
+ mainView.appSelectSignal(model.unit)
+ } else {
+ pathView.currentIndex = model.index;
+ }
+ }
+ }
+}
diff --git a/app/gdp-hmi-launcher2/content/NMapEffect.qml b/app/gdp-hmi-launcher2/content/NMapEffect.qml
new file mode 100755
index 0000000..05694e6
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/NMapEffect.qml
@@ -0,0 +1,97 @@
+/**
+ * Source codes are licensed under a Creative Commons Attribution 3.0 Unported
+ * License. http://creativecommons.org/licenses/by/3.0/
+ *
+ * SPDX license identifier: CC-BY-3.0
+ *
+ * Initial code writters can be contacted at: info@quitcoding.com
+ *
+ * Copyright (C) 2015 GENIVI Alliance
+ *
+ * List of changes:
+ *
+ */
+import QtQuick 2.0
+
+/* Simple normal mapping shader */
+
+ShaderEffect {
+ id: root
+ // Original image
+ property string sourceImage
+ // Normal mapped image
+ property string normalsImage
+ // Lightsource which defines the position of light
+ property NMapLightSource lightSource
+ // Boost diffuse effect of this item
+ property real diffuseBoost: 0.0
+ // Light intensity from source or alternatively custom intensity for this item
+ property real lightIntensity: lightSource.lightIntensity
+ // Switch x-coordinate of normal mapped image
+ property bool switchX: false
+ // Switch y-coordinate of normal mapped image
+ property bool switchY: false
+ // Set these in case this item isn't directly under main area
+ property real elementPositionX: root.x
+ property real elementPositionY: root.y
+ // Optional 'colorize' effect to apply for the item, can be used for fog effect
+ property color colorizeColor: "#404040"
+ property real colorizeAmount: 0.0
+ // Sizes of the original pixmap
+ property real originalWidth: sourceImageItem.sourceSize.width
+ property real originalHeight: sourceImageItem.sourceSize.height
+
+ /* Private */
+ property real _lightPosX: lightSource.lightPosX / lightSource.width * (lightSource.width/root.width) - elementPositionX/root.width
+ property real _lightPosY: lightSource.lightPosY / lightSource.height * (lightSource.height/root.height) - elementPositionY/root.height
+ property variant _source: ShaderEffectSource { sourceItem: sourceImageItem; hideSource: true }
+ property variant _source2: ShaderEffectSource { sourceItem: normalsourceImageItem; hideSource: true }
+
+ width: sourceImageItem.width
+ height: sourceImageItem.height
+
+ Image {
+ id: sourceImageItem
+ source: sourceImage
+ visible: false
+ }
+ Image {
+ id: normalsourceImageItem
+ source: normalsImage
+ visible: false
+ }
+
+ fragmentShader: "
+ varying highp vec2 qt_TexCoord0;
+ uniform highp float qt_Opacity;
+ uniform sampler2D _source;
+ uniform sampler2D _source2;
+ uniform highp float _lightPosX;
+ uniform highp float _lightPosY;
+ uniform highp float diffuseBoost;
+ uniform highp float lightIntensity;
+ uniform highp float colorizeAmount;
+ uniform highp vec4 colorizeColor;
+ uniform bool switchX;
+ uniform bool switchY;
+
+ void main(void)
+ {
+ highp vec2 pixPos = qt_TexCoord0;
+ highp vec4 pix = texture2D(_source, pixPos.st);
+ highp vec4 pix2 = texture2D(_source2, pixPos.st);
+ highp vec3 normal = normalize(pix2.rgb * 2.0 - 1.0);
+ highp float xp = float(switchX) * (_lightPosX - pixPos.x) + float(!switchX) * (pixPos.x - _lightPosX);
+ highp float yp = float(switchY) * (_lightPosY - pixPos.y) + float(!switchY) * (pixPos.y - _lightPosY);
+ highp vec3 light_pos = normalize(vec3(xp, yp, lightIntensity));
+
+ highp float diffuse = max(dot(normal, light_pos), 0.2);
+ diffuse *= (1.0 + diffuseBoost);
+
+ highp vec4 color = vec4(diffuse * pix.rgb, pix.a);
+ color = mix(color, color.a * colorizeColor, colorizeAmount);
+
+ gl_FragColor = color * qt_Opacity;
+ }
+ "
+}
diff --git a/app/gdp-hmi-launcher2/content/NMapLightSource.qml b/app/gdp-hmi-launcher2/content/NMapLightSource.qml
new file mode 100755
index 0000000..b0c787f
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/NMapLightSource.qml
@@ -0,0 +1,46 @@
+/**
+ * Source codes are licensed under a Creative Commons Attribution 3.0 Unported
+ * License. http://creativecommons.org/licenses/by/3.0/
+ *
+ * SPDX license identifier: CC-BY-3.0
+ *
+ * Initial code writters can be contacted at: info@quitcoding.com
+ *
+ * Copyright (C) 2015 GENIVI Alliance
+ *
+ * List of changes:
+ *
+ */
+import QtQuick 2.0
+
+/* Light source for the normal mapping shader */
+
+Item {
+ id: root
+
+ // The position of light, read-only to keep translate
+ property real lightPosX: priv.lPosX + lightTranslateX
+ property real lightPosY: priv.lPosY + lightTranslateY
+
+ // Translate position, for e.g. animating light slightly
+ property real lightTranslateX: 0
+ property real lightTranslateY: 0
+
+ // The intensity of light
+ property real lightIntensity: 0.4;
+
+ // Set the position for light, forces inside the area
+ function setLightPos(xpos, ypos) {
+ priv.lPosX = Math.min(root.width, Math.max(0, xpos));
+ priv.lPosY = Math.min(root.height, Math.max(0, ypos));
+ }
+
+ // This item should fill the whole area where light is used
+ anchors.fill: parent
+
+ Item {
+ id: priv
+ property real lPosX: root.width/2;
+ property real lPosY: root.height/2;
+ }
+}
diff --git a/app/gdp-hmi-launcher2/content/PowerOffItem.qml b/app/gdp-hmi-launcher2/content/PowerOffItem.qml
new file mode 100755
index 0000000..ea198e4
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/PowerOffItem.qml
@@ -0,0 +1,54 @@
+/**
+ * SPDX license identifier: MPL-2.0
+ *
+ * Copyright (C) 2015 GENIVI Alliance
+ *
+ * This file is part of GENIVI Demo Platform HMI.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License (MPL), v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ * List of changes:
+ * 16.Mar.2015, Sebastien Baudouin, written based on template created by QtCreator
+ *
+ */
+import QtQuick 2.0
+
+Item {
+ id: root
+
+ width: 96
+ height: 108
+
+ Image {
+ id: powerOffImage
+ x: -78
+ y: -82
+ source: "file://usr/share/gdp/powerOff.png"
+ scale:0.3
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ mainView.requestOffSignal();
+ }
+ }
+
+ }
+
+ Text {
+ x: 10
+ height: 16
+ anchors.right: parent.right
+ anchors.verticalCenter: powerOffImage.verticalCenter
+ color: "#ffffff"
+ style: Text.Outline
+ styleColor: "#606060"
+ font.pixelSize: 19
+ text: "PowerOff"
+ anchors.verticalCenterOffset: 46
+ anchors.rightMargin: 8
+ }
+}
diff --git a/app/gdp-hmi-launcher2/content/images/arrow-right.png b/app/gdp-hmi-launcher2/content/images/arrow-right.png
new file mode 100755
index 0000000..98d9b86
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/arrow-right.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/background_lab.jpg b/app/gdp-hmi-launcher2/content/images/background_lab.jpg
new file mode 100755
index 0000000..251d184
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/background_lab.jpg
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1.png
new file mode 100755
index 0000000..fc637a2
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1n.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1n.png
new file mode 100755
index 0000000..71dc511
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1n.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1s.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1s.png
new file mode 100755
index 0000000..b7dcea1
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-1s.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2.png
new file mode 100755
index 0000000..7552f5a
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2n.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2n.png
new file mode 100755
index 0000000..b496b78
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2n.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2s.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2s.png
new file mode 100755
index 0000000..e0f911e
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-2s.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3.png
new file mode 100755
index 0000000..6fec203
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3n.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3n.png
new file mode 100755
index 0000000..a0bd66f
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3n.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3s.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3s.png
new file mode 100755
index 0000000..16f509b
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-3s.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4.png
new file mode 100755
index 0000000..88264de
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4n.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4n.png
new file mode 100755
index 0000000..c983e8d
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4n.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4s.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4s.png
new file mode 100755
index 0000000..48fce46
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-4s.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5.png
new file mode 100755
index 0000000..b31fdea
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5n.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5n.png
new file mode 100755
index 0000000..983c23c
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5n.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5s.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5s.png
new file mode 100755
index 0000000..ee7e1d4
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-5s.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6.png
new file mode 100755
index 0000000..82549ac
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6n.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6n.png
new file mode 100755
index 0000000..1d333b1
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6n.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6s.png b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6s.png
new file mode 100755
index 0000000..3c58113
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/hmi_icons_033115-6s.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/powerOff.png b/app/gdp-hmi-launcher2/content/images/powerOff.png
new file mode 100755
index 0000000..3ae8435
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/powerOff.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/content/images/spot.png b/app/gdp-hmi-launcher2/content/images/spot.png
new file mode 100755
index 0000000..b064054
--- /dev/null
+++ b/app/gdp-hmi-launcher2/content/images/spot.png
Binary files differ
diff --git a/app/gdp-hmi-launcher2/deployment.pri b/app/gdp-hmi-launcher2/deployment.pri
new file mode 100644
index 0000000..5441b63
--- /dev/null
+++ b/app/gdp-hmi-launcher2/deployment.pri
@@ -0,0 +1,27 @@
+android-no-sdk {
+ target.path = /data/user/qt
+ export(target.path)
+ INSTALLS += target
+} else:android {
+ x86 {
+ target.path = /libs/x86
+ } else: armeabi-v7a {
+ target.path = /libs/armeabi-v7a
+ } else {
+ target.path = /libs/armeabi
+ }
+ export(target.path)
+ INSTALLS += target
+} else:unix {
+ isEmpty(target.path) {
+ qnx {
+ target.path = /tmp/$${TARGET}/bin
+ } else {
+ target.path = /opt/$${TARGET}/bin
+ }
+ export(target.path)
+ }
+ INSTALLS += target
+}
+
+export(INSTALLS)
diff --git a/app/gdp-hmi-launcher2/gdp-hmi-launcher2.bb b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.bb
new file mode 100644
index 0000000..c38ee14
--- /dev/null
+++ b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.bb
@@ -0,0 +1,70 @@
+# Copyright (C) 2015 GENIVI Alliance
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "GENIVI Demo Platform HMI - Launcher2"
+HOMEPAGE = "http://projects.genivi.org/genivi-demo-platform/"
+LICENSE = "MPL-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad"
+
+DEPENDS = "qtbase qtdeclarative gdp-hmi-panel"
+
+inherit qmake5
+inherit externalsrc
+EXTERNALSRC = ""
+
+PV = "1.0"
+
+FILES_${PN} += "\
+ ${datadir}/gdp/* \
+ "
+
+do_install_append() {
+ install -d ${D}${datadir}/gdp
+ install -m 0444 ${S}/content/images/hmi_icons_033115-1.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-1.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-2.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-2.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-3.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-3.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-4.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-4.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-5.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-5.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-6.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-6.png
+
+ install -m 0444 ${S}/content/images/hmi_icons_033115-1n.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-1n.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-2n.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-2n.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-3n.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-3n.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-4n.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-4n.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-5n.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-5n.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-6n.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-6n.png
+
+ install -m 0444 ${S}/content/images/hmi_icons_033115-1s.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-1s.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-2s.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-2s.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-3s.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-3s.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-4s.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-4s.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-5s.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-5s.png
+ install -m 0444 ${S}/content/images/hmi_icons_033115-6s.png \
+ ${D}${datadir}/gdp/hmi_icons_033115-6s.png
+
+ install -m 0444 ${S}/content/images/arrow-right.png \
+ ${D}${datadir}/gdp/arrow-right.png
+ install -m 0444 ${S}/content/images/background_lab.jpg \
+ ${D}${datadir}/gdp/background_lab.jpg
+ install -m 0444 ${S}/content/images/spot.png \
+ ${D}${datadir}/gdp/spot.png
+ install -m 0444 ${S}/content/images/powerOff.png \
+ ${D}${datadir}/gdp/powerOff.png
+}
diff --git a/app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp
new file mode 100644
index 0000000..b626f9b
--- /dev/null
+++ b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.cpp
@@ -0,0 +1,55 @@
+/**
+ * SPDX license identifier: MPL-2.0
+ *
+ * Copyright (C) 2015, GENIVI Alliance
+ *
+ * This file is part of GENIVI Demo Platform HMI.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License (MPL), v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ * List of changes:
+ * 16.Mar.2015, Sebastien Baudouin, written
+ */
+
+/*! \file gdp-hmi-launcher2.cpp
+ * \brief HMI launcher class for the GENIVI Demo Platform
+ *
+ * This component implements the HMI launcher class of the
+ * GENIVI Demo Platform.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <systemd/sd-journal.h>
+
+#include "gdp-hmi-launcher2.h"
+
+static const char *GDP_HMI_PID_FILENAME = "/var/run/gdp-hmi-controller.pid";
+static const char *GDP_DBUS_SERVICE_NAME = "org.genivi.gdp.hmi.controller";
+static const char *GDP_DBUS_SERVICE_PATH = "/org/genivi/gdp/hmi/controller";
+
+GDPLauncherClass::GDPLauncherClass()
+: m_hmiControllerPid(-1)
+{
+ sd_journal_print(LOG_DEBUG, "Debug: GDPLauncherClass - dbus session.\n");
+ m_controller = new org::genivi::gdp::HMI_Controller(GDP_DBUS_SERVICE_NAME,
+ GDP_DBUS_SERVICE_PATH, QDBusConnection::sessionBus(), this);
+ m_timerId = startTimer(5000); // 5 second timer
+}
+
+GDPLauncherClass::~GDPLauncherClass()
+{
+}
+
+void GDPLauncherClass::timerEvent(QTimerEvent *event)
+{
+ Q_UNUSED(event);
+ if ( !(m_controller->isValid()) ) {
+ sd_journal_print(LOG_INFO, "Info: HMI Controller - disconnected.\n");
+ }
+}
diff --git a/app/gdp-hmi-launcher2/gdp-hmi-launcher2.h b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.h
new file mode 100644
index 0000000..d13e91b
--- /dev/null
+++ b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.h
@@ -0,0 +1,65 @@
+/**
+ * SPDX license identifier: MPL-2.0
+ *
+ * Copyright (C) 2015, GENIVI Alliance
+ *
+ * This file is part of GENIVI Demo Platform HMI.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License (MPL), v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ * List of changes:
+ * 16.Mar.2015, Sebastien Baudouin, written
+ * 16.Mar.2015, Sebastien Baudouin, added supprot for dbus
+ */
+
+#ifndef GDP_HMI_LAUNCHER2_H
+#define GDP_HMI_LAUNCHER2_H
+
+#include <QDebug>
+#include <QObject>
+#include <QString>
+#include <QtDBus>
+
+#include <signal.h>
+#include <sys/types.h>
+#include <systemd/sd-journal.h>
+
+#include "gdp-hmi-introspect_interface.h"
+
+class GDPLauncherClass : public QObject
+{
+ Q_OBJECT
+
+public:
+ GDPLauncherClass();
+ ~GDPLauncherClass();
+
+public slots:
+ void hmiRequestOffSlot() {
+ QString unit = QStringLiteral("poweroff.target");
+ QString status = m_controller->Show(unit);
+ sd_journal_print(LOG_DEBUG,
+ "DEBUG: controller->Show(\"%s\") -> %s\n",
+ unit.toLatin1().data(), status.toLatin1().data());
+ }
+ void hmiAppLaunchSlot(const QString &unit) {
+ QString status = m_controller->Show(unit);
+ sd_journal_print(LOG_DEBUG,
+ "DEBUG: controller->Show(\"%s\") -> %s\n",
+ unit.toLatin1().data(), status.toLatin1().data());
+ }
+
+protected:
+ void timerEvent(QTimerEvent *event);
+
+private:
+ pid_t m_hmiControllerPid;
+ int m_timerId;
+ org::genivi::gdp::HMI_Controller *m_controller;
+};
+
+#endif // GDP_HMI_LAUNCHER2_H
diff --git a/app/gdp-hmi-launcher2/gdp-hmi-launcher2.pro b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.pro
new file mode 100644
index 0000000..109e690
--- /dev/null
+++ b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.pro
@@ -0,0 +1,47 @@
+# SPDX license identifier: MPL-2.0
+#
+# Copyright (C) 2015, GENIVI Alliance
+#
+# This file is part of GENIVI Demo Platform HMI.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License (MPL), v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# For further information see http://www.genivi.org/.
+#
+# List of changes:
+# 16.Mar.2015, Sebastien Baudouin, created using QtCreator
+# 16.Mar.2015, Sebastien Baudouin, added gdp-hmi-launcher2 sources and headers
+# 16.Mar.2015, Sebastien Baudouin, added support for dbus
+
+TEMPLATE = app
+
+QT += dbus qml quick widgets
+
+DBUS_INTERFACES += \
+ protocol/dbus/gdp-hmi-introspect.xml
+
+HEADERS += \
+ gdp-hmi-launcher2.h
+
+SOURCES += \
+ main.cpp \
+ gdp-hmi-launcher2.cpp
+
+RESOURCES += qml.qrc
+
+# Additional import path used to resolve QML modules in Qt Creator's code model
+QML_IMPORT_PATH =
+
+# enable C standard as published in 2011 as ISO/IEC 9899:2011 (known as C11)
+CONFIG += c++11
+
+LIBS += -lsystemd
+
+target.path = /usr/bin
+
+# Default rules for deployment.
+include(deployment.pri)
+
+DISTFILES +=
diff --git a/app/gdp-hmi-launcher2/gdp-hmi-launcher2.qml b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.qml
new file mode 100755
index 0000000..caf764c
--- /dev/null
+++ b/app/gdp-hmi-launcher2/gdp-hmi-launcher2.qml
@@ -0,0 +1,168 @@
+/**
+ * Source codes are licensed under a Creative Commons Attribution 3.0 Unported
+ * License. http://creativecommons.org/licenses/by/3.0/
+ *
+ * SPDX license identifier: CC-BY-3.0
+ *
+ * Initial code writters can be contacted at: info@quitcoding.com
+ *
+ * Copyright (C) 2015 GENIVI Alliance
+ *
+ * List of changes:
+ * 16.Mar.2015, Sebastien Baudouin, modify the file to take in account our screen
+ * aspect ratio and the path where icons are
+ * stored and add a new item for powerOff
+ *
+ */
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+import "content"
+
+Item {
+ id: mainView
+
+ width: 1024
+ height: 768
+
+ signal appSelectSignal(string unit)
+ signal requestOffSignal()
+
+ QtObject {
+ id: settings
+ property real spotAnimationPosition: 0.0
+ SequentialAnimation on spotAnimationPosition {
+ loops: Animation.Infinite
+ NumberAnimation { to: 30; duration: 2000; easing.type: Easing.InOutQuad }
+ NumberAnimation { to: 0; duration: 2000; easing.type: Easing.InOutQuad }
+ }
+ }
+
+ Image {
+ anchors.fill: parent
+ source: "file://usr/share/gdp/background_lab.jpg"
+ }
+
+ ContentModel {
+ id: listModel
+ }
+
+ NMapLightSource {
+ id: lightSourceItem
+ z: 10
+ lightPosX: mainView.width * 0.5
+ lightPosY: mainView.height * 0.8 - settings.spotAnimationPosition * 5
+ lightIntensity: 0.3
+ }
+
+ PathView {
+ id: pathView
+ anchors.fill: parent
+ model: listModel
+ delegate: ListItem {
+ onIsSelectedChanged: {
+ if (isSelected) {
+ nameTextItem.text = model.name
+ }
+ }
+ }
+ path: Path {
+ startX: mainView.width*0.5; startY: mainView.height*0.68
+ PathAttribute { name: "iconScale"; value: 0.8 }
+ PathAttribute { name: "iconZ"; value: 100.0 }
+ PathAttribute { name: "iconFog"; value: 0.0 }
+ PathQuad { x: mainView.width*0.5; y: mainView.height*0.2; controlX: mainView.width*1.1; controlY: mainView.height*0.2 }
+ PathAttribute { name: "iconScale"; value: 0.46 }
+ PathAttribute { name: "iconZ"; value: 1.0 }
+ PathAttribute { name: "iconFog"; value: 0.5 }
+ PathQuad { x: mainView.width*0.5; y: mainView.height*0.68; controlX: -mainView.width*0.1; controlY: mainView.height*0.2 }
+ }
+ focus: true
+ Keys.onPressed: {
+ if (event.key === Qt.Key_Left) {
+ pathView.decrementCurrentIndex();
+ event.accepted = true;
+ }
+ if (event.key === Qt.Key_Right) {
+ pathView.incrementCurrentIndex();
+ event.accepted = true;
+ }
+ }
+ }
+
+ Text {
+ id: nameTextItem
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: parent.height * 0.08
+ font.pixelSize: 68
+ color: "#d0d0d0"
+ style: Text.Outline
+ styleColor: "#404040"
+ visible: false
+ }
+
+ DropShadow {
+ anchors.fill: nameTextItem
+ horizontalOffset: 0
+ verticalOffset: settings.spotAnimationPosition * 0.5 - 8
+ radius: 14.0
+ samples: 16
+ color: "#000000"
+ source: nameTextItem
+ opacity: 0.6
+ }
+
+ Image {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: parent.height * 0.01
+ anchors.right: parent.right
+ anchors.rightMargin: Math.max(8, parent.width * 0.15 - 100)
+ source: "file://usr/share/gdp/arrow-right.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: pathView.incrementCurrentIndex()
+ }
+ }
+
+ Image {
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: parent.height * 0.01
+ anchors.left: parent.left
+ anchors.leftMargin: Math.max(8, parent.width * 0.15 - 100)
+ mirror: true
+ source: "file://usr/share/gdp/arrow-right.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: pathView.decrementCurrentIndex()
+ }
+ }
+
+ Image {
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.horizontalCenterOffset: 150
+ source: "file://usr/share/gdp/spot.png"
+ transformOrigin: Item.BottomRight
+ width: 500
+ height: 200
+ rotation: settings.spotAnimationPosition * 0.8
+ opacity: 0.2
+ }
+
+ Image {
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.horizontalCenterOffset: -150
+ source: "file://usr/share/gdp/spot.png"
+ mirror: true
+ transformOrigin: Item.BottomLeft
+ width: 500
+ height: 200
+ rotation: -settings.spotAnimationPosition * 0.8
+ opacity: 0.2
+ }
+
+ PowerOffItem {
+ id: powerOffItem
+ }
+}
diff --git a/app/gdp-hmi-launcher2/main.cpp b/app/gdp-hmi-launcher2/main.cpp
new file mode 100755
index 0000000..3aea5bb
--- /dev/null
+++ b/app/gdp-hmi-launcher2/main.cpp
@@ -0,0 +1,51 @@
+/**
+ * SPDX license identifier: MPL-2.0
+ *
+ * Copyright (C) 2015 GENIVI Alliance
+ *
+ * This file is part of GENIVI Demo Platform HMI.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License (MPL), v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ * List of changes:
+ * 16.Mar.2015, Sebastien Baudouin, written based on template created by QtCreator
+ */
+#include <QGuiApplication>
+#include <QQuickView>
+#include <QtDBus>
+#include <systemd/sd-journal.h>
+
+#include "gdp-hmi-launcher2.h"
+#define GDP_LAUNCHER2_SURFACE_ID 1
+
+int main(int argc, char* argv[])
+{
+ setenv("QT_QPA_PLATFORM", "wayland", 1); // force to use wayland plugin
+ setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1);
+
+ sd_journal_print(LOG_DEBUG, "GDP: launcher2 surface (id=%u)",
+ GDP_LAUNCHER2_SURFACE_ID);
+
+ QObject *object;
+ QGuiApplication app(argc,argv);
+
+ QQuickView view(QUrl(QStringLiteral("qrc:/gdp-hmi-launcher2.qml")));
+
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ object = (QObject *)view.rootObject();
+
+ GDPLauncherClass launcher2;
+ QObject::connect(object, SIGNAL(appSelectSignal(QString)),
+ &launcher2, SLOT(hmiAppLaunchSlot(QString)));
+ QObject::connect(object, SIGNAL(requestOffSignal()),
+ &launcher2, SLOT(hmiRequestOffSlot()));
+
+ view.setProperty("IVI-Surface-ID", GDP_LAUNCHER2_SURFACE_ID);
+ view.showFullScreen();
+
+ return app.exec();
+}
diff --git a/app/gdp-hmi-launcher2/protocol/dbus/gdp-hmi-introspect.xml b/app/gdp-hmi-launcher2/protocol/dbus/gdp-hmi-introspect.xml
new file mode 100644
index 0000000..c87f9ce
--- /dev/null
+++ b/app/gdp-hmi-launcher2/protocol/dbus/gdp-hmi-introspect.xml
@@ -0,0 +1,29 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+ "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+<!--
+ * SPDX license identifier: MPL-2.0
+ *
+ * Copyright (C) 2015, GENIVI Alliance
+ *
+ * This file is part of GENIVI Demo Platform HMI.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License (MPL), v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For further information see http://www.genivi.org/.
+ *
+ * List of changes:
+ * 16.Mar.2015, Seabstien Baudouin, written
+-->
+<node name="/org/genivi/gdp/hmi/controller">
+ <interface name="org.genivi.gdp.HMI_Controller">
+ <method name="GetId">
+ <arg type="x" name="pid" direction="out"/>
+ </method>
+ <method name="Show">
+ <arg type="s" name="unit" direction="in"/>
+ <arg type="s" name="status" direction="out"/>
+ </method>
+ </interface>
+</node>
diff --git a/app/gdp-hmi-launcher2/qml.qrc b/app/gdp-hmi-launcher2/qml.qrc
new file mode 100644
index 0000000..2e9b3f2
--- /dev/null
+++ b/app/gdp-hmi-launcher2/qml.qrc
@@ -0,0 +1,10 @@
+<RCC>
+ <qresource prefix="/">
+ <file>gdp-hmi-launcher2.qml</file>
+ <file>content/ContentModel.qml</file>
+ <file>content/ListItem.qml</file>
+ <file>content/NMapEffect.qml</file>
+ <file>content/NMapLightSource.qml</file>
+ <file>content/PowerOffItem.qml</file>
+ </qresource>
+</RCC>