navit  0.5.3-trunk
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 int navit_cmd_zoom_to_route (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_set_center_cursor (struct navit *this_, char *function, struct attr **in, struct attr ***out)
 Recenters the map so that the vehicle cursor is visible. More...
 
static int navit_cmd_announcer_toggle (struct navit *this_, char *function, struct attr **in, struct attr ***out)
 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 int navit_cmd_switch_layout_day_night (struct navit *this_, char *function, struct attr **in, struct attr ***out)
 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_)
 Get the current mapset. More...
 
struct mapnavit_get_search_results_map (struct navit *this_)
 Get the search result map (and create it if it does not exist) More...
 
int navit_populate_search_results_map (struct navit *this_, GList *search_results, struct coord_rect *r)
 Populate a map containing one or more search result points. More...
 
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_, char *cmd, struct attr **in, struct attr ***out)
 
static int navit_cmd_zoom_out (struct navit *this_, char *cmd, struct attr **in, struct attr ***out)
 
static int navit_cmd_say (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_set_int_var (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_set_attr_var (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_toggle_layer (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_map_add_curr_pos (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_map_item_set_attr (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_get_attr_var (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_get_int_var (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_push_int (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_pop_int (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_int_stack_size (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static struct attr ** navit_get_coord (struct navit *this, struct attr **in, struct pcoord *pc)
 
static int navit_cmd_set_destination (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_route_remove_next_waypoint (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_route_remove_last_waypoint (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_set_center (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_set_position (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_fmt_coordinates (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_strjoin (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
static int navit_cmd_spawn (struct navit *this, char *function, struct attr **in, struct attr ***out)
 
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)
 Retrieves destinations from the route. More...
 
int navit_get_destination_count (struct navit *this_)
 Get the destinations count for the route. More...
 
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_)
 
int 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)
 
struct layoutnavit_get_layout_by_name (struct navit *this_, const char *layout_name)
 Select the default layout by name. More...
 
void navit_update_current_layout (struct navit *this_, struct layout *layout)
 Set the current layout. More...
 
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 *unused)
 
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

◆ coord_not_set()

static int coord_not_set ( struct coord  c)
static

References c, pcoord::x, and pcoord::y.

Referenced by navit_vehicle_draw().

◆ navit_add_attr()

◆ navit_add_callback()

◆ navit_add_destination_description()

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(), c, description(), former_destination, and recentdest_count.

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

◆ navit_add_former_destinations_from_file()

◆ navit_add_layout()

static int navit_add_layout ( struct navit this_,
struct layout layout 
)
static

check if we want to immediately activate this layout. Unfortunately we have concurring conditions about when to activate a layout:

  • A layout could bear the "active" property
  • A layout's name could match this_->default_layout_name This cannot be fully resolved, as we cannot predict the future, so lets set the last parsed layout active, which either matches default_layout_name or bears the "active" tag, or is the first layout ever parsed.

References active, dbg, default_layout_name, layout, layout_current, layout_get_attr(), layouts, lvl_debug, layout::name, attr::num, and attr::u.

Referenced by navit_add_attr().

◆ navit_add_log()

static int navit_add_log ( struct navit this_,
struct log log 
)
static

◆ navit_add_mapset()

void navit_add_mapset ( struct navit this_,
struct mapset ms 
)

References mapsets.

◆ navit_add_message()

void navit_add_message ( struct navit this_,
const char *  message 
)

◆ navit_add_vehicle()

◆ navit_attr_iter_destroy()

◆ navit_attr_iter_new()

◆ navit_autozoom()

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, center, navit_scale(), trans, transform_get_projection(), transform_get_scale(), transform_get_size(), and transform_point().

Referenced by navit_set_center_cursor().

◆ navit_block()

int navit_block ( struct navit this_,
int  block 
)

Blocks or unblocks redraw operations.

The

Definition: mg.h:33

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(), Java_org_navitproject_navit_NavitCallbackHandler_callbackCmdChannel(), request_navit_block(), Backend::resize(), and Backend::showMenu().

◆ navit_button()

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

◆ navit_check_route()

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().

◆ navit_cmd_announcer_toggle()

static int navit_cmd_announcer_toggle ( struct navit this_,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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.

◆ navit_cmd_fmt_coordinates()

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

◆ navit_cmd_get_attr_var()

static int navit_cmd_get_attr_var ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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

◆ navit_cmd_get_int_var()

static int navit_cmd_get_int_var ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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

◆ navit_cmd_int_stack_size()

static int navit_cmd_int_stack_size ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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

◆ navit_cmd_map_add_curr_pos()

static int navit_cmd_map_add_curr_pos ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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(), attr::type, type, attr::u, map_selection::u, vehicle_get_attr(), coord::x, and coord::y.

◆ navit_cmd_map_item_set_attr()

static int navit_cmd_map_item_set_attr ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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, attr::type, type, and attr::u.

◆ navit_cmd_pop_int()

static int navit_cmd_pop_int ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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

◆ navit_cmd_push_int()

static int navit_cmd_push_int ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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

◆ navit_cmd_route_remove_last_waypoint()

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

◆ navit_cmd_route_remove_next_waypoint()

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

◆ navit_cmd_say()

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

◆ navit_cmd_set_attr_var()

static int navit_cmd_set_attr_var ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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

◆ navit_cmd_set_center()

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

◆ navit_cmd_set_center_cursor()

static int navit_cmd_set_center_cursor ( struct navit this_,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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

static void navit_set_center_cursor_draw(struct navit *this_)
Recenters the map so that the vehicle cursor is visible.
Definition: navit.c:2524

.

Parameters
this_The navit object

References navit_set_center_cursor_draw().

◆ navit_cmd_set_destination()

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

◆ navit_cmd_set_int_var()

static int navit_cmd_set_int_var ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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

◆ navit_cmd_set_position()

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

◆ navit_cmd_spawn()

static int navit_cmd_spawn ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

◆ navit_cmd_strjoin()

static int navit_cmd_strjoin ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
Returns
0

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

◆ navit_cmd_switch_layout_day_night()

static int navit_cmd_switch_layout_day_night ( struct navit this_,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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

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, layout_current, lvl_debug, layout::name, navit_layout_switch(), navit_set_layout_by_name(), layout::nightname, prevTs, attr::str, type, and vehicle.

◆ navit_cmd_toggle_layer()

static int navit_cmd_toggle_layer ( struct navit this,
char *  function,
struct attr **  in,
struct attr ***  out 
)
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
0

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

◆ navit_cmd_zoom_in()

static int navit_cmd_zoom_in ( struct navit this_,
char *  cmd,
struct attr **  in,
struct attr ***  out 
)
static

◆ navit_cmd_zoom_out()

static int navit_cmd_zoom_out ( struct navit this_,
char *  cmd,
struct attr **  in,
struct attr ***  out 
)
static

◆ navit_cmd_zoom_to_route()

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

References navit_zoom_to_route().

◆ navit_command_add_table()

void navit_command_add_table ( struct navit this_,
struct command_table commands,
int  count 
)

◆ navit_destroy()

◆ navit_disable_suspend()

void navit_disable_suspend ( void  )

◆ navit_draw()

◆ navit_draw_async()

◆ navit_draw_displaylist()

void navit_draw_displaylist ( struct navit this_)

◆ navit_former_destinations_active()

static int navit_former_destinations_active ( struct navit this_)
static

◆ navit_get_attr()

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(), auto_switch, autozoom_active, attr::bookmarks, bookmarks, bookmarks_get_map(), c, attr::callback_list, center, center_timeout, attr::coord_geo, dbg, destination, destination_valid, attr::displaylist, displaylist, navit_vehicle::follow_curr, follow_cursor, former_destination, gra, attr::graphics, attr::gui, 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, attr::navigation, navigation, navit_get_messages(), navit_object_get_attr(), message::next, attr::num, offset, orientation, osd_configuration, attr::pcoord, attr::route, route, attr::speech, speech, attr::str, sunrise_degrees, message::text, attr::tracking, tracking, tracking_flag, trans, transform_get_center(), transform_get_pitch(), transform_get_projection(), transform_get_scale(), transform_to_geo(), attr::transformation, tunnel_nightlayout, attr::type, type, attr::u, attr_iter::u, attr::vehicle, navit_vehicle::vehicle, vehicle, attr::vehicleprofile, 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(), gtk_gui_poi(), 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(), model_poi(), NGQProxyBookmarks::moveDown(), NGQProxyBookmarks::moveRoot(), NGQProxyBookmarks::moveUp(), navit_cmd_announcer_toggle(), navit_get_attr_py(), navit_get_layout_by_name(), navit_init(), 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_draw_arrows(), pedestrian_navit_init(), pedestrian_read_tilt(), popup_set_bookmark(), request_navit_get_attr(), request_navit_set_layout(), request_navit_traffic_export_gpx(), request_navit_traffic_inject(), resolve_object(), NGQProxyBookmarks::setPoint(), speech_dbus_say(), statusbar_route_update(), traffic_set_shared(), and traffic_traff_android_on_feed_received().

◆ navit_get_blocked()

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().

◆ navit_get_coord()

◆ navit_get_cursor_pnt()

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, p, radius, padding::right, navit_vehicle::speed, padding::top, tracking, tracking_flag, tracking_get_angle(), trans, transform_get_size(), vehicle, and width.

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

◆ navit_get_destination_count()

int navit_get_destination_count ( struct navit this_)

◆ navit_get_destination_description()

char* navit_get_destination_description ( struct navit this_,
int  n 
)

◆ navit_get_destinations()

int navit_get_destinations ( struct navit this_,
struct pcoord pc,
int  count 
)

Retrieves destinations from the route.

Prior to calling this method, you may want to retrieve the number of destinations by calling navit_get_destination_count(struct navit *) and assigning a buffer of sufficient capacity.

If the return value equals count, the buffer was either just large enough or too small to hold the entire list of destinations; there is no way to tell from the result which is the case.

If the Navit instance does not have a route, the result is 0.

Parameters
this_The Navit instance
pcPointer to an array of projected coordinates which will receive the destination coordinates
countCapacity of pc
Returns
The number of destinations stored in pc, never greater than count

References route, and route_get_destinations().

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

◆ navit_get_displaylist()

struct displaylist* navit_get_displaylist ( struct navit this_)

◆ navit_get_graphics()

◆ navit_get_gui()

struct gui* navit_get_gui ( struct navit this_)

References gui.

Referenced by popup(), and popup_set_bookmark().

◆ navit_get_height()

◆ navit_get_layout_by_name()

struct layout* navit_get_layout_by_name ( struct navit this_,
const char *  layout_name 
)

Select the default layout by name.

Parameters
this_The navit instance
nameThe new default layout's name
Returns
The first layout match (if any), or NULL if there was no match

References attr_iter::iter, attr::layout, layout::name, navit_attr_iter_destroy(), navit_attr_iter_new(), navit_get_attr(), and attr::u.

Referenced by layout_new(), and navit_update_current_layout().

◆ navit_get_mapset()

◆ navit_get_messages()

struct message* navit_get_messages ( struct navit this_)

References message_get(), and messages.

Referenced by navit_get_attr(), and osd_text_draw().

◆ navit_get_navigation()

◆ navit_get_ready()

int navit_get_ready ( struct navit this_)

◆ navit_get_route()

◆ navit_get_search_results_map()

struct map* navit_get_search_results_map ( struct navit this_)

Get the search result map (and create it if it does not exist)

Parameters
this_The navit instance
Returns
A pointer to the map named "search_results" or NULL if there wasa failure

References attr::attr_types, attrmap, attr::attrs, attr::map, map_new(), mapset_add_attr(), mapset_get_map_by_name(), navit_get_mapset(), attr::num, attr::str, attr::type, types, and attr::u.

Referenced by navit_populate_search_results_map().

◆ navit_get_tracking()

◆ navit_get_trans()

◆ navit_get_user_data_directory()

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(), main_setup_environment(), osd_odometer_new(), osd_odometer_save(), popup_traffic_distortion(), tm_dump_item_to_textfile(), traffic_dump_messages_to_xml(), and traffic_get_map().

◆ navit_get_vehicleprofile()

struct vehicleprofile* navit_get_vehicleprofile ( struct navit this_)

References vehicleprofile.

Referenced by osd_speed_warner_draw(), and osd_text_draw().

◆ navit_get_vehicleprofiles()

GList* navit_get_vehicleprofiles ( struct navit this_)

◆ navit_get_width()

◆ navit_handle_button()

◆ navit_handle_motion()

◆ navit_handle_resize()

◆ navit_ignore_button()

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().

◆ navit_ignore_graphics_events()

void navit_ignore_graphics_events ( struct navit this_,
int  ignore 
)

◆ navit_init()

◆ navit_layout_switch()

◆ navit_map_progress()

static void navit_map_progress ( struct navit this_)
static

◆ navit_mark_navigation_stopped()

static void navit_mark_navigation_stopped ( char *  former_destination_file)
static

◆ navit_motion()

static void navit_motion ( void *  data,
struct point p 
)
static

◆ navit_motion_timeout()

◆ navit_new()

◆ navit_populate_search_results_map()

int navit_populate_search_results_map ( struct navit this_,
GList search_results,
struct coord_rect r 
)

Populate a map containing one or more search result points.

These search results will be displayed as an overlay on the top of the geographic map.

Warning
Each call to this function will replace currently displayed results, it will not add to them
Parameters
this_The navit instance
search_resultsA GList storing
struct lcoord
An integer mercator coordinate packed with a text label.
Definition: coord.h:46
elements to display on the result map If this argument in NULL, all existing results will be removed from the map
[in,out]coord_rectAn optional rectangular zone that will be extended to contain all result points or NULL if no zone needs to be computed
Returns
The number of results actually added to the map

References change_mode_modify, coord_rect_extend(), dbg, item, item_attr_set(), item_coord_set(), item_type_set(), coord_rect::lu, lvl_info, lvl_warning, map_rect_create_item(), map_rect_destroy(), map_rect_get_item(), map_rect_new(), navit_get_search_results_map(), coord_rect::rl, square_shape_str(), attr::str, attr::type, and attr::u.

Referenced by button_destination(), button_destination_clicked(), button_map(), button_map_clicked(), button_visit_clicked(), gtk_gui_poi(), gui_gtk_action_activate(), and gui_internal_prepare_search_results_map().

◆ navit_popup()

static void navit_popup ( void *  data)
static

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

Referenced by navit_button().

◆ navit_predraw()

static void navit_predraw ( struct navit this_)
static

◆ navit_projection_set()

static void navit_projection_set ( struct navit this_,
enum projection  pro,
int  draw 
)
static

◆ navit_redraw_route()

static void navit_redraw_route ( struct navit this_,
struct route route,
struct attr attr 
)
static

◆ navit_remove_attr()

int navit_remove_attr ( struct navit this_,
struct attr attr 
)

◆ navit_remove_callback()

void navit_remove_callback ( struct navit this_,
struct callback cb 
)

◆ navit_remove_nth_waypoint()

void navit_remove_nth_waypoint ( struct navit this_,
int  n 
)

◆ navit_remove_waypoint()

void navit_remove_waypoint ( struct navit this_)

◆ navit_resize()

static void navit_resize ( void *  data,
int  w,
int  h 
)
static

◆ navit_restrict_map_center_to_world_boundingbox()

static void navit_restrict_map_center_to_world_boundingbox ( struct transformation tr,
struct coord new_center 
)
static

◆ navit_restrict_to_range()

static int navit_restrict_to_range ( int  value,
int  min,
int  max 
)
static

◆ navit_say()

void navit_say ( struct navit this_,
const char *  text 
)

◆ navit_scale()

static void navit_scale ( struct navit this_,
long  scale,
struct point p,
int  draw 
)
static

◆ navit_set_attr()

◆ navit_set_attr_do()

◆ navit_set_center()

void navit_set_center ( struct navit this_,
struct pcoord center,
int  set_timeout 
)

◆ navit_set_center_coord_screen()

static void navit_set_center_coord_screen ( struct navit this_,
struct coord c,
struct point p,
int  set_timeout 
)
static

◆ navit_set_center_cursor()

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

@ attr_position_valid_invalid
Definition: attr.h:123

, 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().

◆ 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

void navit_set_center_cursor(struct navit *this_, int autozoom, int keep_orientation)
Recalculates the map view so that the vehicle cursor is visible.
Definition: navit.c:2499

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().

◆ navit_set_center_screen()

void navit_set_center_screen ( struct navit this_,
struct point p,
int  set_timeout 
)

◆ navit_set_cursors()

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(), name, navit_vehicle::vehicle, vehicle_get_attr(), vehicle_set_cursor(), and vehicles.

Referenced by navit_init(), and navit_set_attr_do().

◆ navit_set_destination()

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

Start or add a given set of coordinates for route computing

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
asyncSet to 1 to do route calculation asynchronously
Returns
nothing

References attr_cbl, bookmarks_append_destinations(), bookmarks_get_destination_file(), c, callback_list_call_attr_0, dbg, description(), destination, destination_valid, flags, former_destination, lvl_debug, navit_draw(), navit_get_attr(), navit_mark_navigation_stopped(), ready, recentdest_count, route, route_append_destination(), route_get_destination_count(), route_get_destinations(), route_set_destination(), waypoints_flag, pcoord::x, and pcoord::y.

Referenced by button_destination(), button_destination_clicked(), gui_gtk_action_activate(), gui_internal_cmd2_abort_navigation(), gui_internal_cmd_load_bookmarks_as_waypoints(), gui_internal_cmd_set_destination(), Java_org_navitproject_navit_NavitCallbackHandler_callbackCmdChannel(), Java_org_navitproject_navit_NavitCallbackHandler_callbackMessageChannel(), navit_cmd_set_destination(), navit_remove_nth_waypoint(), navit_remove_waypoint(), navit_set_destination_py(), navit_vehicle_update_position(), notify_apply(), popup_set_destination(), request_navit_clear_destination(), request_navit_set_destination(), route_clear_action(), Backend::setActivePoiAsDestination(), NGQProxyNavit::setDestination(), and NGQProxyNavit::stopNavigation().

◆ navit_set_destinations()

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(), c, callback_list_call_attr_0, description(), destination, destination_valid, former_destination, navit_draw(), ready, recentdest_count, route, and route_set_destinations().

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

◆ navit_set_graphics()

◆ navit_set_gui()

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

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

Referenced by navit_add_attr().

◆ navit_set_layout_by_name()

◆ navit_set_position()

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, c, 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().

◆ navit_set_timeout()

void navit_set_timeout ( struct navit this_)

◆ navit_set_vehicle()

◆ navit_set_vehicle_by_name()

◆ navit_set_vehicleprofile()

static int navit_set_vehicleprofile ( struct navit this_,
struct vehicleprofile vp 
)
static

◆ navit_set_vehicleprofile_name()

int navit_set_vehicleprofile_name ( struct navit this_,
char *  name 
)

◆ navit_speak()

◆ navit_textfile_debug_log()

void navit_textfile_debug_log ( struct navit this_,
const char *  fmt,
  ... 
)

◆ navit_textfile_debug_log_at()

void navit_textfile_debug_log_at ( struct navit this_,
struct pcoord pc,
const char *  fmt,
  ... 
)

◆ navit_update_current_layout()

void navit_update_current_layout ( struct navit this_,
struct layout layout 
)

Set the current layout.

Parameters
this_The navit instance
layoutThe layout to set as default (if NULL, we will set the current layout according to the default name stored in this_->default_layout_name
Note
If argument layout is NULL and the default layout name in the config file does not exist or has not been provided in the config file, the default layout is unchanged

References dbg, default_layout_name, layout, layout_current, lvl_debug, lvl_warning, and navit_get_layout_by_name().

Referenced by navit_set_attr_do().

◆ navit_vehicle_draw()

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_get_projection(), transform_get_yaw(), transform_point(), navit_vehicle::vehicle, and vehicle_draw().

Referenced by navit_predraw(), and navit_vehicle_update_position().

◆ 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
    Definition: navit.c:112
    '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
The vehicle used for navigation.
Definition: navit.c:98
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, 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_from_geo(), transform_get_projection(), transform_point(), transform_within_border(), attr::u, navit_vehicle::vehicle, vehicle, vehicle_get_attr(), vehicleprofile, coord::x, pcoord::x, coord::y, and pcoord::y.

Referenced by navit_add_vehicle().

◆ navit_vehicle_update_status()

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

char type[3]
Definition: garmin_img.c:2

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, type, navit_vehicle::vehicle, and vehicle.

Referenced by navit_add_vehicle().

◆ navit_window_roadbook_destroy()

void navit_window_roadbook_destroy ( struct navit this_)

◆ navit_window_roadbook_new()

◆ navit_window_roadbook_update()

◆ navit_zoom_in()

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(), p, 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().

◆ navit_zoom_in_cursor()

◆ navit_zoom_out()

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(), p, 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().

◆ navit_zoom_out_cursor()

◆ navit_zoom_to_rect()

◆ navit_zoom_to_route()

◆ read_former_destinations_from_file()

struct map* read_former_destinations_from_file ( void  )

◆ update_transformation()

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

Variable Documentation

◆ cmd_attr_var_hash

GHashTable* cmd_attr_var_hash = NULL
static

◆ cmd_int_var_hash

GHashTable* cmd_int_var_hash = NULL
static

◆ cmd_int_var_stack

◆ commands

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)},
}
#define command_cast(x)
Definition: command.h:32
static int navit_cmd_announcer_toggle(struct navit *this_, char *function, struct attr **in, struct attr ***out)
Toggles the navigation announcer for navit.
Definition: navit.c:1935
static int navit_cmd_say(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:870
static int navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:972
static int navit_cmd_zoom_out(struct navit *this_, char *cmd, struct attr **in, struct attr ***out)
Definition: navit.c:864
static int navit_cmd_spawn(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1393
static int navit_cmd_set_center(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1316
static int navit_cmd_switch_layout_day_night(struct navit *this_, char *function, struct attr **in, struct attr ***out)
this command is used to change the layout and enable/disable the automatic layout switcher
Definition: navit.c:3648
static int navit_cmd_set_center_cursor(struct navit *this_, char *function, struct attr **in, struct attr ***out)
Recenters the map so that the vehicle cursor is visible.
Definition: navit.c:2538
static int navit_cmd_zoom_in(struct navit *this_, char *cmd, struct attr **in, struct attr ***out)
Definition: navit.c:858
static int navit_cmd_toggle_layer(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:945
static int navit_cmd_set_position(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1329
static int navit_cmd_route_remove_next_waypoint(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1302
static int navit_cmd_set_destination(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1289
static int navit_cmd_route_remove_last_waypoint(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1309
static int navit_cmd_get_attr_var(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1125
static int navit_cmd_set_attr_var(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:915
static int navit_cmd_get_int_var(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1160
static int navit_cmd_pop_int(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1214
static int navit_cmd_push_int(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1196
static int navit_cmd_set_int_var(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:888
static int navit_cmd_int_stack_size(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1239
static int navit_cmd_strjoin(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1358
static int navit_cmd_zoom_to_route(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:2333
static int navit_cmd_fmt_coordinates(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1339
static int navit_cmd_map_item_set_attr(struct navit *this, char *function, struct attr **in, struct attr ***out)
Definition: navit.c:1061

Referenced by navit_command_add_table(), and navit_new().

◆ global_navit

struct navit* global_navit

◆ main_loop_gui

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.

Referenced by navit_set_gui().

◆ navit_func

struct object_func navit_func
Initial value:
= {
attr_navit,
}
int navit_add_attr(struct navit *this_, struct attr *attr)
Definition: navit.c:3108
struct attr_iter * navit_attr_iter_new(void *unused)
Definition: navit.c:3188
int navit_init(struct navit *this_)
Definition: navit.c:2107
void navit_attr_iter_destroy(struct attr_iter *iter)
Definition: navit.c:3192
void navit_destroy(struct navit *this_)
Definition: navit.c:3792
struct navit * navit_new(struct attr *parent, struct attr **attrs)
Definition: navit.c:1477
int navit_set_attr(struct navit *this_, struct attr *attr)
Definition: navit.c:2792
int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: navit.c:2796
int navit_remove_attr(struct navit *this_, struct attr *attr)
Definition: navit.c:3171
void * navit_object_unref(struct navit_object *obj)
Definition: xmlconfig.c:1313
struct navit_object * navit_object_ref(struct navit_object *obj)
Definition: xmlconfig.c:1307
void(* object_func_iter_destroy)(struct attr_iter *)
Definition: xmlconfig.h:57
void *(* object_func_new)(struct attr *parent, struct attr **attrs)
Definition: xmlconfig.h:54
int(* object_func_remove_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:60
void *(* object_func_ref)(void *)
Definition: xmlconfig.h:64
struct attr_iter *(* object_func_iter_new)(void *)
Definition: xmlconfig.h:56
int(* object_func_init)(void *)
Definition: xmlconfig.h:61
void *(* object_func_dup)(void *)
Definition: xmlconfig.h:63
int(* object_func_add_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:59
void(* object_func_destroy)(void *)
Definition: xmlconfig.h:62
int(* object_func_set_attr)(void *, struct attr *attr)
Definition: xmlconfig.h:58
int(* object_func_get_attr)(void *, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition: xmlconfig.h:55
void *(* object_func_unref)(void *)
Definition: xmlconfig.h:65

Referenced by navit_new(), and object_func_lookup().