]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: dcscreen.cpp | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
dbf858b5 | 5 | // Id: $Id$ |
01111366 | 6 | // Copyright: (c) 1998 Robert Roebling |
72cdf4c9 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | #ifdef __GNUG__ | |
11 | #pragma implementation "dcscreen.h" | |
12 | #endif | |
13 | ||
14 | #include "wx/dcscreen.h" | |
15 | #include "wx/window.h" | |
dbf858b5 | 16 | |
071a2d78 | 17 | #include <gdk/gdk.h> |
5d25c050 | 18 | #include <gdk/gdkx.h> |
071a2d78 | 19 | #include <gtk/gtk.h> |
83624f79 | 20 | |
dbf858b5 RR |
21 | //----------------------------------------------------------------------------- |
22 | // global data initialization | |
23 | //----------------------------------------------------------------------------- | |
24 | ||
25 | GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL; | |
72cdf4c9 VZ |
26 | int wxScreenDC::sm_overlayWindowX = 0; |
27 | int wxScreenDC::sm_overlayWindowY = 0; | |
dbf858b5 | 28 | |
c801d85f KB |
29 | //----------------------------------------------------------------------------- |
30 | // wxScreenDC | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
33 | IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC) | |
34 | ||
72cdf4c9 | 35 | wxScreenDC::wxScreenDC() |
c801d85f | 36 | { |
4bc67cc5 | 37 | m_ok = FALSE; |
4bc67cc5 | 38 | m_cmap = gdk_colormap_get_system(); |
5d25c050 | 39 | m_window = GDK_ROOT_PARENT(); |
72cdf4c9 | 40 | |
4bc67cc5 | 41 | SetUpDC(); |
72cdf4c9 | 42 | |
4bc67cc5 RR |
43 | gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS ); |
44 | gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS ); | |
45 | gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS ); | |
46 | gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS ); | |
ff7b1510 | 47 | } |
c801d85f | 48 | |
72cdf4c9 | 49 | wxScreenDC::~wxScreenDC() |
c801d85f | 50 | { |
5d25c050 RR |
51 | gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN ); |
52 | gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN ); | |
53 | gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN ); | |
54 | gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN ); | |
55 | ||
4bc67cc5 | 56 | EndDrawingOnTop(); |
ff7b1510 | 57 | } |
c801d85f | 58 | |
dbf858b5 | 59 | bool wxScreenDC::StartDrawingOnTop( wxWindow *window ) |
c801d85f | 60 | { |
4bc67cc5 | 61 | if (!window) return StartDrawingOnTop(); |
72cdf4c9 | 62 | |
4bc67cc5 RR |
63 | int x = 0; |
64 | int y = 0; | |
65 | window->GetPosition( &x, &y ); | |
66 | int w = 0; | |
67 | int h = 0; | |
68 | window->GetSize( &w, &h ); | |
69 | window->ClientToScreen( &x, &y ); | |
72cdf4c9 | 70 | |
4bc67cc5 RR |
71 | wxRect rect; |
72 | rect.x = x; | |
73 | rect.y = y; | |
74 | rect.width = 0; | |
75 | rect.height = 0; | |
72cdf4c9 | 76 | |
4bc67cc5 | 77 | return StartDrawingOnTop( &rect ); |
ff7b1510 | 78 | } |
c801d85f | 79 | |
16e93305 | 80 | bool wxScreenDC::StartDrawingOnTop( wxRect *rect ) |
c801d85f | 81 | { |
5d25c050 RR |
82 | int x = 0; |
83 | int y = 0; | |
84 | int width = gdk_screen_width(); | |
85 | int height = gdk_screen_height(); | |
86 | if (rect) | |
87 | { | |
88 | x = rect->x; | |
89 | y = rect->y; | |
90 | width = rect->width; | |
91 | height = rect->height; | |
92 | } | |
c801d85f | 93 | |
5d25c050 | 94 | return TRUE; |
ff7b1510 | 95 | } |
c801d85f | 96 | |
72cdf4c9 | 97 | bool wxScreenDC::EndDrawingOnTop() |
c801d85f | 98 | { |
4bc67cc5 | 99 | return TRUE; |
ff7b1510 RR |
100 | } |
101 |