]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "dcscreen.h"
15 #include "wx/dcscreen.h"
16 #include "wx/window.h"
19 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
23 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC
,wxPaintDC
)
25 wxScreenDC::wxScreenDC(void)
29 m_cmap
= gdk_colormap_get_system();
31 m_window
= GDK_ROOT_PARENT();
35 gdk_gc_set_subwindow( m_penGC
, GDK_INCLUDE_INFERIORS
);
36 gdk_gc_set_subwindow( m_brushGC
, GDK_INCLUDE_INFERIORS
);
37 gdk_gc_set_subwindow( m_textGC
, GDK_INCLUDE_INFERIORS
);
38 gdk_gc_set_subwindow( m_bgGC
, GDK_INCLUDE_INFERIORS
);
41 wxScreenDC::~wxScreenDC(void)
46 bool wxScreenDC::StartDrawingOnTop( wxWindow
*WXUNUSED(window
) )
58 window->GetPosition( &rect.x, &rect.y );
61 window->GetSize( &rect.width, &rect.height );
62 window->ClientToScreen( &rect.x, &rect.y );
63 StartDrawingOnTop( &rect );
68 bool wxScreenDC::StartDrawingOnTop( wxRectangle
*WXUNUSED(rect
) )
74 int width = gdk_screen_width();
75 int height = gdk_screen_height();
81 height = rect->height;
84 GTK cannot set transparent backgrounds. :-(
91 attr.override_redirect = TRUE;
92 attr.wclass = GDK_INPUT_OUTPUT;
94 attr.window_type = GDK_WINDOW_TEMP;
95 m_window = gdk_window_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
97 gdk_window_show( m_window );
99 m_window = GDK_ROOT_PARENT();
103 gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
104 gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
105 gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
106 gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
112 bool wxScreenDC::EndDrawingOnTop(void)
116 if (m_window) gdk_window_destroy( m_window );