]>
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"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC
,wxPaintDC
)
24 wxScreenDC::wxScreenDC(void)
27 m_window
= (GdkWindow
*) NULL
;
28 m_cmap
= gdk_colormap_get_system();
30 m_window
= GDK_ROOT_PARENT();
34 gdk_gc_set_subwindow( m_penGC
, GDK_INCLUDE_INFERIORS
);
35 gdk_gc_set_subwindow( m_brushGC
, GDK_INCLUDE_INFERIORS
);
36 gdk_gc_set_subwindow( m_textGC
, GDK_INCLUDE_INFERIORS
);
37 gdk_gc_set_subwindow( m_bgGC
, GDK_INCLUDE_INFERIORS
);
40 wxScreenDC::~wxScreenDC(void)
45 bool wxScreenDC::StartDrawingOnTop( wxWindow
*WXUNUSED(window
) )
57 window->GetPosition( &rect.x, &rect.y );
60 window->GetSize( &rect.width, &rect.height );
61 window->ClientToScreen( &rect.x, &rect.y );
62 StartDrawingOnTop( &rect );
67 bool wxScreenDC::StartDrawingOnTop( wxRectangle
*WXUNUSED(rect
) )
73 int width = gdk_screen_width();
74 int height = gdk_screen_height();
80 height = rect->height;
83 GTK cannot set transparent backgrounds. :-(
90 attr.override_redirect = TRUE;
91 attr.wclass = GDK_INPUT_OUTPUT;
93 attr.window_type = GDK_WINDOW_TEMP;
94 m_window = gdk_window_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
96 gdk_window_show( m_window );
98 m_window = GDK_ROOT_PARENT();
102 gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
103 gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
104 gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
105 gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
111 bool wxScreenDC::EndDrawingOnTop(void)
115 if (m_window) gdk_window_destroy( m_window );