]>
git.saurik.com Git - wxWidgets.git/blob - src/x11/dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxScreenDC class
4 // Author: Julian Smart, Robert Roebling
8 // Copyright: (c) Julian Smart, Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/window.h"
14 #include "wx/dcscreen.h"
17 #include "wx/fontutil.h"
19 #include "wx/x11/private.h"
21 //-----------------------------------------------------------------------------
22 // global data initialization
23 //-----------------------------------------------------------------------------
25 WXWindow
*wxScreenDC::sm_overlayWindow
= (WXWindow
*) NULL
;
26 int wxScreenDC::sm_overlayWindowX
= 0;
27 int wxScreenDC::sm_overlayWindowY
= 0;
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC
,wxPaintDC
)
35 wxScreenDC::wxScreenDC()
39 m_display
= (WXDisplay
*) wxGlobalDisplay();
41 int screen
= DefaultScreen( (Display
*) m_display
);
42 m_cmap
= (WXColormap
) DefaultColormap( (Display
*) m_display
, screen
);
44 m_window
= (WXWindow
) RootWindow( (Display
*) m_display
, screen
);
49 m_context
= wxTheApp
->GetPangoContext();
50 m_fontdesc
= wxNORMAL_FONT
->GetNativeFontInfo()->description
;
55 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_penGC
, IncludeInferiors
);
56 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_brushGC
, IncludeInferiors
);
57 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_textGC
, IncludeInferiors
);
58 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_bgGC
, IncludeInferiors
);
61 wxScreenDC::~wxScreenDC()
63 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_penGC
, ClipByChildren
);
64 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_brushGC
, ClipByChildren
);
65 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_textGC
, ClipByChildren
);
66 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_bgGC
, ClipByChildren
);
71 bool wxScreenDC::StartDrawingOnTop( wxWindow
*window
)
73 if (!window
) return StartDrawingOnTop();
77 window
->GetPosition( &x
, &y
);
80 window
->GetSize( &w
, &h
);
81 window
->ClientToScreen( &x
, &y
);
89 return StartDrawingOnTop( &rect
);
92 bool wxScreenDC::StartDrawingOnTop( wxRect
*rectIn
)
94 // VZ: should we do the same thing that wxMotif wxScreenDC does here?
106 DoGetSize(&rect
.width
, &rect
.height
);
113 bool wxScreenDC::EndDrawingOnTop()
118 void wxScreenDC::DoGetSize(int *width
, int *height
) const
120 wxDisplaySize(width
, height
);