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