Mercurial > octave
annotate libgui/graphics/Object.h @ 33624:e0c037a01fde default tip
redirect stdout and stderr into experimental terminal widget
* command-widget.cc (command_widget): open temp files for redirecting
stdout and stderr, setup a file system watcher for signals on changes
to these files;
(~command_widget): close and remove the temp. files;
(insert_interpreter_output): use the style as second argument
(print_stream): add new contents of temp. files for stdout and stderr
to the end of the terminal contents;
(notice_settings): set the terminal preferences to the new lexer of
the console;
(console): create and set new lexer;
(new_command_line): use prompt style for the prompt;
(execute_command): use second command line argument for the style;
(append_string): use style as second argument and style the added
text accordingly;
* command-widget.h (console) append_string with second argument for style,
(command_widget): now with destructor, new method print_stream,
insert_interpreter_output with second argument for style, new class
variables for temp. file descriptors and file system watcher
* console-lexer.cc/h: new lexer derived from QScintillas default lexer
for styling the terminal output, styles used so far: Default, Error,
and Prompt
* gui-preferences-cs.h: new constants for error and prompt colors
* libgui/src/module.mk: new files console_lexer.cc/h
* qt-interpreter-events.cc (display_exception): interpreter_output_signal
with second argument for the style, here Error style
* qt-interpreter-events.h: interpreter_output_signal with second
argument for the style
* terminal-dock-widget.h: interpreter_output_signal with second
argument for the style
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sat, 25 May 2024 14:36:01 +0200 |
parents | 7f18c537e101 |
children |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31808
diff
changeset
|
3 // Copyright (C) 2011-2024 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21139
diff
changeset
|
26 #if ! defined (octave_Object_h) |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21139
diff
changeset
|
27 #define octave_Object_h 1 |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include <QObject> |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
27303
07b330708e3c
use Qt signals for interpreter callbacks in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
31 #include "event-manager.h" |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 #include "graphics.h" |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 class QObject; |
19681
35bca657d74d
printing for Qt plot widget (bug #42537)
John W. Eaton <jwe@octave.org>
parents:
19625
diff
changeset
|
35 class QString; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 class QWidget; |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
38 OCTAVE_BEGIN_NAMESPACE(octave) |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
39 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
40 class interpreter; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
42 class Container; |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
43 class ObjectProxy; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
45 class Object : public QObject |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
46 { |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
47 Q_OBJECT |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
49 public: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
50 Object (octave::interpreter& interp, const graphics_object& go, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
51 QObject *obj = nullptr); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
53 virtual ~Object (); |
19595
be7ac98fab43
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18501
diff
changeset
|
54 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
55 base_properties& properties () |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
56 { return object ().get_properties (); } |
19595
be7ac98fab43
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18501
diff
changeset
|
57 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
58 const base_properties& properties () const |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
59 { return object ().get_properties (); } |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
61 template <typename T> |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
62 typename T::properties& properties () |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
63 { |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
64 return dynamic_cast<typename T::properties&> |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
65 (object ().get_properties ()); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
66 } |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
68 template <typename T> |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
69 const typename T::properties& properties () const |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
70 { |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
71 return dynamic_cast<const typename T::properties&> |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
72 (object ().get_properties ()); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
73 } |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
75 graphics_object object () const; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
77 virtual QObject * qObject () { return m_qobject; } |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
79 template <typename T> |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
80 T * qWidget () { return qobject_cast<T *>(qObject ()); } |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
82 virtual Container * innerContainer () = 0; |
27376
1952e110d346
Allow Qt graphics callbacks to work again (bug #56857)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
27319
diff
changeset
|
83 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
84 static Object * fromQObject (QObject *obj); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
86 virtual void do_connections (const QObject *receiver, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
87 const QObject *emitter = nullptr); |
27303
07b330708e3c
use Qt signals for interpreter callbacks in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
88 |
33599
7f18c537e101
maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents:
32632
diff
changeset
|
89 Q_SIGNALS: |
27303
07b330708e3c
use Qt signals for interpreter callbacks in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
90 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
91 void interpreter_event (const octave::fcn_callback& fcn); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
92 void interpreter_event (const octave::meth_callback& meth); |
27303
07b330708e3c
use Qt signals for interpreter callbacks in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
93 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
94 void gh_callback_event (const graphics_handle& h, const std::string& name); |
27319
6b2d20317b26
use Qt signals to manage calls to gh_manager functions in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
27317
diff
changeset
|
95 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
96 void gh_callback_event (const graphics_handle& h, const std::string& name, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
97 const octave_value& data); |
27319
6b2d20317b26
use Qt signals to manage calls to gh_manager functions in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
27317
diff
changeset
|
98 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
99 void gh_set_event (const graphics_handle& h, const std::string& name, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
100 const octave_value& value); |
27319
6b2d20317b26
use Qt signals to manage calls to gh_manager functions in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
27317
diff
changeset
|
101 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
102 void gh_set_event (const graphics_handle& h, const std::string& name, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
103 const octave_value& value, bool notify_toolkit); |
27319
6b2d20317b26
use Qt signals to manage calls to gh_manager functions in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
27317
diff
changeset
|
104 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
105 void gh_set_event (const graphics_handle& h, const std::string& name, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
106 const octave_value& value, bool notify_toolkit, |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
107 bool redraw_figure); |
27319
6b2d20317b26
use Qt signals to manage calls to gh_manager functions in Qt graphics toolkit
John W. Eaton <jwe@octave.org>
parents:
27317
diff
changeset
|
108 |
33599
7f18c537e101
maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents:
32632
diff
changeset
|
109 public Q_SLOTS: |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
110 void slotUpdate (int pId); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
111 void slotFinalize (); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
112 void slotRedraw (); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
113 void slotShow (); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
114 void slotPrint (const QString& file_cmd, const QString& term); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
115 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
116 void objectDestroyed (QObject *obj = nullptr); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
117 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
118 protected: |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
119 static Object * |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
120 parentObject (octave::interpreter& interp, const graphics_object& go); |
27647
2a506bc4a7af
eliminate global access to Octave interpreter in qt graphics classes
John W. Eaton <jwe@octave.org>
parents:
27376
diff
changeset
|
121 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
122 void init (QObject *obj, bool callBase = false); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
123 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
124 virtual void update (int pId); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
125 virtual void finalize (); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
126 virtual void redraw (); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
127 virtual void show (); |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
128 virtual void print (const QString& file_cmd, const QString& term); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
129 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
130 virtual void beingDeleted (); |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
131 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
132 protected: |
25044
b6aea95a7bf9
store graphics object in Qt backend to avoid crash (bug #53487, #53500)
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
133 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
134 octave::interpreter& m_interpreter; |
27647
2a506bc4a7af
eliminate global access to Octave interpreter in qt graphics classes
John W. Eaton <jwe@octave.org>
parents:
27376
diff
changeset
|
135 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
136 // Store the graphics object directly so that it will exist when |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
137 // we need it. Previously, it was possible for the graphics |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
138 // toolkit to get a handle to a figure, then have the interpreter |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
139 // thread delete the corresponding object before the graphics |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
140 // toolkit (GUI) thread had a chance to display it. It should be OK |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
141 // to store this object and use it in both threads (graphics_object |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
142 // uses a std::shared_ptr) provided that we protect access with |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
143 // mutex locks. |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
144 graphics_object m_go; |
25044
b6aea95a7bf9
store graphics object in Qt backend to avoid crash (bug #53487, #53500)
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
145 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
146 // Handle to the graphics object. This may be redundant now. |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
147 // Also, the whole ObjectProxy thing may not need to store a |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
148 // pointer now? Maybe we can just have a lookup table from figure |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
149 // handle to Object? What does the FLTK toolkit do? Why does |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
150 // this seem to be so complicated? |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
151 graphics_handle m_handle; |
25044
b6aea95a7bf9
store graphics object in Qt backend to avoid crash (bug #53487, #53500)
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
152 |
31808
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
153 QObject *m_qobject; |
90621682cc03
maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
154 }; |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
155 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31644
diff
changeset
|
156 OCTAVE_END_NAMESPACE(octave) |
18498
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
157 |
2e7cad6f180c
Initial integration of QtHandles.
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
158 #endif |