]> git.saurik.com Git - wxWidgets.git/blame - src/x11/dcmemory.cpp
Show full screen windows with WS_POPUP style in wxMSW.
[wxWidgets.git] / src / x11 / dcmemory.cpp
CommitLineData
83df96d6 1/////////////////////////////////////////////////////////////////////////////
de6185e2 2// Name: src/x11/dcmemory.cpp
83df96d6
JS
3// Purpose: wxMemoryDC class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
83df96d6 7// Copyright: (c) Julian Smart
de6185e2 8// Licence: wxWindows licence
83df96d6
JS
9/////////////////////////////////////////////////////////////////////////////
10
de6185e2
WS
11// for compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
83df96d6 14#include "wx/dcmemory.h"
de6185e2
WS
15
16#ifndef WX_PRECOMP
17 #include "wx/utils.h"
9eddec69 18 #include "wx/settings.h"
de6185e2
WS
19#endif
20
7266b672 21#include "wx/x11/private.h"
2b77c3fc 22#include "wx/x11/dcmemory.h"
83df96d6 23
2b77c3fc 24IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl,wxWindowDCImpl)
83df96d6 25
2b77c3fc
RR
26wxMemoryDCImpl::wxMemoryDCImpl( wxDC *owner )
27 : wxWindowDCImpl( owner )
03647350 28{
2b77c3fc
RR
29 Init();
30}
31
32wxMemoryDCImpl::wxMemoryDCImpl( wxDC *owner, wxBitmap& bitmap )
33 : wxWindowDCImpl( owner )
03647350
VZ
34{
35 Init();
2b77c3fc
RR
36 DoSelect(bitmap);
37}
38
39wxMemoryDCImpl::wxMemoryDCImpl( wxDC* owner, wxDC *WXUNUSED(dc) )
40 : wxWindowDCImpl( owner )
41{
42 Init();
43}
44
45void wxMemoryDCImpl::Init()
83df96d6 46{
de6185e2
WS
47 m_ok = false;
48
3cd0b8c5
RR
49 m_display = (WXDisplay *) wxGlobalDisplay();
50
51 int screen = DefaultScreen( wxGlobalDisplay() );
52 m_cmap = (WXColormap) DefaultColormap( wxGlobalDisplay(), screen );
53}
83df96d6 54
2b77c3fc 55wxMemoryDCImpl::~wxMemoryDCImpl()
83df96d6 56{
3cd0b8c5 57}
83df96d6 58
2b77c3fc 59void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
83df96d6 60{
3cd0b8c5 61 Destroy();
de6185e2 62
3cd0b8c5 63 m_selected = bitmap;
a1b806b9 64 if (m_selected.IsOk())
83df96d6 65 {
3cd0b8c5
RR
66 if (m_selected.GetPixmap())
67 {
2b77c3fc 68 m_x11window = (WXWindow) m_selected.GetPixmap();
3cd0b8c5
RR
69 }
70 else
71 {
2b77c3fc 72 m_x11window = m_selected.GetBitmap();
3cd0b8c5
RR
73 }
74
de6185e2 75 m_isMemDC = true;
3cd0b8c5
RR
76
77 SetUpDC();
83df96d6
JS
78 }
79 else
80 {
de6185e2 81 m_ok = false;
2b77c3fc 82 m_x11window = NULL;
3cd0b8c5
RR
83 }
84}
83df96d6 85
2b77c3fc 86void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
83df96d6 87{
a1b806b9 88 if (m_selected.IsOk())
83df96d6 89 {
3cd0b8c5
RR
90 if (width) (*width) = m_selected.GetWidth();
91 if (height) (*height) = m_selected.GetHeight();
83df96d6
JS
92 }
93 else
94 {
95 if (width) (*width) = 0;
96 if (height) (*height) = 0;
3cd0b8c5
RR
97 }
98}
2b77c3fc
RR
99
100const wxBitmap& wxMemoryDCImpl::GetSelectedBitmap() const
101{
102 return m_selected;
103}
104
105wxBitmap& wxMemoryDCImpl::GetSelectedBitmap()
106{
107 return m_selected;
108}