DC updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9726 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -319,11 +319,9 @@ public:
|
||||
bool m_bOwnsDC:1;
|
||||
|
||||
//
|
||||
// our HDC and its usage count: we only free it when the usage count drops
|
||||
// to 0
|
||||
// our HDC
|
||||
//
|
||||
WXHDC m_hDC;
|
||||
int m_nDCCount;
|
||||
|
||||
//
|
||||
// Store all old GDI objects when do a SelectObject, so we can select them
|
||||
|
@@ -34,52 +34,53 @@ WX_DECLARE_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
|
||||
|
||||
class WXDLLEXPORT wxWindowDC : public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||
|
||||
public:
|
||||
wxWindowDC();
|
||||
|
||||
// Create a DC corresponding to the whole window
|
||||
wxWindowDC(wxWindow *win);
|
||||
wxWindowDC(wxWindow* pWin);
|
||||
|
||||
virtual ~wxWindowDC();
|
||||
protected:
|
||||
void InitDC(void);
|
||||
|
||||
private:
|
||||
HAB m_hab;
|
||||
SIZEL m_PageSize;
|
||||
};
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||
}; // end of CLASS wxWindowDC
|
||||
|
||||
class WXDLLEXPORT wxClientDC : public wxWindowDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||
|
||||
public:
|
||||
wxClientDC();
|
||||
|
||||
// Create a DC corresponding to the client area of the window
|
||||
wxClientDC(wxWindow *win);
|
||||
|
||||
virtual ~wxClientDC();
|
||||
};
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||
}; // end of CLASS wxClientDC
|
||||
|
||||
class WXDLLEXPORT wxPaintDC : public wxWindowDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||
|
||||
public:
|
||||
wxPaintDC();
|
||||
|
||||
// Create a DC corresponding for painting the window in OnPaint()
|
||||
wxPaintDC(wxWindow *win);
|
||||
wxPaintDC(wxWindow* pWin);
|
||||
|
||||
virtual ~wxPaintDC();
|
||||
|
||||
// find the entry for this DC in the cache (keyed by the window)
|
||||
static WXHDC FindDCInCache(wxWindow* pWin);
|
||||
|
||||
protected:
|
||||
static wxArrayDCInfo ms_cache;
|
||||
|
||||
// find the entry for this DC in the cache (keyed by the window)
|
||||
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
|
||||
};
|
||||
wxPaintDCInfo* FindInCache(size_t* pIndex = NULL) const;
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||
}; // end of wxPaintDC
|
||||
|
||||
#endif
|
||||
// _WX_DCCLIENT_H_
|
||||
|
@@ -16,17 +16,28 @@
|
||||
|
||||
class WXDLLEXPORT wxMemoryDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||
|
||||
public:
|
||||
wxMemoryDC(void);
|
||||
wxMemoryDC(wxDC* pDC); // Create compatible DC
|
||||
|
||||
~wxMemoryDC(void);
|
||||
virtual void SelectObject(const wxBitmap& rBitmap);
|
||||
protected:
|
||||
// override some base class virtuals
|
||||
virtual void DoDrawRectangle( wxCoord vX
|
||||
,wxCoord vY
|
||||
,wxCoord vWidth
|
||||
,wxCoord vHeight
|
||||
);
|
||||
virtual void DoGetSize( int* pWidth
|
||||
,int* pHeight
|
||||
) const;
|
||||
// create DC compatible with the given one or screen if dc == NULL
|
||||
bool CreateCompatible(wxDC* pDC);
|
||||
|
||||
// initialize the newly created DC
|
||||
void Init(void);
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||
}; // end of CLASS wxMemoryDC
|
||||
|
||||
#endif
|
||||
|
@@ -20,29 +20,50 @@
|
||||
class WXDLLEXPORT wxPrinterDC: public wxDC
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(wxPrinterDC)
|
||||
|
||||
// Create a printer DC [obsolete]
|
||||
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
|
||||
wxPrinterDC( const wxString& rsDriver
|
||||
,const wxString& rsDevice
|
||||
,const wxString& rsOutput
|
||||
,bool bInteractive = TRUE
|
||||
,int nOrientation = wxPORTRAIT
|
||||
);
|
||||
|
||||
// Create from print data
|
||||
wxPrinterDC(const wxPrintData& data);
|
||||
wxPrinterDC(const wxPrintData& rData);
|
||||
wxPrinterDC(WXHDC hTheDC);
|
||||
|
||||
wxPrinterDC(WXHDC theDC);
|
||||
|
||||
~wxPrinterDC();
|
||||
|
||||
bool StartDoc(const wxString& message);
|
||||
bool StartDoc(const wxString& rsMessage);
|
||||
void EndDoc(void);
|
||||
void StartPage(void);
|
||||
void EndPage(void);
|
||||
|
||||
protected:
|
||||
virtual void DoDrawBitmap( const wxBitmap& rBmp
|
||||
,wxCoord vX
|
||||
,wxCoord vY
|
||||
,bool bUseMask = FALSE
|
||||
);
|
||||
virtual bool DoBlit( wxCoord vXdest
|
||||
,wxCoord vYdest
|
||||
,wxCoord vWidth
|
||||
,wxCoord vHeight
|
||||
,wxDC* pSource
|
||||
,wxCoord vXsrc
|
||||
,wxCoord vYsrc
|
||||
,int nRop = wxCOPY
|
||||
,bool bUseMask = FALSE
|
||||
);
|
||||
|
||||
// init the dc
|
||||
void Init(void);
|
||||
|
||||
wxPrintData m_printData;
|
||||
};
|
||||
private:
|
||||
DECLARE_CLASS(wxPrinterDC)
|
||||
}; // end of CLASS wxPrinterDC
|
||||
|
||||
// Gets an HDC for the specified printer configuration
|
||||
WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& data);
|
||||
WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& rData);
|
||||
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
|
@@ -20,19 +20,18 @@
|
||||
|
||||
class WXDLLEXPORT wxScreenDC: public wxWindowDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||
|
||||
public:
|
||||
// Create a DC representing the whole screen
|
||||
wxScreenDC();
|
||||
~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:
|
||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||
}; // end of CLASS wxScreenDC
|
||||
|
||||
#endif
|
||||
// _WX_DCSCREEN_H_
|
||||
|
Reference in New Issue
Block a user