navit  0.5.1-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
The navit core instance

navit is the object containing most global data structures. More...

Data Structures

struct  navit_vehicle
 The vehicle used for navigation. More...
 
struct  navit
 
struct  attr_iter
 

Functions

static void navit_vehicle_update_position (struct navit *this_, struct navit_vehicle *nv)
 Called when the position of a vehicle changes. More...
 
static void navit_vehicle_draw (struct navit *this_, struct navit_vehicle *nv, struct point *pnt)
 
static int navit_add_vehicle (struct navit *this_, struct vehicle *v)
 Registers a new vehicle. More...
 
static int navit_set_attr_do (struct navit *this_, struct attr *attr, int init)
 
static int navit_get_cursor_pnt (struct navit *this_, struct point *p, int keep_orientation, int *dir)
 Calculates the position of the cursor on the screen. More...
 
static void navit_set_cursors (struct navit *this_)
 
static void navit_cmd_zoom_to_route (struct navit *this)
 
static void navit_cmd_set_center_cursor (struct navit *this_)
 Recenters the map so that the vehicle cursor is visible. More...
 
static void navit_cmd_announcer_toggle (struct navit *this_)
 Toggles the navigation announcer for navit. More...
 
static void navit_set_vehicle (struct navit *this_, struct navit_vehicle *nv)
 
static int navit_set_vehicleprofile (struct navit *this_, struct vehicleprofile *vp)
 
static void navit_cmd_switch_layout_day_night (struct navit *this_, char *function, struct attr **in, struct attr ***out, int valid)
 this command is used to change the layout and enable/disable the automatic layout switcher More...
 
void navit_add_mapset (struct navit *this_, struct mapset *ms)
 
struct mapsetnavit_get_mapset (struct navit *this_)
 
struct trackingnavit_get_tracking (struct navit *this_)
 
char * navit_get_user_data_directory (int create)
 Get the user data directory. More...
 
void navit_draw_async (struct navit *this_, int async)
 
void navit_draw (struct navit *this_)
 
int navit_get_ready (struct navit *this_)
 
void navit_draw_displaylist (struct navit *this_)
 
static void navit_map_progress (struct navit *this_)
 
static void navit_redraw_route (struct navit *this_, struct route *route, struct attr *attr)
 
void navit_handle_resize (struct navit *this_, int w, int h)
 
static void navit_resize (void *data, int w, int h)
 
int navit_get_width (struct navit *this_)
 
int navit_get_height (struct navit *this_)
 
static void navit_popup (void *data)
 
int navit_ignore_button (struct navit *this_)
 Sets a flag indicating that the current button event should be ignored by subsequent handlers. More...
 
void navit_ignore_graphics_events (struct navit *this_, int ignore)
 
static int navit_restrict_to_range (int value, int min, int max)
 
static void navit_restrict_map_center_to_world_boundingbox (struct transformation *tr, struct coord *new_center)
 
static void update_transformation (struct transformation *tr, struct point *old, struct point *new)
 Change map center position by translating from "old" to "new". More...
 
void navit_set_timeout (struct navit *this_)
 
int navit_handle_button (struct navit *this_, int pressed, int button, struct point *p, struct callback *popup_callback)
 
static void navit_button (void *data, int pressed, int button, struct point *p)
 
static void navit_motion_timeout (struct navit *this_)
 
void navit_handle_motion (struct navit *this_, struct point *p)
 
static void navit_motion (void *data, struct point *p)
 
static void navit_predraw (struct navit *this_)
 
static void navit_scale (struct navit *this_, long scale, struct point *p, int draw)
 
static void navit_autozoom (struct navit *this_, struct coord *center, int speed, int draw)
 Automatically adjusts zoom level. More...
 
void navit_zoom_in (struct navit *this_, int factor, struct point *p)
 
void navit_zoom_out (struct navit *this_, int factor, struct point *p)
 
void navit_zoom_in_cursor (struct navit *this_, int factor)
 
void navit_zoom_out_cursor (struct navit *this_, int factor)
 
static int navit_cmd_zoom_in (struct navit *this_)
 
static int navit_cmd_zoom_out (struct navit *this_)
 
