summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormvglasow <michael -at- vonglasow.com>2015-11-08 20:46:38 +0100
committermvglasow <michael -at- vonglasow.com>2015-11-08 20:46:38 +0100
commitd57fd565f86e41a8f96245ac4e3062f61e178e70 (patch)
tree3761ba0466813a0cb126df363521ac29bfb2011f
parent4d57b38a0398f12ef445f52328acc42bdd2683f0 (diff)
parentea16064a2fe1a9545509bb235a7fa8ec7276fa0d (diff)
downloadnavit-d57fd565f86e41a8f96245ac4e3062f61e178e70.tar.gz
Merge branch 'status-osd.trac1324' of github.com:mvglasow/navit into status-osd.trac1324
-rw-r--r--navit/maptool/misc.c4
-rw-r--r--navit/navit.c40
-rw-r--r--navit/xmlconfig.c25
-rw-r--r--navit/xslt/osd_minimum.xslt8
4 files changed, 73 insertions, 4 deletions
diff --git a/navit/maptool/misc.c b/navit/maptool/misc.c
index d4ce6f169..90b03d462 100644
--- a/navit/maptool/misc.c
+++ b/navit/maptool/misc.c
@@ -173,8 +173,12 @@ item_order_by_type(enum item_type type)
switch (type) {
case type_town_label_1e7:
case type_town_label_5e6:
+ max=3;
+ break;
case type_town_label_2e6:
case type_town_label_1e6:
+ max=5;
+ break;
case type_town_label_5e5:
case type_district_label_1e7:
case type_district_label_5e6:
diff --git a/navit/navit.c b/navit/navit.c
index 79c4ba955..0ac6783cd 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -151,7 +151,10 @@ struct navit {
struct log *textfile_debug_log;
struct pcoord destination;
int destination_valid;
- int blocked;
+ int blocked; /**< Whether draw operations are currently blocked. This can be a combination of the
+ following flags:
+ 1: draw operations are blocked
+ 2: draw operations are pending, requiring a redraw once draw operations are unblocked */
int w,h;
int drag_bitmap;
int use_mousewheel;
@@ -381,6 +384,20 @@ navit_popup(void *data)
}
+/**
+ * @brief Sets a flag indicating that the current button event should be ignored by subsequent handlers.
+ *
+ * Calling this function will set the {@code ignore_button} member to {@code true} and return its previous state.
+ * The default handler, {@link navit_handle_button(navit *, int, int, point *, callback *)} calls this function
+ * just before the actual event handling core and aborts if the result is {@code true}. In order to prevent
+ * multiple handlers from firing on a single event, custom button click handlers should implement the same logic
+ * for events they wish to handle.
+ *
+ * If a handler wishes to pass down an event to other handlers, it must abort without calling this function.
+ *
+ * @param this_ The navit instance
+ * @return {@code true} if the caller should ignore the button event, {@code false} if it should handle it
+ */
int
navit_ignore_button(struct navit *this_)
{
@@ -3450,6 +3467,24 @@ navit_disable_suspend() {
callback_list_call_attr_0(global_navit->attr_cbl,attr_unsuspend);
}
+/**
+ * @brief Blocks or unblocks redraw operations.
+ *
+ * The {@code block} parameter specifies the operation to carry out:
+ *
+ * {@code block > 0} cancels all draw operations in progress and blocks future operations. It sets flag 1 of the
+ * {@code blocked} member. If draw operations in progress were canceled, flag 2 is also set.
+ *
+ * {@code block = 0} unblocks redraw operations, resetting {@code blocked} to 0. If flag 2 was previously set,
+ * indicating that draw operations had been previously canceled, a redraw is triggered.
+ *
+ * {@code block < 0} unblocks redraw operations and forces a redraw. As above, {@code blocked} is reset to 0.
+ *
+ * @param this_ The navit instance
+ * @param block The operation to perform, see description
+ *
+ * @return {@code true} if a redraw operation was triggered, {@code false} if not
+ */
int
navit_block(struct navit *this_, int block)
{
@@ -3468,6 +3503,9 @@ navit_block(struct navit *this_, int block)
return 0;
}
+/**
+ * @brief Returns whether redraw operations are currently blocked.
+ */
int navit_get_blocked(struct navit *this_)
{
return this_->blocked;
diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c
index 66b73fd02..f752998eb 100644
--- a/navit/xmlconfig.c
+++ b/navit/xmlconfig.c
@@ -1295,6 +1295,31 @@ navit_object_attr_iter_destroy(struct attr_iter *iter)
g_free(iter);
}
+/**
+ * @brief Generic get function
+ *
+ * This function searches an attribute list for an attribute of a given type and stores it in the {@code attr}
+ * parameter. Internally it calls
+ * {@link attr_generic_get_attr(struct attr **, struct attr **, enum attr_type, struct attr *, struct attr_iter *)}
+ * to retrieve the attribute; see its documentation for details.
+ * <p>
+ * Searching for attr_any or attr_any_xml is supported.
+ * <p>
+ * An iterator can be specified to get multiple attributes of the same type:
+ * The first call will return the first match; each subsequent call
+ * with the same iterator will return the next match. If no more matching
+ * attributes are found in either of them, false is returned.
+ *
+ * @param obj The object to return an attribute for. This can be any Navit object type, but the parameter should
+ * be cast to {@code struct navit_object *} to avoid compiler warnings.
+ * @param type The attribute type to search for. Searching for {@code attr_any} or {@code attr_any_xml} is
+ * possible.
+ * @param attr Points to a {@code struct attr} which will receive the attribute
+ * @param iter An iterator to receive multiple attributes of the same type with subsequent calls. If {@code NULL},
+ * the first matching attribute will be retrieved.
+ *
+ * @return True if a matching attribute was found, false if not.
+ */
int
navit_object_get_attr(struct navit_object *obj, enum attr_type type, struct attr *attr, struct attr_iter *iter)
{
diff --git a/navit/xslt/osd_minimum.xslt b/navit/xslt/osd_minimum.xslt
index 8d39255c5..688158d8d 100644
--- a/navit/xslt/osd_minimum.xslt
+++ b/navit/xslt/osd_minimum.xslt
@@ -6,11 +6,13 @@
<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))}" osd_configuration="1"/>
<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))}" osd_configuration="1"/>
+ <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"/>
<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" osd_configuration="1"/>
+ <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"/>
<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))}" osd_configuration="1"/>
+ <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"/>
+ <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"/>
<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="0" osd_configuration="1"/>
<xsl:text>&#x0A; </xsl:text>