ReactOS  0.4.15-dev-4872-g8a3db97
ToolBase Struct Reference

#include <toolsmodel.h>

Inheritance diagram for ToolBase:
Collaboration diagram for ToolBase:

Public Member Functions

 ToolBase (TOOLTYPE tool)
 
virtual ~ToolBase ()
 
virtual void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
 
virtual void OnMouseMove (BOOL bLeftButton, LONG x, LONG y)
 
virtual void OnButtonUp (BOOL bLeftButton, LONG x, LONG y)
 
virtual void OnCancelDraw ()
 
virtual void OnFinishDraw ()
 
void beginEvent ()
 
void endEvent ()
 
void reset ()
 

Static Public Member Functions

static ToolBasecreateToolObject (TOOLTYPE type)
 

Public Attributes

TOOLTYPE m_tool
 
HDC m_hdc
 
COLORREF m_fg
 
COLORREF m_bg
 

Static Public Attributes

static INT pointSP = 0
 
static POINT pointStack [256] = { { 0 } }
 

Detailed Description

Definition at line 34 of file toolsmodel.h.

Constructor & Destructor Documentation

◆ ToolBase()

ToolBase::ToolBase ( TOOLTYPE  tool)
inline

Definition at line 42 of file toolsmodel.h.

42  : m_tool(tool), m_hdc(NULL)
43  {
44  }
HDC m_hdc
Definition: toolsmodel.h:37
TOOLTYPE m_tool
Definition: toolsmodel.h:36
#define NULL
Definition: types.h:112

◆ ~ToolBase()

virtual ToolBase::~ToolBase ( )
inlinevirtual

Definition at line 46 of file toolsmodel.h.

47  {
48  }

Member Function Documentation

◆ beginEvent()

void ToolBase::beginEvent ( )

Definition at line 95 of file mouse.cpp.

96 {
100 }
HDC m_hdc
Definition: toolsmodel.h:37
COLORREF GetBgColor() const
COLORREF GetFgColor() const
HDC GetDC()
Definition: history.cpp:239
COLORREF m_bg
Definition: toolsmodel.h:38
COLORREF m_fg
Definition: toolsmodel.h:38
ImageModel imageModel
Definition: main.cpp:32
PaletteModel paletteModel
Definition: main.cpp:28

Referenced by ToolsModel::OnButtonDown(), ToolsModel::OnButtonUp(), ToolsModel::OnCancelDraw(), ToolsModel::OnFinishDraw(), and ToolsModel::OnMouseMove().

◆ createToolObject()

ToolBase * ToolBase::createToolObject ( TOOLTYPE  type)
static

Definition at line 764 of file mouse.cpp.

765 {
766  switch (type)
767  {
768  case TOOL_FREESEL: return new FreeSelTool();
769  case TOOL_RECTSEL: return new RectSelTool();
770  case TOOL_RUBBER: return new RubberTool();
771  case TOOL_FILL: return new FillTool();
772  case TOOL_COLOR: return new ColorTool();
773  case TOOL_ZOOM: return new ZoomTool();
774  case TOOL_PEN: return new PenTool();
775  case TOOL_BRUSH: return new BrushTool();
776  case TOOL_AIRBRUSH: return new AirBrushTool();
777  case TOOL_TEXT: return new TextTool();
778  case TOOL_LINE: return new LineTool();
779  case TOOL_BEZIER: return new BezierTool();
780  case TOOL_RECT: return new RectTool();
781  case TOOL_SHAPE: return new ShapeTool();
782  case TOOL_ELLIPSE: return new EllipseTool();
783  case TOOL_RRECT: return new RRectTool();
784  }
785  UNREACHABLE;
786  return NULL;
787 }
#define NULL
Definition: types.h:112
#define UNREACHABLE
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by ToolsModel::GetOrCreateTool().

◆ endEvent()

void ToolBase::endEvent ( )

Definition at line 102 of file mouse.cpp.

103 {
104  m_hdc = NULL;
105 }
HDC m_hdc
Definition: toolsmodel.h:37
#define NULL
Definition: types.h:112

Referenced by ToolsModel::OnButtonDown(), ToolsModel::OnButtonUp(), ToolsModel::OnCancelDraw(), ToolsModel::OnFinishDraw(), and ToolsModel::OnMouseMove().

◆ OnButtonDown()

virtual void ToolBase::OnButtonDown ( BOOL  bLeftButton,
LONG  x,
LONG  y,
BOOL  bDoubleClick 
)
inlinevirtual

Reimplemented in ShapeTool, BezierTool, TextTool, ZoomTool, FillTool, GenericDrawTool, RectSelTool, and FreeSelTool.

Definition at line 50 of file toolsmodel.h.

51  {
52  }

Referenced by ToolsModel::OnButtonDown().

◆ OnButtonUp()

virtual void ToolBase::OnButtonUp ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inlinevirtual

Reimplemented in ShapeTool, BezierTool, TextTool, ColorTool, GenericDrawTool, RectSelTool, and FreeSelTool.

Definition at line 58 of file toolsmodel.h.

59  {
60  }

Referenced by ToolsModel::OnButtonUp().

◆ OnCancelDraw()

◆ OnFinishDraw()

void ToolBase::OnFinishDraw ( )
virtual

◆ OnMouseMove()

virtual void ToolBase::OnMouseMove ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inlinevirtual

Reimplemented in ShapeTool, BezierTool, TextTool, ColorTool, GenericDrawTool, RectSelTool, and FreeSelTool.

Definition at line 54 of file toolsmodel.h.

55  {
56  }

Referenced by ToolsModel::OnMouseMove().

◆ reset()

void ToolBase::reset ( )

Definition at line 76 of file mouse.cpp.

77 {
78  pointSP = 0;
79  start.x = start.y = last.x = last.y = -1;
81  if (selectionWindow.IsWindow())
82  selectionWindow.ShowWindow(SW_HIDE);
83 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
POINT last
Definition: font.c:46
#define SW_HIDE
Definition: winuser.h:762
SelectionModel selectionModel
Definition: main.cpp:20
static INT pointSP
Definition: toolsmodel.h:39
GLuint start
Definition: gl.h:1545
CSelectionWindow selectionWindow
Definition: main.cpp:71

Referenced by OnCancelDraw(), OnFinishDraw(), and ToolsModel::resetTool().

Member Data Documentation

◆ m_bg

◆ m_fg

◆ m_hdc

◆ m_tool

TOOLTYPE ToolBase::m_tool

Definition at line 36 of file toolsmodel.h.

◆ pointSP

◆ pointStack


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