GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Container.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2011-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_Container_h)
27 #define octave_Container_h 1
28 
29 #include <QWidget>
30 
31 #include "GenericEventNotify.h"
32 
33 #include "event-manager.h"
34 #include "graphics.h"
35 
37 
38 class base_qobject;
39 }
40 
42 
44 
45 class Canvas;
46 
47 class Container : public ContainerBase
48 {
49  Q_OBJECT
50 
51 public:
52  Container (QWidget *parent, octave::base_qobject& oct_qobj,
53  octave::interpreter& interp);
54  ~Container (void);
55 
56  Canvas * canvas (const graphics_handle& handle, bool create = true);
57 
58 signals:
59 
62 
63  void gh_callback_event (const graphics_handle& h, const std::string& name);
64 
65  void gh_callback_event (const graphics_handle& h, const std::string& name,
66  const octave_value& data);
67 
68  void gh_set_event (const graphics_handle& h, const std::string& name,
69  const octave_value& value);
70 
71  void gh_set_event (const graphics_handle& h, const std::string& name,
72  const octave_value& value, bool notify_toolkit);
73 
74  void gh_set_event (const graphics_handle& h, const std::string& name,
75  const octave_value& value, bool notify_toolkit,
76  bool redraw_figure);
77 
78 protected:
79  void childEvent (QChildEvent *event);
80  void resizeEvent (QResizeEvent *event);
81 
82 private:
83  octave::base_qobject& m_octave_qobj;
84  octave::interpreter& m_interpreter;
86 };
87 
89 
90 #endif
OCTAVE_END_NAMESPACE(octave)
#define DECLARE_GENERICEVENTNOTIFY_SENDER(T, B)
Definition: Canvas.h:50
octave::base_qobject & m_octave_qobj
Definition: Container.h:83
void gh_set_event(const graphics_handle &h, const std::string &name, const octave_value &value)
void interpreter_event(const octave::meth_callback &meth)
Canvas * m_canvas
Definition: Container.h:85
void gh_set_event(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit)
void gh_callback_event(const graphics_handle &h, const std::string &name)
void gh_callback_event(const graphics_handle &h, const std::string &name, const octave_value &data)
octave::interpreter & m_interpreter
Definition: Container.h:84
void interpreter_event(const octave::fcn_callback &fcn)
void gh_set_event(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit, bool redraw_figure)
Base class for Octave interfaces that use Qt.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::function< void(void)> fcn_callback
Definition: event-manager.h:43
std::function< void(interpreter &)> meth_callback
Definition: event-manager.h:48