2013-03-15 13:11:33 +00:00
|
|
|
@interface CocoaWindow : NSWindow <NSWindowDelegate> {
|
|
|
|
@public
|
2013-05-02 11:25:45 +00:00
|
|
|
phoenix::Window* window;
|
|
|
|
NSMenu* menuBar;
|
|
|
|
NSMenu* rootMenu;
|
|
|
|
NSTextField* statusBar;
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|
2013-03-21 12:59:01 +00:00
|
|
|
-(id) initWith:(phoenix::Window&)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;
|
|
|
|
-(void) menuQuit;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(NSTextField*) statusBar;
|
2013-03-15 13:11:33 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
namespace phoenix {
|
|
|
|
|
|
|
|
struct pWindow : public pObject {
|
2013-05-02 11:25:45 +00:00
|
|
|
Window& window;
|
|
|
|
CocoaWindow* cocoaWindow = nullptr;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
|
|
|
static Window& none();
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
void append(Layout& layout);
|
|
|
|
void append(Menu& menu);
|
|
|
|
void append(Widget& widget);
|
2013-03-15 13:11:33 +00:00
|
|
|
bool focused();
|
|
|
|
Geometry frameMargin();
|
|
|
|
Geometry geometry();
|
2013-05-02 11:25:45 +00:00
|
|
|
void remove(Layout& layout);
|
|
|
|
void remove(Menu& menu);
|
|
|
|
void remove(Widget& widget);
|
2013-07-29 09:42:45 +00:00
|
|
|
void setBackgroundColor(Color color);
|
|
|
|
void setDroppable(bool droppable);
|
2013-03-15 13:11:33 +00:00
|
|
|
void setFocused();
|
|
|
|
void setFullScreen(bool fullScreen);
|
2013-07-29 09:42:45 +00:00
|
|
|
void setGeometry(Geometry geometry);
|
|
|
|
void setMenuFont(string font);
|
2013-03-15 13:11:33 +00:00
|
|
|
void setMenuVisible(bool visible);
|
|
|
|
void setModal(bool modal);
|
|
|
|
void setResizable(bool resizable);
|
2013-07-29 09:42:45 +00:00
|
|
|
void setStatusFont(string font);
|
|
|
|
void setStatusText(string text);
|
2013-03-15 13:11:33 +00:00
|
|
|
void setStatusVisible(bool visible);
|
2013-07-29 09:42:45 +00:00
|
|
|
void setTitle(string text);
|
2013-03-15 13:11:33 +00:00
|
|
|
void setVisible(bool visible);
|
2013-07-29 09:42:45 +00:00
|
|
|
void setWidgetFont(string font);
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
pWindow(Window& window) : pObject(window), window(window) {}
|
2013-03-15 13:11:33 +00:00
|
|
|
void constructor();
|
|
|
|
void destructor();
|
|
|
|
void moveEvent();
|
|
|
|
void sizeEvent();
|
2013-03-21 12:59:01 +00:00
|
|
|
unsigned statusBarHeight();
|
|
|
|
void statusBarReposition();
|
2013-03-15 13:11:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|