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
108 {
109 enum class SELECTION_ZOOM
110 {
111 NONE,
112 PAN,
113 ZOOM,
114 };
115
117 };
118
119 struct GRAPHICS
120 {
124 };
125
127 {
129 };
130
131 struct LIB_TREE
132 {
133 std::vector<wxString> columns;
134 std::map<wxString, int> column_widths;
135 std::vector<wxString> open_libs;
136 };
137
138 struct PRINTING
139 {
142 double scale;
144 wxString color_theme;
146 std::vector<int> layers;
147 };
148
149 struct SYSTEM
150 {
151 bool first_run_shown; //@todo RFB remove? - not used
153 std::vector<wxString> file_history;
154 int units;
159 };
160
161 APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaVersion );
162
164
165 virtual bool MigrateFromLegacy( wxConfigBase* aCfg ) override;
166
167 const std::vector<GRID> DefaultGridSizeList() const;
168
169public:
171
173
175
177
179
181
183
185
187
189 wxString m_ColorTheme;
190
191
194
195protected:
196
197 virtual std::string getLegacyFrameName() const { return std::string(); }
198
200 void migrateFindReplace( wxConfigBase* aCfg );
201
209 bool migrateWindowConfig( wxConfigBase* aCfg, const std::string& aFrameName,
210 const std::string& aJsonPath );
211
217 void addParamsForWindow( WINDOW_SETTINGS* aWindow, const std::string& aJsonPath );
218
222 bool migrateLibTreeWidth();
223};
224
225#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
SEARCH_PANE m_SearchPane
Definition: app_settings.h:182
WINDOW_SETTINGS m_Window
Definition: app_settings.h:186
FIND_REPLACE m_FindReplace
Definition: app_settings.h:172
COLOR_PICKER m_ColorPicker
Definition: app_settings.h:176
virtual ~APP_SETTINGS_BASE()
Definition: app_settings.h:163
virtual std::string getLegacyFrameName() const
Definition: app_settings.h:197
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:189
CROSS_PROBING_SETTINGS m_CrossProbing
Definition: app_settings.h:170
int m_appSettingsSchemaVersion
! Local schema version for common app settings
Definition: app_settings.h:193
#define KICOMMON_API
Definition: kicommon.h:28
@ NONE
No connection to this item.
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:122
float select_factor
How much to brighten selected objects by.
Definition: app_settings.h:123
std::vector< wxString > columns
Ordered list of visible columns in the tree.
Definition: app_settings.h:133
std::map< wxString, int > column_widths
Column widths, keyed by header name.
Definition: app_settings.h:134
std::vector< wxString > open_libs
list of libraries the user has open in the tree
Definition: app_settings.h:135
bool monochrome
Whether or not to print in monochrome.
Definition: app_settings.h:141
bool background
Whether or not to print background color.
Definition: app_settings.h:140
std::vector< int > layers
List of enabled layers for printing.
Definition: app_settings.h:146
wxString color_theme
Color theme to use for printing.
Definition: app_settings.h:144
double scale
Printout scale.
Definition: app_settings.h:142
bool title_block
Whether or not to print title block.
Definition: app_settings.h:145
bool use_theme
If false, display color theme will be used.
Definition: app_settings.h:143
bool show_import_issues
Stored value for "show import issues" when importing non-KiCad designs to this application.
Definition: app_settings.h:158
std::vector< wxString > file_history
Definition: app_settings.h:153
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