-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathGCUndoTestView.h
44 lines (32 loc) · 867 Bytes
/
GCUndoTestView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// GCUndoTestView.h
// GCDrawKit
//
// Created by graham on 5/12/09.
// Copyright 2009-2011 Apptree.net. All rights reserved.
//
#import <Cocoa/Cocoa.h>
// n.b for simplicty this includes a very crude data model of a draggable/resizeable box. This is not a good example of MVC separation, as
// the purpose of it is merely to allow testing of the undo manager code.
@interface GCUndoTestView : NSView
{
NSRect draggedBox;
NSPoint mouseOffset;
NSInteger hit;
NSColor* dragBoxColour;
}
// undoable properties
- (void) setDraggedBoxPosition:(NSPoint) p;
- (NSPoint) draggedBoxPosition;
- (void) setDraggedBoxSize:(NSSize) size;
- (NSSize) draggedBoxSize;
- (void) setDraggedBoxColour:(NSColor*) aColour;
- (NSColor*) draggedBoxColour;
- (NSInteger) hitTestBox:(NSPoint) p;
@end
enum
{
kNoHit = 0,
kHitForMove = 1,
kHitForSize = 2
};