1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/toplevel.h
3 // Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
4 // Author: Stefan Csomor
8 // Copyright: (c) 2001 Stefan Csomor
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MSW_TOPLEVEL_H_
13 #define _WX_MSW_TOPLEVEL_H_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "toplevel.h"
19 #if wxUSE_SYSTEM_OPTIONS
20 #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition")
23 // ----------------------------------------------------------------------------
24 // wxTopLevelWindowMac
25 // ----------------------------------------------------------------------------
27 class WXDLLEXPORT wxTopLevelWindowMac
: public wxTopLevelWindowBase
30 // constructors and such
31 wxTopLevelWindowMac() { Init(); }
33 wxTopLevelWindowMac(wxWindow
*parent
,
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
)
43 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
46 bool Create(wxWindow
*parent
,
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
);
54 virtual ~wxTopLevelWindowMac();
56 virtual wxPoint
GetClientAreaOrigin() const;
58 // implement base class pure virtuals
59 virtual void Maximize(bool maximize
= TRUE
);
60 virtual bool IsMaximized() const;
61 virtual void Iconize(bool iconize
= TRUE
);
62 virtual bool IsIconized() const;
63 virtual void SetIcon(const wxIcon
& icon
);
64 virtual void SetIcons(const wxIconBundle
& icons
) { SetIcon( icons
.GetIcon( -1 ) ); }
65 virtual void Restore();
67 virtual bool SetShape(const wxRegion
& region
);
69 virtual bool ShowFullScreen(bool WXUNUSED(show
), long WXUNUSED(style
) = wxFULLSCREEN_ALL
)
71 virtual bool IsFullScreen() const { return FALSE
; }
73 // implementation from now on
74 // --------------------------
76 static void MacDelayedDeactivation(long timestamp
);
77 virtual void MacCreateRealWindow( const wxString
& title
,
81 const wxString
& name
) ;
82 virtual void ClearBackground() ;
84 WXWindow
MacGetWindowRef() { return m_macWindow
; }
85 virtual void MacActivate( long timestamp
, bool inIsActivating
) ;
89 virtual void SetTitle( const wxString
& title
);
90 virtual bool Show( bool show
= TRUE
);
92 virtual void MacSetBackgroundBrush( const wxBrush
&brush
) ;
94 bool MacUsesCompositing() { return m_macUsesCompositing
; }
95 virtual void MacInstallTopLevelWindowEventHandler() ;
97 void MacSetMetalAppearance( bool on
) ;
98 bool MacGetMetalAppearance() const ;
100 void MacChangeWindowAttributes( wxUint32 attributesToSet
, wxUint32 attributesToClear
) ;
101 wxUint32
MacGetWindowAttributes() const ;
103 WXEVENTHANDLERREF
MacGetEventHandler() { return m_macEventHandler
; }
105 virtual void MacGetContentAreaInset( int &left
, int &top
, int &right
, int &bottom
) ;
108 // common part of all ctors
111 virtual void DoGetPosition( int *x
, int *y
) const;
112 virtual void DoGetSize( int *width
, int *height
) const;
113 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
114 virtual void DoGetClientSize(int *width
, int *height
) const;
116 // is the frame currently iconized?
119 // should the frame be maximized when it will be shown? set by Maximize()
120 // when it is called while the frame is hidden
121 bool m_maximizeOnShow
;
122 bool m_macUsesCompositing
;
124 WXWindow m_macWindow
;
126 wxWindowMac
* m_macFocus
;
128 static wxTopLevelWindowMac
*s_macDeactivateWindow
;
130 WXEVENTHANDLERREF m_macEventHandler
;
132 DECLARE_EVENT_TABLE()
135 // list of all frames and modeless dialogs
136 extern WXDLLEXPORT_DATA(wxWindowList
) wxModelessWindows
;
138 #endif // _WX_MSW_TOPLEVEL_H_