| navit
    0.5.3-trunk
    | 
#include <stdlib.h>#include <glib.h>#include <stdio.h>#include <errno.h>#include "config.h"#include "file.h"#include "debug.h"#include "projection.h"#include "coord.h"#include "transform.h"#include "callback.h"#include "map.h"#include "command.h"#include "bookmarks.h"#include "navit.h"#include "navit_nls.h"#include "util.h"| Data Structures | |
| struct | bookmarks | 
| struct | bookmark_item_priv | 
| struct | former_destination | 
| Functions | |
| void | bookmarks_move_root (struct bookmarks *this_) | 
| void | bookmarks_move_up (struct bookmarks *this_) | 
| int | bookmarks_move_down (struct bookmarks *this_, const char *name) | 
| void | bookmarks_item_rewind (struct bookmarks *this_) | 
| struct item * | bookmarks_get_item (struct bookmarks *this_) | 
| int | bookmarks_get_bookmark_count (struct bookmarks *this_) | 
| const char * | bookmarks_item_cwd (struct bookmarks *this_) | 
| static void | bookmarks_clear_item (struct bookmark_item_priv *b_item) | 
| static void | bookmarks_clear_hash (struct bookmarks *this_) | 
| static void | bookmarks_load_hash (struct bookmarks *this_) | 
| struct bookmarks * | bookmarks_new (struct attr *parent, struct attr **attrs, struct transformation *trans) | 
| void | bookmarks_destroy (struct bookmarks *this_) | 
| struct map * | bookmarks_get_map (struct bookmarks *this_) | 
| enum projection | bookmarks_get_projection (struct bookmarks *this_) | 
| void | bookmarks_add_callback (struct bookmarks *this_, struct callback *cb) | 
| static int | bookmarks_store_bookmarks_to_file (struct bookmarks *this_, int limit, int replace) | 
| char * | bookmarks_get_destination_file (gboolean create) | 
| char * | bookmarks_get_center_file (gboolean create) | 
| void | bookmarks_set_center_from_file (struct bookmarks *this_, char *file) | 
| void | bookmarks_write_center_to_file (struct bookmarks *this_, char *file) | 
| static void | bookmarks_emit_dbus_signal (struct bookmarks *this_, struct pcoord *c, const char *description, int create) | 
| int | bookmarks_add_bookmark (struct bookmarks *this_, struct pcoord *pc, const char *description) | 
| int | bookmarks_cut_bookmark (struct bookmarks *this_, const char *label) | 
| int | bookmarks_copy_bookmark (struct bookmarks *this_, const char *label) | 
| int | bookmarks_paste_bookmark (struct bookmarks *this_) | 
| int | bookmarks_delete_bookmark (struct bookmarks *this_, const char *label) | 
| int | bookmarks_rename_bookmark (struct bookmarks *this_, const char *oldName, const char *newName) | 
| static void | g_free_helper (void *data, void *user_data) | 
| static void | free_former_destination (struct former_destination *former_destination, void *unused) | 
| static GList * | read_former_destination_map_as_list (struct map *map) | 
| static int | destination_equal (struct former_destination *dest1, struct former_destination *dest2, int ignore_descriptions) | 
| static GList * | find_destination_in_list (struct former_destination *dest_to_remove, GList *former_destinations, int remove_found) | 
| static void | write_former_destinations (const GList *former_destinations, const char *former_destination_file, enum projection proj) | 
| Write all former destinations into a text file.  More... | |
| void | bookmarks_append_destinations (struct map *former_destination_map, char *former_destination_file, struct pcoord *c, int count, enum item_type type, const char *description, int limit) | 
| Append recent destination(s) item to the former destionations map.  More... | |
| int bookmarks_add_bookmark | ( | struct bookmarks * | this_, | 
| struct pcoord * | pc, | ||
| const char * | description | ||
| ) | 
Record the given set of coordinates as a bookmark
| navit | The navit instance | 
| c | The coordinate to store | 
| description | A label which allows the user to later identify this bookmark | 
References bookmarks::attr_cbl, bookmarks_clear_hash(), bookmarks_emit_dbus_signal(), bookmarks::bookmarks_list, bookmarks_load_hash(), bookmarks_store_bookmarks_to_file(), bookmark_item_priv::c, callback_list_call_attr_0, bookmark_item_priv::children, bookmarks::current, description(), bookmark_item_priv::label, bookmark_item_priv::parent, bookmark_item_priv::type, pcoord::x, and pcoord::y.
Referenced by NGQProxyBookmarks::AddBookmark(), NGQProxyBookmarks::AddFolder(), button_bookmark(), gui_gtk_add_bookmark_do(), gui_internal_cmd_add_bookmark_do(), gui_internal_cmd_add_bookmark_folder_do(), gui_internal_cmd_replace_bookmarks_from_waypoints(), and popup_set_bookmark().
References bookmarks::attr_cbl, and callback_list_add().
Referenced by gui_gtk_bookmarks_init().
| void bookmarks_append_destinations | ( | struct map * | former_destination_map, | 
| char * | former_destination_file, | ||
| struct pcoord * | c, | ||
| int | count, | ||
| enum item_type | type, | ||
| const char * | description, | ||
| int | limit | ||
| ) | 
Append recent destination(s) item to the former destionations map.
| former_destination_map | |
| former_destination_file | |
| c | coordinates of item point(s). Can be set to NULL when navigation is stopped to remove type_former_itinerary and type_former_itinerary_part items from the file. | 
| count | number of points in this item. Set to 0 when navigation is stopped. | 
| type | type_former_destination, type_former_itinerary and type_former_itinerary_part are meaningful here | 
| description | character string used to identify this destination. If NULL, most recent waypoint at these coordinates will be used to get description. | 
| limit | Limits the number of entries in the "backlog". Set to 0 for "infinite" | 
References _, c, description(), find_destination_in_list(), free_former_destination(), limit, map_projection(), read_former_destination_map_as_list(), transform_from_to(), type, write_former_destinations(), coord::x, pcoord::x, coord::y, and pcoord::y.
Referenced by navit_add_destination_description(), navit_set_destination(), navit_set_destinations(), and navit_vehicle_update_position().
| 
 | static | 
