]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/toplevel.h
wxCocoa: Added preliminary Blit support
[wxWidgets.git] / include / wx / cocoa / toplevel.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/toplevel.h
3 // Purpose: wxTopLevelWindowCocoa is the Cocoa implementation of wxTLW
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2002/12/08
7 // RCS-ID: $Id:
8 // Copyright: (c) 2002 David Elliott
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __WX_COCOA_TOPLEVEL_H__
13 #define __WX_COCOA_TOPLEVEL_H__
14
15 #include "wx/hashmap.h"
16 #include "wx/cocoa/NSWindow.h"
17
18 // ========================================================================
19 // wxTopLevelWindowCocoa
20 // ========================================================================
21 class WXDLLEXPORT wxTopLevelWindowCocoa : public wxTopLevelWindowBase, protected wxCocoaNSWindow
22 {
23 DECLARE_EVENT_TABLE();
24 DECLARE_NO_COPY_CLASS(wxTopLevelWindowCocoa);
25 // ------------------------------------------------------------------------
26 // initialization
27 // ------------------------------------------------------------------------
28 public:
29 inline wxTopLevelWindowCocoa() { Init(); }
30
31 inline wxTopLevelWindowCocoa(wxWindow *parent,
32 wxWindowID winid,
33 const wxString& title,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = wxDEFAULT_FRAME_STYLE,
37 const wxString& name = wxFrameNameStr)
38 {
39 Init();
40 Create(parent, winid, title, pos, size, style, name);
41 }
42
43 bool Create(wxWindow *parent,
44 wxWindowID winid,
45 const wxString& title,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = wxDEFAULT_FRAME_STYLE,
49 const wxString& name = wxFrameNameStr);
50
51 virtual ~wxTopLevelWindowCocoa();
52
53 protected:
54 // common part of all ctors
55 void Init();
56
57 // ------------------------------------------------------------------------
58 // Cocoa specifics
59 // ------------------------------------------------------------------------
60 public:
61 inline WX_NSWindow GetNSWindow() { return m_cocoaNSWindow; }
62 virtual void Cocoa_close(void);
63 virtual bool Cocoa_windowShouldClose(void);
64 virtual void Cocoa_wxMenuItemAction(wxMenuItem& item);
65 protected:
66 void SetNSWindow(WX_NSWindow cocoaNSWindow);
67 WX_NSWindow m_cocoaNSWindow;
68 static wxCocoaNSWindowHash sm_cocoaHash;
69
70 // ------------------------------------------------------------------------
71 // Implementation
72 // ------------------------------------------------------------------------
73 public:
74 // Pure virtuals
75 virtual void Maximize(bool maximize = true);
76 virtual bool IsMaximized() const;
77 virtual void Iconize(bool iconize = true);
78 virtual bool IsIconized() const;
79 virtual void Restore();
80 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
81 virtual bool IsFullScreen() const;
82 // other
83 virtual bool Show( bool show = true );
84 virtual bool Close( bool force = false );
85 virtual void OnCloseWindow(wxCloseEvent& event);
86 virtual void DoMoveWindow(int x, int y, int width, int height);
87 virtual void DoGetSize(int *width, int *height) const;
88 virtual void DoGetPosition(int *x, int *y) const;
89
90
91 // Things I may/may not do
92 // virtual void SetIcon(const wxIcon& icon);
93 // virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
94 // virtual void Clear() ;
95 // virtual void Raise();
96 // virtual void Lower();
97 // virtual void SetTitle( const wxString& title);
98 protected:
99 // is the frame currently iconized?
100 bool m_iconized;
101 // has the frame been closed
102 bool m_closed;
103 // should the frame be maximized when it will be shown? set by Maximize()
104 // when it is called while the frame is hidden
105 bool m_maximizeOnShow;
106 };
107
108 // list of all frames and modeless dialogs
109 extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
110
111 #endif // __WX_COCOA_TOPLEVEL_H__