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-line-wire-add.xpm>
40#include <cursors/cursor-measure.xpm>
41#include <cursors/cursor-pencil.xpm>
42#include <cursors/cursor-select-lasso.xpm>
43#include <cursors/cursor-select-window.xpm>
44#include <cursors/cursor-subtract.xpm>
45#include <cursors/cursor-text.xpm>
46#include <cursors/cursor-xor.xpm>
47#include <cursors/cursor-zoom-in.xpm>
48#include <cursors/cursor-zoom-out.xpm>
49#include <cursors/cursor_tune.xpm>
50#include <cursors/voltage_probe.xpm>
51#include <cursors/current_probe.xpm>
54#include <cursors/cursor-add64.xpm>
55#include <cursors/cursor-component64.xpm>
56#include <cursors/cursor-eraser64.xpm>
57#include <cursors/cursor-label-global64.xpm>
58#include <cursors/cursor-label-hier64.xpm>
59#include <cursors/cursor-label-net64.xpm>
60#include <cursors/cursor-line-bus64.xpm>
61#include <cursors/cursor-line-graphic64.xpm>
62#include <cursors/cursor-line-wire64.xpm>
63#include <cursors/cursor-line-wire-add64.xpm>
64#include <cursors/cursor-measure64.xpm>
65#include <cursors/cursor-pencil64.xpm>
66#include <cursors/cursor-select-lasso64.xpm>
67#include <cursors/cursor-select-window64.xpm>
68#include <cursors/cursor-subtract64.xpm>
69#include <cursors/cursor-text64.xpm>
70#include <cursors/cursor-xor64.xpm>
71#include <cursors/cursor-zoom-in64.xpm>
72#include <cursors/cursor-zoom-out64.xpm>
73#include <cursors/cursor_tune64.xpm>
74#include <cursors/voltage_probe64.xpm>
75#include <cursors/current_probe64.xpm>
80#include <cursors/cursor-place.xpm>
81#include <cursors/cursor-place64.xpm>
82#include <cursors/cursor-select-m.xpm>
83#include <cursors/cursor-select-m64.xpm>
85#include <cursors/cursor-place-black.xpm>
86#include <cursors/cursor-place-black64.xpm>
87#include <cursors/cursor-select-m-black.xpm>
88#include <cursors/cursor-select-m-black64.xpm>
135 cursor_select_m_black_xpm,
208 cursor_label_net_xpm,
216 cursor_label_global_xpm,
224 cursor_component_xpm,
232 cursor_select_lasso_xpm,
240 cursor_select_window_xpm,
256 cursor_line_wire_xpm,
264 cursor_line_wire_add_xpm,
272 cursor_line_graphic_xpm,
280 cursor_label_hier_xpm,
291 cursor_place_black_xpm,
337 cursor_select_m64_xpm,
339 cursor_select_m_black64_xpm,
364 cursor_measure64_xpm,
380 cursor_subtract64_xpm,
396 cursor_zoom_in64_xpm,
404 cursor_zoom_out64_xpm,
412 cursor_label_net64_xpm,
420 cursor_label_global64_xpm,
428 cursor_component64_xpm,
436 cursor_select_lasso64_xpm,
444 cursor_select_window64_xpm,
452 cursor_line_bus64_xpm,
460 cursor_line_wire64_xpm,
468 cursor_line_wire_add64_xpm,
476 cursor_line_graphic64_xpm,
484 cursor_label_hier64_xpm,
495 cursor_place_black64_xpm,
514 if( aDef.
m_xpm !=
nullptr )
516 wxImage xpmImage = wxImage( aDef.
m_xpm );
518 xpmImage.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, aDef.
m_hotspot.x );
519 xpmImage.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, aDef.
m_hotspot.y );
521 return wxCursor( xpmImage );
525#if defined( __WXMSW__ ) || defined( __WXMAC__ )
531 img_bitmap.SetMask(
new wxMask( msk_bitmap ) );
533 wxImage
image( img_bitmap.ConvertToImage() );
535#if defined( __WXMSW__ )
536 image.SetMaskColour( 255, 255, 255 );
539 image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, aDef.
m_hotspot.x );
540 image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, aDef.
m_hotspot.y );
542 return wxCursor{
image };
544#elif defined( __WXGTK__ ) || defined( __WXMOTIF__ )
556 wxASSERT_MSG(
false, wxS(
"Unknown platform for cursor construction." ) );
561 wxASSERT_MSG(
false, wxS(
"Unknown to find cursor" ) );
568 for(
const auto& def : aDefs )
577 const auto find_iter =
m_store.find( aIdKey );
579 if( find_iter !=
m_store.end() )
580 return find_iter->second;
582 wxASSERT_MSG(
false, wxString::Format(
"Could not find cursor with ID %d",
583 static_cast<int>( aIdKey ) ) );
592 if( stock != wxCURSOR_MAX )
594 return wxCursor( stock );
598 return store.
Get( aCursorType );
606 if( stock != wxCURSOR_MAX )
608 return wxCursor( stock );
612 return store.
Get( aCursorType );
618 wxStockCursor stockCursor;
619 switch( aCursorType )
621 case KICURSOR::MOVING:
622 stockCursor = wxCURSOR_SIZING;
624 case KICURSOR::BULLSEYE:
625 stockCursor = wxCURSOR_BULLSEYE;
628 stockCursor = wxCURSOR_HAND;
630 case KICURSOR::ARROW:
631 stockCursor = wxCURSOR_ARROW;
634 stockCursor = wxCURSOR_MAX;
640 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.