42 |
/* User data is the event loop we are running in */ |
/* User data is the event loop we are running in */ |
43 |
appdata_t *appdata = (appdata_t*)user_data; |
appdata_t *appdata = (appdata_t*)user_data; |
44 |
|
|
45 |
printf("got a dbus message from Maemo Mapper\n"); |
if(dbus_message_is_signal(message, MM_DBUS_SERVICE, |
46 |
|
"view_position_changed")) { |
|
if(dbus_message_is_signal(message, MM_DBUS_SERVICE, "view_position_changed")) { |
|
47 |
DBusError error; |
DBusError error; |
48 |
double lat, lon; |
double lat, lon; |
49 |
dbus_error_init (&error); |
dbus_error_init (&error); |
50 |
|
|
51 |
printf(" is \"view position changed\"\n"); |
printf("Received \"view position changed\"\n"); |
52 |
|
|
53 |
if(dbus_message_get_args |
if(dbus_message_get_args |
54 |
(message, &error, DBUS_TYPE_DOUBLE, &lat, DBUS_TYPE_DOUBLE, &lon, DBUS_TYPE_INVALID)) { |
(message, &error, DBUS_TYPE_DOUBLE, &lat, |
55 |
|
DBUS_TYPE_DOUBLE, &lon, DBUS_TYPE_INVALID)) { |
56 |
|
|
57 |
g_print(" Position received: %f/%f\n", (float)lat, (float)lon); |
g_print(" Position received: %f/%f\n", (float)lat, (float)lon); |
58 |
|
|