ReactOS  0.4.13-dev-101-g0ca4b50
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 
8 class CardRegion;
9 class CardButton;
10 
12 
14 {
15  friend class CardRegion;
16  friend class CardButton;
17 
18  friend void RegisterCardWindow();
19 
20 public:
21 
22  CardWindow();
23  ~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 
64 private:
65 
66  int GetNumDropZones() { return nNumDropZones; }
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 
83  CardButton *CardButtonFromPoint(int x, int y);
84  CardRegion *CardRegionFromPoint(int x, int y);
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 */
CardButton * CardButtonFromPoint(int x, int y)
Definition: cardwindow.cpp:229
HPALETTE CreateCardPalette()
Definition: cardwindow.cpp:702
void(CARDLIBPROC * pResizeWndProc)(int width, int height)
Definition: cardlib.h:91
UINT GetBackCardIdx()
Definition: cardwindow.cpp:738
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLint GLint GLsizei width
Definition: gl.h:1546
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
CardRegion * CardRegionFromId(int id)
Definition: cardwindow.cpp:531
int nNumCardRegions
Definition: cardwindow.h:104
DropZone * GetDropZoneFromRect(RECT *rect)
Definition: dropzone.cpp:22
BOOL Create(HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height)
Definition: cardwindow.cpp:109
GLint dy
Definition: linetemp.h:97
void EmptyStacks(void)
Definition: cardwindow.cpp:607
bool DeleteButton(CardButton *pButton)
Definition: cardwindow.cpp:559
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
bool fVisible
Definition: cardbutton.h:73
HANDLE HWND
Definition: compat.h:13
LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
UINT uStyle
Definition: cardbutton.h:72
int(CARDLIBPROC * pDropZoneProc)(int dzid, const CardStack &cards)
Definition: cardlib.h:92
UINT_PTR WPARAM
Definition: windef.h:207
void Paint(HDC hdc)
Definition: cardwindow.cpp:276
static HANDLE proc()
Definition: pdb.c:32
void SetBackColor(COLORREF cr)
Definition: cardwindow.cpp:176
#define MAXDROPZONES
Definition: cardwindow.h:6
int GetHeight()
Definition: cardwindow.h:56
GLint GLint GLint yoffset
Definition: gl.h:1547
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
COLORREF GetBackColor()
Definition: cardwindow.cpp:224
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
int nNumDropZones
Definition: cardwindow.h:107
#define MAXCARDSTACKS
Definition: cardwindow.h:5
void Redraw(void)
Definition: cardwindow.cpp:553
int nHeight
Definition: cardwindow.h:92
void PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, int sx, int sy)
Definition: cardwindow.cpp:743
COLORREF crBackgnd
Definition: cardwindow.h:109
HDC hdcBackImage
Definition: cardwindow.h:97
CardRegion * CardRegionFromPoint(int x, int y)
Definition: cardwindow.cpp:249
static const WCHAR szText[]
Definition: dialog.c:139
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint xoffset
Definition: gl.h:1547
bool DistributeStacks(int nIdFrom, int nNumStacks, UINT xJustify, int xSpacing, int nStartX)
Definition: cardwindow.cpp:618
bool RegisterDropZone(int id, RECT *rect, pDropZoneProc proc)
Definition: dropzone.cpp:10
static HWND hwndParent
Definition: cryptui.c:300
#define MAXBUTTONS
Definition: cardwindow.h:4
bool DeleteRegion(CardRegion *pRegion)
Definition: cardwindow.cpp:583
LONG_PTR LPARAM
Definition: windef.h:208
DropZone * dropzone[MAXDROPZONES]
Definition: cardwindow.h:106
BOOL Destroy()
Definition: cardwindow.cpp:123
CardButton * CreateButton(int id, TCHAR *szText, UINT uStyle, bool fVisible, int x, int y, int width, int height)
Definition: cardbutton.cpp:334
int GetWidth()
Definition: cardwindow.h:55
CardButton * CardButtonFromId(int id)
Definition: cardwindow.cpp:542
char TCHAR
Definition: xmlstorage.h:189
DWORD COLORREF
Definition: windef.h:285
HWND m_hWnd
Definition: cardwindow.h:91
int nWidth
Definition: cardwindow.h:92
CardRegion * CreateRegion(int id, bool fVisible, int x, int y, int xoffset, int yoffset)
Definition: cardregion.cpp:104
unsigned long DWORD
Definition: ntddk_ex.h:95
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
bool DeleteAll()
Definition: cardwindow.cpp:152
static LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: cardwindow.cpp:270
int GetNumDropZones()
Definition: cardwindow.h:66
HDC hdc
Definition: main.c:9
CardRegion * GetBestStack(int x, int y, int w, int h)
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
HBITMAP hbmBackImage
Definition: cardwindow.h:96
void SetBackImage(HBITMAP hBitmap)
Definition: cardwindow.cpp:805
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
bool DeleteDropZone(int id)
Definition: dropzone.cpp:44
pResizeWndProc ResizeWndCallback
Definition: cardwindow.h:111
unsigned int UINT
Definition: ndis.h:50
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
void Update(void)
Definition: cardwindow.cpp:687
int nNumButtons
Definition: cardwindow.h:101
static HBITMAP
Definition: button.c:44
UINT nBackCardIdx
Definition: cardwindow.h:94
LONG_PTR LRESULT
Definition: windef.h:209
friend void RegisterCardWindow()
Definition: cardwindow.cpp:42
static HBITMAP hBitmap
Definition: timezone.c:35
LPARAM lParam
Definition: combotst.c:139
void SetResizeProc(pResizeWndProc proc)
Definition: cardwindow.cpp:696
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: cardwindow.cpp:339