ReactOS  0.4.12-dev-685-gf36cbf7
cardwindow.cpp
Go to the documentation of this file.
1 //
2 // CardLib - CardWindow class
3 //
4 // Freeware
5 // Copyright J Brown 2001
6 //
7 
8 #include "cardlib.h"
9 
10 #include <tchar.h>
11 
12 extern HPALETTE __holdplacepal;
13 
14 HPALETTE UseNicePalette(HDC hdc, HPALETTE hPalette)
15 {
16  HPALETTE hOld;
17 
18  hOld = SelectPalette(hdc, hPalette, FALSE);
20 
21  return hOld;
22 }
23 
24 void RestorePalette(HDC hdc, HPALETTE hOldPal)
25 {
26  SelectPalette(hdc, hOldPal, TRUE);
27 }
28 
29 HPALETTE MakePaletteFromCols(COLORREF cols[], int nNumColours);
30 void PaintRect(HDC hdc, RECT *rect, COLORREF colour);
31 HBITMAP CreateSinkBmp(HDC hdcCompat, HDC hdc, COLORREF col, int width, int height);
32 void GetSinkCols(COLORREF crBase, COLORREF *fg, COLORREF *bg, COLORREF *sh1, COLORREF *sh2);
33 
34 void LoadCardBitmaps();
35 void FreeCardBitmaps();
36 
37 static TCHAR szCardName[] = _T("CardWnd32");
38 static bool fRegistered = false;
39 static LONG uCardBitmapRef = 0;
40 
41 
43 {
44  WNDCLASSEX wc;
45 
46  //Window class for the main application parent window
47  wc.cbSize = sizeof(wc);
50  wc.cbClsExtra = 0;
51  wc.cbWndExtra = sizeof(CardWindow *);
52  wc.hInstance = GetModuleHandle(0);
53  wc.hIcon = 0;
55  wc.hbrBackground = 0;
56  wc.lpszMenuName = 0;
58  wc.hIconSm = 0;
59 
60  RegisterClassEx(&wc);
61 }
62 
64 {
65  HDC hdc = GetDC(0);
66 
67  nNumButtons = 0;
68  nNumCardRegions = 0;
69  nNumDropZones = 0;
70  nBackCardIdx = 53;
71 
73  hbmBackImage = 0;
74  hdcBackImage = 0;
75 
76  srand((unsigned)GetTickCount());
77 
78  //All colours (buttons, highlights, decks)
79  //are calculated off this single base colour
80  crBackgnd = PALETTERGB(0,80,0);//PALETTERGB(0,64,100);
81 
82  // If uCardBitmapRef was previously zero, then
83  // load the card bitmaps
85  {
87 
89 
91 
93 
95 
96  }
97 
98  ReleaseDC(0, hdc);
99 
100  //register the window class if necessary
101  if(!fRegistered)
102  {
103  fRegistered = true;
105  }
106 
107 }
108 
109 BOOL CardWindow::Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height)
110 {
111  if(m_hWnd)
112  return FALSE;
113 
114  //Create the window associated with this object
115  m_hWnd = CreateWindowEx(dwExStyle, szCardName, NULL,
116  dwStyle,
117  x, y, width, height,
119 
120  return TRUE;
121 }
122 
124 {
126  m_hWnd = 0;
127 
128  return TRUE;
129 }
130 
132 {
133  if(m_hWnd)
135 
136  DeleteAll();
137 
139  {
140  FreeCardBitmaps();
141 
144 
146 
147  if(__hPalette)
149  }
150 }
151 
153 {
154  int i;
155 
156  for(i = 0; i < nNumCardRegions; i++)
157  {
158  delete Regions[i];
159  }
160 
161  for(i = 0; i < nNumButtons; i++)
162  {
163  delete Buttons[i];
164  }
165 
166  for(i = 0; i < nNumDropZones; i++)
167  {
168  delete dropzone[i];
169  }
170 
172 
173  return true;
174 }
175 
177 {
178  crBackgnd = cr;
179  int i;
180 
181  //
182  // Create the exact palette we need to render the buttons/stacks
183  //
185 
186  if(__hPalette)
188 
190 
191  //
192  // re-create the place-holder!
193  HDC hdc = GetDC(m_hWnd);
194 
196 
198 
200  //SelectObject(__hdcPlaceHolder, __hbmPlaceHolder);
201 
202  //reset all buttons to same colour
203  for(i = 0; i < nNumButtons; i++)
204  {
205  if(Buttons[i]->GetStyle() & CB_PUSHBUTTON)
206  {
207  Buttons[i]->SetBackColor(ColorScaleRGB(crBackgnd, RGB(255,255,255), 0.1));
208  }
209  else
210  {
212  }
213  }
214 
215  for(i = 0; i < nNumCardRegions; i++)
216  {
218  }
219 
220 
221  ReleaseDC(m_hWnd, hdc);
222 }
223 
225 {
226  return crBackgnd;
227 }
228 
230 {
231  CardButton *bptr = 0;
232 
233  POINT pt;
234  pt.x = x;
235  pt.y = y;
236 
237  //Search BACKWARDS...to reflect the implicit Z-order that
238  //the button creation provided
239  for(int i = nNumButtons - 1; i >= 0; i--)
240  {
241  bptr = Buttons[i];
242  if(PtInRect(&bptr->rect, pt) && bptr->fVisible)
243  return bptr;
244  }
245 
246  return 0;
247 }
248 
250 {
251  POINT pt;
252  pt.x = x;
253  pt.y = y;
254 
255  //Search BACKWARDS...to reflect the implicit Z-order that
256  //the stack creation provided
257  for(int i = nNumCardRegions - 1; i >= 0; i--)
258  {
259  if(Regions[i]->IsPointInStack(x, y))
260  return Regions[i];
261  }
262 
263  return 0;
264 }
265 
266 //
267 // Forward all window messages onto the appropriate
268 // class instance
269 //
271 {
273  return cw->WndProc(hwnd, iMsg, wParam, lParam);
274 }
275 
277 {
278  int i;
279  RECT rect;
280  HPALETTE hOldPal;
281 
282  hOldPal = UseNicePalette(hdc, __hPalette);
283 
284  //
285  // Clip the card stacks so that they won't
286  // get painted over
287  //
288  for(i = 0; i < nNumCardRegions; i++)
289  {
290  Regions[i]->Clip(hdc);
291  }
292 
293  //
294  // Clip the buttons
295  //
296  for(i = 0; i < nNumButtons; i++)
297  {
298  Buttons[i]->Clip(hdc);
299  }
300 
301 
302  // Now paint the whole screen with background colour,
303  //
305 
306  //PaintRect(hdc, &rect, MAKE_PALETTERGB(crBackgnd));
307  PaintCardRgn(hdc, 0, 0, rect.right, rect.bottom, 0, 0);
309 
310  // Don't let cards draw over buttons, so clip buttons again
311  //
312  for(i = 0; i < nNumButtons; i++)
313  {
314  Buttons[i]->Clip(hdc);
315  }
316 
317  // Paint each card stack in turn
318  //
319  for(i = 0; i < nNumCardRegions; i++)
320  {
321  Regions[i]->Render(hdc);
322  }
323 
324  // Paint each button now
325  //
327 
328  for(i = 0; i < nNumButtons; i++)
329  {
330  Buttons[i]->Redraw();
331  }
332 
333  RestorePalette(hdc, hOldPal);
334 }
335 
336 
337 
338 
340 {
341  HDC hdc;
342  PAINTSTRUCT ps;
343 
344  CREATESTRUCT *cs;
345 
346  static CardButton *buttonptr = 0;
347  static CardRegion *stackptr = 0;
348 
349  int x, y, i;
350 
351  switch(iMsg)
352  {
353  case WM_NCCREATE:
354 
355  // When we created this window, we passed in the
356  // pointer to the class object (CardWindow *) in the
357  // call to CreateWindow.
358  cs = (CREATESTRUCT *)lParam;
359 
360  //
361  // associate this class with the window
362  //
363  SetWindowLongPtr(hwnd, 0, (LONG_PTR)cs->lpCreateParams);
364 
365  return 1;
366 
367  case WM_NCDESTROY:
368  // Don't delete anything here..
369  break;
370 
371  case WM_SIZE:
372  nWidth = LOWORD(lParam);
373  nHeight = HIWORD(lParam);
374 
375  //
376  // reposition all the stacks and buttons
377  // in case any of them are centered, right-justified etc
378  //
379  for(i = 0; i < nNumCardRegions; i++)
380  {
382  }
383 
384  for(i = 0; i < nNumButtons; i++)
385  {
387  }
388 
389  //
390  // Call the user-defined resize proc AFTER all the stacks
391  // have been positioned
392  //
395 
396  return 0;
397 
398  case WM_PAINT:
399 
400  hdc = BeginPaint(hwnd, &ps);
401 
402  Paint(hdc);
403 
404  EndPaint(hwnd, &ps);
405  return 0;
406 
407  case WM_TIMER:
408 
409  //find the timer object in the registered funcs
410  /*if(wParam >= 0x10000)
411  {
412  for(i = 0; i < nRegFuncs; i++)
413  {
414  if(RegFuncs[i].id == wParam)
415  {
416  KillTimer(hwnd, wParam);
417 
418  //call the registered function!!
419  RegFuncs[i].func(RegFuncs[i].dwParam);
420 
421  RegFuncs[i] = RegFuncs[nRegFuncs-1];
422  nRegFuncs--;
423  }
424  }
425  }
426  else*/
427  {
428  //find the cardstack
429  CardRegion *stackobj = (CardRegion *)wParam;//CardStackFromId(wParam);
430  stackobj->DoFlash();
431  }
432 
433  return 0;
434 
435  case WM_LBUTTONDBLCLK:
436 
437  x = (short)LOWORD(lParam);
438  y = (short)HIWORD(lParam);
439 
440  if((buttonptr = CardButtonFromPoint(x, y)) != 0)
441  {
442  buttonptr->OnLButtonDown(hwnd, x, y);
443  return 0;
444  }
445 
446  if((stackptr = CardRegionFromPoint(x, y)) != 0)
447  {
448  stackptr->OnLButtonDblClk(x, y);
449  stackptr = 0;
450  }
451 
452  return 0;
453 
454  case WM_LBUTTONDOWN:
455 
456  x = (short)LOWORD(lParam);
457  y = (short)HIWORD(lParam);
458 
459  //if clicked on a button
460  if((buttonptr = CardButtonFromPoint(x, y)) != 0)
461  {
462  if(buttonptr->OnLButtonDown(hwnd, x, y) == 0)
463  buttonptr = 0;
464 
465  return 0;
466  }
467 
468  if((stackptr = CardRegionFromPoint(x, y)) != 0)
469  {
470  if(!stackptr->OnLButtonDown(x, y))
471  stackptr = 0;
472  }
473 
474  return 0;
475 
476  case WM_LBUTTONUP:
477 
478  x = (short)LOWORD(lParam);
479  y = (short)HIWORD(lParam);
480 
481  //
482  // if we were clicking a button
483  //
484  if(buttonptr != 0)
485  {
486  buttonptr->OnLButtonUp(hwnd, x, y);
487  buttonptr = 0;
488  return 0;
489  }
490 
491  if(stackptr != 0)
492  {
493  stackptr->OnLButtonUp(x, y);
494  stackptr = 0;
495  return 0;
496  }
497 
498  if ((stackptr = CardRegionFromPoint(x, y)) != 0)
499  {
500  stackptr->ClickRelease(x, y);
501  stackptr = 0;
502  }
503 
504  return 0;
505 
506  case WM_MOUSEMOVE:
507 
508  x = (short)LOWORD(lParam);
509  y = (short)HIWORD(lParam);
510 
511  // if we were clicking a button
512  if(buttonptr != 0)
513  {
514  buttonptr->OnMouseMove(hwnd, x, y);
515  return 0;
516  }
517 
518  if(stackptr != 0)
519  {
520  return stackptr->OnMouseMove(x, y);
521  }
522 
523  return 0;
524 
525  }
526 
527  return DefWindowProc (hwnd, iMsg, wParam, lParam);
528 }
529 
530 
532 {
533  for(int i = 0; i < nNumCardRegions; i++)
534  {
535  if(Regions[i]->id == id)
536  return Regions[i];
537  }
538 
539  return 0;
540 }
541 
543 {
544  for(int i = 0; i < nNumButtons; i++)
545  {
546  if(Buttons[i]->id == id)
547  return Buttons[i];
548  }
549 
550  return 0;
551 }
552 
554 {
555  InvalidateRect(m_hWnd, 0, 0);
557 }
558 
560 {
561  for(int i = 0; i < nNumButtons; i++)
562  {
563  if(Buttons[i] == pButton)
564  {
565  CardButton *cb = Buttons[i];
566 
567  //shift any after this one backwards
568  for(int j = i; j < nNumButtons - 1; j++)
569  {
570  Buttons[j] = Buttons[j + 1];
571  }
572 
573  delete cb;
574  nNumButtons--;
575 
576  return true;
577  }
578  }
579 
580  return false;
581 }
582 
584 {
585  for(int i = 0; i < nNumCardRegions; i++)
586  {
587  if(Regions[i] == pRegion)
588  {
589  CardRegion *cr = Regions[i];
590 
591  //shift any after this one backwards
592  for(int j = i; j < nNumCardRegions - 1; j++)
593  {
594  Regions[j] = Regions[j + 1];
595  }
596 
597  delete cr;
598  nNumCardRegions--;
599 
600  return true;
601  }
602  }
603 
604  return false;
605 }
606 
608 {
609  for(int i = 0; i < nNumCardRegions; i++)
610  {
611  Regions[i]->Clear();
612  Regions[i]->Update();
613  }
614 
615  Redraw();
616 }
617 
618 bool CardWindow::DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, int xSpacing, int nStartX)
619 {
620  int numvisiblestacks = 0;
621  int curx = nStartX;
622  int startindex = -1;
623  int i;
624 
625  //find the stack which starts with our ID
626  for(i = 0; i < nNumCardRegions; i++)
627  {
628  if(Regions[i]->Id() == nIdFrom)
629  {
630  startindex = i;
631  break;
632  }
633  }
634 
635  //if didn't find, return
636  if(i == nNumCardRegions) return false;
637 
638  //count the stacks that are visible
639  for(i = startindex; i < startindex + nNumStacks; i++)
640  {
641  if(Regions[i]->IsVisible())
642  numvisiblestacks++;
643  }
644 
645  if(xJustify == CS_XJUST_CENTER)
646  {
647  //startx -= ((numvisiblestacks + spacing) * cardwidth - spacing) / 2;
648  int viswidth;
649  viswidth = numvisiblestacks * __cardwidth;
650  viswidth += xSpacing * (numvisiblestacks - 1);
651  curx = -(viswidth - __cardwidth) / 2;
652 
653  for(i = startindex; i < startindex + nNumStacks; i++)
654  {
655  if(Regions[i]->IsVisible())
656  {
657  Regions[i]->xadjust = curx;
659  curx += Regions[i]->width + xSpacing;
660  }
661 
662  }
663  }
664 
665  if(xJustify == CS_XJUST_RIGHT)
666  {
667  nStartX -= ((numvisiblestacks + xSpacing) * __cardwidth - xSpacing);
668  }
669 
670  if(xJustify == CS_XJUST_NONE)
671  {
672  for(i = startindex; i < startindex + nNumStacks; i++)
673  {
674  if(Regions[i]->IsVisible())
675  {
676  Regions[i]->xpos = curx;
677  curx += Regions[i]->width + xSpacing;
678  Regions[i]->UpdateSize();
679  }
680 
681  }
682  }
683 
684  return 0;
685 }
686 
688 {
689  for(int i = 0; i < nNumCardRegions; i++)
690  {
692  }
693 }
694 
695 
697 {
699 }
700 
701 
703 {
704  COLORREF cols[10];
705  int nNumCols;
706 
707 
708  //include button text colours
709  cols[0] = RGB(0, 0, 0);
710  cols[1] = RGB(255, 255, 255);
711 
712  //include the base background colour
713  cols[2] = crBackgnd;
714 
715  //include the standard button colours...
717  cols[4] = CardButton::GetShadow(crBackgnd);
718  cols[5] = CardButton::GetFace(crBackgnd);
719 
720  //include the sunken image bitmap colours...
721  GetSinkCols(crBackgnd, &cols[6], &cols[7], &cols[8], &cols[9]);
722 
723  nNumCols = 10;
724 
725  return MakePaletteFromCols(cols, nNumCols);
726 }
727 
729 {
730  if(uBackIdx >= 52 && uBackIdx <= 68)
731  nBackCardIdx = uBackIdx;
732 
733  for(int i = 0; i < nNumCardRegions; i++)
734  Regions[i]->SetBackCardIdx(uBackIdx);
735 
736 }
737 
739 {
740  return nBackCardIdx;
741 }
742 
743 void CardWindow::PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, int sx, int sy)
744 {
745  RECT rect;
746 
747  //if just a solid background colour
748  if(hbmBackImage == 0)
749  {
750  SetRect(&rect, dx, dy, dx+width, dy+height);
751 
752  /*if(GetVersion() < 0x80000000)
753  {
754  PaintRect(hdc, &rect, MAKE_PALETTERGB(crBackgnd));
755  }
756  else*/
757  {
759  FillRect(hdc, &rect, hbr);
760  DeleteObject(hbr);
761  }
762  }
763  //otherwise, paint using the bitmap
764  else
765  {
766  // Draw whatever part of background we can
767  BitBlt(hdc, dx, dy, width, height, hdcBackImage, sx, sy, SRCCOPY);
768 
769  // Now we need to paint any area outside the bitmap,
770  // just in case the bitmap is too small to fill whole window
771  if(0)//sx + width > bm.bmWidth || sy + height > bm.bmHeight)
772  {
773  // Find out size of bitmap
774  BITMAP bm;
775  GetObject(hbmBackImage, sizeof(bm), &bm);
776 
777  HRGN hr1 = CreateRectRgn(sx, sy, sx+width, sy+height);
778  HRGN hr2 = CreateRectRgn(0, 0, bm.bmWidth, bm.bmHeight);
779  HRGN hr3 = CreateRectRgn(0,0, 1, 1);
780  HRGN hr4 = CreateRectRgn(0,0, 1, 1);
781 
782  CombineRgn(hr3, hr1, hr2, RGN_DIFF);
783 
784  GetClipRgn(hdc, hr4);
785 
786  CombineRgn(hr3, hr4, hr3, RGN_AND);
787  SelectClipRgn(hdc, hr3);
788 
789  // Fill remaining space not filled with bitmap
790  HBRUSH hbr = CreateSolidBrush(crBackgnd);
791  FillRgn(hdc, hr3, hbr);
792  DeleteObject(hbr);
793 
794  // Clean up
795  SelectClipRgn(hdc, hr4);
796 
797  DeleteObject(hr1);
798  DeleteObject(hr2);
799  DeleteObject(hr3);
800  DeleteObject(hr4);
801  }
802  }
803 }
804 
806 {
807  //delete current image?? NO!
808  if(hdcBackImage == 0)
809  {
811  }
812 
814 
815  if(hBitmap)
817 }
CardButton * CardButtonFromPoint(int x, int y)
Definition: cardwindow.cpp:229
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
HPALETTE CreateCardPalette()
Definition: cardwindow.cpp:702
HPALETTE __holdplacepal
Definition: cardlib.cpp:23
void(CARDLIBPROC * pResizeWndProc)(int width, int height)
Definition: cardlib.h:91
#define HDC
Definition: msvc.h:22
UINT GetBackCardIdx()
Definition: cardwindow.cpp:738
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT style
Definition: winuser.h:3155
GLint GLint GLsizei width
Definition: gl.h:1546
#define MAKE_PALETTERGB(colref)
Definition: cardcolor.h:17
LPCSTR lpszMenuName
Definition: winuser.h:3163
#define TRUE
Definition: types.h:120
int WINAPI FillRgn(_In_ HDC, _In_ HRGN, _In_ HBRUSH)
Definition: painting.c:173
#define RegisterClassEx
Definition: winuser.h:5703
CardRegion * CardRegionFromId(int id)
Definition: cardwindow.cpp:531
#define HBITMAP
Definition: msvc.h:28
int nNumCardRegions
Definition: cardwindow.h:104
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
COLORREF ColorScaleRGB(const COLORREF Col1, const COLORREF Col2, const double Ratio)
Definition: cardcolor.cpp:154
HCURSOR hCursor
Definition: winuser.h:3161
WNDPROC lpfnWndProc
Definition: winuser.h:3156
static TCHAR szCardName[]
Definition: cardwindow.cpp:37
RECT rect
Definition: cardbutton.h:70
bool IsPointInStack(int x, int y)
HDC WINAPI GetDC(_In_opt_ HWND)
LPCSTR lpszClassName
Definition: winuser.h:3164
int OnLButtonUp(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:301
static COLORREF GetFace(COLORREF crBase)
Definition: cardbutton.cpp:426
static COLORREF GetHighlight(COLORREF crBase)
Definition: cardbutton.cpp:415
#define pt(x, y)
Definition: drawing.c:79
BOOL Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height)
Definition: cardwindow.cpp:109
#define CS_XJUST_RIGHT
Definition: cardlib.h:38
void AdjustPosition(int winwidth, int winheight)
Definition: cardbutton.cpp:208
void EmptyStacks(void)
Definition: cardwindow.cpp:607
#define HRGN
Definition: msvc.h:39
bool DeleteButton(CardButton *pButton)
Definition: cardwindow.cpp:559
#define CALLBACK
Definition: compat.h:27
BOOL WINAPI UpdateWindow(_In_ HWND)
bool fVisible
Definition: cardbutton.h:73
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
void __cdecl srand(_In_ unsigned int _Seed)
HBITMAP __hbmPlaceHolder
Definition: cardlib.cpp:22
void GetSinkCols(COLORREF crBase, COLORREF *fg, COLORREF *bg, COLORREF *sh1, COLORREF *sh2)
bool OnLButtonUp(int x, int y)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
INT dx
Definition: msvc.h:65
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define CS_HREDRAW
Definition: winuser.h:648
int OnMouseMove(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:278
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
void Paint(HDC hdc)
Definition: cardwindow.cpp:276
static HANDLE proc()
Definition: pdb.c:32
void LoadCardBitmaps()
Definition: cardbitmaps.cpp:82
HICON hIconSm
Definition: winuser.h:3165
void SetBackColor(COLORREF cr)
Definition: cardwindow.cpp:176
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC __hdcPlaceHolder
Definition: cardlib.cpp:21
#define WM_NCCREATE
Definition: winuser.h:1665
BOOL WINAPI DestroyWindow(_In_ HWND)
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
#define SetWindowLongPtr
Definition: treelist.c:70
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
COLORREF GetBackColor()
Definition: cardwindow.cpp:224
void Redraw()
Definition: cardbutton.cpp:385
DWORD Id
UINT_PTR WPARAM
Definition: windef.h:207
int nNumDropZones
Definition: cardwindow.h:107
bool OnMouseMove(int x, int y)
void Redraw(void)
Definition: cardwindow.cpp:553
INT INT y
Definition: msvc.h:62
#define RGN_AND
Definition: wingdi.h:355
int nHeight
Definition: cardwindow.h:92
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:91
void PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, int sx, int sy)
Definition: cardwindow.cpp:743
void PaintRect(HDC hdc, RECT *rect, COLORREF colour)
Definition: cardlib.cpp:116
uint32_t cs
Definition: isohybrid.c:75
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
Definition: glfuncs.h:248
COLORREF crBackgnd
Definition: cardwindow.h:109
HDC hdcBackImage
Definition: cardwindow.h:97
CardRegion * CardRegionFromPoint(int x, int y)
Definition: cardwindow.cpp:249
HINSTANCE hInstance
Definition: winuser.h:3159
#define CS_XJUST_NONE
Definition: cardlib.h:37
void Update()
Definition: cardregion.cpp:207
long LONG
Definition: pedump.c:60
int OnLButtonDown(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:253
LONG_PTR LPARAM
Definition: windef.h:208
bool DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, int xSpacing, int nStartX)
Definition: cardwindow.cpp:618
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
int xjustify
Definition: cardregion.h:159
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define CreateWindowEx
Definition: winuser.h:5621
HDC hdc
Definition: msvc.h:53
#define CB_PUSHBUTTON
Definition: cardlib.h:46
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
void Clip(HDC hdc)
Definition: cardbutton.cpp:102
bool DeleteRegion(CardRegion *pRegion)
Definition: cardwindow.cpp:583
UINT cbSize
Definition: winuser.h:3154
DropZone * dropzone[MAXDROPZONES]
Definition: cardwindow.h:106
BOOL Destroy()
Definition: cardwindow.cpp:123
bool OnLButtonDblClk(int x, int y)
void RestorePalette(HDC hdc, HPALETTE hOldPal)
Definition: cardwindow.cpp:24
HBRUSH hbrBackground
Definition: winuser.h:3162
#define CS_XJUST_CENTER
Definition: cardlib.h:39
#define DefWindowProc
Definition: ros2win.h:31
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 GLint GLint j
Definition: glfuncs.h:250
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
static COLORREF GetShadow(COLORREF crBase)
Definition: cardbutton.cpp:421
void UpdateSize()
Definition: cardregion.cpp:83
CardButton * CardButtonFromId(int id)
Definition: cardwindow.cpp:542
#define CS_VREDRAW
Definition: winuser.h:653
char TCHAR
Definition: xmlstorage.h:189
HBITMAP CreateSinkBmp(HDC hdcCompat, HDC hdc, COLORREF col, int width, int height)
#define _T(x)
Definition: vfdio.h:22
unsigned int BOOL
Definition: ntddk_ex.h:94
HPALETTE UseNicePalette(HDC hdc, HPALETTE hPalette)
Definition: cardwindow.cpp:14
bool OnLButtonDown(int x, int y)
#define WM_SIZE
Definition: winuser.h:1593
HWND m_hWnd
Definition: cardwindow.h:91
#define WM_TIMER
Definition: winuser.h:1718
int nWidth
Definition: cardwindow.h:92
HPALETTE __hPalette
Definition: cardlib.cpp:28
#define WM_NCDESTROY
Definition: winuser.h:1666
#define RGB(r, g, b)
Definition: wingdi.h:2918
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned long DWORD
Definition: ntddk_ex.h:95
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
int cbWndExtra
Definition: winuser.h:3158
bool DeleteAll()
Definition: cardwindow.cpp:152
static LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: cardwindow.cpp:270
static DWORD cb
Definition: integrity.c:41
#define GetObject
Definition: wingdi.h:4446
void FreeCardBitmaps()
#define WM_PAINT
Definition: winuser.h:1602
void SetBackColor(COLORREF cr)
Definition: cardbutton.cpp:403
static bool fRegistered
Definition: cardwindow.cpp:38
HICON hIcon
Definition: winuser.h:3160
#define InterlockedDecrement
Definition: armddk.h:52
void Render(HDC hdc)
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1754
#define CS_DBLCLKS
Definition: winuser.h:646
#define LoadCursor
Definition: winuser.h:5678
int __cardwidth
Definition: cardlib.cpp:25
static LONG uCardBitmapRef
Definition: cardwindow.cpp:39
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void Clear()
Definition: cardregion.h:84
HBITMAP hbmBackImage
Definition: cardwindow.h:96
void SetBackImage(HBITMAP hBitmap)
Definition: cardwindow.cpp:805
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
bool IsVisible()
Definition: cardregion.cpp:245
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
int cbClsExtra
Definition: winuser.h:3157
#define InterlockedIncrement
Definition: armddk.h:53
#define GetModuleHandle
Definition: winbase.h:3641
BOOL WINAPI DeleteDC(_In_ HDC)
void RegisterCardWindow()
Definition: cardwindow.cpp:42
#define RGN_DIFF
Definition: wingdi.h:357
INT x
Definition: msvc.h:62
#define PALETTERGB(r, g, b)
Definition: wingdi.h:2920
#define WM_LBUTTONUP
Definition: winuser.h:1753
Definition: bl.h:1331
pResizeWndProc ResizeWndCallback
Definition: cardwindow.h:111
void AdjustPosition(int winwidth, int winheight)
Definition: cardregion.cpp:281
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_MOUSEMOVE
Definition: winuser.h:1751
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
INT INT dy
Definition: msvc.h:65
HPALETTE MakePaletteFromCols(COLORREF cols[], int nNumColours)
void DoFlash()
Definition: cardregion.cpp:344
void Update(void)
Definition: cardwindow.cpp:687
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define IDC_ARROW
Definition: winuser.h:682
void SetBackColor(COLORREF cr)
Definition: cardregion.cpp:67
int __cardheight
Definition: cardlib.cpp:26
#define HIWORD(l)
Definition: typedefs.h:246
void ClickRelease(int x, int y)
int nNumButtons
Definition: cardwindow.h:101
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
UINT nBackCardIdx
Definition: cardwindow.h:94
#define GetWindowLongPtr
Definition: treelist.c:73
LONG_PTR LRESULT
Definition: windef.h:209
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
friend void RegisterCardWindow()
Definition: cardwindow.cpp:42
DWORD COLORREF
Definition: windef.h:285
static HBITMAP hBitmap
Definition: timezone.c:34
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
UINT WINAPI RealizePalette(_In_ HDC)
Definition: palette.c:138
#define SRCCOPY
Definition: wingdi.h:332
void SetResizeProc(pResizeWndProc proc)
Definition: cardwindow.cpp:696
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: cardwindow.cpp:339
void Clip(HDC hdc)