navit  0.5.3-trunk
osd_core.c File Reference
#include "config.h"
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <glib.h>
#include <time.h>
#include <string.h>
#include "item.h"
#include "xmlconfig.h"
#include "point.h"
#include "coord.h"
#include "graphics.h"
#include "transform.h"
#include "route.h"
#include "navit.h"
#include "plugin.h"
#include "debug.h"
#include "callback.h"
#include "color.h"
#include "vehicle.h"
#include "navigation.h"
#include "track.h"
#include "map.h"
#include "file.h"
#include "attr.h"
#include "command.h"
#include "navit_nls.h"
#include "messages.h"
#include "vehicleprofile.h"
#include "roadprofile.h"
#include "osd.h"
#include "speech.h"
#include "event.h"
#include "mapset.h"
#include "util.h"

Data Structures

struct  osd_priv_common
 
struct  compass
 
struct  route_guard
 
struct  odometer
 
struct  cmd_interface
 
struct  stopwatch
 
struct  osd_button
 
struct  navigation_status
 
struct  nav_next_turn
 
struct  nav_toggle_announcer
 
struct  osd_speed_cam_entry
 
struct  osd_speed_cam
 
struct  osd_speed_warner
 
struct  osd_text_item
 
struct  osd_text
 
struct  gps_status
 
struct  volume
 
struct  osd_scale
 
struct  auxmap
 

Enumerations

enum  osd_speed_warner_eAnnounceState { eNoWarn =0 , eWarningTold =1 }
 
enum  camera_t {
  CAM_FIXED =1 , CAM_TRAFFIC_LAMP , CAM_RED , CAM_SECTION ,
  CAM_MOBILE , CAM_RAIL , CAM_TRAFFIPAX
}
 
enum  cam_dir_t { CAMDIR_ALL =0 , CAMDIR_ONE , CAMDIR_TWO }
 

Functions

int set_std_osd_attr (struct osd_priv *priv, struct attr *the_attr)
 
static void osd_odometer_reset (struct osd_priv_common *opc, int flags)
 
