On 25.08.13 08:42, [email protected] wrote:
> Hi,
> 
> thanks for your work to make navit better. Could you please use the bugtracker
> http://trac.navit-project.org/
> to submit your patches?
> 
> Bye Henning


How to use this for reporting bugs?  The login page refers to the trac
page, and the trac page asks to go to the login page.  Unfortunately
there is no obvious knob for "submit a patch [here]" or "submit a
feature request [here]", or similar.

So being sorry, in order to move on, even if it could not be
appropriate, for archieving purposes or for interested parties please
let me repost the few fixes here again, decomposed into "unrelated" hunks.

 *****

Few comments:

(*) I'm using navit subversion revision 5560 and the attached fixes
should apply, by the given enumeration, to this revision.


(*) I configured navit by issuing

./configure CFLAGS="-O1
-I/System/Library/Frameworks/OpenGL.framework/Versions/Current
-I/System/Library/Frameworks/GLUT.framework/Versions/Current
-I/usr/local/gpsd/include -DHAVE_LIBGPS19" CXXFLAGS="-O1
-I/Library/Frameworks/QtCore.framework/Versions/4/Headers"
LDFLAGS="-framework OpenGL -framework GLUT -framework QtCore"
GPSD_CFLAGS=-I/usr/local/gpsd/include GPSD_LIBS="-L/usr/local/gpsd/lib
-lgps" QT_GUI_CFLAGS=-I/Library/Frameworks/QtGui.framework/Headers
QT_GUI_LIBS="-framework QtGui"
QT_SVG_CFLAGS=-I/Library/Frameworks/QtSvg.framework/Headers
QT_SVG_LIBS="-framework QtSvg"
QT_XML_CFLAGS=-I/Library/Frameworks/QtXml.framework/Headers
QT_XML_LIBS="-framework QtXml"   --disable-svg2png
--enable-graphics-opengl  --prefix=/usr/local/navit


(*) I am using QT 4.6.3 from binary dmg distribution from Trolltech.


(*) There is no "macports", or anything else as suggested on the "MacOSX
page", installed (except "byteswap.h").


(*) Patches:

(1) Without "navit-01-maptool.h.patch" linking fails:

