]>
git.saurik.com Git - wxWidgets.git/blob - src/dfb/dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/dfb/dcscreen.cpp
3 // Purpose: wxScreenDC implementation
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2006 REA Elektronik GmbH
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // ===========================================================================
12 // ===========================================================================
14 // ---------------------------------------------------------------------------
16 // ---------------------------------------------------------------------------
18 // For compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
21 #include "wx/dcscreen.h"
22 #include "wx/dfb/dcscreen.h"
23 #include "wx/dfb/private.h"
25 // ===========================================================================
27 // ===========================================================================
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 // FIXME: Currently, wxScreenDC doesn't work at all in non-exclusive mode
34 // (DFSCL_NORMAL). In this mode, requesting primary surface results
35 // in one of the following actions, depending on directfbrc
38 // (1) if force-desktop, a surface is created and used as *background*
39 // for the windows managed by DFB WM
41 // (2) otherwise, a dummy surface of the right size and format is
42 // created, but isn't shown on the screen
44 // (3) furthermore, if autoflip-window option is not used and primary
45 // surface is requested as single-buffered (which is needed to
46 // implement wxScreenDC semantics), a warning is issued in addition
47 // to 2); if autoflip-window is used, then a helper thread is
48 // created and does periodic flipping, which is even worse
50 // 2) and 3) are obviously unsatisfactory. 1) isn't suitable either,
51 // because wxScreenDC has to render *on top* of windows.
53 // In conclusion, wxScreenDC as currently implemented is only usable
54 // for measuring things (e.g. font sizes). For this task, however, it
55 // is quite expensive to create in DFSCL_NORMAL mode, because it
56 // involves creation of a new surface as big as the screen.
58 // The surface, as obtained from GetPrimarySurface(), is double-buffered
59 // for the sole purpose of silencing the warning from 3) above.
61 IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl
, wxDFBDCImpl
)
63 wxScreenDCImpl::wxScreenDCImpl(wxScreenDC
*owner
)
66 DFBInit(wxIDirectFB::Get()->GetPrimarySurface());