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 | 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(ObserverInterface::*Ptr)(Args1...), Args2 &&... aArgs) |
Notify event to all subscribed observers. | |
void | NotifyIgnore (void(ObserverInterface::*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 |
OPENGL_ANTIALIASING_MODE | gl_antialiasing_mode |
CAIRO_ANTIALIASING_MODE | cairo_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 |
Fullscreen crosshair or small cross. | |
bool | m_fullscreenCursor |
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.
|
protectedinherited |
Definition at line 216 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::allocate_impl(), and UTIL::DETAIL::OBSERVABLE_BASE::impl_.
|
privateinherited |
Definition at line 188 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::impl_.
Referenced by UTIL::DETAIL::OBSERVABLE_BASE::add_observer().
|
privateinherited |
Definition at line 195 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::impl_.
Referenced by UTIL::DETAIL::OBSERVABLE_BASE::get_shared_impl().
|
privateinherited |
Definition at line 204 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::impl_.
Referenced by UTIL::DETAIL::OBSERVABLE_BASE::on_observers_empty().
|
protectedinherited |
Definition at line 230 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::impl_.
Referenced by UTIL::OBSERVABLE< ObserverInterface >::Notify(), and UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore().
|
privateinherited |
Definition at line 209 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::allocate_shared_impl(), and UTIL::DETAIL::OBSERVABLE_BASE::impl_.
|
protectedinherited |
Definition at line 237 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::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.
|
inherited |
Definition at line 61 of file gal_display_options.cpp.
References UTIL::OBSERVABLE< GAL_DISPLAY_OPTIONS_OBSERVER >::Notify(), KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER::OnGalDisplayOptionsChanged(), and traceGalDispOpts.
Referenced by ReadCommonConfig(), ReadWindowSettings(), EDA_DRAW_PANEL_GAL::SwitchBackend(), SYMBOL_DIFF_FRAME::SYMBOL_DIFF_FRAME(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), COMMON_TOOLS::ToggleCursorStyle(), and 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 UTIL::DETAIL::OBSERVABLE_BASE::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::cairo_aa_mode, KIGFX::GAL_DISPLAY_OPTIONS::cairo_antialiasing_mode, KIGFX::GAL_DISPLAY_OPTIONS::gl_antialiasing_mode, m_dpi, COMMON_SETTINGS::m_Graphics, KIGFX::GAL_DISPLAY_OPTIONS::NotifyChanged(), COMMON_SETTINGS::GRAPHICS::opengl_aa_mode, traceGalDispOpts, and UpdateScaleFactor().
Referenced by EDA_DRAW_FRAME::CommonSettingsChanged(), and 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 98 of file gal_display_options_common.cpp.
References ReadCommonConfig(), ReadWindowSettings(), and traceGalDispOpts.
Referenced by DESIGN_BLOCK_PREVIEW_WIDGET::DESIGN_BLOCK_PREVIEW_WIDGET(), EDA_DRAW_FRAME::LoadSettings(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), and SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET().
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, WINDOW_SETTINGS::cursor, CURSOR_SETTINGS::fullscreen_cursor, UTIL::GetValFromConfig(), WINDOW_SETTINGS::grid, gridSnapConfigVals, gridStyleConfigVals, GRID_SETTINGS::line_width, KIGFX::GAL_DISPLAY_OPTIONS::m_axesEnabled, KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor, 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 SCH_EDIT_FRAME::CommonSettingsChanged(), SYMBOL_EDIT_FRAME::CommonSettingsChanged(), SYMBOL_VIEWER_FRAME::CommonSettingsChanged(), GERBVIEW_FRAME::CommonSettingsChanged(), PL_EDITOR_FRAME::CommonSettingsChanged(), FOOTPRINT_EDIT_FRAME::CommonSettingsChanged(), PCB_EDIT_FRAME::CommonSettingsChanged(), SYMBOL_VIEWER_FRAME::LoadSettings(), FOOTPRINT_VIEWER_FRAME::LoadSettings(), and ReadConfig().
|
protectedinherited |
Definition at line 223 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::impl_.
|
inherited |
Definition at line 249 of file observable.cpp.
References UTIL::DETAIL::OBSERVABLE_BASE::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 123 of file gal_display_options_common.cpp.
References DPI_SCALING_COMMON::GetScaleFactor(), m_dpi, KIGFX::GAL_DISPLAY_OPTIONS::m_scaleFactor, and KIGFX::GAL_DISPLAY_OPTIONS::NotifyChanged().
Referenced by EDA_DRAW_FRAME::OnMove(), and ReadCommonConfig().
void GAL_DISPLAY_OPTIONS_IMPL::WriteConfig | ( | WINDOW_SETTINGS & | aCfg | ) |
Definition at line 109 of file gal_display_options_common.cpp.
References CURSOR_SETTINGS::always_show_cursor, GRID_SETTINGS::axes_enabled, WINDOW_SETTINGS::cursor, CURSOR_SETTINGS::fullscreen_cursor, UTIL::GetConfigForVal(), WINDOW_SETTINGS::grid, gridSnapConfigVals, gridStyleConfigVals, GRID_SETTINGS::line_width, KIGFX::GAL_DISPLAY_OPTIONS::m_axesEnabled, KIGFX::GAL_DISPLAY_OPTIONS::m_forceDisplayCursor, KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor, 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 EDA_DRAW_FRAME::SaveSettings(), and COMMON_TOOLS::ToggleCursorStyle().
|
inherited |
The grid style to draw the grid in.
Definition at line 92 of file gal_display_options.h.
Referenced by SCH_PRINTOUT::PrintPage(), ReadCommonConfig(), KIGFX::CAIRO_GAL::setCompositor(), and KIGFX::CAIRO_GAL::updatedGalDisplayOptions().
|
inherited |
Definition at line 90 of file gal_display_options.h.
Referenced by PCB_TEST_FRAME_BASE::createView(), KIGFX::OPENGL_GAL::OPENGL_GAL(), ReadCommonConfig(), and KIGFX::OPENGL_GAL::updatedGalDisplayOptions().
|
protectedinherited |
Definition at line 93 of file observable.h.
Referenced by UTIL::DETAIL::OBSERVABLE_BASE::add_observer(), UTIL::DETAIL::OBSERVABLE_BASE::allocate_impl(), UTIL::DETAIL::OBSERVABLE_BASE::allocate_shared_impl(), UTIL::DETAIL::OBSERVABLE_BASE::deallocate_impl(), UTIL::DETAIL::OBSERVABLE_BASE::enter_iteration(), UTIL::DETAIL::OBSERVABLE_BASE::get_shared_impl(), UTIL::DETAIL::OBSERVABLE_BASE::leave_iteration(), UTIL::OBSERVABLE< ObserverInterface >::Notify(), UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore(), UTIL::DETAIL::OBSERVABLE_BASE::remove_observer(), UTIL::DETAIL::OBSERVABLE_BASE::size(), and UTIL::OBSERVABLE< ObserverInterface >::Subscribe().
|
inherited |
Fullscreen crosshair or small cross.
Definition at line 107 of file gal_display_options.h.
Referenced by ReadWindowSettings(), SYMBOL_EDIT_FRAME::SaveSettings(), FOOTPRINT_EDIT_FRAME::SaveSettings(), FOOTPRINT_VIEWER_FRAME::SaveSettings(), SYMBOL_DIFF_FRAME::SYMBOL_DIFF_FRAME(), SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().
DPI_SCALING_COMMON GAL_DISPLAY_OPTIONS_IMPL::m_dpi |
Definition at line 68 of file gal_display_options_common.h.
Referenced by ReadCommonConfig(), and UpdateScaleFactor().
|
inherited |
The pixel scale factor (>1 for hi-DPI scaled displays)
Definition at line 113 of file gal_display_options.h.
Referenced by DESIGN_BLOCK_PREVIEW_WIDGET::DESIGN_BLOCK_PREVIEW_WIDGET(), PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS(), DIALOG_PAD_PROPERTIES::prepareCanvas(), ReadWindowSettings(), SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET(), COMMON_TOOLS::ToggleCursor(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().
|
inherited |
Force cursor display.
Definition at line 110 of file gal_display_options.h.
Referenced by EDITOR_CONDITIONS::cursorFunc(), ReadWindowSettings(), COMMON_TOOLS::ToggleCursorStyle(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().
|
inherited |
Minimum pixel distance between displayed grid lines.
Definition at line 101 of file gal_display_options.h.
Referenced by ReadWindowSettings(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().
|
inherited |
Whether or not to draw the coordinate system axes.
Definition at line 104 of file gal_display_options.h.
Referenced by ReadWindowSettings(), SYMBOL_DIFF_FRAME::SYMBOL_DIFF_FRAME(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().
|
inherited |
Thickness to render grid lines/dots.
Definition at line 98 of file gal_display_options.h.
Referenced by ReadWindowSettings(), and WriteConfig().
|
inherited |
Snapping options for the grid.
Definition at line 95 of file gal_display_options.h.
Referenced by ReadWindowSettings(), KIGFX::GAL::updatedGalDisplayOptions(), and WriteConfig().
|
inherited |
Definition at line 116 of file gal_display_options.h.
Referenced by PCB_TEST_FRAME_BASE::createView(), EDA_DRAW_FRAME::OnMove(), KIGFX::GAL::updatedGalDisplayOptions(), UpdateScaleFactor(), and PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview().