summaryrefslogtreecommitdiff
path: root/navit/xslt
diff options
context:
space:
mode:
authormvglasow <michael@vonglasow.com>2019-02-20 00:22:58 +0100
committerGitHub <noreply@github.com>2019-02-20 00:22:58 +0100
commit0428ef92825cfa2d9949a9ea6ef84e0d98fb8fba (patch)
tree59fb38cf0297fea6eec6dd4b39acdd309d8cf6fe /navit/xslt
parentf4d8faa5cefd43dcf2758092af2e555d43141b57 (diff)
parent88fca113d2b281f2d53fa52ce0b72c6a6105dc2a (diff)
downloadnavit-0428ef92825cfa2d9949a9ea6ef84e0d98fb8fba.tar.gz
Merge pull request #737 from mvglasow/osd-layout
New default OSD layout
Diffstat (limited to 'navit/xslt')
-rw-r--r--navit/xslt/openmoko.xslt8
-rw-r--r--navit/xslt/osd_android.xslt2
-rw-r--r--navit/xslt/osd_minimum.xslt30
-rw-r--r--navit/xslt/sailfish_osd.xslt29
-rw-r--r--navit/xslt/tomtom.xslt17
-rw-r--r--navit/xslt/wince.xslt7
6 files changed, 46 insertions, 47 deletions
diff --git a/navit/xslt/openmoko.xslt b/navit/xslt/openmoko.xslt
index 2de3c0aab..dae507c90 100644
--- a/navit/xslt/openmoko.xslt
+++ b/navit/xslt/openmoko.xslt
@@ -1,7 +1,13 @@
<?xml version="1.0"?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xsl:param name="OSD_SIZE" select="2"/>
+ <xsl:param name="ICON_SMALL" select="48"/>
+ <xsl:param name="ICON_MEDIUM" select="48"/>
+ <xsl:param name="ICON_BIG" select="96"/>
+ <xsl:param name="OSD_USE_OVERLAY">yes</xsl:param>
+
<xsl:output method="xml" doctype-system="navit.dtd" cdata-section-elements="gui"/>
<xsl:include href="navit_drag_bitmap.xslt"/>
- <xsl:include href="osd_enable_zoom.xslt"/>
+ <xsl:include href="osd_minimum.xslt"/>
<xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template>
</xsl:transform>
diff --git a/navit/xslt/osd_android.xslt b/navit/xslt/osd_android.xslt
index a15d4f34d..96dce2449 100644
--- a/navit/xslt/osd_android.xslt
+++ b/navit/xslt/osd_android.xslt
@@ -3,6 +3,6 @@
<xsl:template match="/config/navit/osd[last()]">
<xsl:copy><xsl:copy-of select="@*|node()"/></xsl:copy>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_android_menu_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="graphics.menu()" x="{round(-60*number($OSD_SIZE))}" y="{round(48*number($OSD_SIZE))}" enable_expression="!has_menu_button" use_overlay="yes"/>
+ <osd type="button" src="gui_android_menu" command="graphics.menu()" x="{round(-(number($ICON_BIG)+8*number($OSD_SIZE)))}" y="{round(62*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" enable_expression="!has_menu_button" use_overlay="yes"/>
</xsl:template>
</xsl:transform>
diff --git a/navit/xslt/osd_minimum.xslt b/navit/xslt/osd_minimum.xslt
index fc4e1f593..b0e310aae 100644
--- a/navit/xslt/osd_minimum.xslt
+++ b/navit/xslt/osd_minimum.xslt
@@ -5,27 +5,35 @@
<xsl:param name="NEXT_TURN_TEXT_HIGHT"><xsl:value-of select="round(20*number($OSD_SIZE))"/></xsl:param>
<xsl:param name="OSD_USE_OVERLAY"><xsl:value-of select="$OSD_USE_OVERLAY='yes' or $OSD_USE_OVERLAY='true' or $OSD_USE_OVERLAY='1'"/></xsl:param>
- <osd type="compass" enabled="yes" x="{round(-60*number($OSD_SIZE))}" y="{round(-80*number($OSD_SIZE))}" w="{round(60*number($OSD_SIZE))}" h="{round(80*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="vehicle.position_valid"/>
+ <osd type="text" label="${{navigation.item[1].name}}" x="0" y="0" w="100%" h="{round(14*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status&gt;=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="text" label="${{navigation.item.destination_length[named]}}\n${{navigation.item.destination_time[arrival]}}" x="{round(-60*number($OSD_SIZE))}" y="0" w="{round(60*number($OSD_SIZE))}" h="{round(40*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
+ <osd type="compass" enabled="yes" x="{round(-60*number($OSD_SIZE))}" y="{round(-94*number($OSD_SIZE))}" w="{round(60*number($OSD_SIZE))}" h="{round(80*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="vehicle.position_valid"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="navigation_status" x="0" y="{-($NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT)}" w="{$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" h="{$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" icon_src="%s_wh_{$ICON_BIG}_{$ICON_BIG}.png" enable_expression="navigation.nav_status==-1 || navigation.nav_status==1 || navigation.nav_status==2"/>
+ <osd type="text" label="${{navigation.item.destination_length[named]}}\n${{navigation.item.destination_time[arrival]}}" x="{round(-60*number($OSD_SIZE))}" y="{round(14*number($OSD_SIZE))}" w="{round(60*number($OSD_SIZE))}" h="{round(40*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="navigation_next_turn" x="0" y="{-($NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT)}" w="{$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" h="{$NEXT_TURN_SIZE}" icon_src="%s_wh_{$ICON_BIG}_{$ICON_BIG}.png" enable_expression="navigation.nav_status>=3"/>
+ <osd type="navigation_status" x="0" y="0" w="{$NEXT_TURN_SIZE}" h="{$NEXT_TURN_SIZE}" icon_w="{round(number($ICON_BIG))}" icon_h="{round(number($ICON_BIG))}" icon_src="%s_wh" enable_expression="navigation.nav_status==-1 || navigation.nav_status==1 || navigation.nav_status==2"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="text" label="${{navigation.item[1].length[named]}}" x="0" y="{-$NEXT_TURN_TEXT_HIGHT}" w="{$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" h="{$NEXT_TURN_TEXT_HIGHT}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
+ <osd type="navigation_next_turn" x="0" y="{round(14*number($OSD_SIZE))}" w="{$NEXT_TURN_SIZE}" h="{$NEXT_TURN_SIZE}" icon_w="{round(number($ICON_BIG))}" icon_h="{round(number($ICON_BIG))}" icon_src="%s_wh" enable_expression="navigation.nav_status>=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_zoom_manual_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="autozoom_active=0" x="0" y="0" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active!=0"/>
+ <osd type="text" label="${{navigation.item[1].length[value]}}" x="0" y="{round(14*number($OSD_SIZE))+$NEXT_TURN_SIZE}" w="{$NEXT_TURN_SIZE}" h="{$NEXT_TURN_TEXT_HIGHT}" font_size="{round(260*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_zoom_auto_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="autozoom_active=1" x="0" y="0" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active==0"/>
+ <osd type="text" label="${{navigation.item[1].length[unit]}}" x="0" y="{round(14*number($OSD_SIZE))+$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" w="{$NEXT_TURN_SIZE}" h="{$NEXT_TURN_TEXT_HIGHT}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_zoom_in_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="zoom_in()" x="0" y="{round(number($ICON_BIG)+8*number($OSD_SIZE))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <osd type="text" label="${{tracking.item.street_name}} ${{tracking.item.street_name_systematic}}" x="0" y="{round(-14*number($OSD_SIZE))}" w="100%" h="{round(14*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="vehicle.position_valid"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_zoom_out_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="zoom_out()" x="0" y="{round(2*(number($ICON_BIG)+8*number($OSD_SIZE)))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <osd type="toggle_announcer" icon_src="%s" x="{round(-(number($ICON_MEDIUM)+8*number($OSD_SIZE)))}" y="{round(-(number($ICON_MEDIUM)+8*number($OSD_SIZE))-94*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="cmd_interface" update_period="1" command="pitch=autozoom_active==0?pitch:(follow>1?0:20);orientation=autozoom_active==0?orientation:(follow>1?0:-1)" x="-1" y="-1" w="1" h="1"/>
+ <osd type="button" src="zoom_manual" command="autozoom_active=0" x="{round(8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active!=0"/>
+ <xsl:text>&#x0A; </xsl:text>
+ <osd type="button" src="zoom_auto" command="autozoom_active=1" x="{round(8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active==0"/>
+ <xsl:text>&#x0A; </xsl:text>
+ <osd type="button" src="zoom_in" command="zoom_in()" x="{round((number($ICON_MEDIUM)+8*number($OSD_SIZE))+8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="cursor_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="follow=0;set_center_cursor()" x="{round(number($ICON_BIG)+8*number($OSD_SIZE))}" y="0" enable_expression="follow>1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <osd type="button" src="zoom_out" command="zoom_out()" x="{round(2*(number($ICON_MEDIUM)+8*number($OSD_SIZE))+8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <xsl:text>&#x0A; </xsl:text>
+ <osd type="button" src="follow" command="follow=0;set_center_cursor()" x="{round(8*number($OSD_SIZE))}" y="{round(-2*(number($ICON_MEDIUM)+8*number($OSD_SIZE))-14*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" enable_expression="follow>1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <xsl:text>&#x0A; </xsl:text>
+ <osd type="cmd_interface" update_period="1" command="pitch=autozoom_active==0?pitch:(follow>1?0:20);orientation=autozoom_active==0?orientation:(follow>1?0:-1)" x="-1" y="-1" w="1" h="1"/>
<xsl:text>&#x0A; </xsl:text>
<xsl:copy><xsl:copy-of select="@*|node()"/></xsl:copy>
</xsl:template>
diff --git a/navit/xslt/sailfish_osd.xslt b/navit/xslt/sailfish_osd.xslt
index ca9925a49..fc2244d97 100644
--- a/navit/xslt/sailfish_osd.xslt
+++ b/navit/xslt/sailfish_osd.xslt
@@ -2,8 +2,14 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xsl:param name="OSD_SIZE" select="2"/>
+ <xsl:param name="ICON_SMALL" select="32"/>
+ <xsl:param name="ICON_MEDIUM" select="64"/>
+ <xsl:param name="ICON_BIG" select="96"/>
+ <xsl:param name="OSD_USE_OVERLAY">yes</xsl:param>
<xsl:output method="xml" indent="yes" cdata-section-elements="gui" doctype-system="navit.dtd"/>
+ <xsl:include href="osd_minimum.xslt"/>
<!-- Default rule: copy all -->
<xsl:template match="node()|@*">
@@ -12,27 +18,4 @@
</xsl:copy>
</xsl:template>
- <xsl:template match="/config/navit/osd[1]">
- <osd enabled="yes" type="gps_status" x="0" y="0" w="50" h="50"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="no" type="text" label="${{vehicle.position_sats_used}}/${{vehicle.position_qual}}" x="0" y="0" w="50" h="50" background_color="#00000058" font_size="400"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="text" label="${{vehicle.position_speed}}" x="50" y="0" w="150" h="50" background_color="#00000058" font_size="400"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="text" label="${{navigation.item.destination_length[named]}}" x="200" y="0" w="240" h="50" background_color="#00000058" font_size="400"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="navigation_next_turn" x="-100" y="0" w="100" h="100" icon_w="90" icon_h="80" background_color="#00000058"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="button" x="-96" y="-96" w="96" h="96" command="zoom_in()" src="zoom_in" use_overlay="true"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="text" label="${{navigation.item[1].length[named]}}" x="-100" y="100" w="100" h="50" background_color="#00000058" font_size="400"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="button" x="0" y="-96" w="96" h="96" command="zoom_out()" src="zoom_out" use_overlay="true"/>
- <xsl:text>&#x0A; </xsl:text>
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates select="node()"/>
- </xsl:copy>
- </xsl:template>
-
</xsl:stylesheet>
diff --git a/navit/xslt/tomtom.xslt b/navit/xslt/tomtom.xslt
index fd8031ea2..dac69f3d3 100644
--- a/navit/xslt/tomtom.xslt
+++ b/navit/xslt/tomtom.xslt
@@ -1,7 +1,13 @@
<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude" version="1.0">
+ <xsl:param name="OSD_SIZE" select="1"/>
+ <xsl:param name="ICON_SMALL" select="24"/>
+ <xsl:param name="ICON_MEDIUM" select="24"/>
+ <xsl:param name="ICON_BIG" select="48"/>
+ <xsl:param name="OSD_USE_OVERLAY">yes</xsl:param>
<xsl:output method="xml" indent="yes" cdata-section-elements="gui" doctype-system="navit.dtd"/>
+ <xsl:include href="osd_minimum.xslt"/>
<xsl:template match="/">
<xsl:apply-templates select="config"/>
@@ -22,17 +28,6 @@
<xsl:attribute name="recent_dest">25</xsl:attribute>
<graphics type="sdl" w="480" h="272" bpp="16" frame="0" flags="1"/>
<xsl:copy-of select="gui[@type='internal']"/>
- <osd enabled="yes" type="text" x="80" y="0" w="320" h="40" font_size="360" align="0" label="${{tracking.item.street_name}} ${{tracking.item.street_name_systematic}}" background_color="#00008080"/>
- <osd enabled="yes" type="text" x="80" y="232" w="80" h="40" font_size="360" align="0" label="${{navigation.item[1].length[named]}}" background_color="#00008080"/>
- <osd enabled="yes" type="text" x="160" y="232" w="240" h="40" font_size="360" align="0" label="${{vehicle.position_speed}} / ${{tracking.item.route_speed}}" background_color="#00008080"/>
- <osd enabled="yes" type="text" x="400" y="232" w="80" h="40" font_size="360" align="0" label="${{navigation.item.destination_length[named]}}" background_color="#00008080"/>
- <osd enabled="yes" type="text" x="400" y="192" w="80" h="40" font_size="360" align="0" label="${{navigation.item.destination_time[arrival]}}" background_color="#00008080"/>
- <osd enabled="yes" type="compass" x="400" y="80" w="80" h="112" background_color="#00008080" font_size="300"/>
- <osd enabled="yes" type="gps_status" x="0" y="80" w="80" h="40" background_color="#00008080"/>
- <osd enabled="yes" type="speed_warner" x="0" y="120" w="80" h="72" background_color="#00008080" font_size="300"/>
- <osd enabled="yes" type="navigation_next_turn" x="0" y="192" w="80" h="80" icon_w="48" icon_h="48" icon_src="%s_wh_48_48.png" background_color="#00008080"/>
- <osd enabled="yes" type="button" x="400" y="0" command="zoom_in()" src="tomtom_plus_80_80.png"/>
- <osd enabled="yes" type="button" x="0" y="0" command="zoom_out()" src="tomtom_minus_80_80.png"/>
<vehicle name="Local GPS" profilename="car" enabled="yes" active="yes" follow="1" source="file:/var/run/gpspipe">
<!-- Navit can write a tracklog in several formats (gpx, nmea or textfile): -->
<log enabled="no" type="gpx" attr_types="position_time_iso8601,position_direction,position_speed,position_radius" data="/mnt/sdcard/navit/track_%Y%m%d-%%i.gpx" flush_size="1000" flush_time="30"/>
diff --git a/navit/xslt/wince.xslt b/navit/xslt/wince.xslt
index 1b0c0d230..c5f75bf0d 100644
--- a/navit/xslt/wince.xslt
+++ b/navit/xslt/wince.xslt
@@ -1,6 +1,13 @@
<?xml version="1.0"?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xsl:param name="OSD_SIZE" select="1"/>
+ <xsl:param name="ICON_SMALL" select="24"/>
+ <xsl:param name="ICON_MEDIUM" select="24"/>
+ <xsl:param name="ICON_BIG" select="48"/>
+ <xsl:param name="OSD_USE_OVERLAY">yes</xsl:param>
+
<xsl:output method="xml" doctype-system="navit.dtd" cdata-section-elements="gui"/>
+ <xsl:include href="osd_minimum.xslt"/>
<xsl:template match="/config/navit/vehicle[@enabled='yes']">
<xsl:copy>
<xsl:copy-of select="@*[name() != 'gpsd_query']"/>