KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::GAL_DISPLAY_OPTIONS Class Reference

#include <gal_display_options.h>

Inheritance diagram for KIGFX::GAL_DISPLAY_OPTIONS:
UTIL::OBSERVABLE< GAL_DISPLAY_OPTIONS_OBSERVER > UTIL::DETAIL::OBSERVABLE_BASE

Public Member Functions

 GAL_DISPLAY_OPTIONS ()
 
void ReadWindowSettings (WINDOW_SETTINGS &aCfg)
 Read GAL config options from application-level config. More...
 
void ReadCommonConfig (COMMON_SETTINGS &aCommonSettings, wxWindow *aWindow)
 Read GAL config options from the common config store. More...
 
void ReadConfig (COMMON_SETTINGS &aCommonConfig, WINDOW_SETTINGS &aWindowConfig, wxWindow *aWindow)
 Read application and common configs. More...
 
void WriteConfig (WINDOW_SETTINGS &aCfg)
 
void UpdateScaleFactor ()
 
void NotifyChanged ()
 
void SubscribeUnmanaged (GAL_DISPLAY_OPTIONS_OBSERVER *aObserver)
 Add a subscription without RAII link. More...
 
LINK Subscribe (GAL_DISPLAY_OPTIONS_OBSERVER *aObserver)
 Add a subscription returning an RAII link. More...
 
void Unsubscribe (GAL_DISPLAY_OPTIONS_OBSERVER *aObserver)
 Cancel the subscription of a subscriber. More...
 
void Notify (void(ObserverInterface::*Ptr)(Args1...), Args2 &&... aArgs)
 Notify event to all subscribed observers. More...
 
void NotifyIgnore (void(ObserverInterface::*Ptr)(Args1...), GAL_DISPLAY_OPTIONS_OBSERVER *aIgnore, Args2 &&... aArgs)
 Notify event to all subscribed observers but one to be ignore. More...
 
size_t size () const
 

Public Attributes

OPENGL_ANTIALIASING_MODE gl_antialiasing_mode
 
CAIRO_ANTIALIASING_MODE cairo_antialiasing_mode
 
DPI_SCALING m_dpi
 The grid style to draw the grid in. More...
 
KIGFX::GRID_STYLE m_gridStyle
 Snapping options for the grid. More...
 
GRID_SNAPPING m_gridSnapping
 Thickness to render grid lines/dots. More...
 
double m_gridLineWidth
 Minimum pixel distance between displayed grid lines. More...
 
double m_gridMinSpacing
 Whether or not to draw the coordinate system axes. More...
 
bool m_axesEnabled
 Fullscreen crosshair or small cross. More...
 
bool m_fullscreenCursor
 Force cursor display. More...
 
bool m_forceDisplayCursor
 The pixel scale factor (>1 for hi-DPI scaled displays) More...
 
double m_scaleFactor
 

Protected Member Functions

void on_observers_empty ()
 
void enter_iteration ()
 
void leave_iteration ()
 
void add_observer (void *observer)
 
void remove_observer (void *observer)
 

Protected Attributes

std::shared_ptr< IMPLimpl_
 

Private Member Functions

void allocate_impl ()
 
void allocate_shared_impl ()
 
void deallocate_impl ()
 
std::shared_ptr< IMPLget_shared_impl ()
 

Detailed Description

Definition at line 80 of file gal_display_options.h.

Constructor & Destructor Documentation

◆ GAL_DISPLAY_OPTIONS()

GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS ( )

Definition at line 60 of file gal_display_options.cpp.

Member Function Documentation

◆ add_observer()

void UTIL::DETAIL::OBSERVABLE_BASE::add_observer ( void *  observer)
protectedinherited

◆ allocate_impl()

void UTIL::DETAIL::OBSERVABLE_BASE::allocate_impl ( )
privateinherited

◆ allocate_shared_impl()

void UTIL::DETAIL::OBSERVABLE_BASE::allocate_shared_impl ( )
privateinherited

◆ deallocate_impl()

void UTIL::DETAIL::OBSERVABLE_BASE::deallocate_impl ( )
privateinherited

◆ enter_iteration()

void UTIL::DETAIL::OBSERVABLE_BASE::enter_iteration ( )
protectedinherited

◆ get_shared_impl()

std::shared_ptr< OBSERVABLE_BASE::IMPL > UTIL::DETAIL::OBSERVABLE_BASE::get_shared_impl ( )
privateinherited

◆ leave_iteration()

void UTIL::DETAIL::OBSERVABLE_BASE::leave_iteration ( )
protectedinherited

◆ Notify()

void UTIL::OBSERVABLE< GAL_DISPLAY_OPTIONS_OBSERVER >::Notify ( void(ObserverInterface::*)(Args1...)  Ptr,
Args2 &&...  aArgs 
)
inlineinherited

Notify event to all subscribed observers.

Parameters
Ptris a pointer to method of the observer interface.
aArgsis a list of arguments to each notification call, will be perfectly forwarded.

Definition at line 182 of file observable.h.

◆ NotifyChanged()

◆ NotifyIgnore()

void UTIL::OBSERVABLE< GAL_DISPLAY_OPTIONS_OBSERVER >::NotifyIgnore ( void(ObserverInterface::*)(Args1...)  Ptr,
GAL_DISPLAY_OPTIONS_OBSERVER *  aIgnore,
Args2 &&...  aArgs 
)
inlineinherited

Notify event to all subscribed observers but one to be ignore.

Parameters
Ptris a pointer to method of the observer interface.
aIgnoreis an observer to ignore during this notification.
aArgsis a list of arguments to each notification call, will be perfectly forwarded.

