ReactOS 0.4.15-dev-7961-gdcf9eb0
SmoothDrawTool Struct Referenceabstract
Inheritance diagram for SmoothDrawTool:
Collaboration diagram for SmoothDrawTool:

Public Member Functions

virtual void OnDraw (HDC hdc, BOOL bLeftButton, POINT pt0, POINT pt1)=0
 
void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) override
 
BOOL OnMouseMove (BOOL bLeftButton, LONG &x, LONG &y) override
 
BOOL OnButtonUp (BOOL bLeftButton, LONG &x, LONG &y) override
 
void OnDrawOverlayOnImage (HDC hdc) override
 
- Public Member Functions inherited from ToolBase
 ToolBase ()
 
virtual ~ToolBase ()
 
virtual void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
 
virtual BOOL OnMouseMove (BOOL bLeftButton, LONG &x, LONG &y)
 
virtual BOOL OnButtonUp (BOOL bLeftButton, LONG &x, LONG &y)
 
virtual void OnDrawOverlayOnImage (HDC hdc)
 
virtual void OnDrawOverlayOnCanvas (HDC hdc)
 
virtual void OnSpecialTweak (BOOL bMinus)
 
virtual void OnEndDraw (BOOL bCancel)
 
void beginEvent ()
 
void endEvent ()
 
void reset ()
 

Public Attributes

DIRECTION m_direction = NO_DIRECTION
 
BOOL m_bShiftDown = FALSE
 
BOOL m_bLeftButton = FALSE
 
- Public Attributes inherited from ToolBase
HDC m_hdc
 
COLORREF m_fg
 
COLORREF m_bg
 

Additional Inherited Members

- Static Public Member Functions inherited from ToolBase
static ToolBasecreateToolObject (TOOLTYPE type)
 

Detailed Description

Definition at line 302 of file mouse.cpp.

Member Function Documentation

◆ OnButtonDown()

void SmoothDrawTool::OnButtonDown ( BOOL  bLeftButton,
LONG  x,
LONG  y,
BOOL  bDoubleClick 
)
inlineoverridevirtual

Reimplemented from ToolBase.

Reimplemented in AirBrushTool.

Definition at line 310 of file mouse.cpp.

311 {
313 m_bShiftDown = (::GetKeyState(VK_SHIFT) & 0x8000); // Is Shift key pressed?
314 m_bLeftButton = bLeftButton;
315 s_cPoints = 0;
316 pushToPoints(x, y);
317 pushToPoints(x, y); // We have to draw the first point
319 }
@ NO_DIRECTION
Definition: mouse.cpp:213
static void pushToPoints(LONG x, LONG y)
Definition: mouse.cpp:143
static SIZE_T s_cPoints
Definition: mouse.cpp:12
void NotifyImageChanged()
Definition: history.cpp:23
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
ImageModel imageModel
Definition: history.cpp:11
BOOL m_bLeftButton
Definition: mouse.cpp:306
BOOL m_bShiftDown
Definition: mouse.cpp:305
DIRECTION m_direction
Definition: mouse.cpp:304
#define VK_SHIFT
Definition: winuser.h:2202
SHORT WINAPI GetKeyState(_In_ int)

Referenced by AirBrushTool::OnButtonDown().

◆ OnButtonUp()

BOOL SmoothDrawTool::OnButtonUp ( BOOL  bLeftButton,
LONG x,
LONG y 
)
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 343 of file mouse.cpp.

344 {
347
348 pushToPoints(x, y);
349
350 CRect rcPartial;
352
354 rcPartial.InflateRect((size.cx + 1) / 2, (size.cy + 1) / 2);
355
356 imageModel.PushImageForUndo(rcPartial);
357
361 return TRUE;
362 }
static LPPOINT s_pPoints
Definition: mouse.cpp:16
static void RestrictDrawDirection(DIRECTION dir, LONG x0, LONG y0, LONG &x1, LONG &y1)
Definition: mouse.cpp:276
void getBoundaryOfPoints(RECT &rcBoundary, SIZE_T cPoints, const POINT *pPoints)
Definition: mouse.cpp:56
static POINT g_ptStart
Definition: mouse.cpp:17
ToolsModel toolsModel
Definition: toolsmodel.cpp:10
void InflateRect(int x, int y) noexcept
Definition: atltypes.h:323
void PushImageForUndo()
Definition: history.cpp:127
SIZE GetToolSize() const
Definition: toolsmodel.cpp:205
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLsizeiptr size
Definition: glext.h:5919
void OnDrawOverlayOnImage(HDC hdc) override
Definition: mouse.cpp:364
HDC m_hdc
Definition: toolsmodel.h:43
virtual void OnEndDraw(BOOL bCancel)
Definition: mouse.cpp:125
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48

◆ OnDraw()

virtual void SmoothDrawTool::OnDraw ( HDC  hdc,
BOOL  bLeftButton,
POINT  pt0,
POINT  pt1 
)
pure virtual

Implemented in RubberTool, PenTool, BrushTool, and AirBrushTool.

Referenced by OnDrawOverlayOnImage().

◆ OnDrawOverlayOnImage()

void SmoothDrawTool::OnDrawOverlayOnImage ( HDC  hdc)
inlineoverridevirtual

Reimplemented from ToolBase.

Reimplemented in AirBrushTool.

Definition at line 364 of file mouse.cpp.

365 {
366 for (SIZE_T i = 1; i < s_cPoints; ++i)
367 {
369 }
370 }
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
HDC hdc
Definition: main.c:9
virtual void OnDraw(HDC hdc, BOOL bLeftButton, POINT pt0, POINT pt1)=0
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by OnButtonUp(), and AirBrushTool::OnDrawOverlayOnImage().

◆ OnMouseMove()

BOOL SmoothDrawTool::OnMouseMove ( BOOL  bLeftButton,
LONG x,
LONG y 
)
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 321 of file mouse.cpp.

322 {
323 if (!m_bShiftDown)
324 {
325 pushToPoints(x, y);
327 return TRUE;
328 }
329
331 {
334 return FALSE;
335 }
336
338 pushToPoints(x, y);
340 return TRUE;
341 }
static DIRECTION GetDirection(LONG x0, LONG y0, LONG x1, LONG y1)
Definition: mouse.cpp:223

Member Data Documentation

◆ m_bLeftButton

BOOL SmoothDrawTool::m_bLeftButton = FALSE

Definition at line 306 of file mouse.cpp.

Referenced by OnButtonDown(), and OnDrawOverlayOnImage().

◆ m_bShiftDown

BOOL SmoothDrawTool::m_bShiftDown = FALSE

Definition at line 305 of file mouse.cpp.

Referenced by OnButtonDown(), OnButtonUp(), and OnMouseMove().

◆ m_direction

DIRECTION SmoothDrawTool::m_direction = NO_DIRECTION

Definition at line 304 of file mouse.cpp.

Referenced by OnButtonDown(), OnButtonUp(), and OnMouseMove().


The documentation for this struct was generated from the following file: