KiCad PCB EDA Suite
|
#include <gal_display_options_common.h>
Public Member Functions | |
GAL_DISPLAY_OPTIONS_IMPL () | |
void | ReadWindowSettings (WINDOW_SETTINGS &aCfg) |
Read GAL config options from application-level config. | |
void | ReadCommonConfig (COMMON_SETTINGS &aCommonSettings, wxWindow *aWindow) |
Read GAL config options from the common config store. | |
void | ReadConfig (COMMON_SETTINGS &aCommonConfig, WINDOW_SETTINGS &aWindowConfig, wxWindow *aWindow) |
Read application and common configs. | |
void | WriteConfig (WINDOW_SETTINGS &aCfg) |
void | UpdateScaleFactor () |
void | SetCursorMode (CROSS_HAIR_MODE aMode) |
CROSS_HAIR_MODE | GetCursorMode () const |
void | NotifyChanged () |
void | SubscribeUnmanaged (GAL_DISPLAY_OPTIONS_OBSERVER *aObserver) |
Add a subscription without RAII link. | |
LINK | Subscribe (GAL_DISPLAY_OPTIONS_OBSERVER *aObserver) |
Add a subscription returning an RAII link. | |
void | Unsubscribe (GAL_DISPLAY_OPTIONS_OBSERVER *aObserver) |
Cancel the subscription of a subscriber. | |
void | Notify (void(GAL_DISPLAY_OPTIONS_OBSERVER::*Ptr)(Args1...), Args2 &&... aArgs) |
Notify event to all subscribed observers. | |
void | NotifyIgnore (void(GAL_DISPLAY_OPTIONS_OBSERVER::*Ptr)(Args1...), GAL_DISPLAY_OPTIONS_OBSERVER *aIgnore, Args2 &&... aArgs) |
Notify event to all subscribed observers but one to be ignore. | |
size_t | size () const |
Public Attributes | |
DPI_SCALING_COMMON | m_dpi |
GAL_ANTIALIASING_MODE | antialiasing_mode |
The grid style to draw the grid in. | |
KIGFX::GRID_STYLE | m_gridStyle |
Snapping options for the grid. | |
GRID_SNAPPING | m_gridSnapping |
Thickness to render grid lines/dots. | |
double | m_gridLineWidth |
Minimum pixel distance between displayed grid lines. | |
double | m_gridMinSpacing |
Whether or not to draw the coordinate system axes. | |
bool | m_axesEnabled |
Crosshair drawing mode. | |
CROSS_HAIR_MODE | m_crossHairMode |
Force cursor display. | |
bool | m_forceDisplayCursor |
The pixel scale factor (>1 for hi-DPI scaled displays) | |
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< IMPL > | impl_ |
Private Member Functions | |
void | allocate_impl () |
void | allocate_shared_impl () |
void | deallocate_impl () |
std::shared_ptr< IMPL > | get_shared_impl () |
Definition at line 36 of file gal_display_options_common.h.
GAL_DISPLAY_OPTIONS_IMPL::GAL_DISPLAY_OPTIONS_IMPL | ( | ) |
Definition at line 57 of file gal_display_options_common.cpp.
References KIGFX::GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS(), and m_dpi.
|
protectedinherited |
Definition at line 216 of file observable.cpp.
References allocate_impl(), and impl_.
|
privateinherited |
|
privateinherited |
|
privateinherited |
Definition at line 204 of file observable.cpp.
References impl_.
Referenced by on_observers_empty().
|
protectedinherited |
Definition at line 230 of file observable.cpp.
References impl_.
Referenced by UTIL::OBSERVABLE< ObserverInterface >::Notify(), and UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore().
|
privateinherited |
Definition at line 209 of file observable.cpp.
References allocate_shared_impl(), and impl_.
Referenced by OBSERVABLE_BASE().
|
inlineinherited |
Definition at line 122 of file gal_display_options.h.
References m_crossHairMode.
Referenced by EDITOR_CONDITIONS::cursorFunc().
|
protectedinherited |
Definition at line 237 of file observable.cpp.
References impl_.
Referenced by UTIL::OBSERVABLE< ObserverInterface >::Notify(), and UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore().
|
inlineinherited |
Notify event to all subscribed observers.
Ptr | is a pointer to method of the observer interface. |
aArgs | is a list of arguments to each notification call, will be perfectly forwarded. |
Definition at line 182 of file observable.h.
Referenced by KIGFX::GAL_DISPLAY_OPTIONS::NotifyChanged().
|
inherited |
Definition at line 60 of file gal_display_options.cpp.
References UTIL::OBSERVABLE< GAL_DISPLAY_OPTIONS_OBSERVER >::Notify(), KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER::OnGalDisplayOptionsChanged(), and traceGalDispOpts.
Referenced by COMMON_TOOLS::Cursor45Crosshairs(), COMMON_TOOLS::CursorFullCrosshairs(), COMMON_TOOLS::CursorSmallCrosshairs(), GAL_DISPLAY_OPTIONS_IMPL::ReadCommonConfig(), GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), and GAL_DISPLAY_OPTIONS_IMPL::UpdateScaleFactor().
|
inlineinherited |
Notify event to all subscribed observers but one to be ignore.
Ptr | is a pointer to method of the observer interface. |
aIgnore | is an observer to ignore during this notification. |
aArgs | is a list of arguments to each notification call, will be perfectly forwarded. |
Definition at line 218 of file observable.h.
|
protectedinherited |
Definition at line 258 of file observable.cpp.
References deallocate_impl().
void GAL_DISPLAY_OPTIONS_IMPL::ReadCommonConfig | ( | COMMON_SETTINGS & | aCommonSettings, |
wxWindow * | aWindow ) |
Read GAL config options from the common config store.
aCommonSettings | the common config store. |
aWindow | the wx parent window (used for DPI scaling). |
Definition at line 81 of file gal_display_options_common.cpp.
References COMMON_SETTINGS::GRAPHICS::aa_mode, KIGFX::GAL_DISPLAY_OPTIONS::antialiasing_mode, m_dpi, COMMON_SETTINGS::m_Graphics, KIGFX::GAL_DISPLAY_OPTIONS::NotifyChanged(), traceGalDispOpts, and UpdateScaleFactor().
Referenced by ReadConfig().
void GAL_DISPLAY_OPTIONS_IMPL::ReadConfig | ( | COMMON_SETTINGS & | aCommonConfig, |
WINDOW_SETTINGS & | aWindowConfig, | ||
wxWindow * | aWindow ) |
Read application and common configs.
aCommonConfig | the common config store. |
aCfg | the application config base. |
aBaseName | the application's GAL options key prefix. |
aWindow | the wx parent window (used for DPI scaling). |
Definition at line 95 of file gal_display_options_common.cpp.
References ReadCommonConfig(), ReadWindowSettings(), and traceGalDispOpts.
void GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings | ( | WINDOW_SETTINGS & | aCfg | ) |
Read GAL config options from application-level config.
aCfg | the window settings to load from. |
Definition at line 64 of file gal_display_options_common.cpp.
References CURSOR_SETTINGS::always_show_cursor, GRID_SETTINGS::axes_enabled, CURSOR_SETTINGS::cross_hair_mode, WINDOW_SETTINGS::cursor, UTIL::GetValFromConfig(), WINDOW_SETTINGS::grid, gridSnapConfigVals, gridStyleConfigVals, GRID_SETTINGS::line_width, KIGFX::GAL_DISPLAY_OPTIONS::m_axesEnabled, KIGFX::GAL_DISPLAY_OPTIONS::m_crossHairMode, KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_gridLineWidth, KIGFX::GAL_DISPLAY_OPTIONS::m_gridMinSpacing, KIGFX::GAL_DISPLAY_OPTIONS::m_gridSnapping, KIGFX::GAL_DISPLAY_OPTIONS::m_gridStyle, GRID_SETTINGS::min_spacing, KIGFX::GAL_DISPLAY_OPTIONS::NotifyChanged(), GRID_SETTINGS::snap, GRID_SETTINGS::style, and traceGalDispOpts.
Referenced by FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), GERBVIEW_FRAME::CommonSettingsChanged(), PCB_EDIT_FRAME::CommonSettingsChanged(), PL_EDITOR_FRAME::CommonSettingsChanged(), SCH_EDIT_FRAME::CommonSettingsChanged(), SYMBOL_EDIT_FRAME::CommonSettingsChanged(), SYMBOL_VIEWER_FRAME::CommonSettingsChanged(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), SYMBOL_VIEWER_FRAME::LoadSettings(), and ReadConfig().
|
protectedinherited |
Definition at line 223 of file observable.cpp.
References impl_.
|
inlineinherited |
Definition at line 120 of file gal_display_options.h.
References m_crossHairMode.
Referenced by COMMON_TOOLS::Cursor45Crosshairs(), COMMON_TOOLS::CursorFullCrosshairs(), and COMMON_TOOLS::CursorSmallCrosshairs().
|
inherited |
Definition at line 249 of file observable.cpp.
References impl_.
|
inlineinherited |
Add a subscription returning an RAII link.
aObserver | observer to subscribe |
Definition at line 157 of file observable.h.
|
inlineinherited |
Add a subscription without RAII link.
aObserver | Observer to subscribe. |
Definition at line 146 of file observable.h.
|
inlineinherited |
Cancel the subscription of a subscriber.
This can be called during notification calls.
aObserver | observer to remove from the subscription list. |
Definition at line 170 of file observable.h.
void GAL_DISPLAY_OPTIONS_IMPL::UpdateScaleFactor | ( | ) |
Definition at line 120 of file gal_display_options_common.cpp.
References m_dpi, KIGFX::GAL_DISPLAY_OPTIONS::m_scaleFactor, and KIGFX::GAL_DISPLAY_OPTIONS::NotifyChanged().
Referenced by ReadCommonConfig().
void GAL_DISPLAY_OPTIONS_IMPL::WriteConfig | ( | WINDOW_SETTINGS & | aCfg | ) |
Definition at line 106 of file gal_display_options_common.cpp.
References CURSOR_SETTINGS::always_show_cursor, GRID_SETTINGS::axes_enabled, CURSOR_SETTINGS::cross_hair_mode, WINDOW_SETTINGS::cursor, UTIL::GetConfigForVal(), WINDOW_SETTINGS::grid, gridSnapConfigVals, gridStyleConfigVals, GRID_SETTINGS::line_width, KIGFX::GAL_DISPLAY_OPTIONS::m_axesEnabled, KIGFX::GAL_DISPLAY_OPTIONS::m_crossHairMode, KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_gridLineWidth, KIGFX::GAL_DISPLAY_OPTIONS::m_gridMinSpacing, KIGFX::GAL_DISPLAY_OPTIONS::m_gridSnapping, KIGFX::GAL_DISPLAY_OPTIONS::m_gridStyle, GRID_SETTINGS::min_spacing, GRID_SETTINGS::snap, GRID_SETTINGS::style, and traceGalDispOpts.
Referenced by COMMON_TOOLS::Cursor45Crosshairs(), COMMON_TOOLS::CursorFullCrosshairs(), and COMMON_TOOLS::CursorSmallCrosshairs().
|
inherited |
The grid style to draw the grid in.
Definition at line 94 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), SCH_PRINTOUT::PrintPage(), GAL_DISPLAY_OPTIONS_IMPL::ReadCommonConfig(), and KIGFX::CAIRO_GAL::updatedGalDisplayOptions().
|
protectedinherited |
Definition at line 93 of file observable.h.
Referenced by add_observer(), allocate_impl(), allocate_shared_impl(), deallocate_impl(), enter_iteration(), get_shared_impl(), leave_iteration(), UTIL::OBSERVABLE< ObserverInterface >::Notify(), UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore(), OBSERVABLE_BASE(), remove_observer(), size(), and UTIL::OBSERVABLE< ObserverInterface >::Subscribe().
|
inherited |
Crosshair drawing mode.
Definition at line 109 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings(), FOOTPRINT_EDIT_FRAME::SaveSettings(), FOOTPRINT_VIEWER_FRAME::SaveSettings(), SYMBOL_EDIT_FRAME::SaveSettings(), SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), and GAL_DISPLAY_OPTIONS_IMPL::WriteConfig().
|
inherited |
Force cursor display.
Definition at line 112 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), GetCursorMode(), GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings(), SetCursorMode(), and GAL_DISPLAY_OPTIONS_IMPL::WriteConfig().
DPI_SCALING_COMMON GAL_DISPLAY_OPTIONS_IMPL::m_dpi |
Definition at line 71 of file gal_display_options_common.h.
Referenced by GAL_DISPLAY_OPTIONS_IMPL(), ReadCommonConfig(), and UpdateScaleFactor().
|
inherited |
The pixel scale factor (>1 for hi-DPI scaled displays)
Definition at line 115 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), DIALOG_PAD_PROPERTIES::prepareCanvas(), GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings(), and GAL_DISPLAY_OPTIONS_IMPL::WriteConfig().
|
inherited |
Minimum pixel distance between displayed grid lines.
Definition at line 103 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings(), and GAL_DISPLAY_OPTIONS_IMPL::WriteConfig().
|
inherited |
Whether or not to draw the coordinate system axes.
Definition at line 106 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), and GAL_DISPLAY_OPTIONS_IMPL::WriteConfig().
|
inherited |
Thickness to render grid lines/dots.
Definition at line 100 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings(), and GAL_DISPLAY_OPTIONS_IMPL::WriteConfig().
|
inherited |
Snapping options for the grid.
Definition at line 97 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings(), and GAL_DISPLAY_OPTIONS_IMPL::WriteConfig().
|
inherited |
Definition at line 118 of file gal_display_options.h.
Referenced by GAL_DISPLAY_OPTIONS(), and GAL_DISPLAY_OPTIONS_IMPL::UpdateScaleFactor().