Gnash
0.8.11dev
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
libcore
DragState.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3
// Free Software Foundation, Inc
4
//
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
14
//
15
// You should have received a copy of the GNU General Public License
16
// along with this program; if not, write to the Free Software
17
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19
#ifndef GNASH_DRAG_STATE_H
20
#define GNASH_DRAG_STATE_H
21
22
#include <boost/optional.hpp>
23
24
#include "
SWFRect.h
"
25
#include "
DisplayObject.h
"
26
27
// Forward declarations
28
namespace
gnash {
29
class
DisplayObject;
30
}
31
32
namespace
gnash {
33
35
class
DragState
36
{
37
public
:
38
39
DragState
(
DisplayObject
*
d
,
bool
lock)
40
:
41
_displayObject(d),
42
_lock_centered(lock)
43
{
44
}
45
46
bool
isLockCentered
()
const
{
47
return
_lock_centered;
48
}
49
54
void
setOffset
(boost::int32_t
x
, boost::int32_t
y
) {
55
_xoffset =
x
;
56
_yoffset =
y
;
57
}
58
59
boost::int32_t
xOffset
()
const
{
return
_xoffset; }
60
boost::int32_t
yOffset
()
const
{
return
_yoffset; }
61
62
bool
hasBounds
()
const
{
63
return
(_bounds);
64
}
65
69
//
77
const
SWFRect
&
getBounds
()
const
{
return
*_bounds; }
78
82
//
86
void
setBounds
(
const
SWFRect
& bounds) {
87
_bounds = bounds;
88
}
89
91
DisplayObject
*
getCharacter
()
const
{
92
return
_displayObject;
93
}
94
96
void
reset
() {
97
_displayObject = 0;
98
_bounds.reset();
99
_lock_centered =
false
;
100
}
101
103
void
markReachableResources
()
const
{
104
if
(_displayObject) _displayObject->
setReachable
();
105
}
106
107
private
:
108
111
boost::optional<SWFRect> _bounds;
112
113
DisplayObject
* _displayObject;
114
115
bool
_lock_centered;
116
121
boost::int32_t _xoffset;
122
boost::int32_t _yoffset;
123
124
};
125
126
127
}
// namespace gnash
128
129
#endif // GNASH_DRAG_STATE_H
Generated on Tue Jan 28 2014 17:18:06 for Gnash by
1.8.4