home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xgraphob.h < prev    next >
Text File  |  1998-01-18  |  2KB  |  51 lines

  1. #ifndef __OOL_XGRAPHICOBJ_H__
  2. #define __OOL_XGRAPHICOBJ_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XGraphicObject                        */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 7/96                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13.  
  14. #include "xobject.h"
  15. #include "xpoint.h"
  16. #include "XColor.h"
  17. #include "XGraphDv.h"
  18.  
  19. class XRect;
  20.  
  21. #define GO_HIDE 1
  22.  
  23.  
  24. class _export_ XGraphicObject: public XObject
  25. {
  26.       friend XGraphicDevice;
  27.       friend class XLayer;
  28.       friend class XPrinterDevice;
  29.    protected:
  30.       XColor color;
  31.       XPoint p;
  32.       char settings;
  33.       virtual BOOL HitTest( const LONG , const LONG ) { return FALSE;}
  34.       XGraphicObject() { ;}
  35.       SHORT pattern;
  36.    public:
  37.       XGraphicObject( const XPoint * p = NULL);
  38.       XGraphicObject( const LONG x, const LONG y);
  39.       virtual ~XGraphicObject() { ;}
  40.       virtual void Draw( XGraphicDevice * dev ) { ;}
  41.       void GetColor( XColor * c) { *c = color; }
  42.       void GetPos( XPoint * point) { *point = p; }
  43.       void Move( const XPoint * point) { p = *point; }
  44.       void SetColor( const XColor * c) { color = *c;}
  45.       void SetPattern( SHORT p) { pattern = p; }
  46.       virtual void SetupDevice ( XGraphicDevice * dev ) { LONG c = color.GetColor();   if( dev->aktColor != c)   dev->SetColor(c); if(dev->aktPattern != pattern) dev->SetPattern(pattern);}
  47.       void Show( const BOOL show = TRUE );
  48. };
  49.  
  50. #endif
  51.