Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

gritem.h

00001 /*
00002 /--------------------------------------------------------------------
00003 |
00004 |      $Id: gritem.h,v 1.5 2002/02/24 13:00:57 uzadow Exp $
00005 |      Graphic item class
00006 |
00007 |      Abstract base class for an item on a canvas. Saves position
00008 |      and size information as well as opacity of the item. The
00009 |      actual draw method is implemented in derived classes.
00010 |
00011 |      Copyright (c) 1996-2002 Ulrich von Zadow
00012 |
00013 \--------------------------------------------------------------------
00014 */
00015 
00016 #ifndef INCL_GRITEM
00017 #define INCL_GRITEM
00018 
00019 class PLBmp;
00020 
00021 class CGrItem : public CObject
00022 {
00023 
00024 DECLARE_DYNAMIC (CGrItem);
00025 
00026 public:
00027   CGrItem
00028     ( int x,            // Position on the canvas
00029       int y,
00030       int w,            // Width
00031       int h,            // Height
00032       int z,            // Position in z-Order
00033       BYTE Opacity      // Opacity of the object. 255 is completely
00034                         // opaque, 0 is completely transparent.
00035     );
00036     // Create and initialize a GrItem.
00037 
00038   ~CGrItem
00039     ();
00040 
00041   virtual void Draw
00042     ( PLBmp * pCanvas,
00043       CRect * pUpdateRect
00044     ) = 0;
00045     // Responsible for drawing the object on the canvas. Implemented
00046     // in a derived class.
00047 
00048 
00049   void GetRect
00050     ( CRect * pRect
00051     );
00052     // Returns dimensions as a rectangle.
00053 
00054   // Member variables.
00055 
00056   int    m_x, m_y;     // Position on the canvas
00057   int    m_w, m_h;     // Width & Height
00058   int    m_z;          // Position in z-Order
00059   BYTE   m_Opacity;    // Opacity of the object. 255 is completely
00060                        // opaque, 0 is completely transparent.
00061 
00062 protected:
00063   void clip
00064     ( PLBmp * pDestBmp,
00065       CRect * pUpdRect
00066     );
00067     // Clips pUpdRect to the current item and canvas.
00068 
00069 };
00070 
00071 #endif
00072 /*
00073 /--------------------------------------------------------------------
00074 |
00075 |      $Log: gritem.h,v $
00076 |      Revision 1.5  2002/02/24 13:00:57  uzadow
00077 |      Documentation update; removed buggy PLFilterRotate.
00078 |
00079 |      Revision 1.4  2001/09/16 19:03:23  uzadow
00080 |      Added global name prefix PL, changed most filenames.
00081 |
00082 |
00083 --------------------------------------------------------------------
00084 */

Generated on Sun Jun 6 13:42:21 2004 for paintlib by doxygen 1.3.2