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
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef _APP_SETTINGS_H
22#define _APP_SETTINGS_H
23
24#include <gal/color4d.h>
25#include <json_common.h>
28
40
41namespace KIGFX
42{
43 enum class CROSS_HAIR_MODE : int;
44}
45
54
79
84{
86 int size_x;
87 int size_y;
88 int pos_x;
89 int pos_y;
90 unsigned int display;
91};
92
107
108
120
121
130{
131public:
133 {
134 wxString find_string;
135 std::vector<wxString> find_history;
137 std::vector<wxString> replace_history;
138
140
143 };
144
158
159 struct GRAPHICS
160 {
163 };
164
166 {
168 };
169
170 struct LIB_TREE
171 {
172 std::vector<wxString> columns;
173 std::map<wxString, int> column_widths;
174 std::vector<wxString> open_libs;
175 };
176
178 {
181 int width;
188
189 // For saving tree columns and widths
191 };
192
208
209 struct SYSTEM
210 {
211 bool first_run_shown; //@todo RFB remove? - not used
213 std::vector<wxString> file_history;
214 int units;
217
221 };
222
223 struct PLUGINS
224 {
226 std::vector<std::pair<wxString, bool>> actions;
227 };
228
229 APP_SETTINGS_BASE( const std::string& aFilename, int aSchemaVersion );
230
232
233 virtual bool MigrateFromLegacy( wxConfigBase* aCfg ) override;
234
235 const std::vector<GRID> DefaultGridSizeList() const;
236
237 const std::vector<double> DefaultZoomList() const;
238
239public:
241
243
245
247
249
251
253
255
257
259
261
263 wxString m_ColorTheme;
264
267
268
271
272protected:
273
274 virtual std::string getLegacyFrameName() const { return std::string(); }
275
277 void migrateFindReplace( wxConfigBase* aCfg );
278
287 bool migrateWindowConfig( wxConfigBase* aCfg, const std::string& aFrameName,
288 const std::string& aJsonPath );
289
296 void addParamsForWindow( WINDOW_SETTINGS* aWindow, const std::string& aJsonPath,
297 int aDefaultWidth = 0, int aDefaultHeight = 0 );
298
302 bool migrateLibTreeWidth();
303};
304
305#endif
ARC_EDIT_MODE
Settings for arc editing.
@ 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.
SEARCH_PANE m_SearchPane
WINDOW_SETTINGS m_Window
APP_SETTINGS_BASE(const std::string &aFilename, int aSchemaVersion)
FIND_REPLACE m_FindReplace
bool m_CustomToolbars
Use custom toolbars.
PANEL_DESIGN_BLOCK_CHOOSER m_DesignBlockChooserPanel
COLOR_PICKER m_ColorPicker
virtual ~APP_SETTINGS_BASE()
virtual std::string getLegacyFrameName() const
wxString m_ColorTheme
Active color theme name.
CROSS_PROBING_SETTINGS m_CrossProbing
int m_appSettingsSchemaVersion
! Local schema version for common app settings.
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
#define KICOMMON_API
Definition kicommon.h:27
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:30
std::vector< wxString > replace_history
std::vector< wxString > find_history
float highlight_factor
How much to brighten highlighted objects by.
float select_factor
How much to brighten selected objects by.
std::vector< wxString > columns
Ordered list of visible columns in the tree.
std::map< wxString, int > column_widths
Column widths, keyed by header name.
std::vector< wxString > open_libs
list of libraries the user has open in the tree.
std::vector< std::pair< wxString, bool > > actions
Ordered list of plugin actions mapped to whether or not they are shown in the toolbar.
bool monochrome
Whether or not to print in monochrome.
bool mirror
Print mirrored.
bool background
Whether or not to print background color.
int pagination
0=all layers on one page, 1=one page per layer.
std::vector< int > layers
List of enabled layers for printing.
wxString color_theme
Color theme to use for printing.
bool edge_cuts_on_all_pages
Print board edges on all pages.
double scale
Printout scale.
int drill_marks
Drill marks type (0=none, 1=small, 2=real).
bool title_block
Whether or not to print title block.
bool as_item_checkboxes
Honor checkboxes in appearance manager.
bool use_theme
If false, display color theme will be used.
bool show_import_issues
Stored value for "show import issues" when importing non-KiCad designs to this application.
std::vector< wxString > file_history
Cross-probing behavior.
bool flash_selection
Flash newly cross-probed selection (visual attention aid).
bool on_selection
Synchronize the selection for multiple items too.
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off).
bool center_on_items
Automatically pan to cross-probed items.
bool auto_highlight
Automatically turn on highlight mode in the target frame.
Common cursor settings, available to every frame.
KIGFX::CROSS_HAIR_MODE cross_hair_mode
Dialog settings for the lib/symbol/footprint table editors across the various editors.
std::map< std::string, int > field_widths
Store the common settings that are saved and loaded for each window / frame.
CURSOR_SETTINGS cursor
WINDOW_STATE state
GRID_SETTINGS grid
wxString mru_path
std::vector< double > zoom_factors
nlohmann::json aui_state
wxString perspective
Store the window positioning/state.
unsigned int display