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 The 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{
71};
72
77{
79 int size_x;
80 int size_y;
81 int pos_x;
82 int pos_y;
83 unsigned int display;
84};
85
90{
92 wxString mru_path;
93 wxString perspective;
94 std::vector<double> zoom_factors;
95
98};
99
108{
109public:
111 {
112 wxString find_string;
113 std::vector<wxString> find_history;
115 std::vector<wxString> replace_history;
116
118
121 };
122
124 {
125 enum class SELECTION_ZOOM
126 {
127 NONE,
128 PAN,
129 ZOOM,
130 };
131
135 };
136
137 struct GRAPHICS
138 {
141 };
142
144 {
146 };
147
148 struct LIB_TREE
149 {
150 std::vector<wxString> columns;
151 std::map<wxString, int> column_widths;
152 std::vector<wxString> open_libs;
153 };
154
156 {
159 int width;
166
167 // For saving tree columns and widths
169 };
170
171 struct PRINTING
172 {
175 double scale;
177 wxString color_theme;
179 std::vector<int> layers;
180 };
181
182 struct SYSTEM
183 {
184 bool first_run_shown; //@todo RFB remove? - not used
186 std::vector<wxString> file_history;
187 int units;
190
194 };
195
196 struct PLUGINS
197 {
199 std::vector<std::pair<wxString, bool>> actions;
200 };
201
202 APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaVersion );
203
205
206 virtual bool MigrateFromLegacy( wxConfigBase* aCfg ) override;
207
208 const std::vector<GRID> DefaultGridSizeList() const;
209
210 const std::vector<double> DefaultZoomList() const;
211
212public:
214
216
218
220
222
224
226
228
230
232
234
236 wxString m_ColorTheme;
237
240
241
244
245protected:
246
247 virtual std::string getLegacyFrameName() const { return std::string(); }
248
250 void migrateFindReplace( wxConfigBase* aCfg );
251
260 bool migrateWindowConfig( wxConfigBase* aCfg, const std::string& aFrameName,
261 const std::string& aJsonPath );
262
269 void addParamsForWindow( WINDOW_SETTINGS* aWindow, const std::string& aJsonPath,
270 int aDefaultWidth = 0, int aDefaultHeight = 0 );
271
275 bool migrateLibTreeWidth();
276};
277
278#endif
ARC_EDIT_MODE
Settings for arc editing.
Definition: app_settings.h:52
@ KEEP_ENDPOINTS_OR_START_DIRECTION
Whe editing endpoints, the other end remains in place.
@ KEEP_CENTER_ENDS_ADJUST_ANGLE
When editing endpoints, only the angle is adjusted.
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
When editing endpoints, the angle and radius are adjusted.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:108
SEARCH_PANE m_SearchPane
Definition: app_settings.h:227
WINDOW_SETTINGS m_Window
Definition: app_settings.h:233
FIND_REPLACE m_FindReplace
Definition: app_settings.h:215
bool m_CustomToolbars
Use custom toolbars.
Definition: app_settings.h:239
PANEL_DESIGN_BLOCK_CHOOSER m_DesignBlockChooserPanel
Definition: app_settings.h:217
COLOR_PICKER m_ColorPicker
Definition: app_settings.h:221
virtual ~APP_SETTINGS_BASE()
Definition: app_settings.h:204
virtual std::string getLegacyFrameName() const
Definition: app_settings.h:247
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:236
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:213
int m_appSettingsSchemaVersion
! Local schema version for common app settings.
Definition: app_settings.h:243
@ NONE
Definition: eda_shape.h:69
#define KICOMMON_API
Definition: kicommon.h:28
std::vector< wxString > replace_history
Definition: app_settings.h:115
std::vector< wxString > find_history
Definition: app_settings.h:113
float highlight_factor
How much to brighten highlighted objects by.
Definition: app_settings.h:139
float select_factor
How much to brighten selected objects by.
Definition: app_settings.h:140
std::vector< wxString > columns
Ordered list of visible columns in the tree.
Definition: app_settings.h:150
std::map< wxString, int > column_widths
Column widths, keyed by header name.
Definition: app_settings.h:151
std::vector< wxString > open_libs
list of libraries the user has open in the tree.
Definition: app_settings.h:152
std::vector< std::pair< wxString, bool > > actions
Ordered list of plugin actions mapped to whether or not they are shown in the toolbar.
Definition: app_settings.h:199
bool monochrome
Whether or not to print in monochrome.
Definition: app_settings.h:174
bool background
Whether or not to print background color.
Definition: app_settings.h:173
std::vector< int > layers
List of enabled layers for printing.
Definition: app_settings.h:179
wxString color_theme
Color theme to use for printing.
Definition: app_settings.h:177
double scale
Printout scale.
Definition: app_settings.h:175
bool title_block
Whether or not to print title block.
Definition: app_settings.h:178
bool use_theme
If false, display color theme will be used.
Definition: app_settings.h:176
bool show_import_issues
Stored value for "show import issues" when importing non-KiCad designs to this application.
Definition: app_settings.h:193
std::vector< wxString > file_history
Definition: app_settings.h:186
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
Store the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:90
CURSOR_SETTINGS cursor
Definition: app_settings.h:96
WINDOW_STATE state
Definition: app_settings.h:91
GRID_SETTINGS grid
Definition: app_settings.h:97
wxString mru_path
Definition: app_settings.h:92
std::vector< double > zoom_factors
Definition: app_settings.h:94
wxString perspective
Definition: app_settings.h:93
Store the window positioning/state.
Definition: app_settings.h:77
unsigned int display
Definition: app_settings.h:83