1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/dfb/toplevel.h
3 // Purpose: Top level window, abstraction of wxFrame and wxDialog
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2006 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_DFB_TOPLEVEL_H_
12 #define _WX_DFB_TOPLEVEL_H_
14 #include "wx/dfb/dfbptr.h"
16 wxDFB_DECLARE_INTERFACE(IDirectFBWindow
);
18 class wxDfbQueuedPaintRequests
;
19 struct wxDFBWindowEvent
;
21 //-----------------------------------------------------------------------------
22 // wxTopLevelWindowDFB
23 //-----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxTopLevelWindowDFB
: public wxTopLevelWindowBase
29 wxTopLevelWindowDFB() { Init(); }
30 wxTopLevelWindowDFB(wxWindow
*parent
,
32 const wxString
& title
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 long style
= wxDEFAULT_FRAME_STYLE
,
36 const wxString
& name
= wxFrameNameStr
)
40 Create(parent
, id
, title
, pos
, size
, style
, name
);
43 bool Create(wxWindow
*parent
,
45 const wxString
& title
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
48 long style
= wxDEFAULT_FRAME_STYLE
,
49 const wxString
& name
= wxFrameNameStr
);
51 virtual ~wxTopLevelWindowDFB();
53 // implement base class pure virtuals
54 virtual void Maximize(bool maximize
= true);
55 virtual bool IsMaximized() const;
56 virtual void Iconize(bool iconize
= true);
57 virtual bool IsIconized() const;
58 virtual void Restore();
60 virtual bool ShowFullScreen(bool show
, long style
= wxFULLSCREEN_ALL
);
61 virtual bool IsFullScreen() const { return m_fsIsShowing
; }
63 virtual bool Show(bool show
= true);
65 virtual bool CanSetTransparent() { return true; }
66 virtual bool SetTransparent(wxByte alpha
);
68 virtual void SetTitle(const wxString
&title
) { m_title
= title
; }
69 virtual wxString
GetTitle() const { return m_title
; }
71 virtual void Update();
73 // implementation from now on
74 // --------------------------
76 void OnInternalIdle();
78 wxIDirectFBWindowPtr
GetDirectFBWindow() const { return m_dfbwin
; }
80 // Returns true if some invalidated area of the TLW is currently being
82 bool IsPainting() const { return m_isPainting
; }
85 // common part of all ctors
88 virtual wxIDirectFBSurfacePtr
ObtainDfbSurface() const;
90 // overriden wxWindow methods
91 virtual void DoGetPosition(int *x
, int *y
) const;
92 virtual void DoGetSize(int *width
, int *height
) const;
93 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
95 virtual void DoRefreshRect(const wxRect
& rect
);
97 // sets DirectFB keyboard focus to this toplevel window (note that DFB
98 // focus is different from wx: only shown TLWs can have it and not any
103 // do queued painting in idle time
104 void HandleQueuedPaintRequests();
106 // DirectFB events handling
107 static void HandleDFBWindowEvent(const wxDFBWindowEvent
& event_
);
112 bool m_fsIsShowing
:1; /* full screen */
115 wxRect m_fsSaveFrame
;
117 // is the frame currently maximized?
118 bool m_isMaximized
:1;
121 // did we sent wxSizeEvent at least once?
124 // window's opacity (0: transparent, 255: opaque)
127 // interface to the underlying DirectFB window
128 wxIDirectFBWindowPtr m_dfbwin
;
131 // invalidated areas of the TLW that need repainting
132 wxDfbQueuedPaintRequests
*m_toPaint
;
133 // are we currently painting some area of this TLW?
136 friend class wxEventLoop
; // for HandleDFBWindowEvent
137 friend class wxWindowDFB
; // for SetDfbFocus
140 #endif // _WX_DFB_TOPLEVEL_H_