2015-12-30 06:41:46 +00:00
|
|
|
#if defined(Hiro_Window)
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
@interface CocoaWindow : NSWindow <NSWindowDelegate> {
|
|
|
|
@public
|
2015-12-30 06:41:46 +00:00
|
|
|
hiro::mWindow* window;
|
2013-05-02 11:25:45 +00:00
|
|
|
NSMenu* menuBar;
|
|
|
|
NSMenu* rootMenu;
|
2016-01-08 09:23:46 +00:00
|
|
|
NSMenuItem* disableGatekeeperAutoRearm;
|
2013-05-02 11:25:45 +00:00
|
|
|
NSTextField* statusBar;
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
-(id) initWith:(hiro::mWindow&)window;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(BOOL) canBecomeKeyWindow;
|
|
|
|
-(BOOL) canBecomeMainWindow;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(void) windowDidBecomeMain:(NSNotification*)notification;
|
|
|
|
-(void) windowDidMove:(NSNotification*)notification;
|
|
|
|
-(void) windowDidResize:(NSNotification*)notification;
|
|
|
|
-(BOOL) windowShouldClose:(id)sender;
|
2013-07-29 09:42:45 +00:00
|
|
|
-(NSDragOperation) draggingEntered:(id<NSDraggingInfo>)sender;
|
|
|
|
-(BOOL) performDragOperation:(id<NSDraggingInfo>)sender;
|
2013-03-19 08:48:50 +00:00
|
|
|
-(NSMenu*) menuBar;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(void) menuAbout;
|
|
|
|
-(void) menuPreferences;
|
2016-01-08 09:23:46 +00:00
|
|
|
-(void) menuDisableGatekeeperAutoRearm;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(void) menuQuit;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(NSTextField*) statusBar;
|
2013-03-15 13:11:33 +00:00
|
|
|
@end
|
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
namespace hiro {
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
struct pWindow : pObject {
|
|
|
|
Declare(Window, Object)
|
|
|
|
|
|
|
|
auto append(sLayout layout) -> void;
|
|
|
|
auto append(sMenuBar menuBar) -> void;
|
|
|
|
auto append(sStatusBar statusBar) -> void;
|
|
|
|
auto focused() const -> bool override;
|
|
|
|
auto frameMargin() const -> Geometry;
|
|
|
|
auto remove(sLayout layout) -> void;
|
|
|
|
auto remove(sMenuBar menuBar) -> void;
|
|
|
|
auto remove(sStatusBar statusBar) -> void;
|
|
|
|
auto setBackgroundColor(Color color) -> void;
|
|
|
|
auto setDroppable(bool droppable) -> void;
|
|
|
|
auto setFocused() -> void override;
|
|
|
|
auto setFullScreen(bool fullScreen) -> void;
|
|
|
|
auto setGeometry(Geometry geometry) -> void;
|
|
|
|
auto setModal(bool modal) -> void;
|
|
|
|
auto setResizable(bool resizable) -> void;
|
|
|
|
auto setTitle(const string& text) -> void;
|
|
|
|
auto setVisible(bool visible) -> void;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
auto moveEvent() -> void;
|
|
|
|
auto sizeEvent() -> void;
|
|
|
|
auto statusBarHeight() -> uint;
|
|
|
|
auto statusBarReposition() -> void;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
auto _append(mWidget& widget) -> void;
|
2016-01-08 09:23:46 +00:00
|
|
|
auto _geometry() -> Geometry;
|
2015-12-30 06:41:46 +00:00
|
|
|
|
|
|
|
CocoaWindow* cocoaWindow = nullptr;
|
2016-01-08 09:23:46 +00:00
|
|
|
Geometry windowedGeometry;
|
2013-03-15 13:11:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
|
|
|
|
#endif
|