BRL-CAD
dm-qt.h
Go to the documentation of this file.
1 /* D M - Q T . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2013-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @addtogroup libdm */
21 /** @{ */
22 /** @file dm-qt.h
23  *
24  */
25 
26 #ifndef DM_QT_H
27 #define DM_QT_H
28 
29 #include "vmath.h"
30 
31 #ifdef DM_QT
32 # include <QApplication>
33 # include <QPainter>
34 # include <QWindow>
35 # include <QBackingStore>
36 # include <QResizeEvent>
37 # include <QImage>
38 
39 class QTkMainWindow: public QWindow {
40 
41 public:
42  QTkMainWindow(QPixmap *p, QWindow *parent = 0, void *d = NULL);
43  ~QTkMainWindow();
44 
45  virtual void render(QPainter *painter);
46 public slots:
47  void renderNow();
48 
49 protected:
50  bool event(QEvent *event);
51 
52  void resizeEvent(QResizeEvent *event);
53  void exposeEvent(QExposeEvent *event);
54 
55 private:
56  QPixmap *pixmap;
57  QBackingStore *m_backingStore;
58  bool m_update_pending;
59  void *dmp;
60 };
61 
62 
63 struct qt_vars {
64  QApplication *qapp;
65  QWindow *parent;
66  QTkMainWindow *win;
67  QColor fg, bg;
68  QPixmap *pix;
69  QPainter *painter;
70  QFont *font;
71  mat_t qmat;
72  QImage *img;
73  int drawFb;
74 };
75 
76 struct qt_tk_bind {
77  char* (*bind_function)(QEvent *event);
78  const char *name;
79 };
80 
81 #endif /* DM_QT */
82 
83 #endif /* DM_QT_H */
84 
85 /** @} */
86 /*
87  * Local Variables:
88  * mode: C++
89  * tab-width: 8
90  * indent-tabs-mode: t
91  * c-file-style: "stroustrup"
92  * End:
93  * ex: shiftwidth=4 tabstop=8
94  */
Definition: clone.c:90
struct fg_node fg
Definition: chull3d.cpp:80