2016-12-23 16:06:33 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
|
|
|
*
|
2017-02-13 11:53:58 +00:00
|
|
|
* Copyright (C) 2017 Kicad Developers, see change_log.txt for contributors.
|
2016-12-23 16:06:33 +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
|
|
|
|
*/
|
|
|
|
|
2016-12-23 15:21:00 +00:00
|
|
|
#ifndef GAL_DISPLAY_OPTIONS_H__
|
|
|
|
#define GAL_DISPLAY_OPTIONS_H__
|
|
|
|
|
|
|
|
#include <observable.h>
|
|
|
|
|
|
|
|
class wxConfigBase;
|
|
|
|
class wxString;
|
|
|
|
|
2017-02-13 11:43:28 +00:00
|
|
|
namespace KIGFX
|
|
|
|
{
|
|
|
|
/**
|
2017-02-16 02:50:34 +00:00
|
|
|
* GRID_STYLE: Type definition of the grid style
|
2017-02-13 11:43:28 +00:00
|
|
|
*/
|
2017-02-16 02:50:34 +00:00
|
|
|
enum class GRID_STYLE
|
2017-02-13 11:43:28 +00:00
|
|
|
{
|
2017-03-01 09:29:19 +00:00
|
|
|
DOTS, ///< Use dots for the grid
|
2017-09-14 14:52:24 +00:00
|
|
|
LINES, ///< Use lines for the grid
|
2017-03-01 09:29:19 +00:00
|
|
|
SMALL_CROSS ///< Use small cross instead of dots for the grid
|
2017-02-13 11:43:28 +00:00
|
|
|
};
|
2016-12-23 15:21:00 +00:00
|
|
|
|
2017-02-16 02:40:35 +00:00
|
|
|
enum class OPENGL_ANTIALIASING_MODE
|
2017-01-11 15:19:58 +00:00
|
|
|
{
|
2017-02-16 02:40:35 +00:00
|
|
|
NONE,
|
|
|
|
SUBSAMPLE_HIGH,
|
|
|
|
SUBSAMPLE_ULTRA,
|
|
|
|
SUPERSAMPLING_X2,
|
|
|
|
SUPERSAMPLING_X4,
|
2016-12-23 15:21:00 +00:00
|
|
|
};
|
|
|
|
|
2018-01-04 12:13:00 +00:00
|
|
|
enum class CAIRO_ANTIALIASING_MODE
|
|
|
|
{
|
|
|
|
NONE,
|
|
|
|
FAST,
|
|
|
|
GOOD,
|
|
|
|
BEST,
|
|
|
|
};
|
|
|
|
|
2017-02-13 11:43:28 +00:00
|
|
|
class GAL_DISPLAY_OPTIONS;
|
|
|
|
|
2016-12-23 15:21:00 +00:00
|
|
|
class GAL_DISPLAY_OPTIONS_OBSERVER
|
|
|
|
{
|
|
|
|
public:
|
2017-01-11 15:19:58 +00:00
|
|
|
virtual void OnGalDisplayOptionsChanged( const GAL_DISPLAY_OPTIONS& ) = 0;
|
2017-02-16 01:15:45 +00:00
|
|
|
protected:
|
|
|
|
// Observer lifetimes aren't handled by base class pointer
|
|
|
|
virtual ~GAL_DISPLAY_OPTIONS_OBSERVER() {}
|
2016-12-23 15:21:00 +00:00
|
|
|
};
|
|
|
|
|
2017-01-11 15:19:58 +00:00
|
|
|
class GAL_DISPLAY_OPTIONS : public UTIL::OBSERVABLE<GAL_DISPLAY_OPTIONS_OBSERVER>
|
2016-12-23 15:21:00 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
GAL_DISPLAY_OPTIONS();
|
|
|
|
|
2017-09-23 09:20:10 +00:00
|
|
|
void ReadConfig ( wxConfigBase* aCfg, const wxString& aBaseName );
|
|
|
|
void WriteConfig( wxConfigBase* aCfg, const wxString& aBaseName );
|
2016-12-23 15:21:00 +00:00
|
|
|
|
|
|
|
void NotifyChanged();
|
2017-02-13 11:43:28 +00:00
|
|
|
|
|
|
|
OPENGL_ANTIALIASING_MODE gl_antialiasing_mode;
|
2017-02-13 11:53:58 +00:00
|
|
|
|
2018-01-04 12:13:00 +00:00
|
|
|
CAIRO_ANTIALIASING_MODE cairo_antialiasing_mode;
|
|
|
|
|
2017-02-13 11:53:58 +00:00
|
|
|
///> The grid style to draw the grid in
|
|
|
|
KIGFX::GRID_STYLE m_gridStyle;
|
2017-02-14 15:31:21 +00:00
|
|
|
|
|
|
|
///> Thickness to render grid lines/dots
|
|
|
|
double m_gridLineWidth;
|
2017-02-13 03:47:50 +00:00
|
|
|
|
|
|
|
///> Minimum pixel distance between displayed grid lines
|
|
|
|
double m_gridMinSpacing;
|
2017-03-08 08:37:12 +00:00
|
|
|
|
|
|
|
///> Whether or not to draw the coordinate system axes
|
|
|
|
bool m_axesEnabled;
|
2017-03-18 20:03:24 +00:00
|
|
|
|
2017-03-19 20:51:59 +00:00
|
|
|
///> Fullscreen crosshair or small cross
|
|
|
|
bool m_fullscreenCursor;
|
|
|
|
|
2017-03-18 20:03:24 +00:00
|
|
|
///> Force cursor display
|
|
|
|
bool m_forceDisplayCursor;
|
2019-03-22 21:15:26 +00:00
|
|
|
|
|
|
|
///> The pixel scale factor (>1 for hi-DPI scaled displays)
|
|
|
|
double m_scaleFactor;
|
2016-12-23 15:21:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|