1/*
2 * Copyright 2006-2009, 2023, Haiku.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Stephan A��mus <superstippi@gmx.de>
7 *		Zardshard
8 */
9
10#include "PerspectiveBoxStates.h"
11
12#include <Cursor.h>
13#include <View.h>
14
15#include "cursors.h"
16#include "PerspectiveBox.h"
17
18
19using namespace PerspectiveBoxStates;
20
21
22DragState::DragState(PerspectiveBox* parent)
23	:
24	fOrigin(0.0, 0.0),
25	fParent(parent)
26{
27}
28
29
30void
31DragState::_SetViewCursor(BView* view, const uchar* cursorData) const
32{
33	BCursor cursor(cursorData);
34	view->SetViewCursor(&cursor);
35}
36
37
38// #pragma mark - DragCornerState
39
40
41DragCornerState::DragCornerState(PerspectiveBox* parent, BPoint* point)
42	:
43	DragState(parent),
44	fPoint(point)
45{
46}
47
48
49void
50DragCornerState::SetOrigin(BPoint origin)
51{
52	DragState::SetOrigin(origin);
53}
54
55
56void
57DragCornerState::DragTo(BPoint current, uint32 modifiers)
58{
59	*fPoint = current;
60	fParent->Update(true);
61}
62
63
64void
65DragCornerState::UpdateViewCursor(BView* view, BPoint current) const
66{
67	_SetViewCursor(view, kPathMoveCursor);
68}
69