ReactOS  0.4.12-dev-57-g7050ac4
toolsmodel.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: PAINT for ReactOS
3  * LICENSE: LGPL
4  * FILE: base/applications/mspaint/toolsmodel.cpp
5  * PURPOSE: Keep track of tool parameters, notify listeners
6  * PROGRAMMERS: Benedikt Freisen
7  */
8 
9 /* INCLUDES *********************************************************/
10 
11 #include "precomp.h"
12 
13 /* FUNCTIONS ********************************************************/
14 
16 {
17  m_lineWidth = 1;
18  m_shapeStyle = 0;
19  m_brushStyle = 0;
21  m_airBrushWidth = 5;
22  m_rubberRadius = 4;
23  m_transpBg = FALSE;
24  m_zoom = 1000;
25 }
26 
28 {
29  return m_lineWidth;
30 }
31 
32 void ToolsModel::SetLineWidth(int nLineWidth)
33 {
34  m_lineWidth = nLineWidth;
36 }
37 
39 {
40  return m_shapeStyle;
41 }
42 
43 void ToolsModel::SetShapeStyle(int nShapeStyle)
44 {
45  m_shapeStyle = nShapeStyle;
47 }
48 
50 {
51  return m_brushStyle;
52 }
53 
54 void ToolsModel::SetBrushStyle(int nBrushStyle)
55 {
56  m_brushStyle = nBrushStyle;
58 }
59 
61 {
62  return m_activeTool;
63 }
64 
65 void ToolsModel::SetActiveTool(int nActiveTool)
66 {
67  m_activeTool = nActiveTool;
69 }
70 
72 {
73  return m_airBrushWidth;
74 }
75 
76 void ToolsModel::SetAirBrushWidth(int nAirBrushWidth)
77 {
78  m_airBrushWidth = nAirBrushWidth;
80 }
81 
83 {
84  return m_rubberRadius;
85 }
86 
87 void ToolsModel::SetRubberRadius(int nRubberRadius)
88 {
89  m_rubberRadius = nRubberRadius;
91 }
92 
94 {
95  return m_transpBg;
96 }
97 
99 {
100  m_transpBg = bTransparent;
102 }
103 
105 {
106  return m_zoom;
107 }
108 
109 void ToolsModel::SetZoom(int nZoom)
110 {
111  m_zoom = nZoom;
113 }
114 
116 {
120 }
121 
123 {
126 }
127 
129 {
131 }
int GetLineWidth()
Definition: toolsmodel.cpp:27
#define WM_TOOLSMODELZOOMCHANGED
Definition: definitions.h:243
CToolBox toolBoxContainer
Definition: main.cpp:65
#define WM_TOOLSMODELTOOLCHANGED
Definition: definitions.h:241
int m_rubberRadius
Definition: toolsmodel.h:21
void SetLineWidth(int nLineWidth)
Definition: toolsmodel.cpp:32
int GetRubberRadius()
Definition: toolsmodel.cpp:82
int m_activeTool
Definition: toolsmodel.h:19
int m_zoom
Definition: toolsmodel.h:23
#define TOOL_PEN
Definition: definitions.h:141
int GetZoom()
Definition: toolsmodel.cpp:104
BOOL m_transpBg
Definition: toolsmodel.h:22
int m_airBrushWidth
Definition: toolsmodel.h:20
void SetBackgroundTransparent(BOOL bTransparent)
Definition: toolsmodel.cpp:98
int GetAirBrushWidth()
Definition: toolsmodel.cpp:71
void SetAirBrushWidth(int nAirBrushWidth)
Definition: toolsmodel.cpp:76
void SetActiveTool(int nActiveTool)
Definition: toolsmodel.cpp:65
int GetShapeStyle()
Definition: toolsmodel.cpp:38
BOOL IsBackgroundTransparent()
Definition: toolsmodel.cpp:93
#define WM_TOOLSMODELSETTINGSCHANGED
Definition: definitions.h:242
unsigned int BOOL
Definition: ntddk_ex.h:94
int m_brushStyle
Definition: toolsmodel.h:18
void NotifyZoomChanged()
Definition: toolsmodel.cpp:128
void NotifyToolChanged()
Definition: toolsmodel.cpp:115
void NotifyToolSettingsChanged()
Definition: toolsmodel.cpp:122
void SetZoom(int nZoom)
Definition: toolsmodel.cpp:109
void SetShapeStyle(int nShapeStyle)
Definition: toolsmodel.cpp:43
void SetBrushStyle(int nBrushStyle)
Definition: toolsmodel.cpp:54
int GetActiveTool()
Definition: toolsmodel.cpp:60
int GetBrushStyle()
Definition: toolsmodel.cpp:49
void SetRubberRadius(int nRubberRadius)
Definition: toolsmodel.cpp:87
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1039
CTextEditWindow textEditWindow
Definition: main.cpp:80
int m_lineWidth
Definition: toolsmodel.h:16
CToolSettingsWindow toolSettingsWindow
Definition: main.cpp:66
CSelectionWindow selectionWindow
Definition: main.cpp:70
int m_shapeStyle
Definition: toolsmodel.h:17