navit
0.5.3-trunk
|
#include <stdlib.h>
#include <gtk/gtk.h>
#include "gui_gtk_poi.h"
#include "popup.h"
#include "debug.h"
#include "navit_nls.h"
#include "coord.h"
#include "point.h"
#include "callback.h"
#include "graphics.h"
#include "navit.h"
#include "item.h"
#include "map.h"
#include "mapset.h"
#include "transform.h"
#include "attr.h"
#include "util.h"
#include "navigation.h"
Data Structures | |
struct | gtk_poi_search |
Context passed around POI search function. More... | |
Functions | |
GdkPixbuf * | geticon (const char *name) |
Get a pixbuf representing an icon for the catalog. More... | |
static GtkTreeModel * | category_list_model (struct gtk_poi_search *search) |
static GtkTreeModel * | model_poi (struct gtk_poi_search *search) |
static void | treeview_poi_changed (GtkWidget *widget, struct gtk_poi_search *search) |
static void | treeview_poi_reload (GtkWidget *widget, struct gtk_poi_search *search) |
static void | button_destination_clicked (GtkWidget *widget, struct gtk_poi_search *search) |
Callback invoked when 'Destination' is clicked in a POI contextual window. More... | |
static void | button_map_clicked (GtkWidget *widget, struct gtk_poi_search *search) |
Callback invoked when 'Map' is clicked in a POI contextual window. More... | |
static void | button_visit_clicked (GtkWidget *widget, struct gtk_poi_search *search) |
Callback invoked when 'Visit before' is clicked in a POI contextual window. More... | |
void | gtk_gui_poi (struct navit *nav) |
Create the POI search UI window and connect objects to functions. More... | |
Variables | |
static struct gtk_poi_search | gtk_poi_search |
|
static |
Callback invoked when 'Destination' is clicked in a POI contextual window.
Set the selected POI as destination
widget | The widget that has been clicked |
search | A pointer to private data containing the POI search context |
References _, dbg, startup::dest, label, lat, lvl_debug, gtk_poi_search::nav, navit_populate_search_results_map(), navit_set_destination(), gtk_poi_search::store_cat_sorted, gtk_poi_search::store_poi_sorted, gtk_poi_search::treeview_cat, and gtk_poi_search::treeview_poi.
Referenced by gtk_gui_poi().
|
static |
Callback invoked when 'Map' is clicked in a POI contextual window.
Show the POI's position in the map
widget | The widget that has been clicked |
search | A pointer to private data containing the POI search context |
References _, dbg, label, lat, lvl_debug, gtk_poi_search::nav, navit_populate_search_results_map(), navit_set_center(), p, gtk_poi_search::store_poi_sorted, gtk_poi_search::treeview_poi, point::x, and point::y.
Referenced by gtk_gui_poi().
|
static |
Callback invoked when 'Visit before' is clicked in a POI contextual window.
Set POI as a waypoint to visit before an existing destination
widget | The widget that has been clicked |
search | A pointer to private data containing the POI search context |
References _, dbg, startup::dest, lat, lvl_debug, gtk_poi_search::nav, navit_populate_search_results_map(), popup_set_visitbefore(), gtk_poi_search::store_poi_sorted, and gtk_poi_search::treeview_poi.
Referenced by gtk_gui_poi().
|
static |
Build the category list model with icons.
References _, geticon(), gtk_poi_search::store_cat, and gtk_poi_search::store_cat_sorted.
Referenced by gtk_gui_poi().
GdkPixbuf * geticon | ( | const char * | name | ) |
Get a pixbuf representing an icon for the catalog.
Navit, a modular navigation system. Copyright (C) 2005-2013 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.
name | The name of the icon to use (eg: "pharmacy.png" |
References dbg, filename, graphics_icon_path(), lvl_error, and name.
Referenced by category_list_model(), and gui_gtk_new().
void gtk_gui_poi | ( | struct navit * | nav | ) |
Create the POI search UI window and connect objects to functions.
nav | The navit instance |
References _, gtk_poi_search::button_destination, button_destination_clicked(), gtk_poi_search::button_map, button_map_clicked(), gtk_poi_search::button_visit, button_visit_clicked(), category_list_model(), gtk_poi_search::entry_distance, gtk_poi_search, gtk_poi_search::label_distance, gtk_poi_search::nav, navit_get_attr(), navit_populate_search_results_map(), attr::num, gtk_poi_search::store_cat, gtk_poi_search::store_cat_sorted, gtk_poi_search::store_poi, gtk_poi_search::store_poi_sorted, gtk_poi_search::treeview_cat, gtk_poi_search::treeview_poi, treeview_poi_changed(), treeview_poi_reload(), and attr::u.
Referenced by poi_search_action().
|
static |
Construct model of POIs from map information.
If the user has selected imperial, translate idist from meters to feet. We convert to feet only, and not miles, because the code sorts on the numeric value of the distance, so it doesn't like two different units. Currently, the distance is an int. Can it be made a float? Possible future enhancement?
References _, center, gtk_poi_search::entry_distance, FEET_PER_METER, get_compass_direction(), item, item_attr_get(), item_coord_get(), item_from_name(), gtk_poi_search::label_distance, map_projection(), map_rect_destroy(), map_rect_get_item(), map_rect_new(), map_selection_destroy(), map_selection_dup_pro(), map_selection_rect_new(), mapset_close(), mapset_next(), mapset_open(), METERS_TO_MILES, gtk_poi_search::nav, navit_get_attr(), navit_get_height(), navit_get_mapset(), navit_get_trans(), navit_get_width(), attr::num, pcoord::pro, projection_mg, gtk_poi_search::selected_cat, gtk_poi_search::store_poi, gtk_poi_search::store_poi_sorted, attr::str, transform_distance(), transform_get_angle_delta(), transform_get_projection(), transform_reverse(), transform_scale(), item::type, attr::u, coord::x, pcoord::x, point::x, coord::y, pcoord::y, and point::y.
Referenced by treeview_poi_reload().
|
static |
Enable button if there is a selected row.
References gtk_poi_search::button_destination, gtk_poi_search::button_map, gtk_poi_search::button_visit, gtk_poi_search::store_cat_sorted, and gtk_poi_search::treeview_cat.
Referenced by gtk_gui_poi().
|
static |
Reload the POI list and disable buttons.
References gtk_poi_search::button_destination, gtk_poi_search::button_map, gtk_poi_search::button_visit, model_poi(), gtk_poi_search::selected_cat, gtk_poi_search::store_cat_sorted, gtk_poi_search::treeview_cat, and gtk_poi_search::treeview_poi.
Referenced by gtk_gui_poi().
|
static |
Referenced by gtk_gui_poi().