15 #define TRACE(s) printf("%s(%i): %s",__FILE__,__LINE__,s) 25 static pDebugClickProc DebugStackClickProc = 0;
27 void CardLib_SetStackClickProc(pDebugClickProc
proc)
29 DebugStackClickProc =
proc;
37 int maxoverlapidx = -1;
47 if(percent > maxoverlap &&
Regions[
i]->IsVisible())
55 if(maxoverlapidx != -1)
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 498 void 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 > &)
pClickProc DblClickCallback
GLint GLint GLsizei width
void MoveDragCardTo(HDC hdc, int x, int y)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
GLubyte GLubyte GLubyte GLubyte w
int ClipCard(HDC hdc, int x, int y, int width, int height)
CardRegion * CardRegionFromId(int id)
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
pRemoveProc RemoveCallback
#define CS_DROPZONE_NODROP
bool IsPointInStack(int x, int y)
HDC WINAPI GetDC(_In_opt_ HWND)
const CardStack & GetCardStack()
DropZone * GetDropZoneFromRect(RECT *rect)
int GetNumDragCards(int x, int y)
bool OnLButtonUp(int x, int y)
GLint GLint GLint GLint GLint x
pClickProc ClickReleaseCallback
void DrawCard(HDC hdc, int x, int y, HDC hdcSource, int width, int height)
GLint GLint GLint yoffset
GLfloat GLfloat GLfloat GLfloat h
pCanDropProc CanDropCallback
bool OnMouseMove(int x, int y)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
int GetOverlapRatio(int x, int y, int width, int height)
bool OnLButtonDblClk(int x, int y)
bool OnLButtonDown(int x, int y)
void ZoomCard(HDC hdc, int xpos, int ypos, CardRegion *dest)
bool CanDropCards(CardStack &cards)
void RedrawIfNotDim(CardRegion *compare, bool fFullRedraw)
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
CardRegion * GetBestStack(int x, int y, int w, int h)
CardRegion * Regions[MAXCARDSTACKS]
void SetCardStack(const CardStack &cs)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
GLint GLint GLsizei GLsizei height
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
void ReleaseDragBitmaps(void)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
HWND WINAPI SetCapture(_In_ HWND hWnd)
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
int DropCards(CardStack &cardstack)
int WINAPI ExcludeClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL ClippedBitBlt(HDC hdcDest, int x, int y, int width, int height, HDC hdcSrc, int srcx, int srcy, DWORD dwROP)
GLint GLint GLint GLint GLint GLint y
pCanDragProc CanDragCallback
BOOL WINAPI ReleaseCapture(void)
void ClickRelease(int x, int y)
void PrepareDragBitmaps(int numtodrag)
static VOID NTAPI 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)
bool CanDragCards(int iNumCards)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *