ReactOS 0.4.16-dev-319-g6cf4263
toolsettings.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: PAINT for ReactOS
3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4 * PURPOSE: Window procedure of the tool settings window
5 * COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
6 * Copyright 2018 Stanislav Motylkov <x86corez@gmail.com>
7 * Copyright 2021-2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
8 */
9
10#include "precomp.h"
11
12#define X_TOOLSETTINGS 0
13#define Y_TOOLSETTINGS (CY_TOOLBAR + 3)
14#define CX_TOOLSETTINGS CX_TOOLBAR
15#define CY_TOOLSETTINGS 140
16
17#define CX_TRANS_ICON 40
18#define CY_TRANS_ICON 30
19#define MARGIN1 3
20#define MARGIN2 2
21
22#define MAX_ZOOM_TRACK 6
23#define MIN_ZOOM_TRACK 0
24#define DEFAULT_ZOOM_TRACK 3
25
26static const BYTE s_AirRadius[4] = { 5, 8, 3, 12 };
27
29
30/* FUNCTIONS ********************************************************/
31
33{
34 RECT toolSettingsWindowPos =
35 {
38 };
39 return !!Create(toolBoxContainer, toolSettingsWindowPos, NULL, WS_CHILD | WS_VISIBLE);
40}
41
42static INT
43getSplitRects(RECT *rects, INT cColumns, INT cRows, LPCRECT prc, LPPOINT ppt)
44{
45 INT cx = prc->right - prc->left, cy = prc->bottom - prc->top;
46 for (INT i = 0, iRow = 0; iRow < cRows; ++iRow)
47 {
48 for (INT iColumn = 0; iColumn < cColumns; ++iColumn)
49 {
50 RECT& rc = rects[i];
51 rc.left = prc->left + (iColumn * cx / cColumns);
52 rc.top = prc->top + (iRow * cy / cRows);
53 rc.right = prc->left + ((iColumn + 1) * cx / cColumns);
54 rc.bottom = prc->top + ((iRow + 1) * cy / cRows);
55 if (ppt && ::PtInRect(&rc, *ppt))
56 return i;
57 ++i;
58 }
59 }
60 return -1;
61}
62
63static inline INT getTransRects(RECT rects[2], LPCRECT prc, LPPOINT ppt = NULL)
64{
65 return getSplitRects(rects, 1, 2, prc, ppt);
66}
67
69{
70 RECT rc[2];
71 getTransRects(rc, prc);
72
76 ::DrawIconEx(hdc, rc[1].left, rc[1].top, m_hTranspIcon,
78}
79
80static inline INT getRubberRects(RECT rects[4], LPCRECT prc, LPPOINT ppt = NULL)
81{
82 return getSplitRects(rects, 1, 4, prc, ppt);
83}
84
86{
87 RECT rects[4], rcRubber;
88 getRubberRects(rects, prc);
89 INT xCenter = (prc->left + prc->right) / 2;
90 for (INT i = 0; i < 4; i++)
91 {
92 INT iColor, radius = i + 2;
93 if (toolsModel.GetRubberRadius() == radius)
94 {
97 }
98 else
99 {
101 }
102
103 INT yCenter = (rects[i].top + rects[i].bottom) / 2;
104 rcRubber.left = xCenter - radius;
105 rcRubber.top = yCenter - radius;
106 rcRubber.right = rcRubber.left + radius * 2;
107 rcRubber.bottom = rcRubber.top + radius * 2;
109 }
110}
111
112static inline INT getBrushRects(RECT rects[12], LPCRECT prc, LPPOINT ppt = NULL)
113{
114 return getSplitRects(rects, 3, 4, prc, ppt);
115}
116
118{
121};
122
124{
125 { BrushStyleRound, 7 }, { BrushStyleRound, 4 }, { BrushStyleRound, 1 },
129};
130
132{
133 RECT rects[12];
134 getBrushRects(rects, prc);
135
136 for (INT i = 0; i < 12; i++)
137 {
138 RECT rcItem = rects[i];
139 INT x = (rcItem.left + rcItem.right) / 2, y = (rcItem.top + rcItem.bottom) / 2;
140
141 INT iColor;
143 if (data.width == toolsModel.GetBrushWidth() && data.style == toolsModel.GetBrushStyle())
144 {
146 ::FillRect(hdc, &rcItem, (HBRUSH)(COLOR_HIGHLIGHT + 1));
147 }
148 else
149 {
151 }
152
153 Brush(hdc, x, y, x, y, ::GetSysColor(iColor), data.style, data.width);
154 }
155}
156
157static inline INT getLineRects(RECT rects[5], LPCRECT prc, LPPOINT ppt = NULL)
158{
159 return getSplitRects(rects, 1, 5, prc, ppt);
160}
161
163{
164 RECT rects[5];
165 getLineRects(rects, prc);
166
167 for (INT i = 0; i < 5; i++)
168 {
169 INT penWidth = i + 1;
170 CRect rcLine = rects[i];
171 rcLine.InflateRect(-2, 0);
172 rcLine.top = (rcLine.top + rcLine.bottom - penWidth) / 2;
173 rcLine.bottom = rcLine.top + penWidth;
174 if (toolsModel.GetLineWidth() == penWidth)
175 {
178 }
179 else
180 {
182 }
183 }
184}
185
187{
188 INT cx = (prc->right - prc->left), cy = (prc->bottom - prc->top);
189
190 rects[0] = rects[1] = rects[2] = rects[3] = *prc;
191
192 rects[0].right = rects[1].left = prc->left + cx * 3 / 8;
193 rects[0].bottom = rects[1].bottom = prc->top + cy / 2;
194
195 rects[2].top = rects[3].top = prc->top + cy / 2;
196 rects[2].right = rects[3].left = prc->left + cx * 2 / 8;
197
198 if (ppt)
199 {
200 for (INT i = 0; i < 4; ++i)
201 {
202 if (::PtInRect(&rects[i], *ppt))
203 return i;
204 }
205 }
206 return -1;
207}
208
210{
211 RECT rects[4];
212 getAirBrushRects(rects, prc);
213
214 srand(0);
215 for (size_t i = 0; i < 4; ++i)
216 {
217 RECT& rc = rects[i];
218 INT x = (rc.left + rc.right) / 2;
219 INT y = (rc.top + rc.bottom) / 2;
221 if (bHigh)
222 {
224
225 for (int k = 0; k < 3; ++k)
227 }
228 else
229 {
230 for (int k = 0; k < 3; ++k)
232 }
233 }
234}
235
236static inline INT getBoxRects(RECT rects[3], LPCRECT prc, LPPOINT ppt = NULL)
237{
238 return getSplitRects(rects, 1, 3, prc, ppt);
239}
240
242{
243 CRect rects[3];
244 getBoxRects(rects, prc);
245
246 for (INT iItem = 0; iItem < 3; ++iItem)
247 {
248 CRect& rcItem = rects[iItem];
249
250 if (toolsModel.GetShapeStyle() == iItem)
252
253 rcItem.InflateRect(-5, -5);
254
255 if (iItem <= 1)
256 {
257 COLORREF rgbPen;
258 if (toolsModel.GetShapeStyle() == iItem)
260 else
262 HGDIOBJ hOldBrush;
263 if (iItem == 0)
265 else
267 HGDIOBJ hOldPen = ::SelectObject(hdc, ::CreatePen(PS_SOLID, 1, rgbPen));
268 ::Rectangle(hdc, rcItem.left, rcItem.top, rcItem.right, rcItem.bottom);
270 ::SelectObject(hdc, hOldBrush);
271 }
272 else
273 {
274 if (toolsModel.GetShapeStyle() == iItem)
276 else
277 ::FillRect(hdc, &rcItem, ::GetSysColorBrush(COLOR_WINDOWTEXT));
278 }
279 }
280}
281
283{
284 /* preloading the draw transparent/nontransparent icons for later use */
289
290 CRect trackbarZoomPos, rect2;
291 calculateTwoBoxes(trackbarZoomPos, rect2);
292 trackbarZoomPos.InflateRect(-1, -1);
293
294 trackbarZoom.Create(TRACKBAR_CLASS, m_hWnd, trackbarZoomPos, NULL, WS_CHILD | TBS_VERT | TBS_AUTOTICKS);
297 return 0;
298}
299
301{
304 return 0;
305}
306
308{
310 canvasWindow.zoomTo(MIN_ZOOM << trackPos);
311
312 INT zoomRate = toolsModel.GetZoom();
313
314 CStringW strZoom;
315 if (zoomRate % 10 == 0)
316 strZoom.Format(L"%d%%", zoomRate / 10);
317 else
318 strZoom.Format(L"%d.%d%%", zoomRate / 10, zoomRate % 10);
319
321
322 OnToolsModelZoomChanged(nMsg, wParam, lParam, bHandled);
323 return 0;
324}
325
327{
328 NMHDR *pnmhdr = (NMHDR*)lParam;
329 if (pnmhdr->code == NM_CUSTOMDRAW)
330 {
331 NMCUSTOMDRAW *pCustomDraw = (NMCUSTOMDRAW*)pnmhdr;
332 pCustomDraw->uItemState &= ~CDIS_FOCUS; // Do not draw the focus
333 }
334 return 0;
335}
336
338{
339 CRect rcClient;
340 GetClientRect(&rcClient);
341 rcClient.InflateRect(-MARGIN1, -MARGIN1);
342
343 INT yCenter = (rcClient.top + rcClient.bottom) / 2;
344 rect1.SetRect(rcClient.left, rcClient.top, rcClient.right, yCenter);
345 rect2.SetRect(rcClient.left, yCenter, rcClient.right, rcClient.bottom);
346
347 rect1.InflateRect(-MARGIN2, -MARGIN2);
348 rect2.InflateRect(-MARGIN2, -MARGIN2);
349}
350
352{
353 CRect rect1, rect2;
354 calculateTwoBoxes(rect1, rect2);
355
356 PAINTSTRUCT ps;
357 HDC hdc = BeginPaint(&ps);
358
361
364
365 rect1.InflateRect(-MARGIN2, -MARGIN2);
366 rect2.InflateRect(-MARGIN2, -MARGIN2);
367 switch (toolsModel.GetActiveTool())
368 {
369 case TOOL_FREESEL:
370 case TOOL_RECTSEL:
371 case TOOL_TEXT:
372 drawTrans(hdc, &rect1);
373 break;
374 case TOOL_RUBBER:
375 drawRubber(hdc, &rect1);
376 break;
377 case TOOL_BRUSH:
378 drawBrush(hdc, &rect1);
379 break;
380 case TOOL_AIRBRUSH:
381 drawAirBrush(hdc, &rect1);
382 break;
383 case TOOL_LINE:
384 case TOOL_BEZIER:
385 drawLine(hdc, &rect1);
386 break;
387 case TOOL_RECT:
388 case TOOL_SHAPE:
389 case TOOL_ELLIPSE:
390 case TOOL_RRECT:
391 drawBox(hdc, &rect1);
392 drawLine(hdc, &rect2);
393 break;
394 case TOOL_FILL:
395 case TOOL_COLOR:
396 case TOOL_ZOOM:
397 case TOOL_PEN:
398 break;
399 }
400 EndPaint(&ps);
401 return 0;
402}
403
405{
407
408 CRect rect1, rect2;
409 calculateTwoBoxes(rect1, rect2);
410 RECT rects[12];
411
412 INT iItem;
413 switch (toolsModel.GetActiveTool())
414 {
415 case TOOL_FREESEL:
416 case TOOL_RECTSEL:
417 case TOOL_TEXT:
418 iItem = getTransRects(rects, &rect1, &pt);
419 if (iItem != -1)
421 break;
422 case TOOL_RUBBER:
423 iItem = getRubberRects(rects, &rect1, &pt);
424 if (iItem != -1)
425 toolsModel.SetRubberRadius(iItem + 2);
426 break;
427 case TOOL_BRUSH:
428 iItem = getBrushRects(rects, &rect1, &pt);
429 if (iItem != -1)
430 {
431 const BrushStyleAndWidth& data = c_BrushPresets[iItem];
434 }
435 break;
436 case TOOL_AIRBRUSH:
437 iItem = getAirBrushRects(rects, &rect1, &pt);
438 if (iItem != -1)
440 break;
441 case TOOL_LINE:
442 case TOOL_BEZIER:
443 iItem = getLineRects(rects, &rect1, &pt);
444 if (iItem != -1)
445 toolsModel.SetLineWidth(iItem + 1);
446 break;
447 case TOOL_RECT:
448 case TOOL_SHAPE:
449 case TOOL_ELLIPSE:
450 case TOOL_RRECT:
451 iItem = getBoxRects(rects, &rect1, &pt);
452 if (iItem != -1)
454
455 iItem = getLineRects(rects, &rect2, &pt);
456 if (iItem != -1)
457 toolsModel.SetLineWidth(iItem + 1);
458 break;
459 case TOOL_FILL:
460 case TOOL_COLOR:
461 case TOOL_ZOOM:
462 case TOOL_PEN:
463 break;
464 }
465
466 ::SetCapture(::GetParent(m_hWnd));
467 return 0;
468}
469
471{
472 Invalidate();
474 return 0;
475}
476
478{
479 Invalidate();
480 return 0;
481}
482
484{
485 int tbPos = MIN_ZOOM_TRACK;
486 int tempZoom = toolsModel.GetZoom();
487
488 while (tempZoom > MIN_ZOOM)
489 {
490 tbPos++;
491 tempZoom = tempZoom >> 1;
492 }
493
495 return 0;
496}
HWND g_hStatusBar
Definition: main.cpp:23
HINSTANCE g_hinstExe
Definition: main.cpp:17
ToolsModel toolsModel
Definition: toolsmodel.cpp:10
#define MIN_ZOOM
Definition: precomp.h:44
CToolBox toolBoxContainer
Definition: toolbox.cpp:11
#define IDI_NONTRANSPARENT
Definition: resource.h:18
#define IDI_TRANSPARENT
Definition: resource.h:17
@ Create
Definition: registry.c:563
CCanvasWindow canvasWindow
Definition: canvas.cpp:10
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:818
HWND Create(LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:417
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1333
VOID zoomTo(INT newZoom, LONG left=0, LONG top=0)
Definition: canvas.cpp:107
void InflateRect(int x, int y) noexcept
Definition: atltypes.h:323
void SetRect(int x1, int y1, int x2, int y2) noexcept
Definition: atltypes.h:423
LRESULT OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnDestroy(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID calculateTwoBoxes(CRect &rect1, CRect &rect2)
LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnToolsModelToolChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID drawBrush(HDC hdc, LPCRECT prc)
VOID drawBox(HDC hdc, LPCRECT prc)
LRESULT OnToolsModelZoomChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
VOID drawLine(HDC hdc, LPCRECT prc)
VOID drawAirBrush(HDC hdc, LPCRECT prc)
VOID drawRubber(HDC hdc, LPCRECT prc)
BOOL DoCreate(HWND hwndParent)
VOID drawTrans(HDC hdc, LPCRECT prc)
LRESULT OnToolsModelSettingsChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnNotify(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
LRESULT OnVScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
void SetBrushStyle(BrushStyle nBrushStyle)
Definition: toolsmodel.cpp:128
int GetZoom() const
Definition: toolsmodel.cpp:261
int GetLineWidth() const
Definition: toolsmodel.cpp:46
int GetShapeStyle() const
Definition: toolsmodel.cpp:112
void SetAirBrushRadius(INT nAirBrushRadius)
Definition: toolsmodel.cpp:188
void SetShapeStyle(int nShapeStyle)
Definition: toolsmodel.cpp:117
void SetRubberRadius(int nRubberRadius)
Definition: toolsmodel.cpp:199
BrushStyle GetBrushStyle() const
Definition: toolsmodel.cpp:123
BOOL IsBackgroundTransparent() const
Definition: toolsmodel.cpp:249
void SetBackgroundTransparent(BOOL bTransparent)
Definition: toolsmodel.cpp:254
int GetRubberRadius() const
Definition: toolsmodel.cpp:194
TOOLTYPE GetActiveTool() const
Definition: toolsmodel.cpp:134
void SetBrushWidth(INT nBrushWidth)
Definition: toolsmodel.cpp:75
INT GetAirBrushRadius() const
Definition: toolsmodel.cpp:183
void SetLineWidth(int nLineWidth)
Definition: toolsmodel.cpp:51
INT GetBrushWidth() const
Definition: toolsmodel.cpp:70
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static HWND hwndParent
Definition: cryptui.c:300
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
void Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r)
Definition: drawing.cpp:153
RECT rect2
Definition: edittest.c:51
unsigned int BOOL
Definition: ntddk_ex.h:94
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
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
void __cdecl srand(_In_ unsigned int _Seed)
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
int k
Definition: mpi.c:3369
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define INT
Definition: polytest.cpp:20
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TBM_GETPOS
Definition: commctrl.h:2036
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TBS_VERT
Definition: commctrl.h:2021
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define TBM_SETRANGE
Definition: commctrl.h:2042
#define TBM_SETPOS
Definition: commctrl.h:2041
#define TBS_AUTOTICKS
Definition: commctrl.h:2020
#define SB_SETTEXT
Definition: commctrl.h:1954
#define TRACKBAR_CLASS
Definition: commctrl.h:2018
UINT code
Definition: winuser.h:3162
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
static INT getBrushRects(RECT rects[12], LPCRECT prc, LPPOINT ppt=NULL)
#define MARGIN2
#define MARGIN1
#define Y_TOOLSETTINGS
#define CY_TOOLSETTINGS
#define CY_TRANS_ICON
static INT getRubberRects(RECT rects[4], LPCRECT prc, LPPOINT ppt=NULL)
#define DEFAULT_ZOOM_TRACK
#define CX_TOOLSETTINGS
static INT getBoxRects(RECT rects[3], LPCRECT prc, LPPOINT ppt=NULL)
#define CX_TRANS_ICON
#define MAX_ZOOM_TRACK
#define X_TOOLSETTINGS
static const BYTE s_AirRadius[4]
static const BrushStyleAndWidth c_BrushPresets[]
static INT getAirBrushRects(RECT rects[4], LPCRECT prc, LPPOINT ppt=NULL)
static INT getTransRects(RECT rects[2], LPCRECT prc, LPPOINT ppt=NULL)
static INT getSplitRects(RECT *rects, INT cColumns, INT cRows, LPCRECT prc, LPPOINT ppt)
#define MIN_ZOOM_TRACK
CToolSettingsWindow toolSettingsWindow
static INT getLineRects(RECT rects[5], LPCRECT prc, LPPOINT ppt=NULL)
@ TOOL_AIRBRUSH
Definition: toolsmodel.h:20
@ TOOL_COLOR
Definition: toolsmodel.h:16
@ TOOL_SHAPE
Definition: toolsmodel.h:25
@ TOOL_RUBBER
Definition: toolsmodel.h:14
@ TOOL_BRUSH
Definition: toolsmodel.h:19
@ TOOL_RECT
Definition: toolsmodel.h:24
@ TOOL_BEZIER
Definition: toolsmodel.h:23
@ TOOL_FILL
Definition: toolsmodel.h:15
@ TOOL_TEXT
Definition: toolsmodel.h:21
@ TOOL_PEN
Definition: toolsmodel.h:18
@ TOOL_LINE
Definition: toolsmodel.h:22
@ TOOL_FREESEL
Definition: toolsmodel.h:12
@ TOOL_ZOOM
Definition: toolsmodel.h:17
@ TOOL_ELLIPSE
Definition: toolsmodel.h:26
@ TOOL_RRECT
Definition: toolsmodel.h:27
@ TOOL_RECTSEL
Definition: toolsmodel.h:13
BrushStyle
Definition: toolsmodel.h:32
@ BrushStyleForeSlash
Definition: toolsmodel.h:35
@ BrushStyleRound
Definition: toolsmodel.h:33
@ BrushStyleBackSlash
Definition: toolsmodel.h:36
@ BrushStyleSquare
Definition: toolsmodel.h:34
int32_t INT
Definition: typedefs.h:58
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
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define DI_NORMAL
Definition: wingdi.h:72
#define NULL_BRUSH
Definition: wingdi.h:901
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define PS_SOLID
Definition: wingdi.h:586
HWND WINAPI SetCapture(_In_ HWND hWnd)
DWORD WINAPI GetSysColor(_In_ int)
#define SW_HIDE
Definition: winuser.h:771
#define BDR_SUNKENOUTER
Definition: winuser.h:443
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
#define IMAGE_ICON
Definition: winuser.h:212
#define COLOR_WINDOWTEXT
Definition: winuser.h:924
#define COLOR_HIGHLIGHT
Definition: winuser.h:929
HBRUSH WINAPI GetSysColorBrush(_In_ int)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2255
#define BF_MIDDLE
Definition: winuser.h:468
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2080
#define COLOR_APPWORKSPACE
Definition: winuser.h:928
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:930
HWND WINAPI GetParent(_In_ HWND)
#define LR_DEFAULTCOLOR
Definition: winuser.h:1090
#define SW_SHOW
Definition: winuser.h:778
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define BF_RECT
Definition: winuser.h:462
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105
_In_ ULONG iColor
Definition: xlateobj.h:17
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193