Make automated FSCommand invocation tests show player-side output.
[gnash.git] / libcore / MouseButtonState.h
blob87ead62298a085491d763c48532421ba22098a11
1 // Thatcher Ulrich <tu@tulrich.com> 2003
3 // This source code has been donated to the Public Domain. Do
4 // whatever you want with it.
7 #ifndef GNASH_MOUSE_BUTTON_STATE_H
8 #define GNASH_MOUSE_BUTTON_STATE_H
10 #include "InteractiveObject.h"
12 // Forward declarations
13 namespace gnash {
14 class MovieClip;
17 namespace gnash {
19 /// Helper to generate mouse events, given mouse state & history.
20 struct MouseButtonState
23 public:
25 /// entity that currently owns the mouse pointer
26 InteractiveObject* activeEntity;
28 /// what's underneath the mouse right now
29 InteractiveObject* topmostEntity;
31 /// previous state of mouse button
32 bool wasDown;
34 /// current state of mouse button
35 bool isDown;
37 /// whether mouse was inside the active_entity last frame
38 bool wasInsideActiveEntity;
40 MouseButtonState()
42 activeEntity(nullptr),
43 topmostEntity(nullptr),
44 wasDown(false),
45 isDown(false),
46 wasInsideActiveEntity(false)
50 /// Mark reachable objects (active and topmost entities)
51 void markReachableResources() const {
52 if (activeEntity) activeEntity->setReachable();
53 if (topmostEntity) topmostEntity->setReachable();
57 } // end namespace gnash
60 #endif // GNASH_MOUSE_BUTTON_STATE_H
63 // Local Variables:
64 // mode: C++
65 // c-basic-offset: 8
66 // tab-width: 8
67 // indent-tabs-mode: nil
68 // End: