Autosyncing with Wine
svn path=/trunk/; revision=22823
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS Cards
|
* Cards dll implementation
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003 Filip Navara <xnavara@volny.org>
|
* Copyright (C) 2004 Sami Nopanen
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -18,224 +18,286 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "windows.h"
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
|
||||||
#include "cards.h"
|
#include "cards.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
HBITMAP g_CardBitmaps[MAX_CARD_BITMAPS];
|
WINE_DEFAULT_DEBUG_CHANNEL(cards);
|
||||||
HINSTANCE g_hModule = 0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Redundant function from 16-bit Windows time
|
void WINAPI cdtTerm(void);
|
||||||
|
|
||||||
|
|
||||||
|
static HINSTANCE hInst;
|
||||||
|
static int cardWidth;
|
||||||
|
static int cardHeight;
|
||||||
|
static HBITMAP cardBitmaps[CARD_MAX + 1];
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* Initializes the cards.dll library. Loads the card bitmaps from the
|
||||||
|
* resources, and initializes the card size variables.
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI WEP(DWORD Unknown)
|
BOOL WINAPI cdtInit(int *width, int *height)
|
||||||
{
|
{
|
||||||
return TRUE;
|
BITMAP bm;
|
||||||
}
|
int i;
|
||||||
|
|
||||||
/*
|
TRACE("(%p, %p)\n", width, height);
|
||||||
* Initialize card library and return cards width and height
|
|
||||||
*/
|
|
||||||
BOOL WINAPI cdtInit(INT *Width, INT *Height)
|
|
||||||
{
|
|
||||||
DWORD dwIndex;
|
|
||||||
|
|
||||||
/* Report card width and height to user */
|
for(i = 0; i <= CARD_MAX; i++)
|
||||||
*Width = CARD_WIDTH;
|
cardBitmaps[i] = 0;
|
||||||
*Height = CARD_HEIGHT;
|
|
||||||
|
|
||||||
/* Load images */
|
for(i = 0; i <= CARD_MAX; i++)
|
||||||
for (dwIndex = 0; dwIndex < MAX_CARD_BITMAPS; ++dwIndex)
|
|
||||||
g_CardBitmaps[dwIndex] =
|
|
||||||
(HBITMAP)LoadBitmapA(g_hModule, MAKEINTRESOURCEA(dwIndex + 1));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Terminate card library
|
|
||||||
*/
|
|
||||||
VOID WINAPI cdtTerm(VOID)
|
|
||||||
{
|
|
||||||
DWORD dwIndex;
|
|
||||||
|
|
||||||
/* Unload images */
|
|
||||||
for (dwIndex = 0; dwIndex < MAX_CARD_BITMAPS; dwIndex++)
|
|
||||||
DeleteObject(g_CardBitmaps[dwIndex]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Render card with no stretching
|
|
||||||
*/
|
|
||||||
BOOL WINAPI cdtDraw(HDC hdc, INT x, INT y, INT card, INT type, COLORREF color)
|
|
||||||
{
|
|
||||||
return cdtDrawExt(hdc, x, y, CARD_WIDTH, CARD_HEIGHT, card, type, color);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* internal
|
|
||||||
*/
|
|
||||||
static __inline VOID BltCard(HDC hdc, INT x, INT y, INT dx, INT dy, HDC hdcCard, DWORD dwRasterOp, BOOL bStretch)
|
|
||||||
{
|
|
||||||
if (bStretch)
|
|
||||||
{
|
{
|
||||||
StretchBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, CARD_WIDTH, CARD_HEIGHT, dwRasterOp);
|
cardBitmaps[i] = LoadBitmapA(hInst, MAKEINTRESOURCEA(i));
|
||||||
} else
|
if(cardBitmaps[i] == 0)
|
||||||
{
|
|
||||||
BitBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, dwRasterOp);
|
|
||||||
/*
|
|
||||||
* This is need when using Microsoft images, because they use two-color red/white images for
|
|
||||||
* red cards and thus needs fix-up of the edge to black color.
|
|
||||||
*/
|
|
||||||
#if 0
|
|
||||||
if (ISREDCARD(card))
|
|
||||||
{
|
{
|
||||||
PatBlt(hdc, x, y + 2, 1, dy - 4, BLACKNESS);
|
cdtTerm();
|
||||||
PatBlt(hdc, x + dx - 1, y + 2, 1, dy - 4, BLACKNESS);
|
|
||||||
PatBlt(hdc, x + 2, y, dx - 4, 1, BLACKNESS);
|
|
||||||
PatBlt(hdc, x + 2, y + dy - 1, dx - 4, 1, BLACKNESS);
|
|
||||||
SetPixel(hdc, x + 1, y + 1, 0);
|
|
||||||
SetPixel(hdc, x + dx - 2, y + 1, 0);
|
|
||||||
SetPixel(hdc, x + 1, y + dy - 2, 0);
|
|
||||||
SetPixel(hdc, x + dx - 2, y + dy - 2, 0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Render card
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* hdc - Handle of destination device context
|
|
||||||
* x - Position left
|
|
||||||
* y - Position right
|
|
||||||
* dx - Destination width
|
|
||||||
* dy - Destination height
|
|
||||||
* card - Image id (meaning depend on type)
|
|
||||||
* type - One of edt* constants
|
|
||||||
* color - Background color (?)
|
|
||||||
*/
|
|
||||||
BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type, COLORREF color)
|
|
||||||
{
|
|
||||||
HDC hdcCard;
|
|
||||||
DWORD dwRasterOp = SRCCOPY, OldBkColor;
|
|
||||||
BOOL bSaveEdges = TRUE;
|
|
||||||
BOOL bStretch = FALSE;
|
|
||||||
|
|
||||||
if (type & ectSAVEEDGESMASK)
|
|
||||||
{
|
|
||||||
type &= ~ectSAVEEDGESMASK;
|
|
||||||
bSaveEdges = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dx != CARD_WIDTH || dy != CARD_HEIGHT)
|
|
||||||
{
|
|
||||||
bStretch = TRUE;
|
|
||||||
bSaveEdges = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case ectINVERTED:
|
|
||||||
dwRasterOp = NOTSRCCOPY;
|
|
||||||
case ectFACES:
|
|
||||||
card = (card % 4) * 13 + (card / 4);
|
|
||||||
break;
|
|
||||||
case ectBACKS:
|
|
||||||
--card;
|
|
||||||
break;
|
|
||||||
case ectEMPTYNOBG:
|
|
||||||
dwRasterOp = SRCAND;
|
|
||||||
case ectEMPTY:
|
|
||||||
card = 52;
|
|
||||||
break;
|
|
||||||
case ectERASE:
|
|
||||||
break;
|
|
||||||
case ectREDX:
|
|
||||||
card = 66;
|
|
||||||
break;
|
|
||||||
case ectGREENO:
|
|
||||||
card = 67;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == ectEMPTY || type == ectERASE)
|
GetObjectA(cardBitmaps[0], sizeof(BITMAP), &bm);
|
||||||
{
|
*width = cardWidth = bm.bmWidth;
|
||||||
POINT pPoint;
|
*height = cardHeight = bm.bmHeight;
|
||||||
HBRUSH hBrush;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
hBrush = CreateSolidBrush(color);
|
static DWORD do_blt(HDC hdc, int x, int y, int dx, int dy, HDC hMemoryDC, DWORD rasterOp )
|
||||||
GetDCOrgEx(hdc, &pPoint);
|
{
|
||||||
SetBrushOrgEx(hdc, pPoint.x, pPoint.y, 0);
|
if((cardWidth == dx) && (cardHeight == dy))
|
||||||
SelectObject(hdc, hBrush);
|
return BitBlt(hdc, x, y, cardWidth, cardHeight, hMemoryDC, 0, 0, rasterOp);
|
||||||
PatBlt(hdc, x, y, dx, dy, PATCOPY);
|
return StretchBlt(hdc, x, y, dx, dy, hMemoryDC, 0, 0, cardWidth, cardHeight, rasterOp);
|
||||||
}
|
}
|
||||||
if (type != ectERASE)
|
|
||||||
|
/***********************************************************************
|
||||||
|
* Draw a card. Unlike cdtDrawCard, this version allows you to stretch
|
||||||
|
* card bitmaps to the size you specify (dx, dy). See cdtDraw for info
|
||||||
|
* on card, mode and color parameters.
|
||||||
|
*/
|
||||||
|
BOOL WINAPI cdtDrawExt(HDC hdc, int x, int y, int dx, int dy, int card, int mode, DWORD color)
|
||||||
|
{
|
||||||
|
HDC hMemoryDC;
|
||||||
|
HBITMAP hCardBitmap;
|
||||||
|
HGDIOBJ result;
|
||||||
|
DWORD rasterOp = SRCCOPY;
|
||||||
|
BOOL roundCornersFlag;
|
||||||
|
BOOL eraseFlag = FALSE;
|
||||||
|
BOOL drawFlag = TRUE;
|
||||||
|
|
||||||
|
TRACE("(%p, %d, %d, %d, %d, %d, %d, %ld)\n", hdc, x, y, dx, dy, card, mode, color);
|
||||||
|
|
||||||
|
roundCornersFlag = !(mode & MODEFLAG_DONT_ROUND_CORNERS) &&
|
||||||
|
(dx == cardWidth) && (dy == cardHeight);
|
||||||
|
mode &= ~MODEFLAG_DONT_ROUND_CORNERS;
|
||||||
|
|
||||||
|
if((card < 0) || (card > CARD_MAX))
|
||||||
{
|
{
|
||||||
hdcCard = CreateCompatibleDC(hdc);
|
FIXME("Unexpected card: %d\n", card);
|
||||||
SelectObject(hdcCard, g_CardBitmaps[card]);
|
return FALSE;
|
||||||
OldBkColor = SetBkColor(hdc, (type == ectFACES) ? 0xFFFFFF : color);
|
}
|
||||||
if (bSaveEdges)
|
|
||||||
|
if((mode < MODE_FACEUP) || (mode > MODE_DECKO))
|
||||||
|
{
|
||||||
|
FIXME("Unexpected mode: %d\n", mode);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(mode)
|
||||||
|
{
|
||||||
|
case MODE_FACEUP:
|
||||||
|
break;
|
||||||
|
case MODE_FACEDOWN:
|
||||||
|
break;
|
||||||
|
case MODE_HILITE:
|
||||||
|
rasterOp = NOTSRCCOPY;
|
||||||
|
break;
|
||||||
|
case MODE_GHOST:
|
||||||
|
card = CARD_FREE_MASK;
|
||||||
|
eraseFlag = TRUE;
|
||||||
|
rasterOp = SRCAND;
|
||||||
|
break;
|
||||||
|
case MODE_REMOVE:
|
||||||
|
eraseFlag = TRUE;
|
||||||
|
drawFlag = FALSE;
|
||||||
|
break;
|
||||||
|
case MODE_INVISIBLEGHOST:
|
||||||
|
card = CARD_FREE_MASK;
|
||||||
|
rasterOp = SRCAND;
|
||||||
|
break;
|
||||||
|
case MODE_DECKX:
|
||||||
|
card = CARD_BACK_THE_X;
|
||||||
|
break;
|
||||||
|
case MODE_DECKO:
|
||||||
|
card = CARD_BACK_THE_O;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
hMemoryDC = CreateCompatibleDC(hdc);
|
||||||
|
if(hMemoryDC == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if(eraseFlag)
|
||||||
|
{
|
||||||
|
HBRUSH hBrush;
|
||||||
|
RECT rect;
|
||||||
|
hBrush = CreateSolidBrush(color);
|
||||||
|
rect.left = x;
|
||||||
|
rect.top = y;
|
||||||
|
rect.right = x + cardWidth - 1;
|
||||||
|
rect.bottom = y + cardHeight - 1;
|
||||||
|
FillRect(hdc, &rect, hBrush);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(drawFlag)
|
||||||
|
{
|
||||||
|
hCardBitmap = cardBitmaps[card];
|
||||||
|
if(hCardBitmap == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
result = SelectObject(hMemoryDC, hCardBitmap);
|
||||||
|
if((result == 0) || (result == HGDI_ERROR))
|
||||||
{
|
{
|
||||||
COLORREF SavedPixels[12];
|
DeleteDC(hMemoryDC);
|
||||||
SavedPixels[0] = GetPixel(hdc, x, y);
|
return FALSE;
|
||||||
SavedPixels[1] = GetPixel(hdc, x + 1, y);
|
}
|
||||||
SavedPixels[2] = GetPixel(hdc, x, y + 1);
|
|
||||||
SavedPixels[3] = GetPixel(hdc, x + dx - 1, y);
|
|
||||||
SavedPixels[4] = GetPixel(hdc, x + dx - 2, y);
|
|
||||||
SavedPixels[5] = GetPixel(hdc, x + dx - 1, y + 1);
|
|
||||||
SavedPixels[6] = GetPixel(hdc, x, y + dy - 1);
|
|
||||||
SavedPixels[7] = GetPixel(hdc, x + 1, y + dy - 1);
|
|
||||||
SavedPixels[8] = GetPixel(hdc, x, y + dy - 2);
|
|
||||||
SavedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1);
|
|
||||||
SavedPixels[10] = GetPixel(hdc, x + dx - 2, y + dy - 1);
|
|
||||||
SavedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2);
|
|
||||||
|
|
||||||
BltCard(hdc, x, y, dx, dy, hdcCard, dwRasterOp, bStretch);
|
SetBkColor(hdc, color);
|
||||||
|
|
||||||
SetPixel(hdc, x, y, SavedPixels[0]);
|
if(roundCornersFlag)
|
||||||
SetPixel(hdc, x + 1, y, SavedPixels[1]);
|
{
|
||||||
SetPixel(hdc, x, y + 1, SavedPixels[2]);
|
COLORREF savedPixels[12];
|
||||||
SetPixel(hdc, x + dx - 1, y, SavedPixels[3]);
|
|
||||||
SetPixel(hdc, x + dx - 2, y, SavedPixels[4]);
|
savedPixels[0] = GetPixel(hdc, x, y);
|
||||||
SetPixel(hdc, x + dx - 1, y + 1, SavedPixels[5]);
|
savedPixels[1] = GetPixel(hdc, x + 1, y);
|
||||||
SetPixel(hdc, x, y + dy - 1, SavedPixels[6]);
|
savedPixels[2] = GetPixel(hdc, x, y + 1);
|
||||||
SetPixel(hdc, x + 1, y + dy - 1, SavedPixels[7]);
|
savedPixels[3] = GetPixel(hdc, x + dx - 1, y);
|
||||||
SetPixel(hdc, x, y + dy - 2, SavedPixels[8]);
|
savedPixels[4] = GetPixel(hdc, x + dx - 2, y);
|
||||||
SetPixel(hdc, x + dx - 1, y + dy - 1, SavedPixels[9]);
|
savedPixels[5] = GetPixel(hdc, x + dx - 1, y + 1);
|
||||||
SetPixel(hdc, x + dx - 2, y + dy - 1, SavedPixels[10]);
|
savedPixels[6] = GetPixel(hdc, x, y + dy - 1);
|
||||||
SetPixel(hdc, x + dx - 1, y + dy - 2, SavedPixels[11]);
|
savedPixels[7] = GetPixel(hdc, x + 1, y + dy - 1);
|
||||||
}
|
savedPixels[8] = GetPixel(hdc, x, y + dy - 2);
|
||||||
else
|
savedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1);
|
||||||
{
|
savedPixels[10] = GetPixel(hdc, x + dx - 2, y + dy - 1);
|
||||||
BltCard(hdc, x, y, dx, dy, hdcCard, dwRasterOp, bStretch);
|
savedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2);
|
||||||
}
|
|
||||||
SetBkColor(hdc, OldBkColor);
|
do_blt(hdc, x, y, dx, dy, hMemoryDC, rasterOp);
|
||||||
DeleteDC(hdcCard);
|
|
||||||
|
SetPixel(hdc, x, y, savedPixels[0]);
|
||||||
|
SetPixel(hdc, x + 1, y, savedPixels[1]);
|
||||||
|
SetPixel(hdc, x, y + 1, savedPixels[2]);
|
||||||
|
SetPixel(hdc, x + dx - 1, y, savedPixels[3]);
|
||||||
|
SetPixel(hdc, x + dx - 2, y, savedPixels[4]);
|
||||||
|
SetPixel(hdc, x + dx - 1, y + 1, savedPixels[5]);
|
||||||
|
SetPixel(hdc, x, y + dy - 1, savedPixels[6]);
|
||||||
|
SetPixel(hdc, x + 1, y + dy - 1, savedPixels[7]);
|
||||||
|
SetPixel(hdc, x, y + dy - 2, savedPixels[8]);
|
||||||
|
SetPixel(hdc, x + dx - 1, y + dy - 1, savedPixels[9]);
|
||||||
|
SetPixel(hdc, x + dx - 2, y + dy - 1, savedPixels[10]);
|
||||||
|
SetPixel(hdc, x + dx - 1, y + dy - 2, savedPixels[11]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
do_blt(hdc, x, y, dx, dy, hMemoryDC, rasterOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeleteDC(hMemoryDC);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* cdtAnimate (CARDS.@)
|
* Draws a card at position x, y in its default size (as returned by
|
||||||
|
* cdtInit.
|
||||||
*
|
*
|
||||||
* Animate card background, we don't use it
|
* Mode controls how the card gets drawn:
|
||||||
|
* MODE_FACEUP ; draw card facing up
|
||||||
|
* MODE_FACEDOWN ; draw card facing down
|
||||||
|
* MODE_HILITE ; draw face up, with NOTSRCCOPY
|
||||||
|
* MODE_GHOST ; draw 'ghost' card
|
||||||
|
* MODE_REMOVE ; draw with background color
|
||||||
|
* MODE_INVISIBLEGHOST ; draw 'ghost' card, without clearing background
|
||||||
|
* MODE_DECKX ; draw X
|
||||||
|
* MODE_DECKO ; draw O
|
||||||
|
*
|
||||||
|
* The card parameter defines the card graphic to be drawn. If we are
|
||||||
|
* drawing fronts of cards, card should have a value from 0 through 51
|
||||||
|
* to represent the card face. If we are drawing card backs, 53 through
|
||||||
|
* 68 represent different card backs.
|
||||||
|
*
|
||||||
|
* When drawing card faces, two lowest bits represent the card suit
|
||||||
|
* (clubs, diamonds, hearts, spades), and the bits above that define the
|
||||||
|
* card value (ace, 2, ..., king). That is,
|
||||||
|
* card = face * 4 + suit.
|
||||||
|
*
|
||||||
|
* Color parameter defines the background color, used when drawing some
|
||||||
|
* card backs.
|
||||||
|
*/
|
||||||
|
BOOL WINAPI cdtDraw(HDC hdc, int x, int y, int card, int mode, DWORD color)
|
||||||
|
{
|
||||||
|
TRACE("(%p, %d, %d, %d, %d, %ld)\n", hdc, x, y, card, mode, color);
|
||||||
|
|
||||||
|
return cdtDrawExt(hdc, x, y, cardWidth, cardHeight, card, mode, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* Animates the card backs, e.g. blinking lights on the robot, the sun
|
||||||
|
* donning sunglasses, bats flying across the caste, etc.. Works only
|
||||||
|
* for cards of normal size (as drawn with cdtDraw). To draw frames of
|
||||||
|
* the card back animation, start with frame = 0, and increment the
|
||||||
|
* frame by one, until cdtAnimate returns FALSE (to indicate that we
|
||||||
|
* have gone through all frames of animation).
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI cdtAnimate(HDC hdc, int cardback, int x, int y, int frame)
|
BOOL WINAPI cdtAnimate(HDC hdc, int cardback, int x, int y, int frame)
|
||||||
{
|
{
|
||||||
return TRUE;
|
TRACE("(%p, %d, %d, %d, %d)\n", hdc, cardback, x, y, frame);
|
||||||
|
FIXME("Implement me.\n");
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|
||||||
{
|
|
||||||
if (fdwReason == DLL_PROCESS_ATTACH)
|
|
||||||
g_hModule = hinstDLL;
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* Frees resources reserved by cdtInitialize.
|
||||||
|
*/
|
||||||
|
void WINAPI cdtTerm()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
TRACE("()\n");
|
||||||
|
|
||||||
|
for(i = 0; i <= CARD_MAX; i++)
|
||||||
|
{
|
||||||
|
if(cardBitmaps[i] != 0)
|
||||||
|
DeleteObject(cardBitmaps[i]);
|
||||||
|
cardBitmaps[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* DllMain.
|
||||||
|
*/
|
||||||
|
BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved)
|
||||||
|
{
|
||||||
|
switch (reason)
|
||||||
|
{
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
hInst = inst;
|
||||||
|
DisableThreadLibraryCalls( inst );
|
||||||
|
break;
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
break;
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
LIBRARY cards.dll
|
|
||||||
EXPORTS
|
|
||||||
WEP@4
|
|
||||||
cdtAnimate@20
|
|
||||||
cdtDraw@24
|
|
||||||
cdtDrawExt@32
|
|
||||||
cdtInit@8
|
|
||||||
cdtTerm@0
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS Cards
|
* Cards dll definitions
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003 Filip Navara <xnavara@volny.org>
|
* Copyright (C) 2004 Sami Nopanen
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -18,44 +18,54 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CARDS_H
|
#ifndef __CARDS_H__
|
||||||
#define _CARDS_H
|
#define __CARDS_H__
|
||||||
|
|
||||||
/*
|
/* Card suits */
|
||||||
* 52 card faces +
|
#define CARD_SUIT_CLUBS 0
|
||||||
* 12 card backs +
|
#define CARD_SUIT_DIAMONDS 1
|
||||||
* X Sign +
|
#define CARD_SUIT_HEARTS 2
|
||||||
* O Sign +
|
#define CARD_SUIT_SPADES 3
|
||||||
* FreeCard +
|
|
||||||
* Joker
|
|
||||||
*/
|
|
||||||
#define MAX_CARD_BITMAPS 68
|
|
||||||
|
|
||||||
#define ectFACES 0
|
|
||||||
#define ectBACKS 1
|
|
||||||
#define ectINVERTED 2
|
|
||||||
#define ectEMPTY 3
|
|
||||||
#define ectERASE 4
|
|
||||||
#define ectEMPTYNOBG 5
|
|
||||||
#define ectREDX 6
|
|
||||||
#define ectGREENO 7
|
|
||||||
#define ectSAVEEDGESMASK 0x80000000
|
|
||||||
|
|
||||||
/* Microsoft card dimensions */
|
/* 0-51 = normal 52 cards of deck */
|
||||||
/*
|
/* 52 = ghost card mask */
|
||||||
#define CARD_WIDTH 71
|
/* 53-68 = card backs */
|
||||||
#define CARD_HEIGHT 96
|
#define CARD_FREE_MASK 52
|
||||||
*/
|
#define CARD_BACK_CROSSHATCH 53
|
||||||
/* Oxymoron's card dimensions */
|
#define CARD_BACK_WEAVE1 54
|
||||||
#define CARD_WIDTH 73
|
#define CARD_BACK_WEAVE2 55
|
||||||
#define CARD_HEIGHT 97
|
#define CARD_BACK_ROBOT 56
|
||||||
|
#define CARD_BACK_FLOWERS 57
|
||||||
|
#define CARD_BACK_VINE1 58
|
||||||
|
#define CARD_BACK_VINE2 59
|
||||||
|
#define CARD_BACK_FISH1 60
|
||||||
|
#define CARD_BACK_FISH2 61
|
||||||
|
#define CARD_BACK_SHELLS 62
|
||||||
|
#define CARD_BACK_CASTLE 63
|
||||||
|
#define CARD_BACK_ISLAND 64
|
||||||
|
#define CARD_BACK_CARDHAND 65
|
||||||
|
#define CARD_BACK_UNUSED 66
|
||||||
|
#define CARD_BACK_THE_X 67
|
||||||
|
#define CARD_BACK_THE_O 68
|
||||||
|
|
||||||
#define ISREDCARD(x) (x >= 13 && x <= 39)
|
#define CARD_MAX 68
|
||||||
|
|
||||||
BOOL WINAPI cdtInit(int *width, int *height);
|
/* Drawing modes */
|
||||||
BOOL WINAPI cdtDraw(HDC hdc, int x, int y, int card, int type, DWORD color);
|
#define MODE_FACEUP 0
|
||||||
BOOL WINAPI cdtDrawExt(HDC hdc, int x, int y, int dx, int dy, int card, int suit, DWORD color);
|
#define MODE_FACEDOWN 1
|
||||||
BOOL WINAPI cdtAnimate(HDC hdc, int cardback, int x, int y, int frame);
|
#define MODE_HILITE 2
|
||||||
void WINAPI cdtTerm(void);
|
#define MODE_GHOST 3
|
||||||
|
#define MODE_REMOVE 4
|
||||||
|
#define MODE_INVISIBLEGHOST 5
|
||||||
|
#define MODE_DECKX 6
|
||||||
|
#define MODE_DECKO 7
|
||||||
|
|
||||||
#endif /* _CARDS_H */
|
#define MODEFLAG_DONT_ROUND_CORNERS 0x80000000
|
||||||
|
|
||||||
|
/* As defined by CARD_SUIT_* */
|
||||||
|
#define SUIT_FROM_CARD(card) (card & 3)
|
||||||
|
/* 0 = ace, ..., 12 = king */
|
||||||
|
#define FACE_FROM_CARD(card) (card >> 2)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,13 +1,22 @@
|
||||||
<module name="cards" type="win32dll" baseaddress="${BASEADDRESS_CARDS}" installbase="system32" installname="cards.dll">
|
<module name="cards" type="win32dll" baseaddress="${BASEADDRESS_CARDS}" installbase="system32" installname="cards.dll" allowwarnings="true">
|
||||||
<importlibrary definition="cards.def" />
|
<importlibrary definition="cards.spec.def" />
|
||||||
<include base="cards">.</include>
|
<include base="cards">.</include>
|
||||||
<define name="UNICODE" />
|
<include base="ReactOS">include/reactos/wine</include>
|
||||||
<define name="_UNICODE" />
|
<define name="__REACTOS__" />
|
||||||
|
<define name="__WINESRC__" />
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<library>ntdll</library>
|
<define name="_WIN32_IE">0x600</define>
|
||||||
<library>kernel32</library>
|
<define name="_WIN32_WINNT">0x501</define>
|
||||||
<library>gdi32</library>
|
<define name="WINVER">0x501</define>
|
||||||
|
<library>wine</library>
|
||||||
<library>user32</library>
|
<library>user32</library>
|
||||||
|
<library>gdi32</library>
|
||||||
|
<library>kernel32</library>
|
||||||
|
<library>ntdll</library>
|
||||||
<file>cards.c</file>
|
<file>cards.c</file>
|
||||||
|
<library>ntdll</library>
|
||||||
<file>cards.rc</file>
|
<file>cards.rc</file>
|
||||||
|
<library>ntdll</library>
|
||||||
|
<file>version.rc</file>
|
||||||
|
<file>cards.spec</file>
|
||||||
</module>
|
</module>
|
||||||
|
|
5
reactos/dll/win32/cards/cards.spec
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@ stdcall cdtAnimate(long long long long long)
|
||||||
|
@ stdcall cdtDraw(long long long long long long)
|
||||||
|
@ stdcall cdtDrawExt(long long long long long long long long)
|
||||||
|
@ stdcall cdtInit(ptr ptr)
|
||||||
|
@ stdcall cdtTerm()
|
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
28
reactos/dll/win32/cards/version.rc
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Cards dll version resources
|
||||||
|
*
|
||||||
|
* Copyright (C) 2004 Sami Nopanen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define WINE_FILEDESCRIPTION_STR "Wine Cards Library"
|
||||||
|
#define WINE_FILENAME_STR "cards.dll"
|
||||||
|
#define WINE_FILEVERSION 5,0,2134,1
|
||||||
|
#define WINE_FILEVERSION_STR "5.00.2134.1"
|
||||||
|
#define WINE_PRODUCTVERSION 5,0,2134,1
|
||||||
|
#define WINE_PRODUCTVERSION_STR "5.00.2134.1"
|
||||||
|
|
||||||
|
#include "wine/wine_common_ver.rc"
|