]>
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 | ||
af49c4b8 | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
fe08e597 SC |
16 | #pragma interface "toplevel.h" |
17 | #endif | |
18 | ||
19 | // ---------------------------------------------------------------------------- | |
20 | // wxTopLevelWindowMac | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
23 | class WXDLLEXPORT wxTopLevelWindowMac : public wxTopLevelWindowBase | |
24 | { | |
25 | public: | |
26 | // constructors and such | |
27 | wxTopLevelWindowMac() { Init(); } | |
28 | ||
29 | wxTopLevelWindowMac(wxWindow *parent, | |
30 | wxWindowID id, | |
31 | const wxString& title, | |
32 | const wxPoint& pos = wxDefaultPosition, | |
33 | const wxSize& size = wxDefaultSize, | |
34 | long style = wxDEFAULT_FRAME_STYLE, | |
35 | const wxString& name = wxFrameNameStr) | |
36 | { | |
37 | Init(); | |
38 | ||
39 | (void)Create(parent, id, title, pos, size, style, name); | |
40 | } | |
41 | ||
42 | bool Create(wxWindow *parent, | |
43 | wxWindowID id, | |
44 | const wxString& title, | |
45 | const wxPoint& pos = wxDefaultPosition, | |
46 | const wxSize& size = wxDefaultSize, | |
47 | long style = wxDEFAULT_FRAME_STYLE, | |
48 | const wxString& name = wxFrameNameStr); | |
49 | ||
50 | virtual ~wxTopLevelWindowMac(); | |
51 | ||
52 | // implement base class pure virtuals | |
53 | virtual void Maximize(bool maximize = TRUE); | |
54 | virtual bool IsMaximized() const; | |
55 | virtual void Iconize(bool iconize = TRUE); | |
56 | virtual bool IsIconized() const; | |
57 | virtual void SetIcon(const wxIcon& icon); | |
f618020a | 58 | virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); } |
fe08e597 SC |
59 | virtual void Restore(); |
60 | ||
1542ea39 RD |
61 | virtual bool SetShape(const wxRegion& region); |
62 | ||
d84afea9 GD |
63 | virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL) |
64 | { return FALSE; } | |
fe08e597 SC |
65 | virtual bool IsFullScreen() const { return FALSE; } |
66 | ||
67 | // implementation from now on | |
68 | // -------------------------- | |
69 | ||
d84afea9 GD |
70 | virtual void MacCreateRealWindow( const wxString& title, |
71 | const wxPoint& pos, | |
72 | const wxSize& size, | |
73 | long style, | |
74 | const wxString& name ) ; | |
75 | static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; } | |
76 | virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ; | |
77 | virtual void Clear() ; | |
78 | virtual WXWidget MacGetContainerForEmbedding() ; | |
79 | WXWindow MacGetWindowRef() { return m_macWindow ; } | |
cbf8aca6 | 80 | virtual void MacActivate( long timestamp , bool inIsActivating ) ; |
d84afea9 | 81 | virtual void MacUpdate( long timestamp ) ; |
cbf8aca6 | 82 | #if !TARGET_CARBON |
d84afea9 GD |
83 | virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ; |
84 | virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ; | |
85 | virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ; | |
86 | virtual void MacKeyDown( WXEVENTREF ev ) ; | |
cbf8aca6 SC |
87 | #endif |
88 | virtual void MacFireMouseEvent( wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ; | |
d84afea9 GD |
89 | virtual void Raise(); |
90 | virtual void Lower(); | |
91 | virtual void SetTitle( const wxString& title); | |
92 | virtual bool Show( bool show = TRUE ); | |
93 | virtual void DoMoveWindow(int x, int y, int width, int height); | |
94 | void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ; | |
8a2c82c1 | 95 | short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme ; } |
cbf8aca6 SC |
96 | |
97 | #if TARGET_CARBON | |
e40298d5 | 98 | WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; } |
cbf8aca6 | 99 | #endif |
fe08e597 SC |
100 | protected: |
101 | // common part of all ctors | |
102 | void Init(); | |
103 | ||
104 | // is the frame currently iconized? | |
105 | bool m_iconized; | |
106 | ||
107 | // should the frame be maximized when it will be shown? set by Maximize() | |
108 | // when it is called while the frame is hidden | |
109 | bool m_maximizeOnShow; | |
6ed63f8b | 110 | |
5273bf2f SC |
111 | short m_macWindowBackgroundTheme ; |
112 | WXWindow m_macWindow ; | |
113 | WXWidget m_macRootControl ; | |
6ed63f8b | 114 | wxWindowMac* m_macFocus ; |
5273bf2f | 115 | WXHRGN m_macNoEraseUpdateRgn ; |
6ed63f8b SC |
116 | bool m_macNeedsErasing ; |
117 | ||
d84afea9 | 118 | static WXWindow s_macWindowInUpdate ; |
cbf8aca6 SC |
119 | private : |
120 | #if TARGET_CARBON | |
e40298d5 | 121 | WXEVENTHANDLERREF m_macEventHandler ; |
cbf8aca6 | 122 | #endif |
fe08e597 SC |
123 | }; |
124 | ||
125 | // list of all frames and modeless dialogs | |
126 | extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows; | |
127 | ||
6ed63f8b SC |
128 | // associate mac windows with wx counterparts |
129 | ||
5273bf2f SC |
130 | wxTopLevelWindowMac* wxFindWinFromMacWindow( WXWindow inWindow ) ; |
131 | void wxAssociateWinWithMacWindow(WXWindow inWindow, wxTopLevelWindowMac *win) ; | |
6ed63f8b SC |
132 | void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ; |
133 | ||
134 | ||
fe08e597 SC |
135 | #endif // _WX_MSW_TOPLEVEL_H_ |
136 |