Navit SVN

/work/compile/navit/src/navit/graphics/qt_qpainter/RenderArea.h

00001 
00019 #ifndef __RENDERAREA_H
00020 #define __RENDERAREA_H
00021 
00022 #ifdef QT_QPAINTER_USE_EMBEDDING
00023 class EmbeddedWidget : public QX11EmbedWidget {
00024     Q_OBJECT
00025 
00026         struct graphics_priv *gra;
00027 public:
00028         EmbeddedWidget(struct graphics_priv *priv, QWidget* child, QWidget *parent = NULL);
00029 protected:
00030         void closeEvent(QCloseEvent *event);
00031 };
00032 #endif
00033 
00034 class RenderArea : public QT_QPAINTER_RENDERAREA_PARENT
00035 {
00036      Q_OBJECT
00037  public:
00038      RenderArea(struct graphics_priv *priv, QT_QPAINTER_RENDERAREA_PARENT *parent = 0, int w=800, int h=800, int overlay=0);
00039      void do_resize(QSize size);
00040      QPixmap *pixmap;
00041      struct callback_list *cbl;
00042      struct graphics_priv *gra;
00043 
00044 #if QT_QPAINTER_USE_EVENT_QT
00045      GHashTable *timer_type;
00046      GHashTable *timer_callback;
00047      GHashTable *watches;
00048 #endif
00049 
00050      void processClose();
00051 protected:
00052      int is_overlay;
00053      QSize sizeHint() const;
00054      void paintEvent(QPaintEvent *event);
00055      void resizeEvent(QResizeEvent *event);
00056      void mouseEvent(int pressed, QMouseEvent *event);
00057      void mousePressEvent(QMouseEvent *event);
00058      void mouseReleaseEvent(QMouseEvent *event);
00059      void mouseMoveEvent(QMouseEvent *event);
00060      void wheelEvent(QWheelEvent *event);
00061      void keyPressEvent(QKeyEvent *event);
00062      void closeEvent(QCloseEvent *event);
00063      bool event(QEvent *event);
00064 #if QT_QPAINTER_USE_EVENT_QT
00065      void timerEvent(QTimerEvent *event);
00066 #endif
00067  protected slots:
00068      void watchEvent(int fd);
00069  };
00070 
00071 #endif /* __RENDERAREA_H */