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