]> git.saurik.com Git - wxWidgets.git/blob - src/gtk/dcscreen.cpp
Use GetFont not m_font for GetCharHeight
[wxWidgets.git] / src / gtk / dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: 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/dcscreen.h"
14 #include "wx/window.h"
15
16 #include <gdk/gdk.h>
17 #include <gdk/gdkx.h>
18 #include <gtk/gtk.h>
19
20 //-----------------------------------------------------------------------------
21 // global data initialization
22 //-----------------------------------------------------------------------------
23
24 GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
25 int wxScreenDC::sm_overlayWindowX = 0;
26 int wxScreenDC::sm_overlayWindowY = 0;
27
28 //-----------------------------------------------------------------------------
29 // wxScreenDC
30 //-----------------------------------------------------------------------------
31
32 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
33
34 wxScreenDC::wxScreenDC()
35 {
36 m_ok = FALSE;
37 m_cmap = gdk_colormap_get_system();
38 m_window = GDK_ROOT_PARENT();
39
40 #ifdef __WXGTK20__
41 m_context = gdk_pango_context_get();
42 m_layout = pango_layout_new( m_context );
43 // m_fontdesc = pango_font_description_copy( widget->style->font_desc );
44 #endif
45
46 m_isScreenDC = TRUE;
47
48 SetUpDC();
49
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 );
54 }
55
56 wxScreenDC::~wxScreenDC()
57 {
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 );
62
63 EndDrawingOnTop();
64 }
65
66 bool wxScreenDC::StartDrawingOnTop( wxWindow * )
67 {
68 return true;
69 }
70
71 bool wxScreenDC::StartDrawingOnTop( wxRect * )
72 {
73 return true;
74 }
75
76 bool wxScreenDC::EndDrawingOnTop()
77 {
78 return true;
79 }
80
81 void wxScreenDC::DoGetSize(int *width, int *height) const
82 {
83 wxDisplaySize(width, height);
84 }