navit
0.5.3-trunk
|
Go to the source code of this file.
Macros | |
#define | FEET_PER_METER 3.2808399 |
#define | FEET_PER_MILE 5280 |
#define | KILOMETERS_TO_MILES 0.62137119 /* Kilometers to miles */ |
#define | METERS_TO_MILES (KILOMETERS_TO_MILES/1000.0) /* Meters to miles */ |
#define | MPS_TO_KPH 3.6 |
Enumerations | |
enum | nav_status { status_invalid = -2 , status_no_route = -1 , status_no_destination = 0 , status_position_wait = 1 , status_calculating = 2 , status_recalculating = 3 , status_routing = 4 } |
Functions | |
char * | nav_status_to_text (int status) |
Converts navigation status to human-readable text. More... | |
int | navigation_get_attr (struct navigation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
int | navigation_set_attr (struct navigation *this_, struct attr *attr) |
struct navigation * | navigation_new (struct attr *parent, struct attr **attrs) |
int | navigation_set_announce (struct navigation *this_, enum item_type type, int *level) |
void | navigation_destroy (struct navigation *this_) |
int | navigation_register_callback (struct navigation *this_, enum attr_type type, struct callback *cb) |
Registers a new callback function. More... | |
void | navigation_unregister_callback (struct navigation *this_, enum attr_type type, struct callback *cb) |
Unregisters a callback function. More... | |
struct map * | navigation_get_map (struct navigation *this_) |
void | navigation_set_route (struct navigation *this_, struct route *route) |
void | navigation_init (void) |
#define FEET_PER_METER 3.2808399 |
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.
#define FEET_PER_MILE 5280 |
#define KILOMETERS_TO_MILES 0.62137119 /* Kilometers to miles */ |
#define METERS_TO_MILES (KILOMETERS_TO_MILES/1000.0) /* Meters to miles */ |
#define MPS_TO_KPH 3.6 |
enum nav_status |
Values for the
attribute
char* nav_status_to_text | ( | int | status | ) |
Converts navigation status to human-readable text.
The | status. This must be one of the values for enum nav_status
|
References status_calculating, status_invalid, status_no_destination, status_no_route, status_position_wait, status_recalculating, and status_routing.
Referenced by attr_to_text_ext(), and osd_navigation_status_draw_do().
void navigation_destroy | ( | struct navigation * | this_ | ) |
int navigation_get_attr | ( | struct navigation * | this_, |
enum attr_type | type, | ||
struct attr * | attr, | ||
struct attr_iter * | iter | ||
) |
References attr_to_name(), dbg, item, item_attr_get(), attr::item_type, lvl_debug, attr::map, navigation::map, map_rect_destroy(), map_rect_get_item(), map_rect_new(), navigation::nav_status, navit_object_get_attr(), attr::num, navigation::turn_around_count, attr::type, item::type, type, and attr::u.
Referenced by navigation_register_callback(), navigation_unregister_callback(), osd_navigation_status_draw(), osd_navigation_status_init(), and request_navigation_get_attr().
struct map* navigation_get_map | ( | struct navigation * | this_ | ) |
References attr::attrs, data, description(), navigation::map, map_new(), attr::navigation, and type.
Referenced by gui_internal_populate_route_table(), navigation_get_map_py(), navit_init(), navit_speak(), navit_window_roadbook_update(), osd_nav_next_turn_draw(), osd_text_draw(), request_navit_route_export_geojson(), request_navit_route_export_gpx(), and statusbar_route_update().
void navigation_init | ( | void | ) |
Referenced by main_real().
struct navigation* navigation_new | ( | struct attr * | parent, |
struct attr ** | attrs | ||
) |
References navigation::announce, attr_search(), navigation::callback, callback_list_new(), navigation::callback_speech, navigation::delay, navigation::distance_turn, navigation::flags, navigation::hash, item_hash_new(), navigation::level_last, navigation_func, navigation::navit, navit_object_new(), attr::num, route_item_first, route_item_last, navigation::route_mr, navigation::tell_street_name, navigation::turn_around_limit, and attr::u.
int navigation_register_callback | ( | struct navigation * | this_, |
enum attr_type | type, | ||
struct callback * | cb | ||
) |
Registers a new callback function.
Callback functions are called whenever the attribute for which they are registered changes. It is possible to register callbacks for
, which will fire on any change.
The
object has three callback lists. They differ by the arguments which are passed to the callback function and are selected based on the attribute type:
this_ | The navigation object. |
type | The attribute type |
cb | The callback function |
References navigation::callback, attr::callback_list, callback_list_add(), navigation::callback_speech, navigation_get_attr(), type, and attr::u.
Referenced by navit_init(), navit_window_roadbook_new(), osd_navigation_status_init(), and traffic_traff_android_init().
int navigation_set_announce | ( | struct navigation * | this_, |
enum item_type | type, | ||
int * | level | ||
) |
int navigation_set_attr | ( | struct navigation * | this_, |
struct attr * | attr | ||
) |
References navigation::nav_status, navit_object_set_attr(), attr::num, attr::speech, navigation::speech, attr::type, and attr::u.
Referenced by navigation_update(), navigation_update_done(), and navit_init().
void navigation_set_route | ( | struct navigation * | this_, |
struct route * | route | ||
) |
References callback_cast, callback_new_attr_1, navigation_update(), attr::route, navigation::route, route_add_attr(), navigation::route_cb, route_get_attr(), route_remove_attr(), and callback::type.
Referenced by navit_init().
void navigation_unregister_callback | ( | struct navigation * | this_, |
enum attr_type | type, | ||
struct callback * | cb | ||
) |
Unregisters a callback function.
This function removes a previously registered callback function from the callback list to which it was added. See the documentation on navigation_register_callback(struct navigation *, enum attr_type, struct callback *) for details on callback lists.
this_ | The navigation object. |
type | The attribute type |
cb | The callback function |
References navigation::callback, attr::callback_list, callback_list_remove(), navigation::callback_speech, navigation_get_attr(), type, and attr::u.
Referenced by navit_window_roadbook_destroy().