/bin/sh ../../libtool --tag=CC   --mode=link gcc  -g -O1
-I/usr/local/gpsd/include -DHAVE_LIBGPS19 -I/opt/local/include
-L/opt/local/lib -Wall -Wcast-align -Wmissing-declarations
-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type
-D_GNU_SOURCE -ffast-math -I../../intl/  -framework QtCore -o maptool
maptool.o libmaptool.la ../libnavit.la  -L/usr/local/lib -lgthread-2.0
-lglib-2.0 -lintl   -L/usr/local/lib -lgmodule-2.0 -lglib-2.0 -lintl
-lintl  -lz  -lcrypto -lintl  -lm
libtool: link: gcc -g -O1 -I/usr/local/gpsd/include -DHAVE_LIBGPS19
-I/opt/local/include -Wall -Wcast-align -Wmissing-declarations
-Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type
-D_GNU_SOURCE -ffast-math -I../../intl/ -o maptool maptool.o
-L/opt/local/lib ./.libs/libmaptool.a ../.libs/libnavit.a
-L/usr/local/lib -Lfib-1.1 /usr/local/lib/libgthread-2.0.dylib
/usr/local/lib/libgmodule-2.0.dylib /usr/local/lib/libglib-2.0.dylib -lz
-lcrypto /usr/local/lib/libintl.dylib /usr/lib/libiconv.dylib -lc -lm
-framework QtCore
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning -L: directory
name (/opt/local/lib) does not exist
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning -L: directory
name (fib-1.1) does not exist
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of
symbol _map_information_attrs
./.libs/libmaptool.a(buffer.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(ch.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(coastline.o) definition of _map_information_attrs
in section (__DATA,__common)
./.libs/libmaptool.a(itembin.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(itembin_buffer.o) definition of
_map_information_attrs in section (__DATA,__common)
./.libs/libmaptool.a(misc.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(osm.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(osm_o5m.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(osm_protobuf.o) definition of
_map_information_attrs in section (__DATA,__common)
./.libs/libmaptool.a(osm_protobufdb.o) definition of
_map_information_attrs in section (__DATA,__common)
./.libs/libmaptool.a(osm_relations.o) definition of
_map_information_attrs in section (__DATA,__common)
./.libs/libmaptool.a(osm_xml.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(sourcesink.o) definition of _map_information_attrs
in section (__DATA,__common)
./.libs/libmaptool.a(tempfile.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(tile.o) definition of _map_information_attrs in
section (__DATA,__common)
./.libs/libmaptool.a(zip.o) definition of _map_information_attrs in
section (__DATA,__common)
collect2: ld returned 1 exit status
make[4]: *** [maptool] Error 1
make[4]: Leaving directory
`/Volumes/Festplatte/eeri/c/tmp/navit/navit-0.5.0/navit/maptool'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/Volumes/Festplatte/eeri/c/tmp/navit/navit-0.5.0/navit'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/Volumes/Festplatte/eeri/c/tmp/navit/navit-0.5.0/navit'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/Volumes/Festplatte/eeri/c/tmp/navit/navit-0.5.0'
make: *** [all] Error 2



(2) Without "navit-02-graphics_qt_qpainter.h.Freetype.patch" navit
crashed with "Bus error", due to issues with Freetype subsystem. This
issue may arise also under MS-Windows, though I didn't verify; anyways,
it would be reasonable to assume existing X11 environment while
expecting Freetype presence?


(3) Without "navit-03-graphics_qt_qpainter.h.EventQT.patch" navit hangs
indefinitely on startup having painted the map window (with rotating
rainbow-coloured "busy" mouse cursor).  Due to lacking appropriate
MS-Windows environment this issue is unverified there.


(4) Bounding box calculations for text items are wrong:
navit-04-graphics_qt_qpainter.cpp.QTboundingRect.patch.  Comparing the
same source code in e.g. sdl or win32 graphics engines revealed this bug.


(5) Scale SVGs and Pixmaps to requested size:
navit-05-graphics_qt_qpainter.cpp.PixmapScale.patch.  This caused e.g.
the "Exit" knob to take half the OSD-window and so screw the items
placement.  Someone with better understanding of QT could review this.


(6) Fix byte ordering on bigendian systems for pixelcopy:
navit-06-graphics_qt_qpainter.cpp.Bigendian_overlaycopy.patch.


(7) Postpone map window creation after having initialised window title
name and window size from navit.xml:
navit-07-graphics_qt_qpainter.cpp.QTtitle.patch.  Map window appeared
without any title otherwise.


(8) Recover focus in map window after turning fullscreen on/off; raise
map window on creation: navit-08-graphics_qt_qpainter.cpp.APPLEraise.patch.


(9) Not sure if non-X11 systems have X11-timers:
navit-09-graphics_qt_qpainter.cpp.X11ExcludeTimers.patch. This is
probably a cosmetic issue?


(10) Cosmetic fix: Apple systems often have Arial installed but Lucida
Grande is a systemwide default and looks "native":
navit-10-graphics_qt_qpainter.cpp.LucidaGrande.patch.


(11) MacOSX lacks wget, use curl instead:
navit-11-maps.Makefile.in.patch.  Due to lacking experiences I am unsure
if this belongs to Makefile.am or Makefile.in, or how to solve this
issue generally, so here a review is advisable.


(12) Introduce debug-level '-1' to suppress all debug output (for
production use): navit-12-debug.c.patch.


(13) PENDING: Activated computer keyboard enters garbage due to a memory
corruption problem; identify the problem: navit-13-gui_internal.c.patch.
 TO RECAPITULATE: This is not a fix to the problem but merely a hint
what might be affected and where the symptom finally visibly occurs.


    Eeri Kask

--- navit/maptool/maptool.h.orig        2013-08-12 20:44:46.000000000 +0200
+++ navit/maptool/maptool.h     2013-08-12 20:45:25.000000000 +0200
@@ -348,9 +348,9 @@
 int write_aux_tiles(struct zip_info *zip_info);
 int create_tile_hash(void);
 void write_tilesdir(struct tile_info *info, struct zip_info *zip_info, FILE 
*out);
 void merge_tiles(struct tile_info *info);
-struct attr map_information_attrs[32];
+extern struct attr map_information_attrs[32];
 void index_init(struct zip_info *info, int version);
 void index_submap_add(struct tile_info *info, struct tile_head *th);
 
 /* zip.c */
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.h.orig      2013-08-12 
20:46:40.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.h   2013-08-24 
13:49:34.000000000 +0200
@@ -36,11 +36,13 @@
 #include "navit/navit.h"
 
 #include <qglobal.h>
 
+#ifdef Q_WS_X11
 #ifndef QT_QPAINTER_USE_FREETYPE
 #define QT_QPAINTER_USE_FREETYPE 1
 #endif
+#endif
 
 #if QT_QPAINTER_USE_FREETYPE
 #include "navit/font/freetype/font_freetype.h"
 #endif
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.h.orig      2013-08-31 
13:22:41.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.h   2013-08-31 
13:28:03.000000000 +0200
@@ -83,11 +83,17 @@
 #ifdef HAVE_QT_SVG
 #include <QSvgRenderer>
 #endif
 
+#if (defined __APPLE__ || defined _WIN32 || defined _WIN64)
+#ifndef QT_QPAINTER_USE_EVENT_QT
+#define QT_QPAINTER_USE_EVENT_QT 1
+#endif
+#else
 #ifndef QT_QPAINTER_USE_EVENT_GLIB
 #define QT_QPAINTER_USE_EVENT_GLIB 1
 #endif
+#endif
 
 #ifdef Q_WS_X11
 #ifndef QT_QPAINTER_USE_EMBEDDING
 #define QT_QPAINTER_USE_EMBEDDING 1
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp.orig    2013-08-06 
02:20:11.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2013-08-24 
15:12:18.000000000 +0200
@@ -695,15 +731,15 @@
        QString tmp=QString::fromUtf8(text);
        painter->setFont(*font->font);
        QRect r=painter->boundingRect(0,0,gr->w,gr->h,0,tmp);
        ret[0].x=0;
-       ret[0].y=-r.height();
+       ret[0].y=0;
        ret[1].x=0;
-       ret[1].y=0;
+       ret[1].y=-r.height();
        ret[2].x=r.width();
-       ret[2].y=0;
+       ret[2].y=-r.height();
        ret[3].x=r.width();
-       ret[3].y=-r.height();
+       ret[3].y=0;
 }
 
 
 
//##############################################################################################################
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp.orig    2013-08-06 
02:20:11.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2013-08-24 
15:12:18.000000000 +0200
@@ -295,17 +304,29 @@
                     if (!renderer.isValid()) {
                        g_free(ret);
                        return NULL;
                     }
-                    ret->pixmap=new QPixmap(renderer.defaultSize());
-                    ret->pixmap->fill(Qt::transparent);
-                    QPainter painter(ret->pixmap); 
-                    renderer.render(&painter);
-
+                   if (*w > 0 && *h > 0 && renderer.viewBox() != 
QRect(0,0,*w,*h)) {
+                       ret->pixmap=new QPixmap(*w, *h);
+                       ret->pixmap->fill(Qt::transparent);
+                       QPainter painter(ret->pixmap); 
+                       
painter.scale((qreal)(*w)/(qreal)(renderer.viewBox().width()), 
(qreal)(*h)/(qreal)(renderer.viewBox().height()));
+                       renderer.render(&painter);
+                   } else {
+                       ret->pixmap=new QPixmap(renderer.defaultSize());
+                       ret->pixmap->fill(Qt::transparent);
+                       QPainter painter(ret->pixmap); 
+                       renderer.render(&painter);
+                   }
                 } else {
-
-                   ret->pixmap=new QPixmap(path);
-
+                   if (*w > 0 && *h > 0) {
+                       QPixmap tmp(path);
+                       if (tmp.isNull() || (*w == tmp.width() && *h == 
tmp.height()))
+                           ret->pixmap=new QPixmap(tmp);
+                       else
+                           ret->pixmap=new QPixmap(tmp.scaled(QSize(*w,*h), 
Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
+                   } else
+                       ret->pixmap=new QPixmap(path);
                 }
 #else 
                ret->pixmap=new QPixmap(path);
 #endif /* QT__VERSION */
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp.orig    2013-08-06 
02:20:11.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2013-08-24 
15:12:18.000000000 +0200
@@ -102,10 +102,15 @@
                        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]) 
+#ifdef WORDS_BIGENDIAN
+                               if (data[3] == overlay->rgba[0] && data[2] == 
overlay->rgba[1] && data[1] == overlay->rgba[2])
+                                       data[0]=overlay->rgba[3];
+#else
+                               if (data[0] == overlay->rgba[0] && data[1] == 
overlay->rgba[1] && data[2] == overlay->rgba[2])
                                        data[3]=overlay->rgba[3];
+#endif
                                data+=4;
                        }
 #if QT_VERSION < 0x040000
                        
painter.drawImage(QPoint(ovr.x()-r->x(),ovr.y()-r->y()), img, 0);
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp.orig    2013-08-31 
15:03:03.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2013-08-31 
15:04:05.000000000 +0200
@@ -980,11 +980,8 @@
 #else
        ret->app = new QApplication(argc, argv);
 #endif
 #endif
-       ret->widget= new RenderArea(ret);
-       ret->widget->cbl=cbl;
-       ret->painter = new QPainter;
 #if QT_QPAINTER_USE_EVENT_QT
        event_gr=ret;
 #endif
        ret->w=800;
@@ -997,8 +994,12 @@
                ret->window_title=g_strdup(attr->u.str);
        else
                ret->window_title=g_strdup("Navit");
 
+       ret->widget= new RenderArea(ret);
+       ret->widget->cbl=cbl;
+       ret->painter = new QPainter;
+
        dbg(0,"return\n");
        return ret;
 }
 
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp.orig    2013-08-31 
15:04:05.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2013-08-31 
15:05:57.000000000 +0200
@@ -639,9 +639,12 @@
 #endif /* QT_QPAINTER_USE_EMBEDDING */
        if (on)
                _outerWidget->showFullScreen();
        else
-               _outerWidget->showMaximized();
+               _outerWidget->showNormal();
+#ifdef __APPLE__
+       _outerWidget->activateWindow();
+#endif
 #endif
        return 1;
 }
 
@@ -683,11 +686,18 @@
                if (xid.length()>0) {
                        _outerWidget->embedInto(xid.toULong(&ok,0));
                }
                _outerWidget->show();
+#ifdef __APPLE__
+               _outerWidget->raise();
+#endif
 #endif /* QT_QPAINTER_USE_EMBEDDING */
-               if (this_->w && this_->h)
+               if (this_->w && this_->h) {
                        this_->widget->show();
+#ifdef __APPLE__
+                       this_->widget->raise();
+#endif
+               }
                else
                        this_->widget->showMaximized();
 #endif /* QT_QPAINTER_NO_WIDGET */
                win->priv=this_;
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp.orig    2013-08-31 
15:05:57.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2013-08-31 
15:08:14.000000000 +0200
@@ -604,9 +604,14 @@
                }
 #endif
 #if QT_VERSION >= 0x040000
                if (!gr->parent)
-                       
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers|QEventLoop::DeferredDeletion|QEventLoop::X11ExcludeTimers);
+                       
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents
+                                                       | 
QEventLoop::ExcludeSocketNotifiers
+#ifdef Q_WS_X11
+                                                       | 
QEventLoop::X11ExcludeTimers
+#endif
+                                                       | 
QEventLoop::DeferredDeletion);
 #endif
        }
 #if QT_VERSION >= 0x040000
        if (mode == draw_mode_end_lazy) {
--- navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp.orig    2013-08-31 
15:08:14.000000000 +0200
+++ navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp 2013-08-31 
15:09:31.000000000 +0200
@@ -189,9 +189,13 @@
 
//##############################################################################################################
 static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct 
graphics_font_methods *meth, char *fontfamily, int size, int flags)
 {
        struct graphics_font_priv *ret=g_new0(struct graphics_font_priv, 1);
+#ifdef __APPLE__
+       ret->font=new QFont("Lucida Grande",size/20);
+#else
        ret->font=new QFont("Arial",size/20);
+#endif
        *meth=font_methods;
        return ret;
 }
 
--- navit/maps/Makefile.in.orig 2013-08-06 02:21:07.000000000 +0200
+++ navit/maps/Makefile.in      2013-08-31 15:33:30.000000000 +0200
@@ -639,9 +639,9 @@
        echo '<map type="binfile" enabled="yes" 
data="$$NAVIT_SHAREDIR/maps/$<"/>' >$@
 
 $(SAMPLE_MAP).osm.bz2:
        echo "Downloading osm sample map"
-       wget -O $(SAMPLE_MAP).osm.bz2.tmp 
http://www.navit-project.org/maps/$(SAMPLE_MAP).osm.bz2
+       `if test \`uname -s\` = Darwin; then echo curl; else echo wget -O -; 
fi`  http://www.navit-project.org/maps/$(SAMPLE_MAP).osm.bz2  > 
$(SAMPLE_MAP).osm.bz2.tmp
        mv $(SAMPLE_MAP).osm.bz2.tmp $(SAMPLE_MAP).osm.bz2
 
 distclean-local: 
        rm -f $(SAMPLE_MAP).osm.bz2 $(SAMPLE_MAP).bin $(SAMPLE_MAP).xml
--- navit/debug.c.orig  2013-08-22 09:23:32.000000000 +0200
+++ navit/debug.c       2013-08-22 09:23:37.000000000 +0200
@@ -53,5 +53,5 @@
 
 
-int debug_level=0;
+int debug_level=-1;
 #define GLOBAL_DEBUG_LEVEL_UNSET -1
 int global_debug_level=GLOBAL_DEBUG_LEVEL_UNSET;
--- navit/gui/internal/gui_internal.c.orig      2013-08-24 15:26:46.000000000 
+0200
+++ navit/gui/internal/gui_internal.c   2013-08-25 09:41:47.000000000 +0200
@@ -2747,8 +2747,9 @@
 //# Authors: Martin Schaller (04/2008)
 
//##############################################################################################################
 static void gui_internal_keypress(void *data, char *key)
 {
+char tmp[2];
        struct gui_priv *this=data;
        int w,h;
        struct point p;
        if (!this->root.children) {
@@ -2787,9 +2788,11 @@
                        break;
                }
                return;
        }
+tmp[0] = key[0], tmp[1] = key[1];
        graphics_draw_mode(this->gra, draw_mode_begin);
+key[0] = tmp[0], key[1] = tmp[1];
        switch (*key) {
        case NAVIT_KEY_LEFT:
                gui_internal_keynav_highlight_next(this,-1,0);
                break;
@@ -2817,9 +2820,11 @@
        default:
                gui_internal_keypress_do(this, key);
        }
        if (!event_main_loop_has_quit()) {
+tmp[0] = key[0], tmp[1] = key[1];
                graphics_draw_mode(this->gra, draw_mode_end);
+key[0] = tmp[0], key[1] = tmp[1];
                gui_internal_check_exit(this);
        }
 }
 
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Navit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/navit-users

Reply via email to