From: Kaj-Michael Lang Date: Mon, 2 Jul 2007 12:40:04 +0000 (+0300) Subject: Fixes so it builds again under maemo scratchbox. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83b68b0e70937d7f93ff37c1257c2aa70bdeb8c2;p=mapper Fixes so it builds again under maemo scratchbox. --- diff --git a/intltool-extract b/intltool-extract index a3e0911..3c1b65d 100755 --- a/intltool-extract +++ b/intltool-extract @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/scratchbox/tools/bin/perl -w # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- # diff --git a/intltool-merge b/intltool-merge index 6101bec..b06d77a 100755 --- a/intltool-merge +++ b/intltool-merge @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/scratchbox/tools/bin/perl -w # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- # diff --git a/intltool-update b/intltool-update index b80bdd6..eff9643 100755 --- a/intltool-update +++ b/intltool-update @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/scratchbox/tools/bin/perl -w # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- # @@ -565,7 +565,7 @@ sub Console_WriteError_InvalidOption sub GenerateHeaders { - my $EXTRACT = "/home/milang/devel/git/mapper/intltool-extract"; + my $EXTRACT = "/home/milang/src/mapper/intltool-extract"; chomp $EXTRACT; $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"}; @@ -619,7 +619,7 @@ sub GenerateHeaders # sub GeneratePOTemplate { - my $XGETTEXT = $ENV{"XGETTEXT"} || "/usr/bin/xgettext"; + my $XGETTEXT = $ENV{"XGETTEXT"} || "/scratchbox/tools/bin/xgettext"; my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || ''; chomp $XGETTEXT; @@ -788,7 +788,7 @@ sub POFile_Update { -f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n"; - my $MSGMERGE = $ENV{"MSGMERGE"} || "/usr/bin/msgmerge"; + my $MSGMERGE = $ENV{"MSGMERGE"} || "/scratchbox/tools/bin/msgmerge"; my ($lang, $outfile) = @_; print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE; @@ -831,7 +831,7 @@ sub POFile_GetLanguage ($) sub Console_Write_TranslationStatus { my ($lang, $output_file) = @_; - my $MSGFMT = $ENV{"MSGFMT"} || "/usr/bin/msgfmt"; + my $MSGFMT = $ENV{"MSGFMT"} || "/scratchbox/tools/bin/msgfmt"; $output_file = "$SRCDIR/$lang.po" if ($output_file eq ""); @@ -840,7 +840,7 @@ sub Console_Write_TranslationStatus sub Console_Write_CoverageReport { - my $MSGFMT = $ENV{"MSGFMT"} || "/usr/bin/msgfmt"; + my $MSGFMT = $ENV{"MSGFMT"} || "/scratchbox/tools/bin/msgfmt"; &GatherPOFiles; diff --git a/src/bt-maemo.c b/src/bt-maemo.c index fadc586..c817e45 100644 --- a/src/bt-maemo.c +++ b/src/bt-maemo.c @@ -4,19 +4,32 @@ #ifdef WITH_HILDON +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + #include #include #include #include -#include -#include -#include -#include -#include -#include #include #include +#include "gps.h" +#include "bt.h" +#include "settings.h" +#include "ui-common.h" + /*****************************************************************************/ #ifndef __g_cclosure_user_marshal_MARSHAL_H__ @@ -250,21 +263,17 @@ void rcvr_connect_response(DBusGProxy * proxy, DBusGProxyCall * call_id) dbus_g_error_get_name(error)) || !fdpath) { GtkWidget *confirm; - printf - ("Caught remote method exception %s: %s", + printf("Caught remote method exception %s: %s", dbus_g_error_get_name(error), error->message); rcvr_disconnect(); /* Ask user to re-connect. */ - confirm = - hildon_note_new_confirmation + confirm = hildon_note_new_confirmation (GTK_WINDOW(_window), - _ - ("Failed to connect to GPS receiver. Retry?")); + _("Failed to connect to GPS receiver. Retry?")); - if (GTK_RESPONSE_OK == - gtk_dialog_run(GTK_DIALOG(confirm))) + if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) rcvr_connect_later(); /* Try again later. */ else set_conn_state(RCVR_OFF); diff --git a/src/bt.h b/src/bt.h index 6463d9b..ebac6c2 100644 --- a/src/bt.h +++ b/src/bt.h @@ -3,6 +3,16 @@ #define _GNU_SOURCE +#include "config.h" + +#define DBUS_API_SUBJECT_TO_CHANGE +#include +#include + +#ifdef WITH_HILDON +#include +#endif + #include "utils.h" #include "mapper-types.h" @@ -34,6 +44,8 @@ struct _ScanInfo { GtkWidget *banner; GtkListStore *store; guint sid; + DBusGProxy *req_proxy; + DBusGProxy *sig_proxy; }; ConnState _conn_state; diff --git a/src/hildon-wrappers.c b/src/hildon-wrappers.c index 0db0ac5..73441d1 100644 --- a/src/hildon-wrappers.c +++ b/src/hildon-wrappers.c @@ -1,11 +1,14 @@ /**************************************************************************** * Hildon function Wrappers for non-hildon build ****************************************************************************/ +#include "config.h" + #define _GNU_SOURCE +#include + #ifndef WITH_HILDON -#include #include "ui-common.h" static gint _sb_sid=0; diff --git a/src/iap.c b/src/iap.c index 0cbeb5f..8926fb2 100644 --- a/src/iap.c +++ b/src/iap.c @@ -2,6 +2,33 @@ #ifdef WITH_HILDON +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "settings.h" +#include "gps.h" +#include "map.h" + +gboolean _iap_connecting=FALSE; +gboolean _iap_connected=FALSE; + void iap_callback(struct iap_event_t *event, void *arg) { printf("%s()\n", __PRETTY_FUNCTION__); diff --git a/src/maemo-osso.c b/src/maemo-osso.c index 646b086..a686905 100644 --- a/src/maemo-osso.c +++ b/src/maemo-osso.c @@ -7,14 +7,37 @@ #define _GNU_SOURCE #include +#include #ifdef WITH_HILDON #include -#include #include #include +#include "bt.h" +#include "gps.h" +#include "map.h" +#include "route.h" +#include "settings.h" +#include "ui-common.h" + +gint +dbus_cb_default(const gchar *interface, const gchar *method, + GArray *arguments, gpointer data, osso_rpc_t *retval) +{ +printf("%s()\n", __PRETTY_FUNCTION__); + +if(!strcmp(method, "top_application")) + gtk_idle_add((GSourceFunc)window_present, NULL); + +retval->type = DBUS_TYPE_INVALID; + +vprintf("%s(): return\n", __PRETTY_FUNCTION__); +return OSSO_OK; +} + + void osso_cb_hw_state(osso_hw_state_t * state, gpointer data) { static gboolean _must_save_data = FALSE; diff --git a/src/mapper.c b/src/mapper.c index 85bcd45..e7d2ac0 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -55,12 +55,12 @@ #include #include #include -#include #include #include #include #include #include +#include "maemo-osso.h" #endif #include diff --git a/src/settings.h b/src/settings.h index 27f413d..cc16218 100644 --- a/src/settings.h +++ b/src/settings.h @@ -7,6 +7,7 @@ #ifndef _MAPPER_SETTINGS_H #define _MAPPER_SETTINGS_H +#include "mapper-types.h" #include "settings-gconf.h" /** CONFIGURATION INFORMATION. */ @@ -34,6 +35,9 @@ gboolean _show_velvec; gboolean _show_poi; gboolean _auto_download; +gboolean _iap_connecting; +gboolean _iap_connected; + guint _lead_ratio; guint _center_ratio; guint _draw_width; diff --git a/src/ui-common.c b/src/ui-common.c index 0c827d7..18ef1f3 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -22,6 +22,19 @@ #include #include +#include + +#ifdef WITH_HILDON +#include +#include +#include +#include +#include +#include +#include "maemo-osso.h" +#include "iap.h" +#endif + #include "utils.h" #include "poi.h" #include "route.h" @@ -757,9 +770,11 @@ g_signal_connect (item, "clicked", G_CALLBACK (cb_zoom_autozoom), NULL); item = gtk_separator_tool_item_new(); gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1); +#ifndef WITH_HILDON _toolbar_fullscreen_item = gtk_toggle_tool_button_new_from_stock (GTK_STOCK_FULLSCREEN); gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), _toolbar_fullscreen_item, -1); g_signal_connect (_toolbar_fullscreen_item, "clicked", G_CALLBACK (cb_fullscreen_click), NULL); +#endif item = gtk_separator_tool_item_new(); gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1); @@ -1191,8 +1206,8 @@ void mapper_init(gint argc, gchar ** argv) /* Add D-BUS signal handler for 'status_changed' */ { DBusConnection *dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); - gchar *filter_string = - g_strdup_printf("interface=%s", ICD_DBUS_INTERFACE); + gchar *filter_string = g_strdup_printf("interface=%s", ICD_DBUS_INTERFACE); + /* add match */ dbus_bus_add_match(dbus_conn, filter_string, NULL); @@ -1203,6 +1218,7 @@ void mapper_init(gint argc, gchar ** argv) get_connection_status_signal_cb, NULL, NULL); } + osso_iap_cb(iap_callback); { @@ -1210,16 +1226,14 @@ void mapper_init(gint argc, gchar ** argv) GError *error = NULL; /* Initialize D-Bus. */ - if (NULL == - (dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error))) { + if (NULL == (dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error))) { g_printerr("Failed to open connection to D-Bus: %s.\n", error->message); error = NULL; } - if (NULL == - (_rfcomm_req_proxy = - dbus_g_proxy_new_for_name(dbus_conn, BTCOND_SERVICE, + if (NULL == (_rfcomm_req_proxy = dbus_g_proxy_new_for_name(dbus_conn, + BTCOND_SERVICE, BTCOND_REQ_PATH, BTCOND_REQ_INTERFACE))) { g_printerr("Failed to open connection to %s.\n", diff --git a/src/ui-maemo.h b/src/ui-maemo.h index fd807e1..5f89336 100644 --- a/src/ui-maemo.h +++ b/src/ui-maemo.h @@ -5,6 +5,22 @@ #ifdef WITH_HILDON +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + /** The main GtkWindow of the application. */ HildonProgram *_program; diff --git a/src/utils.c b/src/utils.c index d1da655..e090567 100644 --- a/src/utils.c +++ b/src/utils.c @@ -19,10 +19,15 @@ #include #include +#ifdef WITH_HILDON +#include +#endif + #include "utils.h" #include "gps.h" #include "mapper-types.h" #include "bt.h" +#include "route.h" void sound_noise(void) {