KiCad PCB EDA Suite
class_colors_design_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) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU 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, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef COLORS_DESIGN_SETTING_H
31 #define COLORS_DESIGN_SETTING_H
32 #include <gal/color4d.h>
34 #include <core/settings.h>
35 
36 using KIGFX::COLOR4D;
37 
38 class wxConfigBase;
39 class wxString;
40 #include <frame_type.h>
41 
42 class PARAM_CFG_ARRAY;
43 
49 {
50 public:
51  // Color options for screen display of the Printed Board or schematic:
53 
54 public:
55  COLORS_DESIGN_SETTINGS( FRAME_T aFrameType );
56 
58  {}
59 
60  virtual void Load( wxConfigBase *aConfig ) override;
61  virtual void Save( wxConfigBase *aConfig ) override;
66  COLOR4D GetLayerColor( LAYER_NUM aLayer ) const;
67 
72  void SetLayerColor( LAYER_NUM aLayer, COLOR4D aColor );
73 
79  COLOR4D GetItemColor( int aItemIdx ) const;
80 
86  void SetItemColor( int aItemIdx, COLOR4D aColor );
87 
93  void SetAllColorsAs( COLOR4D aColor );
94 
101  void SetLegacyMode( bool aMode )
102  {
103  m_legacyMode = aMode;
104  }
105 
106 private:
108 
113 
114  void setupConfigParams();
115 
116 };
117 
118 #endif // COLORS_DESIGN_SETTING_H
A list of parameters type.
void SetItemColor(int aItemIdx, COLOR4D aColor)
Function SetItemColor sets the color for an item which is one of the item indices given in enum PCB_L...
Class TOOL_SETTINGS.
Definition: settings.h:38
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
void SetLayerColor(LAYER_NUM aLayer, COLOR4D aColor)
Function SetLayerColor sets the color for aLayer.
virtual void Save(wxConfigBase *aConfig) override
COLOR4D GetItemColor(int aItemIdx) const
Function GetItemColor.
COLOR4D m_LayersColors[LAYER_ID_COUNT]
Layer colors (tracks and graphic items)
void SetAllColorsAs(COLOR4D aColor)
Function SetAllColorsAs sets alls colors to aColor Usefull to create a monochrome color selection for...
COLORS_DESIGN_SETTINGS(FRAME_T aFrameType)
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
virtual void Load(wxConfigBase *aConfig) override
Board layer functions and definitions.
COLOR4D GetLayerColor(LAYER_NUM aLayer) const
Function GetLayerColor.
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
void SetLegacyMode(bool aMode)
Enables or disables legacy color mode.
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39