diff options
Diffstat (limited to 'navit/graphics/qt_qpainter')
-rw-r--r-- | navit/graphics/qt_qpainter/RenderArea.cpp | 4 | ||||
-rw-r--r-- | navit/graphics/qt_qpainter/RenderArea.h | 4 | ||||
-rw-r--r-- | navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp | 22 | ||||
-rw-r--r-- | navit/graphics/qt_qpainter/graphics_qt_qpainter.h | 6 |
4 files changed, 18 insertions, 18 deletions
diff --git a/navit/graphics/qt_qpainter/RenderArea.cpp b/navit/graphics/qt_qpainter/RenderArea.cpp index 291786f3d..96515f924 100644 --- a/navit/graphics/qt_qpainter/RenderArea.cpp +++ b/navit/graphics/qt_qpainter/RenderArea.cpp @@ -67,7 +67,7 @@ RenderArea::RenderArea(struct graphics_priv *priv, QT_QPAINTER_RENDERAREA_PARENT #endif is_overlay=overlay; gra=priv; -#if QT_QPAINTER_USE_EVENT_QT +#ifdef QT_QPAINTER_USE_EVENT_QT timer_type=g_hash_table_new(NULL, NULL); timer_callback=g_hash_table_new(NULL, NULL); watches=g_hash_table_new(NULL, NULL); @@ -303,7 +303,7 @@ void RenderArea::keyPressEvent(QKeyEvent *event) void RenderArea::watchEvent(int fd) { -#if QT_QPAINTER_USE_EVENT_QT +#ifdef QT_QPAINTER_USE_EVENT_QT struct event_watch *ev=(struct event_watch *)g_hash_table_lookup(watches, (void *)fd); dbg(1,"fd=%d ev=%p cb=%p\n", fd, ev, ev->cb); callback_call_0(ev->cb); diff --git a/navit/graphics/qt_qpainter/RenderArea.h b/navit/graphics/qt_qpainter/RenderArea.h index 9404bc85a..a78c23cab 100644 --- a/navit/graphics/qt_qpainter/RenderArea.h +++ b/navit/graphics/qt_qpainter/RenderArea.h @@ -39,7 +39,7 @@ class RenderArea : public QT_QPAINTER_RENDERAREA_PARENT struct callback_list *cbl; struct graphics_priv *gra; -#if QT_QPAINTER_USE_EVENT_QT +#ifdef QT_QPAINTER_USE_EVENT_QT GHashTable *timer_type; GHashTable *timer_callback; GHashTable *watches; @@ -59,7 +59,7 @@ protected: void keyPressEvent(QKeyEvent *event); void closeEvent(QCloseEvent *event); bool event(QEvent *event); -#if QT_QPAINTER_USE_EVENT_QT +#ifdef QT_QPAINTER_USE_EVENT_QT void timerEvent(QTimerEvent *event); #endif protected slots: diff --git a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp index cddd12844..9e771b8ad 100644 --- a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp +++ b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp @@ -154,7 +154,7 @@ struct graphics_image_priv { //############################################################################################################## static void graphics_destroy(struct graphics_priv *gr) { -#if QT_QPAINTER_USE_FREETYPE +#ifdef QT_QPAINTER_USE_FREETYPE gr->freetype_methods.destroy(); #endif g_free(gr->window_title); @@ -404,7 +404,7 @@ static void draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, s static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) { QPainter *painter=gr->painter; -#if !QT_QPAINTER_USE_FREETYPE +#ifndef QT_QPAINTER_USE_FREETYPE QString tmp=QString::fromUtf8(text); #ifndef QT_NO_TRANSFORMATIONS #if QT_VERSION >= 0x040000 @@ -787,7 +787,7 @@ static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graph { *meth=graphics_methods; struct graphics_priv *ret=g_new0(struct graphics_priv, 1); -#if QT_QPAINTER_USE_FREETYPE +#ifdef QT_QPAINTER_USE_FREETYPE if (gr->font_freetype_new) { ret->font_freetype_new=gr->font_freetype_new; gr->font_freetype_new(&ret->freetype_methods); @@ -808,7 +808,7 @@ static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graph return ret; } -#if QT_QPAINTER_USE_EVENT_QT +#ifdef QT_QPAINTER_USE_EVENT_QT static struct graphics_priv *event_gr; @@ -921,17 +921,17 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct struct attr *attr; dbg(0,"enter\n"); -#if QT_QPAINTER_USE_EVENT_QT +#ifdef QT_QPAINTER_USE_EVENT_QT if (event_gr) return NULL; if (! event_request_system("qt","graphics_qt_qpainter_new")) return NULL; #endif -#if QT_QPAINTER_USE_EVENT_GLIB +#ifdef QT_QPAINTER_USE_EVENT_GLIB if (! event_request_system("glib","graphics_qt_qpainter_new")) return NULL; #endif -#if QT_QPAINTER_USE_FREETYPE +#ifdef QT_QPAINTER_USE_FREETYPE font_freetype_new=(struct font_priv *(*)(void *))plugin_get_font_type("freetype"); if (!font_freetype_new) { dbg(0,"no freetype\n"); @@ -941,14 +941,14 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct ret=g_new0(struct graphics_priv, 1); *meth=graphics_methods; ret->nav=nav; -#if QT_QPAINTER_USE_FREETYPE +#ifdef QT_QPAINTER_USE_FREETYPE ret->font_freetype_new=font_freetype_new; font_freetype_new(&ret->freetype_methods); meth->font_new=(struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int, int))ret->freetype_methods.font_new; meth->get_text_bbox=(void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*, int))ret->freetype_methods.get_text_bbox; #endif -#if QT_QPAINTER_USE_EMBEDDING && QT_VERSION >= 0x040500 +#if defined QT_QPAINTER_USE_EMBEDDING && QT_VERSION >= 0x040500 if ((attr=attr_search(attrs, NULL, attr_gc_type))) QApplication::setGraphicsSystem(attr->u.str); else @@ -973,7 +973,7 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct ret->widget= new RenderArea(ret); ret->widget->cbl=cbl; ret->painter = new QPainter; -#if QT_QPAINTER_USE_EVENT_QT +#ifdef QT_QPAINTER_USE_EVENT_QT event_gr=ret; #endif ret->w=800; @@ -1000,7 +1000,7 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct void plugin_init(void) { plugin_register_graphics_type("qt_qpainter", graphics_qt_qpainter_new); -#if QT_QPAINTER_USE_EVENT_QT +#ifdef QT_QPAINTER_USE_EVENT_QT plugin_register_event_type("qt", event_qt_new); #endif } diff --git a/navit/graphics/qt_qpainter/graphics_qt_qpainter.h b/navit/graphics/qt_qpainter/graphics_qt_qpainter.h index c1970a614..74e63a594 100644 --- a/navit/graphics/qt_qpainter/graphics_qt_qpainter.h +++ b/navit/graphics/qt_qpainter/graphics_qt_qpainter.h @@ -41,7 +41,7 @@ #define QT_QPAINTER_USE_FREETYPE 1 #endif -#if QT_QPAINTER_USE_FREETYPE +#ifdef QT_QPAINTER_USE_FREETYPE #include "navit/font/freetype/font_freetype.h" #endif @@ -94,7 +94,7 @@ #endif -#if QT_QPAINTER_USE_EMBEDDING +#ifdef QT_QPAINTER_USE_EMBEDDING #include <QX11EmbedWidget> #endif @@ -136,7 +136,7 @@ struct graphics_priv { int cleanup; int overlay_disable; int wraparound; -#if QT_QPAINTER_USE_FREETYPE +#ifdef QT_QPAINTER_USE_FREETYPE struct font_priv * (*font_freetype_new)(void *meth); struct font_freetype_methods freetype_methods; #endif |