15#define TRACE(s) printf("%s(%i): %s",__FILE__,__LINE__,s)
25static pDebugClickProc DebugStackClickProc = 0;
27void CardLib_SetStackClickProc(pDebugClickProc
proc)
29 DebugStackClickProc =
proc;
37 int maxoverlapidx = -1;
47 if(percent > maxoverlap &&
Regions[
i]->IsVisible())
55 if(maxoverlapidx != -1)
70 if(
x >= axpos && x < axpos + width && y >= aypos &&
y < aypos +
height &&
fVisible)
132 if(cardindex > maxidx) cardindex = maxidx;
143 if(iNumCards <= 0)
return false;
233 if(DebugStackClickProc)
235 if(!DebugStackClickProc(*
this))
319 TRACE (
"can I drop card?\n" );
322 TRACE (
"yes, dropping card\n" );
349 TRACE (
"done dropping card\n" );
357 TRACE (
"no, putting card back\n" );
359 TRACE (
"calling ZoomCard()\n" );
361 TRACE (
"cardstack += dragstack\n" );
363 TRACE (
"calling ReleaseDC()\n" );
366 TRACE (
"calling Update()\n" );
368 TRACE (
"done putting card back\n" );
374 TRACE (
"OnLButtonUp() done\n" );
446 int interheight = inter.
bottom-inter.
top;
447 int destx, desty, srcx, srcy;
496#ifdef FIXED_PREC_MOVE
498void ZoomCard(
HDC hdc,
int xpos,
int ypos, CARDSTACK *
dest)
509 apparentcards=
dest->numcards/
dest->threedcount;
511 int idestx =
dest->xpos +
dest->xoffset * (apparentcards);
512 int idesty =
dest->ypos +
dest->yoffset * (apparentcards);
532 if(
dx < 0 && ix < idestx) ix = idestx;
533 else if(
dx > 0 && ix > idestx) ix = idestx;
535 if(
dy < 0 &&
iy < idesty)
iy = idesty;
536 else if(
dy > 0 &&
iy > idesty)
iy = idesty;
538 MoveDragCardTo(
hdc, ix,
iy);
540 if(ix == idestx &&
iy == idesty)
555 TRACE (
"ENTER ZoomCard()\n" );
565 int idestx = pDestStack->
xpos + pDestStack->
xoffset * (apparentcards);
566 int idesty = pDestStack->
ypos + pDestStack->
yoffset * (apparentcards);
589 bool attarget =
true;
597 if(
dx < 0.0 && ix < idestx) ix = idestx;
598 else if(
dx > 0.0 && ix > idestx) ix = idestx;
599 else attarget =
false;
601 if(
dy < 0.0 &&
iy < idesty)
iy = idesty;
602 else if(
dy > 0.0 &&
iy > idesty)
iy = idesty;
603 else attarget =
false;
634 if(attarget || (ix == idestx &&
iy == idesty))
645 TRACE (
"EXIT ZoomCard()\n" );
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
#define CS_DROPZONE_NODROP
int ClipCard(HDC hdc, int x, int y, int width, int height)
void DrawCard(HDC hdc, int x, int y, HDC hdcSource, int width, int height)
int ClipCard(HDC hdc, int x, int y, int width, int height)
BOOL ClippedBitBlt(HDC hdcDest, int x, int y, int width, int height, HDC hdcSrc, int srcx, int srcy, DWORD dwROP)
void DrawCard(HDC hdc, int x, int y, HDC hdcSource, int width, int height)
pRemoveProc RemoveCallback
bool CanDragCards(int iNumCards)
bool IsPointInStack(int x, int y)
int GetNumDragCards(int x, int y)
void RedrawIfNotDim(CardRegion *compare, bool fFullRedraw)
void ClickRelease(int x, int y)
pCanDragProc CanDragCallback
bool CanDropCards(CardStack &cards)
void ReleaseDragBitmaps(void)
void PrepareDragBitmaps(int numtodrag)
bool OnLButtonDblClk(int x, int y)
bool OnMouseMove(int x, int y)
bool OnLButtonUp(int x, int y)
void SetCardStack(const CardStack &cs)
const CardStack & GetCardStack()
int GetOverlapRatio(int x, int y, int width, int height)
pClickProc DblClickCallback
void ZoomCard(HDC hdc, int xpos, int ypos, CardRegion *dest)
void MoveDragCardTo(HDC hdc, int x, int y)
pCanDropProc CanDropCallback
bool OnLButtonDown(int x, int y)
pClickProc ClickReleaseCallback
CardRegion * CardRegionFromId(int id)
CardRegion * Regions[MAXCARDSTACKS]
CardRegion * GetBestStack(int x, int y, int w, int h)
DropZone * GetDropZoneFromRect(RECT *rect)
int DropCards(CardStack &cardstack)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLint GLint GLint yoffset
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
int WINAPI ExcludeClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
HWND WINAPI SetCapture(_In_ HWND hWnd)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI ReleaseCapture(void)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)