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...> - 2015-01-31 23:28:49
|
Revision: 6011
http://sourceforge.net/p/navit/code/6011
Author: sleske
Date: 2015-01-31 23:28:41 +0000 (Sat, 31 Jan 2015)
Log Message:
-----------
Fix:vehicle_gpsd:Fix warning.
Modified Paths:
--------------
trunk/navit/navit/vehicle/gpsd/vehicle_gpsd.c
Modified: trunk/navit/navit/vehicle/gpsd/vehicle_gpsd.c
===================================================================
--- trunk/navit/navit/vehicle/gpsd/vehicle_gpsd.c 2015-01-25 13:36:03 UTC (rev 6010)
+++ trunk/navit/navit/vehicle/gpsd/vehicle_gpsd.c 2015-01-31 23:28:41 UTC (rev 6011)
@@ -101,7 +101,7 @@
}
}
}
- dbg(lvl_debug,"data->set="LONGLONG_HEX_FMT"\n", data->set);
+ dbg(lvl_debug,"data->set="LONGLONG_HEX_FMT"\n", (unsigned long long)data->set);
if (data->set & SPEED_SET) {
priv->speed = data->fix.speed * 3.6;
if(!isnan(data->fix.speed))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-25 13:36:25
|
Revision: 6010
http://sourceforge.net/p/navit/code/6010
Author: sleske
Date: 2015-01-25 13:36:03 +0000 (Sun, 25 Jan 2015)
Log Message:
-----------
Fix:core:Remove draw_mode_end_lazy. Only used by QPainter and OpenGL graphics, where it does not appear to do anything useful.
Modified Paths:
--------------
trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
trunk/navit/navit/graphics/opengl/graphics_opengl.c
trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
trunk/navit/navit/graphics.h
trunk/navit/navit/navit.c
trunk/navit/navit/vehicle.c
trunk/navit/navit/vehicle.h
Modified: trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
===================================================================
--- trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2015-01-25 13:35:47 UTC (rev 6009)
+++ trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2015-01-25 13:36:03 UTC (rev 6010)
@@ -934,7 +934,6 @@
/* These constants must be synchronized with enum draw_mode_num in graphics.h. */
public static final int draw_mode_begin = 0;
public static final int draw_mode_end = 1;
- public static final int draw_mode_end_lazy = 2;
protected void draw_mode(int mode)
{
Modified: trunk/navit/navit/graphics/opengl/graphics_opengl.c
===================================================================
--- trunk/navit/navit/graphics/opengl/graphics_opengl.c 2015-01-25 13:35:47 UTC (rev 6009)
+++ trunk/navit/navit/graphics/opengl/graphics_opengl.c 2015-01-25 13:36:03 UTC (rev 6010)
@@ -1210,7 +1210,7 @@
glNewList(gr->DLid, GL_COMPILE);
}
- if (mode == draw_mode_end || mode == draw_mode_end_lazy) {
+ if (mode == draw_mode_end) {
glEndList();
}
#endif
Modified: trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
===================================================================
--- trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2015-01-25 13:35:47 UTC (rev 6009)
+++ trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2015-01-25 13:36:03 UTC (rev 6010)
@@ -531,9 +531,6 @@
if (!gr->parent)
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers|QEventLoop::DeferredDeletion|QEventLoop::X11ExcludeTimers);
}
- if (mode == draw_mode_end_lazy) {
- gr->painter->end();
- }
gr->mode=mode;
}
Modified: trunk/navit/navit/graphics.h
===================================================================
--- trunk/navit/navit/graphics.h 2015-01-25 13:35:47 UTC (rev 6009)
+++ trunk/navit/navit/graphics.h 2015-01-25 13:36:03 UTC (rev 6010)
@@ -37,7 +37,7 @@
/* This enum must be synchronized with the constants in NavitGraphics.java. */
enum draw_mode_num {
- draw_mode_begin, draw_mode_end, draw_mode_end_lazy
+ draw_mode_begin, draw_mode_end
};
struct graphics_priv;
Modified: trunk/navit/navit/navit.c
===================================================================
--- trunk/navit/navit/navit.c 2015-01-25 13:35:47 UTC (rev 6009)
+++ trunk/navit/navit/navit.c 2015-01-25 13:36:03 UTC (rev 6010)
@@ -3004,7 +3004,7 @@
return;
transform(this_->trans_cursor, pro, &nv->coord, &cursor_pnt, 1, 0, 0, NULL);
}
- vehicle_draw(nv->vehicle, this_->gra, &cursor_pnt, pnt ? 0:1, nv->dir-transform_get_yaw(this_->trans_cursor), nv->speed);
+ vehicle_draw(nv->vehicle, this_->gra, &cursor_pnt, nv->dir-transform_get_yaw(this_->trans_cursor), nv->speed);
}
/**
Modified: trunk/navit/navit/vehicle.c
===================================================================
--- trunk/navit/navit/vehicle.c 2015-01-25 13:35:47 UTC (rev 6009)
+++ trunk/navit/navit/vehicle.c 2015-01-25 13:36:03 UTC (rev 6010)
@@ -78,7 +78,7 @@
struct object_func vehicle_func;
static void vehicle_set_default_name(struct vehicle *this);
-static void vehicle_draw_do(struct vehicle *this_, int lazy);
+static void vehicle_draw_do(struct vehicle *this_);
static void vehicle_log_nmea(struct vehicle *this_, struct log *log);
static void vehicle_log_gpx(struct vehicle *this_, struct log *log);
static void vehicle_log_textfile(struct vehicle *this_, struct log *log);
@@ -364,16 +364,15 @@
* @param this_ The vehicle
* @param gra The graphics
* @param pnt Screen coordinates of the vehicle.
- * @param lazy use lazy draw mode.
* @param angle The angle relative to the map.
* @param speed The speed of the vehicle.
*/
void
-vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int lazy, int angle, int speed)
+vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int angle, int speed)
{
if (angle < 0)
angle+=360;
- dbg(lvl_debug,"enter this=%p gra=%p pnt=%p lazy=%d dir=%d speed=%d\n", this_, gra, pnt, lazy, angle, speed);
+ dbg(lvl_debug,"enter this=%p gra=%p pnt=%p dir=%d speed=%d\n", this_, gra, pnt, angle, speed);
dbg(lvl_debug,"point %d,%d\n", pnt->x, pnt->y);
this_->cursor_pnt=*pnt;
this_->angle=angle;
@@ -393,7 +392,7 @@
graphics_background_gc(this_->gra, this_->bg);
}
}
- vehicle_draw_do(this_, lazy);
+ vehicle_draw_do(this_);
}
int
@@ -419,7 +418,7 @@
static void
-vehicle_draw_do(struct vehicle *this_, int lazy)
+vehicle_draw_do(struct vehicle *this_)
{
struct point p;
struct cursor *cursor=this_->cursor;
@@ -460,7 +459,7 @@
++attr;
}
graphics_draw_drag(this_->gra, &this_->cursor_pnt);
- graphics_draw_mode(this_->gra, lazy ? draw_mode_end_lazy : draw_mode_end);
+ graphics_draw_mode(this_->gra, draw_mode_end);
if (this_->animate_callback) {
++this_->sequence;
if (cursor->sequence_range && cursor->sequence_range->max < this_->sequence)
Modified: trunk/navit/navit/vehicle.h
===================================================================
--- trunk/navit/navit/vehicle.h 2015-01-25 13:35:47 UTC (rev 6009)
+++ trunk/navit/navit/vehicle.h 2015-01-25 13:36:03 UTC (rev 6010)
@@ -50,7 +50,7 @@
int vehicle_add_attr(struct vehicle *this_, struct attr *attr);
int vehicle_remove_attr(struct vehicle *this_, struct attr *attr);
void vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor, int overwrite);
-void vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int lazy, int angle, int speed);
+void vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int angle, int speed);
int vehicle_get_cursor_data(struct vehicle *this_, struct point *pnt, int *angle, int *speed);
void vehicle_log_gpx_add_tag(char *tag, char **logstr);
struct vehicle * vehicle_ref(struct vehicle *this_);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-25 13:35:56
|
Revision: 6009
http://sourceforge.net/p/navit/code/6009
Author: sleske
Date: 2015-01-25 13:35:47 +0000 (Sun, 25 Jan 2015)
Log Message:
-----------
Fix:core:Remove unused draw modes draw_mode_begin_clear and draw_mode_cursor.
Modified Paths:
--------------
trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
trunk/navit/navit/graphics.c
trunk/navit/navit/graphics.h
Modified: trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
===================================================================
--- trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2015-01-25 13:35:36 UTC (rev 6008)
+++ trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2015-01-25 13:35:47 UTC (rev 6009)
@@ -933,10 +933,8 @@
/* These constants must be synchronized with enum draw_mode_num in graphics.h. */
public static final int draw_mode_begin = 0;
- public static final int draw_mode_begin_clear = 1;
- public static final int draw_mode_end = 2;
- public static final int draw_mode_cursor = 3;
- public static final int draw_mode_end_lazy = 4;
+ public static final int draw_mode_end = 1;
+ public static final int draw_mode_end_lazy = 2;
protected void draw_mode(int mode)
{
@@ -950,7 +948,7 @@
parent_graphics.view.invalidate(get_rect());
}
}
- if (mode == draw_mode_begin_clear || (mode == draw_mode_begin && parent_graphics != null)) {
+ if (mode == draw_mode_begin && parent_graphics != null) {
draw_bitmap.eraseColor(0);
}
Modified: trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
===================================================================
--- trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c 2015-01-25 13:35:36 UTC (rev 6008)
+++ trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c 2015-01-25 13:35:47 UTC (rev 6009)
@@ -663,13 +663,7 @@
{
GdkRectangle r;
struct graphics_priv *overlay;
-#if 0
- if (mode == draw_mode_begin) {
- if (! gr->parent && gr->background_gc)
- gdk_draw_rectangle(gr->drawable, gr->background_gc->gc, TRUE, 0, 0, gr->width, gr->height);
- }
-#endif
- if (mode == draw_mode_end && gr->mode != draw_mode_cursor) {
+ if (mode == draw_mode_end) {
if (gr->parent) {
if (gr->cleanup) {
overlay_rect(gr->parent, gr, 1, &r);
Modified: trunk/navit/navit/graphics.c
===================================================================
--- trunk/navit/navit/graphics.c 2015-01-25 13:35:36 UTC (rev 6008)
+++ trunk/navit/navit/graphics.c 2015-01-25 13:35:47 UTC (rev 6009)
@@ -2548,7 +2548,7 @@
graphics_background_gc(gra, gra->gc[0]);
if (flags & 1)
callback_list_call_attr_0(gra->cbl, attr_predraw);
- gra->meth.draw_mode(gra->priv, (flags & 8)?draw_mode_begin_clear:draw_mode_begin);
+ gra->meth.draw_mode(gra->priv, draw_mode_begin);
if (!(flags & 2))
gra->meth.draw_rectangle(gra->priv, gra->gc[0]->priv, &gra->r.lu, gra->r.rl.x-gra->r.lu.x, gra->r.rl.y-gra->r.lu.y);
if (l) {
Modified: trunk/navit/navit/graphics.h
===================================================================
--- trunk/navit/navit/graphics.h 2015-01-25 13:35:36 UTC (rev 6008)
+++ trunk/navit/navit/graphics.h 2015-01-25 13:35:47 UTC (rev 6009)
@@ -37,7 +37,7 @@
/* This enum must be synchronized with the constants in NavitGraphics.java. */
enum draw_mode_num {
- draw_mode_begin, draw_mode_begin_clear, draw_mode_end, draw_mode_cursor, draw_mode_end_lazy
+ draw_mode_begin, draw_mode_end, draw_mode_end_lazy
};
struct graphics_priv;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-25 13:35:42
|
Revision: 6008
http://sourceforge.net/p/navit/code/6008
Author: sleske
Date: 2015-01-25 13:35:36 +0000 (Sun, 25 Jan 2015)
Log Message:
-----------
Refactor:android:Named constants for draw_mode values.
Modified Paths:
--------------
trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
trunk/navit/navit/graphics.h
Modified: trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java
===================================================================
--- trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2015-01-25 13:35:27 UTC (rev 6007)
+++ trunk/navit/navit/android/src/org/navitproject/navit/NavitGraphics.java 2015-01-25 13:35:36 UTC (rev 6008)
@@ -930,19 +930,29 @@
// float fy = y;
draw_canvas.drawBitmap(bitmap, x, y, paint);
}
+
+ /* These constants must be synchronized with enum draw_mode_num in graphics.h. */
+ public static final int draw_mode_begin = 0;
+ public static final int draw_mode_begin_clear = 1;
+ public static final int draw_mode_end = 2;
+ public static final int draw_mode_cursor = 3;
+ public static final int draw_mode_end_lazy = 4;
+
protected void draw_mode(int mode)
{
//Log.e("NavitGraphics", "draw_mode mode=" + mode + " parent_graphics="
// + String.valueOf(parent_graphics));
- if (mode == 2) {
+ if (mode == draw_mode_end) {
if (parent_graphics == null) {
view.invalidate();
} else {
parent_graphics.view.invalidate(get_rect());
}
}
- if (mode == 1 || (mode == 0 && parent_graphics != null)) draw_bitmap.eraseColor(0);
+ if (mode == draw_mode_begin_clear || (mode == draw_mode_begin && parent_graphics != null)) {
+ draw_bitmap.eraseColor(0);
+ }
}
protected void draw_drag(int x, int y)
Modified: trunk/navit/navit/graphics.h
===================================================================
--- trunk/navit/navit/graphics.h 2015-01-25 13:35:27 UTC (rev 6007)
+++ trunk/navit/navit/graphics.h 2015-01-25 13:35:36 UTC (rev 6008)
@@ -35,6 +35,7 @@
struct display_list;
struct mapset;
+/* This enum must be synchronized with the constants in NavitGraphics.java. */
enum draw_mode_num {
draw_mode_begin, draw_mode_begin_clear, draw_mode_end, draw_mode_cursor, draw_mode_end_lazy
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-25 13:35:34
|
Revision: 6007
http://sourceforge.net/p/navit/code/6007
Author: sleske
Date: 2015-01-25 13:35:27 +0000 (Sun, 25 Jan 2015)
Log Message:
-----------
Fix:graphics_gtk_drawing_area:Remove useless code for drawing directly into window.
Modified Paths:
--------------
trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
Modified: trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
===================================================================
--- trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c 2015-01-25 13:35:15 UTC (rev 6006)
+++ trunk/navit/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c 2015-01-25 13:35:27 UTC (rev 6007)
@@ -292,19 +292,13 @@
static void
draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
{
- if (gr->mode == draw_mode_begin || gr->mode == draw_mode_end)
- gdk_draw_lines(gr->drawable, gc->gc, (GdkPoint *)p, count);
- if (gr->mode == draw_mode_end || gr->mode == draw_mode_cursor)
- gdk_draw_lines(gr->widget->window, gc->gc, (GdkPoint *)p, count);
+ gdk_draw_lines(gr->drawable, gc->gc, (GdkPoint *)p, count);
}
static void
draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
{
- if (gr->mode == draw_mode_begin || gr->mode == draw_mode_end)
- gdk_draw_polygon(gr->drawable, gc->gc, TRUE, (GdkPoint *)p, count);
- if (gr->mode == draw_mode_end || gr->mode == draw_mode_cursor)
- gdk_draw_polygon(gr->widget->window, gc->gc, TRUE, (GdkPoint *)p, count);
+ gdk_draw_polygon(gr->drawable, gc->gc, TRUE, (GdkPoint *)p, count);
}
static void
@@ -316,10 +310,7 @@
static void
draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r)
{
- if (gr->mode == draw_mode_begin || gr->mode == draw_mode_end)
- gdk_draw_arc(gr->drawable, gc->gc, FALSE, p->x-r/2, p->y-r/2, r, r, 0, 64*360);
- if (gr->mode == draw_mode_end || gr->mode == draw_mode_cursor)
- gdk_draw_arc(gr->widget->window, gc->gc, FALSE, p->x-r/2, p->y-r/2, r, r, 0, 64*360);
+ gdk_draw_arc(gr->drawable, gc->gc, FALSE, p->x-r/2, p->y-r/2, r, r, 0, 64*360);
}
static void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-25 13:35:23
|
Revision: 6006
http://sourceforge.net/p/navit/code/6006
Author: sleske
Date: 2015-01-25 13:35:15 +0000 (Sun, 25 Jan 2015)
Log Message:
-----------
Refactor:core:Doxygen comment.
Modified Paths:
--------------
trunk/navit/navit/navit.c
Modified: trunk/navit/navit/navit.c
===================================================================
--- trunk/navit/navit/navit.c 2015-01-23 21:30:53 UTC (rev 6005)
+++ trunk/navit/navit/navit.c 2015-01-25 13:35:15 UTC (rev 6006)
@@ -2982,7 +2982,9 @@
/**
* Toggle the cursor update : refresh the map each time the cursor has moved (instead of only when it reaches a border)
*
- * @param navit The navit instance
+ * @param this_ The navit instance
+ * @param nv vehicle to draw
+ * @param pnt Screen coordinates of the vehicle. If NULL, position stored in nv is used.
* @returns nothing
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-23 21:30:56
|
Revision: 6005
http://sourceforge.net/p/navit/code/6005
Author: mdankov
Date: 2015-01-23 21:30:53 +0000 (Fri, 23 Jan 2015)
Log Message:
-----------
Add:port_android:Do not include prescaled images without size specifiers on Android.
Modified Paths:
--------------
trunk/navit/CMakeLists.txt
Modified: trunk/navit/CMakeLists.txt
===================================================================
--- trunk/navit/CMakeLists.txt 2015-01-23 21:25:26 UTC (rev 6004)
+++ trunk/navit/CMakeLists.txt 2015-01-23 21:30:53 UTC (rev 6005)
@@ -444,21 +444,21 @@
IF(NOT ANDROID)
set(svg2png_scaling 0 16 32 48 64 96)
ELSE()
- set(svg2png_scaling 24 32 48 64 96 128)
+ set(svg2png_scaling -1 24 32 48 64 96 128)
ENDIF()
ENDIF()
IF(NOT svg2png_scaling_flag)
IF(NOT ANDROID)
set(svg2png_scaling_flag 32)
ELSE()
- set(svg2png_scaling_flag 32 64 96)
+ set(svg2png_scaling_flag -1 24 32 64 96)
ENDIF()
ENDIF()
IF(NOT svg2png_scaling_nav)
IF(NOT ANDROID)
set(svg2png_scaling_nav 64)
ELSE()
- set(svg2png_scaling_nav 24 32 48 64 96 128)
+ set(svg2png_scaling_nav -1 24 32 48 64 96 128)
ENDIF()
ENDIF()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-23 21:25:34
|
Revision: 6004
http://sourceforge.net/p/navit/code/6004
Author: mdankov
Date: 2015-01-23 21:25:26 +0000 (Fri, 23 Jan 2015)
Log Message:
-----------
Fix:core:Better algorithm to select prescaled image to rescale. Try at first to load all bigger ones, then go down in standard sizes row.
Modified Paths:
--------------
trunk/navit/navit/graphics.c
Modified: trunk/navit/navit/graphics.c
===================================================================
--- trunk/navit/navit/graphics.c 2015-01-21 21:14:07 UTC (rev 6003)
+++ trunk/navit/navit/graphics.c 2015-01-23 21:25:26 UTC (rev 6004)
@@ -651,10 +651,10 @@
break;
case 5:
mode++;
+ i=0;
/* If we have no size specifiers, try the default png now */
if(sz<=0) {
new_name=g_strdup_printf("%s.png", name);
- i=0;
break;
}
/* Find best matching size from standard row */
@@ -664,12 +664,15 @@
i=1;
/* Fall through */
case 6:
- /* Select closest matching image from standard row */
+ /* Select best matching image from standard row */
if(sz>0) {
/* If size were specified, start with bmstd and then try standard sizes in row
- * bmstd-1, bmstd+1, bmstd-2, bmstd+2 etc */
- n=bmstd+(i/2)*((i%2)*2-1);
- if(++i==numstdsizes*2)
+ * bmstd, bmstd+1, bmstd+2, .. numstdsizes-1, bmstd-1, bmstd-2, .., 0 */
+ n=bmstd+i;
+ if((bmstd+i)>=numstdsizes)
+ n=numstdsizes-i-1;
+
+ if(++i==numstdsizes)
mode++;
} else {
/* If no size were specified, start with the smallest standard size and then try following ones */
@@ -698,7 +701,7 @@
this_->width=width;
this_->height=height;
- dbg(lvl_info,"Trying to load image '%s' for '%s' at %dx%d\n", new_name, path, width, height);
+ dbg(lvl_debug,"Trying to load image '%s' for '%s' at %dx%d\n", new_name, path, width, height);
if (zip) {
unsigned char *start;
int len;
@@ -714,7 +717,7 @@
this_->priv=gra->meth.image_new(gra->priv, &this_->meth, new_name, &this_->width, &this_->height, &this_->hot, rotate);
}
if (this_->priv) {
- dbg(lvl_debug,"Using image '%s' for '%s' at %dx%d\n", new_name, path, width, height);
+ dbg(lvl_info,"Using image '%s' for '%s' at %dx%d\n", new_name, path, width, height);
g_free(new_name);
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-21 21:14:10
|
Revision: 6003
http://sourceforge.net/p/navit/code/6003
Author: mdankov
Date: 2015-01-21 21:14:07 +0000 (Wed, 21 Jan 2015)
Log Message:
-----------
Fix:graphics_android:When scaling image, report scaled size of image, not size it had before scaling.
Modified Paths:
--------------
trunk/navit/navit/graphics/android/graphics_android.c
Modified: trunk/navit/navit/graphics/android/graphics_android.c
===================================================================
--- trunk/navit/navit/graphics/android/graphics_android.c 2015-01-19 22:07:16 UTC (rev 6002)
+++ trunk/navit/navit/graphics/android/graphics_android.c 2015-01-21 21:14:07 UTC (rev 6003)
@@ -243,7 +243,7 @@
if (localBitmap) {
ret->width=(*jnienv)->CallIntMethod(jnienv, localBitmap, gra->Bitmap_getWidth);
ret->height=(*jnienv)->CallIntMethod(jnienv, localBitmap, gra->Bitmap_getHeight);
- if(*w!=-1 || *h!=-1) {
+ if((*w!=-1 && *w!=ret->width) || (*h!=-1 && *w!=ret->height)) {
jclass scaledBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapClass,
gra->Bitmap_createScaledBitmap, localBitmap, (*w==-1)?ret->width:*w, (*h==-1)?ret->height:*h, JNI_TRUE);
if(!scaledBitmap) {
@@ -251,6 +251,8 @@
} else {
(*jnienv)->DeleteLocalRef(jnienv, localBitmap);
localBitmap=scaledBitmap;
+ ret->width=(*jnienv)->CallIntMethod(jnienv, localBitmap, gra->Bitmap_getWidth);
+ ret->height=(*jnienv)->CallIntMethod(jnienv, localBitmap, gra->Bitmap_getHeight);
}
}
ret->Bitmap = (*jnienv)->NewGlobalRef(jnienv, localBitmap);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-19 22:07:18
|
Revision: 6002
http://sourceforge.net/p/navit/code/6002
Author: sleske
Date: 2015-01-19 22:07:16 +0000 (Mon, 19 Jan 2015)
Log Message:
-----------
Fix:graphics/qt_qpainter:Remove code for Qt <4. We currently require Qt >=4.7.
Modified Paths:
--------------
trunk/navit/navit/graphics/qt_qpainter/RenderArea.cpp
trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h
Modified: trunk/navit/navit/graphics/qt_qpainter/RenderArea.cpp
===================================================================
--- trunk/navit/navit/graphics/qt_qpainter/RenderArea.cpp 2015-01-19 22:07:07 UTC (rev 6001)
+++ trunk/navit/navit/graphics/qt_qpainter/RenderArea.cpp 2015-01-19 22:07:16 UTC (rev 6002)
@@ -25,11 +25,7 @@
EmbeddedWidget::EmbeddedWidget(struct graphics_priv *priv, QWidget* child, QWidget *parent)
: QX11EmbedWidget(parent) {
this->gra=priv;
-#if QT_VERSION >= 0x040000
this->setWindowTitle(priv->window_title);
-#else
- this->setCaption(priv->window_title);
-#endif
QStackedLayout* _outerLayout = new QStackedLayout(this);
this->setLayout(_outerLayout);
_outerLayout->addWidget(child);
@@ -58,11 +54,7 @@
grabGesture(Qt::SwipeGesture);
grabGesture(Qt::PanGesture);
#endif
-#if QT_VERSION >= 0x040000
setWindowTitle(priv->window_title);
-#else
- setCaption(priv->window_title);
-#endif
}
#endif
is_overlay=overlay;
@@ -72,13 +64,9 @@
timer_callback=g_hash_table_new(NULL, NULL);
watches=g_hash_table_new(NULL, NULL);
#ifndef QT_QPAINTER_NO_WIDGET
-#if QT_VERSION >= 0x040000
setAttribute(Qt::WA_OpaquePaintEvent, true);
-#else
- setBackgroundMode(QWidget::NoBackground);
#endif
#endif
-#endif
}
//##############################################################################################################
@@ -234,12 +222,7 @@
void RenderArea::keyPressEvent(QKeyEvent *event)
{
QString str=event->text();
-#if QT_VERSION < 0x040000
- QCString cstr=str.utf8();
- const char *text=cstr;
-#else
const char *text=str.toUtf8().constData();
-#endif
dbg(lvl_debug,"enter text='%s' 0x%x (%zu) key=%d\n", text, text[0], strlen(text), event->key());
if (!text || !text[0] || text[0] == 0x7f) {
dbg(lvl_debug,"special key\n");
Modified: trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
===================================================================
--- trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2015-01-19 22:07:07 UTC (rev 6001)
+++ trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2015-01-19 22:07:16 UTC (rev 6002)
@@ -95,23 +95,14 @@
if (!overlay->overlay_disable && r->intersects(ovr)) {
unsigned char *data;
int i,size=ovr.width()*ovr.height();
-#if QT_VERSION < 0x040000
- QImage img=overlay->widget->pixmap->convertToImage();
- img.setAlphaBuffer(1);
-#else
QImage img=overlay->widget->pixmap->toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
-#endif
data=img.bits();
for (i = 0 ; i < size ; i++) {
if (data[0] == overlay->rgba[0] && data[1] == overlay->rgba[1] && data[2] == overlay->rgba[2])
data[3]=overlay->rgba[3];
data+=4;
}
-#if QT_VERSION < 0x040000
- painter.drawImage(QPoint(ovr.x()-r->x(),ovr.y()-r->y()), img, 0);
-#else
painter.drawImage(QPoint(ovr.x()-r->x(),ovr.y()-r->y()), img);
-#endif
}
overlay=overlay->next;
}
@@ -231,11 +222,7 @@
//##############################################################################################################
static void gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
{
-#if QT_VERSION >= 0x040000
QColor col(c->r >> 8, c->g >> 8, c->b >> 8 /* , c->a >> 8 */);
-#else
- QColor col(c->r >> 8, c->g >> 8, c->b >> 8);
-#endif
gc->pen->setColor(col);
gc->brush->setColor(col);
gc->c=*c;
@@ -340,11 +327,7 @@
static void draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
{
int i;
-#if QT_VERSION >= 0x040000
QPolygon polygon;
-#else
- QPointArray polygon;
-#endif
for (i = 0 ; i < count ; i++)
polygon.putPoints(i, 1, p[i].x, p[i].y);
@@ -360,11 +343,7 @@
static void draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
{
int i;
-#if QT_VERSION >= 0x040000
QPolygon polygon;
-#else
- QPointArray polygon;
-#endif
for (i = 0 ; i < count ; i++)
polygon.putPoints(i, 1, p[i].x, p[i].y);
@@ -407,15 +386,9 @@
#ifndef QT_QPAINTER_USE_FREETYPE
QString tmp=QString::fromUtf8(text);
#ifndef QT_NO_TRANSFORMATIONS
-#if QT_VERSION >= 0x040000
QMatrix sav=gr->painter->worldMatrix();
QMatrix m(dx/65535.0,dy/65535.0,-dy/65535.0,dx/65535.0,p->x,p->y);
painter->setWorldMatrix(m,TRUE);
-#else
- QWMatrix sav=gr->painter->worldMatrix();
- QWMatrix m(dx/65535.0,dy/65535.0,-dy/65535.0,dx/65535.0,p->x,p->y);
- painter->setWorldMatrix(m,TRUE);
-#endif
painter->setPen(*fg->pen);
painter->setFont(*font->font);
painter->drawText(0, 0, tmp);
@@ -445,16 +418,9 @@
g=*gp++;
if (g->w && g->h) {
unsigned char *data;
-#if QT_VERSION < 0x040000
- QImage img(g->w+2, g->h+2, 32);
- img.setAlphaBuffer(1);
- data=img.bits();
- gr->freetype_methods.get_shadow(g,(unsigned char *)(img.jumpTable()),32,0,bgc,&transparent);
-#else
QImage img(g->w+2, g->h+2, QImage::Format_ARGB32_Premultiplied);
data=img.bits();
gr->freetype_methods.get_shadow(g,(unsigned char *)data,32,img.bytesPerLine(),bgc,&transparent);
-#endif
painter->drawImage(((x+g->x)>>6)-1, ((y+g->y)>>6)-1, img);
}
@@ -471,16 +437,9 @@
g=*gp++;
if (g->w && g->h) {
unsigned char *data;
-#if QT_VERSION < 0x040000
- QImage img(g->w, g->h, 32);
- img.setAlphaBuffer(1);
- data=img.bits();
- gr->freetype_methods.get_glyph(g,(unsigned char *)(img.jumpTable()),32,0,fgc,bgc,&transparent);
-#else
QImage img(g->w, g->h, QImage::Format_ARGB32_Premultiplied);
data=img.bits();
gr->freetype_methods.get_glyph(g,(unsigned char *)data,32,img.bytesPerLine(),fgc,bgc,&transparent);
-#endif
painter->drawImage((x+g->x)>>6, (y+g->y)>>6, img);
}
x+=g->dx;
@@ -550,25 +509,12 @@
dbg(lvl_debug,"mode for %p %d\n", gr, mode);
QRect r;
if (mode == draw_mode_begin) {
-#if QT_VERSION >= 0x040000
if (gr->widget->pixmap->paintingActive()) {
gr->widget->pixmap->paintEngine()->painter()->end();
}
-#endif
gr->painter->begin(gr->widget->pixmap);
-#if 0
- gr->painter->fillRect(QRect(QPoint(0,0), gr->widget->size()), *gr->background_gc->brush);
-#endif
}
-#if QT_VERSION < 0x040000
- if (mode == draw_mode_cursor) {
- gr->painter->begin(gr->widget);
- }
-#endif
if (mode == draw_mode_end) {
-#if 0
- if (gr->mode == draw_mode_begin) {
-#endif
gr->painter->end();
if (gr->parent) {
if (gr->cleanup) {
@@ -582,23 +528,12 @@
r.setRect(0, 0, gr->widget->pixmap->width(), gr->widget->pixmap->height());
qt_qpainter_draw(gr, &r, 0);
}
-#if 0
- } else {
-#if QT_VERSION < 0x040000
- gr->painter->end();
-#endif
- }
-#endif
-#if QT_VERSION >= 0x040000
if (!gr->parent)
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers|QEventLoop::DeferredDeletion|QEventLoop::X11ExcludeTimers);
-#endif
}
-#if QT_VERSION >= 0x040000
if (mode == draw_mode_end_lazy) {
gr->painter->end();
}
-#endif
gr->mode=mode;
}
Modified: trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h
===================================================================
--- trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h 2015-01-19 22:07:07 UTC (rev 6001)
+++ trunk/navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h 2015-01-19 22:07:16 UTC (rev 6002)
@@ -36,6 +36,9 @@
#include "navit/navit.h"
#include <qglobal.h>
+#if QT_VERSION < 0x040000
+#error "Support for Qt 3 was dropped in rev 5999."
+#endif
#ifndef QT_QPAINTER_USE_FREETYPE
#define QT_QPAINTER_USE_FREETYPE 1
@@ -45,25 +48,6 @@
#include "navit/font/freetype/font_freetype.h"
#endif
-#if QT_VERSION < 0x040000
-#include <qwidget.h>
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qbrush.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qpixmapcache.h>
-#include <qlistview.h>
-#include <qobject.h>
-#include <qsocketnotifier.h>
-#ifdef HAVE_QPE
-#include <qpe/qpeapplication.h>
-#endif
-#ifndef QT_QPAINTER_USE_EVENT_QT
-#define QT_QPAINTER_USE_EVENT_QT 1
-#endif
-#else
#include <QResizeEvent>
#include <QApplication>
#if QT_VERSION >= 0x040200
@@ -92,8 +76,6 @@
#endif
#endif
-#endif
-
#ifdef QT_QPAINTER_USE_EMBEDDING
#include <QX11EmbedWidget>
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-19 22:07:09
|
Revision: 6001
http://sourceforge.net/p/navit/code/6001
Author: sleske
Date: 2015-01-19 22:07:07 +0000 (Mon, 19 Jan 2015)
Log Message:
-----------
Fix:map_binfile:Log map file name with warnings and errors.
Modified Paths:
--------------
trunk/navit/navit/map/binfile/binfile.c
Modified: trunk/navit/navit/map/binfile/binfile.c
===================================================================
--- trunk/navit/navit/map/binfile/binfile.c 2015-01-19 22:06:58 UTC (rev 6000)
+++ trunk/navit/navit/map/binfile/binfile.c 2015-01-19 22:07:07 UTC (rev 6001)
@@ -243,7 +243,7 @@
eoc_to_cpu(eoc);
dbg(lvl_debug,"sig 0x%x\n", eoc->zipesig);
if (eoc->zipesig != zip_eoc_sig) {
- dbg(lvl_error,"eoc signature check failed: 0x%x vs 0x%x\n",eoc->zipesig,zip_eoc_sig);
+ dbg(lvl_error,"map file %s: eoc signature check failed: 0x%x vs 0x%x\n", fi->name, eoc->zipesig,zip_eoc_sig);
file_data_free(fi,(unsigned char *)eoc);
eoc=NULL;
}
@@ -262,14 +262,14 @@
dbg(lvl_debug,"sig 0x%x\n", eocl->zip64lsig);
if (eocl->zip64lsig != zip64_eocl_sig) {
file_data_free(fi,(unsigned char *)eocl);
- dbg(lvl_warning,"eocl wrong\n");
+ dbg(lvl_warning,"map file %s: eocl wrong\n", fi->name);
return NULL;
}
eoc=(struct zip64_eoc *)file_data_read(fi,eocl->zip64lofst, sizeof(struct zip64_eoc));
if (eoc) {
if (eoc->zip64esig != zip64_eoc_sig) {
file_data_free(fi,(unsigned char *)eoc);
- dbg(lvl_warning,"eoc wrong\n");
+ dbg(lvl_warning,"map file %s: eoc wrong\n", fi->name);
eoc=NULL;
}
dbg(lvl_debug,"eoc64 ok 0x"LONGLONG_HEX_FMT " 0x"LONGLONG_HEX_FMT "\n",eoc->zip64eofst,eoc->zip64ecsz);
@@ -389,12 +389,12 @@
ret=file_data_read_encrypted(fi, offset, lfh->zipsize, lfh->zipuncmp, 1, m->passwd);
break;
default:
- dbg(lvl_error,"Unknown encrypted compression method %d\n",enc->compress_method);
+ dbg(lvl_error,"map file %s: unknown encrypted compression method %d\n", fi->name, enc->compress_method);
}
file_data_free(fi, (unsigned char *)enc);
break;
default:
- dbg(lvl_error,"Unknown compression method %d\n", lfh->zipmthd);
+ dbg(lvl_error,"map file %s: unknown compression method %d\n", fi->name, lfh->zipmthd);
}
return ret;
}
@@ -2564,7 +2564,7 @@
struct zip_cd *first_cd;
int i;
if (!(m->eoc=binfile_read_eoc(m->fi))) {
- dbg(lvl_error,"unable to read eoc\n");
+ dbg(lvl_error,"map file %s: unable to read eoc\n", filename);
return 0;
}
dbg_assert(m->eoc->zipedsk == m->eoc->zipecen);
@@ -2583,11 +2583,11 @@
dbg(lvl_debug,"num_disk %d\n",m->eoc->zipedsk);
m->eoc64=binfile_read_eoc64(m->fi);
if (!binfile_get_index(m)) {
- dbg(lvl_error,"no index found\n");
+ dbg(lvl_error,"map file %s: no index found\n", filename);
return 0;
}
if (!(first_cd=binfile_read_cd(m, 0, 0))) {
- dbg(lvl_error,"unable to get first cd\n");
+ dbg(lvl_error,"map file %s: unable to get first cd\n", filename);
return 0;
}
m->cde_size=sizeof(struct zip_cd)+first_cd->zipcfnl+first_cd->zipcxtl;
@@ -2717,7 +2717,7 @@
return 0;
}
} else if (*magic == zip_lfh_sig_rev || *magic == zip_split_sig_rev || *magic == zip_cd_sig_rev || *magic == zip64_eoc_sig_rev) {
- dbg(lvl_error,"endianness mismatch\n");
+ dbg(lvl_error,"endianness mismatch for '%s'\n", m->filename);
file_destroy(m->fi);
m->fi=NULL;
return 0;
@@ -2744,7 +2744,8 @@
}
map_rect_destroy_binfile(mr);
if (m->map_version >= 16) {
- dbg(lvl_error,"Warning: This map is incompatible with your navit version. Please update navit.\n");
+ dbg(lvl_error,"%s: This map is incompatible with your navit version. Please update navit. (map version %d)\n",
+ m->filename, m->map_version);
return 0;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-19 22:07:01
|
Revision: 6000
http://sourceforge.net/p/navit/code/6000
Author: sleske
Date: 2015-01-19 22:06:58 +0000 (Mon, 19 Jan 2015)
Log Message:
-----------
Fix:core:Do not log debug message as warning.
Modified Paths:
--------------
trunk/navit/navit/navigation.c
Modified: trunk/navit/navit/navigation.c
===================================================================
--- trunk/navit/navit/navigation.c 2015-01-19 22:06:40 UTC (rev 5999)
+++ trunk/navit/navit/navigation.c 2015-01-19 22:06:58 UTC (rev 6000)
@@ -1424,7 +1424,7 @@
if (reason)
*reason=r;
if (r)
- dbg(1, "%s %s -> %s %s: %s\n", old->way.name2, old->way.name1, new->way.name2, new->way.name1, r);
+ dbg(lvl_debug, "%s %s -> %s %s: %s\n", old->way.name2, old->way.name1, new->way.name2, new->way.name1, r);
return ret;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-19 22:06:48
|
Revision: 5999
http://sourceforge.net/p/navit/code/5999
Author: sleske
Date: 2015-01-19 22:06:40 +0000 (Mon, 19 Jan 2015)
Log Message:
-----------
Refactor:binding_dbus:Remove unused (and wrong) code, add missing #include.
Modified Paths:
--------------
trunk/navit/navit/binding/dbus/binding_dbus.c
Modified: trunk/navit/navit/binding/dbus/binding_dbus.c
===================================================================
--- trunk/navit/navit/binding/dbus/binding_dbus.c 2015-01-19 22:06:24 UTC (rev 5998)
+++ trunk/navit/navit/binding/dbus/binding_dbus.c 2015-01-19 22:06:40 UTC (rev 5999)
@@ -50,6 +50,7 @@
#include "layout.h"
#include "roadprofile.h"
#include "util.h"
+#include "transform.h"
static DBusConnection *connection;
@@ -1299,7 +1300,6 @@
request_navit_route_export_gpx(DBusConnection *connection, DBusMessage *message)
{
char * filename;
- struct point p, *pp=NULL;
struct navit *navit;
DBusMessageIter iter;
@@ -1311,14 +1311,6 @@
dbus_message_iter_get_basic(&iter, &filename);
- if (dbus_message_iter_has_next(&iter))
- {
- dbus_message_iter_next(&iter);
- if (!point_get_from_message(message, &iter, &p))
- return dbus_error_invalid_parameter(connection, message);
- pp=&p;
- }
-
struct navigation *nav = navit_get_navigation(navit);
if(!nav) {
return dbus_error_navigation_not_configured(connection, message);
@@ -1329,10 +1321,9 @@
struct map * map=NULL;
struct map_rect * mr=NULL;
struct item *item = NULL;
- struct attr attr,route;
+ struct attr attr;
struct coord c;
struct coord_geo g;
- struct transformation *trans;
char *header = "<?xml version='1.0' encoding='UTF-8'?>\n"
"<gpx version='1.1' creator='Navit http://navit.sourceforge.net'\n"
@@ -1346,7 +1337,6 @@
map = navigation_get_map(nav);
if(map)
mr = map_rect_new(map,NULL);
- trans = navit_get_trans (nav);
FILE *fp;
fp = fopen(filename,"w");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sl...@us...> - 2015-01-19 22:06:31
|
Revision: 5998
http://sourceforge.net/p/navit/code/5998
Author: sleske
Date: 2015-01-19 22:06:24 +0000 (Mon, 19 Jan 2015)
Log Message:
-----------
Fix:binding_dbus:Do not crash if navigation is not configured.|It really helps to read the compiler warnings :-).
Modified Paths:
--------------
trunk/navit/navit/binding/dbus/binding_dbus.c
trunk/navit/navit/navigation.c
Modified: trunk/navit/navit/binding/dbus/binding_dbus.c
===================================================================
--- trunk/navit/navit/binding/dbus/binding_dbus.c 2015-01-18 20:52:11 UTC (rev 5997)
+++ trunk/navit/navit/binding/dbus/binding_dbus.c 2015-01-19 22:06:24 UTC (rev 5998)
@@ -362,6 +362,12 @@
}
static DBusHandlerResult
+dbus_error_navigation_not_configured(DBusConnection *connection, DBusMessage *message)
+{
+ return dbus_error(connection, message, DBUS_ERROR_FAILED, "navigation is not configured (no <navigation> element in config file?)");
+}
+
+static DBusHandlerResult
dbus_error_no_data_available(DBusConnection *connection, DBusMessage *message)
{
#if 1
@@ -1313,10 +1319,14 @@
pp=&p;
}
+ struct navigation *nav = navit_get_navigation(navit);
+ if(!nav) {
+ return dbus_error_navigation_not_configured(connection, message);
+ }
+
dbg(lvl_debug,"Dumping route from dbus to %s\n", filename);
struct map * map=NULL;
- struct navigation * nav = NULL;
struct map_rect * mr=NULL;
struct item *item = NULL;
struct attr attr,route;
@@ -1333,10 +1343,6 @@
"<rte>\n";
char *trailer = "</rte>\n</gpx>\n";
- nav = navit_get_navigation(navit);
- if(!nav) {
- return;
- }
map = navigation_get_map(nav);
if(map)
mr = map_rect_new(map,NULL);
Modified: trunk/navit/navit/navigation.c
===================================================================
--- trunk/navit/navit/navigation.c 2015-01-18 20:52:11 UTC (rev 5997)
+++ trunk/navit/navit/navigation.c 2015-01-19 22:06:24 UTC (rev 5998)
@@ -1205,7 +1205,6 @@
{
int ret=0,d,dw,dlim,dc;
char *r=NULL;
- struct navigation_way *w;
int cat,ncat,wcat,maxcat,left=-180,right=180,is_unambiguous=0,is_same_street;
int curve_limit=25; /* any angle less than this is considered straight */
int junction_limit = 100; /* maximum distance between two carriageways at a junction */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-18 20:52:14
|
Revision: 5997
http://sourceforge.net/p/navit/code/5997
Author: mdankov
Date: 2015-01-18 20:52:11 +0000 (Sun, 18 Jan 2015)
Log Message:
-----------
Fix:core:Fix regressions of svn 5989. Do not crash if gps_status width is not specified, draw circle around osd_speedwarner, fix comment of attr_rel2real.
Modified Paths:
--------------
trunk/navit/navit/attr.c
trunk/navit/navit/osd/core/osd_core.c
Modified: trunk/navit/navit/attr.c
===================================================================
--- trunk/navit/navit/attr.c 2015-01-09 00:07:28 UTC (rev 5996)
+++ trunk/navit/navit/attr.c 2015-01-18 20:52:11 UTC (rev 5997)
@@ -982,7 +982,7 @@
* @param whole Range counted as 100%.
* @param treat_neg_as_rel Replace negative absolute values with whole+attr.u.num.
*
- * @return True if the attribute type was found, false if it was not found, {@code deflt} if types is empty.
+ * @return Absolute value corresponding to given relative value.
*/
int attr_rel2real(int attrval, int whole, int treat_neg_as_rel)
{
Modified: trunk/navit/navit/osd/core/osd_core.c
===================================================================
--- trunk/navit/navit/osd/core/osd_core.c 2015-01-09 00:07:28 UTC (rev 5996)
+++ trunk/navit/navit/osd/core/osd_core.c 2015-01-18 20:52:11 UTC (rev 5997)
@@ -2396,6 +2396,11 @@
osd_set_std_graphic(nav, &opc->osd_item, (struct osd_priv *)opc);
navit_add_callback(nav, callback_new_attr_1(callback_cast(osd_speed_warner_draw), attr_position_coord_geo, opc));
+ this->d=opc->osd_item.w;
+ if (opc->osd_item.h < this->d)
+ this->d=opc->osd_item.h;
+ this->width=this->d/10;
+
if(this->label_str && !strncmp("images:",this->label_str,7)) {
char *tok1=NULL, *tok2=NULL, *tok3=NULL;
strtok(this->label_str,":");
@@ -2490,10 +2495,6 @@
else
this->announce_on = 1; //announce by default
osd_set_std_attr(attrs, &opc->osd_item, 2);
- this->d=opc->osd_item.w;
- if (opc->osd_item.h < this->d)
- this->d=opc->osd_item.h;
- this->width=this->d/10;
navit_add_callback(nav, callback_new_attr_1(callback_cast(osd_speed_warner_init), attr_graphics_ready, opc));
return (struct osd_priv *) opc;
}
@@ -3244,7 +3245,7 @@
opc->osd_item.rel_y = -80;
opc->osd_item.rel_w = 60;
opc->osd_item.navit = nav;
- opc->osd_item.h = 40;
+ opc->osd_item.rel_h = 40;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_gps_status_draw);
meth->set_attr = set_std_osd_attr;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-09 00:07:35
|
Revision: 5996
http://sourceforge.net/p/navit/code/5996
Author: mdankov
Date: 2015-01-09 00:07:28 +0000 (Fri, 09 Jan 2015)
Log Message:
-----------
Fix:core:Report errors if graphics or event system is not present.
Modified Paths:
--------------
trunk/navit/navit/event.c
trunk/navit/navit/graphics.c
Modified: trunk/navit/navit/event.c
===================================================================
--- trunk/navit/navit/event.c 2015-01-08 20:23:14 UTC (rev 5995)
+++ trunk/navit/navit/event.c 2015-01-09 00:07:28 UTC (rev 5996)
@@ -29,12 +29,24 @@
static int has_quit;
+#define require_method_helper(m)\
+ if(!event_methods.m) {\
+ dbg(lvl_error, "Can't find event system method %s. Event system is %s%s\n",\
+ #m ,e_system?"set to ":"not set.", e_system?e_system:"");\
+
+#define require_method(m)\
+ require_method_helper(m)\
+ return;\
+ }
+
+#define require_method2(m,r)\
+ require_method_helper(m)\
+ return r;\
+ }
+
void event_main_loop_run(void)
{
- if (! event_methods.main_loop_run) {
- dbg(lvl_error,"no event system set\n");
- return;
- }
+ require_method(main_loop_run);
event_methods.main_loop_run();
}
@@ -54,42 +66,49 @@
struct event_watch *
event_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
+ require_method2(add_watch, NULL);
return event_methods.add_watch(fd, cond, cb);
}
void
event_remove_watch(struct event_watch *ev)
{
+ require_method(remove_watch);
event_methods.remove_watch(ev);
}
struct event_timeout *
event_add_timeout(int timeout, int multi, struct callback *cb)
{
+ require_method2(add_timeout, NULL);
return event_methods.add_timeout(timeout, multi, cb);
}
void
event_remove_timeout(struct event_timeout *ev)
{
+ require_method(remove_timeout);
event_methods.remove_timeout(ev);
}
struct event_idle *
event_add_idle(int priority, struct callback *cb)
{
+ require_method2(add_idle, NULL);
return event_methods.add_idle(priority,cb);
}
void
event_remove_idle(struct event_idle *ev)
{
+ require_method(remove_idle);
event_methods.remove_idle(ev);
}
void
event_call_callback(struct callback_list *cb)
{
+ require_method(call_callback);
event_methods.call_callback(cb);
}
Modified: trunk/navit/navit/graphics.c
===================================================================
--- trunk/navit/navit/graphics.c 2015-01-08 20:23:14 UTC (rev 5995)
+++ trunk/navit/navit/graphics.c 2015-01-09 00:07:28 UTC (rev 5996)
@@ -232,12 +232,15 @@
struct graphics_priv * (*graphicstype_new)(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl);
if (! (type_attr=attr_search(attrs, NULL, attr_type))) {
+ dbg(lvl_error,"Graphics plugin type is not set.\n");
return NULL;
}
graphicstype_new=plugin_get_graphics_type(type_attr->u.str);
- if (! graphicstype_new)
+ if (! graphicstype_new) {
+ dbg(lvl_error,"Failed to load graphics plugin %s.\n", type_attr->u.str);
return NULL;
+ }
this_=g_new0(struct graphics, 1);
this_->attrs=attr_list_dup(attrs);
this_->cbl=callback_list_new();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-08 20:23:25
|
Revision: 5995
http://sourceforge.net/p/navit/code/5995
Author: mdankov
Date: 2015-01-08 20:23:14 +0000 (Thu, 08 Jan 2015)
Log Message:
-----------
Fix:graphics_opengl:Destroy freetype instance in proper place.
Modified Paths:
--------------
trunk/navit/navit/graphics/opengl/graphics_opengl.c
Modified: trunk/navit/navit/graphics/opengl/graphics_opengl.c
===================================================================
--- trunk/navit/navit/graphics/opengl/graphics_opengl.c 2015-01-07 13:38:25 UTC (rev 5994)
+++ trunk/navit/navit/graphics/opengl/graphics_opengl.c 2015-01-08 20:23:14 UTC (rev 5995)
@@ -252,6 +252,7 @@
{
/*FIXME graphics_destroy is never called */
/*TODO add destroy code for image cache(delete entries in hImageData) */
+ gr->freetype_methods.destroy();
g_free(gr);
gr = NULL;
}
@@ -259,7 +260,6 @@
static void
gc_destroy(struct graphics_gc_priv *gc)
{
- gc->gr->freetype_methods.destroy();
g_free(gc);
gc = NULL;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-07 13:38:32
|
Revision: 5994
http://sourceforge.net/p/navit/code/5994
Author: mdankov
Date: 2015-01-07 13:38:25 +0000 (Wed, 07 Jan 2015)
Log Message:
-----------
Add:port_android:Better image sizes for high dpi screens, scale icons consistently, scale dashes of dashed lines propotionally to other graphic parameters. Related to #1181.
Modified Paths:
--------------
trunk/navit/navit/CMakeLists.txt
trunk/navit/navit/xslt/android.xslt
Modified: trunk/navit/navit/CMakeLists.txt
===================================================================
--- trunk/navit/navit/CMakeLists.txt 2015-01-07 13:30:21 UTC (rev 5993)
+++ trunk/navit/navit/CMakeLists.txt 2015-01-07 13:38:25 UTC (rev 5994)
@@ -139,12 +139,12 @@
endmacro()
if(ANDROID)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxxhdpi.xml OSD_SIZE=5.33 ICON_SMALL=96 ICON_MEDIUM=128 ICON_BIG=128)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxhdpi.xml OSD_SIZE=4 ICON_SMALL=64 ICON_MEDIUM=96 ICON_BIG=96)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxhdpi.xml OSD_SIZE=2.67 ICON_MEDIUM=64)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navithdpi.xml OSD_SIZE=2 ICON_MEDIUM=48)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitmdpi.xml OSD_SIZE=1.33)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitldpi.xml OSD_SIZE=1)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxxhdpi.xml OSD_SIZE=5.33 ICON_SMALL=128 ICON_MEDIUM=192 ICON_BIG=256)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxhdpi.xml OSD_SIZE=4 ICON_SMALL=96 ICON_MEDIUM=128 ICON_BIG=192)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxhdpi.xml OSD_SIZE=2.67 ICON_SMALL=64 ICON_MEDIUM=96 ICON_BIG=128)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navithdpi.xml OSD_SIZE=2 ICON_SMALL=48 ICON_MEDIUM=64 ICON_BIG=96)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitmdpi.xml OSD_SIZE=1.33 ICON_SMALL=32 ICON_MEDIUM=48 ICON_BIG=64)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitldpi.xml OSD_SIZE=1 ICON_SMALL=24 ICON_MEDIUM=32 ICON_BIG=48)
add_custom_target( navit_config_xml ALL DEPENDS navitxxxhdpi.xml navitxxhdpi.xml navitxhdpi.xml navithdpi.xml navitmdpi.xml navitldpi.xml)
else()
process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navit.xml "")
Modified: trunk/navit/navit/xslt/android.xslt
===================================================================
--- trunk/navit/navit/xslt/android.xslt 2015-01-07 13:30:21 UTC (rev 5993)
+++ trunk/navit/navit/xslt/android.xslt 2015-01-07 13:38:25 UTC (rev 5994)
@@ -66,7 +66,7 @@
</xsl:template>
<xsl:template match="/config/navit/layout/layer/itemgra/child::*">
<xsl:copy>
- <xsl:copy-of select="@*[not(name()='text_size') and not(name()='width') and not(name()='radius') and not(name()='w') and not(name()='h') and not(name()='x') and not(name()='y')]"/>
+ <xsl:copy-of select="@*[not(name()='text_size') and not(name()='width') and not(name()='radius') and not(name()='w') and not(name()='h') and not(name()='x') and not(name()='y') and not(name()='dash')]"/>
<xsl:if test="@text_size">
<xsl:attribute name="text_size"><xsl:value-of select="round(number(@text_size)*number($OSD_SIZE))"/></xsl:attribute>
</xsl:if>
@@ -77,8 +77,8 @@
<xsl:attribute name="radius"><xsl:value-of select="round(number(@radius)*number($OSD_SIZE))"/></xsl:attribute>
</xsl:if>
<xsl:if test="name()='icon'">
- <xsl:attribute name="w"><xsl:value-of select="round(24.0*number($OSD_SIZE))"/></xsl:attribute>
- <xsl:attribute name="h"><xsl:value-of select="round(24.0*number($OSD_SIZE))"/></xsl:attribute>
+ <xsl:attribute name="w"><xsl:value-of select="$ICON_SMALL"/></xsl:attribute>
+ <xsl:attribute name="h"><xsl:value-of select="$ICON_SMALL"/></xsl:attribute>
</xsl:if>
<xsl:if test="@w and not(name()='icon')">
<xsl:attribute name="w"><xsl:value-of select="round(number(@w)*number($OSD_SIZE))"/></xsl:attribute>
@@ -93,6 +93,17 @@
<xsl:if test="@y">
<xsl:attribute name="y"><xsl:value-of select="round(number(@y)*number($OSD_SIZE))"/></xsl:attribute>
</xsl:if>
+ <xsl:if test="@offset">
+ <xsl:attribute name="offset"><xsl:value-of select="round(number(@offset)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@dash">
+ <xsl:attribute name="dash">
+ <xsl:for-each select="tokenize(@dash,',')">
+ <xsl:value-of select="round(number(.)*number($OSD_SIZE))"/>
+ <xsl:if test="not(position() eq last())"><xsl:text>,</xsl:text></xsl:if>
+ </xsl:for-each>
+ </xsl:attribute>
+ </xsl:if>
</xsl:copy>
</xsl:template>
<xsl:template match="/config/navit/layout">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-07 13:30:24
|
Revision: 5993
http://sourceforge.net/p/navit/code/5993
Author: mdankov
Date: 2015-01-07 13:30:21 +0000 (Wed, 07 Jan 2015)
Log Message:
-----------
Add:core:Allow to disable generating png image without size specifier, as new graphics.c code no more requires it, and behaves better when all image files have size specifier.
Modified Paths:
--------------
trunk/navit/navit/xpm/CMakeLists.txt
Modified: trunk/navit/navit/xpm/CMakeLists.txt
===================================================================
--- trunk/navit/navit/xpm/CMakeLists.txt 2015-01-07 13:28:10 UTC (rev 5992)
+++ trunk/navit/navit/xpm/CMakeLists.txt 2015-01-07 13:30:21 UTC (rev 5993)
@@ -54,13 +54,15 @@
else()
set (IMAGE_DST ${CMAKE_CURRENT_BINARY_DIR}/${IMAGE_NAME}_${CURRENT_SCALE}_${CURRENT_SCALE}.png)
endif()
-
- convert_to_png(
- ${CMAKE_CURRENT_SOURCE_DIR}/${IMAGE_SRC}
- ${IMAGE_DST}
- ${CURRENT_SCALE}
- )
- list(APPEND IMAGE_TARGETS ${IMAGE_DST})
+
+ if(NOT CURRENT_SCALE EQUAL -1)
+ convert_to_png(
+ ${CMAKE_CURRENT_SOURCE_DIR}/${IMAGE_SRC}
+ ${IMAGE_DST}
+ ${CURRENT_SCALE}
+ )
+ list(APPEND IMAGE_TARGETS ${IMAGE_DST})
+ endif()
endforeach()
endmacro()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-07 13:28:18
|
Revision: 5992
http://sourceforge.net/p/navit/code/5992
Author: mdankov
Date: 2015-01-07 13:28:10 +0000 (Wed, 07 Jan 2015)
Log Message:
-----------
Add:graphics_android:Allow to scale images.
Modified Paths:
--------------
trunk/navit/navit/graphics/android/graphics_android.c
Modified: trunk/navit/navit/graphics/android/graphics_android.c
===================================================================
--- trunk/navit/navit/graphics/android/graphics_android.c 2015-01-07 13:26:11 UTC (rev 5991)
+++ trunk/navit/navit/graphics/android/graphics_android.c 2015-01-07 13:28:10 UTC (rev 5992)
@@ -48,7 +48,7 @@
jmethodID BitmapFactory_decodeFile, BitmapFactory_decodeResource;
jclass BitmapClass;
- jmethodID Bitmap_getHeight, Bitmap_getWidth;
+ jmethodID Bitmap_getHeight, Bitmap_getWidth, Bitmap_createScaledBitmap;
jclass ContextClass;
jmethodID Context_getResources;
@@ -216,49 +216,55 @@
{
struct graphics_image_priv* ret = NULL;
- if ( !g_hash_table_lookup_extended( image_cache_hash, path, NULL, (gpointer)&ret) )
- {
- ret=g_new0(struct graphics_image_priv, 1);
- jstring string;
- jclass localBitmap = NULL;
- int id;
+ ret=g_new0(struct graphics_image_priv, 1);
+ jstring string;
+ jclass localBitmap = NULL;
+ int id;
- dbg(lvl_debug,"enter %s\n",path);
- if (!strncmp(path,"res/drawable/",13)) {
- jstring a=(*jnienv)->NewStringUTF(jnienv, "drawable");
- char *path_noext=g_strdup(path+13);
- char *pos=strrchr(path_noext, '.');
- if (pos)
- *pos='\0';
- dbg(lvl_debug,"path_noext=%s\n",path_noext);
- string = (*jnienv)->NewStringUTF(jnienv, path_noext);
- g_free(path_noext);
- id=(*jnienv)->CallIntMethod(jnienv, gra->Resources, gra->Resources_getIdentifier, string, a, gra->packageName);
- dbg(lvl_debug,"id=%d\n",id);
- if (id)
- localBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapFactoryClass, gra->BitmapFactory_decodeResource, gra->Resources, id);
- (*jnienv)->DeleteLocalRef(jnienv, a);
- } else {
- string = (*jnienv)->NewStringUTF(jnienv, path);
- localBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapFactoryClass, gra->BitmapFactory_decodeFile, string);
+ dbg(lvl_debug,"enter %s\n",path);
+ if (!strncmp(path,"res/drawable/",13)) {
+ jstring a=(*jnienv)->NewStringUTF(jnienv, "drawable");
+ char *path_noext=g_strdup(path+13);
+ char *pos=strrchr(path_noext, '.');
+ if (pos)
+ *pos='\0';
+ dbg(lvl_debug,"path_noext=%s\n",path_noext);
+ string = (*jnienv)->NewStringUTF(jnienv, path_noext);
+ g_free(path_noext);
+ id=(*jnienv)->CallIntMethod(jnienv, gra->Resources, gra->Resources_getIdentifier, string, a, gra->packageName);
+ dbg(lvl_debug,"id=%d\n",id);
+ if (id)
+ localBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapFactoryClass, gra->BitmapFactory_decodeResource, gra->Resources, id);
+ (*jnienv)->DeleteLocalRef(jnienv, a);
+ } else {
+ string = (*jnienv)->NewStringUTF(jnienv, path);
+ localBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapFactoryClass, gra->BitmapFactory_decodeFile, string);
+ }
+ if (localBitmap) {
+ ret->width=(*jnienv)->CallIntMethod(jnienv, localBitmap, gra->Bitmap_getWidth);
+ ret->height=(*jnienv)->CallIntMethod(jnienv, localBitmap, gra->Bitmap_getHeight);
+ if(*w!=-1 || *h!=-1) {
+ jclass scaledBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapClass,
+ gra->Bitmap_createScaledBitmap, localBitmap, (*w==-1)?ret->width:*w, (*h==-1)?ret->height:*h, JNI_TRUE);
+ if(!scaledBitmap) {
+ dbg(lvl_error,"Bitmap scaling to %dx%d failed for %s",*w,*h,path);
+ } else {
+ (*jnienv)->DeleteLocalRef(jnienv, localBitmap);
+ localBitmap=scaledBitmap;
+ }
}
- dbg(lvl_debug,"result=%p\n",localBitmap);
- if (localBitmap) {
- ret->Bitmap = (*jnienv)->NewGlobalRef(jnienv, localBitmap);
- (*jnienv)->DeleteLocalRef(jnienv, localBitmap);
- ret->width=(*jnienv)->CallIntMethod(jnienv, ret->Bitmap, gra->Bitmap_getWidth);
- ret->height=(*jnienv)->CallIntMethod(jnienv, ret->Bitmap, gra->Bitmap_getHeight);
- dbg(lvl_debug,"w=%d h=%d for %s\n",ret->width,ret->height,path);
- ret->hot.x=ret->width/2;
- ret->hot.y=ret->height/2;
- } else {
- g_free(ret);
- ret=NULL;
- dbg(lvl_warning,"Failed to open %s\n",path);
- }
- (*jnienv)->DeleteLocalRef(jnienv, string);
- g_hash_table_insert(image_cache_hash, g_strdup( path ), (gpointer)ret );
+ ret->Bitmap = (*jnienv)->NewGlobalRef(jnienv, localBitmap);
+ (*jnienv)->DeleteLocalRef(jnienv, localBitmap);
+
+ dbg(lvl_debug,"w=%d h=%d for %s\n",ret->width,ret->height,path);
+ ret->hot.x=ret->width/2;
+ ret->hot.y=ret->height/2;
+ } else {
+ g_free(ret);
+ ret=NULL;
+ dbg(lvl_warning,"Failed to open %s\n",path);
}
+ (*jnienv)->DeleteLocalRef(jnienv, string);
if (ret) {
*w=ret->width;
*h=ret->height;
@@ -551,6 +557,8 @@
return 0;
if (!find_method(ret->BitmapClass, "getWidth", "()I", &ret->Bitmap_getWidth))
return 0;
+ if (!find_static_method(ret->BitmapClass, "createScaledBitmap", "(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;", &ret->Bitmap_createScaledBitmap))
+ return 0;
if (!find_class_global("android/content/Context", &ret->ContextClass))
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-07 13:26:13
|
Revision: 5991
http://sourceforge.net/p/navit/code/5991
Author: mdankov
Date: 2015-01-07 13:26:11 +0000 (Wed, 07 Jan 2015)
Log Message:
-----------
Add:port_android:Properly handle densities. Add support for navit_x[x][x]hdpi.xml.
Modified Paths:
--------------
trunk/navit/navit/android/src/org/navitproject/navit/Navit.java
Modified: trunk/navit/navit/android/src/org/navitproject/navit/Navit.java
===================================================================
--- trunk/navit/navit/android/src/org/navitproject/navit/Navit.java 2015-01-07 13:24:24 UTC (rev 5990)
+++ trunk/navit/navit/android/src/org/navitproject/navit/Navit.java 2015-01-07 13:26:11 UTC (rev 5991)
@@ -307,7 +307,7 @@
int height_ = display_.getHeight();
metrics = new DisplayMetrics();
display_.getMetrics(Navit.metrics);
- int densityDpi = (int)(( Navit.metrics.density*160)+.5f);
+ int densityDpi = (int)(( Navit.metrics.density*160)-.5f);
Log.e("Navit", "Navit -> pixels x=" + width_ + " pixels y=" + height_);
Log.e("Navit", "Navit -> dpi=" + densityDpi);
Log.e("Navit", "Navit -> density=" + Navit.metrics.density);
@@ -331,15 +331,27 @@
{
my_display_density = "mdpi";
}
- else if (densityDpi < 320)
+ else if (densityDpi < 240)
{
my_display_density = "hdpi";
}
+ else if (densityDpi < 320)
+ {
+ my_display_density = "xhdpi";
+ }
+ else if (densityDpi < 480)
+ {
+ my_display_density = "xxhdpi";
+ }
+ else if (densityDpi < 640)
+ {
+ my_display_density = "xxxhdpi";
+ }
else
{
- Log.e("Navit", "found xhdpi device, this is not fully supported!!");
- Log.e("Navit", "using hdpi values");
- my_display_density = "hdpi";
+ Log.e("Navit", "found device of very high density ("+densityDpi+")");
+ Log.e("Navit", "using xxxhdpi values");
+ my_display_density = "xxxhdpi";
}
if (!extractRes("navit" + my_display_density, NAVIT_DATA_DIR + "/share/navit.xml"))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-07 13:24:27
|
Revision: 5990
http://sourceforge.net/p/navit/code/5990
Author: mdankov
Date: 2015-01-07 13:24:24 +0000 (Wed, 07 Jan 2015)
Log Message:
-----------
Add:core:Better algorithm to choose prescaled png to rescale it to needed size.
Modified Paths:
--------------
trunk/navit/navit/graphics.c
Modified: trunk/navit/navit/graphics.c
===================================================================
--- trunk/navit/navit/graphics.c 2015-01-03 11:48:22 UTC (rev 5989)
+++ trunk/navit/navit/graphics.c 2015-01-07 13:24:24 UTC (rev 5990)
@@ -611,36 +611,82 @@
static void
image_new_helper(struct graphics *gra, struct graphics_image *this_, char *path, char *name, int width, int height, int rotate, int zip)
{
- int i;
- for (i = 1 ; i <= 6 ; i++) {
+ int i=0;
+ int stdsizes[]={8,12,16,22,24,32,36,48,64,72,96,128,192,256};
+ const int numstdsizes=sizeof(stdsizes)/sizeof(int);
+ int sz;
+ int mode=1;
+ int bmstd=0;
+ sz=width>0?width:height;
+ while (mode<=8) {
char *new_name=NULL;
- switch (i) {
+ int n;
+ switch (mode) {
case 1:
/* The best variant both for cpu usage and quality would be prescaled png of a needed size */
+ mode++;
if (width != -1 && height != -1) {
new_name=g_strdup_printf("%s_%d_%d.png", name, width, height);
}
break;
case 2:
+ mode++;
/* Try to load image by the exact name given by user. For example, if she wants to
scale some prescaled png variant to a new size given as function params, or have
default png image to be displayed unscaled. */
new_name=g_strdup(path);
break;
case 3:
+ mode++;
/* Next, try uncompressed and compressed svgs as they should give best quality but
rendering might take more cpu resources when the image is displayed for the first time */
new_name=g_strdup_printf("%s.svg", name);
break;
case 4:
+ mode++;
new_name=g_strdup_printf("%s.svgz", name);
break;
case 5:
- /* Scaling the default png to the needed size may give some quality loss */
+ mode++;
+ /* If we have no size specifiers, try the default png now */
+ if(sz<=0) {
+ new_name=g_strdup_printf("%s.png", name);
+ i=0;
+ break;
+ }
+ /* Find best matching size from standard row */
+ for(bmstd=0;bmstd<numstdsizes;bmstd++)
+ if(stdsizes[bmstd]>sz)
+ break;
+ i=1;
+ /* Fall through */
+ case 6:
+ /* Select closest matching image from standard row */
+ if(sz>0) {
+ /* If size were specified, start with bmstd and then try standard sizes in row
+ * bmstd-1, bmstd+1, bmstd-2, bmstd+2 etc */
+ n=bmstd+(i/2)*((i%2)*2-1);
+ if(++i==numstdsizes*2)
+ mode++;
+ } else {
+ /* If no size were specified, start with the smallest standard size and then try following ones */
+ n=i++;
+ if(i==numstdsizes)
+ mode+=2;
+ }
+ if(n<0||n>=numstdsizes)
+ break;
+ new_name=g_strdup_printf("%s_%d_%d.png", name, stdsizes[n],stdsizes[n]);
+ break;
+
+ case 7:
+ /* Scaling the default prescaled png of unknown size to the needed size will give random quality loss */
+ mode++;
new_name=g_strdup_printf("%s.png", name);
break;
- case 6:
+ case 8:
/* xpm format is used as a last resort, because its not widely supported and we are moving to svg and png formats */
+ mode++;
new_name=g_strdup_printf("%s.xpm", name);
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2015-01-03 11:48:31
|
Revision: 5989
http://sourceforge.net/p/navit/code/5989
Author: mdankov
Date: 2015-01-03 11:48:22 +0000 (Sat, 03 Jan 2015)
Log Message:
-----------
Add:osd_core:Support negative widhts and heights for osd items as it's done for negative coordinates (meaning "full size minus smth"), see #1255.
Modified Paths:
--------------
trunk/navit/navit/attr.c
trunk/navit/navit/attr.h
trunk/navit/navit/osd/core/osd_core.c
trunk/navit/navit/osd.c
Modified: trunk/navit/navit/attr.c
===================================================================
--- trunk/navit/navit/attr.c 2014-12-30 18:14:51 UTC (rev 5988)
+++ trunk/navit/navit/attr.c 2015-01-03 11:48:22 UTC (rev 5989)
@@ -974,3 +974,22 @@
}
return attr_types_contains(types, type);
}
+
+/**
+ * @brief Derive absolute value from relative attribute, given value of the whole range.
+ *
+ * @param attrval Value of u.num member of attribute capable of holding relative values.
+ * @param whole Range counted as 100%.
+ * @param treat_neg_as_rel Replace negative absolute values with whole+attr.u.num.
+ *
+ * @return True if the attribute type was found, false if it was not found, {@code deflt} if types is empty.
+ */
+int attr_rel2real(int attrval, int whole, int treat_neg_as_rel)
+{
+ if (attrval > ATTR_REL_MAXABS)
+ return whole * (attrval - ATTR_REL_RELSHIFT)/100;
+ if(treat_neg_as_rel && attrval<0 )
+ return whole+attrval;
+ return attrval;
+}
+
Modified: trunk/navit/navit/attr.h
===================================================================
--- trunk/navit/navit/attr.h 2014-12-30 18:14:51 UTC (rev 5988)
+++ trunk/navit/navit/attr.h 2015-01-03 11:48:22 UTC (rev 5989)
@@ -226,6 +226,7 @@
int attr_from_line(char *line, char *name, int *pos, char *val_ret, char *name_ret);
int attr_types_contains(enum attr_type *types, enum attr_type type);
int attr_types_contains_default(enum attr_type *types, enum attr_type type, int deflt);
+int attr_rel2real(int attrval, int whole, int treat_neg_as_rel);
/* end of prototypes */
#ifdef __cplusplus
}
Modified: trunk/navit/navit/osd/core/osd_core.c
===================================================================
--- trunk/navit/navit/osd/core/osd_core.c 2014-12-30 18:14:51 UTC (rev 5988)
+++ trunk/navit/navit/osd/core/osd_core.c 2015-01-03 11:48:22 UTC (rev 5989)
@@ -223,41 +223,32 @@
{
struct osd_priv_common *opc=(struct osd_priv_common *)priv;
if(opc && the_attr && ATTR_IS_INT(the_attr->type)) {
+ int attr_set=0;
if(attr_w == the_attr->type) {
- opc->osd_item.w = the_attr->u.num;
- if(opc->osd_item.gr) {
- osd_std_resize(&opc->osd_item);
- return 1;
- }
+ opc->osd_item.rel_w = the_attr->u.num;
+ attr_set=1;
}
else if(attr_h == the_attr->type) {
- opc->osd_item.h = the_attr->u.num;
- if(opc->osd_item.gr) {
- osd_std_resize(&opc->osd_item);
- return 1;
- }
+ opc->osd_item.rel_h = the_attr->u.num;
+ attr_set=1;
}
else if(attr_x == the_attr->type) {
- opc->osd_item.p.x = the_attr->u.num;
- if(opc->osd_item.gr) {
- osd_std_resize(&opc->osd_item);
- return 1;
- }
+ opc->osd_item.rel_x = the_attr->u.num;
+ attr_set=1;
}
else if(attr_y == the_attr->type) {
- opc->osd_item.p.y = the_attr->u.num;
- if(opc->osd_item.gr) {
- osd_std_resize(&opc->osd_item);
- return 1;
- }
+ opc->osd_item.rel_y = the_attr->u.num;
+ attr_set=1;
}
else if(attr_font_size == the_attr->type) {
opc->osd_item.font_size = the_attr->u.num;
- if(opc->osd_item.gr) {
- osd_std_resize(&opc->osd_item);
- return 1;
- }
+ attr_set=1;
}
+ if(attr_set && opc->osd_item.gr) {
+ osd_std_calculate_sizes(&opc->osd_item, navit_get_width(opc->osd_item.navit), navit_get_height(opc->osd_item.navit));
+ osd_std_resize(&opc->osd_item);
+ return 1;
+ }
}
if(opc->spec_set_attr_func) {
opc->spec_set_attr_func(opc, the_attr);
@@ -437,10 +428,10 @@
struct attr *attr;
opc->data = (void*)this;
- opc->osd_item.p.x = 120;
- opc->osd_item.p.y = 20;
- opc->osd_item.w = 60;
- opc->osd_item.h = 80;
+ opc->osd_item.rel_x = 120;
+ opc->osd_item.rel_y = 20;
+ opc->osd_item.rel_w = 60;
+ opc->osd_item.rel_h = 80;
opc->osd_item.navit = nav;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_route_guard_draw);
@@ -914,10 +905,10 @@
struct color orange_color={0xffff,0xa5a5,0x0000,0xffff};
opc->data = (void*)this;
- opc->osd_item.p.x = 120;
- opc->osd_item.p.y = 20;
- opc->osd_item.w = 60;
- opc->osd_item.h = 80;
+ opc->osd_item.rel_x = 120;
+ opc->osd_item.rel_y = 20;
+ opc->osd_item.rel_w = 60;
+ opc->osd_item.rel_h = 80;
opc->osd_item.navit = nav;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_odometer_draw);
@@ -1133,10 +1124,10 @@
struct attr *attr;
opc->data = (void*)this;
- opc->osd_item.p.x = 120;
- opc->osd_item.p.y = 20;
- opc->osd_item.w = 60;
- opc->osd_item.h = 80;
+ opc->osd_item.rel_x = 120;
+ opc->osd_item.rel_y = 20;
+ opc->osd_item.rel_w = 60;
+ opc->osd_item.rel_h = 80;
opc->osd_item.navit = nav;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_cmd_interface_draw);
@@ -1294,10 +1285,10 @@
struct color orange_color={0xffff,0xa5a5,0x0000,0xffff};
opc->data = (void*)this;
- opc->osd_item.p.x = 120;
- opc->osd_item.p.y = 20;
- opc->osd_item.w = 60;
- opc->osd_item.h = 80;
+ opc->osd_item.rel_x = 120;
+ opc->osd_item.rel_y = 20;
+ opc->osd_item.rel_w = 60;
+ opc->osd_item.rel_h = 80;
opc->osd_item.navit = nav;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_stopwatch_draw);
@@ -1408,10 +1399,10 @@
struct attr *attr;
opc->data = (void*)this;
- opc->osd_item.p.x = 20;
- opc->osd_item.p.y = 20;
- opc->osd_item.w = 60;
- opc->osd_item.h = 80;
+ opc->osd_item.rel_x = 20;
+ opc->osd_item.rel_y = 20;
+ opc->osd_item.rel_w = 60;
+ opc->osd_item.rel_h = 80;
opc->osd_item.navit = nav;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_compass_draw);
@@ -1430,6 +1421,16 @@
char *src_dir,*src;
};
+
+static void
+osd_button_adjust_sizes(struct osd_priv_common *opc, struct graphics_image *img)
+{
+ if(opc->osd_item.rel_w==ATTR_REL_RELSHIFT)
+ opc->osd_item.w=img->width;
+ if(opc->osd_item.rel_h==ATTR_REL_RELSHIFT)
+ opc->osd_item.h=img->height;
+}
+
static void
osd_button_draw(struct osd_priv_common *opc, struct navit *nav)
{
@@ -1444,6 +1445,7 @@
if (this->use_overlay) {
struct graphics_image *img;
img=graphics_image_new(opc->osd_item.gr, this->src);
+ osd_button_adjust_sizes(opc, img);
p.x=(opc->osd_item.w-img->width)/2;
p.y=(opc->osd_item.h-img->height)/2;
osd_std_draw(&opc->osd_item);
@@ -1453,12 +1455,14 @@
struct graphics *gra;
gra = navit_get_graphics(nav);
this->img = graphics_image_new(gra, this->src);
+
if (!this->img) {
dbg(lvl_warning, "failed to load '%s'\n", this->src);
return;
}
osd_std_calculate_sizes(&opc->osd_item, navit_get_width(nav), navit_get_height(nav));
+ osd_button_adjust_sizes(opc, this->img);
p = opc->osd_item.p;
p.x+=(opc->osd_item.w-this->img->width)/2;
@@ -1466,7 +1470,6 @@
if (!opc->osd_item.configured)
return;
- osd_wrap_point(&p, nav);
if(this->img)
graphics_draw_image(opc->osd_item.gr, opc->osd_item.graphic_bg, &p, this->img);
@@ -1485,10 +1488,7 @@
dbg(lvl_warning, "failed to load '%s'\n", this->src);
return;
}
- if (!opc->osd_item.w)
- opc->osd_item.w=this->img->width;
- if (!opc->osd_item.h)
- opc->osd_item.h=this->img->height;
+ osd_button_adjust_sizes(opc, this->img);
if (this->use_overlay) {
struct graphics_image *img;
struct point p;
@@ -1543,10 +1543,6 @@
dbg(lvl_warning, "failed to load '%s'\n", this_->src);
return 0;
}
- if (!opc->osd_item.w)
- opc->osd_item.w=this_->img->width;
- if (!opc->osd_item.h)
- opc->osd_item.h=this_->img->height;
if(navit_get_blocked(nav)&1)
return 1;
@@ -1571,6 +1567,9 @@
opc->data = (void*)this;
opc->osd_item.navit = nav;
opc->osd_item.meth.draw = osd_draw_cast(osd_button_draw);
+ /*Value of 0% is stored in relative attributes as ATTR_REL_RELSHIFT, we use this value as "width/height unset" flag */
+ opc->osd_item.rel_w = ATTR_REL_RELSHIFT;
+ opc->osd_item.rel_h = ATTR_REL_RELSHIFT;
meth->set_attr = set_std_osd_attr;
opc->spec_set_attr_func = osd_button_set_attr;
@@ -1623,10 +1622,7 @@
dbg(lvl_warning, "failed to load '%s'\n", this->src);
return;
}
- if (!opc->osd_item.w)
- opc->osd_item.w=this->img->width;
- if (!opc->osd_item.h)
- opc->osd_item.h=this->img->height;
+ osd_button_adjust_sizes(opc, this->img);
if (this->use_overlay) {
struct graphics_image *img;
struct point p;
@@ -1658,6 +1654,9 @@
opc->data = (void*)this;
opc->osd_item.navit = nav;
opc->osd_item.meth.draw = osd_draw_cast(osd_button_draw);
+ /*Value of 0% is stored in relative attributes as ATTR_REL_RELSHIFT, we use this value as "width/height unset" flag */
+ opc->osd_item.rel_w = ATTR_REL_RELSHIFT;
+ opc->osd_item.rel_h = ATTR_REL_RELSHIFT;
meth->set_attr = set_std_osd_attr;
opc->spec_set_attr_func = osd_button_set_attr;
@@ -1794,11 +1793,11 @@
struct attr *attr;
opc->data = (void*)this;
- opc->osd_item.p.x = 20;
- opc->osd_item.p.y = -80;
- opc->osd_item.w = 70;
+ opc->osd_item.rel_x = 20;
+ opc->osd_item.rel_y = -80;
+ opc->osd_item.rel_w = 70;
opc->osd_item.navit = nav;
- opc->osd_item.h = 70;
+ opc->osd_item.rel_h = 70;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_nav_next_turn_draw);
meth->set_attr = set_std_osd_attr;
@@ -1928,11 +1927,11 @@
char *command = "announcer_toggle()";
opc->data = (void*)this;
- opc->osd_item.w = 48;
- opc->osd_item.h = 48;
- opc->osd_item.p.x = -64;
+ opc->osd_item.rel_w = 48;
+ opc->osd_item.rel_h = 48;
+ opc->osd_item.rel_x = -64;
+ opc->osd_item.rel_y = 76;
opc->osd_item.navit = nav;
- opc->osd_item.p.y = 76;
opc->osd_item.meth.draw = osd_draw_cast(osd_nav_toggle_announcer_draw);
meth->set_attr = set_std_osd_attr;
@@ -2455,11 +2454,11 @@
struct attr *attr;
opc->data = (void*)this;
- opc->osd_item.p.x=-80;
- opc->osd_item.p.y=20;
- opc->osd_item.w=60;
+ opc->osd_item.rel_x=-80;
+ opc->osd_item.rel_y=20;
+ opc->osd_item.rel_w=60;
+ opc->osd_item.rel_h=60;
opc->osd_item.navit = nav;
- opc->osd_item.h=60;
this->active=-1;
opc->osd_item.meth.draw = osd_draw_cast(osd_speed_warner_draw);
meth->set_attr = set_std_osd_attr;
@@ -3127,10 +3126,10 @@
struct attr *attr;
opc->data = (void*)this;
- opc->osd_item.p.x = -80;
- opc->osd_item.p.y = 20;
- opc->osd_item.w = 60;
- opc->osd_item.h = 20;
+ opc->osd_item.rel_x = -80;
+ opc->osd_item.rel_y = 20;
+ opc->osd_item.rel_w = 60;
+ opc->osd_item.rel_h = 20;
opc->osd_item.navit = nav;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_text_draw);
@@ -3241,9 +3240,9 @@
struct attr *attr;
opc->data = (void*)this;
- opc->osd_item.p.x = 20;
- opc->osd_item.p.y = -80;
- opc->osd_item.w = 60;
+ opc->osd_item.rel_x = 20;
+ opc->osd_item.rel_y = -80;
+ opc->osd_item.rel_w = 60;
opc->osd_item.navit = nav;
opc->osd_item.h = 40;
opc->osd_item.font_size = 200;
@@ -3317,7 +3316,6 @@
struct volume *this = (struct volume *)opc->data;
struct point bp = opc->osd_item.p;
- osd_wrap_point(&bp, nav);
if ((p->x < bp.x || p->y < bp.y || p->x > bp.x + opc->osd_item.w || p->y > bp.y + opc->osd_item.h) && !opc->osd_item.pressed)
return;
navit_ignore_button(nav);
@@ -3352,11 +3350,11 @@
struct attr *attr;
opc->data = (void*)this;
- opc->osd_item.p.x = 20;
- opc->osd_item.p.y = -80;
- opc->osd_item.w = 60;
+ opc->osd_item.rel_x = 20;
+ opc->osd_item.rel_y = -80;
+ opc->osd_item.rel_w = 60;
+ opc->osd_item.rel_h = 40;
opc->osd_item.navit = nav;
- opc->osd_item.h = 40;
opc->osd_item.font_size = 200;
opc->osd_item.meth.draw = osd_draw_cast(osd_volume_draw);
meth->set_attr = set_std_osd_attr;
@@ -3422,34 +3420,36 @@
int scale_x_offset,scale_length_on_map,scale_length_pixels;
double distance_on_map;
char *text;
- struct osd_item scale_item=opc->osd_item;
- int width_reduced=scale_item.w*9/10;
+ int width_reduced;
int imperial=0;
+ osd_std_calculate_sizes(&opc->osd_item, navit_get_width(nav), navit_get_height(nav));
+
+ width_reduced=opc->osd_item.w*9/10;
+
if (navit_get_attr(nav, attr_imperial, &imperial_attr, NULL))
imperial=imperial_attr.u.num;
if (!navit_get_attr(nav, attr_transformation, &transformation, NULL))
return;
if (this->use_overlay) {
- graphics_draw_mode(scale_item.gr, draw_mode_begin);
+ graphics_draw_mode(opc->osd_item.gr, draw_mode_begin);
item_pos.x=0;
item_pos.y=0;
- graphics_draw_rectangle(scale_item.gr, scale_item.graphic_bg, &item_pos, scale_item.w, scale_item.h);
+ graphics_draw_rectangle(opc->osd_item.gr, opc->osd_item.graphic_bg, &item_pos, opc->osd_item.w, opc->osd_item.h);
} else {
- item_pos=scale_item.p;
- osd_wrap_point(&item_pos, nav);
+ item_pos=opc->osd_item.p;
}
scale_line_start=item_pos;
- scale_line_start.y+=scale_item.h/2;
- scale_line_start.x+=(scale_item.w-width_reduced)/2;
+ scale_line_start.y+=opc->osd_item.h/2;
+ scale_line_start.x+=(opc->osd_item.w-width_reduced)/2;
scale_line_end=scale_line_start;
scale_line_end.x+=width_reduced;
distance_on_map=transform_pixels_to_map_distance(transformation.u.transformation, width_reduced);
scale_length_on_map=round_to_nice_value(distance_on_map);
scale_length_pixels=scale_length_on_map/distance_on_map*width_reduced;
- scale_x_offset=(scale_item.w-scale_length_pixels) / 2;
+ scale_x_offset=(opc->osd_item.w-scale_length_pixels) / 2;
p[0]=scale_line_start;
p[1]=scale_line_end;
@@ -3457,12 +3457,12 @@
p[1].x-=scale_x_offset;
p[2]=p[0];
p[3]=p[0];
- p[2].y-=scale_item.h/10;
- p[3].y+=scale_item.h/10;
+ p[2].y-=opc->osd_item.h/10;
+ p[3].y+=opc->osd_item.h/10;
p[4]=p[1];
p[5]=p[1];
- p[4].y-=scale_item.h/10;
- p[5].y+=scale_item.h/10;
+ p[4].y-=opc->osd_item.h/10;
+ p[5].y+=opc->osd_item.h/10;
p[6]=p[2];
p[6].x-=2;
p[6].y-=2;
@@ -3471,20 +3471,20 @@
p[8]=p[4];
p[8].x-=2;
p[8].y-=2;
- graphics_draw_rectangle(scale_item.gr, scale_item.graphic_fg_white, p+6, 4,scale_item.h/5+4);
- graphics_draw_rectangle(scale_item.gr, scale_item.graphic_fg_white, p+7, p[1].x-p[0].x, 4);
- graphics_draw_rectangle(scale_item.gr, scale_item.graphic_fg_white, p+8, 4,scale_item.h/5+4);
- graphics_draw_lines(scale_item.gr, this->black, p, 2);
- graphics_draw_lines(scale_item.gr, this->black, p+2, 2);
- graphics_draw_lines(scale_item.gr, this->black, p+4, 2);
+ graphics_draw_rectangle(opc->osd_item.gr, opc->osd_item.graphic_fg_white, p+6, 4,opc->osd_item.h/5+4);
+ graphics_draw_rectangle(opc->osd_item.gr, opc->osd_item.graphic_fg_white, p+7, p[1].x-p[0].x, 4);
+ graphics_draw_rectangle(opc->osd_item.gr, opc->osd_item.graphic_fg_white, p+8, 4,opc->osd_item.h/5+4);
+ graphics_draw_lines(opc->osd_item.gr, this->black, p, 2);
+ graphics_draw_lines(opc->osd_item.gr, this->black, p+2, 2);
+ graphics_draw_lines(opc->osd_item.gr, this->black, p+4, 2);
text=format_distance(scale_length_on_map, "", imperial);
- graphics_get_text_bbox(scale_item.gr, scale_item.font, text, 0x10000, 0, bbox, 0);
- p[0].x=(scale_item.w-bbox[2].x)/2+item_pos.x;
- p[0].y=item_pos.y+scale_item.h-scale_item.h/10;
- graphics_draw_text(scale_item.gr, this->black, scale_item.graphic_fg_white, scale_item.font, text, &p[0], 0x10000, 0);
+ graphics_get_text_bbox(opc->osd_item.gr, opc->osd_item.font, text, 0x10000, 0, bbox, 0);
+ p[0].x=(opc->osd_item.w-bbox[2].x)/2+item_pos.x;
+ p[0].y=item_pos.y+opc->osd_item.h-opc->osd_item.h/10;
+ graphics_draw_text(opc->osd_item.gr, this->black, opc->osd_item.graphic_fg_white, opc->osd_item.font, text, &p[0], 0x10000, 0);
g_free(text);
if (this->use_overlay)
- graphics_draw_mode(scale_item.gr, draw_mode_end);
+ graphics_draw_mode(opc->osd_item.gr, draw_mode_end);
}
static void
@@ -3636,10 +3636,10 @@
struct osd_priv_common *opc = g_new0(struct osd_priv_common,1);
opc->data = (void*)this;
- opc->osd_item.p.x = 20;
- opc->osd_item.p.y = -80;
- opc->osd_item.w = 60;
- opc->osd_item.h = 40;
+ opc->osd_item.rel_x = 20;
+ opc->osd_item.rel_y = -80;
+ opc->osd_item.rel_w = 60;
+ opc->osd_item.rel_h = 40;
opc->osd_item.font_size = 200;
meth->set_attr = set_std_osd_attr;
osd_set_std_attr(attrs, &opc->osd_item, 0);
Modified: trunk/navit/navit/osd.c
===================================================================
--- trunk/navit/navit/osd.c 2014-12-30 18:14:51 UTC (rev 5988)
+++ trunk/navit/navit/osd.c 2015-01-03 11:48:22 UTC (rev 5989)
@@ -162,7 +162,10 @@
* @brief Calculates the size and position of an OSD item.
*
* If the geometry of the OSD item is specified relative to screen dimensions,
- * this function will set its absolute dimensions accordingly.
+ * this function will set its absolute dimensions accordingly. If relative width
+ * or relative height is set to 0% (int value is equal to ATTR_REL_RELSHIFT),
+ * object width (height) is not changed here, for button and image osds it means
+ * to derive values from the underlying image.
* @param item
* @param w Available screen width in pixels (the width that corresponds to
* 100%)
@@ -172,21 +175,16 @@
void
osd_std_calculate_sizes(struct osd_item *item, int w, int h)
{
- if (item->rel_w) {
- item->w = (item->rel_w * w) / 100;
- }
-
- if (item->rel_h) {
- item->h = (item->rel_h * h) / 100;
- }
-
- if (item->rel_x) {
- item->p.x = (item->rel_x * w) / 100;
- }
-
- if (item->rel_y) {
- item->p.y = (item->rel_y * h) / 100;
- }
+ if(item->rel_w!=ATTR_REL_RELSHIFT)
+ item->w=attr_rel2real(item->rel_w, w, 1);
+ if(item->w<0)
+ item->w=0;
+ if(item->rel_h!=ATTR_REL_RELSHIFT)
+ item->h=attr_rel2real(item->rel_h, h, 1);
+ if(item->h<0)
+ item->h=0;
+ item->p.x=attr_rel2real(item->rel_x, w, 1);
+ item->p.y=attr_rel2real(item->rel_y, h, 1);
}
/**
@@ -284,42 +282,22 @@
attr = attr_search(attrs, NULL, attr_w);
if (attr) {
- if (attr->u.num > ATTR_REL_MAXABS) {
- item->rel_w = attr->u.num - ATTR_REL_RELSHIFT;
- } else {
- item->rel_w = 0;
- item->w = attr->u.num;
- }
+ item->rel_w = attr->u.num;
}
attr = attr_search(attrs, NULL, attr_h);
if (attr) {
- if (attr->u.num > ATTR_REL_MAXABS) {
- item->rel_h = attr->u.num - ATTR_REL_RELSHIFT;
- } else {
- item->rel_h = 0;
- item->h = attr->u.num;
- }
+ item->rel_h = attr->u.num;
}
attr = attr_search(attrs, NULL, attr_x);
if (attr) {
- if (attr->u.num > ATTR_REL_MAXABS) {
- item->rel_x = attr->u.num - ATTR_REL_RELSHIFT;
- } else {
- item->rel_x = 0;
- item->p.x = attr->u.num;
- }
+ item->rel_x = attr->u.num;
}
attr = attr_search(attrs, NULL, attr_y);
if (attr) {
- if (attr->u.num > ATTR_REL_MAXABS) {
- item->rel_y = attr->u.num - ATTR_REL_RELSHIFT;
- } else {
- item->rel_y = 0;
- item->p.y = attr->u.num;
- }
+ item->rel_y = attr->u.num;
}
attr = attr_search(attrs, NULL, attr_font_size);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-12-30 18:14:59
|
Revision: 5988
http://sourceforge.net/p/navit/code/5988
Author: mdankov
Date: 2014-12-30 18:14:51 +0000 (Tue, 30 Dec 2014)
Log Message:
-----------
Fix:port_android:Move prescaled png images from res/drawable to res/drawable-nodpi to prevent them from being scaled once again by Android.
Modified Paths:
--------------
trunk/navit/navit/android/CMakeLists.txt
Modified: trunk/navit/navit/android/CMakeLists.txt
===================================================================
--- trunk/navit/navit/android/CMakeLists.txt 2014-12-27 22:48:37 UTC (rev 5987)
+++ trunk/navit/navit/android/CMakeLists.txt 2014-12-30 18:14:51 UTC (rev 5988)
@@ -57,7 +57,7 @@
-P ${PROJECT_SOURCE_DIR}/cmake/copy_files.cmake
COMMAND ${CMAKE_COMMAND}
-D GLOB_EXP="${PROJECT_BINARY_DIR}/navit/xpm/*.png"
- -D DST=${CMAKE_CURRENT_BINARY_DIR}/res/drawable
+ -D DST=${CMAKE_CURRENT_BINARY_DIR}/res/drawable-nodpi
-D LOWER=1
-P ${PROJECT_SOURCE_DIR}/cmake/copy_files.cmake
COMMAND ${CMAKE_COMMAND}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2014-12-23 00:08:07
|
Revision: 5983
http://sourceforge.net/p/navit/code/5983
Author: mdankov
Date: 2014-12-23 00:07:54 +0000 (Tue, 23 Dec 2014)
Log Message:
-----------
Add:port_android:Support xhdpi, xxhdpi, xxxhdpi display densities. Related to #1181.
Modified Paths:
--------------
trunk/navit/navit/CMakeLists.txt
trunk/navit/navit/xslt/android.xslt
Modified: trunk/navit/navit/CMakeLists.txt
===================================================================
--- trunk/navit/navit/CMakeLists.txt 2014-12-21 21:35:54 UTC (rev 5982)
+++ trunk/navit/navit/CMakeLists.txt 2014-12-23 00:07:54 UTC (rev 5983)
@@ -139,10 +139,13 @@
endmacro()
if(ANDROID)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxxhdpi.xml OSD_SIZE=5.33 ICON_SMALL=96 ICON_MEDIUM=128 ICON_BIG=128)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxhdpi.xml OSD_SIZE=4 ICON_SMALL=64 ICON_MEDIUM=96 ICON_BIG=96)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxhdpi.xml OSD_SIZE=2.67 ICON_MEDIUM=64)
process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navithdpi.xml OSD_SIZE=2 ICON_MEDIUM=48)
process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitmdpi.xml OSD_SIZE=1.33)
process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitldpi.xml OSD_SIZE=1)
- add_custom_target( navit_config_xml ALL DEPENDS navithdpi.xml navitmdpi.xml navitldpi.xml)
+ add_custom_target( navit_config_xml ALL DEPENDS navitxxxhdpi.xml navitxxhdpi.xml navitxhdpi.xml navithdpi.xml navitmdpi.xml navitldpi.xml)
else()
process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navit.xml "")
add_custom_target( navit_config_xml_resource DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/navit.xml COMMAND mkdir -p resources/share/navit COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/navit.xml resources/share/navit)
Modified: trunk/navit/navit/xslt/android.xslt
===================================================================
--- trunk/navit/navit/xslt/android.xslt 2014-12-21 21:35:54 UTC (rev 5982)
+++ trunk/navit/navit/xslt/android.xslt 2014-12-23 00:07:54 UTC (rev 5983)
@@ -64,6 +64,33 @@
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
+ <xsl:template match="/config/navit/layout/layer/itemgra/child::*">
+ <xsl:copy>
+ <xsl:copy-of select="@*[not(name()='text_size') and not(name()='width') and not(name()='radius') and not(name()='w') and not(name()='h') and not(name()='x') and not(name()='y')]"/>
+ <xsl:if test="@text_size">
+ <xsl:attribute name="text_size"><xsl:value-of select="round(number(@text_size)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@width">
+ <xsl:attribute name="width"><xsl:value-of select="round(number(@width)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@radius">
+ <xsl:attribute name="radius"><xsl:value-of select="round(number(@radius)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@w">
+ <xsl:attribute name="w"><xsl:value-of select="round(number(@w)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@h">
+ <xsl:attribute name="h"><xsl:value-of select="round(number(@h)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ <xsl:if test="@x">
+ <xsl:attribute name="x"><xsl:value-of select="round(number(@x)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@y">
+ <xsl:attribute name="y"><xsl:value-of select="round(number(@y)*number($OSD_SIZE))"/></xsl:attribute>
+ </xsl:if>
+ </xsl:copy>
+ </xsl:template>
<xsl:template match="/config/navit/layout[@name='Car-Android']">
<xsl:copy>
<xsl:copy-of select="@*"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|