| 
 | static | 
References bookmark_item_priv::children, and bookmark_item_priv::label.
Referenced by bookmarks_clear_hash().
| int bookmarks_copy_bookmark | ( | struct bookmarks * | this_, | 
| const char * | label | ||
| ) | 
References bookmarks_item_rewind(), bookmark_item_priv::c, bookmark_item_priv::children, bookmarks::clipboard, bookmarks::current, data, bookmark_item_priv::item, bookmark_item_priv::iter, bookmark_item_priv::label, label, and bookmark_item_priv::type.
Referenced by bookmarks_cut_bookmark(), NGQProxyBookmarks::Copy(), and gui_internal_cmd_copy_bookmark().
| int bookmarks_cut_bookmark | ( | struct bookmarks * | this_, | 
| const char * | label | ||
| ) | 
References bookmarks_copy_bookmark(), bookmarks_delete_bookmark(), and label.
Referenced by NGQProxyBookmarks::Cut(), and gui_internal_cmd_cut_bookmark().
| int bookmarks_delete_bookmark | ( | struct bookmarks * | this_, | 
| const char * | label | ||
| ) | 
References bookmarks::attr_cbl, bookmarks_clear_hash(), bookmarks_emit_dbus_signal(), bookmarks_item_rewind(), bookmarks::bookmarks_list, bookmarks_load_hash(), bookmarks_store_bookmarks_to_file(), callback_list_call_attr_0, bookmark_item_priv::children, bookmarks::current, data, bookmark_item_priv::iter, and label.
Referenced by bookmarks_cut_bookmark(), NGQProxyBookmarks::Delete(), gui_internal_cmd_delete_bookmark(), gui_internal_cmd_delete_bookmark_folder(), and gui_internal_cmd_replace_bookmarks_from_waypoints().
| void bookmarks_destroy | ( | struct bookmarks * | this_ | ) | 
References bookmarks::attr_cbl, bookmarks::bookmark, bookmarks::bookmark_file, bookmarks_clear_hash(), callback_list_destroy(), bookmarks::clipboard, map_destroy(), and bookmarks::working_file.
Referenced by navit_destroy().
| 
 | static | 
