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 <tomasz.wlostowski@cern.ch>
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 <core/optional.h>
36 
37 #include <tool/tool_action.h>
38 
39 class TOOL_ACTION;
40 class TOOL_MANAGER;
41 class TOOL_BASE;
42 
47 {
48  TC_NONE = 0x00,
49  TC_MOUSE = 0x01,
50  TC_KEYBOARD = 0x02,
51  TC_COMMAND = 0x04,
52  TC_MESSAGE = 0x08,
53  TC_VIEW = 0x10,
54  TC_ANY = 0xffffffff
55 };
56 
58 {
59  // UI input events
60  TA_NONE = 0x0000,
61  TA_MOUSE_CLICK = 0x0001,
63  TA_MOUSE_UP = 0x0004,
64  TA_MOUSE_DOWN = 0x0008,
65  TA_MOUSE_DRAG = 0x0010,
66  TA_MOUSE_MOTION = 0x0020,
67  TA_MOUSE_WHEEL = 0x0040,
68  TA_MOUSE = 0x007f,
69 
70  TA_KEY_PRESSED = 0x0080,
72 
73  // View related events
74  TA_VIEW_REFRESH = 0x0100,
75  TA_VIEW_ZOOM = 0x0200,
76  TA_VIEW_PAN = 0x0400,
77  TA_VIEW_DIRTY = 0x0800,
78  TA_VIEW = 0x0f00,
79 
80  TA_CHANGE_LAYER = 0x1000,
81 
82  // Tool cancel event. Issued automagically when the user hits escape or selects End Tool from
83  // the context menu.
84  TA_CANCEL_TOOL = 0x2000,
85 
86  // Context menu update. Issued whenever context menu is open and the user hovers the mouse
87  // over one of choices. Used in dynamic highlighting in disambiguation menu
89 
90  // Context menu choice. Sent if the user picked something from the context menu or
91  // closed it without selecting anything.
93 
94  // Context menu is closed, no matter whether anything has been chosen or not.
96 
98 
99  // This event is sent *before* undo/redo command is performed.
100  TA_UNDO_REDO_PRE = 0x20000,
101 
102  // This event is sent *after* undo/redo command is performed.
103  TA_UNDO_REDO_POST = 0x40000,
104 
105  // Tool action (allows one to control tools).
106  TA_ACTION = 0x80000,
107 
108  // Tool activation event.
109  TA_ACTIVATE = 0x100000,
110 
111  // Tool re-activation event for tools already on the stack
112  TA_REACTIVATE = 0x200000,
113 
114  // Model has changed (partial update).
115  TA_MODEL_CHANGE = 0x400000,
116 
117  // Tool priming event (a special mouse click)
118  TA_PRIME = 0x800001,
119 
120  TA_ANY = 0xffffffff
121 };
122 
124 {
125  BUT_NONE = 0x0,
126  BUT_LEFT = 0x1,
127  BUT_RIGHT = 0x2,
128  BUT_MIDDLE = 0x4,
130  BUT_ANY = 0xffffffff
131 };
132 
134 {
135  MD_SHIFT = 0x1000,
136  MD_CTRL = 0x2000,
137  MD_ALT = 0x4000,
139 };
140 
143 {
144  CMENU_BUTTON = 0, // On the right button
145  CMENU_NOW, // Right now (after TOOL_INTERACTIVE::SetContextMenu)
146  CMENU_OFF // Never
147 };
148 
153 {
154 public:
160  const std::string Format() const;
161 
163  TOOL_ACTION_SCOPE aScope = AS_GLOBAL, void* aParameter = nullptr ) :
164  m_category( aCategory ),
165  m_actions( aAction ),
166  m_scope( aScope ),
167  m_mouseButtons( 0 ),
168  m_keyCode( 0 ),
169  m_modifiers( 0 ),
170  m_param( aParameter ),
171  m_firstResponder( nullptr )
172  {
173  init();
174  }
175 
176  TOOL_EVENT( TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, int aExtraParam,
177  TOOL_ACTION_SCOPE aScope = AS_GLOBAL, void* aParameter = nullptr ) :
178  m_category( aCategory ),
179  m_actions( aAction ),
180  m_scope( aScope ),
181  m_mouseButtons( 0 ),
182  m_keyCode( 0 ),
183  m_modifiers( 0 ),
184  m_param( aParameter ),
185  m_firstResponder( nullptr )
186  {
187  if( aCategory == TC_MOUSE )
188  {
189  setMouseButtons( aExtraParam & BUT_BUTTON_MASK );
190  }
191  else if( aCategory == TC_KEYBOARD )
192  {
193  m_keyCode = aExtraParam & ~MD_MODIFIER_MASK; // Filter out modifiers
194  }
195  else if( aCategory == TC_COMMAND )
196  {
197  m_commandId = aExtraParam;
198  }
199 
200  if( aCategory & ( TC_MOUSE | TC_KEYBOARD ) )
201  {
202  m_modifiers = aExtraParam & MD_MODIFIER_MASK;
203  }
204 
205  init();
206  }
207 
209  const std::string& aExtraParam, TOOL_ACTION_SCOPE aScope = AS_GLOBAL,
210  void* aParameter = nullptr ) :
211  m_category( aCategory ),
212  m_actions( aAction ),
213  m_scope( aScope ),
214  m_mouseButtons( 0 ),
215  m_keyCode( 0 ),
216  m_modifiers( 0 ),
217  m_param( aParameter ),
218  m_firstResponder( nullptr )
219  {
220  if( aCategory == TC_COMMAND || aCategory == TC_MESSAGE )
221  m_commandStr = aExtraParam;
222 
223  init();
224  }
225 
228 
230  TOOL_ACTIONS Action() const { return m_actions; }
231 
235  bool PassEvent() const { return m_passEvent; }
236  void SetPassEvent( bool aPass = true ) { m_passEvent = aPass; }
237 
240  bool HasPosition() const { return m_hasPosition; }
241  void SetHasPosition( bool aHasPosition ) { m_hasPosition = aHasPosition; }
242 
245  bool ForceImmediate() const { return m_forceImmediate; }
246  void SetForceImmediate( bool aForceImmediate = true ) { m_forceImmediate = aForceImmediate; }
247 
249  void SetFirstResponder( TOOL_BASE* aTool ) { m_firstResponder = aTool; }
250 
252  bool IsReactivate() const { return m_reactivate; }
253  void SetReactivate( bool aReactivate = true ) { m_reactivate = aReactivate; }
254 
257  const VECTOR2D Delta() const
258  {
260  }
261 
263  const VECTOR2D Position() const
264  {
266  }
267 
269  const VECTOR2D DragOrigin() const
270  {
272  }
273 
275  int Buttons() const
276  {
277  assert( m_category == TC_MOUSE ); // this should be used only with mouse events
278  return m_mouseButtons;
279  }
280 
281  bool IsClick( int aButtonMask = BUT_ANY ) const;
282 
283  bool IsDblClick( int aButtonMask = BUT_ANY ) const;
284 
285  bool IsDrag( int aButtonMask = BUT_ANY ) const
286  {
287  return m_actions == TA_MOUSE_DRAG && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
288  }
289 
290  bool IsMouseUp( int aButtonMask = BUT_ANY ) const
291  {
292  return m_actions == TA_MOUSE_UP && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
293  }
294 
295  bool IsMotion() const
296  {
297  return m_actions == TA_MOUSE_MOTION;
298  }
299 
300  bool IsMouseAction() const
301  {
302  return ( m_actions & TA_MOUSE );
303  }
304 
305  bool IsCancel() const
306  {
307  return m_actions == TA_CANCEL_TOOL;
308  }
309 
310  bool IsActivate() const
311  {
312  return m_actions == TA_ACTIVATE;
313  }
314 
315  bool IsUndoRedo() const
316  {
318  }
319 
320  bool IsChoiceMenu() const
321  {
322  return m_actions & TA_CHOICE_MENU;
323  }
324 
325  bool IsPrime() const
326  {
327  return m_actions == TA_PRIME;
328  }
329 
331  int Modifier( int aMask = MD_MODIFIER_MASK ) const
332  {
333  return m_modifiers & aMask;
334  }
335 
336  bool DisableGridSnapping() const
337  {
338  return Modifier( MD_CTRL );
339  }
340 
341  int KeyCode() const
342  {
343  return m_keyCode;
344  }
345 
346  bool IsKeyPressed() const
347  {
348  return m_actions == TA_KEY_PRESSED;
349  }
350 
357  bool Matches( const TOOL_EVENT& aEvent ) const
358  {
359  if( !( m_category & aEvent.m_category ) )
360  return false;
361 
363  {
364  if( (bool) m_commandStr && (bool) aEvent.m_commandStr )
365  return *m_commandStr == *aEvent.m_commandStr;
366 
367  if( (bool) m_commandId && (bool) aEvent.m_commandId )
368  return *m_commandId == *aEvent.m_commandId;
369  }
370 
371  // BUGFIX: TA_ANY should match EVERYTHING, even TA_NONE (for TC_MESSAGE)
372  if( m_actions == TA_ANY && aEvent.m_actions == TA_NONE && aEvent.m_category == TC_MESSAGE )
373  return true;
374 
375  // BUGFIX: This check must happen after the TC_COMMAND check because otherwise events of
376  // the form { TC_COMMAND, TA_NONE } will be incorrectly skipped
377  if( !( m_actions & aEvent.m_actions ) )
378  return false;
379 
380  return true;
381  }
382 
389  bool IsAction( const TOOL_ACTION* aAction ) const;
390 
395  bool IsCancelInteractive() const;
396 
400  bool IsSelectionEvent() const;
401 
408  bool IsPointEditor() const;
409 
415  bool IsMoveTool() const;
416 
420  bool IsSimulator() const;
421 
426  template<typename T>
427  inline T Parameter() const
428  {
429  // Exhibit #798 on why I love to hate C++
430  // - reinterpret_cast needs to be used for pointers
431  // - static_cast must be used for enums
432  // - templates can't usefully distinguish between pointer and non-pointer types
433  // Fortunately good old C's cast can be a reinterpret_cast or a static_cast, and
434  // C99 gave us intptr_t which is guaranteed to be round-trippable with a pointer.
435  return (T) reinterpret_cast<intptr_t>( m_param );
436  }
437 
444  template<typename T>
445  void SetParameter(T aParam)
446  {
447  m_param = (void*) aParam;
448  }
449 
451  {
452  return m_commandId;
453  }
454 
456  {
457  return m_commandStr;
458  }
459 
460  void SetMousePosition( const VECTOR2D& aP )
461  {
462  m_mousePos = aP;
463  }
464 
465 private:
466  friend class TOOL_DISPATCHER;
467 
468  void init();
469 
470  void setMouseDragOrigin( const VECTOR2D& aP )
471  {
472  m_mouseDragOrigin = aP;
473  }
474 
475  void setMouseDelta( const VECTOR2D& aP )
476  {
477  m_mouseDelta = aP;
478  }
479 
480  void setMouseButtons( int aButtons )
481  {
482  assert( ( aButtons & ~BUT_BUTTON_MASK ) == 0 );
483  m_mouseButtons = aButtons;
484  }
485 
486  void setModifiers( int aMods )
487  {
488  assert( ( aMods & ~MD_MODIFIER_MASK ) == 0 );
489  m_modifiers = aMods;
490  }
491 
502  VECTOR2D returnCheckedPosition( const VECTOR2D& aPos ) const;
503 
510 
513 
517 
520 
523 
526 
529 
532 
534  void* m_param;
535 
538 
541 };
542 
544 
550 {
551 public:
553  typedef std::deque<TOOL_EVENT>::iterator iterator;
554  typedef std::deque<TOOL_EVENT>::const_iterator const_iterator;
555 
558  {}
559 
561  TOOL_EVENT_LIST( const TOOL_EVENT& aSingleEvent )
562  {
563  m_events.push_back( aSingleEvent );
564  }
565 
567  TOOL_EVENT_LIST( const TOOL_EVENT_LIST& aEventList )
568  {
569  m_events.clear();
570 
571  for( const TOOL_EVENT& event : aEventList.m_events )
572  m_events.push_back( event );
573  }
574 
581  const std::string Format() const;
582 
584  {
585  for( const TOOL_EVENT& event : m_events )
586  {
587  if( event.Matches( aEvent ) )
588  return event;
589  }
590 
591  return OPT<const TOOL_EVENT&>();
592  }
593 
599  void Add( const TOOL_EVENT& aEvent )
600  {
601  m_events.push_back( aEvent );
602  }
603 
605  {
606  return m_events.begin();
607  }
608 
610  {
611  return m_events.end();
612  }
613 
615  {
616  return m_events.begin();
617  }
618 
620  {
621  return m_events.end();
622  }
623 
624  int size() const
625  {
626  return m_events.size();
627  }
628 
629  void clear()
630  {
631  m_events.clear();
632  }
633 
635  {
636  m_events.clear();
637 
638  for( const TOOL_EVENT& event : aEventList.m_events )
639  m_events.push_back( event );
640 
641  return *this;
642  }
643 
645  {
646  m_events.clear();
647  m_events.push_back( aEvent );
648  return *this;
649  }
650 
652  {
653  Add( aEvent );
654  return *this;
655  }
656 
658  {
659  std::copy( aEvent.m_events.begin(), aEvent.m_events.end(), std::back_inserter( m_events ) );
660  return *this;
661  }
662 
663 private:
664  std::deque<TOOL_EVENT> m_events;
665 };
666 
667 
668 inline const TOOL_EVENT_LIST operator||( const TOOL_EVENT& aEventA, const TOOL_EVENT& aEventB )
669 {
670  TOOL_EVENT_LIST l;
671 
672  l.Add( aEventA );
673  l.Add( aEventB );
674 
675  return l;
676 }
677 
678 
679 inline const TOOL_EVENT_LIST operator||( const TOOL_EVENT& aEvent,
680  const TOOL_EVENT_LIST& aEventList )
681 {
682  TOOL_EVENT_LIST l( aEventList );
683 
684  l.Add( aEvent );
685  return l;
686 }
687 
688 
689 #endif
int Buttons() const
Definition: tool_event.h:275
bool IsCancel() const
Definition: tool_event.h:305
void setMouseButtons(int aButtons)
Definition: tool_event.h:480
bool m_hasPosition
Definition: tool_event.h:508
OPT< int > GetCommandId() const
Definition: tool_event.h:450
void setModifiers(int aMods)
Definition: tool_event.h:486
bool m_forceImmediate
True when the tool is being re-activated from the stack.
Definition: tool_event.h:509
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:162
void setMouseDelta(const VECTOR2D &aP)
Definition: tool_event.h:475
TOOL_EVENT value_type
Definition: tool_event.h:552
const std::string Format() const
Return information about event in form of a human-readable string.
Definition: tool_event.cpp:94
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:236
bool IsSelectionEvent() const
Indicate an selection-changed notification event.
Definition: tool_event.cpp:221
iterator begin()
Definition: tool_event.h:604
void init()
Definition: tool_event.cpp:60
TOOL_EVENT(TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, int aExtraParam, TOOL_ACTION_SCOPE aScope=AS_GLOBAL, void *aParameter=nullptr)
Definition: tool_event.h:176
OPT< const TOOL_EVENT & > Matches(const TOOL_EVENT &aEvent) const
Definition: tool_event.h:583
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:230
int m_modifiers
Generic parameter used for passing non-standard data.
Definition: tool_event.h:531
bool IsClick(int aButtonMask=BUT_ANY) const
Definition: tool_event.cpp:199
bool IsMouseAction() const
Definition: tool_event.h:300
TOOL_ACTIONS m_actions
Definition: tool_event.h:505
TOOL_ACTIONS
Definition: tool_event.h:57
TOOL_EVENT_LIST(const TOOL_EVENT_LIST &aEventList)
Definition: tool_event.h:567
int m_mouseButtons
Stores code of pressed/released key.
Definition: tool_event.h:525
bool IsMotion() const
Definition: tool_event.h:295
bool IsKeyPressed() const
Definition: tool_event.h:346
bool ForceImmediate() const
Definition: tool_event.h:245
TOOL_EVENT_CATEGORY Category() const
Returns more specific information about the type of an event.
Definition: tool_event.h:227
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
OPT< std::string > m_commandStr
Definition: tool_event.h:540
VECTOR2D m_mouseDelta
Current mouse cursor position.
Definition: tool_event.h:516
TOOL_EVENT_CATEGORY
Internal (GUI-independent) event definitions.
Definition: tool_event.h:46
bool IsMoveTool() const
Indicate if the event is from one of the move tools.
Definition: tool_event.cpp:238
int m_keyCode
State of key modifiers (Ctrl/Alt/etc.)
Definition: tool_event.h:528
TOOL_EVENT_LIST & operator=(const TOOL_EVENT &aEvent)
Definition: tool_event.h:644
VECTOR2D m_mouseDragOrigin
State of mouse buttons.
Definition: tool_event.h:522
TOOL_EVENT_LIST & operator||(const TOOL_EVENT_LIST &aEvent)
Definition: tool_event.h:657
void SetReactivate(bool aReactivate=true)
Returns information about difference between current mouse cursor position and the place where draggi...
Definition: tool_event.h:253
OPT< int > m_commandId
Definition: tool_event.h:539
void SetMousePosition(const VECTOR2D &aP)
Definition: tool_event.h:460
bool IsCancelInteractive() const
Indicate the event should restart/end an ongoing interactive tool's event loop (eg esc key,...
Definition: tool_event.cpp:211
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
std::deque< TOOL_EVENT > m_events
Definition: tool_event.h:664
TOOL_EVENT_LIST()
Constructor for a list containing only one TOOL_EVENT.
Definition: tool_event.h:557
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:208
Master controller class:
Definition: tool_manager.h:54
void SetParameter(T aParam)
Set a non-standard parameter assigned to the event.
Definition: tool_event.h:445
bool m_passEvent
Definition: tool_event.h:507
bool IsSimulator() const
Indicate if the event is from the simulator.
Definition: tool_event.cpp:245
A list of TOOL_EVENTs, with overloaded || operators allowing for concatenating TOOL_EVENTs with littl...
Definition: tool_event.h:549
bool IsDrag(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:285
const VECTOR2D Delta() const
Returns mouse cursor position in world coordinates.
Definition: tool_event.h:257
TOOL_ACTION_SCOPE m_scope
Definition: tool_event.h:506
bool IsDblClick(int aButtonMask=BUT_ANY) const
Definition: tool_event.cpp:205
TOOL_EVENT_LIST & operator||(const TOOL_EVENT &aEvent)
Definition: tool_event.h:651
CONTEXT_MENU_TRIGGER
Defines when a context menu is opened.
Definition: tool_event.h:142
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:427
Generic, UI-independent tool event.
Definition: tool_event.h:152
TOOL_EVENT_LIST(const TOOL_EVENT &aSingleEvent)
Copy an existing TOOL_EVENT_LIST.
Definition: tool_event.h:561
bool IsPointEditor() const
Indicate if the event is from one of the point editors.
Definition: tool_event.cpp:229
void SetForceImmediate(bool aForceImmediate=true)
Definition: tool_event.h:246
const VECTOR2D DragOrigin() const
Returns information about mouse buttons state.
Definition: tool_event.h:269
bool Matches(const TOOL_EVENT &aEvent) const
Test whether two events match in terms of category & action or command.
Definition: tool_event.h:357
bool DisableGridSnapping() const
Definition: tool_event.h:336
std::deque< TOOL_EVENT >::const_iterator const_iterator
Default constructor. Creates an empty list.
Definition: tool_event.h:554
bool m_reactivate
Difference between mouse cursor position and the point where dragging event has started.
Definition: tool_event.h:512
bool IsMouseUp(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:290
const std::string Format() const
Function Format() Returns information about event in form of a human-readable string.
Definition: tool_event.cpp:188
int Modifier(int aMask=MD_MODIFIER_MASK) const
Definition: tool_event.h:331
bool IsPrime() const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:325
TOOL_MOUSE_BUTTONS
Definition: tool_event.h:123
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:455
const_iterator cend() const
Definition: tool_event.h:619
bool IsActivate() const
Definition: tool_event.h:310
bool IsUndoRedo() const
Definition: tool_event.h:315
bool PassEvent() const
Definition: tool_event.h:235
void Add(const TOOL_EVENT &aEvent)
Add a tool event to the list.
Definition: tool_event.h:599
TOOL_BASE * m_firstResponder
Definition: tool_event.h:537
const_iterator cbegin() const
Definition: tool_event.h:614
Global action (toolbar/main menu event, global shortcut)
int size() const
Definition: tool_event.h:624
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:249
Base abstract interface for all kinds of tools.
Definition: tool_base.h:65
Represent a single user action.
Definition: tool_action.h:67
TOOL_EVENT_LIST & operator=(const TOOL_EVENT_LIST &aEventList)
Definition: tool_event.h:634
bool IsChoiceMenu() const
Definition: tool_event.h:320
void * m_param
The first tool to receive the event.
Definition: tool_event.h:534
boost::optional< T > OPT
Definition: optional.h:7
bool IsReactivate() const
Definition: tool_event.h:252
TOOL_MODIFIERS
Definition: tool_event.h:133
TOOL_BASE * FirstResponder() const
Definition: tool_event.h:248
bool HasPosition() const
Definition: tool_event.h:240
std::deque< TOOL_EVENT >::iterator iterator
Definition: tool_event.h:553
void setMouseDragOrigin(const VECTOR2D &aP)
Definition: tool_event.h:470
int KeyCode() const
Definition: tool_event.h:341
iterator end()
Definition: tool_event.h:609
VECTOR2D m_mousePos
Point where dragging has started.
Definition: tool_event.h:519
const TOOL_EVENT_LIST operator||(const TOOL_EVENT &aEventA, const TOOL_EVENT &aEventB)
Definition: tool_event.h:668
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:504
TOOL_ACTION_SCOPE
Scope of tool actions.
Definition: tool_action.h:41
const VECTOR2D Position() const
Returns the point where dragging has started.
Definition: tool_event.h:263
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:241
OPT< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:543