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(__APPLE__)
16 #pragma interface "toplevel.h"
19 // ----------------------------------------------------------------------------
20 // wxTopLevelWindowMac
21 // ----------------------------------------------------------------------------
23 class WXDLLEXPORT wxTopLevelWindowMac
: public wxTopLevelWindowBase
26 // constructors and such
27 wxTopLevelWindowMac() { Init(); }
29 wxTopLevelWindowMac(wxWindow
*parent
,
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
)
39 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
42 bool Create(wxWindow
*parent
,
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
);
50 virtual ~wxTopLevelWindowMac();
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
);
58 virtual void SetIcons(const wxIconBundle
& icons
) { SetIcon( icons
.GetIcon( -1 ) ); }
59 virtual void Restore();
61 virtual bool SetShape(const wxRegion
& region
);
63 virtual bool ShowFullScreen(bool WXUNUSED(show
), long WXUNUSED(style
) = wxFULLSCREEN_ALL
)
65 virtual bool IsFullScreen() const { return FALSE
; }
67 // implementation from now on
68 // --------------------------
70 static void MacDelayedDeactivation(long timestamp
);
71 virtual void MacCreateRealWindow( const wxString
& title
,
75 const wxString
& name
) ;
76 static WXWindow
MacGetWindowInUpdate() { return s_macWindowInUpdate
; }
77 virtual void MacGetPortParams(WXPOINTPTR localOrigin
, WXRECTPTR clipRect
, WXWindow
*window
, wxWindowMac
** rootwin
) ;
78 virtual void Clear() ;
79 virtual WXWidget
MacGetContainerForEmbedding() ;
80 WXWindow
MacGetWindowRef() { return m_macWindow
; }
81 virtual void MacActivate( long timestamp
, bool inIsActivating
) ;
82 virtual void MacUpdate( long timestamp
) ;
84 virtual void MacMouseDown( WXEVENTREF ev
, short windowPart
) ;
85 virtual void MacMouseUp( WXEVENTREF ev
, short windowPart
) ;
86 virtual void MacMouseMoved( WXEVENTREF ev
, short windowPart
) ;
87 virtual void MacKeyDown( WXEVENTREF ev
) ;
89 virtual void MacFireMouseEvent( wxUint16 kind
, wxInt32 x
, wxInt32 y
,wxUint32 modifiers
, long timestamp
) ;
92 virtual void SetTitle( const wxString
& title
);
93 virtual bool Show( bool show
= TRUE
);
94 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
95 void MacInvalidate( const WXRECTPTR rect
, bool eraseBackground
) ;
96 short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme
; }
99 WXEVENTHANDLERREF
MacGetEventHandler() { return m_macEventHandler
; }
102 // common part of all ctors
105 // is the frame currently iconized?
108 // should the frame be maximized when it will be shown? set by Maximize()
109 // when it is called while the frame is hidden
110 bool m_maximizeOnShow
;
112 short m_macWindowBackgroundTheme
;
113 WXWindow m_macWindow
;
114 WXWidget m_macRootControl
;
115 wxWindowMac
* m_macFocus
;
116 WXHRGN m_macNoEraseUpdateRgn
;
117 bool m_macNeedsErasing
;
119 static WXWindow s_macWindowInUpdate
;
120 static wxTopLevelWindowMac
*s_macDeactivateWindow
;
123 WXEVENTHANDLERREF m_macEventHandler
;
127 // list of all frames and modeless dialogs
128 extern WXDLLEXPORT_DATA(wxWindowList
) wxModelessWindows
;
130 // associate mac windows with wx counterparts
132 wxTopLevelWindowMac
* wxFindWinFromMacWindow( WXWindow inWindow
) ;
133 void wxAssociateWinWithMacWindow(WXWindow inWindow
, wxTopLevelWindowMac
*win
) ;
134 void wxRemoveMacWindowAssociation(wxTopLevelWindowMac
*win
) ;
137 #endif // _WX_MSW_TOPLEVEL_H_