KiCad PCB EDA Suite
Loading...
Searching...
No Matches
app_settings.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020 Jon Evans <[email protected]>
5 * Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef _APP_SETTINGS_H
22#define _APP_SETTINGS_H
23
24#include <gal/color4d.h>
27
32{
37};
38
43{
46};
47
51enum class ARC_EDIT_MODE
52{
55};
56
61{
63 int size_x;
64 int size_y;
65 int pos_x;
66 int pos_y;
67 unsigned int display;
68};
69
74{
76 wxString mru_path;
77 wxString perspective;
78 std::vector<double> zoom_factors;
79
82};
83
92{
93public:
95 {
96 wxString find_string;
97 std::vector<wxString> find_history;
99 std::vector<wxString> replace_history;
100
102
105 };
106
107 struct GRAPHICS
108 {
112 };
113
115 {
117 };
118
119 struct LIB_TREE
120 {
121 std::vector<wxString> columns;
122 std::map<wxString, int> column_widths;
123 std::vector<wxString> open_libs;
124 };
125
126 struct PRINTING
127 {
130 double scale;
132 wxString color_theme;
134 std::vector<int> layers;
135 };
136
137 struct SYSTEM
138 {
139 bool first_run_shown; //@todo RFB remove? - not used
141 std::vector<wxString> file_history;
142 int units;
145 };
146
147 APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaVersion );
148
150
151 virtual bool MigrateFromLegacy( wxConfigBase* aCfg ) override;
152
153 const std::vector<GRID> DefaultGridSizeList() const;
154
155public:
157
159
161
163
165
167
169
171
173 wxString m_ColorTheme;
174
177
178protected:
179
180 virtual std::string getLegacyFrameName() const { return std::string(); }
181
183 void migrateFindReplace( wxConfigBase* aCfg );
184
192 bool migrateWindowConfig( wxConfigBase* aCfg, const std::string& aFrameName,
193 const std::string& aJsonPath );
194
200 void addParamsForWindow( WINDOW_SETTINGS* aWindow, const std::string& aJsonPath );
201
205 bool migrateLibTreeWidth();
206};
207
208#endif
ARC_EDIT_MODE
Settings for arc editing.
Definition: app_settings.h:52
@ KEEP_ENDPOINTS_OR_START_DIRECTION
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
WINDOW_SETTINGS m_Window
Definition: app_settings.h:170
FIND_REPLACE m_FindReplace
Definition: app_settings.h:158
bool migrateWindowConfig(wxConfigBase *aCfg, const std::string &aFrameName, const std::string &aJsonPath)
Migrates legacy window settings into the JSON document.
const std::vector< GRID > DefaultGridSizeList() const
void migrateFindReplace(wxConfigBase *aCfg)
! Migrates the find/replace history string lists
COLOR_PICKER m_ColorPicker
Definition: app_settings.h:162
virtual ~APP_SETTINGS_BASE()
Definition: app_settings.h:149
virtual std::string getLegacyFrameName() const
Definition: app_settings.h:180
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:173
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:156
void addParamsForWindow(WINDOW_SETTINGS *aWindow, const std::string &aJsonPath)
Adds parameters for the given window object.
bool migrateLibTreeWidth()
Migrates the library tree width setting from a single column (Item) to multi-column.
int m_appSettingsSchemaVersion
! Local schema version for common app settings
Definition: app_settings.h:176
std::vector< wxString > replace_history
Definition: app_settings.h:99
std::vector< wxString > find_history
Definition: app_settings.h:97
float highlight_factor
How much to brighten highlighted objects by.
Definition: app_settings.h:110
float select_factor
How much to brighten selected objects by.
Definition: app_settings.h:111
std::vector< wxString > columns
Ordered list of visible columns in the tree.
Definition: app_settings.h:121
std::map< wxString, int > column_widths
Column widths, keyed by header name.
Definition: app_settings.h:122
std::vector< wxString > open_libs
list of libraries the user has open in the tree
Definition: app_settings.h:123
bool monochrome
Whether or not to print in monochrome.
Definition: app_settings.h:129
bool background
Whether or not to print background color.
Definition: app_settings.h:128
std::vector< int > layers
List of enabled layers for printing.
Definition: app_settings.h:134
wxString color_theme
Color theme to use for printing.
Definition: app_settings.h:132
double scale
Printout scale.
Definition: app_settings.h:130
bool title_block
Whether or not to print title block.
Definition: app_settings.h:133
bool use_theme
If false, display color theme will be used.
Definition: app_settings.h:131
std::vector< wxString > file_history
Definition: app_settings.h:141
Cross-probing behavior.
Definition: app_settings.h:32
bool on_selection
Synchronize the selection for multiple items too.
Definition: app_settings.h:33
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off)
Definition: app_settings.h:35
bool center_on_items
Automatically pan to cross-probed items.
Definition: app_settings.h:34
bool auto_highlight
Automatically turn on highlight mode in the target frame.
Definition: app_settings.h:36
Common cursor settings, available to every frame.
Definition: app_settings.h:43
bool always_show_cursor
Definition: app_settings.h:44
bool fullscreen_cursor
Definition: app_settings.h:45
Stores the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:74
CURSOR_SETTINGS cursor
Definition: app_settings.h:80
WINDOW_STATE state
Definition: app_settings.h:75
GRID_SETTINGS grid
Definition: app_settings.h:81
wxString mru_path
Definition: app_settings.h:76
std::vector< double > zoom_factors
Definition: app_settings.h:78
wxString perspective
Definition: app_settings.h:77
Stores the window positioning/state.
Definition: app_settings.h:61
unsigned int display
Definition: app_settings.h:67