]> git.saurik.com Git - wxWidgets.git/blob - src/gtk/dcscreen.cpp
use the right GdkWindow and origin for non-pizza widget with wxClientDC
[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 #ifndef WX_PRECOMP
17 #include "wx/window.h"
18 #endif
19
20 #include <gdk/gdk.h>
21 #include <gdk/gdkx.h>
22 #include <gtk/gtk.h>
23
24 //-----------------------------------------------------------------------------
25 // wxScreenDCImpl
26 //-----------------------------------------------------------------------------
27
28 IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl)
29
30 wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner )
31 : wxWindowDCImpl( owner )
32 {
33 Init();
34 }
35
36 void wxScreenDCImpl::Init()
37 {
38 m_ok = false;
39 m_cmap = gdk_colormap_get_system();
40 m_gdkwindow = gdk_get_default_root_window();
41
42 m_context = gdk_pango_context_get();
43 // Note: The Sun customised version of Pango shipping with Solaris 10
44 // crashes if the language is left NULL (see bug 1374114)
45 pango_context_set_language( m_context, gtk_get_default_language() );
46 m_layout = pango_layout_new( m_context );
47 // m_fontdesc = pango_font_description_copy( widget->style->font_desc );
48
49 m_isScreenDC = true;
50
51 SetUpDC();
52
53 gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
54 gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
55 gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
56 gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
57 }
58
59 wxScreenDCImpl::~wxScreenDCImpl()
60 {
61 gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
62 gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN );
63 gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN );
64 gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN );
65 }
66
67 void wxScreenDCImpl::DoGetSize(int *width, int *height) const
68 {
69 wxDisplaySize(width, height);
70 }