]> git.saurik.com Git - wxWidgets.git/blob - src/x11/dcscreen.cpp
Add wxTranslations::GetTranslatedString().
[wxWidgets.git] / src / x11 / dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/x11/dcscreen.cpp
3 // Purpose: wxScreenDC class
4 // Author: Julian Smart, Robert Roebling
5 // Modified by:
6 // Created: 17/09/98
7 // Copyright: (c) Julian Smart, Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 // for compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13
14 #include "wx/dcscreen.h"
15 #include "wx/x11/dcscreen.h"
16
17 #ifndef WX_PRECOMP
18 #include "wx/app.h"
19 #include "wx/utils.h"
20 #include "wx/window.h"
21 #include "wx/frame.h"
22 #endif
23
24 #include "wx/fontutil.h"
25
26 #include "wx/x11/private.h"
27
28 //-----------------------------------------------------------------------------
29 // wxScreenDC
30 //-----------------------------------------------------------------------------
31
32 IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl,wxPaintDCImpl)
33
34 wxScreenDCImpl::wxScreenDCImpl( wxDC* owner )
35 : wxPaintDCImpl( owner )
36 {
37 m_ok = false;
38
39 m_display = (WXDisplay *) wxGlobalDisplay();
40
41 int screen = DefaultScreen( (Display*) m_display );
42 m_cmap = (WXColormap) DefaultColormap( (Display*) m_display, screen );
43
44 m_x11window = (WXWindow) RootWindow( (Display*) m_display, screen );
45
46 m_isScreenDC = true;
47
48 #if wxUSE_UNICODE
49 m_context = wxTheApp->GetPangoContext();
50 m_fontdesc = wxNORMAL_FONT->GetNativeFontInfo()->description;
51 #endif
52
53 SetUpDC();
54
55 XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, IncludeInferiors );
56 XSetSubwindowMode( (Display*) m_display, (GC) m_brushGC, IncludeInferiors );
57 XSetSubwindowMode( (Display*) m_display, (GC) m_textGC, IncludeInferiors );
58 XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, IncludeInferiors );
59 }
60
61 wxScreenDCImpl::~wxScreenDCImpl()
62 {
63 XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, ClipByChildren );
64 XSetSubwindowMode( (Display*) m_display, (GC) m_brushGC, ClipByChildren );
65 XSetSubwindowMode( (Display*) m_display, (GC) m_textGC, ClipByChildren );
66 XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, ClipByChildren );
67 }
68
69 void wxScreenDCImpl::DoGetSize(int *width, int *height) const
70 {
71 wxDisplaySize(width, height);
72 }