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