]> git.saurik.com Git - wxWidgets.git/blame - include/wx/dfb/toplevel.h
Fix scrolling bug where client size was reported wrong
[wxWidgets.git] / include / wx / dfb / toplevel.h
CommitLineData
b3c86150
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/dfb/toplevel.h
3// Purpose: Top level window, abstraction of wxFrame and wxDialog
4// Author: Vaclav Slavik
5// Created: 2006-08-10
6// RCS-ID: $Id$
7// Copyright: (c) 2006 REA Elektronik GmbH
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_DFB_TOPLEVEL_H_
12#define _WX_DFB_TOPLEVEL_H_
13
52c8d32a 14#include "wx/dfb/dfbptr.h"
b3c86150
VS
15
16wxDFB_DECLARE_INTERFACE(IDirectFBWindow);
17
18class wxDfbQueuedPaintRequests;
19struct wxDFBWindowEvent;
20
21//-----------------------------------------------------------------------------
22// wxTopLevelWindowDFB
23//-----------------------------------------------------------------------------
24
25class WXDLLIMPEXP_CORE wxTopLevelWindowDFB : public wxTopLevelWindowBase
26{
27public:
28 // construction
29 wxTopLevelWindowDFB() { Init(); }
30 wxTopLevelWindowDFB(wxWindow *parent,
31 wxWindowID id,
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)
37 {
38 Init();
39
40 Create(parent, id, title, pos, size, style, name);
41 }
42
43 bool Create(wxWindow *parent,
44 wxWindowID id,
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);
50
51 virtual ~wxTopLevelWindowDFB();
52
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();
59
60 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
61 virtual bool IsFullScreen() const { return m_fsIsShowing; }
62
63 virtual bool Show(bool show = true);
64
65 virtual bool CanSetTransparent() { return true; }
66 virtual bool SetTransparent(wxByte alpha);
67
68 virtual void SetTitle(const wxString &title) { m_title = title; }
69 virtual wxString GetTitle() const { return m_title; }
70
71 virtual void Update();
72
73 // implementation from now on
74 // --------------------------
75
76 void OnInternalIdle();
77
52c8d32a 78 wxIDirectFBWindowPtr GetDirectFBWindow() const { return m_dfbwin; }
b3c86150 79
20671963
VS
80 // Returns true if some invalidated area of the TLW is currently being
81 // painted
82 bool IsPainting() const { return m_isPainting; }
83
b3c86150
VS
84protected:
85 // common part of all ctors
86 void Init();
87
52c8d32a 88 virtual wxIDirectFBSurfacePtr ObtainDfbSurface() const;
b3c86150
VS
89
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);
94
20671963 95 virtual void DoRefreshRect(const wxRect& rect);
b3c86150
VS
96
97private:
98 // do queued painting in idle time
99 void HandleQueuedPaintRequests();
100
101 // DirectFB events handling
102 static void HandleDFBWindowEvent(const wxDFBWindowEvent& event_);
103
104protected:
105 wxString m_title;
106
107 bool m_fsIsShowing:1; /* full screen */
108 long m_fsSaveStyle;
109 long m_fsSaveFlag;
110 wxRect m_fsSaveFrame;
111
112 // is the frame currently maximized?
113 bool m_isMaximized:1;
114 wxRect m_savedFrame;
115
116 // did we sent wxSizeEvent at least once?
117 bool m_sizeSet:1;
118
119 // window's opacity (0: transparent, 255: opaque)
120 wxByte m_opacity;
121
122 // interface to the underlying DirectFB window
52c8d32a 123 wxIDirectFBWindowPtr m_dfbwin;
b3c86150
VS
124
125private:
20671963 126 // invalidated areas of the TLW that need repainting
b3c86150 127 wxDfbQueuedPaintRequests *m_toPaint;
20671963
VS
128 // are we currently painting some area of this TLW?
129 bool m_isPainting;
b3c86150
VS
130
131 friend class wxEventLoop; // for HandleDFBWindowEvent
132};
133
134#endif // _WX_DFB_TOPLEVEL_H_