Remove code to query GDK window origin from DoGetPosition(), it should not be necessa...
[wxWidgets.git] / src / gtk / dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/dcscreen.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
12
13 #include "wx/dcscreen.h"
14 #include "wx/gtk/dcscreen.h"
15
16 #include <gtk/gtk.h>
17 #ifdef GDK_WINDOWING_X11
18 #include <gdk/gdkx.h>
19 #endif
20
21 //-----------------------------------------------------------------------------
22 // wxScreenDCImpl
23 //-----------------------------------------------------------------------------
24
25 IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl)
26
27 wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner )
28 : wxWindowDCImpl( owner )
29 {
30 Init();
31 }
32
33 void wxScreenDCImpl::Init()
34 {
35 m_ok = false;
36 m_cmap = gdk_colormap_get_system();
37 m_gdkwindow = gdk_get_default_root_window();
38
39 m_context = gdk_pango_context_get();
40 // Note: The Sun customised version of Pango shipping with Solaris 10
41 // crashes if the language is left NULL (see bug 1374114)
42 pango_context_set_language( m_context, gtk_get_default_language() );
43 m_layout = pango_layout_new( m_context );
44 // m_fontdesc = pango_font_description_copy( widget->style->font_desc );
45
46 m_isScreenDC = true;
47
48 SetUpDC();
49
50 gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
51 gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
52 gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
53 gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
54 }
55
56 wxScreenDCImpl::~wxScreenDCImpl()
57 {
58 g_object_unref(m_context);
59
60 gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
61 gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN );
62 gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN );
63 gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN );
64 }
65
66 void wxScreenDCImpl::DoGetSize(int *width, int *height) const
67 {
68 wxDisplaySize(width, height);
69 }