DC reorganization
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50348 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
924
include/wx/dc.h
924
include/wx/dc.h
File diff suppressed because it is too large
Load Diff
@@ -41,7 +41,7 @@
|
||||
// is private style and not returned by GetStyle.
|
||||
#define wxBUFFER_USES_SHARED_BUFFER 0x04
|
||||
|
||||
class WXDLLEXPORT wxBufferedDC : public wxMemoryDC
|
||||
class WXDLLIMPEXP_CORE wxBufferedDC : public wxMemoryDC
|
||||
{
|
||||
public:
|
||||
// Default ctor, must subsequently call Init for two stage construction.
|
||||
@@ -149,7 +149,7 @@ private:
|
||||
|
||||
// Creates a double buffered wxPaintDC, optionally allowing the
|
||||
// user to specify their own buffer to use.
|
||||
class WXDLLEXPORT wxBufferedPaintDC : public wxBufferedDC
|
||||
class WXDLLIMPEXP_CORE wxBufferedPaintDC : public wxBufferedDC
|
||||
{
|
||||
public:
|
||||
// If no bitmap is supplied by the user, a temporary one will be created.
|
||||
@@ -219,7 +219,7 @@ private:
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
|
||||
class wxAutoBufferedPaintDC : public wxAutoBufferedPaintDCBase
|
||||
class WXDLLIMPEXP_CORE wxAutoBufferedPaintDC : public wxAutoBufferedPaintDCBase
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -247,7 +247,7 @@ private:
|
||||
#else // !__WXDEBUG__
|
||||
|
||||
// In release builds, just use typedef
|
||||
typedef wxAutoBufferedPaintDCBase wxAutoBufferedPaintDC;
|
||||
typedef WXDLLIMPEXP_CORE wxAutoBufferedPaintDCBase wxAutoBufferedPaintDC;
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -12,31 +12,49 @@
|
||||
#ifndef _WX_DCCLIENT_H_BASE_
|
||||
#define _WX_DCCLIENT_H_BASE_
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/dc.h"
|
||||
|
||||
#if defined(__WXPALMOS__)
|
||||
#include "wx/palmos/dcclient.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dcclient.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcclient.h"
|
||||
#elif defined(__WXGTK20__)
|
||||
#include "wx/gtk/dcclient.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk1/dcclient.h"
|
||||
#elif defined(__WXX11__)
|
||||
#include "wx/x11/dcclient.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcclient.h"
|
||||
#elif defined(__WXDFB__)
|
||||
#include "wx/dfb/dcclient.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dcclient.h"
|
||||
#elif defined(__WXCOCOA__)
|
||||
#include "wx/cocoa/dcclient.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dcclient.h"
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindowDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
|
||||
{
|
||||
public:
|
||||
wxWindowDC();
|
||||
wxWindowDC( wxWindow *win );
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxClientDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxClientDC : public wxWindowDC
|
||||
{
|
||||
public:
|
||||
wxClientDC();
|
||||
wxClientDC( wxWindow *win );
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPaintDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDC
|
||||
{
|
||||
public:
|
||||
wxPaintDC();
|
||||
wxPaintDC( wxWindow *win );
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCCLIENT_H_BASE_
|
||||
|
@@ -20,27 +20,32 @@
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindowDC;
|
||||
|
||||
#ifdef __WXMAC__
|
||||
#define wxGCDC wxDC
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxGCDC:
|
||||
#ifdef __WXMAC__
|
||||
public wxDCBase
|
||||
#else
|
||||
public wxDC
|
||||
#endif
|
||||
class WXDLLEXPORT wxGCDC: public wxDC
|
||||
{
|
||||
public:
|
||||
wxGCDC( const wxWindowDC& dc );
|
||||
wxGCDC( const wxMemoryDC& dc );
|
||||
wxGCDC();
|
||||
|
||||
wxGraphicsContext* GetGraphicsContext();
|
||||
void SetGraphicsContext( wxGraphicsContext* ctx );
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGCDC)
|
||||
DECLARE_NO_COPY_CLASS(wxGCDC)
|
||||
};
|
||||
|
||||
|
||||
|
||||
class WXDLLEXPORT wxGCDCImpl: public wxDCImpl
|
||||
{
|
||||
public:
|
||||
wxGCDC(const wxWindowDC& dc);
|
||||
#ifdef __WXMSW__
|
||||
wxGCDC( const wxMemoryDC& dc);
|
||||
#endif
|
||||
wxGCDC();
|
||||
virtual ~wxGCDC();
|
||||
wxGCDCImpl( wxDC *owner, const wxWindowDC& dc );
|
||||
wxGCDCImpl( wxDC *owner, const wxMemoryDC& dc );
|
||||
wxGCDCImpl( wxDC *owner );
|
||||
|
||||
virtual ~wxGCDCImpl();
|
||||
|
||||
void Init();
|
||||
|
||||
@@ -190,6 +195,10 @@ protected:
|
||||
double m_formerScaleX, m_formerScaleY;
|
||||
|
||||
wxGraphicsContext* m_graphicContext;
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxGCDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxGCDCImpl)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -15,9 +15,6 @@
|
||||
#include "wx/dc.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMemoryDC
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -44,70 +41,5 @@ private:
|
||||
};
|
||||
|
||||
|
||||
|
||||
#else
|
||||
|
||||
// NOTE: different native implementations of wxMemoryDC will derive from
|
||||
// different wxDC classes (wxPaintDC, wxWindowDC, etc), so that
|
||||
// we cannot derive wxMemoryDCBase from wxDC and then use it as the
|
||||
// only base class for native impl of wxMemoryDC...
|
||||
class WXDLLEXPORT wxMemoryDCBase
|
||||
{
|
||||
public:
|
||||
wxMemoryDCBase() { }
|
||||
|
||||
// avoid warnings about having virtual functions but non virtual dtor
|
||||
virtual ~wxMemoryDCBase() { }
|
||||
|
||||
// select the given bitmap to draw on it
|
||||
void SelectObject(wxBitmap& bmp)
|
||||
{
|
||||
// make sure that the given wxBitmap is not sharing its data with other
|
||||
// wxBitmap instances as its contents will be modified by any drawing
|
||||
// operation done on this DC
|
||||
if (bmp.IsOk())
|
||||
bmp.UnShare();
|
||||
|
||||
DoSelect(bmp);
|
||||
}
|
||||
|
||||
// select the given bitmap for read-only
|
||||
virtual void SelectObjectAsSource(const wxBitmap& bmp)
|
||||
{
|
||||
DoSelect(bmp);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void DoSelect(const wxBitmap& bmp) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXPALMOS__)
|
||||
#include "wx/palmos/dcmemory.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dcmemory.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcmemory.h"
|
||||
#elif defined(__WXGTK20__)
|
||||
#include "wx/gtk/dcmemory.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk1/dcmemory.h"
|
||||
#elif defined(__WXX11__)
|
||||
#include "wx/x11/dcmemory.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcmemory.h"
|
||||
#elif defined(__WXDFB__)
|
||||
#include "wx/dfb/dcmemory.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dcmemory.h"
|
||||
#elif defined(__WXCOCOA__)
|
||||
#include "wx/cocoa/dcmemory.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dcmemory.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_DCMEMORY_H_BASE_
|
||||
|
@@ -16,8 +16,6 @@
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -38,22 +36,9 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS()
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
|
||||
#if defined(__WXPALMOS__)
|
||||
#include "wx/palmos/dcprint.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dcprint.h"
|
||||
#endif
|
||||
#if defined(__WXPM__)
|
||||
#include "wx/os2/dcprint.h"
|
||||
#endif
|
||||
#if defined(__WXMAC__)
|
||||
#include "wx/mac/dcprint.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_NEW_DC
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
#endif
|
||||
// wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#endif
|
||||
// _WX_DCPRINT_H_BASE_
|
||||
|
@@ -15,9 +15,7 @@
|
||||
#include "wx/defs.h"
|
||||
#include "wx/dc.h"
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
|
||||
class WXDLLIMPEXP_CORE wxScreenDC : public wxWindowDC
|
||||
class WXDLLIMPEXP_CORE wxScreenDC : public wxDC
|
||||
{
|
||||
public:
|
||||
wxScreenDC();
|
||||
@@ -33,32 +31,6 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__WXPALMOS__)
|
||||
#include "wx/palmos/dcscreen.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/dcscreen.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcscreen.h"
|
||||
#elif defined(__WXGTK20__)
|
||||
#include "wx/gtk/dcscreen.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk1/dcscreen.h"
|
||||
#elif defined(__WXX11__)
|
||||
#include "wx/x11/dcscreen.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcscreen.h"
|
||||
#elif defined(__WXDFB__)
|
||||
#include "wx/dfb/dcscreen.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dcscreen.h"
|
||||
#elif defined(__WXCOCOA__)
|
||||
#include "wx/cocoa/dcscreen.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dcscreen.h"
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_DCSCREEN_H_BASE_
|
||||
|
@@ -31,23 +31,23 @@ class WXDLLIMPEXP_FWD_BASE wxFileOutputStream;
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLIMPEXP_FWD_BASE wxSVGFileDC;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSVGFileImplDC : public wxImplDC
|
||||
class WXDLLIMPEXP_CORE wxSVGFileDCImpl : public wxDCImpl
|
||||
#else
|
||||
#define wxSVGFileImplDC wxSVGFileDC
|
||||
#define wxSVGFileDCImpl wxSVGFileDC
|
||||
class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
wxSVGFileImplDC( wxSVGFileDC *owner, const wxString &filename,
|
||||
wxSVGFileDCImpl( wxSVGFileDC *owner, const wxString &filename,
|
||||
int width=320, int height=240, double dpi=72.0 );
|
||||
#else
|
||||
wxSVGFileDC( const wxString &filename,
|
||||
int width=320, int height=240, double dpi=72.0 );
|
||||
#endif
|
||||
|
||||
virtual ~wxSVGFileImplDC();
|
||||
virtual ~wxSVGFileDCImpl();
|
||||
|
||||
bool IsOk() const { return m_OK; }
|
||||
|
||||
@@ -217,7 +217,7 @@ private:
|
||||
double m_dpi;
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxSVGFileImplDC)
|
||||
DECLARE_ABSTRACT_CLASS(wxSVGFileDCImpl)
|
||||
};
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
wxSVGFileDC( const wxString &filename,
|
||||
int width=320, int height=240, double dpi=72.0 )
|
||||
{
|
||||
m_pimpl = new wxSVGFileImplDC( this, filename, width, height, dpi );
|
||||
m_pimpl = new wxSVGFileDCImpl( this, filename, width, height, dpi );
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
@@ -44,18 +44,18 @@ private:
|
||||
#endif
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLEXPORT wxPostScriptImplDC : public wxImplDC
|
||||
class WXDLLEXPORT wxPostScriptDCImpl : public wxDCImpl
|
||||
#else
|
||||
#define wxPostScriptImplDC wxPostScriptDC
|
||||
#define wxPostScriptDCImpl wxPostScriptDC
|
||||
class WXDLLEXPORT wxPostScriptDC : public wxDC
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
#if wxUSE_NEW_DC
|
||||
wxPostScriptImplDC( wxPrinterDC *owner );
|
||||
wxPostScriptImplDC( wxPrinterDC *owner, const wxPrintData& data );
|
||||
wxPostScriptImplDC( wxPostScriptDC *owner );
|
||||
wxPostScriptImplDC( wxPostScriptDC *owner, const wxPrintData& data );
|
||||
wxPostScriptDCImpl( wxPrinterDC *owner );
|
||||
wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
||||
wxPostScriptDCImpl( wxPostScriptDC *owner );
|
||||
wxPostScriptDCImpl( wxPostScriptDC *owner, const wxPrintData& data );
|
||||
#else
|
||||
wxPostScriptDC();
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
void Init();
|
||||
|
||||
virtual ~wxPostScriptImplDC();
|
||||
virtual ~wxPostScriptDCImpl();
|
||||
|
||||
virtual bool Ok() const { return IsOk(); }
|
||||
virtual bool IsOk() const;
|
||||
@@ -168,7 +168,7 @@ protected:
|
||||
double m_pageHeight;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptImplDC)
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptDCImpl)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "wx/printdlg.h"
|
||||
#include "wx/listctrl.h"
|
||||
|
||||
#include "wx/dc.h"
|
||||
#if wxUSE_POSTSCRIPT
|
||||
#include "wx/dcps.h"
|
||||
#endif
|
||||
|
@@ -395,10 +395,7 @@ public:
|
||||
virtual ~wxGraphicsContext();
|
||||
|
||||
static wxGraphicsContext* Create( const wxWindowDC& dc) ;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
static wxGraphicsContext * Create( const wxMemoryDC& dc) ;
|
||||
#endif
|
||||
|
||||
static wxGraphicsContext* CreateFromNative( void * context ) ;
|
||||
|
||||
@@ -654,9 +651,8 @@ public :
|
||||
// Context
|
||||
|
||||
virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0 ;
|
||||
#ifdef __WXMSW__
|
||||
virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc) = 0 ;
|
||||
#endif
|
||||
|
||||
virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ) = 0;
|
||||
|
||||
virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window ) = 0;
|
||||
|
@@ -414,7 +414,7 @@ protected:
|
||||
virtual void DoSetIndent();
|
||||
|
||||
private:
|
||||
friend class wxDataViewCtrlDC;
|
||||
friend class wxDataViewCtrlDCImpl;
|
||||
friend class wxDataViewColumn;
|
||||
friend class wxGtkDataViewModelNotifier;
|
||||
GtkWidget *m_treeview;
|
||||
|
@@ -15,22 +15,11 @@
|
||||
// wxDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLIMPEXP_CORE wxGTKImplDC : public wxImplDC
|
||||
#else
|
||||
#define wxGTKImplDC wxDC
|
||||
class WXDLLIMPEXP_CORE wxDC : public wxDCBase
|
||||
#endif
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGTKDCImpl : public wxDCImpl
|
||||
{
|
||||
public:
|
||||
#if wxUSE_NEW_DC
|
||||
wxGTKImplDC( wxDC *owner );
|
||||
#else
|
||||
wxDC();
|
||||
#endif
|
||||
|
||||
virtual ~wxGTKImplDC();
|
||||
wxGTKDCImpl( wxDC *owner );
|
||||
virtual ~wxGTKDCImpl();
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
|
||||
@@ -52,10 +41,10 @@ protected:
|
||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxGTKImplDC)
|
||||
DECLARE_ABSTRACT_CLASS(wxGTKDCImpl)
|
||||
};
|
||||
|
||||
// this must be defined when wxDC::Blit() honours the DC origian and needed to
|
||||
// this must be defined when wxDC::Blit() honours the DC origin and needed to
|
||||
// allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
|
||||
// 2.3.[23]
|
||||
#ifndef wxHAS_WORKING_GTK_DC_BLIT
|
||||
|
@@ -11,33 +11,23 @@
|
||||
#define __GTKDCCLIENTH__
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/gtk/dc.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/region.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindowDC
|
||||
// wxWindowDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLIMPEXP_CORE wxGTKWindowImplDC : public wxGTKImplDC
|
||||
#else
|
||||
#define wxGTKWindowImplDC wxWindowDC
|
||||
class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
|
||||
#endif
|
||||
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxGTKDCImpl
|
||||
{
|
||||
public:
|
||||
wxWindowDCImpl( wxDC *owner );
|
||||
wxWindowDCImpl( wxDC *owner, wxWindow *win );
|
||||
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
wxGTKWindowImplDC( wxDC *owner );
|
||||
wxGTKWindowImplDC( wxDC *owner, wxWindow *win );
|
||||
#else
|
||||
wxWindowDC();
|
||||
wxWindowDC( wxWindow *win );
|
||||
#endif
|
||||
|
||||
virtual ~wxGTKWindowImplDC();
|
||||
virtual ~wxWindowDCImpl();
|
||||
|
||||
virtual bool CanDrawBitmap() const { return true; }
|
||||
virtual bool CanGetTextExtent() const { return true; }
|
||||
@@ -116,14 +106,13 @@ public:
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
GdkWindow *m_window;
|
||||
GdkWindow *m_gdkwindow;
|
||||
GdkGC *m_penGC;
|
||||
GdkGC *m_brushGC;
|
||||
GdkGC *m_textGC;
|
||||
GdkGC *m_bgGC;
|
||||
GdkColormap *m_cmap;
|
||||
bool m_isScreenDC;
|
||||
wxWindow *m_owningWindow;
|
||||
wxRegion m_currentClippingRegion;
|
||||
wxRegion m_paintClippingRegion;
|
||||
|
||||
@@ -137,63 +126,43 @@ public:
|
||||
|
||||
virtual void ComputeScaleAndOrigin();
|
||||
|
||||
virtual GdkWindow *GetGDKWindow() const { return m_window; }
|
||||
virtual GdkWindow *GetGDKWindow() const { return m_gdkwindow; }
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxGTKWindowImplDC)
|
||||
DECLARE_ABSTRACT_CLASS(wxWindowDCImpl)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxClientDC
|
||||
// wxClientDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLIMPEXP_CORE wxGTKClientImplDC : public wxGTKWindowImplDC
|
||||
#else
|
||||
#define wxGTKClientImplDC wxClientDC
|
||||
class WXDLLIMPEXP_CORE wxClientDC : public wxWindowDC
|
||||
#endif
|
||||
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
|
||||
{
|
||||
public:
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
wxGTKClientImplDC( wxDC *owner );
|
||||
wxGTKClientImplDC( wxDC *owner, wxWindow *win );
|
||||
#else
|
||||
wxClientDC();
|
||||
wxClientDC( wxWindow *win );
|
||||
#endif
|
||||
wxClientDCImpl( wxDC *owner );
|
||||
wxClientDCImpl( wxDC *owner, wxWindow *win );
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxGTKClientImplDC)
|
||||
DECLARE_ABSTRACT_CLASS(wxClientDCImpl)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPaintDC
|
||||
// wxPaintDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLIMPEXP_CORE wxGTKPaintImplDC : public wxGTKClientImplDC
|
||||
#else
|
||||
#define wxGTKPaintImplDC wxPaintDC
|
||||
class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDC
|
||||
#endif
|
||||
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
|
||||
{
|
||||
public:
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
wxGTKPaintImplDC( wxDC *owner );
|
||||
wxGTKPaintImplDC( wxDC *owner, wxWindow *win );
|
||||
#else
|
||||
wxPaintDC();
|
||||
wxPaintDC( wxWindow *win );
|
||||
#endif
|
||||
wxPaintDCImpl( wxDC *owner );
|
||||
wxPaintDCImpl( wxDC *owner, wxWindow *win );
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxGTKPaintImplDC)
|
||||
DECLARE_ABSTRACT_CLASS(wxPaintDCImpl)
|
||||
};
|
||||
|
||||
#endif // __GTKDCCLIENTH__
|
||||
#endif
|
||||
// __GTKDCCLIENTH__
|
||||
|
||||
|
@@ -10,33 +10,21 @@
|
||||
#ifndef _WX_GTK_DCMEMORY_H_
|
||||
#define _WX_GTK_DCMEMORY_H_
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/gtk/dcclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMemoryDC
|
||||
// wxMemoryDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLIMPEXP_CORE wxGTKMemoryImplDC : public wxGTKWindowImplDC
|
||||
#else
|
||||
#define wxGTKMemoryImplDC wxMemoryDC
|
||||
class WXDLLIMPEXP_CORE wxMemoryDC : public wxWindowDC, public wxMemoryDCBase
|
||||
#endif
|
||||
class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxWindowDCImpl
|
||||
{
|
||||
public:
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
wxGTKMemoryImplDC( wxMemoryDC *owner );
|
||||
wxGTKMemoryImplDC( wxMemoryDC *owner, wxBitmap& bitmap );
|
||||
wxGTKMemoryImplDC( wxMemoryDC *owner, wxDC *dc );
|
||||
#else
|
||||
wxMemoryDC();
|
||||
wxMemoryDC(wxBitmap& bitmap);
|
||||
wxMemoryDC( wxDC *dc );
|
||||
#endif
|
||||
wxMemoryDCImpl( wxMemoryDC *owner );
|
||||
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
|
||||
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
|
||||
|
||||
virtual ~wxGTKMemoryImplDC();
|
||||
virtual ~wxMemoryDCImpl();
|
||||
|
||||
// these get reimplemented for mono-bitmaps to behave
|
||||
// more like their Win32 couterparts. They now interpret
|
||||
@@ -49,7 +37,7 @@ public:
|
||||
virtual void SetTextBackground( const wxColour &col );
|
||||
|
||||
protected:
|
||||
// overridden from wxImplDC
|
||||
// overridden from wxDCImpl
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const;
|
||||
|
||||
@@ -66,7 +54,9 @@ private:
|
||||
private:
|
||||
void Init();
|
||||
|
||||
DECLARE_ABSTRACT_CLASS(wxGTKMemoryImplDC)
|
||||
DECLARE_ABSTRACT_CLASS(wxMemoryDCImpl)
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_DCMEMORY_H_
|
||||
#endif
|
||||
// _WX_GTK_DCMEMORY_H_
|
||||
|
||||
|
@@ -10,35 +10,18 @@
|
||||
#ifndef __GTKDCSCREENH__
|
||||
#define __GTKDCSCREENH__
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcscreen.h"
|
||||
#include "wx/gtk/dcclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxScreenDC
|
||||
// wxScreenDCImpl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLIMPEXP_CORE wxGTKScreenImplDC : public wxGTKWindowImplDC
|
||||
#else
|
||||
#define wxGTKScreenImplDC wxScreenDC
|
||||
class WXDLLIMPEXP_CORE wxScreenDC : public wxWindowDC
|
||||
#endif
|
||||
class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxWindowDCImpl
|
||||
{
|
||||
public:
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
wxGTKScreenImplDC( wxScreenDC *owner );
|
||||
#else
|
||||
wxScreenDC();
|
||||
#endif
|
||||
|
||||
~wxGTKScreenImplDC();
|
||||
|
||||
static bool StartDrawingOnTop(wxWindow * WXUNUSED(window))
|
||||
{ return true; }
|
||||
static bool StartDrawingOnTop(wxRect * WXUNUSED(rect) = NULL)
|
||||
{ return true; }
|
||||
static bool EndDrawingOnTop() { return true; }
|
||||
|
||||
wxScreenDCImpl( wxScreenDC *owner );
|
||||
~wxScreenDCImpl();
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
@@ -46,7 +29,7 @@ protected:
|
||||
void Init();
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxGTKScreenImplDC)
|
||||
DECLARE_ABSTRACT_CLASS(wxScreenDCImpl)
|
||||
};
|
||||
|
||||
#endif // __GTKDCSCREENH__
|
||||
|
@@ -92,7 +92,7 @@ public:
|
||||
wxPageSetupDialogData * data = NULL );
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
virtual wxImplDC* CreatePrinterImplDC( wxPrinterDC *owner, const wxPrintData& data );
|
||||
virtual wxDCImpl* CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
||||
#else
|
||||
virtual wxDC* CreatePrinterDC( const wxPrintData& data );
|
||||
#endif
|
||||
@@ -212,19 +212,19 @@ private:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class wxGnomePrinterImplDC : public wxImplDC
|
||||
class wxGnomePrinterDCImpl : public wxDCImpl
|
||||
#else
|
||||
#define wxGnomePrinterImplDC wxGnomePrinterDC
|
||||
#define wxGnomePrinterDCImpl wxGnomePrinterDC
|
||||
class wxGnomePrinterDC : public wxDC
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
#if wxUSE_NEW_DC
|
||||
wxGnomePrinterImplDC( wxPrinterDC *owner, const wxPrintData& data );
|
||||
wxGnomePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
||||
#else
|
||||
wxGnomePrinterDC( const wxPrintData& data );
|
||||
#endif
|
||||
virtual ~wxGnomePrinterImplDC();
|
||||
virtual ~wxGnomePrinterDCImpl();
|
||||
|
||||
bool Ok() const { return IsOk(); }
|
||||
bool IsOk() const;
|
||||
@@ -307,8 +307,8 @@ private:
|
||||
void makeEllipticalPath(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGnomePrinterImplDC)
|
||||
DECLARE_NO_COPY_CLASS(wxGnomePrinterImplDC)
|
||||
DECLARE_DYNAMIC_CLASS(wxGnomePrinterDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxGnomePrinterDCImpl)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -54,7 +54,7 @@ public:
|
||||
wxPageSetupDialogData * data = NULL );
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
virtual wxImplDC* CreatePrinterImplDC( wxPrinterDC *owner, const wxPrintData& data );
|
||||
virtual wxDCImpl* CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
||||
#else
|
||||
virtual wxDC* CreatePrinterDC( const wxPrintData& data );
|
||||
#endif
|
||||
@@ -223,19 +223,19 @@ private:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_NEW_DC
|
||||
class WXDLLIMPEXP_CORE wxGtkPrinterImplDC : public wxImplDC
|
||||
class WXDLLIMPEXP_CORE wxGtkPrinterDCImpl : public wxDCImpl
|
||||
#else
|
||||
#define wxGtkPrinterImplDC wxGtkPrinterDC
|
||||
#define wxGtkPrinterDCImpl wxGtkPrinterDC
|
||||
class WXDLLIMPEXP_CORE wxGtkPrinterDC : public wxDC
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
#if wxUSE_NEW_DC
|
||||
wxGtkPrinterImplDC( wxPrinterDC *owner, const wxPrintData& data );
|
||||
wxGtkPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
||||
#else
|
||||
wxGtkPrinterDC( const wxPrintData& data );
|
||||
#endif
|
||||
virtual ~wxGtkPrinterImplDC();
|
||||
virtual ~wxGtkPrinterDCImpl();
|
||||
|
||||
bool Ok() const { return IsOk(); }
|
||||
bool IsOk() const;
|
||||
@@ -320,8 +320,8 @@ private:
|
||||
double m_PS2DEV;
|
||||
double m_DEV2PS;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGtkPrinterImplDC)
|
||||
DECLARE_NO_COPY_CLASS(wxGtkPrinterImplDC)
|
||||
DECLARE_DYNAMIC_CLASS(wxGtkPrinterDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxGtkPrinterDCImpl)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -15,6 +15,9 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "wx/gtk/private/string.h"
|
||||
#include "wx/gtk/dc.h"
|
||||
#include "wx/gtk/dcclient.h"
|
||||
#include "wx/gtk/dcmemory.h"
|
||||
|
||||
// pango_version_check symbol is quite recent ATM (4/2007)... so we
|
||||
// use our own wrapper which implements a smart trick.
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#define _WX_DCCLIENT_H_
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dcgraph.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
@@ -21,59 +22,52 @@
|
||||
class WXDLLIMPEXP_FWD_CORE wxPaintDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
class WXDLLEXPORT wxWindowDC: public wxDC
|
||||
class WXDLLEXPORT wxWindowDCImpl: public wxGCDCImpl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||
|
||||
public:
|
||||
wxWindowDC(void);
|
||||
|
||||
// Create a DC corresponding to a canvas
|
||||
wxWindowDC(wxWindow *win);
|
||||
|
||||
virtual ~wxWindowDC(void);
|
||||
wxWindow *GetWindow() const { return m_window; }
|
||||
protected :
|
||||
public:
|
||||
wxWindowDCImpl( wxDC *owner );
|
||||
wxWindowDCImpl( wxDC *owner, wxWindow *window );
|
||||
virtual ~wxWindowDCImpl();
|
||||
|
||||
protected :
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const;
|
||||
wxWindow *m_window;
|
||||
|
||||
bool m_release;
|
||||
int m_width;
|
||||
int m_height;
|
||||
bool m_release;
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxWindowDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxWindowDCImpl)
|
||||
};
|
||||
|
||||
|
||||
class WXDLLEXPORT wxClientDC: public wxWindowDC
|
||||
class WXDLLEXPORT wxClientDCImpl: public wxWindowDCImpl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||
public:
|
||||
wxClientDCImpl( wxDC *owner );
|
||||
wxClientDCImpl( wxDC *owner, wxWindow *window );
|
||||
virtual ~wxClientDCImpl();
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxClientDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxClientDCImpl)
|
||||
};
|
||||
|
||||
public:
|
||||
wxClientDC(void);
|
||||
|
||||
// Create a DC corresponding to a canvas
|
||||
wxClientDC(wxWindow *win);
|
||||
|
||||
virtual ~wxClientDC(void);
|
||||
class WXDLLEXPORT wxPaintDCImpl: public wxWindowDCImpl
|
||||
{
|
||||
public:
|
||||
wxPaintDCImpl( wxDC *owner );
|
||||
wxPaintDCImpl( wxDC *owner, wxWindow *win );
|
||||
virtual ~wxPaintDCImpl();
|
||||
|
||||
protected:
|
||||
DECLARE_CLASS(wxPaintDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxPaintDCImpl)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPaintDC: public wxWindowDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||
|
||||
public:
|
||||
wxPaintDC(void);
|
||||
|
||||
// Create a DC corresponding to a canvas
|
||||
wxPaintDC(wxWindow *win);
|
||||
|
||||
virtual ~wxPaintDC(void);
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DCCLIENT_H_
|
||||
|
@@ -12,33 +12,31 @@
|
||||
#ifndef _WX_DCMEMORY_H_
|
||||
#define _WX_DCMEMORY_H_
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/mac/carbon/dcclient.h"
|
||||
|
||||
class WXDLLEXPORT wxMemoryDC: public wxPaintDC, public wxMemoryDCBase
|
||||
class WXDLLEXPORT wxMemoryDCImpl: public wxPaintDCImpl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||
|
||||
public:
|
||||
wxMemoryDC() { Init(); }
|
||||
wxMemoryDC(wxBitmap& bitmap) { Init(); SelectObject(bitmap); }
|
||||
wxMemoryDC( wxDC *dc ); // Create compatible DC
|
||||
virtual ~wxMemoryDC(void);
|
||||
|
||||
const wxBitmap& GetSelectedBitmap() const { return m_selected; }
|
||||
wxBitmap GetSelectedBitmap() { return m_selected; }
|
||||
|
||||
wxBitmap GetSelectedObject() { return GetSelectedBitmap() ; }
|
||||
wxMemoryDCImpl( wxMemoryDC *owner );
|
||||
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
|
||||
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
|
||||
|
||||
virtual ~wxMemoryDCImpl();
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
|
||||
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
|
||||
{ return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
|
||||
virtual void DoSelect(const wxBitmap& bitmap);
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
wxBitmap m_selected;
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxMemoryDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxMemoryDCImpl)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -13,19 +13,18 @@
|
||||
#define _WX_DCPRINT_H_
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dcgraph.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
class wxNativePrinterDC ;
|
||||
|
||||
class WXDLLEXPORT wxPrinterDC: public wxDC
|
||||
class WXDLLEXPORT wxPrinterDCImpl: public wxGCDCImpl
|
||||
{
|
||||
public:
|
||||
public:
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
DECLARE_CLASS(wxPrinterDC)
|
||||
|
||||
// Create a printer DC
|
||||
wxPrinterDC(const wxPrintData& printdata );
|
||||
virtual ~wxPrinterDC();
|
||||
wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& printdata );
|
||||
virtual ~wxPrinterDCImpl();
|
||||
|
||||
virtual bool StartDoc( const wxString& WXUNUSED(message) ) ;
|
||||
virtual void EndDoc(void) ;
|
||||
@@ -36,10 +35,15 @@ class WXDLLEXPORT wxPrinterDC: public wxDC
|
||||
|
||||
wxPrintData& GetPrintData() { return m_printData; }
|
||||
virtual wxSize GetPPI() const;
|
||||
protected:
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
wxPrintData m_printData ;
|
||||
|
||||
wxPrintData m_printData ;
|
||||
wxNativePrinterDC* m_nativePrinterDC ;
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxPrinterDC)
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
};
|
||||
|
||||
|
@@ -13,23 +13,20 @@
|
||||
#define _WX_DCSCREEN_H_
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/mac/carbon/dcclient.h"
|
||||
|
||||
class WXDLLEXPORT wxScreenDC: public wxWindowDC
|
||||
class WXDLLEXPORT wxScreenDCImpl: public wxWindowDCImpl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||
public:
|
||||
wxScreenDCImpl( wxDC *owner );
|
||||
virtual ~wxScreenDCImpl();
|
||||
|
||||
public:
|
||||
// Create a DC representing the whole screen
|
||||
wxScreenDC();
|
||||
virtual ~wxScreenDC();
|
||||
|
||||
// Compatibility with X's requirements for
|
||||
// drawing on top of all windows
|
||||
static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; }
|
||||
static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return TRUE; }
|
||||
static bool EndDrawingOnTop() { return TRUE; }
|
||||
private:
|
||||
void* m_overlayWindow;
|
||||
private:
|
||||
void* m_overlayWindow;
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxScreenDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxScreenDCImpl)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -22,6 +22,8 @@
|
||||
#include "wx/dataobj.h"
|
||||
#endif
|
||||
|
||||
#include "wx/mac/carbon/dcclient.h"
|
||||
|
||||
/*
|
||||
* Metafile and metafile device context classes
|
||||
*
|
||||
@@ -65,32 +67,56 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMetafileDC: public wxDC
|
||||
|
||||
class WXDLLEXPORT wxMetafileDCImpl: public wxGCDCImpl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMetafileDC)
|
||||
public:
|
||||
wxMetafileDCImpl( wxDC *owner,
|
||||
const wxString& filename,
|
||||
int width, int height,
|
||||
const wxString& description );
|
||||
|
||||
public:
|
||||
// the ctor parameters specify the filename (empty for memory metafiles),
|
||||
// the metafile picture size and the optional description/comment
|
||||
wxMetafileDC(const wxString& filename = wxEmptyString,
|
||||
int width = 0, int height = 0,
|
||||
const wxString& description = wxEmptyString);
|
||||
virtual ~wxMetafileDCImpl();
|
||||
|
||||
virtual ~wxMetafileDC(void);
|
||||
// Should be called at end of drawing
|
||||
virtual wxMetafile *Close();
|
||||
|
||||
// Should be called at end of drawing
|
||||
virtual wxMetafile *Close(void);
|
||||
|
||||
// Implementation
|
||||
inline wxMetafile *GetMetaFile(void) const { return m_metaFile; }
|
||||
inline void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; }
|
||||
// Implementation
|
||||
wxMetafile *GetMetaFile(void) const { return m_metaFile; }
|
||||
void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; }
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
wxMetafile* m_metaFile;
|
||||
wxMetafile* m_metaFile;
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxMetafileDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxMetafileDCImpl)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMetafileDC: public wxDC
|
||||
{
|
||||
public:
|
||||
// the ctor parameters specify the filename (empty for memory metafiles),
|
||||
// the metafile picture size and the optional description/comment
|
||||
wxMetafileDC( const wxString& filename = wxEmptyString,
|
||||
int width = 0, int height = 0,
|
||||
const wxString& description = wxEmptyString )
|
||||
{ m_pimpl = new wxMetafileDCImpl( this, filename, width, height, description ); }
|
||||
|
||||
wxMetafile *GetMetafile() const
|
||||
{ return ((wxMetafileDCImpl*)m_pimpl)->GetMetaFile(); }
|
||||
|
||||
wxMetafile *Close()
|
||||
{ return ((wxMetafileDCImpl*)m_pimpl)->Close(); }
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxMetafileDC)
|
||||
DECLARE_NO_COPY_CLASS(wxMetafileDC)
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Pass filename of existing non-placeable metafile, and bounding box.
|
||||
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
||||
|
@@ -29,6 +29,9 @@ typedef SInt32 SRefCon;
|
||||
#if wxUSE_GUI
|
||||
|
||||
#include "wx/listbox.h"
|
||||
#include "wx/mac/carbon/dc.h"
|
||||
#include "wx/mac/carbon/dcclient.h"
|
||||
#include "wx/mac/carbon/dcmemory.h"
|
||||
|
||||
class WXDLLEXPORT wxMacCGContextStateSaver
|
||||
{
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#define _WX_MSW_DC_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/dc.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// macros
|
||||
@@ -42,11 +43,11 @@ public:
|
||||
|
||||
// this is an ABC: use one of the derived classes to create a DC associated
|
||||
// with a window, screen, printer and so on
|
||||
class WXDLLEXPORT wxDC : public wxDCBase
|
||||
class WXDLLEXPORT wxMSWDCImpl: public wxDCImpl
|
||||
{
|
||||
public:
|
||||
wxDC(WXHDC hDC) { Init(); m_hDC = hDC; }
|
||||
virtual ~wxDC();
|
||||
wxMSWDCImpl(wxDC *owner, WXHDC hDC);
|
||||
virtual ~wxMSWDCImpl();
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
@@ -94,10 +95,9 @@ public:
|
||||
virtual void SetRop(WXHDC cdc);
|
||||
virtual void SelectOldObjects(WXHDC dc);
|
||||
|
||||
wxWindow *GetWindow() const { return m_canvas; }
|
||||
void SetWindow(wxWindow *win)
|
||||
{
|
||||
m_canvas = win;
|
||||
m_window = win;
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
// if we have palettes use the correct one for this window
|
||||
@@ -145,7 +145,6 @@ public:
|
||||
protected:
|
||||
void Init()
|
||||
{
|
||||
m_canvas = NULL;
|
||||
m_bOwnsDC = false;
|
||||
m_hDC = NULL;
|
||||
|
||||
@@ -161,7 +160,7 @@ protected:
|
||||
|
||||
// create an uninitialized DC: this should be only used by the derived
|
||||
// classes
|
||||
wxDC() { Init(); }
|
||||
wxMSWDCImpl( wxDC *owner ) : wxDCImpl( owner ) { Init(); }
|
||||
|
||||
void RealizeScaleAndOrigin();
|
||||
|
||||
@@ -302,12 +301,12 @@ protected:
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
#if wxUSE_DC_CACHEING
|
||||
static wxList sm_bitmapCache;
|
||||
static wxList sm_dcCache;
|
||||
static wxObjectList sm_bitmapCache;
|
||||
static wxObjectList sm_dcCache;
|
||||
#endif
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxDC)
|
||||
DECLARE_NO_COPY_CLASS(wxDC)
|
||||
DECLARE_CLASS(wxMSWDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxMSWDCImpl)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -315,18 +314,18 @@ protected:
|
||||
// only/mainly)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDCTemp : public wxDC
|
||||
class WXDLLEXPORT wxDCTempImpl: public wxMSWDCImpl
|
||||
{
|
||||
public:
|
||||
// construct a temporary DC with the specified HDC and size (it should be
|
||||
// specified whenever we know it for this HDC)
|
||||
wxDCTemp(WXHDC hdc, const wxSize& size = wxDefaultSize)
|
||||
: wxDC(hdc),
|
||||
wxDCTempImpl(wxDC *owner, WXHDC hdc, const wxSize& size )
|
||||
: wxMSWDCImpl( owner, hdc ),
|
||||
m_size(size)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~wxDCTemp()
|
||||
virtual ~wxDCTempImpl()
|
||||
{
|
||||
// prevent base class dtor from freeing it
|
||||
SetHDC((WXHDC)NULL);
|
||||
@@ -349,8 +348,20 @@ private:
|
||||
// find it ourselves
|
||||
const wxSize m_size;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxDCTemp)
|
||||
DECLARE_NO_COPY_CLASS(wxDCTempImpl)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxDCTemp: public wxDC
|
||||
{
|
||||
public:
|
||||
wxDCTemp( WXHDC hdc, const wxSize& size = wxDefaultSize )
|
||||
{
|
||||
m_pimpl = new wxDCTempImpl( this, hdc, size );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // _WX_MSW_DC_H_
|
||||
|
||||
|
@@ -17,6 +17,8 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/msw/dc.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -32,14 +34,14 @@ WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
|
||||
// DC classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxWindowDC : public wxDC
|
||||
class WXDLLEXPORT wxWindowDCImpl : public wxMSWDCImpl
|
||||
{
|
||||
public:
|
||||
// default ctor
|
||||
wxWindowDC();
|
||||
wxWindowDCImpl( wxDC *owner );
|
||||
|
||||
// Create a DC corresponding to the whole window
|
||||
wxWindowDC(wxWindow *win);
|
||||
wxWindowDCImpl( wxDC *owner, wxWindow *win );
|
||||
|
||||
protected:
|
||||
// initialize the newly created DC
|
||||
@@ -49,19 +51,20 @@ protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowDC)
|
||||
DECLARE_CLASS(wxWindowDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxWindowDCImpl)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxClientDC : public wxWindowDC
|
||||
class WXDLLEXPORT wxClientDCImpl : public wxWindowDCImpl
|
||||
{
|
||||
public:
|
||||
// default ctor
|
||||
wxClientDC();
|
||||
wxClientDCImpl( wxDC *owner );
|
||||
|
||||
// Create a DC corresponding to the client area of the window
|
||||
wxClientDC(wxWindow *win);
|
||||
wxClientDCImpl( wxDC *owner, wxWindow *win );
|
||||
|
||||
virtual ~wxClientDC();
|
||||
virtual ~wxClientDCImpl();
|
||||
|
||||
protected:
|
||||
void InitDC();
|
||||
@@ -70,18 +73,19 @@ protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxClientDC)
|
||||
DECLARE_CLASS(wxClientDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxClientDCImpl)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPaintDC : public wxClientDC
|
||||
class WXDLLEXPORT wxPaintDCImpl : public wxClientDCImpl
|
||||
{
|
||||
public:
|
||||
wxPaintDC();
|
||||
wxPaintDCImpl( wxDC *owner );
|
||||
|
||||
// Create a DC corresponding for painting the window in OnPaint()
|
||||
wxPaintDC(wxWindow *win);
|
||||
wxPaintDCImpl( wxDC *owner, wxWindow *win );
|
||||
|
||||
virtual ~wxPaintDC();
|
||||
virtual ~wxPaintDCImpl();
|
||||
|
||||
// find the entry for this DC in the cache (keyed by the window)
|
||||
static WXHDC FindDCInCache(wxWindow* win);
|
||||
@@ -93,7 +97,8 @@ protected:
|
||||
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPaintDC)
|
||||
DECLARE_CLASS(wxPaintDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxPaintDCImpl)
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -106,10 +111,8 @@ class WXDLLEXPORT wxPaintDCEx : public wxPaintDC
|
||||
{
|
||||
public:
|
||||
wxPaintDCEx(wxWindow *canvas, WXHDC dc);
|
||||
virtual ~wxPaintDCEx();
|
||||
|
||||
private:
|
||||
int saveState;
|
||||
|
||||
DECLARE_CLASS(wxPaintDCEx)
|
||||
DECLARE_NO_COPY_CLASS(wxPaintDCEx)
|
||||
};
|
||||
|
@@ -12,14 +12,15 @@
|
||||
#ifndef _WX_DCMEMORY_H_
|
||||
#define _WX_DCMEMORY_H_
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/msw/dc.h"
|
||||
|
||||
class WXDLLEXPORT wxMemoryDC : public wxDC, public wxMemoryDCBase
|
||||
class WXDLLEXPORT wxMemoryDCImpl: public wxMSWDCImpl
|
||||
{
|
||||
public:
|
||||
wxMemoryDC() { CreateCompatible(NULL); Init(); }
|
||||
wxMemoryDC(wxBitmap& bitmap) { CreateCompatible(NULL); Init(); SelectObject(bitmap); }
|
||||
wxMemoryDC(wxDC *dc); // Create compatible DC
|
||||
wxMemoryDCImpl( wxMemoryDC *owner );
|
||||
wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap );
|
||||
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc ); // Create compatible DC
|
||||
|
||||
|
||||
protected:
|
||||
@@ -38,7 +39,8 @@ protected:
|
||||
void Init();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMemoryDC)
|
||||
DECLARE_CLASS(wxMemoryDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxMemoryDCImpl)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -14,19 +14,20 @@
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dcprint.h"
|
||||
#include "wx/cmndata.h"
|
||||
#include "wx/msw/dc.h"
|
||||
|
||||
class WXDLLEXPORT wxPrinterDC : public wxDC
|
||||
// ------------------------------------------------------------------------
|
||||
// wxPrinterDCImpl
|
||||
//
|
||||
|
||||
class WXDLLEXPORT wxPrinterDCImpl : public wxMSWDCImpl
|
||||
{
|
||||
public:
|
||||
// Create a printer DC (obsolete function: use wxPrintData version now)
|
||||
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = true, int orientation = wxPORTRAIT);
|
||||
|
||||
// Create from print data
|
||||
wxPrinterDC(const wxPrintData& data);
|
||||
|
||||
wxPrinterDC(WXHDC theDC);
|
||||
wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
||||
wxPrinterDCImpl( wxPrinterDC *owner, WXHDC theDC );
|
||||
|
||||
// override some base class virtuals
|
||||
virtual bool StartDoc(const wxString& message);
|
||||
@@ -34,7 +35,7 @@ public:
|
||||
virtual void StartPage();
|
||||
virtual void EndPage();
|
||||
|
||||
wxRect GetPaperRect();
|
||||
virtual wxRect GetPaperRect();
|
||||
|
||||
protected:
|
||||
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||
@@ -55,15 +56,26 @@ protected:
|
||||
wxPrintData m_printData;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPrinterDC)
|
||||
DECLARE_CLASS(wxPrinterDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxPrinterDCImpl)
|
||||
};
|
||||
|
||||
// Gets an HDC for the default printer configuration
|
||||
// WXHDC WXDLLEXPORT wxGetPrinterDC(int orientation);
|
||||
|
||||
// Gets an HDC for the specified printer configuration
|
||||
WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& data);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// wxPrinterDCromHDC
|
||||
//
|
||||
|
||||
class WXDLLEXPORT wxPrinterDCFromHDC: public wxPrinterDC
|
||||
{
|
||||
public:
|
||||
wxPrinterDCFromHDC( WXHDC theDC )
|
||||
{
|
||||
m_pimpl = new wxPrinterDCImpl( this, theDC );
|
||||
}
|
||||
};
|
||||
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#endif // _WX_MSW_DCPRINT_H_
|
||||
|
@@ -12,19 +12,14 @@
|
||||
#ifndef _WX_MSW_DCSCREEN_H_
|
||||
#define _WX_MSW_DCSCREEN_H_
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dcscreen.h"
|
||||
#include "wx/msw/dc.h"
|
||||
|
||||
class WXDLLEXPORT wxScreenDC : public wxDC
|
||||
class WXDLLEXPORT wxScreenDCImpl : public wxMSWDCImpl
|
||||
{
|
||||
public:
|
||||
// Create a DC representing the whole screen
|
||||
wxScreenDC();
|
||||
|
||||
// Compatibility with X's requirements for drawing on top of all windows:
|
||||
// they don't do anything under MSW
|
||||
static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return true; }
|
||||
static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return true; }
|
||||
static bool EndDrawingOnTop() { return true; }
|
||||
wxScreenDCImpl( wxScreenDC *owner );
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *w, int *h) const
|
||||
@@ -33,7 +28,8 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxScreenDC)
|
||||
DECLARE_CLASS(wxScreenDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxScreenDCImpl)
|
||||
};
|
||||
|
||||
#endif // _WX_MSW_DCSCREEN_H_
|
||||
|
@@ -82,19 +82,6 @@ public:
|
||||
int width = 0, int height = 0,
|
||||
const wxString& description = wxEmptyString);
|
||||
|
||||
virtual ~wxEnhMetaFileDC();
|
||||
|
||||
// obtain a pointer to the new metafile (caller should delete it)
|
||||
wxEnhMetaFile *Close();
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
// size passed to ctor and returned by DoGetSize()
|
||||
int m_width,
|
||||
m_height;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxEnhMetaFileDC)
|
||||
};
|
||||
|
||||
|
@@ -72,20 +72,13 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMetafile)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMetafileDC: public wxDC
|
||||
class WXDLLEXPORT wxMetafileDCImpl: public wxMSWDCImpl
|
||||
{
|
||||
public:
|
||||
// Don't supply origin and extent
|
||||
// Supply them to wxMakeMetaFilePlaceable instead.
|
||||
wxMetafileDC(const wxString& file = wxEmptyString);
|
||||
|
||||
// Supply origin and extent (recommended).
|
||||
// Then don't need to supply them to wxMakeMetaFilePlaceable.
|
||||
wxMetafileDCImpl(const wxString& file = wxEmptyString);
|
||||
wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg);
|
||||
virtual ~wxMetafileDCImpl();
|
||||
|
||||
virtual ~wxMetafileDC();
|
||||
|
||||
// Should be called at end of drawing
|
||||
virtual wxMetafile *Close();
|
||||
virtual void SetMapMode(int mode);
|
||||
virtual void DoGetTextExtent(const wxString& string,
|
||||
@@ -107,9 +100,37 @@ protected:
|
||||
wxMetafile* m_metaFile;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMetafileDC)
|
||||
DECLARE_CLASS(wxMetafileDCImpl)
|
||||
DECLARE_NO_COPY_CLASS(wxMetafileDCImpl)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMetafileDC: public wxDC
|
||||
{
|
||||
public:
|
||||
// Don't supply origin and extent
|
||||
// Supply them to wxMakeMetaFilePlaceable instead.
|
||||
wxMetafileDC(const wxString& file);
|
||||
{ m_pimpl = new wxMetafileDCImpl( this, file ); }
|
||||
|
||||
// Supply origin and extent (recommended).
|
||||
// Then don't need to supply them to wxMakeMetaFilePlaceable.
|
||||
wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg)
|
||||
{ m_pimpl = new wxMetafileDCImpl( this, file, xext, yext, xorg, yorg ); }
|
||||
|
||||
wxMetafile *GetMetafile() const
|
||||
{ return ((wxMetafileDCImpl*)m_pimpl)->GetMetaFile(); }
|
||||
|
||||
wxMetafile *Close()
|
||||
{ return ((wxMetafileDCImpl*)m_pimpl)->Close(); }
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxMetafileDC)
|
||||
DECLARE_NO_COPY_CLASS(wxMetafileDC)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Pass filename of existing non-placeable metafile, and bounding box.
|
||||
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
||||
|
@@ -213,6 +213,11 @@ struct WinStruct : public T
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/colour.h"
|
||||
|
||||
#include "wx/msw/dc.h"
|
||||
#include "wx/msw/dcclient.h"
|
||||
#include "wx/msw/dcmemory.h"
|
||||
|
||||
|
||||
// make conversion from wxColour and COLORREF a bit less painful
|
||||
inline COLORREF wxColourToRGB(const wxColour& c)
|
||||
{
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/dc.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxButton;
|
||||
@@ -77,7 +78,7 @@ public:
|
||||
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||
wxPageSetupDialogData * data = NULL ) = 0;
|
||||
|
||||
virtual wxDC* CreatePrinterDC( const wxPrintData& data ) = 0;
|
||||
virtual wxDCImpl* CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data ) = 0;
|
||||
|
||||
// What to do and what to show in the wxPrintDialog
|
||||
// a) Use the generic print setup dialog or a native one?
|
||||
@@ -121,7 +122,7 @@ public:
|
||||
virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent,
|
||||
wxPageSetupDialogData * data = NULL );
|
||||
|
||||
virtual wxDC* CreatePrinterDC( const wxPrintData& data );
|
||||
virtual wxDCImpl* CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
||||
|
||||
virtual bool HasPrintSetupDialog();
|
||||
virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data );
|
||||
|
Reference in New Issue
Block a user