You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(59) |
Sep
(43) |
Oct
(95) |
Nov
(135) |
Dec
(108) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(229) |
Feb
(141) |
Mar
(59) |
Apr
(70) |
May
(64) |
Jun
(87) |
Jul
(57) |
Aug
(108) |
Sep
(74) |
Oct
(203) |
Nov
(141) |
Dec
(108) |
| 2009 |
Jan
(114) |
Feb
(91) |
Mar
(101) |
Apr
(69) |
May
(54) |
Jun
(82) |
Jul
(49) |
Aug
(109) |
Sep
(81) |
Oct
(93) |
Nov
(100) |
Dec
(79) |
| 2010 |
Jan
(46) |
Feb
(36) |
Mar
(135) |
Apr
(103) |
May
(116) |
Jun
(130) |
Jul
(52) |
Aug
(31) |
Sep
(46) |
Oct
(48) |
Nov
(98) |
Dec
(110) |
| 2011 |
Jan
(234) |
Feb
(184) |
Mar
(150) |
Apr
(43) |
May
(53) |
Jun
(52) |
Jul
(112) |
Aug
(72) |
Sep
(79) |
Oct
(23) |
Nov
(6) |
Dec
(30) |
| 2012 |
Jan
(39) |
Feb
(37) |
Mar
(49) |
Apr
(60) |
May
(63) |
Jun
(38) |
Jul
(33) |
Aug
(24) |
Sep
(20) |
Oct
(14) |
Nov
(23) |
Dec
(50) |
| 2013 |
Jan
(30) |
Feb
(32) |
Mar
(27) |
Apr
(41) |
May
(59) |
Jun
(21) |
Jul
(10) |
Aug
(73) |
Sep
(23) |
Oct
(60) |
Nov
(14) |
Dec
(15) |
| 2014 |
Jan
(4) |
Feb
(8) |
Mar
(11) |
Apr
(6) |
May
(27) |
Jun
(4) |
Jul
(29) |
Aug
(62) |
Sep
(11) |
Oct
(17) |
Nov
(58) |
Dec
(9) |
| 2015 |
Jan
(23) |
Feb
(3) |
Mar
(26) |
Apr
(47) |
May
(8) |
Jun
(28) |
Jul
(10) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sl...@us...> - 2014-08-31 12:28:06
|
Revision: 5881
http://sourceforge.net/p/navit/code/5881
Author: sleske
Date: 2014-08-31 12:27:58 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Fix:core:Correct signature of event_add_watch: file descriptors are int's.
Modified Paths:
--------------
trunk/navit/navit/event.c
trunk/navit/navit/event.h
trunk/navit/navit/event_glib.c
trunk/navit/navit/graphics/android/graphics_android.c
trunk/navit/navit/graphics/null/graphics_null.c
trunk/navit/navit/graphics/opengl/graphics_opengl.c
trunk/navit/navit/graphics/opengl/graphics_opengl_x11.c
trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h
trunk/navit/navit/graphics/sdl/event.c
trunk/navit/navit/graphics/sdl/event_sdl.c
trunk/navit/navit/graphics/sdl/graphics_sdl.c
trunk/navit/navit/graphics/win32/graphics_win32.c
trunk/navit/navit/plugin/pedestrian/pedestrian.c
trunk/navit/navit/vehicle/file/vehicle_file.c
trunk/navit/navit/vehicle/gpsd/vehicle_gpsd.c
Modified: trunk/navit/navit/event.c
===================================================================
--- trunk/navit/navit/event.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/event.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -52,7 +52,7 @@
}
struct event_watch *
-event_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb)
+event_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
return event_methods.add_watch(fd, cond, cb);
}
Modified: trunk/navit/navit/event.h
===================================================================
--- trunk/navit/navit/event.h 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/event.h 2014-08-31 12:27:58 UTC (rev 5881)
@@ -37,7 +37,7 @@
struct event_methods {
void (*main_loop_run)(void);
void (*main_loop_quit)(void);
- struct event_watch *(*add_watch)(void *fd, enum event_watch_cond cond, struct callback *cb);
+ struct event_watch *(*add_watch)(int fd, enum event_watch_cond cond, struct callback *cb);
void (*remove_watch)(struct event_watch *ev);
struct event_timeout *(*add_timeout)(int timeout, int multi, struct callback *cb);
void (*remove_timeout)(struct event_timeout *ev);
@@ -57,7 +57,7 @@
void event_main_loop_run(void);
void event_main_loop_quit(void);
int event_main_loop_has_quit(void);
-struct event_watch *event_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb);
+struct event_watch *event_add_watch(int fd, enum event_watch_cond cond, struct callback *cb);
void event_remove_watch(struct event_watch *ev);
struct event_timeout *event_add_timeout(int timeout, int multi, struct callback *cb);
void event_remove_timeout(struct event_timeout *ev);
Modified: trunk/navit/navit/event_glib.c
===================================================================
--- trunk/navit/navit/event_glib.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/event_glib.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -58,11 +58,11 @@
}
static struct event_watch *
-event_glib_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb)
+event_glib_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
struct event_watch *ret=g_new0(struct event_watch, 1);
int flags=0;
- ret->iochan = g_io_channel_unix_new(GPOINTER_TO_INT(fd));
+ ret->iochan = g_io_channel_unix_new(fd);
switch (cond) {
case event_watch_cond_read:
flags=G_IO_IN;
Modified: trunk/navit/navit/graphics/android/graphics_android.c
===================================================================
--- trunk/navit/navit/graphics/android/graphics_android.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/android/graphics_android.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -763,11 +763,11 @@
}
static struct event_watch *
-event_android_add_watch(void *h, enum event_watch_cond cond, struct callback *cb)
+event_android_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
jobject ret;
- ret=(*jnienv)->NewObject(jnienv, NavitWatchClass, NavitWatch_init, (int)do_poll, (int) h, (int) cond, (int)cb);
- dbg(0,"result for %p,%d,%p=%p\n",h,cond,cb,ret);
+ ret=(*jnienv)->NewObject(jnienv, NavitWatchClass, NavitWatch_init, (int)do_poll, h, (int) cond, (int)cb);
+ dbg(0,"result for %d,%d,%p=%p\n",h,cond,cb,ret);
if (ret)
ret = (*jnienv)->NewGlobalRef(jnienv, ret);
return (struct event_watch *)ret;
Modified: trunk/navit/navit/graphics/null/graphics_null.c
===================================================================
--- trunk/navit/navit/graphics/null/graphics_null.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/null/graphics_null.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -289,7 +289,7 @@
}
static struct event_watch *
-event_null_add_watch(void *h, enum event_watch_cond cond, struct callback *cb)
+event_null_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
dbg(0,"enter\n");
return NULL;
Modified: trunk/navit/navit/graphics/opengl/graphics_opengl.c
===================================================================
--- trunk/navit/navit/graphics/opengl/graphics_opengl.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/opengl/graphics_opengl.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -1753,7 +1753,7 @@
}
static struct event_watch *
-event_opengl_add_watch(void *h, enum event_watch_cond cond,
+event_opengl_add_watch(int fd, enum event_watch_cond cond,
struct callback *cb)
{
dbg(0, "enter\n");
Modified: trunk/navit/navit/graphics/opengl/graphics_opengl_x11.c
===================================================================
--- trunk/navit/navit/graphics/opengl/graphics_opengl_x11.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/opengl/graphics_opengl_x11.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -129,7 +129,7 @@
dbg(0,"failed to open display\n");
goto error;
}
- ret->watch=event_add_watch((void *)(long)ConnectionNumber(ret->display), event_watch_cond_read, ret->cb);
+ ret->watch=event_add_watch(ConnectionNumber(ret->display), event_watch_cond_read, ret->cb);
ret->screen=XDefaultScreen(ret->display);
ret->root_window=RootWindow(ret->display, ret->screen);
if (!XMatchVisualInfo(ret->display, ret->screen, depth, TrueColor, &ret->visual)) {
Modified: trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
===================================================================
--- trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2014-08-31 12:27:58 UTC (rev 5881)
@@ -826,14 +826,14 @@
}
static struct event_watch *
-event_qt_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb)
+event_qt_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
dbg(1,"enter fd=%d\n",(int)(long)fd);
struct event_watch *ret=g_new0(struct event_watch, 1);
ret->fd=fd;
ret->cb=cb;
- g_hash_table_insert(event_gr->widget->watches, fd, ret);
- ret->sn=new QSocketNotifier((int)(long)fd, QSocketNotifier::Read, event_gr->widget);
+ g_hash_table_insert(event_gr->widget->watches, GINT_TO_POINTER(fd), ret);
+ ret->sn=new QSocketNotifier(fd, QSocketNotifier::Read, event_gr->widget);
QObject::connect(ret->sn, SIGNAL(activated(int)), event_gr->widget, SLOT(watchEvent(int)));
return ret;
}
@@ -841,7 +841,7 @@
static void
event_qt_remove_watch(struct event_watch *ev)
{
- g_hash_table_remove(event_gr->widget->watches, ev->fd);
+ g_hash_table_remove(event_gr->widget->watches, GINT_TO_POINTER(ev->fd));
delete(ev->sn);
g_free(ev);
Modified: trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h
===================================================================
--- trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h 2014-08-31 12:27:58 UTC (rev 5881)
@@ -149,7 +149,7 @@
struct event_watch {
QSocketNotifier *sn;
struct callback *cb;
- void *fd;
+ int fd;
};
void event_qt_remove_timeout(struct event_timeout *ev);
Modified: trunk/navit/navit/graphics/sdl/event.c
===================================================================
--- trunk/navit/navit/graphics/sdl/event.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/sdl/event.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -26,7 +26,7 @@
static void event_sdl_watch_thread(GPtrArray *);
static void event_sdl_watch_startthread(GPtrArray *watch_list);
static void event_sdl_watch_stopthread(void);
-static struct event_watch *event_sdl_add_watch(void *, enum event_watch_cond,
+static struct event_watch *event_sdl_add_watch(int, enum event_watch_cond,
struct callback *);
static void event_sdl_remove_watch(struct event_watch *);
static struct event_timeout *event_sdl_add_timeout(int, int, struct callback *);
@@ -216,7 +216,7 @@
}
static struct event_watch *
-event_sdl_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb) {
+event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb) {
dbg(1, "fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
event_sdl_watch_stopthread();
@@ -227,7 +227,7 @@
struct event_watch *new_ew = g_new0 (struct event_watch, 1);
struct pollfd *pfd = g_new0 (struct pollfd, 1);
- pfd->fd = (int) fd;
+ pfd->fd = fd;
/* Modify watchlist here */
switch (cond) {
Modified: trunk/navit/navit/graphics/sdl/event_sdl.c
===================================================================
--- trunk/navit/navit/graphics/sdl/event_sdl.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/sdl/event_sdl.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -35,7 +35,7 @@
static void event_sdl_watch_startthread(GPtrArray *);
static void event_sdl_watch_stopthread(void);
-static struct event_watch *event_sdl_add_watch(void *, enum event_watch_cond, struct callback *);
+static struct event_watch *event_sdl_add_watch(int, enum event_watch_cond, struct callback *);
static void event_sdl_remove_watch(struct event_watch *);
static struct event_timeout *event_sdl_add_timeout(int, int, struct callback *);
static void event_sdl_remove_timeout(struct event_timeout *);
@@ -153,7 +153,7 @@
}
static struct event_watch *
-event_sdl_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb)
+event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
dbg(1,"fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
@@ -165,7 +165,7 @@
struct event_watch *new_ew = g_new0 (struct event_watch, 1);
struct pollfd *pfd = g_new0 (struct pollfd, 1);
- pfd->fd = (int) fd;
+ pfd->fd = fd;
/* Modify watchlist here */
switch (cond) {
Modified: trunk/navit/navit/graphics/sdl/graphics_sdl.c
===================================================================
--- trunk/navit/navit/graphics/sdl/graphics_sdl.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/sdl/graphics_sdl.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -202,7 +202,7 @@
static void event_sdl_watch_thread (GPtrArray *);
static void event_sdl_watch_startthread(GPtrArray *watch_list);
static void event_sdl_watch_stopthread(void);
-static struct event_watch *event_sdl_add_watch(void *, enum event_watch_cond, struct callback *);
+static struct event_watch *event_sdl_add_watch(int, enum event_watch_cond, struct callback *);
static void event_sdl_remove_watch(struct event_watch *);
static struct event_timeout *event_sdl_add_timeout(int, int, struct callback *);
static void event_sdl_remove_timeout(struct event_timeout *);
@@ -2318,7 +2318,7 @@
}
static struct event_watch *
-event_sdl_add_watch(void *fd, enum event_watch_cond cond, struct callback *cb)
+event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
dbg(1,"fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
@@ -2330,7 +2330,7 @@
struct event_watch *new_ew = g_new0 (struct event_watch, 1);
struct pollfd *pfd = g_new0 (struct pollfd, 1);
- pfd->fd = (int) fd;
+ pfd->fd = fd;
/* Modify watchlist here */
switch (cond) {
Modified: trunk/navit/navit/graphics/win32/graphics_win32.c
===================================================================
--- trunk/navit/navit/graphics/win32/graphics_win32.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/graphics/win32/graphics_win32.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -1714,7 +1714,7 @@
}
static struct event_watch *
- event_win32_add_watch(void *h, enum event_watch_cond cond, struct callback *cb)
+ event_win32_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
dbg(0,"enter\n");
return NULL;
Modified: trunk/navit/navit/plugin/pedestrian/pedestrian.c
===================================================================
--- trunk/navit/navit/plugin/pedestrian/pedestrian.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/plugin/pedestrian/pedestrian.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -1103,7 +1103,7 @@
ioctl(fd, FIONBIO, &on);
cb=callback_new_3(callback_cast(pedestrian_read_tilt), fd, nav, data);
cbt=callback_new_2(callback_cast(pedestrian_write_tilt_timer), fd, data);
- event_add_watch((void *)fd, event_watch_cond_read, cb);
+ event_add_watch(fd, event_watch_cond_read, cb);
event_add_timeout(300, 1, cbt);
read(fd, buffer, 32);
#if 0
Modified: trunk/navit/navit/vehicle/file/vehicle_file.c
===================================================================
--- trunk/navit/navit/vehicle/file/vehicle_file.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/vehicle/file/vehicle_file.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -708,7 +708,7 @@
#endif
{
if (! priv->watch)
- priv->watch = event_add_watch((void *)priv->fd, event_watch_cond_read, priv->cb);
+ priv->watch = event_add_watch(priv->fd, event_watch_cond_read, priv->cb);
}
}
Modified: trunk/navit/navit/vehicle/gpsd/vehicle_gpsd.c
===================================================================
--- trunk/navit/navit/vehicle/gpsd/vehicle_gpsd.c 2014-08-31 12:27:32 UTC (rev 5880)
+++ trunk/navit/navit/vehicle/gpsd/vehicle_gpsd.c 2014-08-31 12:27:58 UTC (rev 5881)
@@ -234,7 +234,7 @@
#endif
priv->cb = callback_new_1(callback_cast(vehicle_gpsd_io), priv);
priv->cbt = callback_new_1(callback_cast(vehicle_gpsd_try_open), priv);
- priv->evwatch = event_add_watch((void *)priv->gps->gps_fd, event_watch_cond_read, priv->cb);
+ priv->evwatch = event_add_watch(priv->gps->gps_fd, event_watch_cond_read, priv->cb);
if (!priv->gps->gps_fd) {
dbg(0,"Warning: gps_fd is 0, most likely you have used a gps.h incompatible to libgps");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-31 12:27:37
|
Revision: 5880
http://sourceforge.net/p/navit/code/5880
Author: sleske
Date: 2014-08-31 12:27:32 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Fix:core:Fix warnings for incorrect format strings: use %td, %zu.
Modified Paths:
--------------
trunk/navit/navit/file.c
trunk/navit/navit/map/binfile/binfile.c
trunk/navit/navit/map/mg/street.c
trunk/navit/navit/map/mg/tree.c
trunk/navit/navit/vehicle/file/vehicle_file.c
Modified: trunk/navit/navit/file.c
===================================================================
--- trunk/navit/navit/file.c 2014-08-31 12:26:36 UTC (rev 5879)
+++ trunk/navit/navit/file.c 2014-08-31 12:27:32 UTC (rev 5880)
@@ -427,7 +427,7 @@
dbg(1,"checking header\n");
if ((hdr=file_http_header_end(file->buffer, file->buffer_len))) {
hdr[-1]='\0';
- dbg(1,"found %s (%d bytes)\n",file->buffer,sizeof(file->buffer));
+ dbg(1,"found %s\n",file->buffer);
file_process_headers(file, file->buffer);
file_shift_buffer(file, hdr-file->buffer);
file->requests--;
@@ -920,6 +920,6 @@
file_cache=cache_new(sizeof(struct file_cache_id), CACHE_SIZE);
#endif
if(sizeof(off_t)<8)
- dbg(0,"Maps larger than 2GB are not supported by this binary, sizeof(off_t)=%d\n",sizeof(off_t));
+ dbg(0,"Maps larger than 2GB are not supported by this binary, sizeof(off_t)=%zu\n",sizeof(off_t));
}
Modified: trunk/navit/navit/map/binfile/binfile.c
===================================================================
--- trunk/navit/navit/map/binfile/binfile.c 2014-08-31 12:26:36 UTC (rev 5879)
+++ trunk/navit/navit/map/binfile/binfile.c 2014-08-31 12:27:32 UTC (rev 5880)
@@ -295,7 +295,7 @@
}
cd=(struct zip_cd *)file_data_read(m->fi,cdoffset+offset, sizeof(*cd)+len);
if (cd) {
- dbg(1,"cd at "LONGLONG_FMT" %d bytes\n",cdoffset+offset, sizeof(*cd)+len);
+ dbg(1,"cd at "LONGLONG_FMT" %zu bytes\n",cdoffset+offset, sizeof(*cd)+len);
cd_to_cpu(cd);
dbg(1,"sig 0x%x\n", cd->zipcensig);
if (cd->zipcensig != zip_cd_sig) {
@@ -685,7 +685,7 @@
{
int *i=t->pos,j=0;
- dbg(0,"Before: pos_coord=%d\n",t->pos_coord-i);
+ dbg(0,"Before: pos_coord=%td\n",t->pos_coord-i);
while (i < t->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
@@ -742,18 +742,18 @@
tn=mr->t;
tn->pos_coord=tn->pos_coord_start+coffset;
tn->pos_attr=tn->pos_attr_start+aoffset;
- dbg(0,"moving %d ints from offset %d to %d\n",move_len,tn->pos_coord_start+move_offset-data,tn->pos_coord_start+move_offset+delta-data);
+ dbg(0,"moving %d ints from offset %td to %td\n",move_len,tn->pos_coord_start+move_offset-data,tn->pos_coord_start+move_offset+delta-data);
memmove(tn->pos_coord_start+move_offset+delta, tn->pos_coord_start+move_offset, move_len*4);
{
int *i=tn->pos,j=0;
- dbg(0,"After move: pos_coord=%d\n",tn->pos_coord-i);
+ dbg(0,"After move: pos_coord=%td\n",tn->pos_coord-i);
while (i < tn->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
}
if (mode != change_mode_append)
tn->pos_coord+=move_offset;
if (mode != change_mode_delete) {
- dbg(0,"writing %d ints at offset %d\n",count*2,write_offset+tn->pos_coord_start-data);
+ dbg(0,"writing %d ints at offset %td\n",count*2,write_offset+tn->pos_coord_start-data);
for (i = 0 ; i < count ; i++) {
tn->pos_coord_start[write_offset++]=c[i].x;
tn->pos_coord_start[write_offset++]=c[i].y;
@@ -762,7 +762,7 @@
}
{
int *i=tn->pos,j=0;
- dbg(0,"After: pos_coord=%d\n",tn->pos_coord-i);
+ dbg(0,"After: pos_coord=%td\n",tn->pos_coord-i);
while (i < tn->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
}
@@ -781,7 +781,7 @@
{
int *i=t->pos,j=0;
- dbg(0,"Before: pos_attr=%d\n",t->pos_attr-i);
+ dbg(0,"Before: pos_attr=%td\n",t->pos_attr-i);
while (i < t->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
@@ -846,20 +846,20 @@
tn=mr->t;
tn->pos_coord=tn->pos_coord_start+coffset;
tn->pos_attr=tn->pos_attr_start+offset;
- dbg(0,"attr start %d offset %d\n",tn->pos_attr_start-data,offset);
- dbg(0,"moving %d ints from offset %d to %d\n",move_len,tn->pos_attr_start+move_offset-data,tn->pos_attr_start+move_offset+delta-data);
+ dbg(0,"attr start %td offset %d\n",tn->pos_attr_start-data,offset);
+ dbg(0,"moving %d ints from offset %td to %td\n",move_len,tn->pos_attr_start+move_offset-data,tn->pos_attr_start+move_offset+delta-data);
memmove(tn->pos_attr_start+move_offset+delta, tn->pos_attr_start+move_offset, move_len*4);
if (mode != change_mode_append)
tn->pos_attr+=delta;
{
int *i=tn->pos,j=0;
- dbg(0,"After move: pos_attr=%d\n",tn->pos_attr-i);
+ dbg(0,"After move: pos_attr=%td\n",tn->pos_attr-i);
while (i < tn->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
}
if (nattr_len) {
int *nattr=tn->pos_attr_start+write_offset;
- dbg(0,"writing %d ints at %d\n",nattr_len,nattr-data);
+ dbg(0,"writing %d ints at %td\n",nattr_len,nattr-data);
nattr[0]=cpu_to_le32(nattr_len-1);
nattr[1]=cpu_to_le32(attr->type);
memcpy(nattr+2, attr_data_get(attr), nattr_size);
@@ -867,8 +867,10 @@
}
{
int *i=tn->pos,j=0;
- dbg(0,"After: pos_attr=%d\n",tn->pos_attr-i);
+ dbg(0,"After: pos_attr=%td\n",tn->pos_attr-i);
while (i < tn->pos_next)
+ dbg(0,"After: pos_attr=%td\n",tn->pos_attr-i);
+ while (i < tn->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
}
return 1;
@@ -936,7 +938,6 @@
t->start=(int *)binfile_read_content(m, fi, binfile_cd_offset(cd), lfh);
t->end=t->start+lfh->zipuncmp/4;
t->fi=fi;
- dbg(1,"0x%x '%s' %d %d,%d\n", lfh->ziplocsig, buffer, sizeof(*cd)+cd->zipcfnl, lfh->zipsize, lfh->zipuncmp);
file_data_free(fi, (unsigned char *)zipfn);
file_data_free(fi, (unsigned char *)lfh);
return t->start != NULL;
@@ -1241,7 +1242,7 @@
if (!size_ret)
return 0;
if (size_ret != sizeof(*cd) || cd->zipcensig != zip_cd_sig) {
- dbg(0,"error1 size=%d vs %d\n",size_ret, sizeof(*cd));
+ dbg(0,"error1 size=%d vs %zu\n",size_ret, sizeof(*cd));
return 0;
}
file_data_write(download->file, download->offset, sizeof(*cd), (unsigned char *)cd);
@@ -2772,7 +2773,7 @@
{
dbg(1,"binfile: plugin_init\n");
if (sizeof(struct zip_cd) != 46) {
- dbg(0,"error: sizeof(struct zip_cd)=%d\n",sizeof(struct zip_cd));
+ dbg(0,"error: sizeof(struct zip_cd)=%zu\n",sizeof(struct zip_cd));
}
plugin_register_map_type("binfile", map_new_binfile);
}
Modified: trunk/navit/navit/map/mg/street.c
===================================================================
--- trunk/navit/navit/map/mg/street.c 2014-08-31 12:26:36 UTC (rev 5879)
+++ trunk/navit/navit/map/mg/street.c 2014-08-31 12:27:32 UTC (rev 5880)
@@ -858,7 +858,7 @@
block_get_byindex(mr->m->file[file_strname_stn], mr->search_block, &mr->b);
mr->b.p=mr->b.block_start+12;
}
- dbg(1,"name id 0x%x\n", mr->b.p-mr->m->file[file_strname_stn]->begin);
+ dbg(1,"name id %td\n", mr->b.p-mr->m->file[file_strname_stn]->begin);
if (! mr->search_blk_count)
return NULL;
for (;;) {
Modified: trunk/navit/navit/map/mg/tree.c
===================================================================
--- trunk/navit/navit/map/mg/tree.c 2014-08-31 12:26:36 UTC (rev 5879)
+++ trunk/navit/navit/map/mg/tree.c 2014-08-31 12:27:32 UTC (rev 5880)
@@ -83,7 +83,7 @@
thdr=(struct tree_hdr_h *)p;
p+=sizeof(*thdr);
end=p+tree_hdr_h_get_size(thdr);
- dbg(1,"@0x%x\n", p-file->begin);
+ dbg(1,"@%td\n", p-file->begin);
last=0;
while (p < end) {
tleaf=(struct tree_leaf_h *)p;
@@ -119,7 +119,7 @@
thdr=(struct tree_hdr_v *)p;
p+=sizeof(*thdr);
count=tree_hdr_v_get_count(thdr);
- dbg(1,"offset=0x%x count=0x%x\n", p-file->begin, count);
+ dbg(1,"offset=%td count=0x%x\n", p-file->begin, count);
while (count--) {
tleaf=(struct tree_leaf_v *)p;
p+=sizeof(*tleaf);
@@ -183,7 +183,7 @@
tsn->end=p+tree_hdr_get_size(tsn->hdr);
tsn->low=tree_hdr_get_low(tsn->hdr);
tsn->high=tree_hdr_get_low(tsn->hdr);
- dbg(1,"pos 0x%x addr 0x%x size 0x%x low 0x%x end 0x%x\n", p-ts->f->begin, tree_hdr_get_addr(tsn->hdr), tree_hdr_get_size(tsn->hdr), tree_hdr_get_low(tsn->hdr), tsn->end-ts->f->begin);
+ dbg(1,"pos %td addr 0x%ux size 0x%ux low 0x%ux end %tu\n", p-ts->f->begin, tree_hdr_get_addr(tsn->hdr), tree_hdr_get_size(tsn->hdr), tree_hdr_get_low(tsn->hdr), tsn->end-ts->f->begin);
return tsn;
}
@@ -202,7 +202,7 @@
*p=tsn->p;
tsn->high=get_u32(p);
ts->last_node=ts->curr_node;
- dbg(1,"saving last2 %d 0x%x\n", ts->curr_node, tsn->last-ts->f->begin);
+ dbg(1,"saving last2 %d %td\n", ts->curr_node, tsn->last-ts->f->begin);
dbg(1,"high2=0x%x\n", tsn->high);
return 0;
}
@@ -221,7 +221,7 @@
*p=tsn->p;
tsn->high=get_u32_unal(p);
ts->last_node=ts->curr_node;
- dbg(1,"saving last4 %d 0x%x\n", ts->curr_node, tsn->last-ts->f->begin);
+ dbg(1,"saving last4 %d %td\n", ts->curr_node, tsn->last-ts->f->begin);
dbg(1,"high4=0x%x\n", tsn->high);
return 0;
}
@@ -233,7 +233,7 @@
struct tree_search_node *tsn=&ts->nodes[ts->curr_node];
int high;
- dbg(1,"pos=%d 0x%x\n", ts->curr_node, *p-ts->f->begin);
+ dbg(1,"pos=%d %td\n", ts->curr_node, *p-ts->f->begin);
if (*p)
ts->nodes[ts->last_node].last=*p;
*p=tsn->last;
@@ -248,7 +248,7 @@
}
return 1;
}
- dbg(1,"eon %d 0x%x 0x%x\n", ts->curr_node, *p-ts->f->begin, tsn->end-ts->f->begin);
+ dbg(1,"eon %d %td %td\n", ts->curr_node, *p-ts->f->begin, tsn->end-ts->f->begin);
if (! ts->curr_node)
break;
ts->curr_node--;
Modified: trunk/navit/navit/vehicle/file/vehicle_file.c
===================================================================
--- trunk/navit/navit/vehicle/file/vehicle_file.c 2014-08-31 12:26:36 UTC (rev 5879)
+++ trunk/navit/navit/vehicle/file/vehicle_file.c 2014-08-31 12:27:32 UTC (rev 5880)
@@ -438,7 +438,7 @@
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(0, "nmea buffer overflow (len %d), discarding '%s'\n", priv->nmea_data_buf?strlen(priv->nmea_data_buf):-1,buffer);
+ dbg(0, "nmea buffer overflow (len %zu), discarding '%s'\n", priv->nmea_data_buf?strlen(priv->nmea_data_buf):-1,buffer);
}
i = 0;
p = buffer;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-31 12:27:17
|
Revision: 5879
http://sourceforge.net/p/navit/code/5879
Author: sleske
Date: 2014-08-31 12:26:36 +0000 (Sun, 31 Aug 2014)
Log Message:
-----------
Refactor:core:Remove unused files compass.c/.h
Modified Paths:
--------------
trunk/navit/COPYING
trunk/navit/navit/CMakeLists.txt
trunk/navit/navit/Makefile.am
Removed Paths:
-------------
trunk/navit/navit/compass.c
trunk/navit/navit/compass.h
Modified: trunk/navit/COPYING
===================================================================
--- trunk/navit/COPYING 2014-08-20 17:14:11 UTC (rev 5878)
+++ trunk/navit/COPYING 2014-08-31 12:26:36 UTC (rev 5879)
@@ -67,7 +67,6 @@
navit/binding/dbus/binding_dbus.c
navit/country.c
navit/track.c
-navit/compass.c
navit/util.c
navit/debug.c
navit/route.c
@@ -112,7 +111,6 @@
navit/callback.h
navit/country.h
navit/track.h
-navit/compass.h
navit/item_def.h
navit/util.h
navit/debug.h
Modified: trunk/navit/navit/CMakeLists.txt
===================================================================
--- trunk/navit/navit/CMakeLists.txt 2014-08-20 17:14:11 UTC (rev 5878)
+++ trunk/navit/navit/CMakeLists.txt 2014-08-31 12:26:36 UTC (rev 5879)
@@ -5,8 +5,8 @@
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/support")
# navit cre
-set(NAVIT_SRC announcement.c atom.c attr.c cache.c callback.c command.c compass.c config_.c coord.c country.c data_window.c debug.c
- event.c file.c geom.c graphics.c gui.c item.c layout.c log.c main.c map.c maps.c
+set(NAVIT_SRC announcement.c atom.c attr.c cache.c callback.c command.c config_.c coord.c country.c data_window.c debug.c
+ event.c file.c geom.c graphics.c gui.c item.c layout.c log.c main.c map.c maps.c
linguistics.c mapset.c maptype.c menu.c messages.c bookmarks.c navit.c navit_nls.c navigation.c osd.c param.c phrase.c plugin.c popup.c
profile.c profile_option.c projection.c roadprofile.c route.c routech.c script.c search.c speech.c start_real.c sunriset.c transform.c track.c
search_houseno_interpol.c util.c vehicle.c vehicleprofile.c xmlconfig.c )
Modified: trunk/navit/navit/Makefile.am
===================================================================
--- trunk/navit/navit/Makefile.am 2014-08-20 17:14:11 UTC (rev 5878)
+++ trunk/navit/navit/Makefile.am 2014-08-31 12:26:36 UTC (rev 5879)
@@ -48,12 +48,12 @@
EXTRA_DIST = navit_shipped.xml navit.dtd
-lib@LIBNAVIT@_la_SOURCES = announcement.c atom.c attr.c cache.c callback.c command.c compass.c config_.c coord.c country.c data_window.c debug.c \
+lib@LIBNAVIT@_la_SOURCES = announcement.c atom.c attr.c cache.c callback.c command.c config_.c coord.c country.c data_window.c debug.c \
event.c event_glib.h file.c geom.c graphics.c gui.c item.c layout.c log.c main.c map.c maps.c \
linguistics.c mapset.c maptype.c menu.c messages.c bookmarks.c bookmarks.h navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c \
profile.c profile_option.c projection.c roadprofile.c route.c routech.c search.c search_houseno_interpol.c script.c speech.c start_real.c \
transform.c track.c util.c vehicle.c vehicleprofile.c xmlconfig.c \
- announcement.h atom.h attr.h attr_def.h cache.h callback.h color.h command.h compass.h config_.h coord.h country.h \
+ announcement.h atom.h attr.h attr_def.h cache.h callback.h color.h command.h config_.h coord.h country.h \
android.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h event.h \
file.h geom.h graphics.h gtkext.h gui.h item.h item_def.h keys.h log.h layer.h layout.h linguistics.h main.h map-share.h map.h\
map_data.h mapset.h maptype.h menu.h messages.h navigation.h navit.h osd.h \
Deleted: trunk/navit/navit/compass.c
===================================================================
--- trunk/navit/navit/compass.c 2014-08-20 17:14:11 UTC (rev 5878)
+++ trunk/navit/navit/compass.c 2014-08-31 12:26:36 UTC (rev 5879)
@@ -1,156 +0,0 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 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.
- */
-
-#include <math.h>
-#include <stdio.h>
-#include <glib.h>
-#include "point.h"
-#include "coord.h"
-#include "graphics.h"
-#include "transform.h"
-#include "item.h"
-#include "route.h"
-#include "vehicle.h"
-#include "navit.h"
-#include "compass.h"
-
-#if 0
-struct compass {
- struct graphics *gr;
- struct graphics_gc *bg;
- struct graphics_gc *white;
- struct graphics_gc *green;
- struct graphics_font *font;
-};
-
-static void
-transform_rotate(struct point *center, int angle, struct point *p, int count)
-{
- int i,x,y;
- double dx,dy;
- for (i = 0 ; i < count ; i++)
- {
- dx=sin(M_PI*angle/180.0);
- dy=cos(M_PI*angle/180.0);
- x=dy*p->x-dx*p->y;
- y=dx*p->x+dy*p->y;
-
- p->x=center->x+x;
- p->y=center->y+y;
- p++;
- }
-}
-
-static void
-handle(struct graphics *gr, struct graphics_gc *gc, struct point *p, int r, int dir)
-{
- struct point ph[3];
- int l=r*0.4;
-
- ph[0].x=0;
- ph[0].y=r;
- ph[1].x=0;
- ph[1].y=-r;
- transform_rotate(p, dir, ph, 2);
- gr->draw_lines(gr, gc, ph, 2);
- ph[0].x=-l;
- ph[0].y=-r+l;
- ph[1].x=0;
- ph[1].y=-r;
- ph[2].x=l;
- ph[2].y=-r+l;
- transform_rotate(p, dir, ph, 3);
- gr->draw_lines(gr, gc, ph, 3);
-}
-
-void
-compass_draw(struct compass *comp, struct container *co)
-{
- struct point p;
- struct coord *pos, *dest;
- double *vehicle_dir,dir,distance;
- int dx,dy;
- char buffer[16];
-
- if (! co->vehicle)
- return;
-
- vehicle_dir=vehicle_dir_get(co->vehicle);
- comp->gr->draw_mode(comp->gr, draw_mode_begin);
- p.x=0;
- p.y=0;
- comp->gr->draw_rectangle(comp->gr, comp->bg, &p, 60, 80);
- p.x=30;
- p.y=30;
- comp->gr->draw_circle(comp->gr, comp->white, &p, 50);
- if (co->flags->orient_north)
- handle(comp->gr,comp->white, &p, 20,0);
- else
- handle(comp->gr, comp->white, &p, 20, -*vehicle_dir);
-#if 0 /* FIXME */
- dest=route_get_destination(co->route);
- if (dest) {
- pos=vehicle_pos_get(co->vehicle);
- dx=dest->x-pos->x;
- dy=dest->y-pos->y;
- dir=atan2(dx,dy)*180.0/M_PI;
-#if 0
- printf("dx %d dy %d dir=%f vehicle_dir=%f\n", dx, dy, dir, *vehicle_dir);
-#endif
- if (! co->flags->orient_north)
- dir-=*vehicle_dir;
- handle(comp->gr, comp->green, &p, 20, dir);
- p.x=8;
- p.y=72;
- distance=transform_distance(projection_mg, pos, dest)/1000.0;
- if (distance >= 100)
- sprintf(buffer,"%.0f km", distance);
- else if (distance >= 10)
- sprintf(buffer,"%.1f km", distance);
- else
- sprintf(buffer,"%.2f km", distance);
-
- comp->gr->draw_text(comp->gr, comp->green, NULL, comp->font, buffer, &p, 0x10000, 0);
- }
-#endif
- comp->gr->draw_mode(comp->gr, draw_mode_end);
-}
-
-struct compass *
-compass_new(struct container *co)
-{
- struct compass *this=g_new0(struct compass, 1);
- struct point p;
- p.x=10;
- p.y=10;
- this->gr=co->gra->overlay_new(co->gra, &p, 60, 80);
- this->bg=this->gr->gc_new(this->gr);
- this->gr->gc_set_foreground(this->bg, 0, 0, 0);
- this->white=this->gr->gc_new(this->gr);
- this->gr->gc_set_foreground(this->white, 0xffff, 0xffff, 0xffff);
- this->gr->gc_set_linewidth(this->white, 2);
- this->green=this->gr->gc_new(this->gr);
- this->gr->gc_set_foreground(this->green, 0x0, 0xffff, 0x0);
- this->gr->gc_set_linewidth(this->green, 2);
-
- this->font=this->gr->font_new(this->gr, 200);
- compass_draw(this, co);
- return this;
-}
-#endif
Deleted: trunk/navit/navit/compass.h
===================================================================
--- trunk/navit/navit/compass.h 2014-08-20 17:14:11 UTC (rev 5878)
+++ trunk/navit/navit/compass.h 2014-08-31 12:26:36 UTC (rev 5879)
@@ -1,26 +0,0 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- */
-
-#ifndef NAVIT_COMPASS_H
-#define NAVIT_COMPASS_H
-
-struct compass * compass_new(struct container *co);
-void compass_draw(struct compass *comp, struct container *co);
-
-#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-08-20 17:14:16
|
Revision: 5878
http://sourceforge.net/p/navit/code/5878
Author: kazer_
Date: 2014-08-20 17:14:11 +0000 (Wed, 20 Aug 2014)
Log Message:
-----------
Fix:maptool:Fixed OSM search issues in Belgium / Netherlands, as per #1243|Thanks jandegr for the fix
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2014-08-16 20:17:49 UTC (rev 5877)
+++ trunk/navit/navit/maptool/osm.c 2014-08-20 17:14:11 UTC (rev 5878)
@@ -147,7 +147,7 @@
{ 50,"Bangladesh"},
{ 51,"Armenia"},
{ 52,"Barbados"},
- { 56,"Belgium,Belgique,Belgie,België,Belgien"},
+ { 56,"Belgium,Belgique,Belgie,België,Belgien","345c7M"},
{ 60,"Bermuda"},
{ 64,"Bhutan"},
{ 68,"Bolivia, Plurinational State of"},
@@ -280,7 +280,7 @@
{ 516,"Namibia"},
{ 520,"Nauru"},
{ 524,"Nepal"},
- { 528,"Nederland,The Netherlands,Niederlande,NL,Netherlands"},
+ { 528,"Nederland,The Netherlands,Niederlande,NL,Netherlands","3c567M"},
{ 530,"Netherlands Antilles"},
{ 531,"Curacao"},
{ 533,"Aruba"},
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-08-16 20:17:57
|
Revision: 5877
http://sourceforge.net/p/navit/code/5877
Author: kazer_
Date: 2014-08-16 20:17:49 +0000 (Sat, 16 Aug 2014)
Log Message:
-----------
Update:Core:Updated Dutch translation from launchpad
Modified Paths:
--------------
trunk/navit/po/nl.po.in
Modified: trunk/navit/po/nl.po.in
===================================================================
--- trunk/navit/po/nl.po.in 2014-08-16 14:08:48 UTC (rev 5876)
+++ trunk/navit/po/nl.po.in 2014-08-16 20:17:49 UTC (rev 5877)
@@ -26,15 +26,16 @@
"Project-Id-Version: navit 0.5.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-05 11:04-0700\n"
-"PO-Revision-Date: 2014-08-10 18:00+0000\n"
-"Last-Translator: rob <lin...@gm...>\n"
+"PO-Revision-Date: 2014-08-16 06:43+0000\n"
+"Last-Translator: Christopher <cst...@sr...>\n"
"Language-Team: afaber\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Launchpad-Export-Date: 2014-08-11 17:44+0000\n"
+"X-Launchpad-Export-Date: 2014-08-16 19:48+0000\n"
"X-Generator: Launchpad (build 17156)\n"
+"Language: \n"
"X-Report-Errors: https://translations.launchpad.net/navit/trunk/+pots/navit\n"
msgid "soon"
@@ -260,7 +261,7 @@
#. TRANSLATORS: First argument is strength, second direction, third how many roads to skip, fourth destination
#, c-format
msgid "then turn %1$s%2$s %3$s%4$s"
-msgstr "daarna, ga na %3$s wegen %1$s %2$s naar %4$s"
+msgstr "daarna, ga na %3$s wegen %1$s%2$s naar %4$s"
#, c-format
msgid "You have reached your destination %s"
@@ -1642,7 +1643,7 @@
#. Adds the Bookmark folders
msgid "Add Bookmark folder"
-msgstr "Favirietenmap toevoegen"
+msgstr "Favorietenmap toevoegen"
#. Pastes the Bookmark
msgid "Paste bookmark"
@@ -1707,7 +1708,7 @@
msgstr "Toon NMEA-gegevens"
msgid "Add Bookmark"
-msgstr "faviriet Toevoegen"
+msgstr "Favoriet toevoegen"
msgid "Rename"
msgstr "Hernoem"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-08-16 14:08:55
|
Revision: 5876
http://sourceforge.net/p/navit/code/5876
Author: mdankov
Date: 2014-08-16 14:08:48 +0000 (Sat, 16 Aug 2014)
Log Message:
-----------
Fix:Maptool:Open file pointer leak, coverity issue 1224898.
Modified Paths:
--------------
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2014-08-15 18:41:18 UTC (rev 5875)
+++ trunk/navit/navit/maptool/osm.c 2014-08-16 14:08:48 UTC (rev 5876)
@@ -3216,6 +3216,7 @@
index_country_add(zip_info,co->countryid,NULL,NULL,tileco,countryindexname, partsize, zip_get_index(zip_info));
fclose(countryindex);
g_free(countryindexname);
+ fclose(in);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wog...@us...> - 2014-08-15 18:41:21
|
Revision: 5875
http://sourceforge.net/p/navit/code/5875
Author: woglinde
Date: 2014-08-15 18:41:18 +0000 (Fri, 15 Aug 2014)
Log Message:
-----------
Fix:map_binfile:correct cut and paste error in duplicate_equal function found by coverity
Modified Paths:
--------------
trunk/navit/navit/map/binfile/binfile.c
Modified: trunk/navit/navit/map/binfile/binfile.c
===================================================================
--- trunk/navit/navit/map/binfile/binfile.c 2014-08-15 18:41:10 UTC (rev 5874)
+++ trunk/navit/navit/map/binfile/binfile.c 2014-08-15 18:41:18 UTC (rev 5875)
@@ -2138,7 +2138,7 @@
{
const struct duplicate *da=a;
const struct duplicate *db=b;
- return (da->c.x == db->c.x && da->c.y == da->c.y && g_str_equal(da->str,db->str));
+ return (da->c.x == db->c.x && da->c.y == db->c.y && g_str_equal(da->str,db->str));
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wog...@us...> - 2014-08-15 18:41:13
|
Revision: 5874
http://sourceforge.net/p/navit/code/5874
Author: woglinde
Date: 2014-08-15 18:41:10 +0000 (Fri, 15 Aug 2014)
Log Message:
-----------
Refactor:map_binfile:remove trailing whitespaces
Modified Paths:
--------------
trunk/navit/navit/map/binfile/binfile.c
Modified: trunk/navit/navit/map/binfile/binfile.c
===================================================================
--- trunk/navit/navit/map/binfile/binfile.c 2014-08-15 17:38:07 UTC (rev 5873)
+++ trunk/navit/navit/map/binfile/binfile.c 2014-08-15 18:41:10 UTC (rev 5874)
@@ -196,7 +196,7 @@
lfh->zipuncmp = le32_to_cpu(lfh->zipuncmp);
lfh->zipfnln = le16_to_cpu(lfh->zipfnln);
lfh->zipxtraln = le16_to_cpu(lfh->zipxtraln);
- }
+ }
}
static void cd_to_cpu(struct zip_cd *zcd) {
@@ -410,8 +410,8 @@
#endif
while (offset < end) {
cd=(struct zip_cd *)(m->search_data+offset-m->search_offset);
- if (! m->search_data ||
- m->search_offset > offset ||
+ if (! m->search_data ||
+ m->search_offset > offset ||
offset-m->search_offset+sizeof(*cd) > m->search_size ||
offset-m->search_offset+sizeof(*cd)+cd->zipcfnl+cd->zipcxtl > m->search_size
) {
@@ -431,9 +431,9 @@
dbg(0,"offset=%d search_offset=%d search_size=%d search_data=%p cd=%p\n", offset, m->search_offset, m->search_size, m->search_data, cd);
dbg(0,"offset=%d fn='%s'\n",offset,cd->zipcfn);
#endif
- if (!skip &&
+ if (!skip &&
(partial || cd->zipcfnl == len) &&
- !strncmp(cd->zipcfn, name, len))
+ !strncmp(cd->zipcfn, name, len))
return offset;
skip=0;
offset+=sizeof(*cd)+cd->zipcfnl+cd->zipcxtl+cd->zipccml;
@@ -507,7 +507,7 @@
t->pos_attr=t->pos_attr_start;
mr->label=0;
memset(mr->label_attr, 0, sizeof(mr->label_attr));
-
+
}
static char *
@@ -553,13 +553,13 @@
if (! partial)
break;
}
-
+
return g_strdup_printf("%s/%s",dir,filename);
}
static int
binfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
-{
+{
struct map_rect_priv *mr=priv_data;
struct tile *t=mr->t;
enum attr_type type;
@@ -572,7 +572,7 @@
while (t->pos_attr < t->pos_next) {
size=le32_to_cpu(*(t->pos_attr++));
type=le32_to_cpu(t->pos_attr[0]);
- if (type == attr_label)
+ if (type == attr_label)
mr->label=1;
if (type == attr_house_number)
mr->label_attr[0]=t->pos_attr;
@@ -588,7 +588,7 @@
if (attr_type == attr_any) {
dbg(1,"pos %p attr %s size %d\n", t->pos_attr-1, attr_to_name(type), size);
}
- attr->type=type;
+ attr->type=type;
if (ATTR_IS_GROUP(type)) {
int i=0;
int *subpos=t->pos_attr+1;
@@ -607,13 +607,13 @@
mr->attrs[i].u.data=NULL;
attr->u.attrs=mr->attrs;
} else {
- attr_data_set_le(attr, t->pos_attr+1);
+ attr_data_set_le(attr, t->pos_attr+1);
if (type == attr_url_local) {
g_free(mr->url);
mr->url=binfile_extract(mr->m, mr->m->cachedir, attr->u.str, 1);
attr->u.str=mr->url;
}
- if (type == attr_flags && mr->m->map_version < 1)
+ if (type == attr_flags && mr->m->map_version < 1)
attr->u.num |= AF_CAR;
}
t->pos_attr+=size;
@@ -665,9 +665,9 @@
entry->id.id_lo=item->id_lo;
entry->flags=1;
dbg(0,"id 0x%x,0x%x\n",entry->id.id_hi,entry->id.id_lo);
-
+
memcpy(ret, t->pos, (size+1)*sizeof(int));
- if (!m->changes)
+ if (!m->changes)
m->changes=g_hash_table_new_full(binfile_hash_entry_hash, binfile_hash_entry_equal, g_free, NULL);
g_hash_table_replace(m->changes, entry, entry);
dbg(0,"ret %p\n",ret);
@@ -686,9 +686,9 @@
{
int *i=t->pos,j=0;
dbg(0,"Before: pos_coord=%d\n",t->pos_coord-i);
- while (i < t->pos_next)
+ while (i < t->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
-
+
}
aoffset=t->pos_attr-t->pos_attr_start;
coffset=t->pos_coord-t->pos_coord_start-2;
@@ -747,7 +747,7 @@
{
int *i=tn->pos,j=0;
dbg(0,"After move: pos_coord=%d\n",tn->pos_coord-i);
- while (i < tn->pos_next)
+ while (i < tn->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
}
if (mode != change_mode_append)
@@ -758,12 +758,12 @@
tn->pos_coord_start[write_offset++]=c[i].x;
tn->pos_coord_start[write_offset++]=c[i].y;
}
-
+
}
{
int *i=tn->pos,j=0;
dbg(0,"After: pos_coord=%d\n",tn->pos_coord-i);
- while (i < tn->pos_next)
+ while (i < tn->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
}
return 1;
@@ -782,12 +782,12 @@
{
int *i=t->pos,j=0;
dbg(0,"Before: pos_attr=%d\n",t->pos_attr-i);
- while (i < t->pos_next)
+ while (i < t->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
-
+
}
- write_offset=0;
+ write_offset=0;
naoffset=t->pos_attr-t->pos_attr_start;
coffset=t->pos_coord-t->pos_coord_start;
offset=0;
@@ -831,7 +831,7 @@
default:
return 0;
}
- if (mode == change_mode_delete || mode == change_mode_modify)
+ if (mode == change_mode_delete || mode == change_mode_modify)
delta=nattr_len-oattr_len;
else
delta=nattr_len;
@@ -854,7 +854,7 @@
{
int *i=tn->pos,j=0;
dbg(0,"After move: pos_attr=%d\n",tn->pos_attr-i);
- while (i < tn->pos_next)
+ while (i < tn->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
}
if (nattr_len) {
@@ -868,7 +868,7 @@
{
int *i=tn->pos,j=0;
dbg(0,"After: pos_attr=%d\n",tn->pos_attr-i);
- while (i < tn->pos_next)
+ while (i < tn->pos_next)
dbg(0,"%d:0x%x\n",j++,*i++);
}
return 1;
@@ -893,7 +893,7 @@
mr->t->pos=mr->t->pos_next=mr->t->start+offset;
if (length == -1)
length=le32_to_cpu(mr->t->pos[0])+1;
- if (length > 0)
+ if (length > 0)
mr->t->end=mr->t->pos+length;
}
@@ -951,7 +951,7 @@
m->redirect=0;
return 0;
}
- if (m->redirect)
+ if (m->redirect)
return 0;
m->redirect=1;
dbg(0,"redirected from %s to %s\n",m->url,location);
@@ -998,10 +998,10 @@
map_binfile_http_request(m, attrs);
data=file_data_read_special(m->http, 0, &size_ret);
g_free(data);
- if (size_ret < 0)
+ if (size_ret < 0)
return 0;
} while (map_binfile_handle_redirect(m));
-
+
ret=file_size(m->http);
dbg(1,"file size "LONGLONG_FMT"\n",ret);
return ret;
@@ -1027,7 +1027,7 @@
struct attr http_header={attr_http_header};
struct attr persistent={attr_persistent};
- persistent.u.num=1;
+ persistent.u.num=1;
attrs[0]=&url;
attrs[1]=&http_header;
attrs[2]=&persistent;
@@ -1307,7 +1307,7 @@
mr->size+=cd->zipcunc;
#endif
t.zipfile_num=zipfile;
- if (zipfile_to_tile(m, cd, &t))
+ if (zipfile_to_tile(m, cd, &t))
push_tile(mr, &t, offset, length);
file_data_free(f, (unsigned char *)cd);
}
@@ -1349,7 +1349,7 @@
if (async == 1) {
m->download=download;
g_free(m->progress);
- if (download->mr)
+ if (download->mr)
m->progress=g_strdup_printf("Download Tile %d 0%%",download->zipfile);
else
m->progress=g_strdup_printf("Download Map Information 0%%");
@@ -1369,7 +1369,7 @@
download->state=0;
break;
case 2:
- if (download_download(download))
+ if (download_download(download))
download->state=3;
else {
g_free(m->progress);
@@ -1553,7 +1553,7 @@
struct zip_cd *cd;
for (i = 0 ; i < m->zip_members ; i++) {
cd=binfile_read_cd(m, m->cde_size*i, -1);
- if (map_download_selection_check(cd, sel))
+ if (map_download_selection_check(cd, sel))
download(m, mr, cd, i, 0, 0, 0);
file_data_free(m->fi, (unsigned char *)cd);
}
@@ -1712,7 +1712,7 @@
if (!binfile_attr_get(mr->item.priv_data, attr_zipfile_ref, &at))
return;
- if(mr->msp)
+ if(mr->msp)
{
struct attr *search=&mr->msp->search;
if(search->type==attr_town_name || search->type==attr_district_name || search->type==attr_town_or_district_name) {
@@ -1730,7 +1730,7 @@
}
}
}
- }
+ }
push_zipfile_tile(mr, at.u.num, 0, 0, 0);
}
@@ -1907,7 +1907,7 @@
map_rec2=map_rect_new_binfile(map, sel);
while ((place=map_rect_get_item_binfile(map_rec2))) {
if (item_is_poly_place(*place) &&
- item_attr_get(place, attr_label, &poly_town_name) &&
+ item_attr_get(place, attr_label, &poly_town_name) &&
!strcmp(poly_town_name.u.str,town_name.u.str)) {
struct coord *c;
int i,count;
@@ -2022,12 +2022,12 @@
struct map_search_priv *msp=g_new0(struct map_search_priv, 1);
struct item *town;
int idx;
-
+
msp->search = *search;
msp->partial = partial;
if(ATTR_IS_STRING(msp->search.type))
msp->search.u.str=linguistics_casefold(search->u.str);
-
+
/*
* NOTE: If you implement search for other attributes than attr_town_name and attr_street_name,
* please update this comment and the documentation for map_search_new() in map.c
@@ -2038,7 +2038,7 @@
case attr_town_name:
case attr_town_or_district_name:
map_rec = map_rect_new_binfile(map, NULL);
- if (!map_rec)
+ if (!map_rec)
break;
map_rec->country_id = item->id_lo;
map_rec->msp = msp;
@@ -2061,12 +2061,12 @@
msp->mode = 1;
else {
if (item_coord_get(town, &c, 1)) {
- if ((msp->mr=binmap_search_street_by_place(map, town, &c, &msp->ms, &msp->boundaries)))
+ if ((msp->mr=binmap_search_street_by_place(map, town, &c, &msp->ms, &msp->boundaries)))
msp->mode = 2;
else {
msp->mr=binmap_search_street_by_estimate(map, town, &c, &msp->ms);
msp->mode = 3;
- }
+ }
}
}
map_rect_destroy_binfile(map_rec);
@@ -2156,7 +2156,7 @@
int len;
char *buffer;
struct duplicate *d;
-
+
if (!msp->search_results)
msp->search_results = g_hash_table_new_full(duplicate_hash, duplicate_equal, g_free, NULL);
binfile_attr_rewind(item->priv_data);
@@ -2209,10 +2209,10 @@
return 0;
}
-static int
+static int
item_inside_poly_list(struct item *it, GList *l)
{
-
+
while(l) {
struct geom_poly_segment *p=l->data;
int count=p->last-p->first+1;
@@ -2231,7 +2231,7 @@
} else {
if(ccount>3)
ccount/=2;
- else
+ else
ccount=2;
while(--ccount>0)
item_coord_get(it,&c,1);
@@ -2259,13 +2259,13 @@
case attr_town_or_district_name:
if (map_search->mr->tile_depth > 1 && item_is_town(*it) && map_search->search.type != attr_district_name) {
if (binfile_attr_get(it->priv_data, attr_town_name_match, &at) || binfile_attr_get(it->priv_data, attr_town_name, &at)) {
- if (!linguistics_compare(at.u.str, map_search->search.u.str, mode) && !duplicate(map_search, it, attr_town_name))
+ if (!linguistics_compare(at.u.str, map_search->search.u.str, mode) && !duplicate(map_search, it, attr_town_name))
return it;
}
}
if (map_search->mr->tile_depth > 1 && item_is_district(*it) && map_search->search.type != attr_town_name) {
if (binfile_attr_get(it->priv_data, attr_district_name_match, &at) || binfile_attr_get(it->priv_data, attr_district_name, &at)) {
- if (!linguistics_compare(at.u.str, map_search->search.u.str, mode) && !duplicate(map_search, it, attr_town_name))
+ if (!linguistics_compare(at.u.str, map_search->search.u.str, mode) && !duplicate(map_search, it, attr_town_name))
return it;
}
}
@@ -2283,12 +2283,12 @@
struct attr at;
if (!map_selection_contains_item_rect(map_search->mr->sel, it))
break;
-
+
if(binfile_attr_get(it->priv_data, attr_label, &at)) {
struct coord c[128];
struct duplicate *d;
-
- /* Extracting all coords here makes duplicate_new() not consider them (we don't want all
+
+ /* Extracting all coords here makes duplicate_new() not consider them (we don't want all
* street segments to be reported as separate streets). */
while(item_coord_get(it,c,128)>0);
d=duplicate_test(map_search, it, attr_label);
@@ -2296,12 +2296,12 @@
break;
if(linguistics_compare(at.u.str, map_search->search.u.str, mode|linguistics_cmp_expand|linguistics_cmp_words)) {
- /* Remember this non-matching street name in duplicate hash to skip name
+ /* Remember this non-matching street name in duplicate hash to skip name
* comparison for its following segments */
duplicate_insert(map_search, d);
break;
}
-
+
if(map_search->boundaries && !item_inside_poly_list(it,map_search->boundaries)) {
/* Other segments may fit the town poly. Do not update hash for now. */
g_free(d);
@@ -2354,7 +2354,7 @@
}
if(map_search->search.type==attr_house_number && map_search->mode==2 && map_search->parent_name) {
/* For unindexed house number search, check if street segments extending possible housenumber locations were found */
- if(map_search->ms.u.c_rect.lu.x!=map_search->rect_new.lu.x || map_search->ms.u.c_rect.lu.y!=map_search->rect_new.lu.y ||
+ if(map_search->ms.u.c_rect.lu.x!=map_search->rect_new.lu.x || map_search->ms.u.c_rect.lu.y!=map_search->rect_new.lu.y ||
map_search->ms.u.c_rect.rl.x!=map_search->rect_new.rl.x || map_search->ms.u.c_rect.rl.y!=map_search->rect_new.rl.y) {
map_search->ms.u.c_rect=map_search->rect_new;
map_rect_destroy_binfile(map_search->mr);
@@ -2453,7 +2453,7 @@
len = strlen("index");
cde_index_size = sizeof(struct zip_cd)+len;
- if (m->eoc64)
+ if (m->eoc64)
offset = m->eoc64->zip64ecsz-cde_index_size;
else
offset = m->eoc->zipecsz-cde_index_size;
@@ -2562,8 +2562,8 @@
m->fi=download->file;
g_free(download);
return 1;
-
+
cd1size=sizeof(*cd1);
cd1offset=zip64_eoc->zip64eofst;
cd1=(struct zip_cd *)map_binfile_download_range(m, cd1offset, cd1size);
@@ -2572,7 +2572,7 @@
cd1size=sizeof(*cd1)+binfile_cd_extra(cd1);
g_free(cd1);
cd1=(struct zip_cd *)map_binfile_download_range(m, cd1offset, cd1size);
- if (!cd1)
+ if (!cd1)
return 0;
cd1->zipcunc=0;
cdisize=sizeof(*cdi)+strlen("index")+cd1->zipcxtl;
@@ -2663,7 +2663,7 @@
m->map_release=g_strdup(attr.u.str);
if (m->url && binfile_attr_get(item->priv_data, attr_url, &attr)) {
dbg(0,"url config %s map %s\n",m->url,attr.u.str);
- if (strcmp(m->url, attr.u.str))
+ if (strcmp(m->url, attr.u.str))
m->update_available=1;
g_free(m->url);
m->url=g_strdup(attr.u.str);
@@ -2711,7 +2711,7 @@
int version=-1;
if (!m->check_version)
return;
- if (m->fi)
+ if (m->fi)
version=file_version(m->fi, m->check_version);
if (version != m->version) {
if (m->fi)
@@ -2734,7 +2734,7 @@
wexp=file_wordexp_new(data->u.str);
wexp_data=file_wordexp_get_array(wexp);
- dbg(1,"map_new_binfile %s\n", data->u.str);
+ dbg(1,"map_new_binfile %s\n", data->u.str);
*meth=map_methods_binfile;
m=g_new0(struct map_priv, 1);
@@ -2743,7 +2743,7 @@
m->filename=g_strdup(wexp_data[0]);
file_wordexp_destroy(wexp);
check_version=attr_search(attrs, NULL, attr_check_version);
- if (check_version)
+ if (check_version)
m->check_version=check_version->u.num;
map_pass=attr_search(attrs, NULL, attr_map_pass);
if (map_pass)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wog...@us...> - 2014-08-15 17:38:10
|
Revision: 5873
http://sourceforge.net/p/navit/code/5873
Author: woglinde
Date: 2014-08-15 17:38:07 +0000 (Fri, 15 Aug 2014)
Log Message:
-----------
Fix:core:guard search_list_select against negative values from search_list_level found by coverity
Modified Paths:
--------------
trunk/navit/navit/search.c
Modified: trunk/navit/navit/search.c
===================================================================
--- trunk/navit/navit/search.c 2014-08-15 17:37:58 UTC (rev 5872)
+++ trunk/navit/navit/search.c 2014-08-15 17:38:07 UTC (rev 5873)
@@ -379,16 +379,21 @@
struct search_list_common *
search_list_select(struct search_list *this_, enum attr_type attr_type, int id, int mode)
{
- int level=search_list_level(attr_type);
- int num=0;
+ int level;
+ int num;
struct search_list_level *le;
struct search_list_common *slc;
GList *curr;
+
+ level = search_list_level(attr_type);
+ if (level < 0)
+ return NULL;
le=&this_->levels[level];
curr=le->list;
if (mode > 0 || !id)
le->selected=mode;
//dbg(0,"enter level=%d %d %d %p\n", level, id, mode, curr);
+ num = 0;
while (curr) {
num++;
if (! id || num == id) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wog...@us...> - 2014-08-15 17:38:02
|
Revision: 5872
http://sourceforge.net/p/navit/code/5872
Author: woglinde
Date: 2014-08-15 17:37:58 +0000 (Fri, 15 Aug 2014)
Log Message:
-----------
Refactor:core:remove trailing whitespaces
Modified Paths:
--------------
trunk/navit/navit/search.c
Modified: trunk/navit/navit/search.c
===================================================================
--- trunk/navit/navit/search.c 2014-08-14 16:15:11 UTC (rev 5871)
+++ trunk/navit/navit/search.c 2014-08-15 17:37:58 UTC (rev 5872)
@@ -195,7 +195,7 @@
struct phrase *phrase=g_new(struct phrase, 1);
phrase->start=s;
phrase->end=d;
- phrase->wordcount=++wordcount;
+ phrase->wordcount=++wordcount;
ret=g_list_append(ret, phrase);
}
} while (*d != '\0');
@@ -306,7 +306,7 @@
while (tmp) {
g_free(tmp->data);
tmp=g_list_next(tmp);
- }
+ }
g_list_free(phrases);
// TODO: Looks like we should g_free(str) here. But this is
// currently dead code, so no way to test it.
@@ -353,7 +353,7 @@
if (search_attr->type == attr_address) {
search_by_address(this_, search_attr->u.str);
this_->use_address_results=1;
- return;
+ return;
}
this_->use_address_results=0;
level=search_list_level(search_attr->type);
@@ -442,13 +442,13 @@
struct attr attr;
int i;
enum attr_type common_attrs[]={
- attr_state_name,
- attr_county_name,
- attr_municipality_name,
- attr_town_name,
- attr_district_name,
- attr_postal,
- attr_town_postal,
+ attr_state_name,
+ attr_county_name,
+ attr_municipality_name,
+ attr_town_name,
+ attr_district_name,
+ attr_postal,
+ attr_town_postal,
attr_postal_mask,
attr_none
};
@@ -709,7 +709,7 @@
ret->c=g_new(struct pcoord, 1);
*ret->c=*slr->c;
}
- if (slr->country)
+ if (slr->country)
ret->country=search_list_country_dup(slr->country);
if (slr->town)
ret->town=search_list_town_dup(slr->town);
@@ -717,7 +717,7 @@
ret->street=search_list_street_dup(slr->street);
if (slr->house_number)
ret->house_number=search_list_house_number_dup(slr->house_number);
- return ret;
+ return ret;
}
static void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-08-14 16:15:14
|
Revision: 5871
http://sourceforge.net/p/navit/code/5871
Author: kazer_
Date: 2014-08-14 16:15:11 +0000 (Thu, 14 Aug 2014)
Log Message:
-----------
Fix:android:Fixed missing translation, closes #1241| Thanks jandegr!
Modified Paths:
--------------
trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
Modified: trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
===================================================================
--- trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2014-08-13 17:24:13 UTC (rev 5870)
+++ trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2014-08-14 16:15:11 UTC (rev 5871)
@@ -135,7 +135,7 @@
protected void onCreateContextMenu(ContextMenu menu) {
super.onCreateContextMenu(menu);
- menu.setHeaderTitle("Position...");
+ menu.setHeaderTitle(Navit._("Position")+"..");
menu.add(1, 1, NONE, Navit._("Route to here")).setOnMenuItemClickListener(this);
menu.add(1, 2, NONE, Navit._("Cancel")).setOnMenuItemClickListener(this);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-08-13 17:24:25
|
Revision: 5870
http://sourceforge.net/p/navit/code/5870
Author: mdankov
Date: 2014-08-13 17:24:13 +0000 (Wed, 13 Aug 2014)
Log Message:
-----------
Fix:core:Allow to query nightlayout and daylayout attributes of layout object.
Modified Paths:
--------------
trunk/navit/navit/layout.c
Modified: trunk/navit/navit/layout.c
===================================================================
--- trunk/navit/navit/layout.c 2014-08-13 17:22:34 UTC (rev 5869)
+++ trunk/navit/navit/layout.c 2014-08-13 17:24:13 UTC (rev 5870)
@@ -112,7 +112,13 @@
break;
case attr_active:
attr->u.num=layout->active;
- break;
+ return 1;
+ case attr_nightlayout:
+ attr->u.str=layout->nightname;
+ return 1;
+ case attr_daylayout:
+ attr->u.str=layout->dayname;
+ return 1;
default:
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-08-13 17:22:38
|
Revision: 5869
http://sourceforge.net/p/navit/code/5869
Author: mdankov
Date: 2014-08-13 17:22:34 +0000 (Wed, 13 Aug 2014)
Log Message:
-----------
Fix:core:Do not crash when navit.layout or navit.layout_name is attempted to be set to NULL.
Modified Paths:
--------------
trunk/navit/navit/navit.c
Modified: trunk/navit/navit/navit.c
===================================================================
--- trunk/navit/navit/navit.c 2014-08-13 17:02:39 UTC (rev 5868)
+++ trunk/navit/navit/navit.c 2014-08-13 17:22:34 UTC (rev 5869)
@@ -2429,6 +2429,8 @@
this_->vehicle->follow_curr = attr->u.num;
break;
case attr_layout:
+ if(!attr->u.layout)
+ return 0;
if(this_->layout_current!=attr->u.layout) {
this_->layout_current=attr->u.layout;
graphics_font_destroy_all(this_->gra);
@@ -2439,6 +2441,8 @@
}
break;
case attr_layout_name:
+ if(!attr->u.str)
+ return 0;
l=this_->layouts;
while (l) {
lay=l->data;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-08-13 17:02:46
|
Revision: 5868
http://sourceforge.net/p/navit/code/5868
Author: mdankov
Date: 2014-08-13 17:02:39 +0000 (Wed, 13 Aug 2014)
Log Message:
-----------
Fix:core:Do not crash on attempt to retrive an attribute missing from object, with command interpreter.
Modified Paths:
--------------
trunk/navit/navit/attr.c
Modified: trunk/navit/navit/attr.c
===================================================================
--- trunk/navit/navit/attr.c 2014-08-11 21:27:03 UTC (rev 5867)
+++ trunk/navit/navit/attr.c 2014-08-13 17:02:39 UTC (rev 5868)
@@ -599,7 +599,7 @@
if (attr->type == attr_none)
return 0;
if (attr->type >= attr_type_string_begin && attr->type <= attr_type_string_end)
- return strlen(attr->u.str)+1;
+ return attr->u.str?strlen(attr->u.str)+1:0;
if (attr->type >= attr_type_int_begin && attr->type <= attr_type_int_end)
return sizeof(attr->u.num);
if (attr->type >= attr_type_coord_geo_begin && attr->type <= attr_type_coord_geo_end)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:27:11
|
Revision: 5867
http://sourceforge.net/p/navit/code/5867
Author: sleske
Date: 2014-08-11 21:27:03 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Fix:gui/gtk:POI search: Remove pointless code for reading vehicle position.|See #1133.
Modified Paths:
--------------
trunk/navit/navit/gui/gtk/gui_gtk_poi.c
Modified: trunk/navit/navit/gui/gtk/gui_gtk_poi.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:26:47 UTC (rev 5866)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:27:03 UTC (rev 5867)
@@ -33,7 +33,6 @@
#include "mapset.h"
#include "transform.h"
#include "attr.h"
-#include "vehicle.h"
#include "util.h"
static struct gtk_poi_search{
@@ -114,24 +113,13 @@
struct map_rect *mr;
struct item *item;
struct point cursor_position;
- struct attr attr, vehicle_attr;
- struct vehicle *v=NULL;
enum item_type selected;
search_distance_meters=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
- if(navit_get_attr(search->nav,attr_vehicle, &vehicle_attr,NULL) && (v=vehicle_attr.u.vehicle)) {
- vehicle_get_attr(v,attr_position_coord_geo, &attr, NULL);
- }
- if (!v || (attr.u.coord_geo->lng==0.0f && attr.u.coord_geo->lat==0.0f)){
- cursor_position.x=navit_get_width(search->nav)/2;
- cursor_position.y=navit_get_height(search->nav)/2;
- gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from screen center (km)"));
- }else{
- cursor_position.x=navit_get_width(search->nav)/2;
- cursor_position.y=navit_get_height(search->nav)*4/5;
- gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from vehicle cursor (km)"));
- }
+ cursor_position.x=navit_get_width(search->nav)/2;
+ cursor_position.y=navit_get_height(search->nav)/2;
+ gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from screen center (km)"));
transform_reverse(navit_get_trans(search->nav), &cursor_position, ¢er);
pc.pro = transform_get_projection(navit_get_trans(search->nav));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:26:54
|
Revision: 5866
http://sourceforge.net/p/navit/code/5866
Author: sleske
Date: 2014-08-11 21:26:47 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Refactor:core:Rename get_direction -> get_compass_direction
Modified Paths:
--------------
trunk/navit/navit/gui/gtk/gui_gtk_poi.c
trunk/navit/navit/gui/internal/gui_internal_poi.c
trunk/navit/navit/util.c
trunk/navit/navit/util.h
Modified: trunk/navit/navit/gui/gtk/gui_gtk_poi.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:26:29 UTC (rev 5865)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:26:47 UTC (rev 5866)
@@ -157,7 +157,7 @@
if (item->type==selected && idist<=search_distance_meters){
char direction[5];
gtk_list_store_append(search->store_poi, &iter);
- get_direction(direction,transform_get_angle_delta(¢er,&coord_item,0),1);
+ get_compass_direction(direction,transform_get_angle_delta(¢er,&coord_item,0),1);
gtk_list_store_set(search->store_poi, &iter, 0,direction, 1,idist,
2,g_strdup(label_attr.u.str), 3,coord_item.x, 4,coord_item.y ,-1);
}
Modified: trunk/navit/navit/gui/internal/gui_internal_poi.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_poi.c 2014-08-11 21:26:29 UTC (rev 5865)
+++ trunk/navit/navit/gui/internal/gui_internal_poi.c 2014-08-11 21:26:47 UTC (rev 5866)
@@ -286,7 +286,7 @@
format_dist(dist,distbuf);
if(c) {
int len;
- get_direction(dirbuf, transform_get_angle_delta(center, c, 0), 1);
+ get_compass_direction(dirbuf, transform_get_angle_delta(center, c, 0), 1);
len=strlen(dirbuf);
dirbuf[len]=' ';
dirbuf[len+1]=0;
Modified: trunk/navit/navit/util.c
===================================================================
--- trunk/navit/navit/util.c 2014-08-11 21:26:29 UTC (rev 5865)
+++ trunk/navit/navit/util.c 2014-08-11 21:26:47 UTC (rev 5866)
@@ -713,7 +713,7 @@
/** Get printable compass direction from an angle. */
void
-get_direction(char *buffer, int angle, int mode)
+get_compass_direction(char *buffer, int angle, int mode)
{
angle=angle%360;
switch (mode) {
Modified: trunk/navit/navit/util.h
===================================================================
--- trunk/navit/navit/util.h 2014-08-11 21:26:29 UTC (rev 5865)
+++ trunk/navit/navit/util.h 2014-08-11 21:26:47 UTC (rev 5866)
@@ -57,4 +57,4 @@
#endif
-void get_direction(char *buffer, int angle, int mode);
+void get_compass_direction(char *buffer, int angle, int mode);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:26:36
|
Revision: 5865
http://sourceforge.net/p/navit/code/5865
Author: sleske
Date: 2014-08-11 21:26:29 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Refactor:core:Centralise get_direction.
Modified Paths:
--------------
trunk/navit/navit/gui/gtk/gui_gtk_poi.c
trunk/navit/navit/gui/internal/gui_internal_poi.c
trunk/navit/navit/util.c
trunk/navit/navit/util.h
Modified: trunk/navit/navit/gui/gtk/gui_gtk_poi.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:26:09 UTC (rev 5864)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:26:29 UTC (rev 5865)
@@ -34,6 +34,7 @@
#include "transform.h"
#include "attr.h"
#include "vehicle.h"
+#include "util.h"
static struct gtk_poi_search{
GtkWidget *entry_distance;
@@ -98,34 +99,6 @@
return GTK_TREE_MODEL (search->store_cat_sorted);
}
-/*Copied from gui_internal_poi.c. I didn't know how to reference it. Gets the cardinal direction from the angle*/
-static void
-get_direction(char *buffer, int angle, int mode)
-{
- angle=angle%360;
- switch (mode) {
- case 0:
- sprintf(buffer,"%d",angle);
- break;
- case 1:
- if (angle < 69 || angle > 291)
- *buffer++='N';
- if (angle > 111 && angle < 249)
- *buffer++='S';
- if (angle > 22 && angle < 158)
- *buffer++='E';
- if (angle > 202 && angle < 338)
- *buffer++='W';
- *buffer++='\0';
- break;
- case 2:
- angle=(angle+15)/30;
- if (! angle)
- angle=12;
- sprintf(buffer,"%d H", angle);
- break;
- }
-}
/** Construct model of POIs from map information. */
static GtkTreeModel *
Modified: trunk/navit/navit/gui/internal/gui_internal_poi.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_poi.c 2014-08-11 21:26:09 UTC (rev 5864)
+++ trunk/navit/navit/gui/internal/gui_internal_poi.c 2014-08-11 21:26:29 UTC (rev 5865)
@@ -17,6 +17,7 @@
#include "transform.h"
#include "linguistics.h"
#include "fib.h"
+#include "util.h"
#include "gui_internal.h"
#include "gui_internal_widget.h"
#include "gui_internal_priv.h"
@@ -141,35 +142,6 @@
return NULL;
}
-
-static void
-get_direction(char *buffer, int angle, int mode)
-{
- angle=angle%360;
- switch (mode) {
- case 0:
- sprintf(buffer,"%d",angle);
- break;
- case 1:
- if (angle < 69 || angle > 291)
- *buffer++='N';
- if (angle > 111 && angle < 249)
- *buffer++='S';
- if (angle > 22 && angle < 158)
- *buffer++='E';
- if (angle > 202 && angle < 338)
- *buffer++='W';
- *buffer++='\0';
- break;
- case 2:
- angle=(angle+15)/30;
- if (! angle)
- angle=12;
- sprintf(buffer,"%d H", angle);
- break;
- }
-}
-
/**
* @brief Free poi_param structure.
*
Modified: trunk/navit/navit/util.c
===================================================================
--- trunk/navit/navit/util.c 2014-08-11 21:26:09 UTC (rev 5864)
+++ trunk/navit/navit/util.c 2014-08-11 21:26:29 UTC (rev 5865)
@@ -24,6 +24,7 @@
#include <time.h>
#include <limits.h>
#include <string.h>
+#include <stdio.h>
#ifdef _POSIX_C_SOURCE
#include <unistd.h>
@@ -131,7 +132,6 @@
#endif
#if defined(_WIN32) || defined(__CEGCC__) || defined (__APPLE__) || defined(HAVE_API_ANDROID)
-#include <stdio.h>
char *stristr(const char *String, const char *Pattern)
{
char *pptr, *sptr, *start;
@@ -711,4 +711,31 @@
return;
}
-
+/** Get printable compass direction from an angle. */
+void
+get_direction(char *buffer, int angle, int mode)
+{
+ angle=angle%360;
+ switch (mode) {
+ case 0:
+ sprintf(buffer,"%d",angle);
+ break;
+ case 1:
+ if (angle < 69 || angle > 291)
+ *buffer++='N';
+ if (angle > 111 && angle < 249)
+ *buffer++='S';
+ if (angle > 22 && angle < 158)
+ *buffer++='E';
+ if (angle > 202 && angle < 338)
+ *buffer++='W';
+ *buffer++='\0';
+ break;
+ case 2:
+ angle=(angle+15)/30;
+ if (! angle)
+ angle=12;
+ sprintf(buffer,"%d H", angle);
+ break;
+ }
+}
Modified: trunk/navit/navit/util.h
===================================================================
--- trunk/navit/navit/util.h 2014-08-11 21:26:09 UTC (rev 5864)
+++ trunk/navit/navit/util.h 2014-08-11 21:26:29 UTC (rev 5865)
@@ -57,3 +57,4 @@
#endif
+void get_direction(char *buffer, int angle, int mode);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:26:18
|
Revision: 5864
http://sourceforge.net/p/navit/code/5864
Author: sleske
Date: 2014-08-11 21:26:09 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Add:xpm:POI icons for taxi and railway station.|Station icon CC-0 from SJJB Management.
Added Paths:
-----------
trunk/navit/navit/xpm/rail_station.svg
trunk/navit/navit/xpm/taxi.svg
Added: trunk/navit/navit/xpm/rail_station.svg
===================================================================
--- trunk/navit/navit/xpm/rail_station.svg (rev 0)
+++ trunk/navit/navit/xpm/rail_station.svg 2014-08-11 21:26:09 UTC (rev 5864)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="22"
+ height="22"
+ id="svg2">
+ <defs
+ id="defs22">
+ <marker
+ markerUnits="strokeWidth"
+ refX="10"
+ refY="5"
+ markerWidth="4"
+ markerHeight="3"
+ orient="auto"
+ viewBox="0 0 10 10"
+ id="ArrowStart">
+ <path
+ d="M 10,0 0,5 10,10 z"
+ id="path3568" />
+ </marker>
+ <marker
+ markerUnits="strokeWidth"
+ refX="0"
+ refY="5"
+ markerWidth="4"
+ markerHeight="3"
+ orient="auto"
+ viewBox="0 0 10 10"
+ id="ArrowEnd">
+ <path
+ d="M 0,0 10,5 0,10 z"
+ id="path3565" />
+ </marker>
+ </defs>
+ <metadata
+ id="metadata10">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="matrix(0.03543117,0,0,0.03543117,32.15603,1.9567887)"
+ id="g2319">
+ <path
+ d=""
+ id="path2323"
+ style="fill:#ffffff;stroke:none" />
+ </g>
+ <g
+ transform="matrix(0.03543117,0,0,0.03543117,32.15603,1.9567887)"
+ id="g2325">
+ <path
+ d=""
+ id="path2329"
+ style="fill:#ffffff;stroke:none" />
+ </g>
+ <g
+ transform="matrix(0.04942432,0,0,0.04942432,-3.9923488,-5.4054936)"
+ id="g3574"
+ style="fill:#000000">
+ <g
+ id="g3576"
+ style="fill:#000000">
+ <path
+ d="M 295.5625,77.1875 213.03125,77.25 c -38.43866,-1.1e-5 -66.71875,30.86801 -66.71875,64.5 l 0,238.21875 c 3e-5,32.58264 25.49108,59.30702 51.125,63.4375 l -76.875,115.3125 44.375,0 54.96875,-80.59375 75.28125,0 0.0625,0 0.0625,0 75.28125,0 54.96875,80.59375 44.375,0 -76.875,-115.3125 c 25.63388,-4.1305 51.15625,-30.85484 51.15625,-63.4375 l 0,-238.21875 c -4e-5,-33.63196 -28.31137,-64.5 -66.75,-64.5 L 295.5625,77.1875 z M 262.875,91 l 32.3125,0 0.0625,0 0.0625,0 32.3125,0 c 5.84817,0 10.9375,4.90183 10.9375,10.75 l 0,18.9375 c 0,5.84817 -4.81084,10.875 -10.9375,10.875 l -32.3125,0 -0.0625,0 -0.0625,0 -32.3125,0 c -6.12665,0 -10.9375,-5.02683 -10.9375,-10.875 l 0,-18.9375 c 0,-5.84817 5.08932,-10.749997 10.9375,-10.75 z m -47.625,53.40625 79.9375,0 0.125,0 79.9375,0 c 21.72176,1e-5 33.25001,15.552 33.25,33.375 l 0,42.875 c 0.16931,20.60784 -14.87004,33.25 -33.25,33.25 l -79.9375,0 -0.0625,0 -0.0625,0 -79.9375,0 c -18.37997,0 -33.41932,-12.64216 -33.25,-33.25 l 0,-42.875 c -1e-5,-17.823 11.52822,-33.375 33.25,-33.375 z m -3.625,205.75 c 16.15766,-3e-5 29.28125,13.09234 29.28125,29.25 0,16.1565 -13.12359,29.25 -29.28125,29.25 -16.15769,-2e-5 -29.25,-13.09346 -29.25,-29.25 -4e-5,-16.1577 13.09234,-29.25 29.25,-29.25 z m 166.5625,0 c 16.15764,-2e-5 29.25,13.09233 29.25,29.25 -2e-5,16.15652 -13.09233,29.25001 -29.25,29.25 -16.15768,-2e-5 -29.25001,-13.09347 -29.25,-29.25 -2e-5,-16.15768 13.09235,-29.25 29.25,-29.25 z"
+ transform="matrix(0.8977168,0,0,0.8977168,40.710583,46.777129)"
+ id="path3578"
+ style="fill:#000000;stroke:none" />
+ </g>
+ <g
+ id="g3584"
+ style="fill:#000000" />
+ </g>
+</svg>
Added: trunk/navit/navit/xpm/taxi.svg
===================================================================
--- trunk/navit/navit/xpm/taxi.svg (rev 0)
+++ trunk/navit/navit/xpm/taxi.svg 2014-08-11 21:26:09 UTC (rev 5864)
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="22"
+ height="22"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.5 r10040"
+ sodipodi:docname="taxi.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="10"
+ inkscape:cx="30.870884"
+ inkscape:cy="19.453805"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ fit-margin-top="3"
+ fit-margin-left="3"
+ fit-margin-right="3"
+ fit-margin-bottom="3"
+ inkscape:window-width="1056"
+ inkscape:window-height="697"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-23.765375,-23.712777)">
+ <rect
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="rect3005"
+ width="21.850609"
+ height="22.025177"
+ x="23.842041"
+ y="23.708303" />
+ <rect
+ style="fill:#ffff00;fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="rect3003"
+ width="19.615889"
+ height="19.220139"
+ x="24.959402"
+ y="25.063957" />
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:Sans Bold"
+ x="2.3"
+ y="3.0999999"
+ id="text3045"
+ sodipodi:linespacing="125%"
+ transform="translate(23.765375,23.712777)"><tspan
+ sodipodi:role="line"
+ id="tspan3047"
+ x="2.3"
+ y="3.0999999" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:24px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:Sans Bold"
+ x="2"
+ y="-2.0999999"
+ id="text3049"
+ sodipodi:linespacing="125%"
+ transform="translate(23.765375,23.712777)"><tspan
+ sodipodi:role="line"
+ id="tspan3051"
+ x="2"
+ y="-2.0999999" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:24px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:Sans Bold"
+ x="2.7"
+ y="4.4000001"
+ id="text3053"
+ sodipodi:linespacing="125%"
+ transform="translate(23.765375,23.712777)"><tspan
+ sodipodi:role="line"
+ id="tspan3055"
+ x="2.7"
+ y="4.4000001" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:25.34528351px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:Sans Bold"
+ x="25.785437"
+ y="35.285679"
+ id="text3057"
+ sodipodi:linespacing="125%"
+ transform="scale(1.0560535,0.94692176)"><tspan
+ sodipodi:role="line"
+ id="tspan3059"
+ x="25.785437"
+ y="35.285679"
+ style="font-size:10.56053448px">TA</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:10.56053448px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:Sans Bold"
+ x="26.207859"
+ y="44.578953"
+ id="text3061"
+ sodipodi:linespacing="125%"
+ transform="scale(1.0560535,0.94692176)"><tspan
+ sodipodi:role="line"
+ id="tspan3063"
+ x="26.207859"
+ y="44.578953">X</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:10.56053448px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:Sans Bold"
+ x="35.606735"
+ y="44.578953"
+ id="text3065"
+ sodipodi:linespacing="125%"
+ transform="scale(1.0560535,0.94692176)"><tspan
+ sodipodi:role="line"
+ id="tspan3067"
+ x="35.606735"
+ y="44.578953">I</tspan></text>
+ </g>
+</svg>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:26:01
|
Revision: 5863
http://sourceforge.net/p/navit/code/5863
Author: sleske
Date: 2014-08-11 21:25:58 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Refactor:gui/gtk:Better comments, variable names.
Modified Paths:
--------------
trunk/navit/navit/gui/gtk/gui_gtk_action.c
trunk/navit/navit/gui/gtk/gui_gtk_poi.c
Modified: trunk/navit/navit/gui/gtk/gui_gtk_action.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_action.c 2014-08-11 21:25:36 UTC (rev 5862)
+++ trunk/navit/navit/gui/gtk/gui_gtk_action.c 2014-08-11 21:25:58 UTC (rev 5863)
@@ -181,9 +181,8 @@
navit_set_destination(gui->nav, NULL, NULL, 0);
}
-/*Action that shows search poi window*/
static void
-poi_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
+poi_search_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
{
gtk_gui_poi(gui->nav);
}
@@ -221,7 +220,7 @@
{ "InfoAction", NULL, _n("_Info"), NULL, NULL, G_CALLBACK(info_action) },
#endif /*GTK_STOCK_INFO*/
{ "DestinationAction", "flag_icon", _n("Set _destination"), "<control>D", _n("Opens address search dialog"), G_CALLBACK(destination_action) },
- { "POIAction", "flag_icon", _n("_POI search"), "<control>P", _n("Opens POI search dialog"), G_CALLBACK(poi_action) },
+ { "POIAction", "flag_icon", _n("_POI search"), "<control>P", _n("Opens POI search dialog"), G_CALLBACK(poi_search_action) },
{ "RouteClearAction", NULL, _n("_Stop Navigation"), "<control>S", NULL, G_CALLBACK(route_clear_action) },
{ "Test", NULL, _n("Test"), NULL, NULL, G_CALLBACK(destination_action) },
{ "QuitAction", GTK_STOCK_QUIT, _n("_Quit"), "<control>Q",_n("Quit the application"), G_CALLBACK (quit_action) }
Modified: trunk/navit/navit/gui/gtk/gui_gtk_poi.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:25:36 UTC (rev 5862)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:25:58 UTC (rev 5863)
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <gtk/gtk.h>
-#include "gui_gtk_poi.h"
+#include "gui_gtk_poi.h"
#include "popup.h"
#include "debug.h"
#include "navit_nls.h"
@@ -40,7 +40,7 @@
GtkWidget *label_distance;
GtkWidget *treeview_cat;
GtkWidget *treeview_poi;
- GtkWidget *button_visit, *button_destination, *button_map;
+ GtkWidget *button_visit, *button_destination, *button_map;
GtkListStore *store_poi;
GtkListStore *store_cat;
GtkTreeModel *store_poi_sorted;
@@ -49,8 +49,6 @@
struct navit *nav;
} gtk_poi_search;
-
-/*Returns an icon with GdkPIxbuf*/
static GdkPixbuf *
geticon(const char *name){
GdkPixbuf *icon=NULL;
@@ -62,41 +60,41 @@
return icon;
}
-/*Builds the category list and adds icons to improve UI*/
+/** Build the category list model with icons. */
static GtkTreeModel *
-model_cat (struct gtk_poi_search *search)
+category_list_model(struct gtk_poi_search *search)
{
GtkTreeIter iter;
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter, 0,geticon("pharmacy.png"), 1, _("Pharmacy"), 2, "poi_pharmacy", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter, 0, geticon("restaurant.png"), 1, _("Restaurant"), 2, "poi_restaurant", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("restaurant.png"), 1, _("Restaurant. Fast food"),2, "poi_fastfood", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("hotel.png"), 1, _("Hotel"),2, "poi_hotel", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("parking.png"), 1, _("Car parking"),2, "poi_car_parking", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("fuel.png"), 1, _("Fuel station"),2, "poi_fuel", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("bank.png"), 1, _("Bank"),2, "poi_bank", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("hospital.png"), 1, _("Hospital"),2, "poi_hospital", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("cinema.png"), 1, _("Cinema"),2, "poi_cinema", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("rail_station.png"), 1, _("Train station"),2, "poi_rail_station", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("school.png"), 1, _("School"),2, "poi_school", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("police.png"), 1, _("Police"),2, "poi_police", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("justice.png"), 1, _("Justice"),2, "poi_justice", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("taxi.png"), 1, _("Taxi"),2, "poi_taxi", -1);
- gtk_list_store_append (search->store_cat, &iter);
- gtk_list_store_set (search->store_cat, &iter,0, geticon("shopping.png"), 1, _("Shopping"),2, "poi_shopping", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter, 0,geticon("pharmacy.png"), 1, _("Pharmacy"), 2, "poi_pharmacy", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter, 0, geticon("restaurant.png"), 1, _("Restaurant"), 2, "poi_restaurant", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("restaurant.png"), 1, _("Restaurant. Fast food"), 2, "poi_fastfood", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("hotel.png"), 1, _("Hotel"), 2, "poi_hotel", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("parking.png"), 1, _("Car parking"), 2, "poi_car_parking", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("fuel.png"), 1, _("Fuel station"), 2, "poi_fuel", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("bank.png"), 1, _("Bank"), 2, "poi_bank", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("hospital.png"), 1, _("Hospital"), 2, "poi_hospital", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("cinema.png"), 1, _("Cinema"), 2, "poi_cinema", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("rail_station.png"), 1, _("Train station"), 2, "poi_rail_station", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("school.png"), 1, _("School"), 2, "poi_school", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("police.png"), 1, _("Police"), 2, "poi_police", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("justice.png"), 1, _("Justice"), 2, "poi_justice", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("taxi.png"), 1, _("Taxi"), 2, "poi_taxi", -1);
+ gtk_list_store_append(search->store_cat, &iter);
+ gtk_list_store_set(search->store_cat, &iter,0, geticon("shopping.png"), 1, _("Shopping"), 2, "poi_shopping", -1);
return GTK_TREE_MODEL (search->store_cat_sorted);
}
@@ -129,7 +127,7 @@
}
}
-/*Constructs model of pois from map information*/
+/** Construct model of POIs from map information. */
static GtkTreeModel *
model_poi (struct gtk_poi_search *search)
{
@@ -138,57 +136,57 @@
struct coord coord_item,center;
struct pcoord pc;
struct mapset_handle *h;
- int dist,idist;
+ int search_distance_meters,idist;
struct map *m;
struct map_rect *mr;
struct item *item;
- struct point p;//Cursor position in screen
+ struct point cursor_position;
struct attr attr, vehicle_attr;
struct vehicle *v=NULL;
enum item_type selected;
- //distance in meters
- dist=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
+ search_distance_meters=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
if(navit_get_attr(search->nav,attr_vehicle, &vehicle_attr,NULL) && (v=vehicle_attr.u.vehicle)) {
vehicle_get_attr(v,attr_position_coord_geo, &attr, NULL);
}
if (!v || (attr.u.coord_geo->lng==0.0f && attr.u.coord_geo->lat==0.0f)){
- p.x=navit_get_width(search->nav)/2;
- p.y=navit_get_height(search->nav)/2;
+ cursor_position.x=navit_get_width(search->nav)/2;
+ cursor_position.y=navit_get_height(search->nav)/2;
gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from screen center (km)"));
}else{
- p.x=navit_get_width(search->nav)/2;
- p.y=navit_get_height(search->nav)*4/5;
+ cursor_position.x=navit_get_width(search->nav)/2;
+ cursor_position.y=navit_get_height(search->nav)*4/5;
gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from vehicle cursor (km)"));
}
- transform_reverse(navit_get_trans(search->nav), &p, ¢er);
+ transform_reverse(navit_get_trans(search->nav), &cursor_position, ¢er);
pc.pro = transform_get_projection(navit_get_trans(search->nav));
pc.x = center.x;
pc.y = center.y;
//Search in the map, for pois
- sel=map_selection_rect_new(&pc ,dist*transform_scale(abs(center.y)+dist*1.5),18);
+ sel=map_selection_rect_new(&pc ,search_distance_meters*transform_scale(abs(center.y)+search_distance_meters*1.5),18);
gtk_list_store_clear(search->store_poi);
h=mapset_open(navit_get_mapset(search->nav));
selected=item_from_name(search->selected_cat);
while ((m=mapset_next(h, 1))) {
- selm=map_selection_dup_pro(sel, 1, map_projection(m));//pro vale 1
+ selm=map_selection_dup_pro(sel, projection_mg, map_projection(m));
mr=map_rect_new(m, selm);
if (mr) {
while ((item=map_rect_get_item(mr))) {
- struct attr attr;
- item_attr_get(item,attr_label,&attr);
+ struct attr label_attr;
+ item_attr_get(item,attr_label,&label_attr);
item_coord_get(item,&coord_item,1);
idist=transform_distance(1,¢er,&coord_item);
- if (item->type==selected && idist<=dist){
- gtk_list_store_append (search->store_poi, &iter);
- char rumbo[5];
- get_direction(rumbo,transform_get_angle_delta(¢er,&coord_item,0),1);
- gtk_list_store_set (search->store_poi, &iter, 0,rumbo, 1,idist, 2,g_strdup(attr.u.str), 3,coord_item.x, 4,coord_item.y ,-1);
+ if (item->type==selected && idist<=search_distance_meters){
+ char direction[5];
+ gtk_list_store_append(search->store_poi, &iter);
+ get_direction(direction,transform_get_angle_delta(¢er,&coord_item,0),1);
+ gtk_list_store_set(search->store_poi, &iter, 0,direction, 1,idist,
+ 2,g_strdup(label_attr.u.str), 3,coord_item.x, 4,coord_item.y ,-1);
}
}
map_rect_destroy(mr);
@@ -201,8 +199,8 @@
return GTK_TREE_MODEL (search->store_poi_sorted);
}
-/*Sets button enabled if there is a row selected*/
-static void
+/** Enable button if there is a selected row. */
+static void
treeview_poi_changed(GtkWidget *widget, struct gtk_poi_search *search)
{
GtkTreePath *path;
@@ -218,8 +216,8 @@
gtk_widget_set_sensitive(search->button_destination,TRUE);
}
-/*Reloads the poi list, and sets buttons disabled*/
-static void
+/** Reload the POI list and disable buttons. */
+static void
treeview_poi_reload(GtkWidget *widget, struct gtk_poi_search *search)
{
GtkTreePath *path;
@@ -237,8 +235,8 @@
gtk_tree_view_set_model(GTK_TREE_VIEW (search->treeview_poi), model_poi(search));
}
-/*Function when button destination is clicked. It sets the selected poi position as destination*/
-static void
+/** Set the selected POI as destination. */
+static void
button_destination_clicked(GtkWidget *widget, struct gtk_poi_search *search)
{
GtkTreePath *path;
@@ -272,8 +270,8 @@
dbg(1,_("Set destination to %ld, %ld \n"),lat,lon);
}
-/*Function when button map is clicked. It shows the poi position in the map*/
-static void
+/* Show the POI's position in the map. */
+static void
button_map_clicked(GtkWidget *widget, struct gtk_poi_search *search)
{
GtkTreePath *path;
@@ -295,8 +293,8 @@
dbg(1,_("Set map to %ld, %ld \n"),lat,lon);
}
-/*Function when button visitbefore is clicked. It sets the first visit before of the waypoint when it's clicked*/
-static void
+/** Set POI as the first "visit before". */
+static void
button_visit_clicked(GtkWidget *widget, struct gtk_poi_search *search)
{
GtkTreePath *path;
@@ -318,7 +316,7 @@
popup_set_visitbefore(search->nav,&dest,0);
}
-/*Create UI and connects objects to functions*/
+/** Create UI and connect objects to functions. */
void gtk_gui_poi(struct navit *nav)
{
GtkWidget *window2,*vbox, *keyboard, *table;
@@ -354,20 +352,19 @@
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_cat),-1, _("Category"), renderer, "text", 1, NULL);
search->store_cat_sorted=gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(search->store_cat));
gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(search->store_cat_sorted),1,GTK_SORT_ASCENDING);
- gtk_tree_view_set_model (GTK_TREE_VIEW (search->treeview_cat), model_cat(search));
+ gtk_tree_view_set_model (GTK_TREE_VIEW (search->treeview_cat), category_list_model(search));
search->treeview_poi=gtk_tree_view_new();
listbox_poi = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (listbox_poi), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(listbox_poi),search->treeview_poi);
- search->store_poi = gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_LONG, G_TYPE_LONG);
+ search->store_poi = gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_LONG, G_TYPE_LONG);
renderer=gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Direction"), renderer, "text",0,NULL);
renderer=gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Distance(m)"), renderer, "text", 1, NULL);
renderer=gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Name"), renderer, "text", 2, NULL);
- search->store_poi_sorted=NULL;
search->store_poi_sorted=gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(search->store_poi));
gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(search->store_poi_sorted),1,GTK_SORT_ASCENDING);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:25:44
|
Revision: 5862
http://sourceforge.net/p/navit/code/5862
Author: sleske
Date: 2014-08-11 21:25:36 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Fix:gui/gtk:POI search: Warn about missing icons.
Modified Paths:
--------------
trunk/navit/navit/gui/gtk/gui_gtk_poi.c
Modified: trunk/navit/navit/gui/gtk/gui_gtk_poi.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:25:25 UTC (rev 5861)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:25:36 UTC (rev 5862)
@@ -56,6 +56,9 @@
GdkPixbuf *icon=NULL;
GError *error=NULL;
icon=gdk_pixbuf_new_from_file(graphics_icon_path(name),&error);
+ if (error) {
+ dbg(0, "failed to load icon '%s': %s\n", name, error->message);
+ }
return icon;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:25:29
|
Revision: 5861
http://sourceforge.net/p/navit/code/5861
Author: sleske
Date: 2014-08-11 21:25:25 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Fix:gui/gtk:Small text corrections for POI search.
Modified Paths:
--------------
trunk/navit/navit/gui/gtk/gui_gtk_action.c
trunk/navit/navit/gui/gtk/gui_gtk_poi.c
Modified: trunk/navit/navit/gui/gtk/gui_gtk_action.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_action.c 2014-08-11 21:25:03 UTC (rev 5860)
+++ trunk/navit/navit/gui/gtk/gui_gtk_action.c 2014-08-11 21:25:25 UTC (rev 5861)
@@ -221,7 +221,7 @@
{ "InfoAction", NULL, _n("_Info"), NULL, NULL, G_CALLBACK(info_action) },
#endif /*GTK_STOCK_INFO*/
{ "DestinationAction", "flag_icon", _n("Set _destination"), "<control>D", _n("Opens address search dialog"), G_CALLBACK(destination_action) },
- { "POIAction", "flag_icon", _n("Set _POI"), "<control>P", _n("Opens POI search dialog"), G_CALLBACK(poi_action) },
+ { "POIAction", "flag_icon", _n("_POI search"), "<control>P", _n("Opens POI search dialog"), G_CALLBACK(poi_action) },
{ "RouteClearAction", NULL, _n("_Stop Navigation"), "<control>S", NULL, G_CALLBACK(route_clear_action) },
{ "Test", NULL, _n("Test"), NULL, NULL, G_CALLBACK(destination_action) },
{ "QuitAction", GTK_STOCK_QUIT, _n("_Quit"), "<control>Q",_n("Quit the application"), G_CALLBACK (quit_action) }
Modified: trunk/navit/navit/gui/gtk/gui_gtk_poi.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:25:03 UTC (rev 5860)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:25:25 UTC (rev 5861)
@@ -153,13 +153,11 @@
if (!v || (attr.u.coord_geo->lng==0.0f && attr.u.coord_geo->lat==0.0f)){
p.x=navit_get_width(search->nav)/2;
p.y=navit_get_height(search->nav)/2;
- gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from center screen (Km)"));
+ gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from screen center (km)"));
}else{
- printf("%f\n",attr.u.coord_geo->lng);
-
p.x=navit_get_width(search->nav)/2;
p.y=navit_get_height(search->nav)*4/5;
- gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from vehicle cursor (Km)"));
+ gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from vehicle cursor (km)"));
}
transform_reverse(navit_get_trans(search->nav), &p, ¢er);
@@ -329,14 +327,14 @@
search->nav=nav;
window2 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(window2),_("Search of POI's"));
+ gtk_window_set_title(GTK_WINDOW(window2),_("POI search"));
gtk_window_set_wmclass (GTK_WINDOW (window2), "navit", "Navit");
gtk_window_set_default_size (GTK_WINDOW (window2),700,550);
vbox = gtk_vbox_new(FALSE, 0);
table = gtk_table_new(4, 4, FALSE);
label_category = gtk_label_new(_("Select a category"));
- search->label_distance = gtk_label_new(_("Select a distance to look for (Km)"));
+ search->label_distance = gtk_label_new(_("Select a distance to look for (km)"));
label_poi=gtk_label_new(_("Select a POI"));
search->entry_distance=gtk_entry_new_with_max_length(2);
@@ -361,9 +359,9 @@
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(listbox_poi),search->treeview_poi);
search->store_poi = gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_LONG, G_TYPE_LONG);
renderer=gtk_cell_renderer_text_new();
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, " ", renderer, "text",0,NULL);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Direction"), renderer, "text",0,NULL);
renderer=gtk_cell_renderer_text_new();
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Meters"), renderer, "text", 1, NULL);
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Distance(m)"), renderer, "text", 1, NULL);
renderer=gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Name"), renderer, "text", 2, NULL);
search->store_poi_sorted=NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:25:11
|
Revision: 5860
http://sourceforge.net/p/navit/code/5860
Author: sleske
Date: 2014-08-11 21:25:03 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Fix:gui/gtk:POI search: Don't crash if no vehicle is active.
Modified Paths:
--------------
trunk/navit/navit/gui/gtk/gui_gtk_poi.c
Modified: trunk/navit/navit/gui/gtk/gui_gtk_poi.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:24:46 UTC (rev 5859)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:25:03 UTC (rev 5860)
@@ -141,19 +141,16 @@
struct item *item;
struct point p;//Cursor position in screen
struct attr attr, vehicle_attr;
- struct vehicle *v;
+ struct vehicle *v=NULL;
enum item_type selected;
//distance in meters
dist=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
- //Searches if vehicle has coord_geo to show distance from vehicle.
- //If vehicle hasn't coord_geo show distance from center of screen
- navit_get_attr(search->nav,attr_vehicle, &vehicle_attr,NULL);
- v=vehicle_attr.u.vehicle;
-
- vehicle_get_attr(v,attr_position_coord_geo, &attr, NULL);
- if (attr.u.coord_geo->lng==0.0f && attr.u.coord_geo->lat==0.0f){
+ if(navit_get_attr(search->nav,attr_vehicle, &vehicle_attr,NULL) && (v=vehicle_attr.u.vehicle)) {
+ vehicle_get_attr(v,attr_position_coord_geo, &attr, NULL);
+ }
+ if (!v || (attr.u.coord_geo->lng==0.0f && attr.u.coord_geo->lat==0.0f)){
p.x=navit_get_width(search->nav)/2;
p.y=navit_get_height(search->nav)/2;
gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from center screen (Km)"));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:24:52
|
Revision: 5859
http://sourceforge.net/p/navit/code/5859
Author: sleske
Date: 2014-08-11 21:24:46 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Add:gui/gtk:New POI search dialog.|Patch from #1133, thanks!
Modified Paths:
--------------
trunk/navit/navit/gui/gtk/CMakeLists.txt
trunk/navit/navit/gui/gtk/Makefile.am
trunk/navit/navit/gui/gtk/gui_gtk_action.c
trunk/navit/navit/popup.c
trunk/navit/navit/popup.h
trunk/navit/po/CMakeLists.txt
trunk/navit/po/Makefile.am
Added Paths:
-----------
trunk/navit/navit/gui/gtk/gui_gtk_poi.c
trunk/navit/navit/gui/gtk/gui_gtk_poi.h
Modified: trunk/navit/navit/gui/gtk/CMakeLists.txt
===================================================================
--- trunk/navit/navit/gui/gtk/CMakeLists.txt 2014-08-11 21:24:18 UTC (rev 5858)
+++ trunk/navit/navit/gui/gtk/CMakeLists.txt 2014-08-11 21:24:46 UTC (rev 5859)
@@ -1,2 +1,2 @@
-module_add_library(gui_gtk datawindow.c destination.c gui_gtk_statusbar.c gui_gtk_action.c gui_gtk_window.c)
+module_add_library(gui_gtk datawindow.c destination.c gui_gtk_statusbar.c gui_gtk_action.c gui_gtk_window.c gui_gtk_poi.c)
Modified: trunk/navit/navit/gui/gtk/Makefile.am
===================================================================
--- trunk/navit/navit/gui/gtk/Makefile.am 2014-08-11 21:24:18 UTC (rev 5858)
+++ trunk/navit/navit/gui/gtk/Makefile.am 2014-08-11 21:24:46 UTC (rev 5859)
@@ -1,6 +1,6 @@
include $(top_srcdir)/Makefile.inc
AM_CPPFLAGS = -I$(top_srcdir)/navit @NAVIT_CFLAGS@ @HILDON_CFLAGS@ @GTK2_CFLAGS@ -DMODULE=gui_gtk
modulegui_LTLIBRARIES = libgui_gtk.la
-libgui_gtk_la_SOURCES = datawindow.c destination.c gui_gtk_statusbar.c gui_gtk_action.c gui_gtk_window.c gui_gtk.h
+libgui_gtk_la_SOURCES = datawindow.c destination.c gui_gtk_statusbar.c gui_gtk_action.c gui_gtk_window.c gui_gtk.h gui_gtk_poi.h
libgui_gtk_la_LIBADD = @GTK2_LIBS@
libgui_gtk_la_LDFLAGS = -module -avoid-version
Modified: trunk/navit/navit/gui/gtk/gui_gtk_action.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_action.c 2014-08-11 21:24:18 UTC (rev 5858)
+++ trunk/navit/navit/gui/gtk/gui_gtk_action.c 2014-08-11 21:24:46 UTC (rev 5859)
@@ -33,6 +33,7 @@
#include "debug.h"
#include "destination.h"
#include "navit_nls.h"
+#include "gui_gtk_poi.h"
struct menu_priv {
char *path;
@@ -180,7 +181,14 @@
navit_set_destination(gui->nav, NULL, NULL, 0);
}
+/*Action that shows search poi window*/
static void
+poi_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
+{
+ gtk_gui_poi(gui->nav);
+}
+
+static void
destination_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
{
destination_address(gui->nav);
@@ -213,6 +221,7 @@
{ "InfoAction", NULL, _n("_Info"), NULL, NULL, G_CALLBACK(info_action) },
#endif /*GTK_STOCK_INFO*/
{ "DestinationAction", "flag_icon", _n("Set _destination"), "<control>D", _n("Opens address search dialog"), G_CALLBACK(destination_action) },
+ { "POIAction", "flag_icon", _n("Set _POI"), "<control>P", _n("Opens POI search dialog"), G_CALLBACK(poi_action) },
{ "RouteClearAction", NULL, _n("_Stop Navigation"), "<control>S", NULL, G_CALLBACK(route_clear_action) },
{ "Test", NULL, _n("Test"), NULL, NULL, G_CALLBACK(destination_action) },
{ "QuitAction", GTK_STOCK_QUIT, _n("_Quit"), "<control>Q",_n("Quit the application"), G_CALLBACK (quit_action) }
@@ -388,6 +397,7 @@
<menu name=\"Route\" action=\"RouteMenuAction\">\
<menuitem name=\"Refresh\" action=\"RefreshAction\" />\
<menuitem name=\"Destination\" action=\"DestinationAction\" />\
+ <menuitem name=\"POI\" action=\"POIAction\" />\
<menuitem name=\"Clear\" action=\"RouteClearAction\" />\
<menu name=\"FormerDestinations\" action=\"FormerDestinationMenuAction\">\
<placeholder name=\"FormerDestinationMenuAdditions\" />\
@@ -419,6 +429,7 @@
<!-- <toolitem name=\"Cursor\" action=\"CursorAction\"/> -->\
<toolitem name=\"Orientation\" action=\"OrientationAction\"/>\
<toolitem name=\"Destination\" action=\"DestinationAction\"/>\
+ <toolitem name=\"POI\" action=\"POIAction\"/>\
<!-- <toolitem name=\"Info\" action=\"InfoAction\"/> -->\
<toolitem name=\"Roadbook\" action=\"RoadbookAction\"/>\
<toolitem name=\"Autozoom\" action=\"AutozoomAction\"/>\
Added: trunk/navit/navit/gui/gtk/gui_gtk_poi.c
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.c (rev 0)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.c 2014-08-11 21:24:46 UTC (rev 5859)
@@ -0,0 +1,406 @@
+/**
+ * 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.
+ */
+
+#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 "vehicle.h"
+
+static struct gtk_poi_search{
+ GtkWidget *entry_distance;
+ GtkWidget *label_distance;
+ GtkWidget *treeview_cat;
+ GtkWidget *treeview_poi;
+ GtkWidget *button_visit, *button_destination, *button_map;
+ GtkListStore *store_poi;
+ GtkListStore *store_cat;
+ GtkTreeModel *store_poi_sorted;
+ GtkTreeModel *store_cat_sorted;
+ char *selected_cat;
+ struct navit *nav;
+} gtk_poi_search;
+
+
+/*Returns an icon with GdkPIxbuf*/
+static GdkPixbuf *
+geticon(const char *name){
+ GdkPixbuf *icon=NULL;
+ GError *error=NULL;
+ icon=gdk_pixbuf_new_from_file(graphics_icon_path(name),&error);
+ return icon;
+}
+
+/*Builds the category list and adds icons to improve UI*/
+static GtkTreeModel *
+model_cat (struct gtk_poi_search *search)
+{
+ GtkTreeIter iter;
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter, 0,geticon("pharmacy.png"), 1, _("Pharmacy"), 2, "poi_pharmacy", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter, 0, geticon("restaurant.png"), 1, _("Restaurant"), 2, "poi_restaurant", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("restaurant.png"), 1, _("Restaurant. Fast food"),2, "poi_fastfood", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("hotel.png"), 1, _("Hotel"),2, "poi_hotel", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("parking.png"), 1, _("Car parking"),2, "poi_car_parking", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("fuel.png"), 1, _("Fuel station"),2, "poi_fuel", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("bank.png"), 1, _("Bank"),2, "poi_bank", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("hospital.png"), 1, _("Hospital"),2, "poi_hospital", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("cinema.png"), 1, _("Cinema"),2, "poi_cinema", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("rail_station.png"), 1, _("Train station"),2, "poi_rail_station", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("school.png"), 1, _("School"),2, "poi_school", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("police.png"), 1, _("Police"),2, "poi_police", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("justice.png"), 1, _("Justice"),2, "poi_justice", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("taxi.png"), 1, _("Taxi"),2, "poi_taxi", -1);
+ gtk_list_store_append (search->store_cat, &iter);
+ gtk_list_store_set (search->store_cat, &iter,0, geticon("shopping.png"), 1, _("Shopping"),2, "poi_shopping", -1);
+ return GTK_TREE_MODEL (search->store_cat_sorted);
+}
+
+/*Copied from gui_internal_poi.c. I didn't know how to reference it. Gets the cardinal direction from the angle*/
+static void
+get_direction(char *buffer, int angle, int mode)
+{
+ angle=angle%360;
+ switch (mode) {
+ case 0:
+ sprintf(buffer,"%d",angle);
+ break;
+ case 1:
+ if (angle < 69 || angle > 291)
+ *buffer++='N';
+ if (angle > 111 && angle < 249)
+ *buffer++='S';
+ if (angle > 22 && angle < 158)
+ *buffer++='E';
+ if (angle > 202 && angle < 338)
+ *buffer++='W';
+ *buffer++='\0';
+ break;
+ case 2:
+ angle=(angle+15)/30;
+ if (! angle)
+ angle=12;
+ sprintf(buffer,"%d H", angle);
+ break;
+ }
+}
+
+/*Constructs model of pois from map information*/
+static GtkTreeModel *
+model_poi (struct gtk_poi_search *search)
+{
+ GtkTreeIter iter;
+ struct map_selection *sel,*selm;
+ struct coord coord_item,center;
+ struct pcoord pc;
+ struct mapset_handle *h;
+ int dist,idist;
+ struct map *m;
+ struct map_rect *mr;
+ struct item *item;
+ struct point p;//Cursor position in screen
+ struct attr attr, vehicle_attr;
+ struct vehicle *v;
+ enum item_type selected;
+
+ //distance in meters
+ dist=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
+
+ //Searches if vehicle has coord_geo to show distance from vehicle.
+ //If vehicle hasn't coord_geo show distance from center of screen
+ navit_get_attr(search->nav,attr_vehicle, &vehicle_attr,NULL);
+ v=vehicle_attr.u.vehicle;
+
+ vehicle_get_attr(v,attr_position_coord_geo, &attr, NULL);
+ if (attr.u.coord_geo->lng==0.0f && attr.u.coord_geo->lat==0.0f){
+ p.x=navit_get_width(search->nav)/2;
+ p.y=navit_get_height(search->nav)/2;
+ gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from center screen (Km)"));
+ }else{
+ printf("%f\n",attr.u.coord_geo->lng);
+
+ p.x=navit_get_width(search->nav)/2;
+ p.y=navit_get_height(search->nav)*4/5;
+ gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from vehicle cursor (Km)"));
+ }
+
+ transform_reverse(navit_get_trans(search->nav), &p, ¢er);
+ pc.pro = transform_get_projection(navit_get_trans(search->nav));
+ pc.x = center.x;
+ pc.y = center.y;
+
+ //Search in the map, for pois
+ sel=map_selection_rect_new(&pc ,dist*transform_scale(abs(center.y)+dist*1.5),18);
+ gtk_list_store_clear(search->store_poi);
+
+ h=mapset_open(navit_get_mapset(search->nav));
+
+ selected=item_from_name(search->selected_cat);
+ while ((m=mapset_next(h, 1))) {
+ selm=map_selection_dup_pro(sel, 1, map_projection(m));//pro vale 1
+ mr=map_rect_new(m, selm);
+ if (mr) {
+ while ((item=map_rect_get_item(mr))) {
+ struct attr attr;
+ item_attr_get(item,attr_label,&attr);
+ item_coord_get(item,&coord_item,1);
+ idist=transform_distance(1,¢er,&coord_item);
+ if (item->type==selected && idist<=dist){
+ gtk_list_store_append (search->store_poi, &iter);
+ char rumbo[5];
+ get_direction(rumbo,transform_get_angle_delta(¢er,&coord_item,0),1);
+ gtk_list_store_set (search->store_poi, &iter, 0,rumbo, 1,idist, 2,g_strdup(attr.u.str), 3,coord_item.x, 4,coord_item.y ,-1);
+ }
+ }
+ map_rect_destroy(mr);
+ }
+ map_selection_destroy(selm);
+ }
+ map_selection_destroy(sel);
+ mapset_close(h);
+
+ return GTK_TREE_MODEL (search->store_poi_sorted);
+}
+
+/*Sets button enabled if there is a row selected*/
+static void
+treeview_poi_changed(GtkWidget *widget, struct gtk_poi_search *search)
+{
+ GtkTreePath *path;
+ GtkTreeViewColumn *focus_column;
+ GtkTreeIter iter;
+
+ gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview_cat), &path, &focus_column);
+ if(!path) return;
+ if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_cat_sorted), &iter, path)) return;
+
+ gtk_widget_set_sensitive(search->button_visit,TRUE);
+ gtk_widget_set_sensitive(search->button_map,TRUE);
+ gtk_widget_set_sensitive(search->button_destination,TRUE);
+}
+
+/*Reloads the poi list, and sets buttons disabled*/
+static void
+treeview_poi_reload(GtkWidget *widget, struct gtk_poi_search *search)
+{
+ GtkTreePath *path;
+ GtkTreeViewColumn *focus_column;
+ GtkTreeIter iter;
+
+ gtk_widget_set_sensitive(search->button_visit,FALSE);
+ gtk_widget_set_sensitive(search->button_map,FALSE);
+ gtk_widget_set_sensitive(search->button_destination,FALSE);
+
+ gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview_cat), &path, &focus_column);
+ if(!path) return;
+ if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_cat_sorted), &iter, path)) return;
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_cat_sorted), &iter, 2, &search->selected_cat, -1);
+ gtk_tree_view_set_model(GTK_TREE_VIEW (search->treeview_poi), model_poi(search));
+}
+
+/*Function when button destination is clicked. It sets the selected poi position as destination*/
+static void
+button_destination_clicked(GtkWidget *widget, struct gtk_poi_search *search)
+{
+ GtkTreePath *path;
+ GtkTreeViewColumn *focus_column;
+ GtkTreeIter iter;
+ long int lat, lon;
+ char *label;
+ char *category;
+ char buffer[2000];
+
+ //Get category
+ gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview_cat), &path, &focus_column);
+ if(!path) return;
+ if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_cat_sorted), &iter, path)) return;
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_cat_sorted), &iter, 1, &category, -1);
+
+ //Get label, lat, lon
+ gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview_poi), &path, &focus_column);
+ if(!path) return;
+ if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_poi_sorted), &iter, path)) return;
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 2, &label, -1);
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 3, &lat, -1);
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 4, &lon, -1);
+ sprintf(buffer, _("POI %s. %s"), category, label);
+
+ struct pcoord dest;
+ dest.x=lat;
+ dest.y=lon;
+ dest.pro=1;
+ navit_set_destination(search->nav, &dest, buffer, 1);
+ dbg(1,_("Set destination to %ld, %ld \n"),lat,lon);
+}
+
+/*Function when button map is clicked. It shows the poi position in the map*/
+static void
+button_map_clicked(GtkWidget *widget, struct gtk_poi_search *search)
+{
+ GtkTreePath *path;
+ GtkTreeViewColumn *focus_column;
+ GtkTreeIter iter;
+ long int lat,lon;
+
+ gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview_poi), &path, &focus_column);
+ if(!path) return;
+ if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_poi_sorted), &iter, path)) return;
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 3, &lat, -1);
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 4, &lon, -1);
+
+ struct pcoord dest;
+ dest.x=lat;
+ dest.y=lon;
+ dest.pro=1;
+ navit_set_center(search->nav, &dest,1);
+ dbg(1,_("Set map to %ld, %ld \n"),lat,lon);
+}
+
+/*Function when button visitbefore is clicked. It sets the first visit before of the waypoint when it's clicked*/
+static void
+button_visit_clicked(GtkWidget *widget, struct gtk_poi_search *search)
+{
+ GtkTreePath *path;
+ GtkTreeViewColumn *focus_column;
+ GtkTreeIter iter;
+ long int lat,lon;
+
+ gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview_poi), &path, &focus_column);
+ if(!path) return;
+ if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_poi_sorted), &iter, path)) return;
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 3, &lat, -1);
+ gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 4, &lon, -1);
+ dbg(1,_("Set next visit to %ld, %ld \n"),lat,lon);
+
+ struct pcoord dest;
+ dest.x=lat;
+ dest.y=lon;
+ dest.pro=1;
+ popup_set_visitbefore(search->nav,&dest,0);
+}
+
+/*Create UI and connects objects to functions*/
+void gtk_gui_poi(struct navit *nav)
+{
+ GtkWidget *window2,*vbox, *keyboard, *table;
+ GtkWidget *label_category, *label_poi;
+ GtkWidget *listbox_cat, *listbox_poi;
+ GtkCellRenderer *renderer;
+
+ struct gtk_poi_search *search=>k_poi_search;
+ search->nav=nav;
+
+ window2 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title(GTK_WINDOW(window2),_("Search of POI's"));
+ gtk_window_set_wmclass (GTK_WINDOW (window2), "navit", "Navit");
+ gtk_window_set_default_size (GTK_WINDOW (window2),700,550);
+ vbox = gtk_vbox_new(FALSE, 0);
+ table = gtk_table_new(4, 4, FALSE);
+
+ label_category = gtk_label_new(_("Select a category"));
+ search->label_distance = gtk_label_new(_("Select a distance to look for (Km)"));
+ label_poi=gtk_label_new(_("Select a POI"));
+
+ search->entry_distance=gtk_entry_new_with_max_length(2);
+ gtk_entry_set_text(GTK_ENTRY(search->entry_distance),"10");
+
+ search->treeview_cat=gtk_tree_view_new();
+ listbox_cat = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (listbox_cat), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(listbox_cat),search->treeview_cat);
+ search->store_cat = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
+ renderer=gtk_cell_renderer_pixbuf_new();
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_cat),-1, _(" "), renderer, "pixbuf", 0, NULL);
+ renderer=gtk_cell_renderer_text_new();
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_cat),-1, _("Category"), renderer, "text", 1, NULL);
+ search->store_cat_sorted=gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(search->store_cat));
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(search->store_cat_sorted),1,GTK_SORT_ASCENDING);
+ gtk_tree_view_set_model (GTK_TREE_VIEW (search->treeview_cat), model_cat(search));
+
+ search->treeview_poi=gtk_tree_view_new();
+ listbox_poi = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (listbox_poi), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(listbox_poi),search->treeview_poi);
+ search->store_poi = gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_LONG, G_TYPE_LONG);
+ renderer=gtk_cell_renderer_text_new();
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, " ", renderer, "text",0,NULL);
+ renderer=gtk_cell_renderer_text_new();
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Meters"), renderer, "text", 1, NULL);
+ renderer=gtk_cell_renderer_text_new();
+ gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (search->treeview_poi),-1, _("Name"), renderer, "text", 2, NULL);
+ search->store_poi_sorted=NULL;
+ search->store_poi_sorted=gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(search->store_poi));
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(search->store_poi_sorted),1,GTK_SORT_ASCENDING);
+
+ search->button_visit = gtk_button_new_with_label(_("Visit Before"));
+ search->button_destination = gtk_button_new_with_label(_("Destination"));
+ search->button_map = gtk_button_new_with_label(_("Map"));
+ gtk_widget_set_sensitive(search->button_visit,FALSE);
+ gtk_widget_set_sensitive(search->button_map,FALSE);
+ gtk_widget_set_sensitive(search->button_destination,FALSE);
+
+ gtk_table_attach(GTK_TABLE(table), search->label_distance, 0, 1, 0, 1, 0, GTK_FILL, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), search->entry_distance, 1, 2, 0, 1, 0, GTK_FILL, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), label_category, 0, 1, 2, 3, 0, GTK_FILL, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), listbox_cat, 0, 1, 3, 4, GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), label_poi, 1, 4, 2, 3, 0, GTK_FILL, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), listbox_poi, 1, 4, 3, 4, GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), search->button_map, 0, 1, 4, 5, GTK_FILL, GTK_FILL, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), search->button_visit, 1, 2, 4, 5, GTK_FILL, GTK_FILL, 0, 0);
+ gtk_table_attach(GTK_TABLE(table), search->button_destination, 2, 3, 4, 5, GTK_FILL, GTK_FILL, 0, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
+
+ g_signal_connect(G_OBJECT(search->entry_distance), "changed", G_CALLBACK(treeview_poi_reload), search);
+ g_signal_connect(G_OBJECT(search->button_visit), "clicked", G_CALLBACK(button_visit_clicked), search);
+ g_signal_connect(G_OBJECT(search->button_map), "clicked", G_CALLBACK(button_map_clicked), search);
+ g_signal_connect(G_OBJECT(search->button_destination), "clicked", G_CALLBACK(button_destination_clicked), search);
+ g_signal_connect(G_OBJECT(search->treeview_cat), "cursor_changed", G_CALLBACK(treeview_poi_reload), search);
+ g_signal_connect(G_OBJECT(search->treeview_poi), "cursor_changed", G_CALLBACK(treeview_poi_changed), search);
+
+ keyboard=gtk_socket_new();
+ gtk_box_pack_end(GTK_BOX(vbox), keyboard, FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(window2), vbox);
+ gtk_widget_show_all(window2);
+}
+
Copied: trunk/navit/navit/gui/gtk/gui_gtk_poi.h (from rev 5858, trunk/navit/navit/popup.h)
===================================================================
--- trunk/navit/navit/gui/gtk/gui_gtk_poi.h (rev 0)
+++ trunk/navit/navit/gui/gtk/gui_gtk_poi.h 2014-08-11 21:24:46 UTC (rev 5859)
@@ -0,0 +1,28 @@
+/**
+ * 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 Library 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 Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+#ifndef NAVIT_GTK_POI_H
+#define NAVIT_GTK_POI_H
+
+struct navit;
+struct pcoord;
+void gtk_gui_poi(struct navit *nav);
+
+#endif
+
Modified: trunk/navit/navit/popup.c
===================================================================
--- trunk/navit/navit/popup.c 2014-08-11 21:24:18 UTC (rev 5858)
+++ trunk/navit/navit/popup.c 2014-08-11 21:24:46 UTC (rev 5859)
@@ -135,7 +135,7 @@
}
-static void
+void
popup_set_visitbefore(struct navit *nav, struct pcoord *pc,int visitbefore)
{
struct pcoord *dst;
Modified: trunk/navit/navit/popup.h
===================================================================
--- trunk/navit/navit/popup.h 2014-08-11 21:24:18 UTC (rev 5858)
+++ trunk/navit/navit/popup.h 2014-08-11 21:24:46 UTC (rev 5859)
@@ -22,6 +22,7 @@
struct navit;
struct point;
+struct pcoord;
void popup(struct navit *nav, int button, struct point *p);
-
+void popup_set_visitbefore(struct navit *nav, struct pcoord *pc, int visitbefore);
#endif
Modified: trunk/navit/po/CMakeLists.txt
===================================================================
--- trunk/navit/po/CMakeLists.txt 2014-08-11 21:24:18 UTC (rev 5858)
+++ trunk/navit/po/CMakeLists.txt 2014-08-11 21:24:46 UTC (rev 5859)
@@ -12,6 +12,7 @@
${PROJECT_SOURCE_DIR}/navit/bookmarks.c
${PROJECT_SOURCE_DIR}/navit/gui/gtk/destination.c
${PROJECT_SOURCE_DIR}/navit/gui/gtk/gui_gtk_action.c
+ ${PROJECT_SOURCE_DIR}/navit/gui/gtk/gui_gtk_poi.c
${PROJECT_SOURCE_DIR}/navit/gui/gtk/gui_gtk_statusbar.c
${PROJECT_SOURCE_DIR}/navit/gui/internal/gui_internal.c
${PROJECT_SOURCE_DIR}/navit/gui/internal/gui_internal_bookmark.c
Modified: trunk/navit/po/Makefile.am
===================================================================
--- trunk/navit/po/Makefile.am 2014-08-11 21:24:18 UTC (rev 5858)
+++ trunk/navit/po/Makefile.am 2014-08-11 21:24:46 UTC (rev 5859)
@@ -21,6 +21,7 @@
$(top_srcdir)/navit/country.c \
$(top_srcdir)/navit/gui/gtk/destination.c \
$(top_srcdir)/navit/gui/gtk/gui_gtk_action.c \
+ $(top_srcdir)/navit/gui/gtk/gui_gtk_poi.c \
$(top_srcdir)/navit/gui/gtk/gui_gtk_statusbar.c \
$(top_srcdir)/navit/gui/internal/gui_internal.c \
$(top_srcdir)/navit/gui/internal/gui_internal_bookmark.c \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-08-11 21:24:27
|
Revision: 5858
http://sourceforge.net/p/navit/code/5858
Author: sleske
Date: 2014-08-11 21:24:18 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Refactor:maptool:Remove unused code.
Modified Paths:
--------------
trunk/navit/navit/maptool/maptool.h
trunk/navit/navit/maptool/osm.c
Modified: trunk/navit/navit/maptool/maptool.h
===================================================================
--- trunk/navit/navit/maptool/maptool.h 2014-08-11 20:56:17 UTC (rev 5857)
+++ trunk/navit/navit/maptool/maptool.h 2014-08-11 21:24:18 UTC (rev 5858)
@@ -118,10 +118,7 @@
struct node_item {
unsigned int id;
- char dummy1;
char ref_way;
- char dummy2;
- char dummy3;
struct coord c;
};
Modified: trunk/navit/navit/maptool/osm.c
===================================================================
--- trunk/navit/navit/maptool/osm.c 2014-08-11 20:56:17 UTC (rev 5857)
+++ trunk/navit/navit/maptool/osm.c 2014-08-11 21:24:18 UTC (rev 5858)
@@ -1333,9 +1333,6 @@
current_node=allocate_node_item_in_buffer();
current_node->id=id;
current_node->ref_way=0;
- current_node->dummy1=0;
- current_node->dummy2=0;
- current_node->dummy3=0;
current_node->c.x=lon*6371000.0*M_PI/180;
current_node->c.y=log(tan(M_PI_4+lat*M_PI/360))*6371000.0;
if (! node_hash) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2014-08-11 20:56:27
|
Revision: 5857
http://sourceforge.net/p/navit/code/5857
Author: kazer_
Date: 2014-08-11 20:56:17 +0000 (Mon, 11 Aug 2014)
Log Message:
-----------
Update:Core:Updated French translation from launchpad
Modified Paths:
--------------
trunk/navit/po/fr.po.in
Modified: trunk/navit/po/fr.po.in
===================================================================
--- trunk/navit/po/fr.po.in 2014-08-11 20:05:03 UTC (rev 5856)
+++ trunk/navit/po/fr.po.in 2014-08-11 20:56:17 UTC (rev 5857)
@@ -28,14 +28,14 @@
"Project-Id-Version: navit 0.5.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-08-05 11:04-0700\n"
-"PO-Revision-Date: 2013-12-24 23:29+0000\n"
-"Last-Translator: Jérôme BLUM <Unknown>\n"
+"PO-Revision-Date: 2014-08-11 17:45+0000\n"
+"Last-Translator: KaZeR <Unknown>\n"
"Language-Team: KaZeR <ka...@al...>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Launchpad-Export-Date: 2014-08-08 16:36+0000\n"
+"X-Launchpad-Export-Date: 2014-08-11 19:08+0000\n"
"X-Generator: Launchpad (build 17156)\n"
"Language: \n"
"X-Report-Errors: https://translations.launchpad.net/navit/trunk/+pots/navit\n"
@@ -1361,7 +1361,7 @@
#, c-format
msgid "Error: No configuration found in config file '%s'\n"
-msgstr ""
+msgstr "Erreur: Configuration non trouvée dans le fichier '%s'\n"
msgid ""
"Internal initialization failed, exiting. Check previous error messages.\n"
@@ -1742,7 +1742,7 @@
#. we=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill)
#. gui_internal_widget_append(w, we)
msgid "Latitude Longitude"
-msgstr ""
+msgstr "Latitude Longitude"
msgid "Enter coordinates, for example:"
msgstr "Saisissez les coordonnées, par exemple :"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|