viewport.hpp 701 B

1234567891011121314151617181920212223242526272829303132
  1. #if defined(Hiro_Viewport)
  2. @interface CocoaViewport : NSView {
  3. @public
  4. hiro::mViewport* viewport;
  5. }
  6. -(id) initWith:(hiro::mViewport&)viewport;
  7. -(void) resetCursorRects;
  8. -(void) drawRect:(NSRect)rect;
  9. -(BOOL) acceptsFirstResponder;
  10. -(NSDragOperation) draggingEntered:(id<NSDraggingInfo>)sender;
  11. -(BOOL) performDragOperation:(id<NSDraggingInfo>)sender;
  12. -(void) keyDown:(NSEvent*)event;
  13. -(void) keyUp:(NSEvent*)event;
  14. @end
  15. namespace hiro {
  16. struct pViewport : pWidget {
  17. Declare(Viewport, Widget)
  18. auto handle() const -> uintptr_t;
  19. auto setDroppable(bool droppable) -> void override;
  20. auto setFocusable(bool focusable) -> void override;
  21. CocoaViewport* cocoaViewport = nullptr;
  22. };
  23. }
  24. #endif