#ifdef HAVE_XWIN_CONFIG_H
#include <xwin-config.h>
#endif
#include "win.h"
extern int g_iPixmapPrivateIndex;
#if 0
static void
winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw);
static void
winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh);
static void
winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
int xrot, int yrot);
#endif
PixmapPtr
winCreatePixmapNativeGDI (ScreenPtr pScreen,
int iWidth, int iHeight,
int iDepth)
{
winPrivPixmapPtr pPixmapPriv = NULL;
PixmapPtr pPixmap = NULL;
pPixmap = AllocatePixmap (pScreen, 0);
if (!pPixmap)
{
ErrorF ("winCreatePixmapNativeGDI () - Couldn't allocate a pixmap\n");
return NullPixmap;
}
#if CYGDEBUG
winDebug ("winCreatePixmap () - w %d h %d d %d bw %d\n",
iWidth, iHeight, iDepth,
PixmapBytePad (iWidth, iDepth));
#endif
pPixmap->drawable.type = DRAWABLE_PIXMAP;
pPixmap->drawable.class = 0;
pPixmap->drawable.pScreen = pScreen;
pPixmap->drawable.depth = iDepth;
pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
pPixmap->drawable.id = 0;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pPixmap->drawable.x = 0;
pPixmap->drawable.y = 0;
pPixmap->drawable.width = iWidth;
pPixmap->drawable.height = iHeight;
pPixmap->devKind = 0;
pPixmap->refcnt = 1;
pPixmap->devPrivate.ptr = NULL;
pPixmapPriv = winGetPixmapPriv (pPixmap);
pPixmapPriv->hBitmap = NULL;
pPixmapPriv->hdcSelected = NULL;
pPixmapPriv->pbBits = NULL;
pPixmapPriv->dwScanlineBytes = PixmapBytePad (iWidth, iDepth);
if (iWidth == 0 || iHeight == 0)
{
return pPixmap;
}
pPixmapPriv->hBitmap = winCreateDIBNativeGDI (iWidth, iHeight, iDepth,
&pPixmapPriv->pbBits,
(BITMAPINFO **) &pPixmapPriv->pbmih);
#if CYGDEBUG
winDebug ("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " \
"screen: %08x\n",
pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen);
#endif
return pPixmap;
}
Bool
winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
{
winPrivPixmapPtr pPixmapPriv = NULL;
#if CYGDEBUG
winDebug ("winDestroyPixmapNativeGDI ()\n");
#endif
if (pPixmap == NULL)
{
ErrorF ("winDestroyPixmapNativeGDI () - No pixmap to destroy\n");
return TRUE;
}
pPixmapPriv = winGetPixmapPriv (pPixmap);
#if CYGDEBUG
winDebug ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n",
pPixmapPriv->hBitmap);
#endif
--pPixmap->refcnt;
if (pPixmap->refcnt != 0)
return TRUE;
if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap);
if (pPixmapPriv->pbmih != NULL)
{
free (pPixmapPriv->pbmih);
pPixmapPriv->pbmih = NULL;
}
free (pPixmap);
pPixmap = NULL;
return TRUE;
}
Bool
winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap,
int iWidth, int iHeight,
int iDepth,
int iBitsPerPixel,
int devKind,
pointer pPixData)
{
FatalError ("winModifyPixmapHeaderNativeGDI ()\n");
return TRUE;
}
#if 0
static void
winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw)
{
ErrorF ("winXRotatePixmap()\n");
}
static void
winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh)
{
ErrorF ("winYRotatePixmap()\n");
}
static void
winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
int xrot, int yrot)
{
ErrorF ("winCopyRotatePixmap()\n");
}
#endif