Removed usage of GdkImlib
[wxWidgets.git] / src / gtk1 / dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcscreen.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifdef __GNUG__
11 #pragma implementation "dcscreen.h"
12 #endif
13
14 #include "wx/dcscreen.h"
15 #include "wx/window.h"
16 #include "gdk/gdkx.h"
17
18 //-----------------------------------------------------------------------------
19 // wxScreenDC
20 //-----------------------------------------------------------------------------
21
22 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
23
24 wxScreenDC::wxScreenDC(void)
25 {
26 m_ok = FALSE;
27 m_window = (GdkWindow *) NULL;
28 m_cmap = gdk_colormap_get_system();
29
30 m_window = GDK_ROOT_PARENT();
31
32 SetUpDC();
33
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 );
38 }
39
40 wxScreenDC::~wxScreenDC(void)
41 {
42 EndDrawingOnTop();
43 }
44
45 bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
46 {
47 return TRUE;
48 /*
49 if (!window)
50 {
51 StartDrawingOnTop();
52 return;
53 }
54 wxRectangle rect;
55 rect.x = 0;
56 rect.y = 0;
57 window->GetPosition( &rect.x, &rect.y );
58 rect.width = 0;
59 rect.height = 0;
60 window->GetSize( &rect.width, &rect.height );
61 window->ClientToScreen( &rect.x, &rect.y );
62 StartDrawingOnTop( &rect );
63 return TRUE;
64 */
65 }
66
67 bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
68 {
69 return TRUE;
70 /*
71 int x = 0;
72 int y = 0;
73 int width = gdk_screen_width();
74 int height = gdk_screen_height();
75 if (rect)
76 {
77 x = rect->x;
78 y = rect->y;
79 width = rect->width;
80 height = rect->height;
81 }
82
83 GTK cannot set transparent backgrounds. :-(
84
85 GdkWindowAttr attr;
86 attr.x = x;
87 attr.y = y;
88 attr.width = width;
89 attr.height = height;
90 attr.override_redirect = TRUE;
91 attr.wclass = GDK_INPUT_OUTPUT;
92 attr.event_mask = 0;
93 attr.window_type = GDK_WINDOW_TEMP;
94 m_window = gdk_window_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
95
96 gdk_window_show( m_window );
97
98 m_window = GDK_ROOT_PARENT();
99
100 SetUpDC();
101
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 );
106
107 return TRUE;
108 */
109 }
110
111 bool wxScreenDC::EndDrawingOnTop(void)
112 {
113 return TRUE;
114 /*
115 if (m_window) gdk_window_destroy( m_window );
116 m_window = NULL;
117 m_isOk = FALSE;
118 return TRUE;
119 */
120 }
121