ReactOS 0.4.15-dev-7788-g1ad9096
cardwindow.h
Go to the documentation of this file.
1#ifndef CARDBOARD_INCLUDED
2#define CARDBOARD_INCLUDED
3
4#define MAXBUTTONS 32
5#define MAXCARDSTACKS 32
6#define MAXDROPZONES 8
7
8class CardRegion;
9class CardButton;
10
12
14{
15 friend class CardRegion;
16 friend class CardButton;
17
18 friend void RegisterCardWindow();
19
20public:
21
22 CardWindow();
24
25 //
26 // Basic windowing support
27 //
28 BOOL Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height);
29 BOOL Destroy();
30
31 operator HWND() { return m_hWnd; }
32
33 CardButton *CreateButton (int id, TCHAR *szText, UINT uStyle, bool fVisible, int x, int y, int width, int height);
34 CardRegion *CreateRegion (int id, bool fVisible, int x, int y, int xoffset, int yoffset);
35
38
39 bool DeleteButton(CardButton *pButton);
40 bool DeleteRegion(CardRegion *pRegion);
41 bool DeleteAll();
42
43 void SetBackColor(COLORREF cr);
45 void SetBackCardIdx(UINT uBackIdx);
48
49 void EmptyStacks(void);
50 void Redraw(void);
51 void Update(void);
52
53 bool DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, int xSpacing, int nStartX);
55 int GetWidth() { return nWidth; }
56 int GetHeight() { return nHeight; }
57
58 //
59 // Dropzone support
60 //
62 bool DeleteDropZone(int id);
63
64private:
65
68
69 //
70 // Window procedure - don't call
71 //
74
75 //
76 // Private functions
77 //
78 void Paint(HDC hdc);
79 void PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, int sx, int sy);
80
81 HPALETTE CreateCardPalette();
82
85 CardRegion *GetBestStack(int x, int y, int w, int h);
86
87 //
88 // Private members
89 //
90
91 HWND m_hWnd; //window handle!
93
94 UINT nBackCardIdx; //all stacks share this card index by default
95
98
99
102
105
108
110
112
113
114};
115
116#endif /* CARDBOARD_INCLUDED */
@ Create
Definition: registry.c:563
void(CARDLIBPROC * pResizeWndProc)(int width, int height)
Definition: cardlib.h:91
int(CARDLIBPROC * pDropZoneProc)(int dzid, const CardStack &cards)
Definition: cardlib.h:92
#define MAXBUTTONS
Definition: cardwindow.h:4
LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
#define MAXDROPZONES
Definition: cardwindow.h:6
#define MAXCARDSTACKS
Definition: cardwindow.h:5
bool DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, int xSpacing, int nStartX)
Definition: cardwindow.cpp:618
HPALETTE CreateCardPalette()
Definition: cardwindow.cpp:702
int GetHeight()
Definition: cardwindow.h:56
void Update(void)
Definition: cardwindow.cpp:687
void SetResizeProc(pResizeWndProc proc)
Definition: cardwindow.cpp:696
HDC hdcBackImage
Definition: cardwindow.h:97
bool DeleteDropZone(int id)
Definition: dropzone.cpp:44
void Paint(HDC hdc)
Definition: cardwindow.cpp:276
UINT nBackCardIdx
Definition: cardwindow.h:94
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
COLORREF crBackgnd
Definition: cardwindow.h:109
int GetWidth()
Definition: cardwindow.h:55
int GetNumDropZones()
Definition: cardwindow.h:66
CardRegion * CardRegionFromId(int id)
Definition: cardwindow.cpp:531
BOOL Destroy()
Definition: cardwindow.cpp:123
void SetBackImage(HBITMAP hBitmap)
Definition: cardwindow.cpp:805
pResizeWndProc ResizeWndCallback
Definition: cardwindow.h:111
CardButton * CardButtonFromPoint(int x, int y)
Definition: cardwindow.cpp:229
int nNumDropZones
Definition: cardwindow.h:107
void SetBackColor(COLORREF cr)
Definition: cardwindow.cpp:176
static LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: cardwindow.cpp:270
HBITMAP hbmBackImage
Definition: cardwindow.h:96
void PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, int sx, int sy)
Definition: cardwindow.cpp:743
int nNumButtons
Definition: cardwindow.h:101
UINT GetBackCardIdx()
Definition: cardwindow.cpp:738
CardRegion * CreateRegion(int id, bool fVisible, int x, int y, int xoffset, int yoffset)
Definition: cardregion.cpp:104
CardButton * CreateButton(int id, TCHAR *szText, UINT uStyle, bool fVisible, int x, int y, int width, int height)
Definition: cardbutton.cpp:334
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: cardwindow.cpp:339
bool DeleteButton(CardButton *pButton)
Definition: cardwindow.cpp:559
HWND m_hWnd
Definition: cardwindow.h:91
int nHeight
Definition: cardwindow.h:92
CardButton * CardButtonFromId(int id)
Definition: cardwindow.cpp:542
COLORREF GetBackColor()
Definition: cardwindow.cpp:224
bool RegisterDropZone(int id, RECT *rect, pDropZoneProc proc)
Definition: dropzone.cpp:10
void EmptyStacks(void)
Definition: cardwindow.cpp:607
friend void RegisterCardWindow()
Definition: cardwindow.cpp:42
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
DropZone * dropzone[MAXDROPZONES]
Definition: cardwindow.h:106
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
bool DeleteAll()
Definition: cardwindow.cpp:152
int nNumCardRegions
Definition: cardwindow.h:104
void Redraw(void)
Definition: cardwindow.cpp:553
int nWidth
Definition: cardwindow.h:92
CardRegion * CardRegionFromPoint(int x, int y)
Definition: cardwindow.cpp:249
bool DeleteRegion(CardRegion *pRegion)
Definition: cardwindow.cpp:583
CardRegion * GetBestStack(int x, int y, int w, int h)
DropZone * GetDropZoneFromRect(RECT *rect)
Definition: dropzone.cpp:22
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static HWND hwndParent
Definition: cryptui.c:300
static HBITMAP hBitmap
Definition: timezone.c:26
HANDLE HWND
Definition: compat.h:19
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint xoffset
Definition: gl.h:1547
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLint GLint GLint yoffset
Definition: gl.h:1547
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
unsigned int UINT
Definition: ndis.h:50
static HANDLE proc()
Definition: pdb.c:34
& rect
Definition: startmenu.cpp:1413
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
char TCHAR
Definition: xmlstorage.h:189