static void navit_cmd_say (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_set_int_var (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_set_attr_var (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_toggle_layer (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_map_add_curr_pos (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_map_item_set_attr (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_get_attr_var (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_get_int_var (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_push_int (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_pop_int (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_int_stack_size (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static struct attr ** navit_get_coord (struct navit *this, struct attr **in, struct pcoord *pc)
 
static void navit_cmd_set_destination (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_route_remove_next_waypoint (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_route_remove_last_waypoint (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_set_center (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_set_position (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_fmt_coordinates (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_strjoin (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
static void navit_cmd_spawn (struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
 
void navit_command_add_table (struct navit *this_, struct command_table *commands, int count)
 
struct navitnavit_new (struct attr *parent, struct attr **attrs)
 
static int navit_set_gui (struct navit *this_, struct gui *gui)
 
void navit_add_message (struct navit *this_, const char *message)
 
struct messagenavit_get_messages (struct navit *this_)
 
static int navit_set_graphics (struct navit *this_, struct graphics *gra)
 
struct graphicsnavit_get_graphics (struct navit *this_)
 
struct vehicleprofilenavit_get_vehicleprofile (struct navit *this_)
 
GListnavit_get_vehicleprofiles (struct navit *this_)
 
static void navit_projection_set (struct navit *this_, enum projection pro, int draw)
 
static void navit_mark_navigation_stopped (char *former_destination_file)
 
void navit_set_destination (struct navit *this_, struct pcoord *c, const char *description, int async)
 
void navit_add_destination_description (struct navit *this_, struct pcoord *c, const char *description)
 
void navit_set_destinations (struct navit *this_, struct pcoord *c, int count, const char *description, int async)
 
int navit_get_destinations (struct navit *this_, struct pcoord *pc, int count)
 
int navit_get_destination_count (struct navit *this_)
 
char * navit_get_destination_description (struct navit *this_, int n)
 
void navit_remove_nth_waypoint (struct navit *this_, int n)
 
void navit_remove_waypoint (struct navit *this_)
 
int navit_check_route (struct navit *this_)
 Checks if a route is calculated. More...
 
static int navit_former_destinations_active (struct navit *this_)
 
struct mapread_former_destinations_from_file ()
 
static void navit_add_former_destinations_from_file (struct navit *this_)
 
void navit_textfile_debug_log (struct navit *this_, const char *fmt,...)
 
void navit_textfile_debug_log_at (struct navit *this_, struct pcoord *pc, const char *fmt,...)
 
void navit_say (struct navit *this_, const char *text)
 
void navit_speak (struct navit *this_)
 
static void navit_window_roadbook_update (struct navit *this_)
 
void navit_window_roadbook_destroy (struct navit *this_)
 
void navit_window_roadbook_new (struct navit *this_)
 
void navit_init (struct navit *this_)
 
void navit_zoom_to_rect (struct navit *this_, struct coord_rect *r)
 
void navit_zoom_to_route (struct navit *this_, int orientation)
 
void navit_set_center (struct navit *this_, struct pcoord *center, int set_timeout)
 
static void navit_set_center_coord_screen (struct navit *this_, struct coord *c, struct point *p, int set_timeout)
 
void navit_set_center_cursor (struct navit *this_, int autozoom, int keep_orientation)
 Recalculates the map view so that the vehicle cursor is visible. More...
 
static void navit_set_center_cursor_draw (struct navit *this_)
 Recenters the map so that the vehicle cursor is visible. More...
 
void navit_set_center_screen (struct navit *this_, struct point *p, int set_timeout)
 
int navit_set_attr (struct navit *this_, struct attr *attr)
 
int navit_get_attr (struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
 
static int navit_add_log (struct navit *this_, struct log *log)
 
static int navit_add_layout (struct navit *this_, struct layout *layout)
 
int navit_add_attr (struct navit *this_, struct attr *attr)
 
int navit_remove_attr (struct navit *this_, struct attr *attr)
 
struct attr_iternavit_attr_iter_new (void)
 
void navit_attr_iter_destroy (struct attr_iter *iter)
 
void navit_add_callback (struct navit *this_, struct callback *cb)
 
void navit_remove_callback (struct navit *this_, struct callback *cb)
 
static int coord_not_set (struct coord c)
 
static void navit_vehicle_update_status (struct navit *this_, struct navit_vehicle *nv, enum attr_type type)
 Called when a status attribute of a vehicle changes. More...
 
void navit_set_position (struct navit *this_, struct pcoord *c)
 
int navit_set_vehicleprofile_name (struct navit *this_, char *name)
 
struct guinavit_get_gui (struct navit *this_)
 
struct transformationnavit_get_trans (struct navit *this_)
 
struct routenavit_get_route (struct navit *this_)
 
struct navigationnavit_get_navigation (struct navit *this_)
 
struct displaylistnavit_get_displaylist (struct navit *this_)
 
void navit_layout_switch (struct navit *n)
 
int navit_set_vehicle_by_name (struct navit *n, const char *name)
 
int navit_set_layout_by_name (struct navit *n, const char *name)
 
void navit_disable_suspend ()
 
int navit_block (struct navit *this_, int block)
 Blocks or unblocks redraw operations. More...
 
int navit_get_blocked (struct navit *this_)
 Returns whether redraw operations are currently blocked. More...
 
void navit_destroy (struct navit *this_)
 

Variables

struct guimain_loop_gui
 
struct object_func navit_func
 
struct navitglobal_navit
 
static GHashTable * cmd_int_var_hash = NULL
 
static GHashTable * cmd_attr_var_hash = NULL
 
GListcmd_int_var_stack = NULL
 
static struct command_table commands []
 

Detailed Description

navit is the object containing most global data structures.

Among others:

Function Documentation

static int coord_not_set ( struct coord  c)
static

References coord::x, and coord::y.

Referenced by navit_vehicle_draw().

void navit_add_destination_description ( struct navit this_,
struct pcoord c,
const char *  description 
)

Add destination description to the recent dest file. Doesn't start routing.

Parameters
navitThe navit instance
cThe coordinate to start routing to
descriptionA label which allows the user to later identify this destination in the former destinations selection
Returns
nothing

References bookmarks_append_destinations(), bookmarks_get_destination_file(), former_destination, recentdest_count, and TRUE.

Referenced by gui_internal_cmd_insert_destination_do(), gui_internal_cmd_load_bookmarks_as_waypoints(), and popup_set_visitbefore().

static int navit_add_layout ( struct navit this_,
struct layout layout 
)
static
static int navit_add_log ( struct navit this_,
struct log log 
)
static
void navit_add_mapset ( struct navit this_,
struct mapset ms 
)

References mapsets.

void navit_add_message ( struct navit this_,
const char *  message 
)
static void navit_autozoom ( struct navit this_,
struct coord center,
int  speed,
int  draw 
)
static

Automatically adjusts zoom level.

This function automatically adjusts the current zoom level according to the current speed.

Parameters
this_The navit struct
centerThe "immovable" point - i.e. the vehicles position if we're centering on the vehicle
speedThe vehicles speed in meters per second
dirThe direction into which the vehicle moves

References autozoom_active, autozoom_max, autozoom_min, autozoom_paused, autozoom_secs, navit_scale(), trans, transform(), transform_get_projection(), transform_get_scale(), and transform_get_size().

Referenced by navit_set_center_cursor().

int navit_block ( struct navit this_,
int  block 
)

Blocks or unblocks redraw operations.

The

parameter specifies the operation to carry out:

block > 0

cancels all draw operations in progress and blocks future operations. It sets flag 1 of the

blocked

member. If draw operations in progress were canceled, flag 2 is also set.

block = 0

unblocks redraw operations, resetting

blocked

to 0. If flag 2 was previously set, indicating that draw operations had been previously canceled, a redraw is triggered.

block < 0

unblocks redraw operations and forces a redraw. As above,

blocked

is reset to 0.

Parameters
this_The navit instance
blockThe operation to perform, see description
Returns
true
if a redraw operation was triggered,
false
if not

References blocked, displaylist, gra, graphics_draw_cancel(), and navit_draw().

Referenced by Backend::block_draw(), gui_internal_check_exit(), gui_internal_enter(), request_navit_block(), Backend::resize(), and Backend::showMenu().

static void navit_button ( void *  data,
int  pressed,
int  button,
struct point p 
)
static
int navit_check_route ( struct navit this_)

Checks if a route is calculated.

This function checks if a route is calculated.

Parameters
this_The navit struct whose route should be checked.
Returns
True if the route is set, false otherwise.

References route, and route_get_path_set().

static void navit_cmd_announcer_toggle ( struct navit this_)
static

Toggles the navigation announcer for navit.

Parameters
this_The navit object

References attr_cbl, callback_list_call_attr_1, navit_get_attr(), attr::num, attr::speech, speech_get_attr(), speech_set_attr(), attr::type, and attr::u.

static void navit_cmd_fmt_coordinates ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static
static void navit_cmd_get_attr_var ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Get attr variable given a key string for the command system (for opaque usage)

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attribute in[0] is the key string
outoutput attribute, the attr for the given key string if exists or NULL
validunused
Returns
nothing

References attr_dup(), ATTR_IS_STRING, cmd_attr_var_hash, attr::item, type, attr::type, and attr::u.

static void navit_cmd_get_int_var ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Get value given a key string for the command system

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attribute in[0] is the key string
outoutput attribute, the value for the given key string if exists or 0
validunused
Returns
nothing

References attr_dup(), ATTR_IS_STRING, cmd_int_var_hash, attr::num, type, attr::type, and attr::u.

static void navit_cmd_int_stack_size ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Get current size of command system's integer stack

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attributes unused
outoutput attribute, the size of stack
validunused
Returns
nothing

References cmd_int_var_stack, attr::num, attr::type, and attr::u.

static void navit_cmd_map_add_curr_pos ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

adds an item with the current coordinate of the vehicle to a named map

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attribute in[0] is the name of the map
outoutput attribute, 0 on error or the id of the created item on success
validunused
Returns
nothing

References attr_dup_content(), ATTR_IS_STRING, map_selection::c_rect, change_mode_modify, attr::coord_geo, dbg, attr::item, item_coord_set(), item_from_name(), coord_rect::lu, lvl_error, map_rect_create_item(), map_rect_destroy(), map_rect_new(), mapset_get_map_by_name(), item_range::max, navit_get_mapset(), map_selection::next, map_selection::order, projection_mg, map_selection::range, coord_rect::rl, attr::str, transform_from_geo(), type, attr::type, map_selection::u, attr::u, vehicle_get_attr(), coord::x, and coord::y.

static void navit_cmd_map_item_set_attr ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

sets an attribute (name value pair) of a map item specified by map name and item id

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attribute in[0] - name of the map ; in[1] - item ; in[2] - attr name ; in[3] - attr value
outoutput attribute, 0 on error, 1 on success
validunused
Returns
nothing

References attr_from_name(), ATTR_IS_DOUBLE, ATTR_IS_INT, ATTR_IS_ITEM, ATTR_IS_STRING, change_mode_modify, dbg, item::id_hi, item::id_lo, attr::item, item_attr_set(), lvl_debug, map_rect_destroy(), map_rect_get_item_byid(), map_rect_new(), mapset_get_map_by_name(), navit_get_mapset(), attr::num, attr::numd, attr::str, type, attr::type, and attr::u.

static void navit_cmd_pop_int ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Pop an integer from the command system's integer stack

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attributes unused
outoutput attribute, the value popped if stack isn't empty or 0
validunused
Returns
nothing

References cmd_int_var_stack, attr::num, attr::type, and attr::u.

static void navit_cmd_push_int ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Push an integer to the stack for the command system

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attribute in[0] is the integer attibute to push
outoutput attributes, unused
validunused
Returns
nothing

References attr_dup_content(), ATTR_IS_NUMERIC, cmd_int_var_stack, and type.

static void navit_cmd_route_remove_last_waypoint ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static
static void navit_cmd_route_remove_next_waypoint ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static
static void navit_cmd_say ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static
static void navit_cmd_set_attr_var ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Store key value pair for the command system (for attr typed values, can be used as opaque handles)

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attributes in[0] is the key string, in[1] is the attr* value to store
outoutput attributes, unused
validunused
Returns
nothing

References attr_dup(), attr_free(), ATTR_IS_STRING, cmd_attr_var_hash, dbg, key, lvl_warning, type, and attr::u.

static void navit_cmd_set_center ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static
static void navit_cmd_set_center_cursor ( struct navit this_)
static

Recenters the map so that the vehicle cursor is visible.

This is the callback function for the

set_center_cursor()

command. It is just a wrapper around

.

Parameters
this_The navit object

References navit_set_center_cursor_draw().

static void navit_cmd_set_destination ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static
static void navit_cmd_set_int_var ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Store key value pair for the command system (for int typed values)

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attributes in[0] is the key string, in[1] is the integer value to store
outoutput attributes, unused
validunused
Returns
nothing

References attr_dup_content(), ATTR_IS_NUMERIC, ATTR_IS_STRING, cmd_int_var_hash, key, type, and attr::u.

static void navit_cmd_set_position ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static
static void navit_cmd_spawn ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Call external program

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attributes in[0] - name of executable, in[1..] - parameters
outoutput attribute unused
validunused
Returns
nothing

References argv, attr_to_text(), dbg, lvl_debug, spawn_process(), spawn_process_info_free(), and type.

static void navit_cmd_strjoin ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

Join several string attributes into one

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attributes in[0] - separator, in[1..] - attributes to join
outoutput attribute joined attribute as string
validunused
Returns
nothing

References attr_generic_add_attr(), attr_to_text(), attr::str, attr::type, and attr::u.

static void navit_cmd_switch_layout_day_night ( struct navit this_,
char *  function,
struct attr **  in,
struct attr ***  out,
int  valid 
)
static

this command is used to change the layout and enable/disable the automatic layout switcher

Parameters
this_The navit instance
functionunused
ininput attributes in[0], a string, see usage below
outoutput attribute unused
validunused

usage : manual : disable autoswitcher auto : enable autoswitcher manual_toggle : disable autoswitcher and toggle between day / night layout manual_day : disable autoswitcher and set to day layout manual_night : disable autoswitcher and set to night layout

todo : make it return the state of the autoswitcher and the version of the active layout (day/night/undefined)

References ATTR_IS_STRING, auto_switch, layout::dayname, dbg, FALSE, layout_current, lvl_debug, layout::name, navit_layout_switch(), navit_set_layout_by_name(), layout::nightname, prevTs, attr::str, TRUE, type, and vehicle.

static void navit_cmd_toggle_layer ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out,
int valid 
)
static

command to toggle the active state of a named layer of the current layout

Parameters
navitThe navit instance
functionunused (needed to match command function signature)
ininput attribute in[0] is the name of the layer
outoutput unused
validunused
Returns
nothing

References layer::active, ATTR_IS_STRING, layer::name, navit_draw(), attr::str, type, and attr::u.

static int navit_cmd_zoom_in ( struct navit this_)
static
static int navit_cmd_zoom_out ( struct navit this_)
static
static void navit_cmd_zoom_to_route ( struct navit this)
static

References navit_zoom_to_route().

void navit_command_add_table ( struct navit this_,
struct command_table commands,
int  count 
)
void navit_disable_suspend ( void  )
void navit_draw_displaylist ( struct navit this_)
static int navit_former_destinations_active ( struct navit this_)
static
int navit_get_attr ( struct navit this_,
enum attr_type  type,
struct attr attr,
struct attr_iter iter 
)

References attr_cbl, attr_generic_get_attr(), attr_to_name(), autozoom_active, bookmarks, attr::bookmarks, bookmarks_get_map(), c, attr::callback_list, center, center_timeout, attr::coord_geo, dbg, destination, destination_valid, displaylist, attr::displaylist, navit_vehicle::follow_curr, follow_cursor, former_destination, gra, attr::graphics, gui, attr::gui, h, imperial, attr_iter::iter, attr::layout, layout_current, layouts, attr_iter::list, lvl_debug, attr::map, attr::mapset, mapset_close(), attr_iter::mapset_handle, mapset_next(), mapset_open(), mapsets, navigation, attr::navigation, navit_get_messages(), navit_object_get_attr(), message::next, attr::num, offset, orientation, osd_configuration, attr::pcoord, route, attr::route, speech, attr::speech, attr::str, message::text, tracking, attr::tracking, tracking_flag, trans, transform_get_center(), transform_get_pitch(), transform_get_projection(), transform_get_scale(), transform_to_geo(), attr::transformation, type, attr::type, attr_iter::u, attr::u, navit_vehicle::vehicle, vehicle, attr::vehicle, vehicleprofile, attr::vehicleprofile, vehicleprofiles, vehicles, w, and waypoints_flag.

Referenced by NGQProxyBookmarks::AddBookmark(), NGQProxyBookmarks::AddFolder(), bookmarks_emit_dbus_signal(), button_bookmark(), NGQProxyBookmarks::Copy(), NGQProxyBookmarks::Cut(), NGQProxyBookmarks::Delete(), Backend::get_bookmarks(), get_distance_str(), get_icon(), Backend::get_maps(), Backend::get_vehicles(), NGQProxyNavit::getAttrFunc(), NGQProxyNavit::getAttrList(), NGQProxyBookmarks::getBookmarks(), graphics_sdl_idle(), gui_gtk_add_bookmark_do(), gui_gtk_bookmarks_init(), gui_gtk_bookmarks_update(), gui_gtk_destinations_update(), gui_gtk_init(), gui_gtk_layouts_init(), gui_gtk_maps_init(), gui_gtk_route_callback(), gui_gtk_toggle_init(), gui_gtk_ui_init(), gui_gtk_vehicles_update(), gui_internal_button_navit_attr_new(), gui_internal_cmd2_pois(), gui_internal_cmd2_setting_layout(), gui_internal_cmd2_setting_maps(), gui_internal_cmd2_setting_vehicle(), gui_internal_cmd_add_bookmark_do(), gui_internal_cmd_add_bookmark_folder_do(), gui_internal_cmd_bookmarks(), gui_internal_cmd_copy_bookmark(), gui_internal_cmd_cut_bookmark(), gui_internal_cmd_delete_bookmark(), gui_internal_cmd_delete_bookmark_folder(), gui_internal_cmd_formerdests(), gui_internal_cmd_load_bookmarks_as_waypoints(), gui_internal_cmd_paste_bookmark(), gui_internal_cmd_pois(), gui_internal_cmd_position_do(), gui_internal_cmd_rename_bookmark_clicked(), gui_internal_cmd_replace_bookmarks_from_waypoints(), gui_internal_dbus_signal(), gui_internal_is_active_vehicle(), gui_internal_poi_icon(), gui_internal_populate_route_table(), gui_internal_set_position_coord(), gui_qml_dbus_signal(), invoke(), map_route_occluded_rect_new(), NGQProxyBookmarks::moveDown(), NGQProxyBookmarks::moveRoot(), NGQProxyBookmarks::moveUp(), navit_cmd_announcer_toggle(), navit_get_attr_py(), navit_layout_switch(), navit_set_destination(), navit_set_layout_by_name(), navit_set_vehicle_by_name(), navit_window_roadbook_update(), NPP_SetWindow(), osd_auxmap_draw(), osd_compass_draw(), osd_gps_status_draw(), osd_marker_draw(), osd_nav_toggle_announcer_draw(), osd_odometer_draw(), osd_rocket_init(), osd_route_guard_draw(), osd_scale_draw(), osd_speed_cam_draw(), osd_speed_warner_draw(), osd_std_calculate_sizes_and_redraw(), osd_std_config(), osd_text_draw(), NGQProxyBookmarks::Paste(), pedestrian_cmd_pedestrian_rocket(), pedestrian_draw_arrows(), pedestrian_navit_init(), pedestrian_read_tilt(), popup_set_bookmark(), request_navit_get_attr(), request_navit_set_layout(), resolve_object(), NGQProxyBookmarks::setPoint(), speech_dbus_say(), and statusbar_route_update().

int navit_get_blocked ( struct navit this_)

Returns whether redraw operations are currently blocked.

References blocked.

Referenced by osd_button_draw(), osd_button_set_attr(), and osd_text_set_attr().

static int navit_get_cursor_pnt ( struct navit this_,
struct point p,
int  keep_orientation,
int dir 
)
static

Calculates the position of the cursor on the screen.

This method considers padding if supported by the graphics plugin. In that case, the inner rectangle (i.e. screen size minus padding) will be used to center the cursor and to determine cursor offset (as specified in this_->radius).

Parameters
this_The navit object
pReceives the screen coordinates for the cursor
keep_orientationWhether to maintain the current map orientation. If false, the map will be rotated so that the bearing of the vehicle is up.
dirReceives the new map orientation as requested by screen_orientation (can be NULL)
Returns
Always 1

References padding::bottom, dbg, navit_vehicle::dir, gra, graphics_get_data(), height, padding::left, lvl_debug, lvl_warning, M_PI, offset, orientation, radius, padding::right, navit_vehicle::speed, padding::top, tracking, tracking_flag, tracking_get_angle(), trans, transform_get_size(), vehicle, width, point::x, and point::y.

Referenced by navit_set_center_cursor(), navit_zoom_in_cursor(), and navit_zoom_out_cursor().

char* navit_get_destination_description ( struct navit this_,
int  n 
)
struct displaylist* navit_get_displaylist ( struct navit this_)
struct gui* navit_get_gui ( struct navit this_)

References gui.

Referenced by popup(), and popup_set_bookmark().

int navit_get_height ( struct navit this_)
struct message* navit_get_messages ( struct navit this_)

References message_get(), and messages.

Referenced by navit_get_attr(), and osd_text_draw().

int navit_get_ready ( struct navit this_)

References ready.

Referenced by gui_internal_set_graphics().

char* navit_get_user_data_directory ( int  create)

Get the user data directory.

Parameters
[in]create- create the directory if it does not exist
Returns
char * to the data directory string.

returns the directory used to store user data files (center.txt, destination.txt, bookmark.txt, ...)

References dbg, file_exists(), file_mkdir(), lvl_debug, and lvl_error.

Referenced by bookmarks_get_center_file(), bookmarks_get_destination_file(), bookmarks_new(), gui_internal_set(), gui_internal_setup(), osd_odometer_new(), osd_odometer_save(), and popup_traffic_distortion().

struct vehicleprofile* navit_get_vehicleprofile ( struct navit this_)

References vehicleprofile.

Referenced by osd_speed_warner_draw(), and osd_text_draw().

GList* navit_get_vehicleprofiles ( struct navit this_)
int navit_get_width ( struct navit this_)
int navit_ignore_button ( struct navit this_)

Sets a flag indicating that the current button event should be ignored by subsequent handlers.

Calling this function will set the

ignore_button

member to

true

and return its previous state. The default handler, navit_handle_button(navit *, int, int, point *, callback *) calls this function just before the actual event handling core and aborts if the result is

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.

Parameters
this_The navit instance
Returns
true
if the caller should ignore the button event,
false
if it should handle it

References ignore_button.

Referenced by osd_odometer_click(), osd_speed_warner_click(), osd_std_click(), osd_stopwatch_click(), and osd_volume_click().

void navit_ignore_graphics_events ( struct navit this_,
int  ignore 
)
static void navit_mark_navigation_stopped ( char *  former_destination_file)
static
static void navit_motion ( void *  data,
struct point p 
)
static
static void navit_popup ( void *  data)
static

References button_timeout, data, popped, and popup().

Referenced by navit_button().

static void navit_predraw ( struct navit this_)
static
static void navit_projection_set ( struct navit this_,
enum projection  pro,
int  draw 
)
static
static void navit_redraw_route ( struct navit this_,
struct route route,
struct attr attr 
)
static
int navit_remove_attr ( struct navit this_,
struct attr attr 
)
void navit_remove_callback ( struct navit this_,
struct callback cb 
)
void navit_remove_nth_waypoint ( struct navit this_,
int  n 
)
void navit_remove_waypoint ( struct navit this_)
static void navit_resize ( void *  data,
int  w,
int  h 
)
static
static void navit_restrict_map_center_to_world_boundingbox ( struct transformation tr,
struct coord new_center 
)
static
static int navit_restrict_to_range ( int  value,
int  min,
int  max 
)
static
void navit_say ( struct navit this_,
const char *  text 
)
static void navit_scale ( struct navit this_,
long  scale,
struct point p,
int  draw 
)
static
void navit_set_center ( struct navit this_,
struct pcoord center,
int  set_timeout 
)
static void navit_set_center_coord_screen ( struct navit this_,
struct coord c,
struct point p,
int  set_timeout 
)
static
void navit_set_center_cursor ( struct navit this_,
int  autozoom,
int  keep_orientation 
)

Recalculates the map view so that the vehicle cursor is visible.

This function recalculates the parameters which control the visible map area, zoom and orientation. The caller is responsible for redrawing the map after the function returns.

If the vehicle supplies a

position_valid

attribute and it is

, the map position is not changed.

Parameters
this_The navit object
autozoomWhether to set zoom based on current speed. If false, current zoom will be maintained.
keep_orientationWhether to maintain the current map orientation. If false, the map will be rotated so that the bearing of the vehicle is up.

References attr_position_valid_invalid, navit_vehicle::coord, navit_autozoom(), navit_get_cursor_pnt(), navit_set_center_coord_screen(), attr::num, navit_vehicle::speed, trans, transform_set_yaw(), attr::u, navit_vehicle::vehicle, vehicle, and vehicle_get_attr().

Referenced by navit_set_center_cursor_draw().

static void navit_set_center_cursor_draw ( struct navit this_)
static

Recenters the map so that the vehicle cursor is visible.

This function first calls

to recalculate the map display, then triggers a redraw of the map.

Parameters
this_The navit object

References navit_draw_async(), navit_set_center_cursor(), and ready.

Referenced by navit_cmd_set_center_cursor(), and navit_vehicle_update_position().

static void navit_set_cursors ( struct navit this_)
static

Links all vehicles to a cursor depending on the current profile.

Parameters
this_A navit instance
Author
Ralph Sennhauser (10/2009)

References c, layout_current, layout_get_cursor(), attr::str, attr::u, navit_vehicle::vehicle, vehicle_get_attr(), vehicle_set_cursor(), and vehicles.

Referenced by navit_init(), and navit_set_attr_do().

void navit_set_destination ( struct navit this_,
struct pcoord c,
const char *  description,
int  async 
)
void navit_set_destinations ( struct navit this_,
struct pcoord c,
int  count,
const char *  description,
int  async 
)

Start the route computing to a given set of coordinates including waypoints

Parameters
this_The navit instance
cThe coordinate to start routing to
descriptionA label which allows the user to later identify this destination in the former destinations selection
asyncIf routing should be done asynchronously
Returns
nothing

References attr_cbl, bookmarks_append_destinations(), bookmarks_get_destination_file(), callback_list_call_attr_0, destination, destination_valid, former_destination, navit_draw(), ready, recentdest_count, route, route_set_destinations(), and TRUE.

Referenced by gui_internal_cmd_delete_waypoint(), gui_internal_cmd_insert_destination_do(), gui_internal_cmd_load_bookmarks_as_waypoints(), and popup_set_visitbefore().

static int navit_set_gui ( struct navit this_,
struct gui gui 
)
static

References dbg, gui, gui_has_main_loop(), and lvl_error.

Referenced by navit_add_attr().

void navit_set_position ( struct navit this_,
struct pcoord c 
)

Set the position of the vehicle

Parameters
navitThe navit instance
cThe coordinate to set as position
Returns
nothing

References attr_cbl, callback_list_call_attr_0, navit_draw(), ready, route, and route_set_position().

Referenced by gui_internal_cmd_set_position(), navit_cmd_set_position(), navit_set_position_py(), popup_set_position(), request_navit_set_position(), NGQProxyNavit::setPosition(), and Backend::showMenu().

void navit_set_timeout ( struct navit this_)
static int navit_set_vehicleprofile ( struct navit this_,
struct vehicleprofile vp 
)
static
int navit_set_vehicleprofile_name ( struct navit this_,
char *  name 
)
void navit_textfile_debug_log ( struct navit this_,
const char *  fmt,
  ... 
)
void navit_textfile_debug_log_at ( struct navit this_,
struct pcoord pc,
const char *  fmt,
  ... 
)
static void navit_vehicle_draw ( struct navit this_,
struct navit_vehicle nv,
struct point pnt 
)
static

Toggle the cursor update : refresh the map each time the cursor has moved (instead of only when it reaches a border)

Parameters
this_The navit instance
nvvehicle to draw
pntScreen coordinates of the vehicle. If NULL, position stored in nv is used.
Returns
nothing

References blocked, navit_vehicle::coord, coord_not_set(), navit_vehicle::dir, gra, navit_vehicle::speed, trans_cursor, transform(), transform_get_projection(), transform_get_yaw(), navit_vehicle::vehicle, and vehicle_draw().

Referenced by navit_predraw(), and navit_vehicle_update_position().

static void navit_vehicle_update_position ( struct navit this_,
struct navit_vehicle nv 
)
static

Called when the position of a vehicle changes.

This function is called when the position of any configured vehicle changes and triggers all actions that need to happen in response, such as:

  • Switching between day and night layout (based on the new position timestamp)
  • Updating position, bearing and speed of
    nv
    with the data of the active vehicle (which may be different from the vehicle reporting the update)
  • Invoking callbacks for 's
    attr_position
    and
    attr_position_coord_geo
    attributes
  • Triggering an update of the vehicle's position on the map and, if needed, an update of the visible map area ad orientation
  • Logging a new track point, if enabled
  • Updating the position on the route
  • Stopping navigation if the destination has been reached
Parameters
this_The navit object
nvThe which reported a new position

References attr_cbl, attr_position_valid_invalid, bookmarks_append_destinations(), bookmarks_get_destination_file(), border, button_pressed, callback_list_call_attr_0, callback_list_call_attr_2, navit_vehicle::coord, attr::coord_geo, description(), navit_vehicle::dir, navit_vehicle::follow, navit_vehicle::follow_curr, follow_cursor, former_destination, gui, int(), navit_disable_suspend(), navit_layout_switch(), navit_set_center_cursor_draw(), navit_set_destination(), navit_textfile_debug_log(), navit_vehicle_draw(), attr::num, attr::numd, pcoord::pro, profile, ready, recentdest_count, route, route_destination_reached(), route_get_destination_count(), route_get_destination_description(), route_get_destinations(), route_remove_waypoint(), route_set_position(), route_set_position_from_tracking(), navit_vehicle::speed, tracking, tracking_flag, tracking_get_attr(), tracking_update(), trans_cursor, transform(), transform_from_geo(), transform_get_projection(), transform_within_border(), TRUE, attr::u, navit_vehicle::vehicle, vehicle, vehicle_get_attr(), vehicleprofile, coord::x, pcoord::x, coord::y, and pcoord::y.

Referenced by navit_add_vehicle().

static void navit_vehicle_update_status ( struct navit this_,
struct navit_vehicle nv,
enum attr_type  type 
)
static

Called when a status attribute of a vehicle changes.

This function is called when the

position_fix_type

,

position_sats_used

or

position_hdop

attribute of any configured vehicle changes.

The function checks if

nv

refers to the active vehicle and if

is one of the above types. If this is the case, it invokes the callback functions for

's respective attributes.

Future actions that need to happen when one of these three attribute changes for any vehicle should be implemented here.

Parameters
this_The navit object
nvThe which reported a new status attribute
typeThe type of attribute with has changed

References attr_cbl, callback_list_call_attr_2, navit_vehicle::vehicle, and vehicle.

Referenced by navit_add_vehicle().

void navit_window_roadbook_destroy ( struct navit this_)
void navit_zoom_in ( struct navit this_,
int  factor,
struct point p 
)

Change the current zoom level, zooming closer to the ground

Parameters
navitThe navit instance
factorThe zoom factor, usually 2
pThe invariant point (if set to NULL, default to center)
Returns
nothing

References autozoom_active, autozoom_paused, navit_scale(), trans, and transform_get_scale().

Referenced by gui_internal_keypress(), gui_qml_keypress(), keypress(), navit_handle_button(), navit_zoom_in_cursor(), request_navit_zoom(), WndProc(), and zoom_in_action().

void navit_zoom_out ( struct navit this_,
int  factor,
struct point p 
)

Change the current zoom level

Parameters
navitThe navit instance
factorThe zoom factor, usually 2
pThe invariant point (if set to NULL, default to center)
Returns
nothing

References autozoom_active, autozoom_paused, navit_scale(), trans, and transform_get_scale().

Referenced by gui_internal_keypress(), gui_qml_keypress(), keypress(), navit_handle_button(), navit_zoom_out_cursor(), request_navit_zoom(), WndProc(), and zoom_out_action().

struct map* read_former_destinations_from_file ( void  )
static void update_transformation ( struct transformation tr,
struct point old,
struct point new 
)
static

Variable Documentation

GHashTable* cmd_attr_var_hash = NULL
static
GHashTable* cmd_int_var_hash = NULL
static
struct command_table commands[]
static
Initial value:
= {
{"set_center_cursor",command_cast(navit_cmd_set_center_cursor)},
{"route_remove_next_waypoint",command_cast(navit_cmd_route_remove_next_waypoint)},
{"route_remove_last_waypoint",command_cast(navit_cmd_route_remove_last_waypoint)},
{"map_item_set_attr",command_cast(navit_cmd_map_item_set_attr)},
{"switch_layout_day_night",command_cast(navit_cmd_switch_layout_day_night)},
}
static void navit_cmd_toggle_layer(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:855
static void navit_cmd_pop_int(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1137
static int navit_cmd_zoom_out(struct navit *this_)
Definition: navit.c:767
static void navit_cmd_int_stack_size(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1165
static void navit_cmd_announcer_toggle(struct navit *this_)
Toggles the navigation announcer for navit.
Definition: navit.c:1882
#define command_cast(x)
Definition: command.h:32
static void navit_cmd_route_remove_last_waypoint(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1240
static void navit_cmd_set_center(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1247
static void navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:884
static void navit_cmd_spawn(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1330
static void navit_cmd_fmt_coordinates(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1272
static void navit_cmd_strjoin(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1293
static void navit_cmd_set_attr_var(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:824
static void navit_cmd_push_int(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1117
static int navit_cmd_zoom_in(struct navit *this_)
Definition: navit.c:759
static void navit_cmd_map_item_set_attr(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:975
static void navit_cmd_zoom_to_route(struct navit *this)
Definition: navit.c:2279
static void navit_cmd_set_destination(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1219
static void navit_cmd_get_attr_var(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1040
static void navit_cmd_get_int_var(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1078
static void navit_cmd_route_remove_next_waypoint(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1233
static void navit_cmd_set_center_cursor(struct navit *this_)
Recenters the map so that the vehicle cursor is visible.
Definition: navit.c:2494
static void navit_cmd_say(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:775
static void navit_cmd_set_position(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:1261
static void navit_cmd_switch_layout_day_night(struct navit *this_, char *function, struct attr **in, struct attr ***out, int valid)
this command is used to change the layout and enable/disable the automatic layout switcher ...
Definition: navit.c:3510
static void navit_cmd_set_int_var(struct navit *this, char *function, struct attr **in, struct attr ***out, int *valid)
Definition: navit.c:795
struct navit* global_navit
struct gui* main_loop_gui

Navit, a modular navigation system. Copyright (C) 2005-2008 Navit Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

struct object_func navit_func
Initial value:
= {
attr_navit,
}
void(* object_func_destroy)(void *)
Definition: xmlconfig.h:62
void *(* object_func_dup)(void *)
Definition: xmlconfig.h:63
int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: navit.c:2736
void(* object_func_iter_destroy)(struct attr_iter *)
Definition: xmlconfig.h:57
void navit_attr_iter_destroy(struct attr_iter *iter)
Definition: navit.c:3062
int navit_add_attr(struct navit *this_, struct attr *attr)
Definition: navit.c:2974
void navit_object_unref(struct navit_object *obj)
Definition: xmlconfig.c:1272
struct navit * navit_new(struct attr *parent, struct attr **attrs)
Definition: navit.c:1416
int(* object_func_init)(void *)
Definition: xmlconfig.h:61
void *(* object_func_ref)(void *)
Definition: xmlconfig.h:64
void navit_init(struct navit *this_)
Definition: navit.c:2074
struct attr_iter *(* object_func_iter_new)(void *)
Definition: xmlconfig.h:56
void *(* object_func_unref)(void *)
Definition: xmlconfig.h:65
int(* object_func_remove_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:60
void *(* object_func_new)(struct attr *parent, struct attr **attrs)
Definition: xmlconfig.h:54
int(* object_func_set_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:58
void navit_destroy(struct navit *this_)
Definition: navit.c:3669
struct attr_iter * navit_attr_iter_new(void)
Definition: navit.c:3056
int navit_set_attr(struct navit *this_, struct attr *attr)
Definition: navit.c:2730
int(* object_func_get_attr)(void *, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: xmlconfig.h:55
struct navit_object * navit_object_ref(struct navit_object *obj)
Definition: xmlconfig.c:1264
int(* object_func_add_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:59
int navit_remove_attr(struct navit *this_, struct attr *attr)
Definition: navit.c:3038

Referenced by navit_new(), and object_func_lookup().