dcmemory.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/dcmemory.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKDCMEMORYH__
  9. #define __GTKDCMEMORYH__
  10. #include "wx/dcmemory.h"
  11. #include "wx/gtk1/dcclient.h"
  12. //-----------------------------------------------------------------------------
  13. // classes
  14. //-----------------------------------------------------------------------------
  15. class WXDLLIMPEXP_FWD_CORE wxMemoryDCImpl;
  16. //-----------------------------------------------------------------------------
  17. // wxMemoryDCImpl
  18. //-----------------------------------------------------------------------------
  19. class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxWindowDCImpl
  20. {
  21. public:
  22. wxMemoryDCImpl(wxMemoryDC *owner)
  23. : wxWindowDCImpl(owner)
  24. {
  25. Init();
  26. }
  27. wxMemoryDCImpl(wxMemoryDC *owner, wxBitmap& bitmap)
  28. : wxWindowDCImpl(owner)
  29. {
  30. Init();
  31. DoSelect(bitmap);
  32. }
  33. wxMemoryDCImpl(wxMemoryDC *owner, wxDC *dc);
  34. virtual ~wxMemoryDCImpl();
  35. virtual void DoSelect(const wxBitmap& bitmap);
  36. virtual void DoGetSize( int *width, int *height ) const;
  37. // these get reimplemented for mono-bitmaps to behave
  38. // more like their Win32 couterparts. They now interpret
  39. // wxWHITE, wxWHITE_BRUSH and wxWHITE_PEN as drawing 0
  40. // and everything else as drawing 1.
  41. virtual void SetPen( const wxPen &pen );
  42. virtual void SetBrush( const wxBrush &brush );
  43. virtual void SetBackground( const wxBrush &brush );
  44. virtual void SetTextForeground( const wxColour &col );
  45. virtual void SetTextBackground( const wxColour &col );
  46. // implementation
  47. wxBitmap m_selected;
  48. private:
  49. void Init();
  50. DECLARE_DYNAMIC_CLASS(wxMemoryDCImpl)
  51. };
  52. #endif // __GTKDCMEMORYH__