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