KiCad PCB EDA Suite
gal_display_options.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) 2017 Kicad Developers, see change_log.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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23 
24 #ifndef GAL_DISPLAY_OPTIONS_H__
25 #define GAL_DISPLAY_OPTIONS_H__
26 
27 #include <observable.h>
28 
29 class wxConfigBase;
30 class wxString;
31 class wxWindow;
32 
33 
34 namespace KIGFX
35 {
39  enum class GRID_STYLE
40  {
41  DOTS,
42  LINES,
44  };
45 
47  {
48  NONE,
53  };
54 
56  {
57  NONE,
58  FAST,
59  GOOD,
60  BEST,
61  };
62 
63  class GAL_DISPLAY_OPTIONS;
64 
66  {
67  public:
68  virtual void OnGalDisplayOptionsChanged( const GAL_DISPLAY_OPTIONS& ) = 0;
69  protected:
70  // Observer lifetimes aren't handled by base class pointer
72  };
73 
74  class GAL_DISPLAY_OPTIONS : public UTIL::OBSERVABLE<GAL_DISPLAY_OPTIONS_OBSERVER>
75  {
76  public:
78 
84  void ReadAppConfig( wxConfigBase& aCfg, const wxString& aBaseName );
85 
91  void ReadCommonConfig( wxConfigBase& aCommonConfig, wxWindow* aWindow );
92 
100  void ReadConfig( wxConfigBase& aCommonConfig, wxConfigBase& aAppCondfig,
101  const wxString& aBaseCfgName, wxWindow* aWindow );
102 
103  void WriteConfig( wxConfigBase& aCfg, const wxString& aBaseName );
104 
105  void NotifyChanged();
106 
108 
110 
113 
116 
119 
122 
125 
128 
131  };
132 
133 }
134 
135 #endif
136 
Use lines for the grid.
GRID_STYLE
GRID_STYLE: Type definition of the grid style.
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
KIGFX::GRID_STYLE m_gridStyle
The grid style to draw the grid in
void ReadCommonConfig(wxConfigBase &aCommonConfig, wxWindow *aWindow)
Read GAL config options from the common config store.
bool m_forceDisplayCursor
Force cursor display
double m_gridMinSpacing
Minimum pixel distance between displayed grid lines
OPENGL_ANTIALIASING_MODE gl_antialiasing_mode
void ReadConfig(wxConfigBase &aCommonConfig, wxConfigBase &aAppCondfig, const wxString &aBaseCfgName, wxWindow *aWindow)
Read application and common configs.
bool m_axesEnabled
Whether or not to draw the coordinate system axes
CAIRO_ANTIALIASING_MODE cairo_antialiasing_mode
void WriteConfig(wxConfigBase &aCfg, const wxString &aBaseName)
void ReadAppConfig(wxConfigBase &aCfg, const wxString &aBaseName)
Read GAL config options from applicaton-level config.
Use dots for the grid.
Use small cross instead of dots for the grid.
virtual void OnGalDisplayOptionsChanged(const GAL_DISPLAY_OPTIONS &)=0
double m_scaleFactor
The pixel scale factor (>1 for hi-DPI scaled displays)
double m_gridLineWidth
Thickness to render grid lines/dots
bool m_fullscreenCursor
Fullscreen crosshair or small cross