References c, attr::callback_list, callback_list_call_attr_4, description(), attr::navit, navit_get_attr(), bookmarks::parent, attr::pcoord, attr::str, attr::type, and attr::u.
Referenced by bookmarks_add_bookmark(), and bookmarks_delete_bookmark().
| int bookmarks_get_bookmark_count | ( | struct bookmarks * | this_ | ) | 
| char* bookmarks_get_center_file | ( | gboolean | create | ) | 
References navit_get_user_data_directory().
Referenced by navit_destroy(), and navit_init().
| char* bookmarks_get_destination_file | ( | gboolean | create | ) | 
| create | create the directory where the file is stored if it does not exist | 
References navit_get_user_data_directory().
Referenced by navit_add_destination_description(), navit_former_destinations_active(), navit_set_destination(), navit_set_destinations(), navit_vehicle_update_position(), and read_former_destinations_from_file().
References bookmarks::current, item::id_hi, item::id_lo, bookmark_item_priv::iter, map_rect_get_item_byid(), and bookmarks::mr.
Referenced by Backend::get_bookmarks(), NGQProxyBookmarks::getBookmarks(), gui_internal_cmd_bookmarks(), gui_internal_cmd_load_bookmarks_as_waypoints(), gui_internal_cmd_replace_bookmarks_from_waypoints(), and NGQProxyBookmarks::setPoint().
References bookmarks::bookmark.
Referenced by navit_get_attr().
| enum projection bookmarks_get_projection | ( | struct bookmarks * | this_ | ) | 
Referenced by gui_internal_cmd_bookmarks(), and gui_internal_cmd_load_bookmarks_as_waypoints().
| const char* bookmarks_item_cwd | ( | struct bookmarks * | this_ | ) | 
References bookmarks::current, and bookmark_item_priv::label.
Referenced by NGQProxyBookmarks::getBookmarks(), and gui_internal_cmd_bookmarks().
| void bookmarks_item_rewind | ( | struct bookmarks * | this_ | ) | 
References bookmark_item_priv::children, bookmarks::current, and bookmark_item_priv::iter.
Referenced by bookmarks_copy_bookmark(), bookmarks_delete_bookmark(), bookmarks_get_bookmark_count(), bookmarks_move_down(), bookmarks_rename_bookmark(), Backend::get_bookmarks(), NGQProxyBookmarks::getBookmarks(), gui_internal_cmd_bookmarks(), gui_internal_cmd_load_bookmarks_as_waypoints(), gui_internal_cmd_replace_bookmarks_from_waypoints(), and NGQProxyBookmarks::setPoint().
| 
 | static | 
