#if !defined( __XBLITTERWINDOW_HPP__ )
#define __XBLITTERWINDOW_HPP__

#include <xheaders.h>
#include "xfrmwnd.h"
#include "xpal.h"
#include "xblitter.h"


// blitting type
#define BLT_DIRTYRECT   0xff00  // dirty rectangles will be blitted; window mustn't be sizable
#define BLT_NODIRTYRECT 0xff01  // the whole buffer will be blitted


class _export_ XBlitterWindow : public XFrameWindow
{
        friend MRESULT EXPENTRY NewWndProc( HWND, ULONG, MPARAM, MPARAM );

        private:
                PFNWP                   pOldWndProc;            // pointer to the old window proc

                XBlitter*               pBlitter;               // pointer to the blitter object
                ULONG                   flBlitting;             // blitting method

                inline void Activate( void )    { pBlitter->pPalette->Enable(); }
                inline void Deactivate( void )  { pBlitter->pPalette->Disable(); }

        public:
                // ctor / dtor
                         XBlitterWindow( const XResource * resource,
                                         const char * title,
                                               XBlitter* pBlitter,
                                         const ULONG     blitting,
                                         const ULONG createstyle = defaultStyle,
                                         const XRect * rec = NULL,
                                         const XFrameWindow * parent=NULL,
                                         const BOOL buildFromResources = FALSE,
                                         const BOOL animate = FALSE                 );
                virtual ~XBlitterWindow()       {}

                // get a pointer to the blitter object
                XBlitter* GetBlitter( void )    { return pBlitter; }
};

#endif
