Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

painter_base.hpp

00001 // painter_base.hpp
00002 
00003 // Copyright (C) 2004 Steven Weiß (steven11@gmx.de)
00004 //
00005 // Permission to copy, use, sell and distribute this software is granted
00006 // provided this copyright notice appears in all copies.
00007 // Permission to modify the code and to distribute modified code is granted
00008 // provided this copyright notice appears in all copies, and a notice
00009 // that the code was modified is included with the copyright notice.
00010 //
00011 // This software is provided "as is" without express or implied warranty,
00012 // and with no claim as to its suitability for any purpose.
00013 
00014 
00015 #pragma once
00016 #include <background_wnd/detail/include.hpp>
00017 
00018 
00019 namespace win32 { namespace gui {
00020 
00033 struct painter_base
00034 {
00035      painter_base()
00036      {}
00037 
00038     virtual ~painter_base()
00039     {}
00040     
00041      virtual bool is_opaque(int cx, int cy) const
00042      {
00043           return false;
00044      }
00045 
00046     virtual void draw(HDC hDC, int cx, int cy) = 0;    
00047      
00048      // FIX_5
00049      // Allow copy construction only through clone() (necessary for painter_holder and background_wnd)
00050      virtual painter_base* clone() const = 0;
00051 
00052 protected:
00053      // FIX_5
00054      painter_base(const painter_base&) {}
00055      const painter_base& operator= (const painter_base&) 
00056      {
00057           return *this;
00058      }
00059 };
00060 
00061 // ========================================================================================================= //
00062 
00068 struct null_painter : painter_base
00069 {    
00070      null_painter* clone() const { return new null_painter(); }
00071      void draw(HDC hDC, int cx, int cy) {}
00072 };
00073 
00074 } }  // namespace win32::gui



by Steven Weiss. You can contact me at steven11@gmx.de.