2
* Copyright (C) 2011 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
19
#include "unity-mt-grab-handle.h"
20
#include "unity-mt-grab-handle-group.h"
21
#include "unity-mt-grab-handle-window.h"
22
#include "unity-mt-texture.h"
23
#include "unity-mt-grab-handle-impl-factory.h"
26
unity::MT::GrabHandle::buttonPress (int x,
28
unsigned int button) const
30
mImpl->buttonPress (x, y, button);
34
unity::MT::GrabHandle::requestMovement (int x,
36
unsigned int button) const
38
unity::MT::GrabHandleGroup::Ptr ghg = mOwner.lock ();
39
ghg->requestMovement (x, y, (maskHandles.find (mId))->second, button);
43
unity::MT::GrabHandle::show ()
49
unity::MT::GrabHandle::hide ()
55
unity::MT::GrabHandle::raise () const
57
unity::MT::GrabHandleGroup::Ptr ghg = mOwner.lock ();
58
boost::shared_ptr <const unity::MT::GrabHandle> gh = shared_from_this ();
59
ghg->raiseHandle (gh);
63
unity::MT::GrabHandle::reposition(int x,
69
if (flags & PositionSet)
75
if (flags & PositionLock)
77
mImpl->lockPosition (x, y, flags);
84
unity::MT::GrabHandle::reposition(int x, int y, unsigned int flags) const
86
if (flags & PositionLock)
88
mImpl->lockPosition (x, y, flags);
92
unity::MT::TextureLayout
93
unity::MT::GrabHandle::layout()
95
return TextureLayout(mTexture, mRect);
98
unity::MT::GrabHandle::GrabHandle(Texture::Ptr texture,
101
const boost::shared_ptr <GrabHandleGroup> &owner,
106
mRect (0, 0, width, height),
111
unity::MT::GrabHandle::Ptr
112
unity::MT::GrabHandle::create (Texture::Ptr texture, unsigned int width, unsigned int height,
113
const boost::shared_ptr <GrabHandleGroup> &owner,
116
unity::MT::GrabHandle::Ptr p (new unity::MT::GrabHandle (texture, width, height, owner, id));
117
p->mImpl = unity::MT::GrabHandle::ImplFactory::Default ()->create (p);
122
unity::MT::GrabHandle::~GrabHandle()