2016-12-23 16:06:33 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KICAD, a free EDA CAD application.
|
|
|
|
*
|
2021-01-25 12:42:36 +00:00
|
|
|
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.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__
|
|
|
|
|
2023-09-26 11:40:17 +00:00
|
|
|
#include <gal/gal.h>
|
2020-06-19 16:02:46 +00:00
|
|
|
#include <gal/dpi_scaling.h>
|
2023-09-07 01:25:24 +00:00
|
|
|
#include <core/observable.h>
|
2016-12-23 15:21:00 +00:00
|
|
|
|
2020-01-13 01:44:19 +00:00
|
|
|
class COMMON_SETTINGS;
|
|
|
|
struct WINDOW_SETTINGS;
|
2016-12-23 15:21:00 +00:00
|
|
|
class wxString;
|
2019-04-11 19:35:52 +00:00
|
|
|
class wxWindow;
|
|
|
|
|
2023-09-27 06:22:39 +00:00
|
|
|
#if defined( _MSC_VER )
|
2023-09-26 11:40:17 +00:00
|
|
|
#pragma warning( push )
|
|
|
|
#pragma warning( disable : 4275 )
|
2023-09-27 06:22:39 +00:00
|
|
|
#endif
|
2016-12-23 15:21:00 +00:00
|
|
|
|
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,
|
2021-06-09 00:20:41 +00:00
|
|
|
SMAA,
|
|
|
|
SUPERSAMPLING,
|
2016-12-23 15:21:00 +00:00
|
|
|
};
|
|
|
|
|
2018-01-04 12:13:00 +00:00
|
|
|
enum class CAIRO_ANTIALIASING_MODE
|
|
|
|
{
|
|
|
|
NONE,
|
|
|
|
FAST,
|
|
|
|
GOOD,
|
|
|
|
};
|
|
|
|
|
2020-09-11 03:07:56 +00:00
|
|
|
enum class GRID_SNAPPING
|
|
|
|
{
|
|
|
|
ALWAYS,
|
|
|
|
WITH_GRID,
|
|
|
|
NEVER
|
|
|
|
};
|
|
|
|
|
2017-02-13 11:43:28 +00:00
|
|
|
class GAL_DISPLAY_OPTIONS;
|
|
|
|
|
2023-09-26 11:40:17 +00:00
|
|
|
class GAL_API GAL_DISPLAY_OPTIONS_OBSERVER
|
2016-12-23 15:21:00 +00:00
|
|
|
{
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2023-09-26 11:40:17 +00:00
|
|
|
class GAL_API GAL_DISPLAY_OPTIONS : public UTIL::OBSERVABLE<GAL_DISPLAY_OPTIONS_OBSERVER>
|
2016-12-23 15:21:00 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
GAL_DISPLAY_OPTIONS();
|
|
|
|
|
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;
|
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< The grid style to draw the grid in
|
2017-02-13 11:53:58 +00:00
|
|
|
KIGFX::GRID_STYLE m_gridStyle;
|
2017-02-14 15:31:21 +00:00
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< Snapping options for the grid
|
2020-09-11 03:07:56 +00:00
|
|
|
GRID_SNAPPING m_gridSnapping;
|
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< Thickness to render grid lines/dots
|
2017-02-14 15:31:21 +00:00
|
|
|
double m_gridLineWidth;
|
2017-02-13 03:47:50 +00:00
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< Minimum pixel distance between displayed grid lines
|
2017-02-13 03:47:50 +00:00
|
|
|
double m_gridMinSpacing;
|
2017-03-08 08:37:12 +00:00
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< Whether or not to draw the coordinate system axes
|
2017-03-08 08:37:12 +00:00
|
|
|
bool m_axesEnabled;
|
2017-03-18 20:03:24 +00:00
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< Fullscreen crosshair or small cross
|
2017-03-19 20:51:59 +00:00
|
|
|
bool m_fullscreenCursor;
|
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< Force cursor display
|
2017-03-18 20:03:24 +00:00
|
|
|
bool m_forceDisplayCursor;
|
2019-03-22 21:15:26 +00:00
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< The pixel scale factor (>1 for hi-DPI scaled displays)
|
2019-03-22 21:15:26 +00:00
|
|
|
double m_scaleFactor;
|
2016-12-23 15:21:00 +00:00
|
|
|
|
2023-09-23 03:17:53 +00:00
|
|
|
void NotifyChanged();
|
|
|
|
};
|
2023-09-26 11:40:17 +00:00
|
|
|
|
|
|
|
} // namespace KIGFX
|
|
|
|
|
2023-09-27 06:22:39 +00:00
|
|
|
#if defined( _MSC_VER )
|
2023-09-26 11:40:17 +00:00
|
|
|
#pragma warning( pop )
|
2023-09-27 06:22:39 +00:00
|
|
|
#endif
|
2016-12-23 15:21:00 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|