]>
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
7 // Copyright: (c) 2006 REA Elektronik GmbH
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // ===========================================================================
13 // ===========================================================================
15 // ---------------------------------------------------------------------------
17 // ---------------------------------------------------------------------------
19 // For compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
22 #include "wx/dcscreen.h"
23 #include "wx/dfb/dcscreen.h"
24 #include "wx/dfb/private.h"
26 // ===========================================================================
28 // ===========================================================================
30 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 // FIXME: Currently, wxScreenDC doesn't work at all in non-exclusive mode
35 // (DFSCL_NORMAL). In this mode, requesting primary surface results
36 // in one of the following actions, depending on directfbrc
39 // (1) if force-desktop, a surface is created and used as *background*
40 // for the windows managed by DFB WM
42 // (2) otherwise, a dummy surface of the right size and format is
43 // created, but isn't shown on the screen
45 // (3) furthermore, if autoflip-window option is not used and primary
46 // surface is requested as single-buffered (which is needed to
47 // implement wxScreenDC semantics), a warning is issued in addition
48 // to 2); if autoflip-window is used, then a helper thread is
49 // created and does periodic flipping, which is even worse
51 // 2) and 3) are obviously unsatisfactory. 1) isn't suitable either,
52 // because wxScreenDC has to render *on top* of windows.
54 // In conclusion, wxScreenDC as currently implemented is only usable
55 // for measuring things (e.g. font sizes). For this task, however, it
56 // is quite expensive to create in DFSCL_NORMAL mode, because it
57 // involves creation of a new surface as big as the screen.
59 // The surface, as obtained from GetPrimarySurface(), is double-buffered
60 // for the sole purpose of silencing the warning from 3) above.
62 IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl
, wxDFBDCImpl
)
64 wxScreenDCImpl::wxScreenDCImpl(wxScreenDC
*owner
)
67 DFBInit(wxIDirectFB::Get()->GetPrimarySurface());