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
19 /// Helper to generate mouse events, given mouse state & history.
20 struct MouseButtonState
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
34 /// current state of mouse button
37 /// whether mouse was inside the active_entity last frame
38 bool wasInsideActiveEntity
;
42 activeEntity(nullptr),
43 topmostEntity(nullptr),
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
67 // indent-tabs-mode: nil