]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation "dcscreen.h"
14 #include "wx/dcscreen.h"
15 #include "wx/window.h"
21 //-----------------------------------------------------------------------------
22 // global data initialization
23 //-----------------------------------------------------------------------------
25 GdkWindow
*wxScreenDC::sm_overlayWindow
= (GdkWindow
*) NULL
;
26 int wxScreenDC::sm_overlayWindowX
= 0;
27 int wxScreenDC::sm_overlayWindowY
= 0;
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC
,wxPaintDC
)
35 wxScreenDC::wxScreenDC()
38 m_cmap
= gdk_colormap_get_system();
39 m_window
= GDK_ROOT_PARENT();
43 gdk_gc_set_subwindow( m_penGC
, GDK_INCLUDE_INFERIORS
);
44 gdk_gc_set_subwindow( m_brushGC
, GDK_INCLUDE_INFERIORS
);
45 gdk_gc_set_subwindow( m_textGC
, GDK_INCLUDE_INFERIORS
);
46 gdk_gc_set_subwindow( m_bgGC
, GDK_INCLUDE_INFERIORS
);
49 wxScreenDC::~wxScreenDC()
51 gdk_gc_set_subwindow( m_penGC
, GDK_CLIP_BY_CHILDREN
);
52 gdk_gc_set_subwindow( m_brushGC
, GDK_CLIP_BY_CHILDREN
);
53 gdk_gc_set_subwindow( m_textGC
, GDK_CLIP_BY_CHILDREN
);
54 gdk_gc_set_subwindow( m_bgGC
, GDK_CLIP_BY_CHILDREN
);
59 bool wxScreenDC::StartDrawingOnTop( wxWindow
*window
)
61 if (!window
) return StartDrawingOnTop();
65 window
->GetPosition( &x
, &y
);
68 window
->GetSize( &w
, &h
);
69 window
->ClientToScreen( &x
, &y
);
77 return StartDrawingOnTop( &rect
);
80 bool wxScreenDC::StartDrawingOnTop( wxRect
*rect
)
84 int width
= gdk_screen_width();
85 int height
= gdk_screen_height();
91 height
= rect
->height
;
97 bool wxScreenDC::EndDrawingOnTop()