]> git.saurik.com Git - wxWidgets.git/blame - src/gtk/dcscreen.cpp
Added support for saving greyscale TIFF images.
[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"
888dde65 14#include "wx/gtk/dcscreen.h"
cdccdfab 15
071a2d78 16#include <gtk/gtk.h>
769c3372 17#include <gdk/gdkx.h>
83624f79 18
c801d85f 19//-----------------------------------------------------------------------------
888dde65 20// wxScreenDCImpl
c801d85f
KB
21//-----------------------------------------------------------------------------
22
888dde65 23IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl)
ab171e95 24
03647350 25wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner )
888dde65 26 : wxWindowDCImpl( owner )
03647350
VZ
27{
28 Init();
ab171e95 29}
c801d85f 30
888dde65 31void wxScreenDCImpl::Init()
c801d85f 32{
cdccdfab 33 m_ok = false;
4bc67cc5 34 m_cmap = gdk_colormap_get_system();
888dde65 35 m_gdkwindow = gdk_get_default_root_window();
72cdf4c9 36
3e3b7e75 37 m_context = gdk_pango_context_get();
e90d93d1
MW
38 // Note: The Sun customised version of Pango shipping with Solaris 10
39 // crashes if the language is left NULL (see bug 1374114)
203b65dd 40 pango_context_set_language( m_context, gtk_get_default_language() );
3e3b7e75
RD
41 m_layout = pango_layout_new( m_context );
42// m_fontdesc = pango_font_description_copy( widget->style->font_desc );
3e3b7e75 43
cdccdfab 44 m_isScreenDC = true;
e1208c31 45
4bc67cc5 46 SetUpDC();
72cdf4c9 47
4bc67cc5
RR
48 gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
49 gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
50 gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
51 gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
ff7b1510 52}
c801d85f 53
888dde65 54wxScreenDCImpl::~wxScreenDCImpl()
c801d85f 55{
769c3372
PC
56 g_object_unref(m_context);
57
5d25c050
RR
58 gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
59 gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN );
60 gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN );
61 gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN );
ff7b1510
RR
62}
63
888dde65 64void wxScreenDCImpl::DoGetSize(int *width, int *height) const
376aa62a
VZ
65{
66 wxDisplaySize(width, height);
67}