AC_INIT(Makefile.am)
AM_INIT_AUTOMAKE(mapper, 1.0.0)
+AM_MAINTAINER_MODE
AC_PROG_CPP
AC_CONFIG_HEADERS(src/config.h)
AC_PROG_INSTALL
AC_PROG_LIBTOOL
+AC_SYS_LARGEFILE
+PKG_PROG_PKG_CONFIG
dnl Debugging options to enable debug macros
DEBUG_FLAGS=
AC_SUBST(GLIBGTK_LIBS)
AC_SUBST(GLIBGTK_CFLAGS)
-dnl Ckeck for hildon-libs
-PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
+AC_ARG_ENABLE([nokia-770],AS_HELP_STRING([--enable-770],[Build for Nokia 770/N800]),
+ [enable_770=$enableval], [enable_770=no])
-if test "x$HAVE_HILDON" = "xno"; then
- PKG_CHECK_MODULES(HILDON, hildon-1, HAVE_HILDON=yes, HAVE_HILDON=no)
+AC_ARG_ENABLE([hildon],AS_HELP_STRING([--enable-hildon],[Build for Hildon]),
+ [enable_hildon=$enableval], [enable_hildon=no])
+
+if test "x$enable_770" = "xno" ; then
+ WITH_DEVICE_770=no
+else
+ WITH_DEVICE_770=yes
+ enable_hildon=yes
+ AC_DEFINE([WITH_DEVICE_770], [1], [With 770/N800 specific code])
fi
-if test "x$HAVE_HILDON" = "xyes"; then
+if test "x$enable_hildon" = "xyes" ; then
+ dnl Ckeck for hildon-libs
+ PKG_CHECK_MODULES(HILDON, hildon-libs, HAVE_HILDON=yes, HAVE_HILDON=no)
+
+ if test "x$HAVE_HILDON" = "xno"; then
+ PKG_CHECK_MODULES(HILDON, hildon-1, HAVE_HILDON1=yes, HAVE_HILDON1=no)
+ fi
+
+ if test "x$HAVE_HILDON" = "xyes"; then
+ AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
+ else
+ AC_MSG_RESULT(no)
+ fi
+else
+ HAVE_HILDON=no
+ HAVE_HILDON1=no
+fi
+
+if test "x$HAVE_HILDON1" = "xyes"; then
AC_DEFINE(WITH_HILDON, 1, [build with Maemo/Hildon user interface])
+ AC_DEFINE(WITH_HILDON_NEW, 1, [build with new Hildon libs])
+ HAVE_HILDON=yes
else
AC_MSG_RESULT(no)
fi
GstElement *filter,
} pipeline;
+gboolean
+audio_bus_cb()
+{
+}
+
gboolean
audio_create_record_pipeline(void)
{
sink=gst_element_factory_make("filesink", "sink");
}
+gboolean
+audio_create_play_pipelin(void)
+{
+
+}
+
void
-audio_src_filename(GstElement *src, gchar *file)
+audio_file_set_filename(GstElement *e, gchar *file)
{
-g_object_set(G_OBJECT(src), "location", file, NULL);
+g_object_set(G_OBJECT(e), "location", file, NULL);
}
gboolean
#include <libintl.h>
#include <locale.h>
-#ifdef WITH_OSSO
-#include <libosso.h>
-#include <osso-helplib.h>
-#endif
-#ifdef WITH_HILDON
-#include <hildon-widgets/hildon-program.h>
-#include <hildon-widgets/hildon-controlbar.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-color-button.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
-#include <device_symbols.h>
-#endif
+#include "hildon-mapper.h"
#include "utils.h"
#include "poi.h"
1, 2, 1, 2, GTK_FILL, 0, 2, 4);
gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
-#ifdef WITH_HILDON
+#ifdef WITH_DEVICE_770
g_object_set(G_OBJECT(txt_lat), HILDON_INPUT_MODE_HINT,
HILDON_INPUT_MODE_HINT_NUMERICSPECIAL, NULL);
g_object_set(G_OBJECT(txt_lon), HILDON_INPUT_MODE_HINT,
{
printf("%s()\n", __PRETTY_FUNCTION__);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
ossohelp_show(_osso, HELP_ID_INTRO, 0);
#endif
gboolean menu_cb_about(GtkAction * action)
{
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
ossohelp_show(_osso, HELP_ID_ABOUT, OSSO_HELP_SHOW_DIALOG);
#else
gchar *authors[]={
/* Version number of package */
#undef VERSION
+/* With 770/N800 specific code */
+#undef WITH_DEVICE_770
+
/* build with Geoclue */
#undef WITH_GEOCLUE
/* build with Maemo/Hildon user interface */
#undef WITH_HILDON
+/* build with Hildon filemanager */
+#undef WITH_HILDONFM
+
+/* build with new Hildon libs */
+#undef WITH_HILDON_NEW
+
/* build with gpsd */
#undef WITH_LIBGPS
/* build with Nokia osso */
#undef WITH_OSSO
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
#include <gtk/gtk.h>
#include <libgnomevfs/gnome-vfs.h>
+#include "hildon-mapper.h"
+
#include "utils.h"
#include "mapper-types.h"
-
#include "settings.h"
#include "ui-common.h"
#include "hildon-wrappers.h"
#include <dbus/dbus-glib.h>
#ifdef WITH_HILDON
-#include <hildon-widgets/hildon-banner.h>
+#include <hildon/hildon-banner.h>
#endif
static GtkWidget *connect_banner = NULL;
--- /dev/null
+#ifndef _HILDON_MAPPER_H
+#define _HILDON_MAPPER_H
+
+#include "config.h"
+
+#ifdef WITH_OSSO
+#include <libosso.h>
+#include <osso-helplib.h>
+#include <osso-ic-dbus.h>
+#include <osso-ic.h>
+#include <bt-dbus.h>
+#include "maemo-osso.h"
+#endif
+
+#ifdef WITH_HILDON
+
+#ifdef WITH_HILDON_NEW
+#include <hildon/hildon-program.h>
+#include <hildon/hildon-program.h>
+#include <hildon/hildon-controlbar.h>
+#include <hildon/hildon-note.h>
+#include <hildon/hildon-color-button.h>
+#include <hildon/hildon-number-editor.h>
+#include <hildon/hildon-banner.h>
+#else
+#include <hildon-widgets/hildon-program.h>
+#include <hildon-widgets/hildon-program.h>
+#include <hildon-widgets/hildon-controlbar.h>
+#include <hildon-widgets/hildon-note.h>
+#include <hildon-widgets/hildon-color-button.h>
+#include <hildon-widgets/hildon-number-editor.h>
+#include <hildon-widgets/hildon-banner.h>
+#endif
+
+#ifdef WITH_HILDON_FM
+#include <hildon/hildon-file-chooser-dialog.h>
+#endif
+
+#ifdef WITH_DEVICE_770
+#include <device_symbols.h>
+#include <hildon/hildon-input-mode-hint.h>
+#endif
+
+#endif
+#endif
#include <gtk/gtk.h>
#include "ui-common.h"
-#ifndef WITH_HILDON
-
-static gint _sb_sid=0;
+#ifndef WITH_HILDON_FM
GtkWidget *hildon_file_chooser_dialog_new(GtkWindow * parent,
GtkFileChooserAction action)
return dialog;
}
+#endif
+
+#ifndef WITH_HILDON
+
+static gint _sb_sid=0;
+
static gboolean
status_bar_clear(void)
{
#define HILDON_HARDKEY_ESC GDK_Escape
#define HILDON_COLOR_BUTTON GTK_COLOR_BUTTON
-#define HWK_BUTTON_UP GDK_Up
-#define HWK_BUTTON_DOWN GDK_Down
-#define HWK_BUTTON_LEFT GDK_Left
-#define HWK_BUTTON_RIGHT GDK_Right
-#define HWK_BUTTON_SELECT GDK_Return
-#define HWK_BUTTON_VIEW GDK_F10
-#define HWK_BUTTON_INCREASE GDK_F6
-#define HWK_BUTTON_DECREASE GDK_F5
-#define HWK_BUTTON_CANCEL GDK_Escape
-#define HILDON_COLOR_BUTTON GTK_COLOR_BUTTON
+#define HILDON_COLOR_BUTTON GTK_COLOR_BUTTON
#define hildon_color_button_new gtk_color_button_new
#define hildon_color_button_set_color gtk_color_button_set_color
#endif
+#ifndef WITH_DEVICE_770
+#define HWK_BUTTON_UP GDK_Up
+#define HWK_BUTTON_DOWN GDK_Down
+#define HWK_BUTTON_LEFT GDK_Left
+#define HWK_BUTTON_RIGHT GDK_Right
+#define HWK_BUTTON_SELECT GDK_Return
+#define HWK_BUTTON_VIEW GDK_F10
+#define HWK_BUTTON_INCREASE GDK_F6
+#define HWK_BUTTON_DECREASE GDK_F5
+#define HWK_BUTTON_CANCEL GDK_Escape
+#endif
+
#endif
#include <glib.h>
#include <gtk/gtk.h>
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
#include <libosso.h>
#include <osso-helplib.h>
#include <gconf/gconf-client.h>
#include <sqlite3.h>
-#ifdef WITH_HILDON
-#include <libosso.h>
-#include <osso-helplib.h>
-#include <hildon-widgets/hildon-controlbar.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-color-button.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-system-sound.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
-#endif
+#include "hildon-mapper.h"
#include "utils.h"
#include "gps.h"
GtkWidget *dialog;
printf("%s()\n", __PRETTY_FUNCTION__);
- dialog =
- GTK_WIDGET(hildon_file_chooser_dialog_new
+ dialog = GTK_WIDGET(hildon_file_chooser_dialog_new
(GTK_WINDOW(browse_info->dialog),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER));
GTK_DIALOG_MODAL, GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT, NULL);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
/* Enable the help button. */
ossohelp_dialog_help_enable(GTK_DIALOG(rmi.dialog), HELP_ID_REPOMAN,
_osso);
GTK_RESPONSE_ACCEPT, NULL);
/* Enable the help button. */
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
ossohelp_dialog_help_enable(GTK_DIALOG(mapman_info.dialog),
HELP_ID_MAPMAN, _osso);
#endif
2, 3, 4, 5, GTK_EXPAND | GTK_FILL, 0, 4, 0);
gtk_entry_set_alignment(GTK_ENTRY(mapman_info.txt_botright_lon), 1.f);
-#ifdef WITH_HILDON
+#ifdef WITH_DEVICE_770
/* Set hildon input hints */
g_object_set(G_OBJECT(mapman_info.txt_topleft_lon),
HILDON_INPUT_MODE_HINT,
#include <locale.h>
#include <sqlite3.h>
-#ifdef WITH_HILDON
-#include <libosso.h>
-#include <hildon-widgets/hildon-program.h>
-#include <hildon-widgets/hildon-controlbar.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-color-button.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-system-sound.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
-#endif
-
+#include "hildon-mapper.h"
#include "utils.h"
#include "map.h"
return "";
}
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
void con_check_connection(void)
{
iap_connect();
pui->file = NULL;
g_tree_insert(_pui_tree, pui, pui);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
if (iap_is_connected() && !_curl_sid)
#endif
_curl_sid = g_timeout_add(100, (GSourceFunc) curl_download_timeout, NULL);
/* removal automatically calls progress_update_info_free(). */
g_tree_steal(_downloading_tree, pui);
g_tree_insert(_pui_tree, pui, pui);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
if (iap_is_connected() && !_curl_sid)
#endif
_curl_sid = g_timeout_add(100,
#include <libgnomevfs/gnome-vfs.h>
#include <curl/multi.h>
#include <gconf/gconf-client.h>
-
-#ifdef WITH_OSSO
-#include <libosso.h>
-#include <osso-helplib.h>
-#include <osso-ic-dbus.h>
-#include <osso-ic.h>
-#include <bt-dbus.h>
-#include "maemo-osso.h"
-#endif
-#ifdef WITH_HILDON
-#include <hildon-widgets/hildon-program.h>
-#include <hildon-widgets/hildon-controlbar.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
-#include <device_symbols.h>
-#endif
-
#include <libintl.h>
#include <locale.h>
+#include "hildon-mapper.h"
+
#include "utils.h"
#include "poi.h"
#include "route.h"
GTK_DIALOG_MODAL, GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT, NULL);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
/* Enable the help button. */
ossohelp_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_POICAT, _osso);
#endif
}
curl_multi_add_handle(_curl_multi, _autoroute_data.curl_easy);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
if (iap_is_connected() && !_curl_sid)
#else
if (!_curl_sid)
GtkEntryCompletion *to_comp;
printf("%s()\n", __PRETTY_FUNCTION__);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
iap_connect();
#endif
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT, NULL);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
/* Enable the help button. */
ossohelp_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_DOWNROUTE,
_osso);
#include <locale.h>
#include <sqlite3.h>
-#ifdef WITH_OSSO
-#include <libosso.h>
-#include <osso-helplib.h>
-#endif
-#ifdef WITH_HILDON
-#include <hildon-widgets/hildon-program.h>
-#include <hildon-widgets/hildon-controlbar.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-color-button.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-system-sound.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
-#include <device_symbols.h>
-#endif
+#include "hildon-mapper.h"
#include "utils.h"
#include "poi.h"
GTK_DIALOG_MODAL, GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT, NULL);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
/* Enable the help button. */
ossohelp_dialog_help_enable(GTK_DIALOG(dialog), HELP_ID_SETTINGS, _osso);
-
+#endif
+#ifdef WITH_DEVICE_770
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
btn_buttons = gtk_button_new_with_label(_("Hardware Keys...")));
g_signal_connect(G_OBJECT(btn_buttons), "clicked", G_CALLBACK(settings_dialog_hardkeys), dialog);
#include <locale.h>
#include <sqlite3.h>
-#ifdef WITH_OSSO
-#include <libosso.h>
-#include <osso-helplib.h>
-#include <osso-ic-dbus.h>
-#include <osso-ic.h>
-#include <bt-dbus.h>
-#include "maemo-osso.h"
-#include "iap.h"
-#endif
-#ifdef WITH_HILDON
-#include <hildon-widgets/hildon-program.h>
-#include <hildon-widgets/hildon-controlbar.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-color-button.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-system-sound.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
-#include <device_symbols.h>
-#endif
+#include "hildon-mapper.h"
#include "utils.h"
#include "poi.h"
gtk_window_present(GTK_WINDOW(_window));
-#ifdef WITH_HILDON
- confirm = hildon_note_new_confirmation(GTK_WINDOW(_window),
- ("It looks like this is your first time running"
- " Mapper. Press OK to view the the help pages."
- " Otherwise, press Cancel to continue."));
-
- if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm)))
- ossohelp_show(_osso, HELP_ID_INTRO, 0);
- gtk_widget_destroy(confirm);
-#endif
+ popup_error(_window, _("It looks like this is your first time running "
+ "Mapper. Press OK to continue."));
+
if (settings_dialog()) {
popup_error(_window,
_("OpenStreetMap.org provides public, free-to-use maps. "
gtk_menu_append(menu, _menu_close_item = gtk_menu_item_new_with_label(_("Quit")));
/* We need to show menu items. */
- gtk_widget_show_all(GTK_WIDGET(menu));
-#ifndef WITH_HILDON
- gtk_widget_show_all(GTK_WIDGET(_menu_bar));
-#endif
/* Connect the "Route" signals. */
g_signal_connect(G_OBJECT(_menu_route_open_item), "activate",
gtk_menu_append(submenu, _cmenu_way_distance_to_item
= gtk_menu_item_new_with_label(_("Show Distance to")));
gtk_menu_append(submenu, _cmenu_way_route_to_item
- =
- gtk_menu_item_new_with_label(_("Download Route to...")));
- gtk_menu_append(submenu, _cmenu_way_delete_item =
- gtk_menu_item_new_with_label(_("Delete...")));
+ = gtk_menu_item_new_with_label(_("Download Route to...")));
+ gtk_menu_append(submenu, _cmenu_way_delete_item
+ = gtk_menu_item_new_with_label(_("Delete...")));
gtk_menu_append(submenu, gtk_separator_menu_item_new());
gtk_menu_append(submenu, _cmenu_way_add_poi = gtk_menu_item_new_with_label(_("Add POI...")));
gtk_widget_set_sensitive(_cmenu_way_add_poi, _db != NULL);
gtk_menu_append(submenu, _cmenu_poi_distance_to_item
= gtk_menu_item_new_with_label(_("Show Distance to")));
gtk_menu_append(submenu, _cmenu_poi_route_to_item
- =
- gtk_menu_item_new_with_label(_
- ("Download Route to...")));
+ = gtk_menu_item_new_with_label(_("Download Route to...")));
gtk_menu_append(submenu, gtk_separator_menu_item_new());
gtk_menu_append(submenu, _cmenu_poi_add_route
= gtk_menu_item_new_with_label(_("Add Route Point")));
G_CALLBACK(menu_cb_goto_nearpoi), NULL);
gtk_widget_show_all(GTK_WIDGET(menu));
+#ifndef WITH_HILDON
+ gtk_widget_show_all(GTK_WIDGET(_menu_bar));
+#endif
-#ifdef WITH_HILDON
+#ifdef WITH_DEVICE_770
gtk_widget_tap_and_hold_setup(_map_widget, GTK_WIDGET(menu), NULL, 0);
#else
_menu_map = menu;
| GDK_POINTER_MOTION_MASK
| GDK_POINTER_MOTION_HINT_MASK);
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
osso_hw_set_event_cb(_osso, NULL, osso_cb_hw_state, NULL);
#endif
/* If we have a route, calculate the next point. */
route_find_nearest_point();
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
/* Add D-BUS signal handler for 'status_changed' */
{
DBusConnection *dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
#define HELP_ID_DOWNROUTE HELP_ID_PREFIX"downroute"
#define HELP_ID_POICAT HELP_ID_PREFIX"poicat"
+#ifdef WITH_OSSO
#include <libosso.h>
-#include <hildon-widgets/hildon-program.h>
+/** The main OSSO context of the application. */
+osso_context_t *_osso;
+#endif
+#include <hildon/hildon-program.h>
/** The main GtkWindow of the application. */
HildonProgram *_program;
-/** The main OSSO context of the application. */
-osso_context_t *_osso;
-
#endif
#endif
#define TILE_SIZE_PIXELS (256)
#define TILE_SIZE_P2 (8)
-#ifdef WITH_HILDON
+#ifdef WITH_DEVICE_770
#define BUF_WIDTH_TILES (4)
#define BUF_HEIGHT_TILES (3)
#define BUF_WIDTH_PIXELS (1024)
map_render_paths(); \
}
-#ifdef WITH_HILDON
+#ifdef WITH_OSSO
#define KEEP_DISPLAY_ON() { \
/* Note that the flag means keep on ONLY when fullscreen. */ \
if(_always_keep_on || _fullscreen) \