more DC changes for wxX11
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -13,32 +13,23 @@
|
|||||||
#define _WX_DCSCREEN_H_
|
#define _WX_DCSCREEN_H_
|
||||||
|
|
||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
|
#include "wx/x11/dcclient.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxScreenDC
|
// wxScreenDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxScreenDC : public wxPaintDC
|
class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxPaintDCImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxScreenDC();
|
wxScreenDCImpl( wxDC *owner);
|
||||||
virtual ~wxScreenDC();
|
virtual ~wxScreenDCImpl();
|
||||||
|
|
||||||
static bool StartDrawingOnTop( wxWindow *window );
|
|
||||||
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
|
||||||
static bool EndDrawingOnTop();
|
|
||||||
|
|
||||||
// implementation
|
|
||||||
|
|
||||||
static WXWindow *sm_overlayWindow;
|
|
||||||
static int sm_overlayWindowX;
|
|
||||||
static int sm_overlayWindowY;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
DECLARE_CLASS(wxScreenDCImpl)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -56,6 +56,12 @@
|
|||||||
#include "wx/mac/dcscreen.h"
|
#include "wx/mac/dcscreen.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXX11__
|
||||||
|
#include "wx/x11/dcclient.h"
|
||||||
|
#include "wx/x11/dcmemory.h"
|
||||||
|
#include "wx/x11/dcscreen.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
// wxDCFactory
|
// wxDCFactory
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#include "wx/dcscreen.h"
|
#include "wx/dcscreen.h"
|
||||||
|
#include "wx/x11/dcscreen.h"
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
@@ -25,21 +26,14 @@
|
|||||||
|
|
||||||
#include "wx/x11/private.h"
|
#include "wx/x11/private.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data initialization
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
WXWindow *wxScreenDC::sm_overlayWindow = (WXWindow*) NULL;
|
|
||||||
int wxScreenDC::sm_overlayWindowX = 0;
|
|
||||||
int wxScreenDC::sm_overlayWindowY = 0;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxScreenDC
|
// wxScreenDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
|
IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl,wxPaintDCImpl)
|
||||||
|
|
||||||
wxScreenDC::wxScreenDC()
|
wxScreenDCImpl::wxScreenDCImpl( wxDC* owner ) :
|
||||||
|
wxPaintDCImpl( owner )
|
||||||
{
|
{
|
||||||
m_ok = false;
|
m_ok = false;
|
||||||
|
|
||||||
@@ -48,7 +42,7 @@ wxScreenDC::wxScreenDC()
|
|||||||
int screen = DefaultScreen( (Display*) m_display );
|
int screen = DefaultScreen( (Display*) m_display );
|
||||||
m_cmap = (WXColormap) DefaultColormap( (Display*) m_display, screen );
|
m_cmap = (WXColormap) DefaultColormap( (Display*) m_display, screen );
|
||||||
|
|
||||||
m_window = (WXWindow) RootWindow( (Display*) m_display, screen );
|
m_x11window = (WXWindow) RootWindow( (Display*) m_display, screen );
|
||||||
|
|
||||||
m_isScreenDC = true;
|
m_isScreenDC = true;
|
||||||
|
|
||||||
@@ -65,49 +59,11 @@ wxScreenDC::wxScreenDC()
|
|||||||
XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, IncludeInferiors );
|
XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, IncludeInferiors );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxScreenDC::~wxScreenDC()
|
wxScreenDCImpl::~wxScreenDCImpl()
|
||||||
{
|
{
|
||||||
XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, ClipByChildren );
|
XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, ClipByChildren );
|
||||||
XSetSubwindowMode( (Display*) m_display, (GC) m_brushGC, ClipByChildren );
|
XSetSubwindowMode( (Display*) m_display, (GC) m_brushGC, ClipByChildren );
|
||||||
XSetSubwindowMode( (Display*) m_display, (GC) m_textGC, ClipByChildren );
|
XSetSubwindowMode( (Display*) m_display, (GC) m_textGC, ClipByChildren );
|
||||||
XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, ClipByChildren );
|
XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, ClipByChildren );
|
||||||
|
|
||||||
EndDrawingOnTop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
|
|
||||||
{
|
|
||||||
if (!window) return StartDrawingOnTop();
|
|
||||||
|
|
||||||
int x = 0;
|
|
||||||
int y = 0;
|
|
||||||
window->GetPosition( &x, &y );
|
|
||||||
int w = 0;
|
|
||||||
int h = 0;
|
|
||||||
window->GetSize( &w, &h );
|
|
||||||
window->ClientToScreen( &x, &y );
|
|
||||||
|
|
||||||
wxRect rect;
|
|
||||||
rect.x = x;
|
|
||||||
rect.y = y;
|
|
||||||
rect.width = 0;
|
|
||||||
rect.height = 0;
|
|
||||||
|
|
||||||
return StartDrawingOnTop( &rect );
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxScreenDC::StartDrawingOnTop( wxRect *WXUNUSED(rectIn) )
|
|
||||||
{
|
|
||||||
// VZ: should we do the same thing that wxMotif wxScreenDC does here?
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool wxScreenDC::EndDrawingOnTop()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxScreenDC::DoGetSize(int *width, int *height) const
|
|
||||||
{
|
|
||||||
wxDisplaySize(width, height);
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user