navit  0.5.6
About: NavIt is a car navigation system with GPS tracking and a routing engine.
  Fossies Dox: navit-0.5.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

navit.c File Reference
#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <fcntl.h>
#include <glib.h>
#include <math.h>
#include <time.h>
#include "debug.h"
#include "navit.h"
#include "callback.h"
#include "gui.h"
#include "item.h"
#include "xmlconfig.h"
#include "projection.h"
#include "map.h"
#include "mapset.h"
#include "main.h"
#include "coord.h"
#include "point.h"
#include "transform.h"
#include "traffic.h"
#include "param.h"
#include "menu.h"
#include "graphics.h"
#include "popup.h"
#include "data_window.h"
#include "route.h"
#include "navigation.h"
#include "speech.h"
#include "track.h"
#include "vehicle.h"
#include "layout.h"
#include "log.h"
#include "attr.h"
#include "event.h"
#include "file.h"
#include "profile.h"
#include "command.h"
#include "navit_nls.h"
#include "util.h"
#include "messages.h"
#include "vehicleprofile.h"
#include "sunriset.h"
#include "bookmarks.h"
Include dependency graph for navit.c:

Go to the source code of this file.

Data Structures

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

Macros

#define _USE_MATH_DEFINES   1
 
#define TEXTFILE_COMMENT_NAVI_STOPPED   "# navigation stopped\n"
 

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 GHashTablecmd_int_var_hash = NULL
 
static GHashTablecmd_attr_var_hash = NULL
 
GListcmd_int_var_stack = NULL
 
static struct command_table commands []
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES   1

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

This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details.

You should have received a copy of the GNU 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.

Definition at line 20 of file navit.c.

◆ TEXTFILE_COMMENT_NAVI_STOPPED

#define TEXTFILE_COMMENT_NAVI_STOPPED   "# navigation stopped\n"

Definition at line 81 of file navit.c.