GNU Octave 7.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-2022 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
36namespace octave
37{
38 class base_qobject;
39}
40
41namespace octave
42{
43
45
46 class Canvas;
47
48 class Container : public ContainerBase
49 {
50 Q_OBJECT
51
52 public:
53 Container (QWidget *parent, octave::base_qobject& oct_qobj,
54 octave::interpreter& interp);
55 ~Container (void);
56
57 Canvas * canvas (const graphics_handle& handle, bool create = true);
58
59 signals:
60
63
64 void gh_callback_event (const graphics_handle& h, const std::string& name);
65
66 void gh_callback_event (const graphics_handle& h, const std::string& name,
67 const octave_value& data);
68
69 void gh_set_event (const graphics_handle& h, const std::string& name,
70 const octave_value& value);
71
72 void gh_set_event (const graphics_handle& h, const std::string& name,
73 const octave_value& value, bool notify_toolkit);
74
75 void gh_set_event (const graphics_handle& h, const std::string& name,
76 const octave_value& value, bool notify_toolkit,
77 bool redraw_figure);
78
79 protected:
80 void childEvent (QChildEvent *event);
81 void resizeEvent (QResizeEvent *event);
82
83 private:
85 octave::interpreter& m_interpreter;
87 };
88
89}
90
91#endif
#define DECLARE_GENERICEVENTNOTIFY_SENDER(T, B)
bool event(QEvent *evt)
Definition: Container.h:44
void childEvent(QChildEvent *event)
Definition: Container.cc:169
octave::base_qobject & m_octave_qobj
Definition: Container.h:84
void interpreter_event(const octave::meth_callback &meth)
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)
Canvas * m_canvas
Definition: Container.h:86
void gh_callback_event(const graphics_handle &h, const std::string &name)
Container(QWidget *parent, octave::base_qobject &oct_qobj, octave::interpreter &interp)
Definition: Container.cc:44
void resizeEvent(QResizeEvent *event)
Definition: Container.cc:134
octave::interpreter & m_interpreter
Definition: Container.h:85
void gh_callback_event(const graphics_handle &h, const std::string &name, const octave_value &data)
void gh_set_event(const graphics_handle &h, const std::string &name, const octave_value &value)
void gh_set_event(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit)
Canvas * canvas(const graphics_handle &handle, bool create=true)
Definition: Container.cc:56
Base class for Octave interfaces that use Qt.
OCTAVE_NAMESPACE_BEGIN typedef std::function< void(void)> fcn_callback
Definition: event-manager.h:47
std::function< void(interpreter &)> meth_callback
Definition: event-manager.h:48
QString name