2005-05-04 18:57:50 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/dcmemory.h
|
|
|
|
// Purpose: wxMemoryDC base header
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created:
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows Licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_DCMEMORY_H_BASE_
|
|
|
|
#define _WX_DCMEMORY_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-10-30 20:51:19 +00:00
|
|
|
#include "wx/bitmap.h"
|
2006-01-25 00:18:12 +00:00
|
|
|
|
2006-10-30 19:41:46 +00:00
|
|
|
// 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...
|
2006-10-30 21:09:47 +00:00
|
|
|
class WXDLLEXPORT wxMemoryDCBase
|
2006-10-30 19:41:46 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2006-12-07 05:44:44 +00:00
|
|
|
protected:
|
2006-10-30 19:41:46 +00:00
|
|
|
virtual void DoSelect(const wxBitmap& bmp) = 0;
|
|
|
|
};
|
|
|
|
|
2004-12-20 12:44:22 +00:00
|
|
|
#if defined(__WXPALMOS__)
|
2004-10-19 13:40:30 +00:00
|
|
|
#include "wx/palmos/dcmemory.h"
|
|
|
|
#elif defined(__WXMSW__)
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/msw/dcmemory.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
1998-08-15 00:23:28 +00:00
|
|
|
#include "wx/motif/dcmemory.h"
|
2006-01-23 03:27:34 +00:00
|
|
|
#elif defined(__WXGTK20__)
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/gtk/dcmemory.h"
|
2006-01-23 03:27:34 +00:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
#include "wx/gtk1/dcmemory.h"
|
2002-02-05 16:34:33 +00:00
|
|
|
#elif defined(__WXX11__)
|
|
|
|
#include "wx/x11/dcmemory.h"
|
2001-06-26 20:59:19 +00:00
|
|
|
#elif defined(__WXMGL__)
|
|
|
|
#include "wx/mgl/dcmemory.h"
|
2006-08-27 09:42:42 +00:00
|
|
|
#elif defined(__WXDFB__)
|
|
|
|
#include "wx/dfb/dcmemory.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
|
|
|
#include "wx/mac/dcmemory.h"
|
2003-03-22 06:18:36 +00:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/dcmemory.h"
|
1999-07-28 03:38:12 +00:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/dcmemory.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_DCMEMORY_H_BASE_
|