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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
1 /*
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
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
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
4
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
6
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
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
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
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
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
16
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6693
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6693
diff changeset
19 <http://www.gnu.org/licenses/>.
12
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
20
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
21 */
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
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
49345c503741 [project @ 1994-05-23 21:01:01 by jwe]
jwe
parents: 195
diff changeset
24 #define octave_defaults_h 1
12
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
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
a24158362f9f [project @ 1996-05-15 06:09:42 by jwe]
jwe
parents: 2198
diff changeset
28 #include <string>
a24158362f9f [project @ 1996-05-15 06:09:42 by jwe]
jwe
parents: 2198
diff changeset
29
3174
390d5e396682 [project @ 1998-05-04 16:36:17 by jwe]
jwe
parents: 3141
diff changeset
30 #include "pathsearch.h"
390d5e396682 [project @ 1998-05-04 16:36:17 by jwe]
jwe
parents: 3141
diff changeset
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
a24158362f9f [project @ 1996-05-15 06:09:42 by jwe]
jwe
parents: 2198
diff changeset
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
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
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
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
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
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
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
fbc0f5ebd3e0 [project @ 1993-08-09 01:07:49 by jwe]
jwe
parents:
diff changeset
102 #endif