]> git.saurik.com Git - wxWidgets.git/blame - src/gtk/dcscreen.cpp
Corrected Clone return type
[wxWidgets.git] / src / gtk / dcscreen.cpp
CommitLineData
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
25GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
72cdf4c9
VZ
26int wxScreenDC::sm_overlayWindowX = 0;
27int wxScreenDC::sm_overlayWindowY = 0;
dbf858b5 28
c801d85f
KB
29//-----------------------------------------------------------------------------
30// wxScreenDC
31//-----------------------------------------------------------------------------
32
33IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
34
72cdf4c9 35wxScreenDC::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
e1208c31
RR
41 m_isScreenDC = TRUE;
42
4bc67cc5 43 SetUpDC();
72cdf4c9 44
4bc67cc5
RR
45 gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
46 gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
47 gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
48 gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
ff7b1510 49}
c801d85f 50
72cdf4c9 51wxScreenDC::~wxScreenDC()
c801d85f 52{
5d25c050
RR
53 gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
54 gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN );
55 gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN );
56 gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN );
57
4bc67cc5 58 EndDrawingOnTop();
ff7b1510 59}
c801d85f 60
dbf858b5 61bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
c801d85f 62{
4bc67cc5 63 if (!window) return StartDrawingOnTop();
72cdf4c9 64
4bc67cc5
RR
65 int x = 0;
66 int y = 0;
67 window->GetPosition( &x, &y );
68 int w = 0;
69 int h = 0;
70 window->GetSize( &w, &h );
71 window->ClientToScreen( &x, &y );
72cdf4c9 72
4bc67cc5
RR
73 wxRect rect;
74 rect.x = x;
75 rect.y = y;
76 rect.width = 0;
77 rect.height = 0;
72cdf4c9 78
4bc67cc5 79 return StartDrawingOnTop( &rect );
ff7b1510 80}
c801d85f 81
16e93305 82bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
c801d85f 83{
5d25c050
RR
84 int x = 0;
85 int y = 0;
86 int width = gdk_screen_width();
87 int height = gdk_screen_height();
88 if (rect)
89 {
90 x = rect->x;
91 y = rect->y;
92 width = rect->width;
93 height = rect->height;
94 }
c801d85f 95
5d25c050 96 return TRUE;
ff7b1510 97}
c801d85f 98
72cdf4c9 99bool wxScreenDC::EndDrawingOnTop()
c801d85f 100{
4bc67cc5 101 return TRUE;
ff7b1510
RR
102}
103
376aa62a
VZ
104void wxScreenDC::DoGetSize(int *width, int *height) const
105{
106 wxDisplaySize(width, height);
107}