]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/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();
45 gdk_gc_set_subwindow( m_penGC
, GDK_INCLUDE_INFERIORS
);
46 gdk_gc_set_subwindow( m_brushGC
, GDK_INCLUDE_INFERIORS
);
47 gdk_gc_set_subwindow( m_textGC
, GDK_INCLUDE_INFERIORS
);
48 gdk_gc_set_subwindow( m_bgGC
, GDK_INCLUDE_INFERIORS
);
51 wxScreenDC::~wxScreenDC()
53 gdk_gc_set_subwindow( m_penGC
, GDK_CLIP_BY_CHILDREN
);
54 gdk_gc_set_subwindow( m_brushGC
, GDK_CLIP_BY_CHILDREN
);
55 gdk_gc_set_subwindow( m_textGC
, GDK_CLIP_BY_CHILDREN
);
56 gdk_gc_set_subwindow( m_bgGC
, GDK_CLIP_BY_CHILDREN
);
61 bool wxScreenDC::StartDrawingOnTop( wxWindow
*window
)
63 if (!window
) return StartDrawingOnTop();
67 window
->GetPosition( &x
, &y
);
70 window
->GetSize( &w
, &h
);
71 window
->ClientToScreen( &x
, &y
);
79 return StartDrawingOnTop( &rect
);
82 bool wxScreenDC::StartDrawingOnTop( wxRect
*rect
)
86 int width
= gdk_screen_width();
87 int height
= gdk_screen_height();
93 height
= rect
->height
;
99 bool wxScreenDC::EndDrawingOnTop()
104 void wxScreenDC::DoGetSize(int *width
, int *height
) const
106 wxDisplaySize(width
, height
);