forked from adlr/formulatepro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FPGraphic.h
101 lines (88 loc) · 2.77 KB
/
FPGraphic.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
// FPGraphic.h
// FormulatePro
//
// Created by Andrew de los Reyes on 7/5/06.
// Copyright 2006 Andrew de los Reyes. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "FPDocumentView.h"
#import "FPLogging.h"
@class MyPDFView;
@class PDFPage;
enum {
NoKnob = 0,
UpperLeftKnob = 1 << 0,
UpperMiddleKnob = 1 << 1,
UpperRightKnob = 1 << 2,
MiddleLeftKnob = 1 << 3,
MiddleRightKnob = 1 << 4,
LowerLeftKnob = 1 << 5,
LowerMiddleKnob = 1 << 6,
LowerRightKnob = 1 << 7,
};
@interface FPGraphic : NSObject {
NSRect _bounds;
NSRect _naturalBounds;
NSRect _origBounds; // for bulk move operations
struct __gFlags {
unsigned int drawsFill:1;
unsigned int drawsStroke:1;
unsigned int manipulatingBounds:1;
unsigned int horizontallyFlipped:1;
unsigned int verticallyFlipped:1;
unsigned int hidesWhenPrinting:1;
unsigned int _pad:26;
} _gFlags;
float _strokeWidth;
NSColor *_fillColor; // STRONG
NSColor *_strokeColor; // STRONG
int _knobMask;
FPDocumentView *_docView;
BOOL _hasPage;
unsigned int _page;
}
- (id)copyWithZone:(NSZone *)zone;
+ (FPGraphic *)graphicInDocumentView:(FPDocumentView *)docView;
- (id)initWithGraphic:(FPGraphic *)graphic;
- (id)initInDocumentView:(FPDocumentView *)docView;
+ (FPGraphic *)graphicFromArchivalDictionary:(NSDictionary *)dict
inDocumentView:(FPDocumentView *)docView;
- (id)initWithArchivalDictionary:(NSDictionary *)dict
inDocumentView:(FPDocumentView *)docView;
+ (NSString *)archivalClassName;
- (NSDictionary *)archivalDictionary;
- (BOOL)placeWithEvent:(NSEvent *)theEvent;
- (void)resizeWithEvent:(NSEvent *)theEvent byKnob:(int)knob;
- (void)moveGraphicByX:(float)x byY:(float)y;
- (void)reassignToPage:(unsigned int)page;
- (void)documentDidZoom;
- (unsigned int)page;
- (void)draw:(BOOL)selected;
- (void)drawKnobs;
- (int)knobForEvent:(NSEvent *)theEvent;
- (NSRect)pageRectForKnob:(int)knob isBoundRect:(BOOL)isBound;
- (BOOL)drawsStroke;
- (void)setDrawsStroke:(BOOL)drawsStroke;
- (NSRect)bounds;
- (void)setBounds:(NSRect)bounds;
- (NSRect)safeBounds;
- (NSRect)boundsWithKnobs;
- (float)strokeWidth;
- (void)setStrokeWidth:(float)strokeWidth;
- (NSColor *)strokeColor;
- (void)setStrokeColor:(NSColor *)strokeColor;
- (BOOL)drawsFill;
- (void)setDrawsFill:(BOOL)drawsFill;
- (NSColor *)fillColor;
- (void)setFillColor:(NSColor *)fillColor;
- (BOOL)isHorizontallyFlipped;
- (void)setIsHorizontallyFlipped:(BOOL)isHorizontallyFlipped;
- (BOOL)isVerticallyFlipped;
- (void)setIsVerticallyFlipped:(BOOL)isVerticallyFlipped;
- (BOOL)hidesWhenPrinting;
- (void)setHidesWhenPrinting:(BOOL)hidesWhenPrinting;
- (BOOL)isEditable;
- (void)startEditing;
- (void)stopEditing;
@end