annotate libgui/src/qt-application.h @ 33634:4a70f390c85e default tip @

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 28 May 2024 15:25:54 +0200
parents 2e484f9f1f18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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: 31837
diff changeset
3 // Copyright (C) 2012-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 ////////////////////////////////////////////////////////////////////////
15139
bfc220d1de67 include gui in default Octave binary
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
27413
b67e5dc2e34a use consistent naming pattern for include file guards in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27197
diff changeset
26 #if ! defined (octave_qt_application_h)
b67e5dc2e34a use consistent naming pattern for include file guards in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27197
diff changeset
27 #define octave_qt_application_h 1
15139
bfc220d1de67 include gui in default Octave binary
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
31837
febd82d1a8de use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents: 31808
diff changeset
29 #include "octave-config.h"
febd82d1a8de use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents: 31808
diff changeset
30
31613
c6683fcc5c33 allow qt_application ctor to set Qt organization, application, and version
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
31 #include <string>
c6683fcc5c33 allow qt_application ctor to set Qt organization, application, and version
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
32
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
33 #include "octave.h"
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
34
31646
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
35 OCTAVE_BEGIN_NAMESPACE(octave)
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
36
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
37 // Programming Note: This file must not include any Qt headers. Any
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
38 // Qt header files required by the qt_application::execute function
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
39 // must be included only in the corresponding .cc file.
27197
b8c0d5ad024f refactor and rename some qt application objects
John W. Eaton <jwe@octave.org>
parents: 27195
diff changeset
40
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
41 //! This class inherits from the pure-virtual base class
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
42 //! application and provides an implementation of the
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
43 //! application::execute method that starts an interface to Octave
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
44 //! that is based on Qt. It may start a command-line interface that
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
45 //! allows Qt graphics to be used or it may start an interface that
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
46 //! provides the full GUI experience.
27197
b8c0d5ad024f refactor and rename some qt application objects
John W. Eaton <jwe@octave.org>
parents: 27195
diff changeset
47
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
48 class OCTGUI_API qt_application : public application
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
49 {
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
50 public:
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
51
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
52 qt_application (const std::string& organization_name,
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
53 const std::string& application_name,
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
54 const std::string& application_version,
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
55 int argc, char **argv);
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
56
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
57 qt_application (int argc, char **argv);
22869
f75d289645ec make deleted functions public
John W. Eaton <jwe@octave.org>
parents: 22865
diff changeset
58
31837
febd82d1a8de use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents: 31808
diff changeset
59 OCTAVE_DISABLE_COPY_MOVE (qt_application)
25944
ceb508ea92ee refactor GUI main_window class
John W. Eaton <jwe@octave.org>
parents: 25938
diff changeset
60
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
61 ~qt_application () = default;
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
62
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
63 // Should we start the GUI or fall back to the CLI?
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
64 bool start_gui_p () const;
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
65
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
66 int execute ();
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
67
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
68 bool gui_running () const { return m_gui_running; }
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
69 void gui_running (bool arg) { m_gui_running = arg; }
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
70
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
71 private:
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
72
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
73 // If TRUE, the GUI should be started.
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
74 bool m_gui_running = false;
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
75 };
31646
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
76
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
77 OCTAVE_END_NAMESPACE(octave)
15139
bfc220d1de67 include gui in default Octave binary
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78
bfc220d1de67 include gui in default Octave binary
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 #endif