Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GNASH_DRAG_STATE_H
00022 #define GNASH_DRAG_STATE_H
00023
00024 #include "SWFRect.h"
00025
00026 namespace gnash
00027 {
00028
00029
00030 class DisplayObject;
00031
00032
00034 class drag_state
00035 {
00036
00037 bool _hasbounds;
00038
00041 SWFRect _bounds;
00042
00043 DisplayObject* _displayObject;
00044
00045 bool _lock_centered;
00046
00051 boost::int32_t _xoffset;
00052 boost::int32_t _yoffset;
00053
00054 public:
00055
00056 bool isLockCentered() const {
00057 return _lock_centered;
00058 }
00059
00060 void setLockCentered(bool lock) {
00061 _lock_centered = lock;
00062 }
00063
00068 void setOffset(boost::int32_t x, boost::int32_t y)
00069 {
00070 _xoffset = x;
00071 _yoffset = y;
00072 }
00073
00074 boost::int32_t xOffset() const { return _xoffset; }
00075 boost::int32_t yOffset() const { return _yoffset; }
00076
00077 bool hasBounds() const {return _hasbounds; }
00078
00082
00090 const SWFRect& getBounds() const { return _bounds; }
00091
00095
00099 void setBounds(const SWFRect& bounds) {
00100 _bounds = bounds;
00101 _hasbounds = true;
00102 }
00103
00105 DisplayObject* getCharacter() const {
00106 return _displayObject;
00107 }
00108
00110 void setCharacter(DisplayObject* ch) {
00111 _displayObject = ch;
00112 }
00113
00115 void reset()
00116 {
00117 _displayObject = NULL;
00118 _hasbounds = false;
00119 _bounds.set_null();
00120 _lock_centered = false;
00121 }
00122
00123 drag_state()
00124 :
00125 _hasbounds(false),
00126 _bounds(),
00127 _displayObject(0),
00128 _lock_centered(false)
00129 {
00130 }
00131
00133 void markReachableResources() const
00134 {
00135 if (_displayObject) _displayObject->setReachable();
00136 }
00137 };
00138
00139
00140 }
00141
00142 #endif // GNASH_DRAG_STATE_H