]> git.saurik.com Git - wxWidgets.git/blob - src/dfb/dcscreen.cpp
No changes, just move mouse capturing bookkeeping data out of wxWindow.
[wxWidgets.git] / src / dfb / dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/dfb/dcscreen.cpp
3 // Purpose: wxScreenDC implementation
4 // Author: Vaclav Slavik
5 // Created: 2006-08-16
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
21 #include "wx/dcscreen.h"
22 #include "wx/dfb/dcscreen.h"
23 #include "wx/dfb/private.h"
24
25 // ===========================================================================
26 // implementation
27 // ===========================================================================
28
29 //-----------------------------------------------------------------------------
30 // wxScreenDC
31 //-----------------------------------------------------------------------------
32
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.
60
61 IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxDFBDCImpl)
62
63 wxScreenDCImpl::wxScreenDCImpl(wxScreenDC *owner)
64 : wxDFBDCImpl(owner)
65 {
66 DFBInit(wxIDirectFB::Get()->GetPrimarySurface());
67 }