References bookmarks::bookmark, bookmarks::bookmarks_hash, bookmarks::bookmarks_list, bookmarks_move_down(), bookmarks_move_root(), bookmark_item_priv::c, c, bookmark_item_priv::children, bookmarks::current, dbg, bookmark_item_priv::item, item, item_attr_get(), item_coord_get(), bookmark_item_priv::label, lvl_debug, map_rect_destroy(), map_rect_get_item(), map_rect_new(), bookmarks::mr, bookmark_item_priv::parent, startup::pos, bookmarks::root, attr::str, bookmark_item_priv::type, item::type, attr::u, pcoord::x, and pcoord::y.
Referenced by bookmarks_add_bookmark(), bookmarks_delete_bookmark(), bookmarks_new(), bookmarks_paste_bookmark(), and bookmarks_rename_bookmark().
| int bookmarks_move_down | ( | struct bookmarks * | this_, | 
| const char * | name | ||
| ) | 
References bookmarks_item_rewind(), bookmark_item_priv::children, bookmarks::current, data, dbg, bookmark_item_priv::iter, bookmark_item_priv::label, lvl_info, and name.
Referenced by bookmarks_load_hash(), gui_internal_cmd_bookmarks(), gui_internal_cmd_replace_bookmarks_from_waypoints(), and NGQProxyBookmarks::moveDown().
| void bookmarks_move_root | ( | struct bookmarks * | this_ | ) | 
References bookmark_item_priv::children, bookmarks::current, dbg, bookmark_item_priv::iter, lvl_info, and bookmarks::root.
Referenced by bookmarks_load_hash(), gui_internal_cmd_bookmarks(), and NGQProxyBookmarks::moveRoot().
| void bookmarks_move_up | ( | struct bookmarks * | this_ | ) | 
| struct bookmarks* bookmarks_new | ( | struct attr * | parent, | 
| struct attr ** | attrs, | ||
| struct transformation * | trans | ||
| ) | 
References bookmarks::attr_cbl, attr::attrs, bookmarks::bookmark, bookmarks::bookmark_file, bookmarks_load_hash(), callback_list_new(), bookmarks::clipboard, data, map_new(), navit_get_user_data_directory(), bookmarks::parent, bookmarks::trans, type, and bookmarks::working_file.
Referenced by navit_new().
| int bookmarks_paste_bookmark | ( | struct bookmarks * | this_ | ) | 
References bookmarks::attr_cbl, bookmarks_clear_hash(), bookmarks::bookmarks_hash, bookmarks::bookmarks_list, bookmarks_load_hash(), bookmarks_store_bookmarks_to_file(), bookmark_item_priv::c, callback_list_call_attr_0, bookmark_item_priv::children, bookmarks::clipboard, bookmarks::current, bookmark_item_priv::item, bookmark_item_priv::label, bookmark_item_priv::parent, bookmark_item_priv::type, pcoord::x, and pcoord::y.
Referenced by gui_internal_cmd_paste_bookmark(), and NGQProxyBookmarks::Paste().
| int bookmarks_rename_bookmark | ( | struct bookmarks * | this_, | 
| const char * | oldName, | ||
| const char * | newName | ||
| ) | 
References bookmarks::attr_cbl, bookmarks_clear_hash(), bookmarks_item_rewind(), bookmarks_load_hash(), bookmarks_store_bookmarks_to_file(), callback_list_call_attr_0, bookmark_item_priv::children, bookmarks::current, data, and bookmark_item_priv::iter.
Referenced by gui_internal_cmd_rename_bookmark_clicked().
| void bookmarks_set_center_from_file | ( | struct bookmarks * | this_, | 
| char * | file | ||
| ) | 
References center, coord_parse(), dbg, lvl_error, bookmarks::trans, transform_center(), and transform_get_projection().
Referenced by navit_init().
| 
 | static | 
References _, bookmarks::bookmark_file, bookmarks::bookmarks_list, dbg, item, bookmark_item_priv::label, limit, lvl_debug, map_rect_destroy(), bookmarks::mr, attr::navit, navit_add_message(), bookmarks::parent, bookmark_item_priv::parent, projection_mg, projection_to_name(), item::type, attr::u, and bookmarks::working_file.
Referenced by bookmarks_add_bookmark(), bookmarks_delete_bookmark(), bookmarks_paste_bookmark(), and bookmarks_rename_bookmark().
| void bookmarks_write_center_to_file | ( | struct bookmarks * | this_, | 
| char * | file | ||
| ) | 
References center, coord_print(), bookmarks::trans, transform_center(), and transform_get_projection().
Referenced by navit_destroy().
| 
 | static | 
References former_destination::c, coord_equal(), former_destination::description, and former_destination::type.
Referenced by find_destination_in_list().
| 
 | static | 
References destination_equal(), and free_former_destination().
Referenced by bookmarks_append_destinations().
| 
 | static | 
References former_destination::c, former_destination::description, and g_free_helper().
Referenced by bookmarks_append_destinations(), and find_destination_in_list().
| 
 | static | 
References data.
Referenced by free_former_destination().
References c, startup::dest, item, item_attr_get(), item_coord_get(), map_rect_destroy(), map_rect_get_item(), map_rect_new(), attr::str, item::type, and attr::u.
Referenced by bookmarks_append_destinations().
| 
 | static | 
Write all former destinations into a text file.
| [in] | former_destinations | A GList of struct coord data elements containing the list of former destinations | 
| [in] | former_destination_file | The name of the output text file | 
| proj | The projection used to represent coordinates in former_destinations' list elements | 
References c, dbg, startup::dest, escape_mode_quote, item_to_name(), lvl_error, projection_to_name(), str_escape(), pcoord::x, and pcoord::y.
Referenced by bookmarks_append_destinations().