1 #ifndef CARDBOARD_INCLUDED
2 #define CARDBOARD_INCLUDED
5 #define MAXCARDSTACKS 32
14 LRESULT CALLBACK
CardWndProc(HWND hwnd
, UINT iMsg
, WPARAM wParam
, LPARAM lParam
);
18 friend class CardRegion
;
19 friend class CardButton
;
21 friend void RegisterCardWindow();
29 // Basic windowing support
31 BOOL
Create(HWND hwndParent
, DWORD dwExStyle
, DWORD dwStyle
, int x
, int y
, int width
, int height
);
34 operator HWND() { return m_hWnd
; }
36 CardButton
*CreateButton (int id
, TCHAR
*szText
, UINT uStyle
, bool fVisible
, int x
, int y
, int width
, int height
);
37 CardRegion
*CreateRegion (int id
, bool fVisible
, int x
, int y
, int xoffset
, int yoffset
);
39 CardButton
*CardButtonFromId(int id
);
40 CardRegion
*CardRegionFromId(int id
);
42 bool DeleteButton(CardButton
*pButton
);
43 bool DeleteRegion(CardRegion
*pRegion
);
46 void SetBackColor(COLORREF cr
);
47 COLORREF
GetBackColor();
48 void SetBackCardIdx(UINT uBackIdx
);
49 UINT
GetBackCardIdx();
50 void SetBackImage(HBITMAP hBitmap
);
52 void EmptyStacks(void);
56 bool DistributeStacks(int nIdFrom
, int nNumStacks
, UINT xJustify
, int xSpacing
, int nStartX
);
57 void SetResizeProc(pResizeWndProc proc
);
58 int GetWidth() { return nWidth
; }
59 int GetHeight() { return nHeight
; }
64 bool RegisterDropZone(int id
, RECT
*rect
, pDropZoneProc proc
);
65 bool DeleteDropZone(int id
);
69 int GetNumDropZones() { return nNumDropZones
; }
70 DropZone
* GetDropZoneFromRect(RECT
*rect
);
73 // Window procedure - don't call
75 LRESULT CALLBACK
WndProc (HWND hwnd
, UINT iMsg
, WPARAM wParam
, LPARAM lParam
);
76 static LRESULT CALLBACK
CardWndProc(HWND hwnd
, UINT iMsg
, WPARAM wParam
, LPARAM lParam
);
82 void PaintCardRgn(HDC hdc
, int dx
, int dy
, int width
, int height
, int sx
, int sy
);
84 HPALETTE
CreateCardPalette();
86 CardButton
*CardButtonFromPoint(int x
, int y
);
87 CardRegion
*CardRegionFromPoint(int x
, int y
);
88 CardRegion
*GetBestStack(int x
, int y
, int w
, int h
);
94 HWND m_hWnd
; //window handle!
97 UINT nBackCardIdx
; //all stacks share this card index by default
103 CardButton
* Buttons
[MAXBUTTONS
];
106 CardRegion
* Regions
[MAXCARDSTACKS
];
109 DropZone
* dropzone
[MAXDROPZONES
];
114 pResizeWndProc ResizeWndCallback
;