home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / ui / brush.h < prev    next >
C/C++ Source or Header  |  1995-04-09  |  2KB  |  99 lines

  1. #ifndef _brush_h_
  2. #define _brush_h_
  3.  
  4.  
  5.  
  6.  
  7.  
  8. /*
  9.  *
  10.  *          Copyright (C) 1994, M. A. Sridhar
  11.  *  
  12.  *
  13.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  14.  *     to copy, modify or distribute this software  as you see fit,
  15.  *     and to use  it  for  any  purpose, provided   this copyright
  16.  *     notice and the following   disclaimer are included  with all
  17.  *     copies.
  18.  *
  19.  *                        DISCLAIMER
  20.  *
  21.  *     The author makes no warranties, either expressed or implied,
  22.  *     with respect  to  this  software, its  quality, performance,
  23.  *     merchantability, or fitness for any particular purpose. This
  24.  *     software is distributed  AS IS.  The  user of this  software
  25.  *     assumes all risks  as to its quality  and performance. In no
  26.  *     event shall the author be liable for any direct, indirect or
  27.  *     consequential damages, even if the  author has been  advised
  28.  *     as to the possibility of such damages.
  29.  *
  30.  */
  31.  
  32.  
  33.  
  34. // Authors: M. A. Sridhar
  35. //          N. Bhowmik
  36.  
  37.  
  38. #if defined(__GNUC__)
  39. #pragma interface
  40. #endif
  41.  
  42.  
  43. #include "ui/dsplrsrc.h"
  44. #include "ui/color.h"
  45.  
  46.  
  47. // A Brush is an object used to draw patterns and colors on a
  48. // DrawingSurface. This object only maintains attributes of the brush; the
  49. // actual drawing is done by the DrawingSurface object.
  50.  
  51.  
  52.  
  53.  
  54.  
  55. enum UI_BrushPattern   {
  56.     UIBrush_Hatched, UIBrush_Hollow, UIBrush_Solid
  57. };
  58.  
  59.  
  60.  
  61. class CL_EXPORT UI_Brush: public UI_DisplayResource {
  62.  
  63. public:
  64.     UI_Brush (UI_DrawingSurface* ctxt, const UI_Color& color,
  65.               UI_BrushPattern pattern);
  66.     // Construct a brush with given color and pattern, for the given
  67.     // display surface.
  68.  
  69.     UI_Brush (const UI_Brush&);
  70.     // Copy constructor.
  71.  
  72.     ~UI_Brush ();
  73.     // Destructor.
  74.  
  75.     void Pattern (UI_BrushPattern p);
  76.     // Set the brush pattern.
  77.  
  78.     UI_BrushPattern Pattern ();
  79.     // Return the brush pattern.
  80.  
  81.     UI_Color Color ();
  82.  
  83.     void Color (const UI_Color&);
  84.     
  85.     const char* ClassName() const {return "UI_Brush";};
  86.     // Override the inherited {\small\tt CL_Object}'s method.
  87.  
  88. protected:
  89.  
  90.     UI_Color          _color;
  91.     UI_BrushPattern   _pattern;
  92.  
  93.     void              _Setup();
  94.  
  95. };
  96.  
  97. #endif
  98.  
  99.