summaryrefslogtreecommitdiff
path: root/src/hmi/gimp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hmi/gimp')
-rw-r--r--src/hmi/gimp/README.md27
-rw-r--r--src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcfbin0 -> 1010727 bytes
-rwxr-xr-xsrc/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapBottom.xcfbin0 -> 84008 bytes
-rwxr-xr-xsrc/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapGuidance.xcfbin0 -> 9683 bytes
-rwxr-xr-xsrc/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapManeuver.xcfbin0 -> 15573 bytes
-rwxr-xr-xsrc/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcfbin0 -> 23531 bytes
-rw-r--r--src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapScale.xcfbin0 -> 2495 bytes
-rwxr-xr-xsrc/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapScroll.xcfbin0 -> 8053 bytes
-rwxr-xr-xsrc/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapSettings.xcfbin0 -> 47551 bytes
-rwxr-xr-xsrc/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapSimulation.xcfbin0 -> 25563 bytes
-rw-r--r--src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapTop.xcfbin0 -> 37753 bytes
-rwxr-xr-xsrc/hmi/gimp/gdp-theme/800x480/NavigationAppMain.xcfbin0 -> 347325 bytes
-rw-r--r--src/hmi/gimp/gdp-theme/800x480/NavigationAppPOI.xcfbin0 -> 217711 bytes
-rw-r--r--src/hmi/gimp/gdp-theme/800x480/NavigationAppSearch.xcfbin0 -> 363735 bytes
-rw-r--r--src/hmi/gimp/gdp-theme/800x480/NavigationAppSettings.xcfbin0 -> 226115 bytes
-rw-r--r--src/hmi/gimp/gdp-theme/800x480/NavigationAppTripComputer.xcfbin0 -> 476223 bytes
-rw-r--r--src/hmi/gimp/gdp-theme/800x480/button-keyboard.xcfbin0 -> 4432 bytes
-rw-r--r--src/hmi/gimp/gdp-theme/LICENSE8
-rw-r--r--src/hmi/gimp/generate-style-sheet.py198
19 files changed, 233 insertions, 0 deletions
diff --git a/src/hmi/gimp/README.md b/src/hmi/gimp/README.md
new file mode 100644
index 0000000..39d69ad
--- /dev/null
+++ b/src/hmi/gimp/README.md
@@ -0,0 +1,27 @@
+# How to generate a new style sheet
+
+## Synopsis
+The HMI of FSA is generated from the Gimp files, by using a python script. It allows to quickly relook the HMI.
+
+## Important notice
+Please don't change the layer names of the xcf files, the qml content is based on it
+Gimp version tested: 2.8
+
+## To load the script in python:
+exit Gimp
+sudo cp generate-style-sheet.py /usr/lib/gimp/2.0/plug-ins
+sudo chmod +x /usr/lib/gimp/2.0/plug-ins/generate-style-sheet.py
+
+## To create the style sheets
+Without the batch (from Gimp):
+To generate a style sheet and the images:
+launch Gimp
+Genivi/Generate style sheet
+Choose the target (must be qml/Core)
+Press OK
+
+With the batch:
+build.sh -c -t (under src folder)
+
+
+
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf
new file mode 100644
index 0000000..550d56b
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMap.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapBottom.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapBottom.xcf
new file mode 100755
index 0000000..ac7c57e
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapBottom.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapGuidance.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapGuidance.xcf
new file mode 100755
index 0000000..b5178cd
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapGuidance.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapManeuver.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapManeuver.xcf
new file mode 100755
index 0000000..a9467d6
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapManeuver.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcf
new file mode 100755
index 0000000..89cf390
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapRoute.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapScale.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapScale.xcf
new file mode 100644
index 0000000..2e70727
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapScale.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapScroll.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapScroll.xcf
new file mode 100755
index 0000000..27f6842
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapScroll.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapSettings.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapSettings.xcf
new file mode 100755
index 0000000..7be59a8
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapSettings.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapSimulation.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapSimulation.xcf
new file mode 100755
index 0000000..5e3c8f1
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapSimulation.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapTop.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapTop.xcf
new file mode 100644
index 0000000..631edab
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppBrowseMapTop.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppMain.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppMain.xcf
new file mode 100755
index 0000000..2f1e14f
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppMain.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppPOI.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppPOI.xcf
new file mode 100644
index 0000000..f3cd72a
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppPOI.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppSearch.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppSearch.xcf
new file mode 100644
index 0000000..7d6d9a6
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppSearch.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppSettings.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppSettings.xcf
new file mode 100644
index 0000000..49ab7ed
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppSettings.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/NavigationAppTripComputer.xcf b/src/hmi/gimp/gdp-theme/800x480/NavigationAppTripComputer.xcf
new file mode 100644
index 0000000..5b418c2
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/NavigationAppTripComputer.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/800x480/button-keyboard.xcf b/src/hmi/gimp/gdp-theme/800x480/button-keyboard.xcf
new file mode 100644
index 0000000..d17386f
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/800x480/button-keyboard.xcf
Binary files differ
diff --git a/src/hmi/gimp/gdp-theme/LICENSE b/src/hmi/gimp/gdp-theme/LICENSE
new file mode 100644
index 0000000..47c14d8
--- /dev/null
+++ b/src/hmi/gimp/gdp-theme/LICENSE
@@ -0,0 +1,8 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+
+Copyright (C) 2015, PCA Peugeot Citroen
+
+Author Philippe Colliot <philippe.colliot@mpsa.com>
+
+This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 Unported License.
+To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
diff --git a/src/hmi/gimp/generate-style-sheet.py b/src/hmi/gimp/generate-style-sheet.py
new file mode 100644
index 0000000..f3c9735
--- /dev/null
+++ b/src/hmi/gimp/generate-style-sheet.py
@@ -0,0 +1,198 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# @licence app begin@
+# SPDX-License-Identifier: MPL-2.0
+#
+# \copyright Copyright (C) 2013-2014, PCA Peugeot Citroen
+#
+# \file generate-style-sheet.py
+#
+# \brief This file is a script to generate the style sheet of the navigation hmi.
+#
+# \author Philippe Colliot <philippe.colliot@mpsa.com>
+# \version 1.0
+#
+# Thanks to Michel Ardan, Saul Goode for hints I found into their code :-)
+#
+# 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:
+# 17-7-2014, philippe colliot, fix rgba bug for migration to Qt 5
+# 22-8-2014, philippe colliot, clean up obsolete banner
+# <date>, <name>, <description of change>
+#
+# @licence end@
+
+
+import os, glob
+import xml.dom
+import xml.dom.minidom
+import string
+from gimpfu import *
+from gimpenums import *
+
+image_path = "../images/"
+
+def format_color(color) :
+ return "Qt.rgba(%.2f, %.2f, %.2f, %.2f)" % (color[0]/255.0,color[1]/255.0,color[2]/255.0,color[3]/255.0)
+
+def get_js_header():
+ header = ['/* This file is generated */','.pragma library','Qt.include("style-constants.js");','']
+ return header
+
+def generate_style_image_layer(layer):
+ layer_name=layer.name
+ return_list = []
+ # format name for the object (replace - with _ ), dash is prohibited in qml
+ object_name = string.replace(layer_name, '-', '_')
+ str = 'var '+object_name+'=new Object;'
+ return_list.append(str)
+ str = object_name+'[SOURCE]='+'"'+image_path+layer_name+'.png'+'"'+';'
+ return_list.append(str)
+ str = object_name+'[X]='+"%d"%layer.offsets[0]+';'
+ return_list.append(str)
+ y_coordinate = layer.offsets[1]
+ str = object_name+'[Y]='+"%d"%y_coordinate+';'
+ return_list.append(str)
+ str = object_name+'[WIDTH]='+"%d"%layer.width+';'
+ return_list.append(str)
+ str = object_name+'[HEIGHT]='+"%d"%layer.height+';'
+ return_list.append(str)
+ str = ''
+ return_list.append(str)
+ return return_list
+
+def generate_style_text_layer(layer):
+ object_name=layer.name
+ return_list = []
+ # format name for the object (replace - with _ ), dash is prohibited in qml
+ object_name = string.replace(object_name, '-', '_')
+ str = 'var '+object_name+'=new Object;'
+ return_list.append(str)
+ str = object_name+'[X]='+"%d"%layer.offsets[0]+';'
+ return_list.append(str)
+ y_coordinate = layer.offsets[1]
+ str = object_name+'[Y]='+"%d"%y_coordinate+';'
+ return_list.append(str)
+ str = object_name+'[WIDTH]='+"%d"%layer.width+';'
+ return_list.append(str)
+ str = object_name+'[HEIGHT]='+"%d"%layer.height+';'
+ return_list.append(str)
+ text_color = pdb.gimp_text_layer_get_color(layer)
+ str = object_name+'[TEXTCOLOR]='+format_color(text_color)+';'
+ return_list.append(str)
+ str = object_name+'[STYLECOLOR]='+format_color(text_color)+';'
+ return_list.append(str)
+ pixel_size = pdb.gimp_text_layer_get_font_size(layer)[0]
+ str = object_name+'[PIXELSIZE]='+"%d"%pixel_size+';'
+ return_list.append(str)
+ str = ''
+ return_list.append(str)
+ return return_list
+
+def generate_style_sheet(image, drawable, select_visible_layers, target_directory, generate_xml_log) :
+ # transmit error messages to gimp console
+ gimp.pdb.gimp_message_set_handler( ERROR_CONSOLE )
+ sc_js_data = []
+ layers = image.layers
+ sc_name = target_directory+os.sep+'style-sheets'+os.sep+image.name;
+ sc_name = string.replace(sc_name, '.xcf', '')
+
+ if (generate_xml_log):
+ #configure the XML document
+ sc_xml_name = sc_name+'-css.xml'
+ doc = xml.dom.minidom.Document()
+ url = ""
+ rootelt = doc.createElementNS(url, "layoutBuilder")
+ doc.appendChild(rootelt)
+
+ #configure the JS document
+ sc_js_name = sc_name+'-css.js'
+ sc_js_data.extend(get_js_header())
+
+ #scan the layers
+ for l in layers:
+ if (select_visible_layers):
+ if (l.visible):
+ if pdb.gimp_item_is_text_layer(l):
+ #generate data for the text object
+ sc_js_data.extend(generate_style_text_layer(l))
+ else:
+ #generate data for the image object
+ sc_js_data.extend(generate_style_image_layer(l))
+ #generate and save the image file
+ ly_name = target_directory+os.sep+'images'+os.sep+ l.name + ".png"
+ gimp.pdb.gimp_file_save(image, l, ly_name, ly_name)
+ else:
+ if pdb.gimp_item_is_text_layer(l):
+ #generate data for the text object
+ sc_js_data.extend(generate_style_text_layer(l))
+ else:
+ #generate data for the image object
+ sc_js_data.extend(generate_style_image_layer(l))
+ #generate the image file
+ ly_name = target_directory+os.sep + l.name + ".png"
+ gimp.pdb.gimp_file_save(image, l, ly_name, ly_name)
+ if (generate_xml_log):
+ if (select_visible_layers):
+ if (l.visible):
+ # populate the xml file (it's a log file)
+ xmlnode = doc.createElementNS(url, "layer")
+ xmlnode.setAttributeNS(url, "x", "%d"%l.offsets[0])
+ xmlnode.setAttributeNS(url, "y", "%d"%l.offsets[1])
+ xmlnode.setAttributeNS(url, "width", "%d"%l.width)
+ xmlnode.setAttributeNS(url, "height", "%d"%l.height)
+ xmltext = doc.createTextNode(l.name);
+ xmlnode.appendChild(xmltext)
+ rootelt.appendChild(xmlnode)
+ else:
+ # populate the xml file (it's a log file)
+ xmlnode = doc.createElementNS(url, "layer")
+ xmlnode.setAttributeNS(url, "x", "%d"%l.offsets[0])
+ xmlnode.setAttributeNS(url, "y", "%d"%l.offsets[1])
+ xmlnode.setAttributeNS(url, "width", "%d"%l.width)
+ xmlnode.setAttributeNS(url, "height", "%d"%l.height)
+ xmltext = doc.createTextNode(l.name);
+ xmlnode.appendChild(xmltext)
+ rootelt.appendChild(xmlnode)
+
+ gimp.pdb.gimp_message( "Saving images to %s"%(target_directory+os.sep+'images'+os.sep) );
+
+ if (generate_xml_log):
+ #save the xml file
+ gimp.pdb.gimp_message( "Saving log to %s"%(sc_xml_name) );
+ file_object = open(sc_xml_name, "w")
+ file_object.write(doc.toprettyxml());
+ file_object.close()
+
+ #save the JS file
+ gimp.pdb.gimp_message( "Saving style sheet to %s"%(sc_js_name) );
+ file_object = open(sc_js_name, "w")
+ for item in sc_js_data:
+ file_object.write("%s\n" %item)
+ file_object.close()
+
+register(
+ "generate-style-sheet",
+ "Generation of style sheet",
+ "Export images and content properties from layers",
+ "Philippe COLLIOT",
+ "PSA Peugeot Citroën",
+ "2014",
+ "<Image>/Genivi/Generate style sheet",
+ "*",
+ [
+ (PF_TOGGLE, "select_visible_layers_toggle", "Save only visible layers", True),
+ (PF_DIRNAME, "target_directory_name", "Target directory (must be qml/Core)", os.getcwd()),
+ (PF_TOGGLE, "generate_xml_log_toggle", "Generate xml log file", False),
+ ],
+ [],
+ generate_style_sheet )
+
+main()