-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathDYImageView.h
54 lines (44 loc) · 1.49 KB
/
DYImageView.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
//Copyright 2005-2023 Dominic Yu. Some rights reserved.
//This work is licensed under the Creative Commons
//Attribution-NonCommercial-ShareAlike License. To view a copy of this
//license, visit http://creativecommons.org/licenses/by-nc-sa/2.0/ or send
//a letter to Creative Commons, 559 Nathan Abbott Way, Stanford,
//California 94305, USA.
// Created by d on 2005.04.01.
@import Cocoa;
@interface DYImageViewZoomInfo : NSObject {
@public
NSRect sourceRect;
NSSize destSize;
float zoomF;
}
@end
typedef NS_ENUM(char, DYImageViewZoomMode) {
DYImageViewZoomModeZoomOut,
DYImageViewZoomModeZoomIn,
DYImageViewZoomModeActualSize,
DYImageViewZoomModeManual,
};
@interface DYImageView : NSView
@property (nonatomic) NSImage *image;
@property (nonatomic) id webpImageSource; // CGImageSourceRef
@property (nonatomic) int rotation;
@property (nonatomic) BOOL scalesUp;
@property (nonatomic) BOOL showActualSize;
@property (nonatomic, getter=isImageFlipped) BOOL imageFlipped;
@property (nonatomic, readonly) float zoomF;
- (void)setImage:(NSImage *)anImage zooming:(DYImageViewZoomMode)zoomMode;
- (int)addRotation:(int)r;
- (BOOL)toggleFlip;
- (void)zoomOff;
- (void)zoomActualSize;
- (void)zoomIn;
- (void)zoomOut;
- (void)setZoomF:(float)f;
- (void)fakeDragX:(float)x y:(float)y;
@property (nonatomic, readonly) BOOL zoomMode;
@property (nonatomic, readonly) BOOL zoomInfoNeedsSaving;
@property (nonatomic, readonly) BOOL dragMode;
- (void)setCursor;
@property (nonatomic) DYImageViewZoomInfo *zoomInfo;
@end