GNU Radio's FOSPHOR Package
QGLSurface.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013-2014 Sylvain Munaut <tnt@246tNt.com>
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef INCLUDED_GR_FOSPHOR_QGLSURFACE_H
22 #define INCLUDED_GR_FOSPHOR_QGLSURFACE_H
23 
24 #include <QGLWidget>
25 #include <QThread>
26 
27 namespace gr {
28  namespace fosphor {
29 
30  class qt_sink_c_impl;
31 
32  class Worker : public QObject
33  {
34  Q_OBJECT
35 
36  public:
37  Worker(qt_sink_c_impl *sink);
38  ~Worker();
39 
40  public Q_SLOTS:
41  void process();
42 
43  Q_SIGNALS:
44  void finished();
45  void error(QString err);
46 
47  private:
48  qt_sink_c_impl *d_sink;
49  };
50 
51 
52  class QGLSurface : public QGLWidget
53  {
54  Q_OBJECT
55 
56  private:
57  qt_sink_c_impl *d_block;
58 
59  protected:
60  void paintEvent(QPaintEvent *pe);
61  void resizeEvent(QResizeEvent *re);
62  void keyPressEvent(QKeyEvent *ke);
63  void closeEvent(QCloseEvent * event);
64 
65  public:
66  QGLSurface(QWidget *parent, qt_sink_c_impl *d_block);
67  void handOver();
68  QThread *d_thread;
69  };
70 
71  } // namespace fosphor
72 } // namespace gr
73 
74 #endif /* INCLUDED_GR_FOSPHOR_QGLSURFACE_H */
Worker(qt_sink_c_impl *sink)
Definition: private.h:43
Definition: QGLSurface.h:32
void error(QString err)
Definition: base_sink_c.h:30
Qt version of fosphor sink (implementation)
Definition: qt_sink_c_impl.h:39
QThread * d_thread
Definition: QGLSurface.h:68
Definition: QGLSurface.h:52