annotate libgui/src/gui-preferences-cs.h @ 31702:aae24eaf89ad

update gui_pref class to match recent changes to sc_pref class * gui-preferences.h, gui-preferences.cc (gui_pref): Define as class with private data members. Disallow modifying data members by only providing accessor functions instead of making data members constant. Change all uses. (all_gui_preferences): New singleton class for global gui_pref data. * gui-preferences-cs.h, gui-preferences-dc.h, gui-preferences-dw.h, gui-preferences-ed.h, gui-preferences-fb.h, gui-preferences-ff.h, gui-preferences-global.h, gui-preferences-gp.h, gui-preferences-hw.h, gui-preferences-mw.h, gui-preferences-nr.h, gui-preferences-pd.h, gui-preferences-sd.h, gui-preferences-ve.h, gui-preferences-ws.h: Provide declarations but not definitions of gui_pref objects. * gui-preferences-cs.cc, gui-preferences-dc.cc, gui-preferences-dw.cc, gui-preferences-ed.cc, gui-preferences-fb.cc, gui-preferences-ff.cc, gui-preferences-global.cc, gui-preferences-gp.cc, gui-preferences-hw.cc, gui-preferences-mw.cc, gui-preferences-nr.cc, gui-preferences-pd.cc, gui-preferences-sd.cc, gui-preferences-ve.cc, gui-preferences-ws.cc: New files to provide definitions of gui_pref objects.
author John W. Eaton <jwe@octave.org>
date Tue, 03 Jan 2023 08:03:20 -0500
parents 50a225732661
children 5f11de0e7440
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 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29484
diff changeset
3 // Copyright (C) 2017-2022 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 ////////////////////////////////////////////////////////////////////////
27560
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #if ! defined (octave_gui_preferences_cs_h)
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #define octave_gui_preferences_cs_h 1
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include "gui-preferences.h"
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 // Console preferences
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
33 extern gui_pref cs_font;
27560
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
35 extern gui_pref cs_font_size;
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
36
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
37 const std::vector<std::string> cs_cursor_types =
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
38 {
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
39 "ibeam",
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
40 "block",
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
41 "underline"
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
42 };
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
43
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
44 extern gui_pref cs_cursor;
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
45
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
46 extern gui_pref cs_cursor_blinking;
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
47
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
48 extern gui_pref cs_cursor_use_fgcol;
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
49
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
50 extern gui_pref cs_hist_buffer;
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
51
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
52 extern gui_pref cs_color_mode;
29484
bed2fd5b8263 allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 29358
diff changeset
53
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
54 const unsigned int cs_colors_count = 4;
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
55
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
56 extern gui_pref cs_colors[];
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
57
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
58 const QStringList
31599
50a225732661 use initializer lists instead of insertion operators
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
59 cs_color_names = {
50a225732661 use initializer lists instead of insertion operators
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
60 QT_TRANSLATE_NOOP ("octave::settings_dialog", "foreground"),
50a225732661 use initializer lists instead of insertion operators
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
61 QT_TRANSLATE_NOOP ("octave::settings_dialog", "background"),
50a225732661 use initializer lists instead of insertion operators
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
62 QT_TRANSLATE_NOOP ("octave::settings_dialog", "selection"),
50a225732661 use initializer lists instead of insertion operators
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
63 QT_TRANSLATE_NOOP ("octave::settings_dialog", "cursor")
50a225732661 use initializer lists instead of insertion operators
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
64 };
27583
315c35e6037c use symbolic constants for command widget preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27560
diff changeset
65
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
66 extern gui_pref cs_focus_cmd;
27849
28d7ec92bae6 replace prefs literals by symbolic constant in main window
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
67
31702
aae24eaf89ad update gui_pref class to match recent changes to sc_pref class
John W. Eaton <jwe@octave.org>
parents: 31599
diff changeset
68 extern gui_pref cs_dbg_location;
27849
28d7ec92bae6 replace prefs literals by symbolic constant in main window
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27583
diff changeset
69
27560
3fcc650de22f split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 #endif