navit  0.5.1-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
graphics_qt_qpainter.h
Go to the documentation of this file.
1 
19 #ifndef __GRAPHICS_QT_QPAINTER_H
20 #define __GRAPHICS_QT_QPAINTER_H
21 
22 #include <glib.h>
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include "config.h"
26 #include "navit/point.h"
27 #include "navit/item.h"
28 #include "navit/graphics.h"
29 #include "navit/color.h"
30 #include "navit/debug.h"
31 #include "navit/plugin.h"
32 #include "navit/callback.h"
33 #include "navit/event.h"
34 #include "navit/window.h"
35 #include "navit/keys.h"
36 #include "navit/navit.h"
37 
38 #include <qglobal.h>
39 #if QT_VERSION < 0x040000
40 #error "Support for Qt 3 was dropped in rev 5999."
41 #endif
42 
43 #ifndef QT_QPAINTER_USE_FREETYPE
44 #define QT_QPAINTER_USE_FREETYPE 1
45 #endif
46 
47 #ifdef QT_QPAINTER_USE_FREETYPE
49 #endif
50 
51 #include <QResizeEvent>
52 #include <QApplication>
53 #if QT_VERSION >= 0x040200
54 #include <QGraphicsScene>
55 #include <QGraphicsView>
56 #endif
57 #include <QPainter>
58 #include <QPen>
59 #include <QBrush>
60 #include <QPixmap>
61 #include <QWidget>
62 #include <QPolygonF>
63 #include <QPixmapCache>
64 #include <QtGui>
65 #ifdef HAVE_QT_SVG
66 #include <QSvgRenderer>
67 #endif
68 
69 #ifndef QT_QPAINTER_USE_EVENT_GLIB
70 #define QT_QPAINTER_USE_EVENT_GLIB 1
71 #endif
72 
73 #ifdef Q_WS_X11
74 #ifndef QT_QPAINTER_USE_EMBEDDING
75 #define QT_QPAINTER_USE_EMBEDDING 1
76 #endif
77 #endif
78 
79 #ifdef QT_QPAINTER_USE_EMBEDDING
80 #include <QX11EmbedWidget>
81 #endif
82 
83 #ifndef QT_QPAINTER_RENDERAREA_PARENT
84 #define QT_QPAINTER_RENDERAREA_PARENT QWidget
85 #endif
86 
87 class RenderArea;
88 
89 //##############################################################################################################
90 //# Description:
91 //# Comment:
92 //# Authors: Martin Schaller (04/2008)
93 //##############################################################################################################
94 struct graphics_gc_priv {
95  QPen *pen;
96  QBrush *brush;
97  struct color c;
98 };
99 
100 //##############################################################################################################
101 //# Description:
102 //# Comment:
103 //# Authors: Martin Schaller (04/2008)
104 //##############################################################################################################
105 struct graphics_priv {
106 #ifdef HAVE_QPE
107  QPEApplication *app;
108 #else
109  QApplication *app;
110 #endif
112  QPainter *painter;
114  unsigned char rgba[4];
115  enum draw_mode_num mode;
116  struct graphics_priv *parent,*overlays,*next;
117  struct point p,pclean;
118  int cleanup;
120  int wraparound;
121 #ifdef QT_QPAINTER_USE_FREETYPE
122  struct font_priv * (*font_freetype_new)(void *meth);
124 #endif
125  int w,h,flags;
126  struct navit* nav;
127  char *window_title;
128 };
129 
130 void qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev);
131 struct event_watch {
132  QSocketNotifier *sn;
133  struct callback *cb;
134  int fd;
135 };
136 
137 void event_qt_remove_timeout(struct event_timeout *ev);
138 
139 #endif /* __GRAPHICS_QT_QPAINTER_H */
draw_mode_num
Definition: graphics.h:44
struct callback * cb
Definition: event_qt5.cpp:53
char * window_title
Definition: graphics_gtk_drawing_area.c:89
Definition: font_freetype.c:73
int h
Definition: graphics_cocoa.m:69
struct graphics_priv * parent
Definition: graphics_cocoa.m:70
struct graphics_priv * overlays
Definition: graphics_cocoa.m:70
Interface to the FreeType 2 library, to render text as bitmaps.
unsigned char rgba[4]
Definition: graphics_qt_qpainter.h:114
Definition: color.h:23
int flags
Definition: graphics_gd.c:198
Definition: event_glib.c:47
int w
Definition: graphics_cocoa.m:69
Definition: font_freetype.h:36
void qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev)
Definition: graphics_qt_qpainter.cpp:64
struct color c
Definition: graphics_gtk_drawing_area.c:95
enum draw_mode_num mode
Definition: graphics_egl.c:89
QApplication * app
Definition: graphics_qt_qpainter.h:109
struct point p
Definition: graphics_egl.c:75
struct graphics_priv * next
Definition: graphics_cocoa.m:70
struct point p pclean
Definition: graphics_cocoa.m:68
Definition: RenderArea.h:32
struct graphics_gc_priv * background_gc
Definition: graphics_egl.c:88
Definition: graphics_android.c:37
QBrush * brush
Definition: graphics_qt5.h:114
RenderArea * widget
Definition: graphics_qt_qpainter.h:111
QPainter * painter
Definition: graphics_qt5.h:87
Definition: event_glib.c:91
void event_qt_remove_timeout(struct event_timeout *ev)
int overlay_disable
Definition: graphics_qt_qpainter.h:119
Definition: callback.c:26
Definition: point.h:23
QPen * pen
Definition: graphics_qt5.h:113
Definition: graphics_android.c:76
int fd
Definition: event_qt5.cpp:54
struct navit * nav
Definition: graphics_egl.c:94
QSocketNotifier * sn
Definition: event_qt5.cpp:52
Definition: navit.c:111
int cleanup
Definition: graphics_cocoa.m:69
Exported functions / structures for the graphics subsystem.
struct font_freetype_methods freetype_methods
Definition: graphics_egl.c:93
int wraparound
Definition: graphics_cocoa.m:69