2014-10-19 20:20:16 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2016-05-25 09:45:55 +00:00
|
|
|
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2017-09-10 14:21:56 +00:00
|
|
|
* Copyright (C) 2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-10-19 20:20:16 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
/**
|
2018-01-30 19:40:52 +00:00
|
|
|
* @file colors_design_settings.h
|
2013-05-26 04:36:44 +00:00
|
|
|
* @brief Handle colors used to draw all items or layers.
|
|
|
|
*/
|
|
|
|
|
2016-05-25 09:45:55 +00:00
|
|
|
#ifndef COLORS_DESIGN_SETTING_H
|
|
|
|
#define COLORS_DESIGN_SETTING_H
|
2017-02-20 16:57:41 +00:00
|
|
|
#include <gal/color4d.h>
|
2013-05-26 04:36:44 +00:00
|
|
|
#include <layers_id_colors_and_visibility.h>
|
2017-08-04 12:43:02 +00:00
|
|
|
#include <core/settings.h>
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2017-02-20 16:57:41 +00:00
|
|
|
using KIGFX::COLOR4D;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2017-08-04 12:43:02 +00:00
|
|
|
class wxConfigBase;
|
|
|
|
class wxString;
|
2017-09-10 14:21:56 +00:00
|
|
|
#include <frame_type.h>
|
2017-08-04 12:43:02 +00:00
|
|
|
|
|
|
|
class PARAM_CFG_ARRAY;
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
/**
|
|
|
|
* Class COLORS_DESIGN_SETTINGS
|
2017-09-10 14:21:56 +00:00
|
|
|
* is a list of color settings for designs in Pcbnew
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
2017-08-04 12:43:02 +00:00
|
|
|
class COLORS_DESIGN_SETTINGS : public SETTINGS
|
2013-05-26 04:36:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-09-10 14:21:56 +00:00
|
|
|
// Color options for screen display of the Printed Board or schematic:
|
2017-02-20 16:57:41 +00:00
|
|
|
COLOR4D m_LayersColors[LAYER_ID_COUNT]; ///< Layer colors (tracks and graphic items)
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
public:
|
2017-09-10 14:21:56 +00:00
|
|
|
COLORS_DESIGN_SETTINGS( FRAME_T aFrameType );
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2017-08-09 09:55:12 +00:00
|
|
|
~COLORS_DESIGN_SETTINGS() override
|
|
|
|
{}
|
|
|
|
|
2017-08-04 15:46:18 +00:00
|
|
|
virtual void Load( wxConfigBase *aConfig ) override;
|
|
|
|
virtual void Save( wxConfigBase *aConfig ) override;
|
2019-08-21 20:57:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetDefaultLayerColor
|
|
|
|
* @return the default color for aLayer which is one of the item indices given in
|
|
|
|
* enum PCB_LAYER_ID
|
|
|
|
*/
|
|
|
|
static COLOR4D GetDefaultLayerColor( LAYER_NUM aLayer );
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
/**
|
|
|
|
* Function GetLayerColor
|
2019-08-21 20:57:53 +00:00
|
|
|
* @return the color for aLayer which is one of the item indices given in
|
|
|
|
* enum PCB_LAYER_ID
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
2017-02-20 16:57:41 +00:00
|
|
|
COLOR4D GetLayerColor( LAYER_NUM aLayer ) const;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetLayerColor
|
2019-08-21 20:57:53 +00:00
|
|
|
* sets the color for aLayer which is one of the item indices given in
|
|
|
|
* enum PCB_LAYER_ID
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
2017-02-20 16:57:41 +00:00
|
|
|
void SetLayerColor( LAYER_NUM aLayer, COLOR4D aColor );
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2019-08-21 20:57:53 +00:00
|
|
|
/**
|
|
|
|
* Function GetDefaultItemColor
|
|
|
|
* @return the default color for the an item which is one of the item
|
|
|
|
* indices given in enum GAL_LAYER_ID
|
|
|
|
*/
|
|
|
|
static COLOR4D GetDefaultItemColor( int aItemIdx );
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
/**
|
|
|
|
* Function GetItemColor
|
|
|
|
* @return the color for an item which is one of the item indices given
|
2019-08-21 20:57:53 +00:00
|
|
|
* in enum GAL_LAYER_ID
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
2017-02-20 16:57:41 +00:00
|
|
|
COLOR4D GetItemColor( int aItemIdx ) const;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetItemColor
|
|
|
|
* sets the color for an item which is one of the item indices given
|
2019-08-21 20:57:53 +00:00
|
|
|
* in enum GAL_LAYER_ID
|
2013-05-26 04:36:44 +00:00
|
|
|
*/
|
2017-02-20 16:57:41 +00:00
|
|
|
void SetItemColor( int aItemIdx, COLOR4D aColor );
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetAllColorsAs
|
|
|
|
* sets alls colors to aColor
|
|
|
|
* Usefull to create a monochrome color selection for printing purpose
|
|
|
|
*/
|
2017-02-20 16:57:41 +00:00
|
|
|
void SetAllColorsAs( COLOR4D aColor );
|
2017-08-04 12:43:02 +00:00
|
|
|
|
|
|
|
private:
|
2017-09-10 14:21:56 +00:00
|
|
|
FRAME_T m_frameType;
|
2017-08-04 12:43:02 +00:00
|
|
|
|
|
|
|
void setupConfigParams();
|
2013-05-26 04:36:44 +00:00
|
|
|
};
|
|
|
|
|
2016-05-25 09:45:55 +00:00
|
|
|
#endif // COLORS_DESIGN_SETTING_H
|