]>
Commit | Line | Data |
---|---|---|
fe08e597 SC |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/mac/toplevel.h | |
5273bf2f | 3 | // Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW |
be55ddb1 | 4 | // Author: Stefan Csomor |
fe08e597 SC |
5 | // Modified by: |
6 | // Created: 20.09.01 | |
7 | // RCS-ID: $Id$ | |
be55ddb1 | 8 | // Copyright: (c) 2001 Stefan Csomor |
fe08e597 SC |
9 | // Licence: wxWindows licence |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_MSW_TOPLEVEL_H_ | |
13 | #define _WX_MSW_TOPLEVEL_H_ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
fe08e597 SC |
16 | #pragma interface "toplevel.h" |
17 | #endif | |
18 | ||
66b7ea46 | 19 | #if wxUSE_SYSTEM_OPTIONS |
19c25033 | 20 | #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition") |
66b7ea46 SC |
21 | #endif |
22 | ||
fe08e597 SC |
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 | ||
56 | // implement base class pure virtuals | |
57 | virtual void Maximize(bool maximize = TRUE); | |
58 | virtual bool IsMaximized() const; | |
59 | virtual void Iconize(bool iconize = TRUE); | |
60 | virtual bool IsIconized() const; | |
61 | virtual void SetIcon(const wxIcon& icon); | |
f618020a | 62 | virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); } |
fe08e597 SC |
63 | virtual void Restore(); |
64 | ||
1542ea39 RD |
65 | virtual bool SetShape(const wxRegion& region); |
66 | ||
d84afea9 GD |
67 | virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL) |
68 | { return FALSE; } | |
fe08e597 SC |
69 | virtual bool IsFullScreen() const { return FALSE; } |
70 | ||
71 | // implementation from now on | |
72 | // -------------------------- | |
73 | ||
245f3581 | 74 | static void MacDelayedDeactivation(long timestamp); |
d84afea9 GD |
75 | virtual void MacCreateRealWindow( const wxString& title, |
76 | const wxPoint& pos, | |
77 | const wxSize& size, | |
78 | long style, | |
79 | const wxString& name ) ; | |
80 | static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; } | |
81 | virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ; | |
5d2e69e8 | 82 | virtual void ClearBackground() ; |
d84afea9 GD |
83 | virtual WXWidget MacGetContainerForEmbedding() ; |
84 | WXWindow MacGetWindowRef() { return m_macWindow ; } | |
cbf8aca6 | 85 | virtual void MacActivate( long timestamp , bool inIsActivating ) ; |
d84afea9 | 86 | virtual void MacUpdate( long timestamp ) ; |
cbf8aca6 | 87 | #if !TARGET_CARBON |
d84afea9 GD |
88 | virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ; |
89 | virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ; | |
90 | virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ; | |
91 | virtual void MacKeyDown( WXEVENTREF ev ) ; | |
cbf8aca6 SC |
92 | #endif |
93 | virtual void MacFireMouseEvent( wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ; | |
d84afea9 GD |
94 | virtual void Raise(); |
95 | virtual void Lower(); | |
96 | virtual void SetTitle( const wxString& title); | |
97 | virtual bool Show( bool show = TRUE ); | |
98 | virtual void DoMoveWindow(int x, int y, int width, int height); | |
99 | void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ; | |
8a2c82c1 | 100 | short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme ; } |
66b7ea46 SC |
101 | static bool MacEnableCompositing( bool useCompositing ); |
102 | bool MacUsesCompositing() { return m_macUsesCompositing; } | |
cbf8aca6 SC |
103 | |
104 | #if TARGET_CARBON | |
e40298d5 | 105 | WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; } |
cbf8aca6 | 106 | #endif |
fe08e597 SC |
107 | protected: |
108 | // common part of all ctors | |
109 | void Init(); | |
110 | ||
111 | // is the frame currently iconized? | |
112 | bool m_iconized; | |
113 | ||
114 | // should the frame be maximized when it will be shown? set by Maximize() | |
115 | // when it is called while the frame is hidden | |
116 | bool m_maximizeOnShow; | |
66b7ea46 | 117 | bool m_macUsesCompositing ; |
6ed63f8b | 118 | |
5273bf2f SC |
119 | short m_macWindowBackgroundTheme ; |
120 | WXWindow m_macWindow ; | |
121 | WXWidget m_macRootControl ; | |
6ed63f8b | 122 | wxWindowMac* m_macFocus ; |
5273bf2f | 123 | WXHRGN m_macNoEraseUpdateRgn ; |
6ed63f8b SC |
124 | bool m_macNeedsErasing ; |
125 | ||
d84afea9 | 126 | static WXWindow s_macWindowInUpdate ; |
245f3581 | 127 | static wxTopLevelWindowMac *s_macDeactivateWindow; |
66b7ea46 | 128 | static bool s_macWindowCompositing ; |
cbf8aca6 SC |
129 | private : |
130 | #if TARGET_CARBON | |
e40298d5 | 131 | WXEVENTHANDLERREF m_macEventHandler ; |
cbf8aca6 | 132 | #endif |
fe08e597 SC |
133 | }; |
134 | ||
135 | // list of all frames and modeless dialogs | |
136 | extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows; | |
137 | ||
6ed63f8b SC |
138 | // associate mac windows with wx counterparts |
139 | ||
5273bf2f SC |
140 | wxTopLevelWindowMac* wxFindWinFromMacWindow( WXWindow inWindow ) ; |
141 | void wxAssociateWinWithMacWindow(WXWindow inWindow, wxTopLevelWindowMac *win) ; | |
6ed63f8b SC |
142 | void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ; |
143 | ||
144 | ||
fe08e597 SC |
145 | #endif // _WX_MSW_TOPLEVEL_H_ |
146 |