#ifndef __OOL_XBITMAP_H__
#define __OOL_XBITMAP_H__

/*===========================================================================*/
/* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
/*===========================================================================*/
/*                              class: XBitmap                               */
/*                       derived from: XGraphicObject                        */
/*                        last update: 12/96                                 */
/*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
/*===========================================================================*/


#include "xgraphob.h"
#include "XPoint.h"
#include "XRes.h"
#include "XWindow.h"
#include "xsize.h"

class _export_  XBitmap: public XGraphicObject
{
      friend class XBitmapShadow;
      friend class XClipBoard;
      friend class XItemDrawEvent;
      friend class XUserButton;
      friend class XContainerObject;
		friend class userbtnhandler;
		friend class userbtnmousehandler;
   private:
      XWindow * owner;
      HBITMAP hbm;
      HDC hdc;
      HPS hps;
      LONG SetData( const BITMAPINFOHEADER2 *, const LONG );
      BOOL HitTest( const LONG x, const LONG y);
      LONG cx, cy, mode, width, height;
   public:
      XBitmap( const XGraphicDevice*, const XPoint * p = NULL, const LONG mode = ROP_SRCCOPY);
      XBitmap( const XWindow *);
      ~XBitmap();
      void Copy( const XGraphicDevice *, const XPoint * );
      void Draw( const XRect * );
      ULONG GetHandle( void ) const { return hbm; }
      LONG Load( const XResource * r);
      LONG Load( const char *);
      void GetDimensions( XSize *);
		void SetOutputSize( const XRect *r) { width = r->GetWidth(); height = r->GetHeight(); }
		XBitmap operator =(const XBitmap& da);
};

#endif
