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-05-29 13:35:42
|
Revision: 5781
http://sourceforge.net/p/navit/code/5781
Author: sleske
Date: 2014-05-29 13:35:39 +0000 (Thu, 29 May 2014)
Log Message:
-----------
Refactor:core:Add some Doxygen comments.
Modified Paths:
--------------
trunk/navit/navit/item.h
trunk/navit/navit/map/binfile/binfile.c
trunk/navit/navit/maptool/maptool.h
Modified: trunk/navit/navit/item.h
===================================================================
--- trunk/navit/navit/item.h 2014-05-29 13:35:24 UTC (rev 5780)
+++ trunk/navit/navit/item.h 2014-05-29 13:35:39 UTC (rev 5781)
@@ -89,13 +89,16 @@
#define ITEM_ID_FMT "(0x%x,0x%x)"
#define ITEM_ID_ARGS(x) (x).id_hi,(x).id_lo
+/**
+ * Represents an object on a map, such as a POI, a building, a way or a boundary.
+ */
struct item {
- enum item_type type;
- int id_hi;
- int id_lo;
- struct map *map;
- struct item_methods *meth;
- void *priv_data;
+ enum item_type type; /**< Type of the item.*/
+ int id_hi; /**< First part of the ID of the item (item IDs have two parts).*/
+ int id_lo; /**< Second part of the ID of the item.*/
+ struct map *map; /**< The map this items belongs to.*/
+ struct item_methods *meth; /**< Methods to manipulate this item.*/
+ void *priv_data; /**< Private item data, only used by the map plugin which supplied this item.*/
};
extern struct item_range {
Modified: trunk/navit/navit/map/binfile/binfile.c
===================================================================
--- trunk/navit/navit/map/binfile/binfile.c 2014-05-29 13:35:24 UTC (rev 5780)
+++ trunk/navit/navit/map/binfile/binfile.c 2014-05-29 13:35:39 UTC (rev 5781)
@@ -161,14 +161,14 @@
* when starting a search, and is used for retrieving results.
*/
struct map_search_priv {
- struct map_priv *map;
- struct map_rect_priv *mr;
+ struct map_priv *map; /**< Map to search in. */
+ struct map_rect_priv *mr; /**< Map rectangle to search inside. */
struct map_rect_priv *mr_item;
struct item *item;
- struct attr search;
+ struct attr search; /**< Attribute specifying what to search for. */
struct map_selection ms;
GList *boundaries;
- int partial;
+ int partial; /**< Find partial matches? */
int mode;
struct coord_rect rect_new;
char *parent_name;
Modified: trunk/navit/navit/maptool/maptool.h
===================================================================
--- trunk/navit/navit/maptool/maptool.h 2014-05-29 13:35:24 UTC (rev 5780)
+++ trunk/navit/navit/maptool/maptool.h 2014-05-29 13:35:39 UTC (rev 5781)
@@ -69,10 +69,22 @@
} *tile_head_root;
-
+/**
+ * A map item (street, POI, border etc.) as it is stored in a Navit binfile.
+ * Note that this struct only has fields for the header of the item. The
+ * actual data (coordinates and attributes) is stored in memory after
+ * this struct as two arrays of type struct coord and struct attr_bin
+ * respectively.
+ * See also http://wiki.navit-project.org/index.php/Navit%27s_binary_map_driver .
+ * @see struct coord
+ * @see struct attr_bin
+ */
struct item_bin {
+ /** Length of this item (not including this length field) in 32-bit ints. */
int len;
+ /** Item type. */
enum item_type type;
+ /** Length of the following coordinate array in 32-bit ints. */
int clen;
};
@@ -135,10 +147,16 @@
void free_boundaries(GList *l);
/* buffer.c */
+
+/** A buffer that can be grown as needed. */
struct buffer {
+ /** Number of bytes to extend the buffer by when it must grow. */
int malloced_step;
+ /** Current allocated size (bytes). */
long long malloced;
+ /** Base address of this buffer. */
unsigned char *base;
+ /** Size of currently used part of the buffer. */
long long size;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-05-29 13:35:28
|
Revision: 5780
http://sourceforge.net/p/navit/code/5780
Author: sleske
Date: 2014-05-29 13:35:24 +0000 (Thu, 29 May 2014)
Log Message:
-----------
Fix:maptool:Remove unused switch '--experimental', delete commented-out code.
Modified Paths:
--------------
trunk/navit/navit/maptool/maptool.c
Modified: trunk/navit/navit/maptool/maptool.c
===================================================================
--- trunk/navit/navit/maptool/maptool.c 2014-05-22 07:27:06 UTC (rev 5779)
+++ trunk/navit/navit/maptool/maptool.c 2014-05-29 13:35:24 UTC (rev 5780)
@@ -56,7 +56,6 @@
int unknown_country;
int doway2poi=1;
char ch_suffix[] ="r"; /* Used to make compiler happy due to Bug 35903 in gcc */
-int experimental;
struct buffer node_buffer = {
64*1024*1024,
@@ -88,9 +87,6 @@
long mem=(long)sbrk(0)-start_brk;
fprintf(stderr," %ld MB",mem/1024/1024);
#endif
-#if 0
- system("grep -i VmRSS /proc/$PPID/status");
-#endif
}
void
@@ -161,7 +157,6 @@
fprintf(f,"-d (--db) <conn. string> : get osm data out of a postgresql database with osm simple scheme and given connect string\n");
#endif
fprintf(f,"-e (--end) <phase> : end at specified phase\n");
- fprintf(f,"-E (--experimental) : Enable experimental features\n");
fprintf(f,"-i (--input-file) <file> : specify the input file name (OSM), overrules default stdin\n");
fprintf(f,"-k (--keep-tmpfiles) : do not delete tmp files after processing. useful to reuse them\n\n");
fprintf(f,"-M (--o5m) : input file os o5m\n");
@@ -240,7 +235,6 @@
{"dump", 0, 0, 'D'},
{"dump-coordinates", 0, 0, 'c'},
{"end", 1, 0, 'e'},
- {"experimental", 0, 0, 'E'},
{"help", 0, 0, 'h'},
{"keep-tmpfiles", 0, 0, 'k'},
{"nodes-only", 0, 0, 'N'},
@@ -280,9 +274,6 @@
case 'D':
p->output=1;
break;
- case 'E':
- experimental=1;
- break;
case 'M':
p->o5m=1;
break;
@@ -781,17 +772,8 @@
int main(int argc, char **argv)
{
-#if 0
- FILE *files[10];
- FILE *references[10];
-#endif
struct maptool_params p;
-#if 0
- char *suffixes[]={"m0l0", "m0l1","m0l2","m0l3","m0l4","m0l5","m0l6"};
- char *suffixes[]={"m","r"};
-#else
char *suffixes[]={""};
-#endif
char *suffix=suffixes[0];
char *filenames[20];
char *referencenames[20];
@@ -838,12 +820,6 @@
exit(0);
}
}
-#if 1
- if (experimental) {
- fprintf(stderr,"No experimental features available\n");
- exit(0);
- }
-#endif
if (optind != argc-(p.output == 1 ? 0:1))
usage(stderr);
p.result=argv[optind];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <xen...@us...> - 2014-05-22 07:27:11
|
Revision: 5779
http://sourceforge.net/p/navit/code/5779
Author: xenos1984
Date: 2014-05-22 07:27:06 +0000 (Thu, 22 May 2014)
Log Message:
-----------
Fix:graphics_sdl:Reverted undefining SDL_IMAGE from SVN 5567 as it probably killed icon display on TomTom platforms.
Modified Paths:
--------------
trunk/navit/navit/graphics/sdl/graphics_sdl.c
Modified: trunk/navit/navit/graphics/sdl/graphics_sdl.c
===================================================================
--- trunk/navit/navit/graphics/sdl/graphics_sdl.c 2014-05-19 21:06:25 UTC (rev 5778)
+++ trunk/navit/navit/graphics/sdl/graphics_sdl.c 2014-05-22 07:27:06 UTC (rev 5779)
@@ -49,6 +49,7 @@
#undef SDL_GFX
#undef ALPHA
+#define SDL_IMAGE
#undef LINUX_TOUCHSCREEN
#ifdef USE_WEBOS
@@ -887,7 +888,7 @@
int i, x, y, stride;
struct font_freetype_glyph *g, **gp;
struct color transparent = { 0x0000, 0x0000, 0x0000, 0x0000 };
- struct color black = { fg->fore_r * 255, fg->fore_g * 255,
+ struct color black = { fg->fore_r * 255, fg->fore_g * 255,
fg->fore_b * 255, fg->fore_a * 255 };
struct color white = { 0xffff, 0xffff, 0xffff, 0xffff };
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-19 21:06:32
|
Revision: 5778
http://sourceforge.net/p/navit/code/5778
Author: mdankov
Date: 2014-05-19 21:06:25 +0000 (Mon, 19 May 2014)
Log Message:
-----------
Add:graphics_win32:Allow to set initial window position with x and y attributes of <graphics> element. Accept "frame" attribute to manage presence of window frame (border). Fixes #1212.
Modified Paths:
--------------
trunk/navit/navit/graphics/win32/graphics_win32.c
Modified: trunk/navit/navit/graphics/win32/graphics_win32.c
===================================================================
--- trunk/navit/navit/graphics/win32/graphics_win32.c 2014-05-12 20:35:09 UTC (rev 5777)
+++ trunk/navit/navit/graphics/win32/graphics_win32.c 2014-05-19 21:06:25 UTC (rev 5778)
@@ -63,8 +63,11 @@
struct navit *nav;
struct window window;
struct point p;
+ int x;
+ int y;
int width;
int height;
+ int frame;
int disabled;
HANDLE wnd_parent_handle;
HANDLE wnd_handle;
@@ -690,11 +693,16 @@
return NULL;
}
- if ( hMenu )
+ if(gr->frame)
{
- wStyle = WS_CHILD;
- } else {
- wStyle = WS_OVERLAPPED|WS_VISIBLE;
+ if ( hMenu )
+ {
+ wStyle = WS_CHILD;
+ } else {
+ wStyle = WS_OVERLAPPED|WS_VISIBLE;
+ }
+ } else {
+ wStyle = WS_VISIBLE | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
}
#ifdef HAVE_API_WIN32_CE
@@ -713,8 +721,8 @@
g_hwnd = hwnd = CreateWindow(g_szClassName,
TEXT("Navit"),
wStyle,
- 0,
- 0,
+ gr->x,
+ gr->y,
gr->width,
gr->height,
gr->wnd_parent_handle,
@@ -1644,6 +1652,15 @@
return NULL;
this_=graphics_win32_new_helper(meth);
this_->nav=nav;
+ this_->frame=1;
+ if ((attr=attr_search(attrs, NULL, attr_frame)))
+ this_->frame=attr->u.num;
+ this_->x=0;
+ if ((attr=attr_search(attrs, NULL, attr_x)))
+ this_->x=attr->u.num;
+ this_->y=0;
+ if ((attr=attr_search(attrs, NULL, attr_y)))
+ this_->y=attr->u.num;
this_->width=792;
if ((attr=attr_search(attrs, NULL, attr_w)))
this_->width=attr->u.num;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-12 20:35:12
|
Revision: 5777
http://sourceforge.net/p/navit/code/5777
Author: mdankov
Date: 2014-05-12 20:35:09 +0000 (Mon, 12 May 2014)
Log Message:
-----------
Fix:graphics_win32:Do not attempt to draw text glow (and crash) if text background pointer passed is NULL
Modified Paths:
--------------
trunk/navit/navit/graphics/win32/graphics_win32.c
Modified: trunk/navit/navit/graphics/win32/graphics_win32.c
===================================================================
--- trunk/navit/navit/graphics/win32/graphics_win32.c 2014-05-10 19:44:15 UTC (rev 5776)
+++ trunk/navit/navit/graphics/win32/graphics_win32.c 2014-05-12 20:35:09 UTC (rev 5777)
@@ -1065,7 +1065,7 @@
&utf16p, utf16p+sizeof(utf16),
lenientConversion) == conversionOK)
{
- if(bg->fg_alpha) {
+ if(bg && bg->fg_alpha) {
SetTextColor(gr->hMemDC, bg->fg_color);
ExtTextOutW(gr->hMemDC, -1, -1, 0, NULL,
utf16, (wchar_t*) utf16p - utf16, NULL);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-10 19:44:19
|
Revision: 5776
http://sourceforge.net/p/navit/code/5776
Author: mdankov
Date: 2014-05-10 19:44:15 +0000 (Sat, 10 May 2014)
Log Message:
-----------
Add:graphics_win32:Glow around text to improve readability.
Modified Paths:
--------------
trunk/navit/navit/graphics/win32/graphics_win32.c
Modified: trunk/navit/navit/graphics/win32/graphics_win32.c
===================================================================
--- trunk/navit/navit/graphics/win32/graphics_win32.c 2014-05-10 13:41:13 UTC (rev 5775)
+++ trunk/navit/navit/graphics/win32/graphics_win32.c 2014-05-10 19:44:15 UTC (rev 5776)
@@ -241,6 +241,7 @@
int line_width;
COLORREF fg_color;
int fg_alpha;
+ int bg_alpha;
COLORREF bg_color;
int dashed;
HPEN hpen;
@@ -800,6 +801,7 @@
static void gc_set_background(struct graphics_gc_priv *gc, struct color *c)
{
gc->bg_color = RGB( c->r >> 8, c->g >> 8, c->b >> 8);
+ gc->bg_alpha = c->a;
if ( gc->gr && gc->gr->hMemDC )
SetBkColor( gc->gr->hMemDC, gc->bg_color );
@@ -823,6 +825,8 @@
gc->line_width = 1;
gc->fg_color = RGB( 0,0,0 );
gc->bg_color = RGB( 255,255,255 );
+ gc->fg_alpha = 65535;
+ gc->bg_alpha = 0;
gc->dashed=0;
gc->hpen = CreatePen( PS_SOLID, gc->line_width, gc->fg_color );
gc->hbrush = CreateSolidBrush( gc->fg_color );
@@ -1026,7 +1030,6 @@
GetClientRect( gr->wnd_handle, &rcClient );
- SetTextColor(gr->hMemDC, fg->fg_color);
prevBkMode = SetBkMode( gr->hMemDC, TRANSPARENT );
if ( NULL == font->hfont )
@@ -1062,8 +1065,20 @@
&utf16p, utf16p+sizeof(utf16),
lenientConversion) == conversionOK)
{
+ if(bg->fg_alpha) {
+ SetTextColor(gr->hMemDC, bg->fg_color);
+ ExtTextOutW(gr->hMemDC, -1, -1, 0, NULL,
+ utf16, (wchar_t*) utf16p - utf16, NULL);
+ ExtTextOutW(gr->hMemDC, 1, 1, 0, NULL,
+ utf16, (wchar_t*) utf16p - utf16, NULL);
+ ExtTextOutW(gr->hMemDC, -1, 1, 0, NULL,
+ utf16, (wchar_t*) utf16p - utf16, NULL);
+ ExtTextOutW(gr->hMemDC, 1, -1, 0, NULL,
+ utf16, (wchar_t*) utf16p - utf16, NULL);
+ }
+ SetTextColor(gr->hMemDC, fg->fg_color);
ExtTextOutW(gr->hMemDC, 0, 0, 0, NULL,
- utf16, (wchar_t*) utf16p - utf16, NULL);
+ utf16, (wchar_t*) utf16p - utf16, NULL);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-10 13:41:17
|
Revision: 5775
http://sourceforge.net/p/navit/code/5775
Author: mdankov
Date: 2014-05-10 13:41:13 +0000 (Sat, 10 May 2014)
Log Message:
-----------
Add:graphics_win32:Initial support for dashed lines (with fixed system defined dash length)
Modified Paths:
--------------
trunk/navit/navit/graphics/win32/graphics_win32.c
Modified: trunk/navit/navit/graphics/win32/graphics_win32.c
===================================================================
--- trunk/navit/navit/graphics/win32/graphics_win32.c 2014-05-09 22:29:10 UTC (rev 5774)
+++ trunk/navit/navit/graphics/win32/graphics_win32.c 2014-05-10 13:41:13 UTC (rev 5775)
@@ -242,6 +242,7 @@
COLORREF fg_color;
int fg_alpha;
COLORREF bg_color;
+ int dashed;
HPEN hpen;
HBRUSH hbrush;
struct graphics_priv *gr;
@@ -767,11 +768,14 @@
{
DeleteObject (gc->hpen);
gc->line_width = w;
- gc->hpen = CreatePen( PS_SOLID, gc->line_width, gc->fg_color );
+ gc->hpen = CreatePen(gc->dashed?PS_DASH:PS_SOLID, gc->line_width, gc->fg_color );
}
static void gc_set_dashes(struct graphics_gc_priv *gc, int width, int offset, unsigned char dash_list[], int n)
{
+ gc->dashed=n>0;
+ DeleteObject (gc->hpen);
+ gc->hpen = CreatePen(gc->dashed?PS_DASH:PS_SOLID, gc->line_width, gc->fg_color );
// gdk_gc_set_dashes(gc->gc, 0, (gint8 *)dash_list, n);
// gdk_gc_set_line_attributes(gc->gc, 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_ROUND, GDK_JOIN_ROUND);
}
@@ -784,7 +788,7 @@
DeleteObject (gc->hpen);
DeleteObject (gc->hbrush);
- gc->hpen = CreatePen( PS_SOLID, gc->line_width, gc->fg_color );
+ gc->hpen = CreatePen(gc->dashed?PS_DASH:PS_SOLID, gc->line_width, gc->fg_color );
gc->hbrush = CreateSolidBrush( gc->fg_color );
if ( gc->gr && c->a < 0xFFFF )
{
@@ -819,6 +823,7 @@
gc->line_width = 1;
gc->fg_color = RGB( 0,0,0 );
gc->bg_color = RGB( 255,255,255 );
+ gc->dashed=0;
gc->hpen = CreatePen( PS_SOLID, gc->line_width, gc->fg_color );
gc->hbrush = CreateSolidBrush( gc->fg_color );
gc->gr = gr;
@@ -831,6 +836,7 @@
int i;
HPEN hpenold = SelectObject( gr->hMemDC, gc->hpen );
+ int oldbkmode=SetBkMode( gr->hMemDC, TRANSPARENT);
int first = 1;
for ( i = 0; i< count; i++ )
@@ -845,7 +851,7 @@
LineTo( gr->hMemDC, p[i].x, p[i].y );
}
}
-
+ SetBkMode( gr->hMemDC, oldbkmode);
SelectObject( gr->hMemDC, hpenold);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-09 22:29:13
|
Revision: 5774
http://sourceforge.net/p/navit/code/5774
Author: mdankov
Date: 2014-05-09 22:29:10 +0000 (Fri, 09 May 2014)
Log Message:
-----------
Add:graphics_android:Support dashed lines
Modified Paths:
--------------
trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
trunk/navit/navit/graphics/android/graphics_android.c
Modified: trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
===================================================================
--- trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2014-05-09 21:16:33 UTC (rev 5773)
+++ trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2014-05-09 22:29:10 UTC (rev 5774)
@@ -823,20 +823,34 @@
protected void draw_polyline(Paint paint, int c[])
{
+ int i, ndashes;
+ float [] intervals;
// Log.e("NavitGraphics","draw_polyline");
paint.setStrokeWidth(c[0]);
paint.setARGB(c[1],c[2],c[3],c[4]);
paint.setStyle(Paint.Style.STROKE);
//paint.setAntiAlias(true);
//paint.setStrokeWidth(0);
+ ndashes=c[5];
+ intervals=new float[ndashes+(ndashes%2)];
+ for (i = 0; i < ndashes; i++)
+ intervals[i]=c[6+i];
+
+ if((ndashes%2)==1)
+ intervals[ndashes]=intervals[ndashes-1];
+
+ if(ndashes>0)
+ paint.setPathEffect(new android.graphics.DashPathEffect(intervals,0.0f));
+
Path path = new Path();
- path.moveTo(c[5], c[6]);
- for (int i = 7; i < c.length; i += 2)
+ path.moveTo(c[6+ndashes], c[7+ndashes]);
+ for (i = 8+ndashes; i < c.length; i += 2)
{
path.lineTo(c[i], c[i + 1]);
}
//global_path.close();
draw_canvas.drawPath(path, paint);
+ paint.setPathEffect(null);
}
protected void draw_polygon(Paint paint, int c[])
Modified: trunk/navit/navit/graphics/android/graphics_android.c
===================================================================
--- trunk/navit/navit/graphics/android/graphics_android.c 2014-05-09 21:16:33 UTC (rev 5773)
+++ trunk/navit/navit/graphics/android/graphics_android.c 2014-05-09 22:29:10 UTC (rev 5774)
@@ -71,6 +71,8 @@
int linewidth;
enum draw_mode_num mode;
int a,r,g,b;
+ unsigned char *dashes;
+ int ndashes;
};
struct graphics_image_priv {
@@ -142,6 +144,7 @@
static void
gc_destroy(struct graphics_gc_priv *gc)
{
+ g_free(gc->dashes);
g_free(gc);
}
@@ -154,6 +157,14 @@
static void
gc_set_dashes(struct graphics_gc_priv *gc, int w, int offset, unsigned char *dash_list, int n)
{
+ g_free(gc->dashes);
+ gc->ndashes=n;
+ if(n) {
+ gc->dashes=g_malloc(n);
+ memcpy(gc->dashes, dash_list, n);
+ } else {
+ gc->dashes=NULL;
+ }
}
static void
@@ -267,22 +278,26 @@
static void
draw_lines(struct graphics_priv *gra, struct graphics_gc_priv *gc, struct point *p, int count)
{
- int arrsize=1+4+count*2;
+ int arrsize=1+4+1+gc->ndashes+count*2;
jint pc[arrsize];
int i;
jintArray points;
if (count <= 0)
return;
points = (*jnienv)->NewIntArray(jnienv,arrsize);
- for (i = 0 ; i < count ; i++) {
- pc[5+i*2]=p[i].x;
- pc[5+i*2+1]=p[i].y;
- }
pc[0]=gc->linewidth;
pc[1]=gc->a;
pc[2]=gc->r;
pc[3]=gc->g;
pc[4]=gc->b;
+ pc[5]=gc->ndashes;
+ for (i = 0 ; i < gc->ndashes ; i++) {
+ pc[6+i] = gc->dashes[i];
+ }
+ for (i = 0 ; i < count ; i++) {
+ pc[6+gc->ndashes+i*2]=p[i].x;
+ pc[6+gc->ndashes+i*2+1]=p[i].y;
+ }
(*jnienv)->SetIntArrayRegion(jnienv, points, 0, arrsize, pc);
(*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_polyline, gc->gra->Paint, points);
(*jnienv)->DeleteLocalRef(jnienv, points);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-09 21:16:34
|
Revision: 5773
http://sourceforge.net/p/navit/code/5773
Author: mdankov
Date: 2014-05-09 21:16:33 +0000 (Fri, 09 May 2014)
Log Message:
-----------
Fix:core:Do not include wide dashed lines in default layouts because we support only width=1 for dashed lines.
Modified Paths:
--------------
trunk/navit/navit/navit_shipped.xml
Modified: trunk/navit/navit/navit_shipped.xml
===================================================================
--- trunk/navit/navit/navit_shipped.xml 2014-05-05 20:30:52 UTC (rev 5772)
+++ trunk/navit/navit/navit_shipped.xml 2014-05-09 21:16:33 UTC (rev 5773)
@@ -1111,16 +1111,16 @@
<polyline color="#800000" width="1" dash="3,6"/>
</itemgra>
<itemgra item_types="track_gravelled,track_grass" order="13-14">
- <polyline color="#ffffff" width="4" dash="4,8"/>
- <polyline color="#800000" width="2" dash="4,8"/>
+ <polyline color="#ffffff" width="4"/>
+ <polyline color="#800000" width="1" dash="4,8"/>
</itemgra>
<itemgra item_types="track_gravelled,track_grass" order="15-16">
- <polyline color="#ffffff" width="5" dash="5,10"/>
- <polyline color="#800000" width="3" dash="5,10"/>
+ <polyline color="#ffffff" width="5"/>
+ <polyline color="#800000" width="1" dash="5,10"/>
</itemgra>
<itemgra item_types="track_gravelled,track_grass" order="17-">
- <polyline color="#ffffff" width="7" dash="7,15"/>
- <polyline color="#800000" width="5" dash="7,15"/>
+ <polyline color="#ffffff" width="7"/>
+ <polyline color="#800000" width="1" dash="7,15"/>
</itemgra>
<itemgra item_types="track_unpaved,track_ground,path,hiking,hiking_mountain,hiking_mountain_demanding,hiking_alpine,hiking_alpine_demanding,hiking_alpine_difficult" order="10-">
<polyline color="#000000" width="1"/>
@@ -1216,50 +1216,50 @@
<polyline color="#0000ff" width="1" dash="3,6" offset="4"/>
</itemgra>
<itemgra item_types="piste_nordic" order="13-14">
- <polyline color="#ffffff" width="4" dash="4,8" offset="6"/>
- <polyline color="#0000ff" width="2" dash="4,8" offset="6"/>
+ <polyline color="#ffffff" width="4" offset="6"/>
+ <polyline color="#0000ff" width="1" dash="4,8" offset="6"/>
</itemgra>
<itemgra item_types="piste_nordic" order="15-16">
- <polyline color="#ffffff" width="5" dash="5,10" offset="7"/>
- <polyline color="#0000ff" width="3" dash="5,10" offset="7"/>
+ <polyline color="#ffffff" width="5" offset="7"/>
+ <polyline color="#0000ff" width="1" dash="5,10" offset="7"/>
</itemgra>
<itemgra item_types="piste_nordic" order="17-">
- <polyline color="#ffffff" width="7" dash="7,15" offset="10"/>
- <polyline color="#0000ff" width="5" dash="7,15" offset="10"/>
+ <polyline color="#ffffff" width="7" offset="10"/>
+ <polyline color="#0000ff" width="1" dash="7,15" offset="10"/>
</itemgra>
<itemgra item_types="footway_and_piste_nordic" order="10-12">
<polyline color="#ff0000" width="1" dash="3,15"/>
<polyline color="#0000ff" width="1" dash="3,15" offset="9"/>
</itemgra>
<itemgra item_types="footway_and_piste_nordic" order="13-14">
- <polyline color="#ffffff" width="4" dash="4,8"/>
- <polyline color="#ff0000" width="2" dash="4,20"/>
- <polyline color="#0000ff" width="2" dash="4,20" offset="12"/>
+ <polyline color="#ffffff" width="4"/>
+ <polyline color="#ff0000" width="2"/>
+ <polyline color="#0000ff" width="1" dash="4,20" offset="12"/>
</itemgra>
<itemgra item_types="footway_and_piste_nordic" order="15-16">
- <polyline color="#ffffff" width="5" dash="5,10"/>
- <polyline color="#ff0000" width="3" dash="5,25"/>
- <polyline color="#0000ff" width="3" dash="5,25" offset="15"/>
+ <polyline color="#ffffff" width="5"/>
+ <polyline color="#ff0000" width="3"/>
+ <polyline color="#0000ff" width="1" dash="5,25" offset="15"/>
</itemgra>
<itemgra item_types="footway_and_piste_nordic" order="17-">
- <polyline color="#ffffff" width="7" dash="7,15"/>
- <polyline color="#ff0000" width="5" dash="7,37"/>
- <polyline color="#0000ff" width="5" dash="7,37" offset="22"/>
+ <polyline color="#ffffff" width="7"/>
+ <polyline color="#ff0000" width="5"/>
+ <polyline color="#0000ff" width="1" dash="7,37" offset="22"/>
</itemgra>
<itemgra item_types="footway" order="10-12">
<polyline color="#ff0000" width="1" dash="3,6"/>
</itemgra>
<itemgra item_types="footway" order="13-14">
- <polyline color="#ffffff" width="4" dash="4,8"/>
- <polyline color="#ff0000" width="2" dash="4,8"/>
+ <polyline color="#ffffff" width="4"/>
+ <polyline color="#ff0000" width="1" dash="4,8"/>
</itemgra>
<itemgra item_types="footway" order="15-16">
- <polyline color="#ffffff" width="5" dash="5,10"/>
- <polyline color="#ff0000" width="3" dash="5,10"/>
+ <polyline color="#ffffff" width="5"/>
+ <polyline color="#ff0000" width="1" dash="5,10"/>
</itemgra>
<itemgra item_types="footway" order="17-">
- <polyline color="#ffffff" width="7" dash="7,15"/>
- <polyline color="#ff0000" width="5" dash="7,15"/>
+ <polyline color="#ffffff" width="7"/>
+ <polyline color="#ff0000" width="1" dash="7,15"/>
</itemgra>
<itemgra item_types="steps" order="10-">
<polyline color="#000000" width="1"/>
@@ -2690,11 +2690,11 @@
</itemgra>
<itemgra item_types="rail" order="6-8">
<polyline color="#282828" width="2"/>
- <polyline color="#3d3d3d" dash="1,5" width="2"/>
+ <polyline color="#3d3d3d" dash="1,5" width="1"/>
</itemgra>
<itemgra item_types="rail" order="9-">
<polyline color="#282828" width="3"/>
- <polyline color="#3d3d3d" dash="1,5" width="2"/>
+ <polyline color="#3d3d3d" dash="1,5" width="1"/>
</itemgra>
<itemgra item_types="ferry" order="5-">
<polyline color="#113111" width="1" dash="10"/>
@@ -2762,16 +2762,16 @@
<polyline color="#800000" width="1" dash="3,6"/>
</itemgra>
<itemgra item_types="track_gravelled" order="13-14">
- <polyline color="#3d3d3d" width="4" dash="4,8"/>
- <polyline color="#800000" width="2" dash="4,8"/>
+ <polyline color="#3d3d3d" width="4"/>
+ <polyline color="#800000" width="1" dash="4,8"/>
</itemgra>
<itemgra item_types="track_gravelled" order="15-16">
- <polyline color="#3d3d3d" width="5" dash="5,10"/>
- <polyline color="#800000" width="3" dash="5,10"/>
+ <polyline color="#3d3d3d" width="5"/>
+ <polyline color="#800000" width="1" dash="5,10"/>
</itemgra>
<itemgra item_types="track_gravelled" order="17-">
- <polyline color="#3d3d3d" width="7" dash="7,15"/>
- <polyline color="#800000" width="5" dash="7,15"/>
+ <polyline color="#3d3d3d" width="7"/>
+ <polyline color="#800000" width="1" dash="7,15"/>
</itemgra>
<itemgra item_types="track_unpaved" order="10-">
<polyline color="#000000" width="1"/>
@@ -2867,25 +2867,31 @@
<polyline color="#0000ff" width="1" dash="3,6"/>
</itemgra>
<itemgra item_types="piste_nordic" order="13-14">
- <polyline color="#0000ff" width="2" dash="4,8"/>
+ <polyline color="#0000ff" width="2"/>
+ <polyline color="#000000" width="1" dash="4,8"/>
</itemgra>
<itemgra item_types="piste_nordic" order="15-16">
- <polyline color="#0000ff" width="3" dash="5,10"/>
+ <polyline color="#0000ff" width="3"/>
+ <polyline color="#000000" width="1" dash="5,10"/>
</itemgra>
<itemgra item_types="piste_nordic" order="17-">
- <polyline color="#0000ff" width="5" dash="7,15"/>
+ <polyline color="#0000ff" width="5"/>
+ <polyline color="#000000" width="1" dash="7,15"/>
</itemgra>
<itemgra item_types="footway" order="11-12">
<polyline color="#4e0000" width="1" dash="3,6"/>
</itemgra>
<itemgra item_types="footway" order="13-14">
- <polyline color="#4e0000" width="2" dash="4,8"/>
+ <polyline color="#4e0000" width="2"/>
+ <polyline color="#000000" width="1" dash="4,8"/>
</itemgra>
<itemgra item_types="footway" order="15-16">
- <polyline color="#4e0000" width="3" dash="5,10"/>
+ <polyline color="#4e0000" width="3"/>
+ <polyline color="#000000" width="1" dash="5,10"/>
</itemgra>
<itemgra item_types="footway" order="17-">
- <polyline color="#4e0000" width="5" dash="7,15"/>
+ <polyline color="#4e0000" width="5"/>
+ <polyline color="#000000" width="1" dash="7,15"/>
</itemgra>
<itemgra item_types="steps" order="14-15">
<polyline color="#4d4e11" width="1"/>
@@ -4168,16 +4174,16 @@
<polyline color="#000000" width="1" />
</itemgra>
<itemgra item_types="track_gravelled" order="14">
- <polyline color="#ffffff" width="4" dash="4,8" />
- <polyline color="#800000" width="2" dash="4,8" />
+ <polyline color="#ffffff" width="4"/>
+ <polyline color="#800000" width="1" dash="4,8" />
</itemgra>
<itemgra item_types="track_gravelled" order="15-16">
- <polyline color="#ffffff" width="5" dash="5,10" />
- <polyline color="#800000" width="3" dash="5,10" />
+ <polyline color="#ffffff" width="5"/>
+ <polyline color="#800000" width="1" dash="5,10" />
</itemgra>
<itemgra item_types="track_gravelled" order="17-">
- <polyline color="#ffffff" width="7" dash="7,15" />
- <polyline color="#800000" width="5" dash="7,15" />
+ <polyline color="#ffffff" width="7"/>
+ <polyline color="#800000" width="1" dash="7,15" />
</itemgra>
<itemgra item_types="track_unpaved" order="14-">
<polyline color="#000000" width="1" />
@@ -4198,12 +4204,12 @@
<polyline color="#696969" width="1" dash="5" />
</itemgra>
<itemgra item_types="footway" order="15-16">
- <polyline color="#ffffff" width="5" dash="5,10" />
- <polyline color="#ff0000" width="3" dash="5,10" />
+ <polyline color="#ffffff" width="5"/>
+ <polyline color="#ff0000" width="1" dash="5,10" />
</itemgra>
<itemgra item_types="footway" order="17-">
- <polyline color="#ffffff" width="7" dash="7,15" />
- <polyline color="#ff0000" width="5" dash="7,15" />
+ <polyline color="#ffffff" width="7"/>
+ <polyline color="#ff0000" width="1" dash="7,15" />
</itemgra>
<itemgra item_types="steps" order="15-">
<polyline color="#000000" width="1" />
@@ -5618,22 +5624,28 @@
</layer>
<layer name="Borders">
<itemgra item_types="border_state" order="0-5">
- <polyline color="#778899" dash="3,2,1,3" width="3"/>
+ <polyline color="#778899" width="3"/>
+ <polyline color="#ffefb7" dash="3,2,1,3" width="1"/>
</itemgra>
<itemgra item_types="border_country" order="0-5">
- <polyline color="#778899" dash="3,2,1,3" width="2"/>
+ <polyline color="#778899" width="2"/>
+ <polyline color="#ffefb7" dash="3,2,1,3" width="1"/>
</itemgra>
<itemgra item_types="border_state" order="6-11">
- <polyline color="#778899" dash="6,6,1,6" width="3"/>
+ <polyline color="#778899" width="3"/>
+ <polyline color="#ffefb7" dash="6,6,1,6" width="1"/>
</itemgra>
<itemgra item_types="border_country" order="6-11">
- <polyline color="#778899" dash="6,6,1,6" width="2"/>
+ <polyline color="#778899" width="2"/>
+ <polyline color="#ffefb7" dash="6,6,1,6" width="1"/>
</itemgra>
<itemgra item_types="border_state" order="12-20">
- <polyline color="#778899" dash="10,10,2,10" width="3"/>
+ <polyline color="#778899" width="3"/>
+ <polyline color="#ffefb7" dash="10,10,2,10" width="1"/>
</itemgra>
<itemgra item_types="border_country" order="12-20">
- <polyline color="#778899" dash="10,10,2,10" width="2"/>
+ <polyline color="#778899" width="2"/>
+ <polyline color="#ffefb7" dash="10,10,2,10" width="1"/>
</itemgra>
</layer>
<layer name="Current Route">
@@ -5698,11 +5710,12 @@
<polyline color="#fefefe" width="1"/>
</itemgra>
<itemgra item_types="track_ground" order="11-">
- <polyline color="#d2d2d2" width="3" dash="6,6"/>
+ <polyline color="#d2d2d2" width="3"/>
<polyline color="#fefefe" width="1" dash="6,6"/>
</itemgra>
<itemgra item_types="track_grass" order="12-">
- <polyline color="#fefefe" width="2" dash="6,6"/>
+ <polyline color="#fefefe" width="2"/>
+ <polyline color="#ffefb7" width="1" dash="6,6"/>
</itemgra>
<itemgra item_types="bridleway" order="10-">
<polyline color="#8b4513" width="3"/>
@@ -5721,16 +5734,20 @@
<polyline color="#F4A460" width="1" dash="6,4"/>
</itemgra>
<itemgra item_types="path" order="11-">
- <polyline color="#8b4513" width="3" dash="2,4"/>
+ <polyline color="#8b4513" width="3"/>
+ <polyline color="#ffefb7" width="1" dash="2,4"/>
</itemgra>
<itemgra item_types="hiking" order="11-">
- <polyline color="#8b4513" width="2" dash="4,4"/>
+ <polyline color="#8b4513" width="2"/>
+ <polyline color="#ffefb7" width="1" dash="4,4"/>
</itemgra>
<itemgra item_types="hiking_mountain" order="11-">
- <polyline color="#8b4513" width="2" dash="6,4"/>
+ <polyline color="#8b4513" width="2"/>
+ <polyline color="#ffefb7" width="1" dash="6,4"/>
</itemgra>
<itemgra item_types="hiking_mountain_demanding" order="13-">
- <polyline color="#8b4513" width="2" dash="8,4"/>
+ <polyline color="#8b4513" width="2"/>
+ <polyline color="#ffefb7" width="1" dash="8,4"/>
</itemgra>
<itemgra item_types="hiking_alpine" order="13-">
<polyline color="#8b4513" width="1" dash="10,4"/>
@@ -6170,39 +6187,39 @@
<layer name="Railways">
<itemgra item_types="rail" order="6-9">
<polyline color="#696969" width="4"/>
- <polyline color="#FFFFFF" dash="2,5" width="2"/>
+ <polyline color="#FFFFFF" dash="2,5" width="1"/>
</itemgra>
<itemgra item_types="rail_narrow_gauge" order="6-9">
<polyline color="#696969" width="4"/>
- <polyline color="#FFFFFF" dash="2,5" width="2"/>
+ <polyline color="#FFFFFF" dash="2,5" width="1"/>
</itemgra>
<itemgra item_types="rail" order="10-13">
<polyline color="#696969" width="6"/>
- <polyline color="#FFFFFF" dash="3,8" width="3"/>
+ <polyline color="#FFFFFF" dash="3,8" width="1"/>
</itemgra>
<itemgra item_types="rail_narrow_gauge" order="10-13">
<polyline color="#696969" width="6"/>
- <polyline color="#FFFFFF" dash="3,8" width="3"/>
+ <polyline color="#FFFFFF" dash="3,8" width="1"/>
</itemgra>
<itemgra item_types="rail" order="14-18">
<polyline color="#696969" width="8"/>
- <polyline color="#FFFFFF" dash="4,12" width="5"/>
+ <polyline color="#FFFFFF" dash="4,12" width="1"/>
</itemgra>
<itemgra item_types="rail_narrow_gauge" order="14-18">
<polyline color="#696969" width="8"/>
- <polyline color="#FFFFFF" dash="4,12" width="5"/>
+ <polyline color="#FFFFFF" dash="4,12" width="1"/>
</itemgra>
<itemgra item_types="rail_light" order="10-13">
<polyline color="#696969" width="4"/>
- <polyline color="#FFFFFF" dash="2,5" width="2"/>
+ <polyline color="#FFFFFF" dash="2,5" width="1"/>
</itemgra>
<itemgra item_types="rail_light" order="14-18">
<polyline color="#696969" width="6"/>
- <polyline color="#FFFFFF" dash="4,8" width="4"/>
+ <polyline color="#FFFFFF" dash="4,8" width="1"/>
</itemgra>
<itemgra item_types="rail_subway" order="8-">
<polyline color="#696969" width="2"/>
- <polyline color="#FFFFFF" dash="5,5" width="2"/>
+ <polyline color="#FFFFFF" dash="5,5" width="1"/>
</itemgra>
<itemgra item_types="rail_mono" order="10-">
<polyline color="#696969" width="2"/>
@@ -6220,19 +6237,20 @@
<polyline color="#f5f5f5" width="1" dash="10"/>
</itemgra>
<itemgra item_types="lift_cable_car" order="10-">
- <polyline color="#778899" width="1"/>
- <polyline color="#778899" dash="1,40" width="5"/>
+ <polyline color="#778899" width="5"/>
+ <polyline color="#ffefb7" dash="1,40" width="1"/>
</itemgra>
<itemgra item_types="lift_chair" order="10-">
- <polyline color="#778899" width="1"/>
- <polyline color="#778899" dash="1,40" width="5"/>
+ <polyline color="#778899" width="5"/>
+ <polyline color="#ffefb7" dash="1,40" width="1"/>
</itemgra>
<itemgra item_types="lift_drag" order="10-">
- <polyline color="#778899" width="1"/>
- <polyline color="#778899" dash="1,40" width="5"/>
+ <polyline color="#778899" width="5"/>
+ <polyline color="#ffefb7" dash="1,40" width="1"/>
</itemgra>
<itemgra item_types="ferry" order="5-">
- <polyline color="#000000" width="3" dash="5"/>
+ <polyline color="#000000" width="3"/>
+ <polyline color="#ffefb7" width="1" dash="5"/>
</itemgra>
<itemgra item_types="track" order="3-">
<polyline color="#3f3f3f" width="1"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-05 20:30:55
|
Revision: 5772
http://sourceforge.net/p/navit/code/5772
Author: mdankov
Date: 2014-05-05 20:30:52 +0000 (Mon, 05 May 2014)
Log Message:
-----------
Add:graphics_android:Draw glow around the text to make it more readable
Modified Paths:
--------------
trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
trunk/navit/navit/graphics/android/graphics_android.c
Modified: trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
===================================================================
--- trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2014-05-03 22:10:47 UTC (rev 5771)
+++ trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2014-05-05 20:30:52 UTC (rev 5772)
@@ -874,25 +874,40 @@
paint.setStyle(Paint.Style.STROKE);
draw_canvas.drawCircle(x, y, r / 2, paint);
}
- protected void draw_text(Paint paint, int x, int y, String text, int size, int dx, int dy)
+ protected void draw_text(Paint paint, int x, int y, String text, int size, int dx, int dy, int bgcolor)
{
- // float fx = x;
- // float fy = y;
- //Log.e("NavitGraphics","Text size "+size + " vs " + paint.getTextSize());
+ int oldcolor=paint.getColor();
+ Path path=null;
+
paint.setTextSize(size / 15);
paint.setStyle(Paint.Style.FILL);
- if (dx == 0x10000 && dy == 0)
- {
- draw_canvas.drawText(text, x, y, paint);
- }
- else
- {
- Path path = new Path();
+
+ if (dx != 0x10000 || dy != 0) {
+ path = new Path();
path.moveTo(x, y);
path.rLineTo(dx, dy);
paint.setTextAlign(android.graphics.Paint.Align.LEFT);
+ }
+
+ if(bgcolor!=0) {
+ paint.setStrokeWidth(3);
+ paint.setColor(bgcolor);
+ paint.setStyle(Paint.Style.STROKE);
+ if(path==null) {
+ draw_canvas.drawText(text, x, y, paint);
+ } else {
+ draw_canvas.drawTextOnPath(text, path, 0, 0, paint);
+ }
+ paint.setStyle(Paint.Style.FILL);
+ paint.setColor(oldcolor);
+ }
+
+ if(path==null) {
+ draw_canvas.drawText(text, x, y, paint);
+ } else {
draw_canvas.drawTextOnPath(text, path, 0, 0, paint);
}
+ paint.clearShadowLayer();
}
protected void draw_image(Paint paint, int x, int y, Bitmap bitmap)
{
Modified: trunk/navit/navit/graphics/android/graphics_android.c
===================================================================
--- trunk/navit/navit/graphics/android/graphics_android.c 2014-05-03 22:10:47 UTC (rev 5771)
+++ trunk/navit/navit/graphics/android/graphics_android.c 2014-05-05 20:30:52 UTC (rev 5772)
@@ -330,10 +330,13 @@
static void
draw_text(struct graphics_priv *gra, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy)
{
+ int bgcolor=0;
dbg(1,"enter %s\n", text);
initPaint(gra, fg);
+ if(bg)
+ bgcolor=(bg->a<<24)| (bg->r<<16) | (bg->g<<8) | bg->b;
jstring string = (*jnienv)->NewStringUTF(jnienv, text);
- (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_text, fg->gra->Paint, p->x, p->y, string, font->size, dx, dy);
+ (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_text, fg->gra->Paint, p->x, p->y, string, font->size, dx, dy, bgcolor);
(*jnienv)->DeleteLocalRef(jnienv, string);
}
@@ -615,7 +618,7 @@
return 0;
if (!find_method(ret->NavitGraphicsClass, "draw_circle", "(Landroid/graphics/Paint;III)V", &ret->NavitGraphics_draw_circle))
return 0;
- if (!find_method(ret->NavitGraphicsClass, "draw_text", "(Landroid/graphics/Paint;IILjava/lang/String;III)V", &ret->NavitGraphics_draw_text))
+ if (!find_method(ret->NavitGraphicsClass, "draw_text", "(Landroid/graphics/Paint;IILjava/lang/String;IIII)V", &ret->NavitGraphics_draw_text))
return 0;
if (!find_method(ret->NavitGraphicsClass, "draw_image", "(Landroid/graphics/Paint;IILandroid/graphics/Bitmap;)V", &ret->NavitGraphics_draw_image))
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-03 22:10:48
|
Revision: 5771
http://sourceforge.net/p/navit/code/5771
Author: mdankov
Date: 2014-05-03 22:10:47 +0000 (Sat, 03 May 2014)
Log Message:
-----------
Add:core:Decrease motion timeout when drag_bitmap is enabled to have better response time.
Modified Paths:
--------------
trunk/navit/navit/navit.c
Modified: trunk/navit/navit/navit.c
===================================================================
--- trunk/navit/navit/navit.c 2014-05-02 08:31:23 UTC (rev 5770)
+++ trunk/navit/navit/navit.c 2014-05-03 22:10:47 UTC (rev 5771)
@@ -565,7 +565,7 @@
if (! this_->motion_timeout_callback)
this_->motion_timeout_callback=callback_new_1(callback_cast(navit_motion_timeout), this_);
if (! this_->motion_timeout)
- this_->motion_timeout=event_add_timeout(100, 0, this_->motion_timeout_callback);
+ this_->motion_timeout=event_add_timeout(this_->drag_bitmap?10:100, 0, this_->motion_timeout_callback);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-02 08:31:26
|
Revision: 5770
http://sourceforge.net/p/navit/code/5770
Author: mdankov
Date: 2014-05-02 08:31:23 +0000 (Fri, 02 May 2014)
Log Message:
-----------
Fix:core:Revert 5769 as we already support xpointer attribute for xi:include's which can be used to skip root (or any) node of included file.
Modified Paths:
--------------
trunk/navit/navit/xmlconfig.c
Modified: trunk/navit/navit/xmlconfig.c
===================================================================
--- trunk/navit/navit/xmlconfig.c 2014-05-02 08:15:50 UTC (rev 5769)
+++ trunk/navit/navit/xmlconfig.c 2014-05-02 08:31:23 UTC (rev 5770)
@@ -955,8 +955,6 @@
xinclude(context, xistate->attribute_names, xistate->attribute_values, doc, error);
return;
}
- if(!g_ascii_strcasecmp("xfragment", element_name))
- return;
start_element(context, element_name, xistate->attribute_names, xistate->attribute_values, doc->user_data, error);
doc->active++;
}
@@ -987,7 +985,7 @@
else
doc->last->child=NULL;
if (doc->active > 0) {
- if(!g_ascii_strcasecmp("xi:include", element_name) || !g_ascii_strcasecmp("xfragment", element_name)) {
+ if(!g_ascii_strcasecmp("xi:include", element_name)) {
return;
}
end_element(context, element_name, doc->user_data, error);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-02 08:15:54
|
Revision: 5769
http://sourceforge.net/p/navit/code/5769
Author: mdankov
Date: 2014-05-02 08:15:50 +0000 (Fri, 02 May 2014)
Log Message:
-----------
Add:core:Support (by ignoring) xml element xfragment to be used as root element in xi:include'd files.
Modified Paths:
--------------
trunk/navit/navit/xmlconfig.c
Modified: trunk/navit/navit/xmlconfig.c
===================================================================
--- trunk/navit/navit/xmlconfig.c 2014-05-01 20:37:51 UTC (rev 5768)
+++ trunk/navit/navit/xmlconfig.c 2014-05-02 08:15:50 UTC (rev 5769)
@@ -955,6 +955,8 @@
xinclude(context, xistate->attribute_names, xistate->attribute_values, doc, error);
return;
}
+ if(!g_ascii_strcasecmp("xfragment", element_name))
+ return;
start_element(context, element_name, xistate->attribute_names, xistate->attribute_values, doc->user_data, error);
doc->active++;
}
@@ -985,7 +987,7 @@
else
doc->last->child=NULL;
if (doc->active > 0) {
- if(!g_ascii_strcasecmp("xi:include", element_name)) {
+ if(!g_ascii_strcasecmp("xi:include", element_name) || !g_ascii_strcasecmp("xfragment", element_name)) {
return;
}
end_element(context, element_name, doc->user_data, error);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-05-01 20:37:55
|
Revision: 5768
http://sourceforge.net/p/navit/code/5768
Author: mdankov
Date: 2014-05-01 20:37:51 +0000 (Thu, 01 May 2014)
Log Message:
-----------
Add:port_android:Include drag_bitmap="1" in default config to improve graphics performance | Thank you rd
Modified Paths:
--------------
trunk/navit/navit/xslt/android.xslt
Modified: trunk/navit/navit/xslt/android.xslt
===================================================================
--- trunk/navit/navit/xslt/android.xslt 2014-04-20 14:10:16 UTC (rev 5767)
+++ trunk/navit/navit/xslt/android.xslt 2014-05-01 20:37:51 UTC (rev 5768)
@@ -40,6 +40,7 @@
<xsl:copy-of select="@*"/>
<xsl:attribute name="zoom">32</xsl:attribute>
<xsl:attribute name="timeout">86400</xsl:attribute>
+ <xsl:attribute name="drag_bitmap">1</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-04-20 14:10:22
|
Revision: 5767
http://sourceforge.net/p/navit/code/5767
Author: mdankov
Date: 2014-04-20 14:10:16 +0000 (Sun, 20 Apr 2014)
Log Message:
-----------
Add:graphics_android:Improve map drawing performance (approx. 3x)
Modified Paths:
--------------
trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
trunk/navit/navit/graphics/android/graphics_android.c
Modified: trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
===================================================================
--- trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2014-04-06 11:19:16 UTC (rev 5766)
+++ trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2014-04-20 14:10:16 UTC (rev 5767)
@@ -824,12 +824,14 @@
protected void draw_polyline(Paint paint, int c[])
{
// Log.e("NavitGraphics","draw_polyline");
+ paint.setStrokeWidth(c[0]);
+ paint.setARGB(c[1],c[2],c[3],c[4]);
paint.setStyle(Paint.Style.STROKE);
//paint.setAntiAlias(true);
//paint.setStrokeWidth(0);
Path path = new Path();
- path.moveTo(c[0], c[1]);
- for (int i = 2; i < c.length; i += 2)
+ path.moveTo(c[5], c[6]);
+ for (int i = 7; i < c.length; i += 2)
{
path.lineTo(c[i], c[i + 1]);
}
@@ -840,12 +842,14 @@
protected void draw_polygon(Paint paint, int c[])
{
//Log.e("NavitGraphics","draw_polygon");
+ paint.setStrokeWidth(c[0]);
+ paint.setARGB(c[1],c[2],c[3],c[4]);
paint.setStyle(Paint.Style.FILL);
//paint.setAntiAlias(true);
//paint.setStrokeWidth(0);
Path path = new Path();
- path.moveTo(c[0], c[1]);
- for (int i = 2; i < c.length; i += 2)
+ path.moveTo(c[5], c[6]);
+ for (int i = 7; i < c.length; i += 2)
{
path.lineTo(c[i], c[i + 1]);
}
Modified: trunk/navit/navit/graphics/android/graphics_android.c
===================================================================
--- trunk/navit/navit/graphics/android/graphics_android.c 2014-04-06 11:19:16 UTC (rev 5766)
+++ trunk/navit/navit/graphics/android/graphics_android.c 2014-04-20 14:10:16 UTC (rev 5767)
@@ -267,18 +267,23 @@
static void
draw_lines(struct graphics_priv *gra, struct graphics_gc_priv *gc, struct point *p, int count)
{
- jint pc[count*2];
+ int arrsize=1+4+count*2;
+ jint pc[arrsize];
int i;
jintArray points;
if (count <= 0)
return;
- points = (*jnienv)->NewIntArray(jnienv,count*2);
+ points = (*jnienv)->NewIntArray(jnienv,arrsize);
for (i = 0 ; i < count ; i++) {
- pc[i*2]=p[i].x;
- pc[i*2+1]=p[i].y;
+ pc[5+i*2]=p[i].x;
+ pc[5+i*2+1]=p[i].y;
}
- initPaint(gra, gc);
- (*jnienv)->SetIntArrayRegion(jnienv, points, 0, count*2, pc);
+ pc[0]=gc->linewidth;
+ pc[1]=gc->a;
+ pc[2]=gc->r;
+ pc[3]=gc->g;
+ pc[4]=gc->b;
+ (*jnienv)->SetIntArrayRegion(jnienv, points, 0, arrsize, pc);
(*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_polyline, gc->gra->Paint, points);
(*jnienv)->DeleteLocalRef(jnienv, points);
}
@@ -286,18 +291,23 @@
static void
draw_polygon(struct graphics_priv *gra, struct graphics_gc_priv *gc, struct point *p, int count)
{
- jint pc[count*2];
+ int arrsize=1+4+count*2;
+ jint pc[arrsize];
int i;
jintArray points;
if (count <= 0)
return;
- points = (*jnienv)->NewIntArray(jnienv,count*2);
+ points = (*jnienv)->NewIntArray(jnienv,arrsize);
for (i = 0 ; i < count ; i++) {
- pc[i*2]=p[i].x;
- pc[i*2+1]=p[i].y;
+ pc[5+i*2]=p[i].x;
+ pc[5+i*2+1]=p[i].y;
}
- initPaint(gra, gc);
- (*jnienv)->SetIntArrayRegion(jnienv, points, 0, count*2, pc);
+ pc[0]=gc->linewidth;
+ pc[1]=gc->a;
+ pc[2]=gc->r;
+ pc[3]=gc->g;
+ pc[4]=gc->b;
+ (*jnienv)->SetIntArrayRegion(jnienv, points, 0, arrsize, pc);
(*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_polygon, gc->gra->Paint, points);
(*jnienv)->DeleteLocalRef(jnienv, points);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-04-06 11:19:21
|
Revision: 5766
http://sourceforge.net/p/navit/code/5766
Author: mdankov
Date: 2014-04-06 11:19:16 +0000 (Sun, 06 Apr 2014)
Log Message:
-----------
Fix:maptool:Don't crash when restarted from phase11.
Modified Paths:
--------------
trunk/navit/navit/maptool/tile.c
Modified: trunk/navit/navit/maptool/tile.c
===================================================================
--- trunk/navit/navit/maptool/tile.c 2014-04-01 21:36:51 UTC (rev 5765)
+++ trunk/navit/navit/maptool/tile.c 2014-04-06 11:19:16 UTC (rev 5766)
@@ -519,6 +519,7 @@
printf("syntax error\n");
}
}
+ *last=NULL;
}
void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-04-01 21:37:00
|
Revision: 5765
http://sourceforge.net/p/navit/code/5765
Author: mdankov
Date: 2014-04-01 21:36:51 +0000 (Tue, 01 Apr 2014)
Log Message:
-----------
Fix:map_csv:Default to utf-8 encoding. Use proper encoding to write csv file.
Modified Paths:
--------------
trunk/navit/navit/map/csv/csv.c
Modified: trunk/navit/navit/map/csv/csv.c
===================================================================
--- trunk/navit/navit/map/csv/csv.c 2014-04-01 21:13:06 UTC (rev 5764)
+++ trunk/navit/navit/map/csv/csv.c 2014-04-01 21:36:51 UTC (rev 5765)
@@ -145,10 +145,20 @@
}
++at;
}
- if(fprintf(fp,"%s\n", csv_line)<0) {
+
+ if(m->charset) {
+ tmpstr=g_convert(csv_line, -1,m->charset,"utf-8",NULL,NULL,NULL);
+ if(!tmpstr)
+ dbg(0,"Error converting '%s' to %s\n",csv_line, m->charset);
+ } else
+ tmpstr=csv_line;
+
+ if(tmpstr && fprintf(fp,"%s\n", tmpstr)<0) {
ferr = 1;
}
g_free(csv_line);
+ if(m->charset)
+ g_free(tmpstr);
}
if(fclose(fp)) {
@@ -655,7 +665,7 @@
static struct map_methods map_methods_csv = {
projection_mg,
- "iso8859-1",
+ "utf-8",
map_destroy_csv,
map_rect_new_csv,
map_rect_destroy_csv,
@@ -734,7 +744,6 @@
m->flags=flags->u.num;
*meth = map_methods_csv;
- meth->charset=m->charset;
data=attr_search(attrs, NULL, attr_data);
@@ -752,14 +761,18 @@
/*if column number is wrong skip*/
if((fp=fopen(m->filename,"rt"))) {
const int max_line_len = 256;
- char *line=g_alloca(sizeof(char)*max_line_len);
+ char *linebuf=g_alloca(sizeof(char)*max_line_len);
while(!feof(fp)) {
- if(fgets(line,max_line_len,fp)) {
- char*line2;
- char* delim = ",";
+ if(fgets(linebuf,max_line_len,fp)) {
+ char *line=g_convert(linebuf, -1,"utf-8",m->charset,NULL,NULL,NULL);
+ char *line2=NULL;
+ char *delim = ",";
int col_cnt=0;
- char*tok;
-
+ char *tok;
+ if(!line) {
+ dbg(0,"Error converting '%s' to utf-8 from %s\n",linebuf, m->charset);
+ continue;
+ }
if(line[strlen(line)-1]=='\n' || line[strlen(line)-1]=='\r') {
line[strlen(line)-1] = '\0';
}
@@ -840,6 +853,7 @@
else {
dbg(0,"ERROR: Non-matching attr count and column count: %d %d SKIPPING line: %s\n",col_cnt, attr_cnt,line);
}
+ g_free(line);
g_free(line2);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-04-01 21:13:09
|
Revision: 5764
http://sourceforge.net/p/navit/code/5764
Author: mdankov
Date: 2014-04-01 21:13:06 +0000 (Tue, 01 Apr 2014)
Log Message:
-----------
Fix:map_textfile:Default to utf-8 encoding.
Modified Paths:
--------------
trunk/navit/navit/map/textfile/textfile.c
Modified: trunk/navit/navit/map/textfile/textfile.c
===================================================================
--- trunk/navit/navit/map/textfile/textfile.c 2014-04-01 21:10:31 UTC (rev 5763)
+++ trunk/navit/navit/map/textfile/textfile.c 2014-04-01 21:13:06 UTC (rev 5764)
@@ -340,7 +340,7 @@
static struct map_methods map_methods_textfile = {
projection_mg,
- "iso8859-1",
+ "utf-8",
map_destroy_textfile,
map_rect_new_textfile,
map_rect_destroy_textfile,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-04-01 21:10:35
|
Revision: 5763
http://sourceforge.net/p/navit/code/5763
Author: mdankov
Date: 2014-04-01 21:10:31 +0000 (Tue, 01 Apr 2014)
Log Message:
-----------
Fix:gui_internal:Convert charset of all map-originated strings before using them.
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal.c
trunk/navit/navit/gui/internal/gui_internal_poi.c
Modified: trunk/navit/navit/gui/internal/gui_internal.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal.c 2014-04-01 21:08:46 UTC (rev 5762)
+++ trunk/navit/navit/gui/internal/gui_internal.c 2014-04-01 21:10:31 UTC (rev 5763)
@@ -630,7 +630,7 @@
struct map *map;
struct map_rect *mr;
struct item *item;
- char *label,*text;
+ char *text;
int i;
int dstcount=navit_get_destination_count(this->nav)+1;
@@ -655,9 +655,7 @@
if(item->type!=type_waypoint && item->type!=type_route_end)
continue;
if (item_attr_get(item, attr_label, &attr)) {
- label=map_convert_string(item->map, attr.u.str);
- text=g_strdup_printf(_("Waypoint %s"), label);
- map_convert_free(label);
+ text=g_strdup_printf(_("Waypoint %s"), map_convert_string_tmp(item->map, attr.u.str));
} else
continue;
gui_internal_widget_append(wtable,row=gui_internal_widget_table_row_new(this,gravity_left|orientation_horizontal|flags_fill));
@@ -887,7 +885,7 @@
if (item) {
while(item_attr_get(item, attr_url_local, &attr)) {
if (! cmd)
- cmd=g_strdup_printf("navit-browser.sh '%s' &",attr.u.str);
+ cmd=g_strdup_printf("navit-browser.sh '%s' &",map_convert_string_tmp(item->map,attr.u.str));
}
}
map_rect_destroy(mr);
@@ -1150,7 +1148,7 @@
item = map_rect_get_item_byid(mr, wm->item.id_hi, wm->item.id_lo);
if (item) {
if (item_attr_get(item, attr_description, &attr))
- gui_internal_widget_append(w, gui_internal_label_new(this, attr.u.str));
+ gui_internal_widget_append(w, gui_internal_label_new(this, map_convert_string_tmp(item->map,attr.u.str)));
if (item_attr_get(item, attr_url_local, &attr)) {
gui_internal_widget_append(wtable,row=gui_internal_widget_table_row_new(this,gravity_left|orientation_horizontal|flags_fill));
gui_internal_widget_append(row,
@@ -1264,7 +1262,7 @@
struct point p;
struct transformation *trans;
- char *text, *label;
+ char *text;
struct map_selection *sel;
GList *l, *ll;
@@ -1293,9 +1291,7 @@
continue;
}
if (item_attr_get(itemo, attr_label, &attr)) {
- label=map_convert_string(itemo->map, attr.u.str);
- text=g_strdup(label);
- map_convert_free(label);
+ text=g_strdup(map_convert_string_tmp(itemo->map, attr.u.str));
} else
text=g_strdup(item_to_name(item->type));
gui_internal_widget_append(wtable,row=gui_internal_widget_table_row_new(this,gravity_left|orientation_horizontal|flags_fill));
@@ -1547,7 +1543,7 @@
while ((item=bookmarks_get_item(mattr.u.bookmarks))) {
if (!item_attr_get(item, attr_label, &attr)) continue;
- label_full=attr.u.str;
+ label_full=map_convert_string_tmp(item->map,attr.u.str);
dbg(2,"full_labled: %s\n",label_full);
// hassub == 1 if the item type is a sub-folder
@@ -3145,7 +3141,7 @@
| orientation_horizontal);
gui_internal_widget_append(this->route_data.route_table,row);
- label = gui_internal_label_new(this,attr.u.str);
+ label = gui_internal_label_new(this,map_convert_string_tmp(item->map,attr.u.str));
gui_internal_widget_append(row,label);
label->item=*item;
Modified: trunk/navit/navit/gui/internal/gui_internal_poi.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_poi.c 2014-04-01 21:08:46 UTC (rev 5762)
+++ trunk/navit/navit/gui/internal/gui_internal_poi.c 2014-04-01 21:10:31 UTC (rev 5763)
@@ -111,7 +111,7 @@
src=el->u.icon.src;
if(!src || !src[0])
src="%s";
- icon=g_strdup_printf(src,icon_src.u.str);
+ icon=g_strdup_printf(src,map_convert_string_tmp(item->map,icon_src.u.str));
}
else {
icon=g_strdup(el->u.icon.src);
@@ -365,22 +365,22 @@
char *s=g_strdup("");
struct attr attr;
if(item_attr_get(item, attr_house_number, &attr))
- s=g_strjoin(" ",s,attr.u.str,NULL);
+ s=g_strjoin(" ",s,map_convert_string_tmp(item->map,attr.u.str),NULL);
if(item_attr_get(item, attr_street_name, &attr))
- s=g_strjoin(" ",s,attr.u.str,NULL);
+ s=g_strjoin(" ",s,map_convert_string_tmp(item->map,attr.u.str),NULL);
if(item_attr_get(item, attr_street_name_systematic, &attr))
- s=g_strjoin(" ",s,attr.u.str,NULL);
+ s=g_strjoin(" ",s,map_convert_string_tmp(item->map,attr.u.str),NULL);
if(item_attr_get(item, attr_district_name, &attr))
- s=g_strjoin(" ",s,attr.u.str,NULL);
+ s=g_strjoin(" ",s,map_convert_string_tmp(item->map,attr.u.str),NULL);
if(item_attr_get(item, attr_town_name, &attr))
- s=g_strjoin(" ",s,attr.u.str,NULL);
+ s=g_strjoin(" ",s,map_convert_string_tmp(item->map,attr.u.str),NULL);
if(item_attr_get(item, attr_county_name, &attr))
- s=g_strjoin(" ",s,attr.u.str,NULL);
+ s=g_strjoin(" ",s,map_convert_string_tmp(item->map,attr.u.str),NULL);
if(item_attr_get(item, attr_country_name, &attr))
- s=g_strjoin(" ",s,attr.u.str,NULL);
+ s=g_strjoin(" ",s,map_convert_string_tmp(item->map,attr.u.str),NULL);
if(item_attr_get(item, attr_address, &attr))
- s=g_strjoin(" ",s,"|",attr.u.str,NULL);
+ s=g_strjoin(" ",s,"|",map_convert_string_tmp(item->map,attr.u.str),NULL);
return s;
}
@@ -412,7 +412,7 @@
if (param->isAddressFilter) {
s=gui_internal_compose_item_address_string(item);
} else if (item_attr_get(item, attr_label, &attr)) {
- s=g_strdup_printf("%s %s", item_to_name(item->type), attr.u.str);
+ s=g_strdup_printf("%s %s", item_to_name(item->type), map_convert_string_tmp(item->map,attr.u.str));
} else {
s=g_strdup(item_to_name(item->type));
}
@@ -640,14 +640,14 @@
if (item->type==type_house_number) {
label=gui_internal_compose_item_address_string(item);
} else if (item_attr_get(item, attr_label, &attr)) {
- label=g_strdup(attr.u.str);
+ label=map_convert_string(item->map,attr.u.str);
// Buildings which label is equal to addr:housenumber value
// are duplicated by item_house_number. Don't include such
// buildings into the list. This is true for OSM maps created with
// maptool patched with #859 latest patch.
// FIXME: For non-OSM maps, we probably would better don't skip these items.
if(item->type==type_poly_building && item_attr_get(item, attr_house_number, &attr) ) {
- if(strcmp(label,attr.u.str)==0) {
+ if(strcmp(label,map_convert_string_tmp(item->map,attr.u.str))==0) {
g_free(label);
continue;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-04-01 21:08:49
|
Revision: 5762
http://sourceforge.net/p/navit/code/5762
Author: mdankov
Date: 2014-04-01 21:08:46 +0000 (Tue, 01 Apr 2014)
Log Message:
-----------
Add:core:New function to perform a temporary charset conversion of map originated string.
Modified Paths:
--------------
trunk/navit/navit/map.c
trunk/navit/navit/map.h
Modified: trunk/navit/navit/map.c
===================================================================
--- trunk/navit/navit/map.c 2014-03-28 20:20:05 UTC (rev 5761)
+++ trunk/navit/navit/map.c 2014-04-01 21:08:46 UTC (rev 5762)
@@ -207,7 +207,33 @@
return (this_->meth.charset != NULL && strcmp(this_->meth.charset, "utf-8"));
}
+char *map_converted_string_tmp=NULL;
+
/**
+ * @brief Converts a string from a map into a temporary allocated buffer. Conversion is not performed and original string is returned
+ * if map doesn't require conversion. So lifetime of returned value is very limited.
+ *
+ * @param this_ The map the string to be converted is from
+ * @param str The string to be converted
+ * @return The converted string. Don't care about it after use.
+ */
+char *
+map_convert_string_tmp(struct map *this_, char *str)
+{
+ if(map_converted_string_tmp!=NULL)
+ g_free(map_converted_string_tmp);
+ map_converted_string_tmp=NULL;
+ if(!this_ || !this_->meth.charset || !strcmp(this_->meth.charset, "utf-8"))
+ return str;
+ map_converted_string_tmp=g_convert(str, -1, "utf-8", this_->meth.charset, NULL, NULL, NULL);
+ if(!map_converted_string_tmp) {
+ dbg(0,"Error converting '%s' from %s to utf-8\n", str, this_->meth.charset);
+ return str;
+ }
+ return map_converted_string_tmp;
+}
+
+/**
* @brief Converts a string from a map
*
* @param this_ The map the string to be converted is from
@@ -217,12 +243,17 @@
char *
map_convert_string(struct map *this_, char *str)
{
- return g_convert(str, -1,"utf-8",this_->meth.charset,NULL,NULL,NULL);
+ return map_convert_dup(map_convert_string_tmp(this_,str));
}
+
char *
map_convert_dup(char *str)
{
+ if(map_converted_string_tmp==str) {
+ map_converted_string_tmp=NULL;
+ return str;
+ }
return g_strdup(str);
}
Modified: trunk/navit/navit/map.h
===================================================================
--- trunk/navit/navit/map.h 2014-03-28 20:20:05 UTC (rev 5761)
+++ trunk/navit/navit/map.h 2014-04-01 21:08:46 UTC (rev 5762)
@@ -247,6 +247,7 @@
void map_add_callback(struct map *this_, struct callback *cb);
void map_remove_callback(struct map *this_, struct callback *cb);
int map_requires_conversion(struct map *this_);
+char *map_convert_string_tmp(struct map *this_, char *str);
char *map_convert_string(struct map *this_, char *str);
char *map_convert_dup(char *str);
void map_convert_free(char *str);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-03-28 20:20:09
|
Revision: 5761
http://sourceforge.net/p/navit/code/5761
Author: mdankov
Date: 2014-03-28 20:20:05 +0000 (Fri, 28 Mar 2014)
Log Message:
-----------
Fix:port_wince:Partially revert r5746 to allow cmake wince builds with gcc versions >5.7.0
Revision Links:
--------------
http://sourceforge.net/p/navit/code/5746
Modified Paths:
--------------
trunk/navit/CMakeLists.txt
Modified: trunk/navit/CMakeLists.txt
===================================================================
--- trunk/navit/CMakeLists.txt 2014-03-21 22:42:09 UTC (rev 5760)
+++ trunk/navit/CMakeLists.txt 2014-03-28 20:20:05 UTC (rev 5761)
@@ -527,6 +527,8 @@
add_plugin(support/libc "wince detected" TRUE)
set(HAVE_API_WIN32_CE 1)
set(BUILD_MAPTOOL FALSE)
+ # mingw32ce since gcc 4.7.0 needs HAVE_PRAGMA_PACK as __attribute__((packed)) is broken, see gcc bug 52991
+ set(HAVE_PRAGMA_PACK 1)
set_with_reason(vehicle/file "wince: currently broken" FALSE)
set_with_reason(vehicle/wince "wince detected" TRUE)
endif()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-03-21 22:42:11
|
Revision: 5760
http://sourceforge.net/p/navit/code/5760
Author: sleske
Date: 2014-03-21 22:42:09 +0000 (Fri, 21 Mar 2014)
Log Message:
-----------
Fix:gui_internal:Enable highlighting of possible keys for all search types, not just town & street.
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_search.c
Modified: trunk/navit/navit/gui/internal/gui_internal_search.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_search.c 2014-03-21 22:41:52 UTC (rev 5759)
+++ trunk/navit/navit/gui/internal/gui_internal_search.c 2014-03-21 22:42:09 UTC (rev 5760)
@@ -191,8 +191,7 @@
gui_internal_find_next_possible_key(char *search_text, char *wm_name, char *possible_keys, char *item_name)
{
gchar* trunk_name;
- if (((! strcmp(wm_name,"Town")) || (! strcmp(wm_name,"Street"))) && item_name)
- {
+ if (item_name) {
trunk_name = g_strrstr(item_name, search_text);
if (trunk_name) {
char next_char = trunk_name[strlen(search_text)];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-03-21 22:41:59
|
Revision: 5759
http://sourceforge.net/p/navit/code/5759
Author: sleske
Date: 2014-03-21 22:41:52 +0000 (Fri, 21 Mar 2014)
Log Message:
-----------
Refactor:gui_internal:Extract gui_internal_get_match_quality, gui_internal_create_resultlist_entry from gui_internal_search_idle.
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_search.c
Modified: trunk/navit/navit/gui/internal/gui_internal_search.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_search.c 2014-03-21 22:41:40 UTC (rev 5758)
+++ trunk/navit/navit/gui/internal/gui_internal_search.c 2014-03-21 22:41:52 UTC (rev 5759)
@@ -241,16 +241,88 @@
}
+static int
+gui_internal_get_match_quality(char *item_name, char* search_text, int is_house_number_without_street)
+{
+ enum match_quality {
+ full_string_match, word_match, substring_match, housenum_but_no_street_match }
+ match_quality;
+ if (is_house_number_without_street) {
+ match_quality=housenum_but_no_street_match;
+ } else if(item_name) {
+ int i;
+ char *folded_name=linguistics_casefold(item_name);
+ char *folded_query=linguistics_casefold(search_text);
+ match_quality=substring_match;
+
+ for(i=0; i<3 ;i++) {
+ char *exp=linguistics_expand_special(folded_name,i);
+ char *p;
+ if(!exp)
+ continue;
+ if(!strcmp(exp,folded_query)) {
+ dbg(1,"exact match for the whole string %s\n", exp);
+ match_quality=full_string_match;
+ g_free(exp);
+ break;
+ }
+ if((p=strstr(exp,folded_query))!=NULL) {
+ p+=strlen(folded_query);
+ if(!*p||strchr(LINGUISTICS_WORD_SEPARATORS_ASCII,*p)) {
+ dbg(1,"exact matching word found inside string %s\n",exp);
+ match_quality=word_match;
+ }
+ }
+ g_free(exp);
+ }
+ g_free(folded_name);
+ g_free(folded_query);
+ }
+ return match_quality;
+}
+
+static struct widget*
+gui_internal_create_resultlist_entry(struct gui_priv *this, struct search_list_result *res, char *result_main_label, char *result_sublabel, void *param, char *widget_name, struct item *item)
+{
+ struct widget *resultlist_entry;
+ if(result_sublabel) {
+ struct widget *entry_sublabel;
+ resultlist_entry=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill);
+ gui_internal_widget_append(resultlist_entry,
+ gui_internal_image_new(this, image_new_xs(this, res->country->flag)));
+ entry_sublabel=gui_internal_box_new(this, gravity_left_center|orientation_vertical|flags_fill);
+ gui_internal_widget_append(resultlist_entry, entry_sublabel);
+ gui_internal_widget_append(entry_sublabel, gui_internal_label_new(this, result_main_label));
+ gui_internal_widget_append(entry_sublabel, gui_internal_label_font_new(this, result_sublabel, 1));
+ resultlist_entry->func=gui_internal_cmd_position;
+ resultlist_entry->data=param;
+ resultlist_entry->state |= STATE_SENSITIVE;
+ resultlist_entry->speech=g_strdup(result_main_label);
+ } else {
+ resultlist_entry=gui_internal_button_new_with_callback(this, result_main_label,
+ image_new_xs(this, res->country->flag),
+ gravity_left_center|orientation_horizontal|flags_fill,
+ gui_internal_cmd_position, param);
+ }
+ resultlist_entry->name=widget_name;
+ if (res->c)
+ resultlist_entry->c=*res->c;
+ resultlist_entry->selection_id=res->id;
+ if (item)
+ resultlist_entry->item=*item;
+
+ return resultlist_entry;
+}
+
static void
gui_internal_search_idle(struct gui_priv *this, char *wm_name, struct widget *search_list, void *param)
{
- char *result_main_label=NULL,*result_sublabel=NULL,*item_name=NULL, *widget_name=NULL;
+ char *result_main_label=NULL,*result_sublabel=NULL,*item_name=NULL, *widget_name=NULL, *search_text;
struct search_list_result *res;
struct item *item=NULL;
- GList *l;
static char possible_keys[256]="";
struct widget *search_input=NULL;
- struct widget *resultlist_row ,*resultlist_entry, *entry_sublabel;
+ struct widget *menu, *resultlist_row, *resultlist_entry;
res=search_list_get_result(this->sl);
if (!res) {
@@ -287,84 +359,30 @@
if(!widget_name)
widget_name=g_strdup(item_name);
- dbg(1,"res->country->flag=%s\n", res->country->flag);
-
- struct widget *menu=g_list_last(this->root.children)->data;
+ menu=g_list_last(this->root.children)->data;
search_input=gui_internal_find_widget(menu, NULL, STATE_EDIT);
dbg_assert(search_input);
- gui_internal_find_next_possible_key(search_input->text, wm_name, possible_keys, item_name);
+ search_text=search_input->text;
+ gui_internal_find_next_possible_key(search_text, wm_name, possible_keys, item_name);
+
resultlist_row=gui_internal_widget_table_row_new(this, gravity_left|orientation_horizontal|flags_fill);
-
if (!result_sublabel)
resultlist_row->text=g_strdup(result_main_label);
else
resultlist_row->text=g_strdup_printf("%s %s",item_name,result_sublabel);
-
- enum sort_rank { rank_full_string_match, rank_word_match,
- rank_substring_match, rank_housenum_but_no_street_match };
- if (! strcmp(wm_name,"House number") && !res->street->name) {
- resultlist_row->datai=rank_housenum_but_no_street_match;
- } else if(item_name) {
- int i;
- char *folded_name=linguistics_casefold(item_name);
- char *folded_query=linguistics_casefold(search_input->text);
- resultlist_row->datai=rank_substring_match;
+ int is_house_number_without_street=!strcmp(wm_name,"House number") && !res->street->name;
+ resultlist_row->datai=gui_internal_get_match_quality(item_name, search_text, is_house_number_without_street);
+ gui_internal_widget_insert_sorted(search_list, resultlist_row, gui_internal_search_cmp);
- for(i=0; i<3 ;i++) {
- char *exp=linguistics_expand_special(folded_name,i);
- char *p;
- if(!exp)
- continue;
- if(!strcmp(exp,folded_query)) {
- dbg(1,"exact match for the whole string %s\n", exp);
- resultlist_row->datai=rank_full_string_match;
- g_free(exp);
- break;
- }
- if((p=strstr(exp,folded_query))!=NULL) {
- p+=strlen(folded_query);
- if(!*p||strchr(LINGUISTICS_WORD_SEPARATORS_ASCII,*p)) {
- dbg(1,"exact matching word found inside string %s\n",exp);
- resultlist_row->datai=rank_word_match;
- }
- }
- g_free(exp);
- }
- g_free(folded_name);
- g_free(folded_query);
- }
- gui_internal_widget_insert_sorted(search_list, resultlist_row, gui_internal_search_cmp);
- if(result_sublabel) {
- resultlist_entry=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill);
- gui_internal_widget_append(resultlist_row, resultlist_entry);
- gui_internal_widget_append(resultlist_entry, gui_internal_image_new(this, image_new_xs(this, res->country->flag)));
- entry_sublabel=gui_internal_box_new(this, gravity_left_center|orientation_vertical|flags_fill);
- gui_internal_widget_append(resultlist_entry, entry_sublabel);
- gui_internal_widget_append(entry_sublabel, gui_internal_label_new(this, result_main_label));
- gui_internal_widget_append(entry_sublabel, gui_internal_label_font_new(this, result_sublabel, 1));
- resultlist_entry->func=gui_internal_cmd_position;
- resultlist_entry->data=param;
- resultlist_entry->state |= STATE_SENSITIVE;
- resultlist_entry->speech=g_strdup(result_main_label);
- } else {
- gui_internal_widget_append(resultlist_row,
- resultlist_entry=gui_internal_button_new_with_callback(this, result_main_label,
- image_new_xs(this, res->country->flag),
- gravity_left_center|orientation_horizontal|flags_fill,
- gui_internal_cmd_position, param));
- }
- resultlist_entry->name=widget_name;
- if (res->c)
- resultlist_entry->c=*res->c;
- resultlist_entry->selection_id=res->id;
- if (item)
- resultlist_entry->item=*item;
+ resultlist_entry=gui_internal_create_resultlist_entry(
+ this, res, result_main_label, result_sublabel, param, widget_name, item);
+ gui_internal_widget_append(resultlist_row, resultlist_entry);
gui_internal_widget_pack(this, search_list);
- l=g_list_last(this->root.children);
graphics_draw_mode(this->gra, draw_mode_begin);
- gui_internal_widget_render(this, l->data);
+ gui_internal_widget_render(this, menu);
graphics_draw_mode(this->gra, draw_mode_end);
+
g_free(result_main_label);
g_free(result_sublabel);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-03-21 22:41:44
|
Revision: 5758
http://sourceforge.net/p/navit/code/5758
Author: sleske
Date: 2014-03-21 22:41:40 +0000 (Fri, 21 Mar 2014)
Log Message:
-----------
Refactor:gui_internal:Extract gui_internal_highlight_possible_keys from gui_internal_search_idle, better variable names.
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_search.c
Modified: trunk/navit/navit/gui/internal/gui_internal_search.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_search.c 2014-03-21 22:41:29 UTC (rev 5757)
+++ trunk/navit/navit/gui/internal/gui_internal_search.c 2014-03-21 22:41:40 UTC (rev 5758)
@@ -146,7 +146,7 @@
}
static char *
-town_str(struct search_list_result *res, int level, int flags)
+town_display_label(struct search_list_result *res, int level, int flags)
{
char *town=district_str(res, level,attr_town_name,"");
char *district=district_str(res, level,attr_district_name,NULL);
@@ -209,49 +209,53 @@
}
static void
+gui_internal_highlight_possible_keys(struct gui_priv *this, char *possible_keys)
+{
+ struct menu_data *md;
+
+ md=gui_internal_menu_data(this);
+ if (md && md->keyboard && !(this->flags & 2048)) {
+ GList *lk=md->keyboard->children;
+ graphics_draw_mode(this->gra, draw_mode_begin);
+ while (lk) {
+ struct widget *child=lk->data;
+ GList *lk2=child->children;
+ while (lk2) {
+ struct widget *child_=lk2->data;
+ lk2=g_list_next(lk2);
+ if (child_->data && strcmp("\b", child_->data)) { // FIXME don't disable special keys
+ if ( (strlen(possible_keys) == 0) ||
+ (g_strrstr(possible_keys, child_->data)!=NULL ) ) {
+ child_->state|= STATE_HIGHLIGHTED|STATE_VISIBLE|STATE_SENSITIVE|STATE_CLEAR ;
+ } else {
+ child_->state&= ~(STATE_HIGHLIGHTED|STATE_VISIBLE|STATE_SELECTED) ;
+ }
+ gui_internal_widget_render(this,child_);
+ }
+ }
+ lk=g_list_next(lk);
+ }
+ gui_internal_widget_render(this,md->keyboard);
+ graphics_draw_mode(this->gra, draw_mode_end);
+ }
+
+}
+
+static void
gui_internal_search_idle(struct gui_priv *this, char *wm_name, struct widget *search_list, void *param)
{
- char *text=NULL,*text2=NULL,*item_name=NULL, *wcname=NULL;
+ char *result_main_label=NULL,*result_sublabel=NULL,*item_name=NULL, *widget_name=NULL;
struct search_list_result *res;
- struct widget *wc;
struct item *item=NULL;
GList *l;
static char possible_keys[256]="";
- struct widget *wi=NULL;
- struct widget *wr, *wb;
+ struct widget *search_input=NULL;
+ struct widget *resultlist_row ,*resultlist_entry, *entry_sublabel;
res=search_list_get_result(this->sl);
if (!res) {
- struct menu_data *md;
gui_internal_search_idle_end(this);
-
- md=gui_internal_menu_data(this);
- if (md && md->keyboard && !(this->flags & 2048)) {
- GList *lk=md->keyboard->children;
- graphics_draw_mode(this->gra, draw_mode_begin);
- while (lk) {
- struct widget *child=lk->data;
- GList *lk2=child->children;
- while (lk2) {
- struct widget *child_=lk2->data;
- lk2=g_list_next(lk2);
- if (child_->data && strcmp("\b", child_->data)) { // FIXME don't disable special keys
- if (strlen(possible_keys) == 0)
- child_->state|= STATE_HIGHLIGHTED|STATE_VISIBLE|STATE_SENSITIVE|STATE_CLEAR ;
- else if (g_strrstr(possible_keys, child_->data)!=NULL ) {
- child_->state|= STATE_HIGHLIGHTED|STATE_VISIBLE|STATE_SENSITIVE|STATE_CLEAR ;
- } else {
- child_->state&= ~(STATE_HIGHLIGHTED|STATE_VISIBLE|STATE_SELECTED) ;
- }
- gui_internal_widget_render(this,child_);
- }
- }
- lk=g_list_next(lk);
- }
- gui_internal_widget_render(this,md->keyboard);
- graphics_draw_mode(this->gra, draw_mode_end);
- }
-
+ gui_internal_highlight_possible_keys(this, possible_keys);
possible_keys[0]='\0';
return;
}
@@ -259,60 +263,62 @@
if (! strcmp(wm_name,"Country")) {
item_name=res->country->name;
item=&res->country->common.item;
- text=g_strdup_printf("%s", res->country->name);
+ result_main_label=g_strdup_printf("%s", res->country->name);
}
if (! strcmp(wm_name,"Town")) {
item=&res->town->common.item;
item_name=res->town->common.town_name;
- text=town_str(res, 1, 0);
- text2=town_str(res, 1, 2);
+ result_main_label=town_display_label(res, 1, 0);
+ result_sublabel=town_display_label(res, 1, 2);
}
if (! strcmp(wm_name,"Street")) {
item_name=res->street->name;
item=&res->street->common.item;
- text=g_strdup(res->street->name);
- text2=town_str(res, 2, 1);
+ result_main_label=g_strdup(res->street->name);
+ result_sublabel=town_display_label(res, 2, 1);
}
if (! strcmp(wm_name,"House number")) {
item_name=res->house_number->house_number;
- text=g_strdup_printf("%s, %s", item_name, res->street->name);
- text2=town_str(res, 3, 0);
- wcname=g_strdup(text);
+ result_main_label=g_strdup_printf("%s, %s", item_name, res->street->name);
+ result_sublabel=town_display_label(res, 3, 0);
+ widget_name=g_strdup(result_main_label);
}
- if(!wcname)
- wcname=g_strdup(item_name);
+ if(!widget_name)
+ widget_name=g_strdup(item_name);
dbg(1,"res->country->flag=%s\n", res->country->flag);
struct widget *menu=g_list_last(this->root.children)->data;
- wi=gui_internal_find_widget(menu, NULL, STATE_EDIT);
- dbg_assert(wi);
- gui_internal_find_next_possible_key(wi->text, wm_name, possible_keys, item_name);
+ search_input=gui_internal_find_widget(menu, NULL, STATE_EDIT);
+ dbg_assert(search_input);
+ gui_internal_find_next_possible_key(search_input->text, wm_name, possible_keys, item_name);
- wr=gui_internal_widget_table_row_new(this, gravity_left|orientation_horizontal|flags_fill);
+ resultlist_row=gui_internal_widget_table_row_new(this, gravity_left|orientation_horizontal|flags_fill);
- if (!text2)
- wr->text=g_strdup(text);
+ if (!result_sublabel)
+ resultlist_row->text=g_strdup(result_main_label);
else
- wr->text=g_strdup_printf("%s %s",item_name,text2);
+ resultlist_row->text=g_strdup_printf("%s %s",item_name,result_sublabel);
+ enum sort_rank { rank_full_string_match, rank_word_match,
+ rank_substring_match, rank_housenum_but_no_street_match };
if (! strcmp(wm_name,"House number") && !res->street->name) {
- wr->datai=2048;
+ resultlist_row->datai=rank_housenum_but_no_street_match;
} else if(item_name) {
int i;
char *folded_name=linguistics_casefold(item_name);
- char *folded_query=linguistics_casefold(wi->text);
- wr->datai=1024;
+ char *folded_query=linguistics_casefold(search_input->text);
+ resultlist_row->datai=rank_substring_match;
- for(i=0;wi && i<3 ;i++) {
+ for(i=0; i<3 ;i++) {
char *exp=linguistics_expand_special(folded_name,i);
char *p;
if(!exp)
continue;
if(!strcmp(exp,folded_query)) {
dbg(1,"exact match for the whole string %s\n", exp);
- wr->datai=0;
+ resultlist_row->datai=rank_full_string_match;
g_free(exp);
break;
}
@@ -320,7 +326,7 @@
p+=strlen(folded_query);
if(!*p||strchr(LINGUISTICS_WORD_SEPARATORS_ASCII,*p)) {
dbg(1,"exact matching word found inside string %s\n",exp);
- wr->datai=512;
+ resultlist_row->datai=rank_word_match;
}
}
g_free(exp);
@@ -328,39 +334,39 @@
g_free(folded_name);
g_free(folded_query);
}
- gui_internal_widget_insert_sorted(search_list, wr, gui_internal_search_cmp);
- if(text2) {
- wc=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill);
- gui_internal_widget_append(wr, wc);
- gui_internal_widget_append(wc, gui_internal_image_new(this, image_new_xs(this, res->country->flag)));
- wb=gui_internal_box_new(this, gravity_left_center|orientation_vertical|flags_fill);
- gui_internal_widget_append(wc, wb);
- gui_internal_widget_append(wb, gui_internal_label_new(this, text));
- gui_internal_widget_append(wb, gui_internal_label_font_new(this, text2, 1));
- wc->func=gui_internal_cmd_position;
- wc->data=param;
- wc->state |= STATE_SENSITIVE;
- wc->speech=g_strdup(text);
+ gui_internal_widget_insert_sorted(search_list, resultlist_row, gui_internal_search_cmp);
+ if(result_sublabel) {
+ resultlist_entry=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill);
+ gui_internal_widget_append(resultlist_row, resultlist_entry);
+ gui_internal_widget_append(resultlist_entry, gui_internal_image_new(this, image_new_xs(this, res->country->flag)));
+ entry_sublabel=gui_internal_box_new(this, gravity_left_center|orientation_vertical|flags_fill);
+ gui_internal_widget_append(resultlist_entry, entry_sublabel);
+ gui_internal_widget_append(entry_sublabel, gui_internal_label_new(this, result_main_label));
+ gui_internal_widget_append(entry_sublabel, gui_internal_label_font_new(this, result_sublabel, 1));
+ resultlist_entry->func=gui_internal_cmd_position;
+ resultlist_entry->data=param;
+ resultlist_entry->state |= STATE_SENSITIVE;
+ resultlist_entry->speech=g_strdup(result_main_label);
} else {
- gui_internal_widget_append(wr,
- wc=gui_internal_button_new_with_callback(this, text,
+ gui_internal_widget_append(resultlist_row,
+ resultlist_entry=gui_internal_button_new_with_callback(this, result_main_label,
image_new_xs(this, res->country->flag),
gravity_left_center|orientation_horizontal|flags_fill,
gui_internal_cmd_position, param));
}
- wc->name=wcname;
+ resultlist_entry->name=widget_name;
if (res->c)
- wc->c=*res->c;
- wc->selection_id=res->id;
+ resultlist_entry->c=*res->c;
+ resultlist_entry->selection_id=res->id;
if (item)
- wc->item=*item;
+ resultlist_entry->item=*item;
gui_internal_widget_pack(this, search_list);
l=g_list_last(this->root.children);
graphics_draw_mode(this->gra, draw_mode_begin);
gui_internal_widget_render(this, l->data);
graphics_draw_mode(this->gra, draw_mode_end);
- g_free(text);
- g_free(text2);
+ g_free(result_main_label);
+ g_free(result_sublabel);
}
static void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2014-03-21 22:41:32
|
Revision: 5757
http://sourceforge.net/p/navit/code/5757
Author: sleske
Date: 2014-03-21 22:41:29 +0000 (Fri, 21 Mar 2014)
Log Message:
-----------
Refactor:gui_internal:Move early return in gui_internal_search_idle to top.
Modified Paths:
--------------
trunk/navit/navit/gui/internal/gui_internal_search.c
Modified: trunk/navit/navit/gui/internal/gui_internal_search.c
===================================================================
--- trunk/navit/navit/gui/internal/gui_internal_search.c 2014-03-21 22:41:14 UTC (rev 5756)
+++ trunk/navit/navit/gui/internal/gui_internal_search.c 2014-03-21 22:41:29 UTC (rev 5757)
@@ -221,41 +221,7 @@
struct widget *wr, *wb;
res=search_list_get_result(this->sl);
- if (res) {
- if (! strcmp(wm_name,"Country")) {
- item_name=res->country->name;
- item=&res->country->common.item;
- text=g_strdup_printf("%s", res->country->name);
- }
- if (! strcmp(wm_name,"Town")) {
- item=&res->town->common.item;
- item_name=res->town->common.town_name;
- text=town_str(res, 1, 0);
- text2=town_str(res, 1, 2);
- }
- if (! strcmp(wm_name,"Street")) {
- item_name=res->street->name;
- item=&res->street->common.item;
- text=g_strdup(res->street->name);
- text2=town_str(res, 2, 1);
- }
- if (! strcmp(wm_name,"House number")) {
- item_name=res->house_number->house_number;
- text=g_strdup_printf("%s, %s", item_name, res->street->name);
- text2=town_str(res, 3, 0);
- wcname=g_strdup(text);
- }
-
- if(!wcname)
- wcname=g_strdup(item_name);
-
- dbg(1,"res->country->flag=%s\n", res->country->flag);
-
- struct widget *menu=g_list_last(this->root.children)->data;
- wi=gui_internal_find_widget(menu, NULL, STATE_EDIT);
- dbg_assert(wi);
- gui_internal_find_next_possible_key(wi->text, wm_name, possible_keys, item_name);
- } else {
+ if (!res) {
struct menu_data *md;
gui_internal_search_idle_end(this);
@@ -290,6 +256,40 @@
return;
}
+ if (! strcmp(wm_name,"Country")) {
+ item_name=res->country->name;
+ item=&res->country->common.item;
+ text=g_strdup_printf("%s", res->country->name);
+ }
+ if (! strcmp(wm_name,"Town")) {
+ item=&res->town->common.item;
+ item_name=res->town->common.town_name;
+ text=town_str(res, 1, 0);
+ text2=town_str(res, 1, 2);
+ }
+ if (! strcmp(wm_name,"Street")) {
+ item_name=res->street->name;
+ item=&res->street->common.item;
+ text=g_strdup(res->street->name);
+ text2=town_str(res, 2, 1);
+ }
+ if (! strcmp(wm_name,"House number")) {
+ item_name=res->house_number->house_number;
+ text=g_strdup_printf("%s, %s", item_name, res->street->name);
+ text2=town_str(res, 3, 0);
+ wcname=g_strdup(text);
+ }
+
+ if(!wcname)
+ wcname=g_strdup(item_name);
+
+ dbg(1,"res->country->flag=%s\n", res->country->flag);
+
+ struct widget *menu=g_list_last(this->root.children)->data;
+ wi=gui_internal_find_widget(menu, NULL, STATE_EDIT);
+ dbg_assert(wi);
+ gui_internal_find_next_possible_key(wi->text, wm_name, possible_keys, item_name);
+
wr=gui_internal_widget_table_row_new(this, gravity_left|orientation_horizontal|flags_fill);
if (!text2)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|