]>
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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "dcscreen.h"
16 #include "wx/window.h"
18 #include "wx/dcscreen.h"
21 #include "wx/fontutil.h"
23 #include "wx/x11/private.h"
25 //-----------------------------------------------------------------------------
26 // global data initialization
27 //-----------------------------------------------------------------------------
29 WXWindow
*wxScreenDC::sm_overlayWindow
= (WXWindow
*) NULL
;
30 int wxScreenDC::sm_overlayWindowX
= 0;
31 int wxScreenDC::sm_overlayWindowY
= 0;
33 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
37 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC
,wxPaintDC
)
39 wxScreenDC::wxScreenDC()
43 m_display
= (WXDisplay
*) wxGlobalDisplay();
45 int screen
= DefaultScreen( (Display
*) m_display
);
46 m_cmap
= (WXColormap
) DefaultColormap( (Display
*) m_display
, screen
);
48 m_window
= (WXWindow
) RootWindow( (Display
*) m_display
, screen
);
53 m_context
= wxTheApp
->GetPangoContext();
54 m_fontdesc
= wxNORMAL_FONT
->GetNativeFontInfo()->description
;
59 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_penGC
, IncludeInferiors
);
60 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_brushGC
, IncludeInferiors
);
61 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_textGC
, IncludeInferiors
);
62 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_bgGC
, IncludeInferiors
);
65 wxScreenDC::~wxScreenDC()
67 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_penGC
, ClipByChildren
);
68 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_brushGC
, ClipByChildren
);
69 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_textGC
, ClipByChildren
);
70 XSetSubwindowMode( (Display
*) m_display
, (GC
) m_bgGC
, ClipByChildren
);
75 bool wxScreenDC::StartDrawingOnTop( wxWindow
*window
)
77 if (!window
) return StartDrawingOnTop();
81 window
->GetPosition( &x
, &y
);
84 window
->GetSize( &w
, &h
);
85 window
->ClientToScreen( &x
, &y
);
93 return StartDrawingOnTop( &rect
);
96 bool wxScreenDC::StartDrawingOnTop( wxRect
*rectIn
)
98 // VZ: should we do the same thing that wxMotif wxScreenDC does here?
110 DoGetSize(&rect
.width
, &rect
.height
);
117 bool wxScreenDC::EndDrawingOnTop()
122 void wxScreenDC::DoGetSize(int *width
, int *height
) const
124 wxDisplaySize(width
, height
);