KiCad PCB EDA Suite
Loading...
Searching...
No Matches
cursors.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef CURSOR_STORE__H
21#define CURSOR_STORE__H
22
23#include <gal/gal.h>
24#include <wx/cursor.h>
25
26#include <map>
27#include <vector>
28
33#if wxCHECK_VERSION( 3, 3, 0 )
34typedef wxCursorBundle WX_CURSOR_TYPE;
35#else
36typedef wxCursor WX_CURSOR_TYPE;
37#endif
38
39
98
106{
107public:
112 {
113 const char** m_xpm;
114
116 wxPoint m_hotspot;
117 };
118
125 static const WX_CURSOR_TYPE GetCursor( KICURSOR aCursorType, bool aHiDPI = false );
126
132 static wxStockCursor GetStockCursor( KICURSOR aCursorType );
133
134private:
139 CURSOR_STORE();
140
141#if wxCHECK_VERSION( 3, 3, 0 )
147 const wxCursorBundle& storeGetBundle( KICURSOR aIdKey ) const;
148#else
155 const wxCursor& storeGetCursor( KICURSOR aIdKey, bool aHiDPI = false ) const;
156#endif
157
158#if wxCHECK_VERSION( 3, 3, 0 )
160 std::map<KICURSOR, wxCursorBundle> m_bundleMap;
161#else
162 std::map<KICURSOR, wxCursor> m_standardCursorMap;
163 std::map<KICURSOR, wxCursor> m_hidpiCursorMap;
164#endif
165
166};
167
168#endif // CURSOR_STORE__H
@ ADD
Definition am_param.h:146
Store all of the related component information found in a netlist.
std::map< KICURSOR, wxCursor > m_hidpiCursorMap
Definition cursors.h:163
static const WX_CURSOR_TYPE GetCursor(KICURSOR aCursorType, bool aHiDPI=false)
Get a cursor bundle (wx 3.3+) or appropriate cursor (older versions)
Definition cursors.cpp:399
static wxStockCursor GetStockCursor(KICURSOR aCursorType)
Get stock cursor type for the given cursor.
Definition cursors.cpp:433
CURSOR_STORE()
Construct a store with cursors for all defined types.
Definition cursors.cpp:324
const wxCursor & storeGetCursor(KICURSOR aIdKey, bool aHiDPI=false) const
Get a cursor by its ID, automatically selecting the appropriate resolution.
Definition cursors.cpp:384
std::map< KICURSOR, wxCursor > m_standardCursorMap
Definition cursors.h:162
KICURSOR
Definition cursors.h:41
@ LINE_WIRE64
Definition cursors.h:92
@ LINE_BUS
Definition cursors.h:87
@ LINE_WIRE
Definition cursors.h:91
@ BULLSEYE64
Definition cursors.h:56
@ LABEL_GLOBAL64
Definition cursors.h:80
@ SUBTRACT
Definition cursors.h:69
@ VOLTAGE_PROBE
Definition cursors.h:57
@ PLACE64
Definition cursors.h:96
@ LINE_GRAPHIC64
Definition cursors.h:90
@ MEASURE64
Definition cursors.h:66
@ ARROW64
Definition cursors.h:44
@ SELECT_WINDOW
Definition cursors.h:83
@ SELECT_LASSO64
Definition cursors.h:86
@ ZOOM_IN64
Definition cursors.h:74
@ SUBTRACT64
Definition cursors.h:70
@ COMPONENT64
Definition cursors.h:82
@ REMOVE
Definition cursors.h:51
@ MOVING64
Definition cursors.h:46
@ MEASURE
Definition cursors.h:65
@ PLACE
Definition cursors.h:95
@ SELECT_LASSO
Definition cursors.h:85
@ LINE_BUS64
Definition cursors.h:88
@ ZOOM_IN
Definition cursors.h:73
@ ZOOM_OUT
Definition cursors.h:75
@ HAND64
Definition cursors.h:54
@ LABEL_NET64
Definition cursors.h:78
@ LABEL_GLOBAL
Definition cursors.h:79
@ MOVING
Definition cursors.h:45
@ TUNE64
Definition cursors.h:62
@ TEXT64
Definition cursors.h:64
@ CURRENT_PROBE
Definition cursors.h:59
@ XOR64
Definition cursors.h:72
@ WARNING64
Definition cursors.h:48
@ ADD64
Definition cursors.h:68
@ LABEL_NET
Definition cursors.h:77
@ LABEL_HIER64
Definition cursors.h:94
@ VOLTAGE_PROBE64
Definition cursors.h:58
@ CURRENT_PROBE64
Definition cursors.h:60
@ PENCIL64
Definition cursors.h:50
@ SELECT_WINDOW64
Definition cursors.h:84
@ LINE_GRAPHIC
Definition cursors.h:89
@ LABEL_HIER
Definition cursors.h:93
@ BULLSEYE
Definition cursors.h:55
@ PENCIL
Definition cursors.h:49
@ REMOVE64
Definition cursors.h:52
@ ZOOM_OUT64
Definition cursors.h:76
wxCursor WX_CURSOR_TYPE
Represents either a wxCursorBundle for wx 3.3+ or a wxCursor for older versions.
Definition cursors.h:36
#define GAL_API
Definition gal.h:27
@ XOR
Definition image.h:41
Definition of a cursor.
Definition cursors.h:112
const char ** m_xpm
Definition cursors.h:113
wxPoint m_hotspot
The "hotspot" where the cursor "is" in the image.
Definition cursors.h:116