]> git.saurik.com Git - wxWidgets.git/blame - src/gtk/dcscreen.cpp
don't do anything before including the PCH header
[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
RR
23//-----------------------------------------------------------------------------
24// global data initialization
25//-----------------------------------------------------------------------------
26
27GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
72cdf4c9
VZ
28int wxScreenDC::sm_overlayWindowX = 0;
29int wxScreenDC::sm_overlayWindowY = 0;
dbf858b5 30
c801d85f
KB
31//-----------------------------------------------------------------------------
32// wxScreenDC
33//-----------------------------------------------------------------------------
34
35IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
36
72cdf4c9 37wxScreenDC::wxScreenDC()
c801d85f 38{
cdccdfab 39 m_ok = false;
4bc67cc5 40 m_cmap = gdk_colormap_get_system();
2454dc8a 41 m_window = gdk_get_default_root_window();
72cdf4c9 42
3e3b7e75 43 m_context = gdk_pango_context_get();
e90d93d1
MW
44 // Note: The Sun customised version of Pango shipping with Solaris 10
45 // crashes if the language is left NULL (see bug 1374114)
203b65dd 46 pango_context_set_language( m_context, gtk_get_default_language() );
3e3b7e75
RD
47 m_layout = pango_layout_new( m_context );
48// m_fontdesc = pango_font_description_copy( widget->style->font_desc );
3e3b7e75 49
cdccdfab 50 m_isScreenDC = true;
e1208c31 51
4bc67cc5 52 SetUpDC();
72cdf4c9 53
4bc67cc5
RR
54 gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
55 gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
56 gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
57 gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
ff7b1510 58}
c801d85f 59
72cdf4c9 60wxScreenDC::~wxScreenDC()
c801d85f 61{
5d25c050
RR
62 gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
63 gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN );
64 gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN );
65 gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN );
66
4bc67cc5 67 EndDrawingOnTop();
ff7b1510 68}
c801d85f 69
b3d6b0c9 70bool wxScreenDC::StartDrawingOnTop( wxWindow * )
c801d85f 71{
b3d6b0c9 72 return true;
ff7b1510 73}
c801d85f 74
b3d6b0c9 75bool wxScreenDC::StartDrawingOnTop( wxRect * )
c801d85f 76{
b3d6b0c9 77 return true;
ff7b1510 78}
c801d85f 79
72cdf4c9 80bool wxScreenDC::EndDrawingOnTop()
c801d85f 81{
b3d6b0c9 82 return true;
ff7b1510
RR
83}
84
376aa62a
VZ
85void wxScreenDC::DoGetSize(int *width, int *height) const
86{
87 wxDisplaySize(width, height);
88}