GNU Radio's FOSPHOR Package
qt_sink_c.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 
22 #ifndef INCLUDED_GR_FOSPHOR_QT_SINK_C_H
23 #define INCLUDED_GR_FOSPHOR_QT_SINK_C_H
24 
25 #ifdef ENABLE_PYTHON
26 #include <Python.h>
27 #endif
28 
29 #include <gnuradio/fosphor/api.h>
31 
32 #include <gnuradio/sync_block.h>
33 
34 #include <QWidget>
35 #include <QApplication>
36 
37 namespace gr {
38  namespace fosphor {
39 
40  /*!
41  * \brief Qt version of fosphor sink
42  * \ingroup fosphor
43  */
44  class GR_FOSPHOR_API qt_sink_c : virtual public base_sink_c
45  {
46  public:
47  typedef boost::shared_ptr<qt_sink_c> sptr;
48 
49  /*!
50  * \brief Return a shared_ptr to a new instance of fosphor::qt_sink_c.
51  *
52  * To avoid accidental use of raw pointers, fosphor::qt_sink_c's
53  * constructor is in a private implementation
54  * class. fosphor::qt_sink_c::make is the public interface for
55  * creating new instances.
56  */
57  static sptr make(QWidget *parent=NULL);
58 
59  virtual void exec_() = 0;
60  virtual QWidget* qwidget() = 0;
61 
62 #ifdef ENABLE_PYTHON
63  virtual PyObject* pyqwidget() = 0;
64 #else
65  virtual void* pyqwidget() = 0;
66 #endif
67 
68  QApplication *d_qApplication;
69  };
70 
71  } // namespace fosphor
72 } // namespace gr
73 
74 #endif /* INCLUDED_GR_FOSPHOR_QT_SINK_C_H */
75 
Base fosphor sink API interface.
Definition: base_sink_c.h:37
#define GR_FOSPHOR_API
Definition: api.h:30
Definition: private.h:43
Definition: base_sink_c.h:30
QApplication * d_qApplication
Definition: qt_sink_c.h:68
Qt version of fosphor sink.
Definition: qt_sink_c.h:44
boost::shared_ptr< qt_sink_c > sptr
Definition: qt_sink_c.h:47