30#include <cursors/cursor-add.xpm>
31#include <cursors/cursor-component.xpm>
32#include <cursors/cursor-eraser.xpm>
33#include <cursors/cursor-label-global.xpm>
34#include <cursors/cursor-label-hier.xpm>
35#include <cursors/cursor-label-net.xpm>
36#include <cursors/cursor-line-bus.xpm>
37#include <cursors/cursor-line-graphic.xpm>
38#include <cursors/cursor-line-wire.xpm>
39#include <cursors/cursor-measure.xpm>
40#include <cursors/cursor-pencil.xpm>
41#include <cursors/cursor-select-lasso.xpm>
42#include <cursors/cursor-select-window.xpm>
43#include <cursors/cursor-subtract.xpm>
44#include <cursors/cursor-text.xpm>
45#include <cursors/cursor-xor.xpm>
46#include <cursors/cursor-zoom-in.xpm>
47#include <cursors/cursor-zoom-out.xpm>
48#include <cursors/cursor_tune.xpm>
49#include <cursors/voltage_probe.xpm>
50#include <cursors/current_probe.xpm>
53#include <cursors/cursor-add64.xpm>
54#include <cursors/cursor-component64.xpm>
55#include <cursors/cursor-eraser64.xpm>
56#include <cursors/cursor-label-global64.xpm>
57#include <cursors/cursor-label-hier64.xpm>
58#include <cursors/cursor-label-net64.xpm>
59#include <cursors/cursor-line-bus64.xpm>
60#include <cursors/cursor-line-graphic64.xpm>
61#include <cursors/cursor-line-wire64.xpm>
62#include <cursors/cursor-measure64.xpm>
63#include <cursors/cursor-pencil64.xpm>
64#include <cursors/cursor-select-lasso64.xpm>
65#include <cursors/cursor-select-window64.xpm>
66#include <cursors/cursor-subtract64.xpm>
67#include <cursors/cursor-text64.xpm>
68#include <cursors/cursor-xor64.xpm>
69#include <cursors/cursor-zoom-in64.xpm>
70#include <cursors/cursor-zoom-out64.xpm>
71#include <cursors/cursor_tune64.xpm>
72#include <cursors/voltage_probe64.xpm>
73#include <cursors/current_probe64.xpm>
78#include <cursors/cursor-place.xpm>
79#include <cursors/cursor-place64.xpm>
80#include <cursors/cursor-select-m.xpm>
81#include <cursors/cursor-select-m64.xpm>
83#include <cursors/cursor-place-black.xpm>
84#include <cursors/cursor-place-black64.xpm>
85#include <cursors/cursor-select-m-black.xpm>
86#include <cursors/cursor-select-m-black64.xpm>
133 cursor_select_m_black_xpm,
206 cursor_label_net_xpm,
214 cursor_label_global_xpm,
222 cursor_component_xpm,
230 cursor_select_lasso_xpm,
238 cursor_select_window_xpm,
254 cursor_line_wire_xpm,
262 cursor_line_graphic_xpm,
270 cursor_label_hier_xpm,
281 cursor_place_black_xpm,
327 cursor_select_m64_xpm,
329 cursor_select_m_black64_xpm,
354 cursor_measure64_xpm,
370 cursor_subtract64_xpm,
386 cursor_zoom_in64_xpm,
394 cursor_zoom_out64_xpm,
402 cursor_label_net64_xpm,
410 cursor_label_global64_xpm,
418 cursor_component64_xpm,
426 cursor_select_lasso64_xpm,
434 cursor_select_window64_xpm,
442 cursor_line_bus64_xpm,
450 cursor_line_wire64_xpm,
458 cursor_line_graphic64_xpm,
466 cursor_label_hier64_xpm,
477 cursor_place_black64_xpm,
496 if( aDef.
m_xpm !=
nullptr )
498 wxImage xpmImage = wxImage( aDef.
m_xpm );
500 xpmImage.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, aDef.
m_hotspot.x );
501 xpmImage.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, aDef.
m_hotspot.y );
503 return wxCursor( xpmImage );
507#if defined( __WXMSW__ ) || defined( __WXMAC__ )
513 img_bitmap.SetMask(
new wxMask( msk_bitmap ) );
515 wxImage
image( img_bitmap.ConvertToImage() );
517#if defined( __WXMSW__ )
518 image.SetMaskColour( 255, 255, 255 );
521 image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, aDef.
m_hotspot.x );
522 image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, aDef.
m_hotspot.y );
524 return wxCursor{
image };
526#elif defined( __WXGTK__ ) || defined( __WXMOTIF__ )
538 wxASSERT_MSG(
false, wxS(
"Unknown platform for cursor construction." ) );
543 wxASSERT_MSG(
false, wxS(
"Unknown to find cursor" ) );
550 for(
const auto& def : aDefs )
559 const auto find_iter =
m_store.find( aIdKey );
561 if( find_iter !=
m_store.end() )
562 return find_iter->second;
564 wxASSERT_MSG(
false, wxString::Format(
"Could not find cursor with ID %d",
565 static_cast<int>( aIdKey ) ) );
574 if( stock != wxCURSOR_MAX )
576 return wxCursor( stock );
580 return store.
Get( aCursorType );
588 if( stock != wxCURSOR_MAX )
590 return wxCursor( stock );
594 return store.
Get( aCursorType );
600 wxStockCursor stockCursor;
601 switch( aCursorType )
603 case KICURSOR::MOVING:
604 stockCursor = wxCURSOR_SIZING;
606 case KICURSOR::BULLSEYE:
607 stockCursor = wxCURSOR_BULLSEYE;
610 stockCursor = wxCURSOR_HAND;
612 case KICURSOR::ARROW:
613 stockCursor = wxCURSOR_ARROW;
616 stockCursor = wxCURSOR_MAX;
622 stockCursor = wxCURSOR_MAX;
Simple class to construct and store cursors against unique ID keys.
const wxCursor & Get(KICURSOR aIdKey) const
Get a given cursor by its ID.
static wxStockCursor GetStockCursor(KICURSOR aCursorType)
static const wxCursor GetHiDPICursor(KICURSOR aCursorType)
static const wxCursor GetCursor(KICURSOR aCursorType)
CURSOR_STORE(const std::vector< CURSOR_DEF > &aDefs)
Construct a store with a pre-set list of cursors.
std::map< KICURSOR, wxCursor > m_store
< Internal store of cursors by ID
wxCursor constructCursor(const CURSOR_STORE::CURSOR_DEF &aDef)
Construct a cursor for the given definition.
static const std::vector< CURSOR_STORE::CURSOR_DEF > hidpi_cursors
static const std::vector< CURSOR_STORE::CURSOR_DEF > standard_cursors
const unsigned char * m_image_data
The mask data bitmap.
const char ** m_xpm
The image size in pixels.
const unsigned char * m_mask_data
wxSize m_size
The "hotspot" where the cursor "is" in the image.