]>
Commit | Line | Data |
---|---|---|
8cf73271 SC |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/mac/toplevel.h | |
3 | // Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 20.09.01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2001 Stefan Csomor | |
65571936 | 9 | // Licence: wxWindows licence |
8cf73271 SC |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_MSW_TOPLEVEL_H_ | |
13 | #define _WX_MSW_TOPLEVEL_H_ | |
14 | ||
15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
16 | #pragma interface "toplevel.h" | |
17 | #endif | |
18 | ||
19 | #if wxUSE_SYSTEM_OPTIONS | |
20 | #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition") | |
21 | #endif | |
22 | ||
23 | // ---------------------------------------------------------------------------- | |
24 | // wxTopLevelWindowMac | |
25 | // ---------------------------------------------------------------------------- | |
26 | ||
27 | class WXDLLEXPORT wxTopLevelWindowMac : public wxTopLevelWindowBase | |
28 | { | |
29 | public: | |
30 | // constructors and such | |
31 | wxTopLevelWindowMac() { Init(); } | |
32 | ||
33 | wxTopLevelWindowMac(wxWindow *parent, | |
34 | wxWindowID id, | |
35 | const wxString& title, | |
36 | const wxPoint& pos = wxDefaultPosition, | |
37 | const wxSize& size = wxDefaultSize, | |
38 | long style = wxDEFAULT_FRAME_STYLE, | |
39 | const wxString& name = wxFrameNameStr) | |
40 | { | |
41 | Init(); | |
42 | ||
43 | (void)Create(parent, id, title, pos, size, style, name); | |
44 | } | |
45 | ||
46 | bool Create(wxWindow *parent, | |
47 | wxWindowID id, | |
48 | const wxString& title, | |
49 | const wxPoint& pos = wxDefaultPosition, | |
50 | const wxSize& size = wxDefaultSize, | |
51 | long style = wxDEFAULT_FRAME_STYLE, | |
52 | const wxString& name = wxFrameNameStr); | |
53 | ||
54 | virtual ~wxTopLevelWindowMac(); | |
55 | ||
4f305456 SC |
56 | virtual wxPoint GetClientAreaOrigin() const; |
57 | ||
3feeb1e1 SC |
58 | // Attracts the users attention to this window if the application is |
59 | // inactive (should be called when a background event occurs) | |
60 | virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO); | |
61 | ||
8cf73271 SC |
62 | // implement base class pure virtuals |
63 | virtual void Maximize(bool maximize = TRUE); | |
64 | virtual bool IsMaximized() const; | |
65 | virtual void Iconize(bool iconize = TRUE); | |
66 | virtual bool IsIconized() const; | |
67 | virtual void SetIcon(const wxIcon& icon); | |
68 | virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); } | |
69 | virtual void Restore(); | |
70 | ||
71 | virtual bool SetShape(const wxRegion& region); | |
72 | ||
2fa2b08e SC |
73 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) ; |
74 | virtual bool IsFullScreen() const ; | |
8cf73271 SC |
75 | |
76 | // implementation from now on | |
77 | // -------------------------- | |
78 | ||
79 | static void MacDelayedDeactivation(long timestamp); | |
80 | virtual void MacCreateRealWindow( const wxString& title, | |
81 | const wxPoint& pos, | |
82 | const wxSize& size, | |
83 | long style, | |
84 | const wxString& name ) ; | |
8cf73271 | 85 | virtual void ClearBackground() ; |
4f305456 | 86 | |
8cf73271 SC |
87 | WXWindow MacGetWindowRef() { return m_macWindow ; } |
88 | virtual void MacActivate( long timestamp , bool inIsActivating ) ; | |
92346151 | 89 | virtual void MacPerformUpdates() ; |
4f305456 | 90 | |
8cf73271 SC |
91 | virtual void Raise(); |
92 | virtual void Lower(); | |
93 | virtual void SetTitle( const wxString& title); | |
94 | virtual bool Show( bool show = TRUE ); | |
4f305456 SC |
95 | |
96 | virtual void MacSetBackgroundBrush( const wxBrush &brush ) ; | |
97 | ||
8cf73271 | 98 | bool MacUsesCompositing() { return m_macUsesCompositing; } |
aa4d3151 | 99 | virtual void MacInstallTopLevelWindowEventHandler() ; |
8cf73271 | 100 | |
4f305456 | 101 | void MacSetMetalAppearance( bool on ) ; |
5171553c | 102 | bool MacGetMetalAppearance() const ; |
4f305456 SC |
103 | |
104 | void MacChangeWindowAttributes( wxUint32 attributesToSet , wxUint32 attributesToClear ) ; | |
105 | wxUint32 MacGetWindowAttributes() const ; | |
106 | ||
8cf73271 | 107 | WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; } |
4f305456 | 108 | |
f5ea731f SC |
109 | virtual void MacGetContentAreaInset( int &left , int &top , int &right , int &bottom ) ; |
110 | ||
8cf73271 SC |
111 | protected: |
112 | // common part of all ctors | |
113 | void Init(); | |
114 | ||
4f305456 SC |
115 | virtual void DoGetPosition( int *x, int *y ) const; |
116 | virtual void DoGetSize( int *width, int *height ) const; | |
117 | virtual void DoMoveWindow(int x, int y, int width, int height); | |
118 | virtual void DoGetClientSize(int *width, int *height) const; | |
119 | ||
8cf73271 SC |
120 | // is the frame currently iconized? |
121 | bool m_iconized; | |
122 | ||
123 | // should the frame be maximized when it will be shown? set by Maximize() | |
124 | // when it is called while the frame is hidden | |
125 | bool m_maximizeOnShow; | |
126 | bool m_macUsesCompositing ; | |
127 | ||
8cf73271 | 128 | WXWindow m_macWindow ; |
4f305456 | 129 | |
8cf73271 | 130 | wxWindowMac* m_macFocus ; |
2fa2b08e | 131 | void *m_macFullScreenData ; |
8cf73271 | 132 | |
8cf73271 | 133 | static wxTopLevelWindowMac *s_macDeactivateWindow; |
8cf73271 | 134 | private : |
8cf73271 | 135 | WXEVENTHANDLERREF m_macEventHandler ; |
4f305456 SC |
136 | |
137 | DECLARE_EVENT_TABLE() | |
8cf73271 SC |
138 | }; |
139 | ||
140 | // list of all frames and modeless dialogs | |
141 | extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows; | |
142 | ||
8cf73271 SC |
143 | #endif // _WX_MSW_TOPLEVEL_H_ |
144 |