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 | free_former_destination (struct former_destination *former_destination) |
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 (GList *former_destinations, char *former_destination_file, enum projection proj) |
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) |
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, 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 _, find_destination_in_list(), free_former_destination(), 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, 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(), and bookmarks_delete_bookmark().
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(), bookmark_item_priv::c, callback_list_call_attr_0, bookmark_item_priv::children, bookmarks::current, data, bookmark_item_priv::iter, and bookmark_item_priv::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, 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_ | ) |
References bookmarks::bookmark, and map_projection().
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, bookmark_item_priv::children, bookmarks::current, dbg, item, bookmark_item_priv::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, coord::x, pcoord::x, coord::y, 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, and lvl_info.
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, 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, attr::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, bookmark_item_priv::iter, and bookmark_item_priv::label.
Referenced by gui_internal_cmd_rename_bookmark_clicked().
void bookmarks_set_center_from_file | ( | struct bookmarks * | this_, |
char * | file | ||
) |
References center, coord_parse(), bookmarks::trans, transform_center(), and transform_get_projection().
Referenced by navit_init().
|
static |
References _, bookmarks::bookmark_file, bookmarks::bookmarks_list, bookmark_item_priv::c, dbg, item, bookmark_item_priv::label, lvl_debug, map_rect_destroy(), bookmarks::mr, attr::navit, navit_add_message(), bookmarks::parent, bookmark_item_priv::parent, projection_mg, projection_to_name(), bookmark_item_priv::type, attr::u, bookmarks::working_file, pcoord::x, and pcoord::y.
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, and former_destination::description.
Referenced by bookmarks_append_destinations(), and find_destination_in_list().
References c, former_destination::c, former_destination::description, startup::dest, item, item_attr_get(), item_coord_get(), map_rect_destroy(), map_rect_get_item(), map_rect_new(), bookmarks::mr, attr::str, former_destination::type, item::type, and attr::u.
Referenced by bookmarks_append_destinations().
|
static |
References c, former_destination::c, dbg, former_destination::description, startup::dest, item_to_name(), lvl_error, projection_to_name(), former_destination::type, coord::x, and coord::y.
Referenced by bookmarks_append_destinations().