2015-12-30 06:41:46 +00:00
|
|
|
#if defined(Hiro_Canvas)
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
@interface CocoaCanvas : NSImageView {
|
|
|
|
@public
|
2015-12-30 06:41:46 +00:00
|
|
|
hiro::mCanvas* canvas;
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
-(id) initWith:(hiro::mCanvas&)canvas;
|
2013-07-29 09:42:45 +00:00
|
|
|
-(NSDragOperation) draggingEntered:(id<NSDraggingInfo>)sender;
|
|
|
|
-(BOOL) performDragOperation:(id<NSDraggingInfo>)sender;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(void) mouseButton:(NSEvent*)event down:(BOOL)isDown;
|
|
|
|
-(void) mouseExited:(NSEvent*)event;
|
|
|
|
-(void) mouseMove:(NSEvent*)event;
|
|
|
|
-(void) mouseDown:(NSEvent*)event;
|
|
|
|
-(void) mouseUp:(NSEvent*)event;
|
|
|
|
-(void) mouseDragged:(NSEvent*)event;
|
|
|
|
-(void) rightMouseDown:(NSEvent*)event;
|
|
|
|
-(void) rightMouseUp:(NSEvent*)event;
|
|
|
|
-(void) rightMouseDragged:(NSEvent*)event;
|
|
|
|
-(void) otherMouseDown:(NSEvent*)event;
|
|
|
|
-(void) otherMouseUp:(NSEvent*)event;
|
|
|
|
-(void) otherMouseDragged:(NSEvent*)event;
|
2013-03-15 13:11:33 +00:00
|
|
|
@end
|
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
namespace hiro {
|
|
|
|
|
|
|
|
struct pCanvas : pWidget {
|
|
|
|
Declare(Canvas, Widget)
|
|
|
|
|
|
|
|
auto minimumSize() const -> Size;
|
|
|
|
auto setColor(Color color) -> void;
|
|
|
|
auto setDroppable(bool droppable) -> void;
|
|
|
|
auto setGeometry(Geometry geometry) -> void override;
|
|
|
|
auto setGradient(Gradient gradient) -> void;
|
|
|
|
auto setImage(const Image& image) -> void;
|
|
|
|
auto update() -> void;
|
|
|
|
|
|
|
|
auto _rasterize() -> void;
|
|
|
|
auto _redraw() -> void;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
CocoaCanvas* cocoaCanvas = nullptr;
|
2015-12-30 06:41:46 +00:00
|
|
|
uint surfaceWidth = 0;
|
|
|
|
uint surfaceHeight = 0;
|
2013-03-15 13:11:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
|
|
|
|
#endif
|