KiCad PCB EDA Suite
tool_event.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 (C) 2013 CERN
5 * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Tomasz Wlostowski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef __TOOL_EVENT_H
28#define __TOOL_EVENT_H
29
30#include <cstdio>
31#include <deque>
32#include <iterator>
33
34#include <math/vector2d.h>
35#include <optional>
36
37#include <tool/tool_action.h>
38
39class TOOL_ACTION;
40class TOOL_MANAGER;
41class TOOL_BASE;
42class TOOLS_HOLDER;
43
48{
49 TC_NONE = 0x00,
50 TC_MOUSE = 0x01,
52 TC_COMMAND = 0x04,
53 TC_MESSAGE = 0x08,
54 TC_VIEW = 0x10,
55 TC_ANY = 0xffffffff
56};
57
59{
60 // UI input events
61 TA_NONE = 0x0000,
64 TA_MOUSE_UP = 0x0004,
65 TA_MOUSE_DOWN = 0x0008,
66 TA_MOUSE_DRAG = 0x0010,
69 TA_MOUSE = 0x007f,
70
73
74 // View related events
76 TA_VIEW_ZOOM = 0x0200,
77 TA_VIEW_PAN = 0x0400,
78 TA_VIEW_DIRTY = 0x0800,
79 TA_VIEW = 0x0f00,
80
82
83 // Tool cancel event. Issued automagically when the user hits escape or selects End Tool from
84 // the context menu.
86
87 // Context menu update. Issued whenever context menu is open and the user hovers the mouse
88 // over one of choices. Used in dynamic highlighting in disambiguation menu
90
91 // Context menu choice. Sent if the user picked something from the context menu or
92 // closed it without selecting anything.
94
95 // Context menu is closed, no matter whether anything has been chosen or not.
97
99
100 // This event is sent *before* undo/redo command is performed.
102
103 // This event is sent *after* undo/redo command is performed.
105
106 // Tool action (allows one to control tools).
107 TA_ACTION = 0x80000,
108
109 // Tool activation event.
110 TA_ACTIVATE = 0x100000,
111
112 // Tool re-activation event for tools already on the stack
113 TA_REACTIVATE = 0x200000,
114
115 // Model has changed (partial update).
116 TA_MODEL_CHANGE = 0x400000,
117
118 // Tool priming event (a special mouse click)
119 TA_PRIME = 0x800001,
120
121 TA_ANY = 0xffffffff
123
125{
126 BUT_NONE = 0x0,
127 BUT_LEFT = 0x1,
130 BUT_AUX1 = 0x8,
131 BUT_AUX2 = 0x10,
133 BUT_ANY = 0xffffffff
135
137{
138 MD_SHIFT = 0x1000,
139 MD_CTRL = 0x2000,
140 MD_ALT = 0x4000,
142};
143
146{
147 CMENU_BUTTON = 0, // On the right button
148 CMENU_NOW, // Right now (after TOOL_INTERACTIVE::SetContextMenu)
149 CMENU_OFF // Never
151
156{
157public:
163 const std::string Format() const;
164
166 TOOL_ACTION_SCOPE aScope = AS_GLOBAL, void* aParameter = nullptr ) :
167 m_category( aCategory ),
168 m_actions( aAction ),
169 m_scope( aScope ),
170 m_mouseButtons( 0 ),
171 m_keyCode( 0 ),
172 m_modifiers( 0 ),
173 m_param( aParameter ),
174 m_firstResponder( nullptr )
175 {
176 init();
177 }
178
179 TOOL_EVENT( TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, int aExtraParam,
180 TOOL_ACTION_SCOPE aScope = AS_GLOBAL, void* aParameter = nullptr ) :
181 m_category( aCategory ),
182 m_actions( aAction ),
183 m_scope( aScope ),
184 m_mouseButtons( 0 ),
185 m_keyCode( 0 ),
186 m_modifiers( 0 ),
187 m_param( aParameter ),
188 m_firstResponder( nullptr )
189 {
190 if( aCategory == TC_MOUSE )
191 {
192 setMouseButtons( aExtraParam & BUT_BUTTON_MASK );
193 }
194 else if( aCategory == TC_KEYBOARD )
195 {
196 m_keyCode = aExtraParam & ~MD_MODIFIER_MASK; // Filter out modifiers
197 }
198 else if( aCategory == TC_COMMAND )
199 {
200 m_commandId = aExtraParam;
201 }
202
203 if( aCategory & ( TC_MOUSE | TC_KEYBOARD ) )
204 {
205 m_modifiers = aExtraParam & MD_MODIFIER_MASK;
206 }
207
208 init();
209 }
210
212 const std::string& aExtraParam, TOOL_ACTION_SCOPE aScope = AS_GLOBAL,
213 void* aParameter = nullptr ) :
214 m_category( aCategory ),
215 m_actions( aAction ),
216 m_scope( aScope ),
217 m_mouseButtons( 0 ),
218 m_keyCode( 0 ),
219 m_modifiers( 0 ),
220 m_param( aParameter ),
221 m_firstResponder( nullptr )
222 {
223 if( aCategory == TC_COMMAND || aCategory == TC_MESSAGE )
224 m_commandStr = aExtraParam;
225
226 init();
227 }
228
231
233 TOOL_ACTIONS Action() const { return m_actions; }
234
238 bool PassEvent() const { return m_passEvent; }
239 void SetPassEvent( bool aPass = true ) { m_passEvent = aPass; }
240
243 bool HasPosition() const { return m_hasPosition; }
244 void SetHasPosition( bool aHasPosition ) { m_hasPosition = aHasPosition; }
245
248 bool ForceImmediate() const { return m_forceImmediate; }
249 void SetForceImmediate( bool aForceImmediate = true ) { m_forceImmediate = aForceImmediate; }
250
252 void SetFirstResponder( TOOL_BASE* aTool ) { m_firstResponder = aTool; }
253
255 bool IsReactivate() const { return m_reactivate; }
256 void SetReactivate( bool aReactivate = true ) { m_reactivate = aReactivate; }
257
260 const VECTOR2D Delta() const
261 {
263 }
264
266 const VECTOR2D Position() const
267 {
269 }
270
272 const VECTOR2D DragOrigin() const
273 {
275 }
276
278 int Buttons() const
279 {
280 assert( m_category == TC_MOUSE ); // this should be used only with mouse events
281 return m_mouseButtons;
282 }
283
284 bool IsClick( int aButtonMask = BUT_ANY ) const;
285
286 bool IsDblClick( int aButtonMask = BUT_ANY ) const;
287
288 bool IsDrag( int aButtonMask = BUT_ANY ) const
289 {
290 return m_actions == TA_MOUSE_DRAG && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
291 }
292
293 bool IsMouseDown( int aButtonMask = BUT_ANY ) const
294 {
295 return m_actions == TA_MOUSE_DOWN && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
296 }
297
298 bool IsMouseUp( int aButtonMask = BUT_ANY ) const
299 {
300 return m_actions == TA_MOUSE_UP && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
301 }
302
303 bool IsMotion() const
304 {
305 return m_actions == TA_MOUSE_MOTION;
306 }
307
308 bool IsMouseAction() const
309 {
310 return ( m_actions & TA_MOUSE );
311 }
312
313 bool IsCancel() const
314 {
315 return m_actions == TA_CANCEL_TOOL;
316 }
317
318 bool IsActivate() const
319 {
320 return m_actions == TA_ACTIVATE;
321 }
322
323 bool IsUndoRedo() const
324 {
326 }
327
328 bool IsChoiceMenu() const
329 {
330 return m_actions & TA_CHOICE_MENU;
331 }
332
333 bool IsPrime() const
334 {
335 return m_actions == TA_PRIME;
336 }
337
339 int Modifier( int aMask = MD_MODIFIER_MASK ) const
340 {
341 return m_modifiers & aMask;
342 }
343
345 {
346 return Modifier( MD_CTRL );
347 }
348
349 int KeyCode() const
350 {
351 return m_keyCode;
352 }
353
354 bool IsKeyPressed() const
355 {
356 return m_actions == TA_KEY_PRESSED;
357 }
358
365 bool Matches( const TOOL_EVENT& aEvent ) const
366 {
367 if( !( m_category & aEvent.m_category ) )
368 return false;
369
371 {
372 if( !m_commandStr.empty() && !aEvent.getCommandStr().empty() )
373 return m_commandStr == aEvent.m_commandStr;
374
375 if( (bool) m_commandId && (bool) aEvent.m_commandId )
376 return *m_commandId == *aEvent.m_commandId;
377 }
378
379 // BUGFIX: TA_ANY should match EVERYTHING, even TA_NONE (for TC_MESSAGE)
380 if( m_actions == TA_ANY && aEvent.m_actions == TA_NONE && aEvent.m_category == TC_MESSAGE )
381 return true;
382
383 // BUGFIX: This check must happen after the TC_COMMAND check because otherwise events of
384 // the form { TC_COMMAND, TA_NONE } will be incorrectly skipped
385 if( !( m_actions & aEvent.m_actions ) )
386 return false;
387
388 return true;
389 }
390
397 bool IsAction( const TOOL_ACTION* aAction ) const;
398
403 bool IsCancelInteractive() const;
404
408 bool IsSelectionEvent() const;
409
416 bool IsPointEditor() const;
417
423 bool IsMoveTool() const;
424
430 bool IsEditorTool() const;
431
435 bool IsSimulator() const;
436
441 template<typename T>
442 inline T Parameter() const
443 {
444 // Exhibit #798 on why I love to hate C++
445 // - reinterpret_cast needs to be used for pointers
446 // - static_cast must be used for enums
447 // - templates can't usefully distinguish between pointer and non-pointer types
448 // Fortunately good old C's cast can be a reinterpret_cast or a static_cast, and
449 // C99 gave us intptr_t which is guaranteed to be round-trippable with a pointer.
450 return (T) reinterpret_cast<intptr_t>( m_param );
451 }
452
459 template<typename T>
460 void SetParameter(T aParam)
461 {
462 m_param = reinterpret_cast<void*>( aParam );
463 }
464
465 std::optional<int> GetCommandId() const
466 {
467 return m_commandId;
468 }
469
470 void SetMousePosition( const VECTOR2D& aP )
471 {
472 m_mousePos = aP;
473 }
474
475private:
476 friend class TOOL_DISPATCHER;
477 friend class TOOL_MANAGER;
478 friend class TOOLS_HOLDER;
479
480 void init();
481
482 const std::string& getCommandStr() const { return m_commandStr; }
483
484 void setMouseDragOrigin( const VECTOR2D& aP )
485 {
487 }
488
489 void setMouseDelta( const VECTOR2D& aP )
490 {
491 m_mouseDelta = aP;
492 }
493
494 void setMouseButtons( int aButtons )
495 {
496 assert( ( aButtons & ~BUT_BUTTON_MASK ) == 0 );
497 m_mouseButtons = aButtons;
498 }
499
500 void setModifiers( int aMods )
501 {
502 assert( ( aMods & ~MD_MODIFIER_MASK ) == 0 );
503 m_modifiers = aMods;
504 }
505
516 VECTOR2D returnCheckedPosition( const VECTOR2D& aPos ) const;
517
524
527
531
534
537
540
543
546
548 void* m_param;
549
552
553 std::optional<int> m_commandId;
554 std::string m_commandStr;
555};
556
557typedef std::optional<TOOL_EVENT> OPT_TOOL_EVENT;
558
564{
565public:
567 typedef std::deque<TOOL_EVENT>::iterator iterator;
568 typedef std::deque<TOOL_EVENT>::const_iterator const_iterator;
569
572 {}
573
575 TOOL_EVENT_LIST( const TOOL_EVENT& aSingleEvent )
576 {
577 m_events.push_back( aSingleEvent );
578 }
579
581 TOOL_EVENT_LIST( const TOOL_EVENT_LIST& aEventList )
582 {
583 m_events.clear();
584
585 for( const TOOL_EVENT& event : aEventList.m_events )
586 m_events.push_back( event );
587 }
588
595 const std::string Format() const;
596
597 OPT_TOOL_EVENT Matches( const TOOL_EVENT& aEvent ) const
598 {
599 for( const TOOL_EVENT& event : m_events )
600 {
601 if( event.Matches( aEvent ) )
602 return event;
603 }
604
605 return OPT_TOOL_EVENT();
606 }
607
613 void Add( const TOOL_EVENT& aEvent )
614 {
615 m_events.push_back( aEvent );
616 }
617
619 {
620 return m_events.begin();
621 }
622
624 {
625 return m_events.end();
626 }
627
629 {
630 return m_events.begin();
631 }
632
634 {
635 return m_events.end();
636 }
637
638 int size() const
639 {
640 return m_events.size();
641 }
642
643 void clear()
644 {
645 m_events.clear();
646 }
647
649 {
650 m_events.clear();
651
652 for( const TOOL_EVENT& event : aEventList.m_events )
653 m_events.push_back( event );
654
655 return *this;
656 }
657
659 {
660 m_events.clear();
661 m_events.push_back( aEvent );
662 return *this;
663 }
664
666 {
667 Add( aEvent );
668 return *this;
669 }
670
672 {
673 std::copy( aEvent.m_events.begin(), aEvent.m_events.end(), std::back_inserter( m_events ) );
674 return *this;
675 }
676
677private:
678 std::deque<TOOL_EVENT> m_events;
679};
680
681
682inline const TOOL_EVENT_LIST operator||( const TOOL_EVENT& aEventA, const TOOL_EVENT& aEventB )
683{
685
686 l.Add( aEventA );
687 l.Add( aEventB );
688
689 return l;
690}
691
692
693inline const TOOL_EVENT_LIST operator||( const TOOL_EVENT& aEvent,
694 const TOOL_EVENT_LIST& aEventList )
695{
696 TOOL_EVENT_LIST l( aEventList );
697
698 l.Add( aEvent );
699 return l;
700}
701
702
703#endif
Represent a single user action.
Definition: tool_action.h:68
Base abstract interface for all kinds of tools.
Definition: tool_base.h:66
A list of TOOL_EVENTs, with overloaded || operators allowing for concatenating TOOL_EVENTs with littl...
Definition: tool_event.h:564
iterator begin()
Definition: tool_event.h:618
const std::string Format() const
Function Format() Returns information about event in form of a human-readable string.
Definition: tool_event.cpp:189
int size() const
Definition: tool_event.h:638
TOOL_EVENT value_type
Definition: tool_event.h:566
std::deque< TOOL_EVENT > m_events
Definition: tool_event.h:678
std::deque< TOOL_EVENT >::const_iterator const_iterator
Default constructor. Creates an empty list.
Definition: tool_event.h:568
iterator end()
Definition: tool_event.h:623
TOOL_EVENT_LIST & operator=(const TOOL_EVENT &aEvent)
Definition: tool_event.h:658
std::deque< TOOL_EVENT >::iterator iterator
Definition: tool_event.h:567
TOOL_EVENT_LIST(const TOOL_EVENT &aSingleEvent)
Copy an existing TOOL_EVENT_LIST.
Definition: tool_event.h:575
TOOL_EVENT_LIST()
Constructor for a list containing only one TOOL_EVENT.
Definition: tool_event.h:571
void Add(const TOOL_EVENT &aEvent)
Add a tool event to the list.
Definition: tool_event.h:613
TOOL_EVENT_LIST & operator=(const TOOL_EVENT_LIST &aEventList)
Definition: tool_event.h:648
const_iterator cbegin() const
Definition: tool_event.h:628
TOOL_EVENT_LIST(const TOOL_EVENT_LIST &aEventList)
Definition: tool_event.h:581
TOOL_EVENT_LIST & operator||(const TOOL_EVENT_LIST &aEvent)
Definition: tool_event.h:671
OPT_TOOL_EVENT Matches(const TOOL_EVENT &aEvent) const
Definition: tool_event.h:597
const_iterator cend() const
Definition: tool_event.h:633
TOOL_EVENT_LIST & operator||(const TOOL_EVENT &aEvent)
Definition: tool_event.h:665
Generic, UI-independent tool event.
Definition: tool_event.h:156
int Buttons() const
Definition: tool_event.h:278
bool HasPosition() const
Definition: tool_event.h:243
bool DisableGridSnapping() const
Definition: tool_event.h:344
bool IsCancelInteractive() const
Indicate the event should restart/end an ongoing interactive tool's event loop (eg esc key,...
Definition: tool_event.cpp:212
bool m_hasPosition
Definition: tool_event.h:522
std::optional< int > m_commandId
Definition: tool_event.h:553
void setMouseDragOrigin(const VECTOR2D &aP)
Definition: tool_event.h:484
int m_keyCode
State of key modifiers (Ctrl/Alt/etc.)
Definition: tool_event.h:542
TOOL_ACTION_SCOPE m_scope
Definition: tool_event.h:520
bool PassEvent() const
Definition: tool_event.h:238
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:442
TOOL_ACTIONS Action() const
These give a tool a method of informing the TOOL_MANAGER that a particular event should be passed on ...
Definition: tool_event.h:233
void SetMousePosition(const VECTOR2D &aP)
Definition: tool_event.h:470
int m_modifiers
Generic parameter used for passing non-standard data.
Definition: tool_event.h:545
int KeyCode() const
Definition: tool_event.h:349
void * m_param
The first tool to receive the event.
Definition: tool_event.h:548
bool Matches(const TOOL_EVENT &aEvent) const
Test whether two events match in terms of category & action or command.
Definition: tool_event.h:365
TOOL_BASE * FirstResponder() const
Definition: tool_event.h:251
void setMouseDelta(const VECTOR2D &aP)
Definition: tool_event.h:489
bool IsActivate() const
Definition: tool_event.h:318
void SetFirstResponder(TOOL_BASE *aTool)
Controls whether the tool is first being pushed to the stack or being reactivated after a pause.
Definition: tool_event.h:252
VECTOR2D m_mousePos
Point where dragging has started.
Definition: tool_event.h:533
bool IsPrime() const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:333
std::string m_commandStr
Definition: tool_event.h:554
TOOL_EVENT(TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, int aExtraParam, TOOL_ACTION_SCOPE aScope=AS_GLOBAL, void *aParameter=nullptr)
Definition: tool_event.h:179
bool IsSimulator() const
Indicate if the event is from the simulator.
Definition: tool_event.cpp:248
const VECTOR2D Position() const
Returns the point where dragging has started.
Definition: tool_event.h:266
bool IsSelectionEvent() const
Indicate an selection-changed notification event.
Definition: tool_event.cpp:220
void SetParameter(T aParam)
Set a non-standard parameter assigned to the event.
Definition: tool_event.h:460
bool ForceImmediate() const
Definition: tool_event.h:248
bool IsReactivate() const
Definition: tool_event.h:255
bool IsKeyPressed() const
Definition: tool_event.h:354
bool IsClick(int aButtonMask=BUT_ANY) const
Definition: tool_event.cpp:200
void SetForceImmediate(bool aForceImmediate=true)
Definition: tool_event.h:249
TOOL_EVENT_CATEGORY Category() const
Returns more specific information about the type of an event.
Definition: tool_event.h:230
bool m_passEvent
Definition: tool_event.h:521
void SetReactivate(bool aReactivate=true)
Returns information about difference between current mouse cursor position and the place where draggi...
Definition: tool_event.h:256
void init()
Definition: tool_event.cpp:60
bool IsDrag(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:288
int Modifier(int aMask=MD_MODIFIER_MASK) const
Definition: tool_event.h:339
bool IsMoveTool() const
Indicate if the event is from one of the move tools.
Definition: tool_event.cpp:236
TOOL_ACTIONS m_actions
Definition: tool_event.h:519
bool m_forceImmediate
True when the tool is being re-activated from the stack.
Definition: tool_event.h:523
bool IsAction(const TOOL_ACTION *aAction) const
Test if the event contains an action issued upon activation of the given TOOL_ACTION.
Definition: tool_event.cpp:88
const VECTOR2D DragOrigin() const
Returns information about mouse buttons state.
Definition: tool_event.h:272
void SetHasPosition(bool aHasPosition)
Returns if the action associated with this event should be treated as immediate regardless of the cur...
Definition: tool_event.h:244
VECTOR2D returnCheckedPosition(const VECTOR2D &aPos) const
Ensure that the event is a type that has a position before returning a position, otherwise return a n...
Definition: tool_event.cpp:76
bool IsEditorTool() const
Indicate if the event is asking for an editor tool.
Definition: tool_event.cpp:242
bool m_reactivate
Difference between mouse cursor position and the point where dragging event has started.
Definition: tool_event.h:526
bool IsCancel() const
Definition: tool_event.h:313
void setMouseButtons(int aButtons)
Definition: tool_event.h:494
TOOL_BASE * m_firstResponder
Definition: tool_event.h:551
bool IsMouseDown(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:293
bool IsDblClick(int aButtonMask=BUT_ANY) const
Definition: tool_event.cpp:206
const std::string & getCommandStr() const
Definition: tool_event.h:482
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:518
bool IsUndoRedo() const
Definition: tool_event.h:323
bool IsPointEditor() const
Indicate if the event is from one of the point editors.
Definition: tool_event.cpp:229
int m_mouseButtons
Stores code of pressed/released key.
Definition: tool_event.h:539
VECTOR2D m_mouseDelta
Current mouse cursor position.
Definition: tool_event.h:530
std::optional< int > GetCommandId() const
Definition: tool_event.h:465
void setModifiers(int aMods)
Definition: tool_event.h:500
TOOL_EVENT(TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, const std::string &aExtraParam, TOOL_ACTION_SCOPE aScope=AS_GLOBAL, void *aParameter=nullptr)
Returns the category (eg. mouse/keyboard/action) of an event..
Definition: tool_event.h:211
void SetPassEvent(bool aPass=true)
Returns if it this event has a valid position (true for mouse events and context-menu or hotkey-based...
Definition: tool_event.h:239
bool IsChoiceMenu() const
Definition: tool_event.h:328
VECTOR2D m_mouseDragOrigin
State of mouse buttons.
Definition: tool_event.h:536
bool IsMouseAction() const
Definition: tool_event.h:308
TOOL_EVENT(TOOL_EVENT_CATEGORY aCategory=TC_NONE, TOOL_ACTIONS aAction=TA_NONE, TOOL_ACTION_SCOPE aScope=AS_GLOBAL, void *aParameter=nullptr)
Definition: tool_event.h:165
bool IsMouseUp(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:298
bool IsMotion() const
Definition: tool_event.h:303
const std::string Format() const
Return information about event in form of a human-readable string.
Definition: tool_event.cpp:94
const VECTOR2D Delta() const
Returns mouse cursor position in world coordinates.
Definition: tool_event.h:260
Master controller class:
Definition: tool_manager.h:55
TOOL_ACTION_SCOPE
Scope of tool actions.
Definition: tool_action.h:42
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:45
const TOOL_EVENT_LIST operator||(const TOOL_EVENT &aEventA, const TOOL_EVENT &aEventB)
Definition: tool_event.h:682
CONTEXT_MENU_TRIGGER
Defines when a context menu is opened.
Definition: tool_event.h:146
@ CMENU_NOW
Definition: tool_event.h:148
@ CMENU_OFF
Definition: tool_event.h:149
@ CMENU_BUTTON
Definition: tool_event.h:147
std::optional< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:557
TOOL_ACTIONS
Definition: tool_event.h:59
@ TA_MODEL_CHANGE
Definition: tool_event.h:116
@ TA_ANY
Definition: tool_event.h:121
@ TA_CHOICE_MENU_CHOICE
Definition: tool_event.h:93
@ TA_UNDO_REDO_PRE
Definition: tool_event.h:101
@ TA_MOUSE_CLICK
Definition: tool_event.h:62
@ TA_CHOICE_MENU_UPDATE
Definition: tool_event.h:89
@ TA_MOUSE
Definition: tool_event.h:69
@ TA_ACTIVATE
Definition: tool_event.h:110
@ TA_CHOICE_MENU_CLOSED
Definition: tool_event.h:96
@ TA_PRIME
Definition: tool_event.h:119
@ TA_MOUSE_MOTION
Definition: tool_event.h:67
@ TA_MOUSE_UP
Definition: tool_event.h:64
@ TA_KEYBOARD
Definition: tool_event.h:72
@ TA_VIEW_REFRESH
Definition: tool_event.h:75
@ TA_CHOICE_MENU
Definition: tool_event.h:98
@ TA_MOUSE_DRAG
Definition: tool_event.h:66
@ TA_CHANGE_LAYER
Definition: tool_event.h:81
@ TA_MOUSE_DOWN
Definition: tool_event.h:65
@ TA_VIEW
Definition: tool_event.h:79
@ TA_UNDO_REDO_POST
Definition: tool_event.h:104
@ TA_KEY_PRESSED
Definition: tool_event.h:71
@ TA_MOUSE_DBLCLICK
Definition: tool_event.h:63
@ TA_MOUSE_WHEEL
Definition: tool_event.h:68
@ TA_ACTION
Definition: tool_event.h:107
@ TA_VIEW_PAN
Definition: tool_event.h:77
@ TA_NONE
Definition: tool_event.h:61
@ TA_CANCEL_TOOL
Definition: tool_event.h:85
@ TA_VIEW_DIRTY
Definition: tool_event.h:78
@ TA_REACTIVATE
Definition: tool_event.h:113
@ TA_VIEW_ZOOM
Definition: tool_event.h:76
TOOL_EVENT_CATEGORY
Internal (GUI-independent) event definitions.
Definition: tool_event.h:48
@ TC_NONE
Definition: tool_event.h:49
@ TC_ANY
Definition: tool_event.h:55
@ TC_COMMAND
Definition: tool_event.h:52
@ TC_MOUSE
Definition: tool_event.h:50
@ TC_MESSAGE
Definition: tool_event.h:53
@ TC_KEYBOARD
Definition: tool_event.h:51
@ TC_VIEW
Definition: tool_event.h:54
TOOL_MODIFIERS
Definition: tool_event.h:137
@ MD_MODIFIER_MASK
Definition: tool_event.h:141
@ MD_ALT
Definition: tool_event.h:140
@ MD_CTRL
Definition: tool_event.h:139
@ MD_SHIFT
Definition: tool_event.h:138
TOOL_MOUSE_BUTTONS
Definition: tool_event.h:125
@ BUT_AUX1
Definition: tool_event.h:130
@ BUT_MIDDLE
Definition: tool_event.h:129
@ BUT_LEFT
Definition: tool_event.h:127
@ BUT_RIGHT
Definition: tool_event.h:128
@ BUT_AUX2
Definition: tool_event.h:131
@ BUT_BUTTON_MASK
Definition: tool_event.h:132
@ BUT_NONE
Definition: tool_event.h:126
@ BUT_ANY
Definition: tool_event.h:133