]>
Commit | Line | Data |
---|---|---|
b3c86150 VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: src/dfb/dcscreen.cpp | |
3 | // Purpose: wxScreenDC implementation | |
4 | // Author: Vaclav Slavik | |
5 | // Created: 2006-08-16 | |
b3c86150 VS |
6 | // Copyright: (c) 2006 REA Elektronik GmbH |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | // =========================================================================== | |
11 | // declarations | |
12 | // =========================================================================== | |
13 | ||
14 | // --------------------------------------------------------------------------- | |
15 | // headers | |
16 | // --------------------------------------------------------------------------- | |
17 | ||
18 | // For compilers that support precompilation, includes "wx.h". | |
19 | #include "wx/wxprec.h" | |
20 | ||
4d2df97f | 21 | #include "wx/dcscreen.h" |
4a624f6e | 22 | #include "wx/dfb/dcscreen.h" |
b3c86150 VS |
23 | #include "wx/dfb/private.h" |
24 | ||
25 | // =========================================================================== | |
26 | // implementation | |
27 | // =========================================================================== | |
28 | ||
29 | //----------------------------------------------------------------------------- | |
30 | // wxScreenDC | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
f94d33c5 VS |
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 | |
36 | // configuration: | |
37 | // | |
38 | // (1) if force-desktop, a surface is created and used as *background* | |
39 | // for the windows managed by DFB WM | |
40 | // | |
41 | // (2) otherwise, a dummy surface of the right size and format is | |
42 | // created, but isn't shown on the screen | |
43 | // | |
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 | |
49 | // | |
50 | // 2) and 3) are obviously unsatisfactory. 1) isn't suitable either, | |
51 | // because wxScreenDC has to render *on top* of windows. | |
52 | // | |
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. | |
57 | // | |
58 | // The surface, as obtained from GetPrimarySurface(), is double-buffered | |
59 | // for the sole purpose of silencing the warning from 3) above. | |
b3c86150 | 60 | |
4a624f6e | 61 | IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxDFBDCImpl) |
b3c86150 | 62 | |
4a624f6e VZ |
63 | wxScreenDCImpl::wxScreenDCImpl(wxScreenDC *owner) |
64 | : wxDFBDCImpl(owner) | |
b3c86150 | 65 | { |
c16db850 | 66 | DFBInit(wxIDirectFB::Get()->GetPrimarySurface()); |
b3c86150 | 67 | } |