KiCad PCB EDA Suite
Loading...
Searching...
No Matches
gal_display_options_common.cpp
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 The KiCad Developers, see AUTHORS.txt for contributors.
5*
6* This program is free software; you can redistribute it and/or
7* modify it under the terms of the GNU General Public License
8* as published by the Free Software Foundation; either version 2
9* of the License, or (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/
19
23
24#include <wx/log.h>
25
26#include <dpi_scaling_common.h>
27
28using namespace KIGFX;
29
37static const wxChar* traceGalDispOpts = wxT( "KICAD_GAL_DISPLAY_OPTIONS" );
38
39
45
46
63
64
66{
67 wxLogTrace( traceGalDispOpts, wxS( "Reading common config" ) );
68
70
71 m_dpi = DPI_SCALING_COMMON( &aSettings, aWindow );
73
75}
76
77
79 WINDOW_SETTINGS& aWindowConfig, wxWindow* aWindow )
80{
81 wxLogTrace( traceGalDispOpts, wxS( "Reading common and app config" ) );
82
83 ReadWindowSettings( aWindowConfig );
84
85 ReadCommonConfig( aCommonConfig, aWindow );
86}
87
88
102
103
105{
106 if( m_scaleFactor != m_dpi.GetScaleFactor() )
107 {
108 m_scaleFactor = m_dpi.GetScaleFactor();
110 }
111}
Class to handle configuration and automatic determination of the DPI scale to use for canvases.
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
void ReadConfig(COMMON_SETTINGS &aCommonConfig, WINDOW_SETTINGS &aWindowConfig, wxWindow *aWindow)
Read application and common configs.
void ReadCommonConfig(COMMON_SETTINGS &aCommonSettings, wxWindow *aWindow)
Read GAL config options from the common config store.
void WriteConfig(WINDOW_SETTINGS &aCfg)
CROSS_HAIR_MODE m_crossHairMode
Crosshair drawing mode.
double m_gridLineWidth
Thickness to render grid lines/dots.
double m_gridMinSpacing
Minimum pixel distance between displayed grid lines.
GAL_ANTIALIASING_MODE antialiasing_mode
bool m_gridShowMajor
Whether or not to show major grid lines.
double m_scaleFactor
The pixel scale factor (>1 for hi-DPI scaled displays)
bool m_forceDisplayCursor
Force cursor display.
KIGFX::GRID_STYLE m_gridStyle
The grid style to draw the grid in.
bool m_axesEnabled
Whether or not to draw the coordinate system axes.
GRID_SNAPPING m_gridSnapping
Snapping options for the grid.
static const wxChar * traceGalDispOpts
Flag to enable GAL_DISPLAY_OPTIONS logging.
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:30
KIGFX::CROSS_HAIR_MODE cross_hair_mode
KIGFX::GRID_SNAPPING snap
KIGFX::GRID_STYLE style
Store the common settings that are saved and loaded for each window / frame.
CURSOR_SETTINGS cursor
GRID_SETTINGS grid