home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / include / xgraphob.h < prev    next >
Text File  |  1997-02-23  |  2KB  |  52 lines

  1. #ifndef __OOL_XGRAPHICOBJ_H__
  2. #define __OOL_XGRAPHICOBJ_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
  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 XPrinterDevice;
  28.    protected:
  29.       XGraphicObject * next;
  30.       XGraphicDevice * dev;
  31.       XColor color;
  32.       XPoint p;
  33.       char settings;
  34.       virtual BOOL HitTest( const LONG , const LONG ) { return FALSE;}
  35.       XGraphicObject() { next=NULL; }
  36.         SHORT pattern;
  37.    public:
  38.       XGraphicObject( const XGraphicDevice*, const XPoint * p = NULL);
  39.       XGraphicObject( const XGraphicDevice*d, const LONG x, const LONG y);
  40.       virtual ~XGraphicObject() { if(dev) dev->RemoveObject( this, FALSE); }
  41.       virtual void Draw( const XRect * = NULL) { ;}
  42.       void GetColor( XColor * c) { *c = color; }
  43.       void GetPos( XPoint * point) { *point = p; }
  44.       void Move( const XPoint * point) { p = *point; }
  45.       void SetColor( const XColor * c) { color = *c;}
  46.         void SetPattern( SHORT p) { pattern = p; }
  47.       virtual void SetupDevice ( void ) { LONG c = color.GetColor();    if( dev->aktColor != c)    dev->SetColor(c); if(dev->aktPattern != pattern) dev->SetPattern(pattern);};
  48.       void Show( const BOOL show = TRUE );
  49. };
  50.  
  51. #endif
  52.