1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: dcclient.h
|
1999-09-21 05:16:03 +00:00
|
|
|
// Purpose: wxClientDC class
|
1999-10-05 22:10:56 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-05 22:10:56 +00:00
|
|
|
// Created: 09/12/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-05 22:10:56 +00:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DCCLIENT_H_
|
|
|
|
#define _WX_DCCLIENT_H_
|
|
|
|
|
1999-09-21 05:16:03 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
#include "wx/dc.h"
|
2008-01-06 22:37:10 +00:00
|
|
|
#include "wx/os2/dc.h"
|
|
|
|
#include "wx/dcclient.h"
|
1999-09-21 05:16:03 +00:00
|
|
|
#include "wx/dynarray.h"
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// array types
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-09-21 05:16:03 +00:00
|
|
|
// this one if used by wxPaintDC only
|
2007-07-09 10:09:52 +00:00
|
|
|
struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2008-01-06 22:37:10 +00:00
|
|
|
WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-09-21 05:16:03 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// DC classes
|
|
|
|
// ----------------------------------------------------------------------------
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxPMDCImpl
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
1999-09-21 05:16:03 +00:00
|
|
|
public:
|
2008-01-06 22:37:10 +00:00
|
|
|
// default ctor
|
|
|
|
wxWindowDCImpl( wxDC *owner );
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-09-21 05:16:03 +00:00
|
|
|
// Create a DC corresponding to the whole window
|
2008-01-06 22:37:10 +00:00
|
|
|
wxWindowDCImpl( wxDC *owner, wxWindow *pWin );
|
|
|
|
|
|
|
|
virtual void DoGetSize(int *pWidth, int *pHeight) const;
|
1999-09-21 05:16:03 +00:00
|
|
|
|
2001-04-11 18:04:54 +00:00
|
|
|
protected:
|
2008-01-06 22:37:10 +00:00
|
|
|
// initialize the newly created DC
|
2001-04-11 18:04:54 +00:00
|
|
|
void InitDC(void);
|
1999-10-02 01:44:39 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SIZEL m_PageSize;
|
2008-01-06 22:37:10 +00:00
|
|
|
DECLARE_CLASS(wxWindowDCImpl)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxWindowDCImpl)
|
2001-04-11 18:04:54 +00:00
|
|
|
}; // end of CLASS wxWindowDC
|
1999-09-21 05:16:03 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
1999-09-21 05:16:03 +00:00
|
|
|
public:
|
2008-01-06 22:37:10 +00:00
|
|
|
// default ctor
|
|
|
|
wxClientDCImpl( wxDC *owner );
|
|
|
|
|
|
|
|
// Create a DC corresponding to the client area of the window
|
|
|
|
wxClientDCImpl( wxDC *owner, wxWindow *pWin );
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2008-01-06 22:37:10 +00:00
|
|
|
virtual ~wxClientDCImpl();
|
|
|
|
|
|
|
|
virtual void DoGetSize(int *pWidth, int *pHeight) const;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2001-07-06 21:45:11 +00:00
|
|
|
protected:
|
|
|
|
void InitDC(void);
|
|
|
|
|
2001-04-11 18:04:54 +00:00
|
|
|
private:
|
2008-01-06 22:37:10 +00:00
|
|
|
DECLARE_CLASS(wxClientDCImpl)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxClientDCImpl)
|
2001-04-11 18:04:54 +00:00
|
|
|
}; // end of CLASS wxClientDC
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
|
1999-07-29 05:11:30 +00:00
|
|
|
{
|
1999-09-21 05:16:03 +00:00
|
|
|
public:
|
2008-01-06 22:37:10 +00:00
|
|
|
wxPaintDCImpl( wxDC *owner );
|
1999-09-21 05:16:03 +00:00
|
|
|
|
|
|
|
// Create a DC corresponding for painting the window in OnPaint()
|
2008-01-06 22:37:10 +00:00
|
|
|
wxPaintDCImpl( wxDC *owner, wxWindow *pWin );
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2008-01-06 22:37:10 +00:00
|
|
|
virtual ~wxPaintDCImpl();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
2001-04-11 18:04:54 +00:00
|
|
|
// find the entry for this DC in the cache (keyed by the window)
|
|
|
|
static WXHDC FindDCInCache(wxWindow* pWin);
|
|
|
|
|
1999-09-21 05:16:03 +00:00
|
|
|
protected:
|
|
|
|
static wxArrayDCInfo ms_cache;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
1999-09-21 05:16:03 +00:00
|
|
|
// find the entry for this DC in the cache (keyed by the window)
|
2001-04-11 18:04:54 +00:00
|
|
|
wxPaintDCInfo* FindInCache(size_t* pIndex = NULL) const;
|
|
|
|
private:
|
2008-01-06 22:37:10 +00:00
|
|
|
DECLARE_CLASS(wxPaintDCImpl)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxPaintDCImpl)
|
2001-04-11 18:04:54 +00:00
|
|
|
}; // end of wxPaintDC
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_DCCLIENT_H_
|