navit  0.5.3-trunk
gui_gtk_poi.c File Reference
#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
 

Function Documentation

◆ button_destination_clicked()

static void button_destination_clicked ( GtkWidget *  widget,
struct gtk_poi_search search 
)
static

Callback invoked when 'Destination' is clicked in a POI contextual window.

Set the selected POI as destination

Parameters
widgetThe widget that has been clicked
searchA 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().

◆ button_map_clicked()

static void button_map_clicked ( GtkWidget *  widget,
struct gtk_poi_search search 
)
static

Callback invoked when 'Map' is clicked in a POI contextual window.

Show the POI's position in the map

Parameters
widgetThe widget that has been clicked
searchA 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().

◆ button_visit_clicked()

static void button_visit_clicked ( GtkWidget *  widget,
struct gtk_poi_search search 
)
static

Callback invoked when 'Visit before' is clicked in a POI contextual window.

Set POI as a waypoint to visit before an existing destination

Parameters
widgetThe widget that has been clicked
searchA 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().

◆ category_list_model()

static GtkTreeModel* category_list_model ( struct gtk_poi_search search)
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().

◆ geticon()

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.

Parameters
nameThe name of the icon to use (eg: "pharmacy.png"
Returns
A pixbuf containing this icon of NULL if the icon could not be loaded

References dbg, filename, graphics_icon_path(), lvl_error, and name.

Referenced by category_list_model(), and gui_gtk_new().

◆ gtk_gui_poi()

◆ model_poi()

static GtkTreeModel* model_poi ( struct gtk_poi_search search)
static

◆ treeview_poi_changed()

static void treeview_poi_changed ( GtkWidget *  widget,
struct gtk_poi_search search 
)
static

◆ treeview_poi_reload()

static void treeview_poi_reload ( GtkWidget *  widget,
struct gtk_poi_search search 
)
static

Variable Documentation

◆ gtk_poi_search

Referenced by gtk_gui_poi().