static int osd_cmd_odometer_reset (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static void osd_odometer_draw (struct osd_priv_common *opc, struct navit *nav, struct vehicle *v)
 
static struct osd_text_itemoti_new (struct osd_text_item *parent)
 Creates a new osd_text_item and inserts it into a linked list. More...
 
int osd_button_set_attr (struct osd_priv_common *opc, struct attr *attr)
 
static void transform_rotate (struct point *center, int angle, struct point *p, int count)
 Rotate a group of points around a center. More...
 
static void transform_move (int dx, int dy, struct point *p, int count)
 Move a group of points in a direction (adding dx and dy to their x and y coordinates) More...
 
static void draw_compass (struct graphics *gr, struct graphics_gc *gc_n, struct graphics_gc *gc_s, struct point *p, int r, int dir)
 Draw a compass handle of length r, centered at point p, pointing to direction dir. More...
 
static void draw_handle (struct graphics *gr, struct graphics_gc *gc, struct point *p, int r, int dir)
 Draw an arrow of length r, centered at point p, with color gc, pointing to direction dir. More...
 
static char * format_distance (double distance, char *sep, int imperial)
 
static char * format_time (struct tm *tm, int days)
 
static char * format_speed (double speed, char *sep, char *format, int imperial)
 
static char * format_float_0 (double num)
 
static void osd_route_guard_draw (struct osd_priv_common *opc, struct navit *nav, struct vehicle *v)
 
static void osd_route_guard_init (struct osd_priv_common *opc, struct navit *nav)
 
static void osd_route_guard_destroy (struct osd_priv_common *opc)
 
static struct osd_priv * osd_route_guard_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static char * str_replace (char *output, char *input, char *pattern, char *replacement)
 
static char * osd_odometer_to_string (struct odometer *this_)
 
static void osd_odometer_from_string (struct odometer *this_, char *str)
 
static void draw_multiline_osd_text (char *buffer, struct osd_item *osd_item, struct graphics_gc *curr_color)
 
static void draw_aligned_osd_text (char *buffer, int align, struct osd_item *osd_item, struct graphics_gc *curr_color)
 
static void osd_odometer_click (struct osd_priv_common *opc, struct navit *nav, int pressed, int button, struct point *p)
 
static int osd_odometer_save (struct navit *nav)
 
static void osd_odometer_init (struct osd_priv_common *opc, struct navit *nav)
 
static void osd_odometer_destroy (struct navit *nav)
 
static struct osd_priv * osd_odometer_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_cmd_interface_draw (struct osd_priv_common *opc, struct navit *nav, struct vehicle *v)
 
static void osd_cmd_interface_init (struct osd_priv_common *opc, struct navit *nav)
 
static int osd_cmd_interface_set_attr (struct osd_priv_common *opc, struct attr *attr)
 
static struct osd_priv * osd_cmd_interface_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_stopwatch_draw (struct osd_priv_common *opc, struct navit *nav, struct vehicle *v)
 
static void osd_stopwatch_click (struct osd_priv_common *opc, struct navit *nav, int pressed, int button, struct point *p)
 
static void osd_stopwatch_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_stopwatch_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_compass_draw (struct osd_priv_common *opc, struct navit *nav, struct vehicle *v)
 Draw the compass on the OSD (includes north and destination direction) More...
 
static void osd_compass_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_compass_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_button_adjust_sizes (struct osd_priv_common *opc, struct graphics_image *img)
 Adjusts width and height of an OSD item to fit the image it displays. More...
 
static void osd_button_draw (struct osd_priv_common *opc, struct navit *nav, struct vehicle *unused)
 
static void osd_button_init (struct osd_priv_common *opc, struct navit *nav)
 
static char * osd_button_icon_path (struct osd_button *this_, char *src)
 
static struct osd_priv * osd_button_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_image_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_image_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_navigation_status_draw_do (struct osd_priv_common *opc, int status)
 Draws a navigation_status OSD. More...
 
static void osd_navigation_status_draw (struct osd_priv *osd, struct navit *navit, struct vehicle *v)
 Draws a navigation_status OSD. More...
 
static void osd_navigation_status_init (struct osd_priv_common *opc, struct navit *navit)
 Initializes a new. More...
 
static struct osd_priv * osd_navigation_status_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 Creates a new. More...
 
static void osd_nav_next_turn_draw (struct osd_priv_common *opc, struct navit *navit, struct vehicle *v)
 
static void osd_nav_next_turn_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_nav_next_turn_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_nav_toggle_announcer_draw (struct osd_priv_common *opc, struct navit *navit, struct vehicle *v)
 
static void osd_nav_toggle_announcer_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_nav_toggle_announcer_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static double angle_diff (int firstAngle, int secondAngle)
 
static void osd_speed_cam_draw (struct osd_priv_common *opc, struct navit *navit, struct vehicle *v)
 
static void osd_speed_cam_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_speed_cam_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_speed_warner_draw (struct osd_priv_common *opc, struct navit *navit, struct vehicle *v)
 
static void osd_speed_warner_click (struct osd_priv_common *opc, struct navit *nav, int pressed, int button, struct point *p)
 
static void osd_speed_warner_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_speed_warner_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static char * osd_text_format_attr (struct attr *attr, char *format, int imperial)
 Formats a text attribute. More...
 
static char * osd_text_split (char *in, char **index)
 Parses a string of the form key.subkey or key[index].subkey into its components, where subkey can itself have its own index and further subkeys. More...
 
static void osd_text_draw (struct osd_priv_common *opc, struct navit *navit, struct vehicle *v)
 
static void osd_text_prepare (struct osd_priv_common *opc, struct navit *nav)
 Prepares a text type OSD element. More...
 
static void osd_text_init (struct osd_priv_common *opc, struct navit *nav)
 
static int osd_text_set_attr (struct osd_priv_common *opc, struct attr *attr)
 
static struct osd_priv * osd_text_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_gps_status_draw (struct osd_priv_common *opc, struct navit *navit, struct vehicle *v)
 
static void osd_gps_status_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_gps_status_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_volume_draw (struct osd_priv_common *opc, struct navit *navit, struct vehicle *unused)
 
static void osd_volume_click (struct osd_priv_common *opc, struct navit *nav, int pressed, int button, struct point *p)
 
static void osd_volume_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_volume_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static int round_to_nice_value (double value)
 
static void osd_scale_draw (struct osd_priv_common *opc, struct navit *nav, struct vehicle *unused)
 
static void osd_scale_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_scale_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
static void osd_auxmap_draw (struct osd_priv_common *opc)
 
static void osd_auxmap_init (struct osd_priv_common *opc, struct navit *nav)
 
static struct osd_priv * osd_auxmap_new (struct navit *nav, struct osd_methods *meth, struct attr **attrs)
 
void plugin_init (void)
 

Variables

static int b_commandtable_added = 0
 
static int odometers_saved = 0
 
static GListodometer_list = NULL
 
static struct command_table commands []
 
char * camera_t_strs [] = {"None","Fix","Traffic lamp","Red detect","Section","Mobile","Rail","Traffipax(non persistent)"}
 
char * camdir_t_strs [] = {"All dir.","UNI-dir","BI-dir"}
 

Enumeration Type Documentation

◆ cam_dir_t

enum cam_dir_t
Enumerator
CAMDIR_ALL 
CAMDIR_ONE 
CAMDIR_TWO 

◆ camera_t

enum camera_t
Enumerator
CAM_FIXED 
CAM_TRAFFIC_LAMP 
CAM_RED 
CAM_SECTION 
CAM_MOBILE 
CAM_RAIL 
CAM_TRAFFIPAX 

◆ osd_speed_warner_eAnnounceState

Enumerator
eNoWarn 
eWarningTold 

Function Documentation

◆ angle_diff()

static double angle_diff ( int  firstAngle,
int  secondAngle 
)
static

Referenced by osd_speed_cam_draw().

◆ draw_aligned_osd_text()

static void draw_aligned_osd_text ( char *  buffer,
int  align,
struct osd_item osd_item,
struct graphics_gc curr_color 
)
static
  • draw osd text based on the given alignment setting on a osd_item
  • Parameters
    bufferpointer to a string containing the text to be displayed
  • Parameters
    alignalignment setting (to be taken form the osd attribute)
  • Parameters
    osd_itemthe osd item to work on
  • Parameters
    curr_colorthe color in which the osd text should be visible (defaults to osd_items foreground color)
  • Returns
    nothing

References dbg, do_draw(), osd_item::do_draw, draw_mode_end, osd_item::font, osd_item::font_size, osd_item::gr, osd_item::graphic_fg_text, graphics_draw_mode(), graphics_draw_text(), graphics_get_text_bbox(), osd_item::h, height, lvl_debug, next, osd_fill_with_bgcolor(), osd_std_resize(), p, osd_item::w, and point::x.

Referenced by osd_odometer_draw().

◆ draw_compass()

static void draw_compass ( struct graphics gr,
struct graphics_gc gc_n,
struct graphics_gc gc_s,
struct point p,
int  r,
int  dir 
)
static

Draw a compass handle of length r, centered at point p, pointing to direction dir.

Parameters
grThe graphics instance on which to draw
gc_nThe color to use for the north half of the compass
gc_sThe color to use for the south half of the compass
pThe center of the compass
rThe radius of the compass (around the center point p)
dirThe direction the compass points to (0 being up, value is in degrees counter-clockwise)

References graphics_draw_polygon_clipped(), graphics_draw_polyline_clipped(), p, transform_rotate(), point::x, and point::y.

Referenced by osd_compass_draw().

◆ draw_handle()

static void draw_handle ( struct graphics gr,
struct graphics_gc gc,
struct point p,
int  r,
int  dir 
)
static

Draw an arrow of length r, centered at point p, with color gc, pointing to direction dir.

Parameters
grThe graphics instance on which to draw
gcThe color to draw the arrow
pThe center of the compass
rThe radius of the compass (around the center point p)
dirThe direction the arrow points to (0 being up, value is in degrees counter-clockwise)

References graphics_draw_lines(), p, transform_move(), transform_rotate(), point::x, and point::y.

Referenced by osd_compass_draw().

◆ draw_multiline_osd_text()

static void draw_multiline_osd_text ( char *  buffer,
struct osd_item osd_item,
struct graphics_gc curr_color 
)
static

◆ format_distance()

static char* format_distance ( double  distance,
char *  sep,
int  imperial 
)
static
  • Format distance, choosing the unit (m or km) and precision depending on distance
  • Parameters
    distancedistance in meters
  • Parameters
    sepseparator character to be inserted between distance value and unit
  • Returns
    a pointer to a string containing the formatted distance

References FEET_PER_METER, and FEET_PER_MILE.

Referenced by osd_compass_draw(), osd_odometer_draw(), osd_route_guard_draw(), osd_scale_draw(), osd_speed_cam_draw(), and osd_text_format_attr().

◆ format_float_0()

static char* format_float_0 ( double  num)
static

Referenced by osd_text_format_attr().

◆ format_speed()

static char* format_speed ( double  speed,
char *  sep,
char *  format,
int  imperial 
)
static
  • Format speed in km/h
  • Parameters
    speedspeed in km/h
  • Parameters
    sepseparator character to be inserted between speed value and unit
  • Returns
    a pointer to a string containing the formatted speed

References FEET_PER_METER, and FEET_PER_MILE.

Referenced by osd_odometer_draw(), osd_speed_warner_draw(), osd_text_draw(), and osd_text_format_attr().

◆ format_time()

static char* format_time ( struct tm *  tm,
int  days 
)
static
  • Format time (duration)
  • Parameters
    tmpointer to a tm structure specifying the time
  • Parameters
    daysdays
  • Returns
    a pointer to a string containing the formatted time

Referenced by osd_text_format_attr().

◆ osd_auxmap_draw()

◆ osd_auxmap_init()

static void osd_auxmap_init ( struct osd_priv_common opc,
struct navit nav 
)
static

References center, osd_priv_common::data, and projection_mg.

Referenced by osd_auxmap_new().

◆ osd_auxmap_new()

◆ osd_button_adjust_sizes()

static void osd_button_adjust_sizes ( struct osd_priv_common opc,
struct graphics_image img 
)
static

Adjusts width and height of an OSD item to fit the image it displays.

A width or height of 0%, stored in relative attributes as

#define ATTR_REL_RELSHIFT
Definition: attr.h:119

, is used as a flag indicating that the respective dimension is unset, i.e. determined by the dimensions of its image.

If this is the case for height and/or width, the respective dimension will be updated to fit the image.

Note that this method is used by several OSD items, notably

osd_image

,

Definition: osd_core.c:1566

and

osd_android_menu

.

Parameters
opcThe OSD item
imgThe image displayed by the item

References ATTR_REL_RELSHIFT, osd_item::h, graphics_image::height, osd_priv_common::osd_item, osd_item::rel_h, osd_item::rel_w, osd_item::w, and graphics_image::width.

Referenced by osd_button_draw(), osd_button_init(), and osd_image_init().

◆ osd_button_draw()

◆ osd_button_icon_path()

static char* osd_button_icon_path ( struct osd_button this_,
char *  src 
)
static

◆ osd_button_init()

◆ osd_button_new()

◆ osd_button_set_attr()

◆ osd_cmd_interface_draw()

◆ osd_cmd_interface_init()

◆ osd_cmd_interface_new()

◆ osd_cmd_interface_set_attr()

◆ osd_cmd_odometer_reset()

static int osd_cmd_odometer_reset ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
static

◆ osd_compass_draw()

static void osd_compass_draw ( struct osd_priv_common opc,
struct navit nav,
struct vehicle v 
)
static

◆ osd_compass_init()

◆ osd_compass_new()

◆ osd_gps_status_draw()

◆ osd_gps_status_init()

static void osd_gps_status_init ( struct osd_priv_common opc,
struct navit nav 
)
static

◆ osd_gps_status_new()

◆ osd_image_init()

◆ osd_image_new()

◆ osd_nav_next_turn_draw()

◆ osd_nav_next_turn_init()

static void osd_nav_next_turn_init ( struct osd_priv_common opc,
struct navit nav 
)
static

◆ osd_nav_next_turn_new()

◆ osd_nav_toggle_announcer_draw()

◆ osd_nav_toggle_announcer_init()

◆ osd_nav_toggle_announcer_new()

◆ osd_navigation_status_draw()

static void osd_navigation_status_draw ( struct osd_priv *  osd,
struct navit navit,
struct vehicle v 
)
static

Draws a navigation_status OSD.

This is the draw method for the OSD. It exposes the standard signature for the draw method and acts as a wrapper around osd_navigation_status_draw_do().

Parameters
osdThe OSD to draw.
navitThe navit instance
vThe vehicle (not used but part of the prototype)

References navigation_get_attr(), navit_get_navigation(), attr::num, osd_navigation_status_draw_do(), and attr::u.

Referenced by osd_navigation_status_new().

◆ osd_navigation_status_draw_do()

static void osd_navigation_status_draw_do ( struct osd_priv_common opc,
int  status 
)
static

Draws a navigation_status OSD.

This method performs the actual operation of selecting and drawing the image. It can be called directly as a callback method for the navigation.nav_status attribute, or indirectly through the draw method.

Parameters
opcThe OSD to draw
statusThe status of the navigation engine (the value of the
nav_status
Definition: navigation.h:45
attribute)

References osd_priv_common::data, dbg, do_draw(), osd_item::do_draw, draw_mode_end, osd_item::gr, graphics_draw_image(), graphics_draw_mode(), graphics_icon_path(), graphics_image_free(), graphics_image_new_scaled(), osd_item::h, navigation_status::icon_h, navigation_status::icon_src, navigation_status::icon_w, navigation_status::last_status, lvl_debug, lvl_error, nav_status_to_text(), osd_fill_with_bgcolor(), osd_priv_common::osd_item, p, status_invalid, and osd_item::w.

Referenced by osd_navigation_status_draw(), and osd_navigation_status_init().

◆ osd_navigation_status_init()

static void osd_navigation_status_init ( struct osd_priv_common opc,
struct navit navit 
)
static

Initializes a new.

Definition: osd_core.c:1857

OSD.

This function is registered as a callback function in osd_navigation_status_new(struct navit *, struct osd_methods *, struct attr **). It is called after graphics initialization has finished and can be used for any initialization tasks which rely on a functional graphics system.

Parameters
opcThe OSD to initialize
navitThe navit instance

References callback_cast, callback_new_attr_1, dbg, lvl_debug, lvl_error, navigation_get_attr(), navigation_register_callback(), navit_get_navigation(), attr::num, osd_priv_common::osd_item, osd_navigation_status_draw_do(), osd_set_std_graphic(), and attr::u.

Referenced by osd_navigation_status_new().

◆ osd_navigation_status_new()

static struct osd_priv* osd_navigation_status_new ( struct navit nav,
struct osd_methods meth,
struct attr **  attrs 
)
static

◆ osd_odometer_click()

◆ osd_odometer_destroy()

static void osd_odometer_destroy ( struct navit nav)
static

References odometers_saved, and osd_odometer_save().

Referenced by osd_odometer_new().

◆ osd_odometer_draw()

◆ osd_odometer_from_string()

static void osd_odometer_from_string ( struct odometer this_,
char *  str 
)
static

◆ osd_odometer_init()

◆ osd_odometer_new()

◆ osd_odometer_reset()

◆ osd_odometer_save()

static int osd_odometer_save ( struct navit nav)
static

◆ osd_odometer_to_string()

static char* osd_odometer_to_string ( struct odometer this_)
static

◆ osd_route_guard_destroy()

static void osd_route_guard_destroy ( struct osd_priv_common opc)
static

◆ osd_route_guard_draw()

◆ osd_route_guard_init()

◆ osd_route_guard_new()

◆ osd_scale_draw()

◆ osd_scale_init()

◆ osd_scale_new()

◆ osd_speed_cam_draw()

◆ osd_speed_cam_init()

static void osd_speed_cam_init ( struct osd_priv_common opc,
struct navit nav 
)
static

References osd_priv_common::data.

Referenced by osd_speed_cam_new().

◆ osd_speed_cam_new()

◆ osd_speed_warner_click()

static void osd_speed_warner_click ( struct osd_priv_common opc,
struct navit nav,
int  pressed,
int  button,
struct point p 
)
static

◆ osd_speed_warner_draw()

◆ osd_speed_warner_init()

static void osd_speed_warner_init ( struct osd_priv_common opc,
struct navit nav 
)
static

References osd_priv_common::data.

Referenced by osd_speed_warner_new().

◆ osd_speed_warner_new()

◆ osd_stopwatch_click()

◆ osd_stopwatch_draw()

◆ osd_stopwatch_init()

◆ osd_stopwatch_new()

◆ osd_text_draw()

◆ osd_text_format_attr()

static char* osd_text_format_attr ( struct attr attr,
char *  format,
int  imperial 
)
static

Formats a text attribute.

Returns the formatted current value of an attribute as a string

Parameters
attrThe attribute to be formatted
formatA string specifying how to format the attribute. Allowed format strings depend on the attribute; this member can be NULL.
imperialTrue to convert values to imperial, false to return metric values
Returns
The formatted value

johnk 8/13/2020 if format is "feet" then return feet else if format is "imperial" return meters or feet as controlled by "imperial" return meters

References attr_to_text(), attr::coord_geo, DEGREES_DECIMAL, DEGREES_MINUTES, DEGREES_MINUTES_SECONDS, FEET_PER_METER, format_distance(), format_float_0(), format_speed(), format_time(), iso8601_to_secs(), coord_geo::lat, coord_geo::lng, attr::num, attr::numd, startup::pos, attr::str, attr::type, and attr::u.

Referenced by osd_text_draw().

◆ osd_text_init()

static void osd_text_init ( struct osd_priv_common opc,
struct navit nav 
)
static

◆ osd_text_new()

◆ osd_text_prepare()

static void osd_text_prepare ( struct osd_priv_common opc,
struct navit nav 
)
static

Prepares a text type OSD element.

This function parses the label string (as specified in the XML file) for a text type OSD element into attributes and static text.

Parameters
opcThe
Definition: osd_core.c:75
for the OSD element.
opc->data->items
will receive a pointer to a list of
Definition: osd_core.c:2863
structures.
navThe navit structure

References attr_from_name(), callback_cast, callback_new_attr_1, osd_priv_common::data, osd_text::items, key, navit_add_callback(), osd_text_draw(), osd_text_split(), oti_new(), osd_text_item::root, and osd_text::text.

Referenced by osd_text_init(), and osd_text_set_attr().

◆ osd_text_set_attr()

◆ osd_text_split()

static char* osd_text_split ( char *  in,
char **  index 
)
static

Parses a string of the form key.subkey or key[index].subkey into its components, where subkey can itself have its own index and further subkeys.

Parameters
inString to parse (the part before subkey will be modified by the function); upon returning this pointer will point to a string containing key
indexPointer to an address that will receive a pointer to a string containing index or NULL if key does not have an index
Returns
If the function succeeds, a pointer to a string containing subkey, i.e. everything following the first period, or a pointer to an empty string if there is nothing left to parse. If the function fails (index with missing closed bracket or passing a null pointer as index argument when an index was encountered), the return value is NULL

References startup::pos.

Referenced by osd_text_prepare().

◆ osd_volume_click()

static void osd_volume_click ( struct osd_priv_common opc,
struct navit nav,
int  pressed,
int  button,
struct point p 
)
static

◆ osd_volume_draw()

◆ osd_volume_init()

◆ osd_volume_new()

◆ oti_new()

static struct osd_text_item * oti_new ( struct osd_text_item parent)
static

Creates a new osd_text_item and inserts it into a linked list.

Parameters
parentThe preceding in the list. If NULL, the new item becomes the root element of a new list
Returns
The new

References osd_text_item::next, osd_text_item::prev, and osd_text_item::root.

Referenced by osd_text_prepare().

◆ plugin_init()

void plugin_init ( void  )

◆ round_to_nice_value()

static int round_to_nice_value ( double  value)
static

References value.

Referenced by osd_scale_draw().

◆ set_std_osd_attr()

◆ str_replace()

static char* str_replace ( char *  output,
char *  input,
char *  pattern,
char *  replacement 
)
static

References startup::pos.

Referenced by osd_odometer_draw(), and osd_speed_cam_draw().

◆ transform_move()

static void transform_move ( int  dx,
int  dy,
struct point p,
int  count 
)
static

Move a group of points in a direction (adding dx and dy to their x and y coordinates)

Parameters
dxThe shift to perform to the x axis
dyThe shift to perform to the y axis
[in,out]pAn array of points to move
countThe number of points stored inside p

References p.

Referenced by draw_handle().

◆ transform_rotate()

static void transform_rotate ( struct point center,
int  angle,
struct point p,
int  count 
)
static

Rotate a group of points around a center.

Parameters
centerThe coordinates of the center of the rotation to apply
angleThe angle of the rotation
[in,out]pAn array of points to rotate
countThe number of points stored inside p

References center, M_PI, and p.

Referenced by draw_compass(), and draw_handle().

Variable Documentation

◆ b_commandtable_added

int b_commandtable_added = 0
static

◆ camdir_t_strs

char* camdir_t_strs[] = {"All dir.","UNI-dir","BI-dir"}

Referenced by osd_speed_cam_draw().

◆ camera_t_strs

char* camera_t_strs[] = {"None","Fix","Traffic lamp","Red detect","Section","Mobile","Rail","Traffipax(non persistent)"}

Referenced by osd_speed_cam_draw().

◆ commands

struct command_table commands[]
static
Initial value:
= {
{"odometer_reset",command_cast(osd_cmd_odometer_reset)},
}
#define command_cast(x)
Definition: command.h:32
static int osd_cmd_odometer_reset(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: osd_core.c:585

Referenced by osd_button_new(), osd_cmd_interface_new(), and osd_odometer_new().

◆ odometer_list

GList* odometer_list = NULL
static

◆ odometers_saved

int odometers_saved = 0
static

Referenced by osd_odometer_destroy().