]> git.saurik.com Git - wxWidgets.git/blame - src/gtk/dcscreen.cpp
always call GTKSetActivatesDefault(), not only if wxTE_PROCESS_ENTER style was given...
[wxWidgets.git] / src / gtk / dcscreen.cpp
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
cdccdfab 2// Name: src/gtk/dcscreen.cpp
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
dbf858b5 5// Id: $Id$
01111366 6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
14f355c2
VS
10// For compilers that support precompilation, includes "wx.h".
11#include "wx/wxprec.h"
12
c801d85f 13#include "wx/dcscreen.h"
cdccdfab
WS
14
15#ifndef WX_PRECOMP
16 #include "wx/window.h"
17#endif
dbf858b5 18
071a2d78 19#include <gdk/gdk.h>
5d25c050 20#include <gdk/gdkx.h>
071a2d78 21#include <gtk/gtk.h>
83624f79 22
dbf858b5 23
c801d85f
KB
24//-----------------------------------------------------------------------------
25// wxScreenDC
26//-----------------------------------------------------------------------------
27
ab171e95
RR
28#if wxUSE_NEW_DC
29IMPLEMENT_ABSTRACT_CLASS(wxGTKScreenImplDC, wxGTKWindowImplDC)
30#else
31IMPLEMENT_ABSTRACT_CLASS(wxScreenDC,wxWindowDC)
32#endif
33
34#if wxUSE_NEW_DC
35wxGTKScreenImplDC::wxGTKScreenImplDC( wxScreenDC *owner )
36 : wxGTKWindowImplDC( owner )
37{
38 Init();
39}
c801d85f 40
ab171e95
RR
41#else
42wxScreenDC::wxScreenDC()
43{
44 Init();
45}
46#endif
47
48void wxGTKScreenImplDC::Init()
c801d85f 49{
cdccdfab 50 m_ok = false;
4bc67cc5 51 m_cmap = gdk_colormap_get_system();
2454dc8a 52 m_window = gdk_get_default_root_window();
72cdf4c9 53
3e3b7e75 54 m_context = gdk_pango_context_get();
e90d93d1
MW
55 // Note: The Sun customised version of Pango shipping with Solaris 10
56 // crashes if the language is left NULL (see bug 1374114)
203b65dd 57 pango_context_set_language( m_context, gtk_get_default_language() );
3e3b7e75
RD
58 m_layout = pango_layout_new( m_context );
59// m_fontdesc = pango_font_description_copy( widget->style->font_desc );
3e3b7e75 60
cdccdfab 61 m_isScreenDC = true;
e1208c31 62
4bc67cc5 63 SetUpDC();
72cdf4c9 64
4bc67cc5
RR
65 gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
66 gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
67 gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
68 gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
ff7b1510 69}
c801d85f 70
ab171e95 71wxGTKScreenImplDC::~wxGTKScreenImplDC()
c801d85f 72{
5d25c050
RR
73 gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
74 gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN );
75 gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN );
76 gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN );
ff7b1510
RR
77}
78
ab171e95 79void wxGTKScreenImplDC::DoGetSize(int *width, int *height) const
376aa62a
VZ
80{
81 wxDisplaySize(width, height);
82}