Mercurial > octave
annotate libinterp/corefcn/defaults.h @ 23721:b2d55b52ee51
new class to manage help system and associated variables
* help.h, help.cc (help_system): New class. Handle
built_in_docstrings_file, doc_cache_file, info_file, info_program,
makeinfo_program, suppress_verbose_help_message, and texi_macros_file
variables. Move most static and global functions inside class.
Change all uses.
* interpreter.h, interpreter.cc (interpreter::m_help_system):
New member variable.
(interpreter::get_help_system): New function.
* interpreter-private.h, interpreter-private.cc (__get_help_system__):
New function.
* defaults.h, defaults.cc (Vbuilt_in_docstrings_file, VEXEC_PATH,
VIMAGE_PATH): Delete.
(config::prepend_octave_home, config::prepend_octave_exec_home):
Define here instead of as static functions in defaults.cc.
(init_defaults): Now static.
(set_default_info_file, set_default_info_prog,
set_default_texi_macros_file, set_default_doc_cache_file,
set_built_in_docstrings_file, install_defaults):
Delete.
* toplev.cc (F__octave_config_info__): Don't include "infofile"
in the struct.
* octave.cc (application::init): Don't call install_defaults.
* documentation-dock-widget.h, documentation-dock-widget.cc
(documentation_dock_widget::load_info_file): New slot.
* main-window.cc (main_window::main_window):
Connect m_interpreter::octave_ready_signal to
doc_browser_window::load_info_file.
* octave-gui.cc (gui_application::gui_application): Don't call
install_defaults here.
* webinfo.h, webinfo.cc (webinfo::load_info_file): New function to set
file for info browser after interpreter is ready instead of doing that
in the webinfo constructor.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 29 Jun 2017 20:16:54 -0400 |
parents | 69a111259a2c |
children | 194eb4bd202b |
rev | line source |
---|---|
12 | 1 /* |
2 | |
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
3 Copyright (C) 1993-2017 John W. Eaton |
12 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
9 the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
10 (at your option) any later version. |
12 | 11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
15 GNU General Public License for more details. |
12 | 16 |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
12 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
23 #if ! defined (octave_defaults_h) |
423 | 24 #define octave_defaults_h 1 |
12 | 25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
27 |
2204 | 28 #include <string> |
29 | |
3174 | 30 #include "pathsearch.h" |
31 | |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
32 namespace octave |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
33 { |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
34 namespace config |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
35 { |
23721
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
36 extern OCTINTERP_API std::string |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
37 prepend_octave_home (const std::string& s); |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
38 |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
39 extern OCTINTERP_API std::string |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
40 prepend_octave_exec_home (const std::string& s); |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
41 |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
42 // These could be defined as pure constants, but we'll use |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
43 // functions to be consistent with the values that require |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
44 // initialization. |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
45 |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
46 extern OCTINTERP_API std::string canonical_host_type (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
47 extern OCTINTERP_API std::string release (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
48 extern OCTINTERP_API std::string default_pager (void); |
2204 | 49 |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
50 // These require initialization, so can't be defined as pure |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
51 // constants. We use functions to access these values so that |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
52 // they can't be modified by users. |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
53 |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
54 extern OCTINTERP_API std::string octave_home (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
55 extern OCTINTERP_API std::string octave_exec_home (void); |
23713
4feef926733a
rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
56 |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
57 extern OCTINTERP_API std::string bin_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
58 extern OCTINTERP_API std::string data_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
59 extern OCTINTERP_API std::string dataroot_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
60 extern OCTINTERP_API std::string include_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
61 extern OCTINTERP_API std::string lib_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
62 extern OCTINTERP_API std::string libexec_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
63 |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
64 extern OCTINTERP_API std::string local_ver_arch_lib_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
65 extern OCTINTERP_API std::string local_api_arch_lib_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
66 extern OCTINTERP_API std::string local_arch_lib_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
67 extern OCTINTERP_API std::string arch_lib_dir (void); |
23713
4feef926733a
rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
68 |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
69 extern OCTINTERP_API std::string local_ver_oct_file_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
70 extern OCTINTERP_API std::string local_api_oct_file_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
71 extern OCTINTERP_API std::string local_oct_file_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
72 extern OCTINTERP_API std::string oct_file_dir (void); |
23713
4feef926733a
rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents:
23712
diff
changeset
|
73 |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
74 extern OCTINTERP_API std::string local_ver_fcn_file_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
75 extern OCTINTERP_API std::string local_api_fcn_file_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
76 extern OCTINTERP_API std::string local_fcn_file_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
77 extern OCTINTERP_API std::string fcn_file_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
78 |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
79 extern OCTINTERP_API std::string oct_data_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
80 extern OCTINTERP_API std::string oct_etc_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
81 extern OCTINTERP_API std::string oct_include_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
82 extern OCTINTERP_API std::string oct_lib_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
83 extern OCTINTERP_API std::string oct_locale_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
84 extern OCTINTERP_API std::string oct_tests_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
85 |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
86 extern OCTINTERP_API std::string info_dir (void); |
5814 | 87 |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
88 extern OCTINTERP_API std::string man_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
89 extern OCTINTERP_API std::string man1_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
90 extern OCTINTERP_API std::string man1_ext (void); |
5814 | 91 |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
92 extern OCTINTERP_API std::string image_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
93 |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
94 extern OCTINTERP_API std::string local_startupfile_dir (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
95 extern OCTINTERP_API std::string startupfile_dir (void); |
5814 | 96 |
23717
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
97 extern OCTINTERP_API std::string local_site_defaults_file (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
98 extern OCTINTERP_API std::string site_defaults_file (void); |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
99 } |
06579337237b
move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents:
23713
diff
changeset
|
100 } |
15157
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15100
diff
changeset
|
101 |
12 | 102 #endif |