Gnash  0.8.11dev
MouseButtonState.h
Go to the documentation of this file.
1 // Thatcher Ulrich <tu@tulrich.com> 2003
2 
3 // This source code has been donated to the Public Domain. Do
4 // whatever you want with it.
5 
6 
7 #ifndef GNASH_MOUSE_BUTTON_STATE_H
8 #define GNASH_MOUSE_BUTTON_STATE_H
9 
10 #include "InteractiveObject.h"
11 
12 // Forward declarations
13 namespace gnash {
14  class MovieClip;
15 }
16 
17 namespace gnash {
18 
21 {
22 
23 public:
24 
27 
30 
32  bool wasDown;
33 
35  bool isDown;
36 
39 
41  :
42  activeEntity(nullptr),
43  topmostEntity(nullptr),
44  wasDown(false),
45  isDown(false),
46  wasInsideActiveEntity(false)
47  {
48  }
49 
51  void markReachableResources() const {
52  if (activeEntity) activeEntity->setReachable();
53  if (topmostEntity) topmostEntity->setReachable();
54  }
55 };
56 
57 } // end namespace gnash
58 
59 
60 #endif // GNASH_MOUSE_BUTTON_STATE_H
61 
62 
63 // Local Variables:
64 // mode: C++
65 // c-basic-offset: 8
66 // tab-width: 8
67 // indent-tabs-mode: nil
68 // End:
bool wasDown
previous state of mouse button
Definition: MouseButtonState.h:32
void setReachable() const
Mark this resource as being reachable.
Definition: GC.h:92
bool isDown
current state of mouse button
Definition: MouseButtonState.h:35
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
InteractiveObject * topmostEntity
what&#39;s underneath the mouse right now
Definition: MouseButtonState.h:29
bool wasInsideActiveEntity
whether mouse was inside the active_entity last frame
Definition: MouseButtonState.h:38
MouseButtonState()
Definition: MouseButtonState.h:40
The base class for interactive objects.
Definition: InteractiveObject.h:44
InteractiveObject * activeEntity
entity that currently owns the mouse pointer
Definition: MouseButtonState.h:26
void markReachableResources() const
Mark reachable objects (active and topmost entities)
Definition: MouseButtonState.h:51
Helper to generate mouse events, given mouse state & history.
Definition: MouseButtonState.h:20