]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: dcscreen.cpp | |
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 KB |
13 | #include "wx/dcscreen.h" |
14 | #include "wx/window.h" | |
dbf858b5 | 15 | |
071a2d78 | 16 | #include <gdk/gdk.h> |
5d25c050 | 17 | #include <gdk/gdkx.h> |
071a2d78 | 18 | #include <gtk/gtk.h> |
83624f79 | 19 | |
dbf858b5 RR |
20 | //----------------------------------------------------------------------------- |
21 | // global data initialization | |
22 | //----------------------------------------------------------------------------- | |
23 | ||
24 | GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL; | |
72cdf4c9 VZ |
25 | int wxScreenDC::sm_overlayWindowX = 0; |
26 | int wxScreenDC::sm_overlayWindowY = 0; | |
dbf858b5 | 27 | |
c801d85f KB |
28 | //----------------------------------------------------------------------------- |
29 | // wxScreenDC | |
30 | //----------------------------------------------------------------------------- | |
31 | ||
32 | IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC) | |
33 | ||
72cdf4c9 | 34 | wxScreenDC::wxScreenDC() |
c801d85f | 35 | { |
4bc67cc5 | 36 | m_ok = FALSE; |
4bc67cc5 | 37 | m_cmap = gdk_colormap_get_system(); |
5d25c050 | 38 | m_window = GDK_ROOT_PARENT(); |
72cdf4c9 | 39 | |
3e3b7e75 RD |
40 | #ifdef __WXGTK20__ |
41 | m_context = gdk_pango_context_get(); | |
e90d93d1 MW |
42 | // Note: The Sun customised version of Pango shipping with Solaris 10 |
43 | // crashes if the language is left NULL (see bug 1374114) | |
203b65dd | 44 | pango_context_set_language( m_context, gtk_get_default_language() ); |
3e3b7e75 RD |
45 | m_layout = pango_layout_new( m_context ); |
46 | // m_fontdesc = pango_font_description_copy( widget->style->font_desc ); | |
47 | #endif | |
48 | ||
e1208c31 RR |
49 | m_isScreenDC = TRUE; |
50 | ||
4bc67cc5 | 51 | SetUpDC(); |
72cdf4c9 | 52 | |
4bc67cc5 RR |
53 | gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS ); |
54 | gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS ); | |
55 | gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS ); | |
56 | gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS ); | |
ff7b1510 | 57 | } |
c801d85f | 58 | |
72cdf4c9 | 59 | wxScreenDC::~wxScreenDC() |
c801d85f | 60 | { |
5d25c050 RR |
61 | gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN ); |
62 | gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN ); | |
63 | gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN ); | |
64 | gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN ); | |
65 | ||
4bc67cc5 | 66 | EndDrawingOnTop(); |
ff7b1510 | 67 | } |
c801d85f | 68 | |
b3d6b0c9 | 69 | bool wxScreenDC::StartDrawingOnTop( wxWindow * ) |
c801d85f | 70 | { |
b3d6b0c9 | 71 | return true; |
ff7b1510 | 72 | } |
c801d85f | 73 | |
b3d6b0c9 | 74 | bool wxScreenDC::StartDrawingOnTop( wxRect * ) |
c801d85f | 75 | { |
b3d6b0c9 | 76 | return true; |
ff7b1510 | 77 | } |
c801d85f | 78 | |
72cdf4c9 | 79 | bool wxScreenDC::EndDrawingOnTop() |
c801d85f | 80 | { |
b3d6b0c9 | 81 | return true; |
ff7b1510 RR |
82 | } |
83 | ||
376aa62a VZ |
84 | void wxScreenDC::DoGetSize(int *width, int *height) const |
85 | { | |
86 | wxDisplaySize(width, height); | |
87 | } |