Definition at line 218 of file observable.h.

◆ on_observers_empty()

void UTIL::DETAIL::OBSERVABLE_BASE::on_observers_empty ( )
protectedinherited

Definition at line 258 of file observable.cpp.

References UTIL::DETAIL::OBSERVABLE_BASE::deallocate_impl().

◆ ReadCommonConfig()

void GAL_DISPLAY_OPTIONS::ReadCommonConfig ( COMMON_SETTINGS aCommonSettings,
wxWindow *  aWindow 
)

Read GAL config options from the common config store.

Parameters
aCommonSettingsthe common config store
aWindowthe wx parent window (used for DPI scaling)

Definition at line 92 of file gal_display_options.cpp.

References COMMON_SETTINGS::GRAPHICS::cairo_aa_mode, cairo_antialiasing_mode, gl_antialiasing_mode, m_dpi, COMMON_SETTINGS::m_Graphics, NotifyChanged(), COMMON_SETTINGS::GRAPHICS::opengl_aa_mode, traceGalDispOpts, and UpdateScaleFactor().

Referenced by EDA_DRAW_FRAME::CommonSettingsChanged(), and ReadConfig().

◆ ReadConfig()

void GAL_DISPLAY_OPTIONS::ReadConfig ( COMMON_SETTINGS aCommonConfig,
WINDOW_SETTINGS aWindowConfig,
wxWindow *  aWindow 
)

Read application and common configs.

Parameters
aCommonConfigthe common config store
aCfgthe application config base
aBaseNamethe application's GAL options key prefix
aWindowthe wx parent window (used for DPI scaling)

Definition at line 109 of file gal_display_options.cpp.

References ReadCommonConfig(), ReadWindowSettings(), and traceGalDispOpts.

Referenced by EDA_DRAW_FRAME::LoadSettings(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), and SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET().

◆ ReadWindowSettings()

◆ remove_observer()

void UTIL::DETAIL::OBSERVABLE_BASE::remove_observer ( void *  observer)
protectedinherited

Definition at line 223 of file observable.cpp.

References UTIL::DETAIL::OBSERVABLE_BASE::impl_.

◆ size()

size_t UTIL::DETAIL::OBSERVABLE_BASE::size ( ) const
inherited

Definition at line 249 of file observable.cpp.

References UTIL::DETAIL::OBSERVABLE_BASE::impl_.

◆ Subscribe()

LINK UTIL::OBSERVABLE< GAL_DISPLAY_OPTIONS_OBSERVER >::Subscribe ( GAL_DISPLAY_OPTIONS_OBSERVER *  aObserver)
inlineinherited

Add a subscription returning an RAII link.

Parameters
aObserverobserver to subscribe
Returns
RAII link controlling the lifetime of the subscription

Definition at line 157 of file observable.h.

◆ SubscribeUnmanaged()

void UTIL::OBSERVABLE< GAL_DISPLAY_OPTIONS_OBSERVER >::SubscribeUnmanaged ( GAL_DISPLAY_OPTIONS_OBSERVER *  aObserver)
inlineinherited

Add a subscription without RAII link.

Parameters
aObserverObserver to subscribe.

Definition at line 146 of file observable.h.

◆ Unsubscribe()

void UTIL::OBSERVABLE< GAL_DISPLAY_OPTIONS_OBSERVER >::Unsubscribe ( GAL_DISPLAY_OPTIONS_OBSERVER *  aObserver)
inlineinherited

Cancel the subscription of a subscriber.

This can be called during notification calls.

Parameters
aObserverobserver to remove from the subscription list.

Definition at line 170 of file observable.h.

◆ UpdateScaleFactor()

void GAL_DISPLAY_OPTIONS::UpdateScaleFactor ( )

◆ WriteConfig()

Member Data Documentation

◆ cairo_antialiasing_mode

CAIRO_ANTIALIASING_MODE KIGFX::GAL_DISPLAY_OPTIONS::cairo_antialiasing_mode

◆ gl_antialiasing_mode

◆ impl_

◆ m_axesEnabled

◆ m_dpi

DPI_SCALING KIGFX::GAL_DISPLAY_OPTIONS::m_dpi

The grid style to draw the grid in.

Definition at line 118 of file gal_display_options.h.

Referenced by ReadCommonConfig(), and UpdateScaleFactor().

◆ m_forceDisplayCursor

bool KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor

◆ m_fullscreenCursor

bool KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor

◆ m_gridLineWidth

double KIGFX::GAL_DISPLAY_OPTIONS::m_gridLineWidth

Minimum pixel distance between displayed grid lines.

Definition at line 127 of file gal_display_options.h.

Referenced by ReadWindowSettings(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().

◆ m_gridMinSpacing

double KIGFX::GAL_DISPLAY_OPTIONS::m_gridMinSpacing

Whether or not to draw the coordinate system axes.

Definition at line 130 of file gal_display_options.h.

Referenced by ReadWindowSettings(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().

◆ m_gridSnapping

GRID_SNAPPING KIGFX::GAL_DISPLAY_OPTIONS::m_gridSnapping

Thickness to render grid lines/dots.

Definition at line 124 of file gal_display_options.h.

Referenced by KIGFX::GAL::GetGridSnapping(), ReadWindowSettings(), and WriteConfig().

◆ m_gridStyle

KIGFX::GRID_STYLE KIGFX::GAL_DISPLAY_OPTIONS::m_gridStyle

Snapping options for the grid.

Definition at line 121 of file gal_display_options.h.

Referenced by ReadWindowSettings(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().

◆ m_scaleFactor


The documentation for this class was generated from the following files: