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 #ifdef WX_COMPATIBILITY
38 #include <wx/debug.h>
39 #else
40 #include <cassert>
41 #endif
42 
43 
44 class TOOL_ACTION;
45 class TOOL_MANAGER;
46 class TOOL_BASE;
47 
52 {
53  TC_NONE = 0x00,
54  TC_MOUSE = 0x01,
55  TC_KEYBOARD = 0x02,
56  TC_COMMAND = 0x04,
57  TC_MESSAGE = 0x08,
58  TC_VIEW = 0x10,
59  TC_ANY = 0xffffffff
60 };
61 
63 {
64  // UI input events
65  TA_NONE = 0x0000,
66  TA_MOUSE_CLICK = 0x0001,
68  TA_MOUSE_UP = 0x0004,
69  TA_MOUSE_DOWN = 0x0008,
70  TA_MOUSE_DRAG = 0x0010,
71  TA_MOUSE_MOTION = 0x0020,
72  TA_MOUSE_WHEEL = 0x0040,
73  TA_MOUSE = 0x007f,
74 
75  TA_KEY_PRESSED = 0x0080,
77 
78  // View related events
79  TA_VIEW_REFRESH = 0x0100,
80  TA_VIEW_ZOOM = 0x0200,
81  TA_VIEW_PAN = 0x0400,
82  TA_VIEW_DIRTY = 0x0800,
83  TA_VIEW = 0x0f00,
84 
85  TA_CHANGE_LAYER = 0x1000,
86 
87  // Tool cancel event. Issued automagically when the user hits escape or selects End Tool from
88  // the context menu.
89  TA_CANCEL_TOOL = 0x2000,
90 
91  // Context menu update. Issued whenever context menu is open and the user hovers the mouse
92  // over one of choices. Used in dynamic highlighting in disambiguation menu
94 
95  // Context menu choice. Sent if the user picked something from the context menu or
96  // closed it without selecting anything.
98 
99  // Context menu is closed, no matter whether anything has been chosen or not.
101 
103 
104  // This event is sent *before* undo/redo command is performed.
105  TA_UNDO_REDO_PRE = 0x20000,
106 
107  // This event is sent *after* undo/redo command is performed.
108  TA_UNDO_REDO_POST = 0x40000,
109 
110  // Tool action (allows one to control tools).
111  TA_ACTION = 0x80000,
112 
113  // Tool activation event.
114  TA_ACTIVATE = 0x100000,
115 
116  // Tool re-activation event for tools already on the stack
117  TA_REACTIVATE = 0x200000,
118 
119  // Model has changed (partial update).
120  TA_MODEL_CHANGE = 0x400000,
121 
122  // Tool priming event (a special mouse click)
123  TA_PRIME = 0x800001,
124 
125  TA_ANY = 0xffffffff
126 };
127 
129 {
130  BUT_NONE = 0x0,
131  BUT_LEFT = 0x1,
132  BUT_RIGHT = 0x2,
133  BUT_MIDDLE = 0x4,
135  BUT_ANY = 0xffffffff
136 };
137 
139 {
140  MD_SHIFT = 0x1000,
141  MD_CTRL = 0x2000,
142  MD_ALT = 0x4000,
144 };
145 
148 {
152 };
153 
156 {
157  AF_NONE = 0,
160 };
161 
164 {
165  CMENU_BUTTON = 0, // On the right button
166  CMENU_NOW, // Right now (after TOOL_INTERACTIVE::SetContextMenu)
167  CMENU_OFF // Never
168 };
169 
174 {
175 public:
181  const std::string Format() const;
182 
184  TOOL_ACTION_SCOPE aScope = AS_GLOBAL, void* aParameter = nullptr ) :
185  m_category( aCategory ),
186  m_actions( aAction ),
187  m_scope( aScope ),
188  m_mouseButtons( 0 ),
189  m_keyCode( 0 ),
190  m_modifiers( 0 ),
191  m_param( aParameter ),
192  m_firstResponder( nullptr )
193  {
194  init();
195  }
196 
197  TOOL_EVENT( TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, int aExtraParam,
198  TOOL_ACTION_SCOPE aScope = AS_GLOBAL, void* aParameter = nullptr ) :
199  m_category( aCategory ),
200  m_actions( aAction ),
201  m_scope( aScope ),
202  m_mouseButtons( 0 ),
203  m_keyCode( 0 ),
204  m_modifiers( 0 ),
205  m_param( aParameter ),
206  m_firstResponder( nullptr )
207  {
208  if( aCategory == TC_MOUSE )
209  {
210  setMouseButtons( aExtraParam & BUT_BUTTON_MASK );
211  }
212  else if( aCategory == TC_KEYBOARD )
213  {
214  m_keyCode = aExtraParam & ~MD_MODIFIER_MASK; // Filter out modifiers
215  }
216  else if( aCategory == TC_COMMAND )
217  {
218  m_commandId = aExtraParam;
219  }
220 
221  if( aCategory & ( TC_MOUSE | TC_KEYBOARD ) )
222  {
223  m_modifiers = aExtraParam & MD_MODIFIER_MASK;
224  }
225 
226  init();
227  }
228 
230  const std::string& aExtraParam, TOOL_ACTION_SCOPE aScope = AS_GLOBAL,
231  void* aParameter = nullptr ) :
232  m_category( aCategory ),
233  m_actions( aAction ),
234  m_scope( aScope ),
235  m_mouseButtons( 0 ),
236  m_keyCode( 0 ),
237  m_modifiers( 0 ),
238  m_param( aParameter ),
239  m_firstResponder( nullptr )
240  {
241  if( aCategory == TC_COMMAND || aCategory == TC_MESSAGE )
242  m_commandStr = aExtraParam;
243 
244  init();
245  }
246 
249 
251  TOOL_ACTIONS Action() const { return m_actions; }
252 
256  bool PassEvent() const { return m_passEvent; }
257  void SetPassEvent( bool aPass = true ) { m_passEvent = aPass; }
258 
261  bool HasPosition() const { return m_hasPosition; }
262  void SetHasPosition( bool aHasPosition ) { m_hasPosition = aHasPosition; }
263 
266  bool ForceImmediate() const { return m_forceImmediate; }
267  void SetForceImmediate( bool aForceImmediate = true ) { m_forceImmediate = aForceImmediate; }
268 
270  void SetFirstResponder( TOOL_BASE* aTool ) { m_firstResponder = aTool; }
271 
273  bool IsReactivate() const { return m_reactivate; }
274  void SetReactivate( bool aReactivate = true ) { m_reactivate = aReactivate; }
275 
278  const VECTOR2D Delta() const
279  {
281  }
282 
284  const VECTOR2D Position() const
285  {
287  }
288 
290  const VECTOR2D DragOrigin() const
291  {
293  }
294 
296  int Buttons() const
297  {
298  assert( m_category == TC_MOUSE ); // this should be used only with mouse events
299  return m_mouseButtons;
300  }
301 
302  bool IsClick( int aButtonMask = BUT_ANY ) const;
303 
304  bool IsDblClick( int aButtonMask = BUT_ANY ) const;
305 
306  bool IsDrag( int aButtonMask = BUT_ANY ) const
307  {
308  return m_actions == TA_MOUSE_DRAG && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
309  }
310 
311  bool IsMouseUp( int aButtonMask = BUT_ANY ) const
312  {
313  return m_actions == TA_MOUSE_UP && ( m_mouseButtons & aButtonMask ) == m_mouseButtons;
314  }
315 
316  bool IsMotion() const
317  {
318  return m_actions == TA_MOUSE_MOTION;
319  }
320 
321  bool IsMouseAction() const
322  {
323  return ( m_actions & TA_MOUSE );
324  }
325 
326  bool IsCancel() const
327  {
328  return m_actions == TA_CANCEL_TOOL;
329  }
330 
331  bool IsActivate() const
332  {
333  return m_actions == TA_ACTIVATE;
334  }
335 
336  bool IsUndoRedo() const
337  {
339  }
340 
341  bool IsChoiceMenu() const
342  {
343  return m_actions & TA_CHOICE_MENU;
344  }
345 
346  bool IsPrime() const
347  {
348  return m_actions == TA_PRIME;
349  }
350 
352  int Modifier( int aMask = MD_MODIFIER_MASK ) const
353  {
354  return m_modifiers & aMask;
355  }
356 
357  int KeyCode() const
358  {
359  return m_keyCode;
360  }
361 
362  bool IsKeyPressed() const
363  {
364  return m_actions == TA_KEY_PRESSED;
365  }
366 
373  bool Matches( const TOOL_EVENT& aEvent ) const
374  {
375  if( !( m_category & aEvent.m_category ) )
376  return false;
377 
379  {
380  if( (bool) m_commandStr && (bool) aEvent.m_commandStr )
381  return *m_commandStr == *aEvent.m_commandStr;
382 
383  if( (bool) m_commandId && (bool) aEvent.m_commandId )
384  return *m_commandId == *aEvent.m_commandId;
385  }
386 
387  // BUGFIX: TA_ANY should match EVERYTHING, even TA_NONE (for TC_MESSAGE)
388  if( m_actions == TA_ANY && aEvent.m_actions == TA_NONE && aEvent.m_category == TC_MESSAGE )
389  return true;
390 
391  // BUGFIX: This check must happen after the TC_COMMAND check because otherwise events of
392  // the form { TC_COMMAND, TA_NONE } will be incorrectly skipped
393  if( !( m_actions & aEvent.m_actions ) )
394  return false;
395 
396  return true;
397  }
398 
405  bool IsAction( const TOOL_ACTION* aAction ) const;
406 
411  bool IsCancelInteractive() const;
412 
416  bool IsSelectionEvent() const;
417 
424  bool IsPointEditor() const;
425 
431  bool IsMoveTool() const;
432 
436  bool IsSimulator() const;
437 
442  template<typename T>
443  inline T Parameter() const
444  {
445  // Exhibit #798 on why I love to hate C++
446  // - reinterpret_cast needs to be used for pointers
447  // - static_cast must be used for enums
448  // - templates can't usefully distinguish between pointer and non-pointer types
449  // Fortunately good old C's cast can be a reinterpret_cast or a static_cast, and
450  // C99 gave us intptr_t which is guaranteed to be round-trippable with a pointer.
451  return (T) reinterpret_cast<intptr_t>( m_param );
452  }
453 
460  template<typename T>
461  void SetParameter(T aParam)
462  {
463  m_param = (void*) aParam;
464  }
465 
467  {
468  return m_commandId;
469  }
470 
472  {
473  return m_commandStr;
474  }
475 
476  void SetMousePosition( const VECTOR2D& aP )
477  {
478  m_mousePos = aP;
479  }
480 
481 private:
482  friend class TOOL_DISPATCHER;
483 
484  void init();
485 
486  void setMouseDragOrigin( const VECTOR2D& aP )
487  {
488  m_mouseDragOrigin = aP;
489  }
490 
491  void setMouseDelta( const VECTOR2D& aP )
492  {
493  m_mouseDelta = aP;
494  }
495 
496  void setMouseButtons( int aButtons )
497  {
498  assert( ( aButtons & ~BUT_BUTTON_MASK ) == 0 );
499  m_mouseButtons = aButtons;
500  }
501 
502  void setModifiers( int aMods )
503  {
504  assert( ( aMods & ~MD_MODIFIER_MASK ) == 0 );
505  m_modifiers = aMods;
506  }
507 
519  {
520  #ifdef WX_COMPATIBILITY
521  wxCHECK_MSG( HasPosition(), VECTOR2D(),
522  "Attempted to get position from non-position event" );
523  #else
524  assert( HasPosition() );
525  #endif
526 
527  return aPos;
528  }
529 
536 
539 
543 
546 
549 
552 
555 
558 
560  void* m_param;
561 
564 
567 };
568 
570 
576 {
577 public:
579  typedef std::deque<TOOL_EVENT>::iterator iterator;
580  typedef std::deque<TOOL_EVENT>::const_iterator const_iterator;
581 
584  {}
585 
587  TOOL_EVENT_LIST( const TOOL_EVENT& aSingleEvent )
588  {
589  m_events.push_back( aSingleEvent );
590  }
591 
593  TOOL_EVENT_LIST( const TOOL_EVENT_LIST& aEventList ) = default;
594 
601  const std::string Format() const;
602 
604  {
605  for( const TOOL_EVENT& event : m_events )
606  {
607  if( event.Matches( aEvent ) )
608  return event;
609  }
610 
611  return OPT<const TOOL_EVENT&>();
612  }
613 
619  void Add( const TOOL_EVENT& aEvent )
620  {
621  m_events.push_back( aEvent );
622  }
623 
625  {
626  return m_events.begin();
627  }
628 
630  {
631  return m_events.end();
632  }
633 
635  {
636  return m_events.begin();
637  }
638 
640  {
641  return m_events.end();
642  }
643 
644  int size() const
645  {
646  return m_events.size();
647  }
648 
649  void clear()
650  {
651  m_events.clear();
652  }
653 
655  {
656  m_events.clear();
657 
658  for( const TOOL_EVENT& event : aEventList.m_events )
659  m_events.push_back( event );
660 
661  return *this;
662  }
663 
665  {
666  m_events.clear();
667  m_events.push_back( aEvent );
668  return *this;
669  }
670 
672  {
673  Add( aEvent );
674  return *this;
675  }
676 
678  {
679  std::copy( aEvent.m_events.begin(), aEvent.m_events.end(), std::back_inserter( m_events ) );
680  return *this;
681  }
682 
683 private:
684  std::deque<TOOL_EVENT> m_events;
685 };
686 
687 
688 inline const TOOL_EVENT_LIST operator||( const TOOL_EVENT& aEventA, const TOOL_EVENT& aEventB )
689 {
690  TOOL_EVENT_LIST l;
691 
692  l.Add( aEventA );
693  l.Add( aEventB );
694 
695  return l;
696 }
697 
698 
699 inline const TOOL_EVENT_LIST operator||( const TOOL_EVENT& aEvent,
700  const TOOL_EVENT_LIST& aEventList )
701 {
702  TOOL_EVENT_LIST l( aEventList );
703 
704  l.Add( aEvent );
705  return l;
706 }
707 
708 
709 #endif
int Buttons() const
Definition: tool_event.h:296
bool IsCancel() const
Definition: tool_event.h:326
void setMouseButtons(int aButtons)
Definition: tool_event.h:496
bool m_hasPosition
Definition: tool_event.h:534
OPT< int > GetCommandId() const
Definition: tool_event.h:466
void setModifiers(int aMods)
Definition: tool_event.h:502
bool m_forceImmediate
True when the tool is being re-activated from the stack.
Definition: tool_event.h:535
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:183
void setMouseDelta(const VECTOR2D &aP)
Definition: tool_event.h:491
TOOL_EVENT value_type
Definition: tool_event.h:578
const std::string Format() const
Return information about event in form of a human-readable string.
Definition: tool_event.cpp:76
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:257
bool IsSelectionEvent() const
Indicate an selection-changed notification event.
Definition: tool_event.cpp:203
iterator begin()
Definition: tool_event.h:624
void init()
Definition: tool_event.cpp:54
TOOL_EVENT(TOOL_EVENT_CATEGORY aCategory, TOOL_ACTIONS aAction, int aExtraParam, TOOL_ACTION_SCOPE aScope=AS_GLOBAL, void *aParameter=nullptr)
Definition: tool_event.h:197
OPT< const TOOL_EVENT & > Matches(const TOOL_EVENT &aEvent) const
Definition: tool_event.h:603
Action belongs to a particular tool (i.e. a part of a pop-up menu)
Definition: tool_event.h:149
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:251
int m_modifiers
Generic parameter used for passing non-standard data.
Definition: tool_event.h:557
bool IsClick(int aButtonMask=BUT_ANY) const
Definition: tool_event.cpp:181
bool IsMouseAction() const
Definition: tool_event.h:321
TOOL_ACTIONS m_actions
Definition: tool_event.h:531
TOOL_ACTIONS
Definition: tool_event.h:62
int m_mouseButtons
Stores code of pressed/released key.
Definition: tool_event.h:551
Action is a notification (it is by default passed to all tools)
Definition: tool_event.h:159
bool IsMotion() const
Definition: tool_event.h:316
bool IsKeyPressed() const
Definition: tool_event.h:362
bool ForceImmediate() const
Definition: tool_event.h:266
TOOL_EVENT_CATEGORY Category() const
Returns more specific information about the type of an event.
Definition: tool_event.h:248
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.h:518
OPT< std::string > m_commandStr
Definition: tool_event.h:566
VECTOR2D m_mouseDelta
Current mouse cursor position.
Definition: tool_event.h:542
TOOL_EVENT_CATEGORY
Internal (GUI-independent) event definitions.
Definition: tool_event.h:51
bool IsMoveTool() const
Indicate if the event is from one of the move tools.
Definition: tool_event.cpp:220
TOOL_ACTION_SCOPE
Scope of tool actions.
Definition: tool_event.h:147
int m_keyCode
State of key modifiers (Ctrl/Alt/etc.)
Definition: tool_event.h:554
TOOL_EVENT_LIST & operator=(const TOOL_EVENT &aEvent)
Definition: tool_event.h:664
VECTOR2D m_mouseDragOrigin
State of mouse buttons.
Definition: tool_event.h:548
TOOL_EVENT_LIST & operator||(const TOOL_EVENT_LIST &aEvent)
Definition: tool_event.h:677
void SetReactivate(bool aReactivate=true)
Returns information about difference between current mouse cursor position and the place where draggi...
Definition: tool_event.h:274
OPT< int > m_commandId
Definition: tool_event.h:565
TOOL_ACTION_FLAGS
Flags for tool actions.
Definition: tool_event.h:155
void SetMousePosition(const VECTOR2D &aP)
Definition: tool_event.h:476
bool IsCancelInteractive() const
Indicate the event should restart/end an ongoing interactive tool's event loop (eg esc key,...
Definition: tool_event.cpp:193
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:70
std::deque< TOOL_EVENT > m_events
Definition: tool_event.h:684
TOOL_EVENT_LIST()
Constructor for a list containing only one TOOL_EVENT.
Definition: tool_event.h:583
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:229
Master controller class:
Definition: tool_manager.h:52
void SetParameter(T aParam)
Set a non-standard parameter assigned to the event.
Definition: tool_event.h:461
bool m_passEvent
Definition: tool_event.h:533
Action activates a tool.
Definition: tool_event.h:158
bool IsSimulator() const
Indicate if the event is from the simulator.
Definition: tool_event.cpp:227
A list of TOOL_EVENTs, with overloaded || operators allowing for concatenating TOOL_EVENTs with littl...
Definition: tool_event.h:575
bool IsDrag(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:306
All active tools.
Definition: tool_event.h:150
const VECTOR2D Delta() const
Returns mouse cursor position in world coordinates.
Definition: tool_event.h:278
VECTOR2< double > VECTOR2D
Definition: vector2d.h:622
TOOL_ACTION_SCOPE m_scope
Definition: tool_event.h:532
bool IsDblClick(int aButtonMask=BUT_ANY) const
Definition: tool_event.cpp:187
TOOL_EVENT_LIST & operator||(const TOOL_EVENT &aEvent)
Definition: tool_event.h:671
CONTEXT_MENU_TRIGGER
Defines when a context menu is opened.
Definition: tool_event.h:163
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:443
Generic, UI-independent tool event.
Definition: tool_event.h:173
TOOL_EVENT_LIST(const TOOL_EVENT &aSingleEvent)
y Copy an existing TOOL_EVENT_LIST
Definition: tool_event.h:587
bool IsPointEditor() const
Indicate if the event is from one of the point editors.
Definition: tool_event.cpp:211
void SetForceImmediate(bool aForceImmediate=true)
Definition: tool_event.h:267
const VECTOR2D DragOrigin() const
Returns information about mouse buttons state.
Definition: tool_event.h:290
bool Matches(const TOOL_EVENT &aEvent) const
Test whether two events match in terms of category & action or command.
Definition: tool_event.h:373
std::deque< TOOL_EVENT >::const_iterator const_iterator
Default constructor. Creates an empty list.
Definition: tool_event.h:580
bool m_reactivate
Difference between mouse cursor position and the point where dragging event has started.
Definition: tool_event.h:538
Global action (toolbar/main menu event, global shortcut)
Definition: tool_event.h:151
bool IsMouseUp(int aButtonMask=BUT_ANY) const
Definition: tool_event.h:311
const std::string Format() const
Function Format() Returns information about event in form of a human-readable string.
Definition: tool_event.cpp:170
int Modifier(int aMask=MD_MODIFIER_MASK) const
Definition: tool_event.h:352
bool IsPrime() const
Returns information about key modifiers state (Ctrl, Alt, etc.)
Definition: tool_event.h:346
TOOL_MOUSE_BUTTONS
Definition: tool_event.h:128
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:471
const_iterator cend() const
Definition: tool_event.h:639
bool IsActivate() const
Definition: tool_event.h:331
bool IsUndoRedo() const
Definition: tool_event.h:336
bool PassEvent() const
Definition: tool_event.h:256
void Add(const TOOL_EVENT &aEvent)
Add a tool event to the list.
Definition: tool_event.h:619
TOOL_BASE * m_firstResponder
Definition: tool_event.h:563
const_iterator cbegin() const
Definition: tool_event.h:634
int size() const
Definition: tool_event.h:644
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:270
Base abstract interface for all kinds of tools.
Definition: tool_base.h:66
Represent a single user action.
Definition: tool_action.h:49
TOOL_EVENT_LIST & operator=(const TOOL_EVENT_LIST &aEventList)
Definition: tool_event.h:654
bool IsChoiceMenu() const
Definition: tool_event.h:341
void * m_param
The first tool to receive the event.
Definition: tool_event.h:560
boost::optional< T > OPT
Definition: optional.h:7
bool IsReactivate() const
Definition: tool_event.h:273
TOOL_MODIFIERS
Definition: tool_event.h:138
TOOL_BASE * FirstResponder() const
Definition: tool_event.h:269
bool HasPosition() const
Definition: tool_event.h:261
std::deque< TOOL_EVENT >::iterator iterator
Definition: tool_event.h:579
void setMouseDragOrigin(const VECTOR2D &aP)
Definition: tool_event.h:486
int KeyCode() const
Definition: tool_event.h:357
iterator end()
Definition: tool_event.h:629
VECTOR2D m_mousePos
Point where dragging has started.
Definition: tool_event.h:545
const TOOL_EVENT_LIST operator||(const TOOL_EVENT &aEventA, const TOOL_EVENT &aEventB)
Definition: tool_event.h:688
TOOL_EVENT_CATEGORY m_category
Definition: tool_event.h:530
const VECTOR2D Position() const
Returns the point where dragging has started.
Definition: tool_event.h:284
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:262
OPT< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:569