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