ReactOS 0.4.16-dev-338-g34e76ad
toolsettings.cpp File Reference
#include "precomp.h"
Include dependency graph for toolsettings.cpp:

Go to the source code of this file.

Classes

struct  BrushStyleAndWidth
 

Macros

#define X_TOOLSETTINGS   0
 
#define Y_TOOLSETTINGS   (CY_TOOLBAR + 3)
 
#define CX_TOOLSETTINGS   CX_TOOLBAR
 
#define CY_TOOLSETTINGS   140
 
#define CX_TRANS_ICON   40
 
#define CY_TRANS_ICON   30
 
#define MARGIN1   3
 
#define MARGIN2   2
 
#define MAX_ZOOM_TRACK   6
 
#define MIN_ZOOM_TRACK   0
 
#define DEFAULT_ZOOM_TRACK   3
 

Functions

static INT getSplitRects (RECT *rects, INT cColumns, INT cRows, LPCRECT prc, LPPOINT ppt)
 
static INT getTransRects (RECT rects[2], LPCRECT prc, LPPOINT ppt=NULL)
 
static INT getRubberRects (RECT rects[4], LPCRECT prc, LPPOINT ppt=NULL)
 
static INT getBrushRects (RECT rects[12], LPCRECT prc, LPPOINT ppt=NULL)
 
static INT getLineRects (RECT rects[5], LPCRECT prc, LPPOINT ppt=NULL)
 
static INT getAirBrushRects (RECT rects[4], LPCRECT prc, LPPOINT ppt=NULL)
 
static INT getBoxRects (RECT rects[3], LPCRECT prc, LPPOINT ppt=NULL)
 

Variables

static const BYTE s_AirRadius [4] = { 5, 8, 3, 12 }
 
CToolSettingsWindow toolSettingsWindow
 
static const BrushStyleAndWidth c_BrushPresets []
 

Macro Definition Documentation

◆ CX_TOOLSETTINGS

#define CX_TOOLSETTINGS   CX_TOOLBAR

Definition at line 14 of file toolsettings.cpp.

◆ CX_TRANS_ICON

#define CX_TRANS_ICON   40

Definition at line 17 of file toolsettings.cpp.

◆ CY_TOOLSETTINGS

#define CY_TOOLSETTINGS   140

Definition at line 15 of file toolsettings.cpp.

◆ CY_TRANS_ICON

#define CY_TRANS_ICON   30

Definition at line 18 of file toolsettings.cpp.

◆ DEFAULT_ZOOM_TRACK

#define DEFAULT_ZOOM_TRACK   3

Definition at line 24 of file toolsettings.cpp.

◆ MARGIN1

#define MARGIN1   3

Definition at line 19 of file toolsettings.cpp.

◆ MARGIN2

#define MARGIN2   2

Definition at line 20 of file toolsettings.cpp.

◆ MAX_ZOOM_TRACK

#define MAX_ZOOM_TRACK   6

Definition at line 22 of file toolsettings.cpp.

◆ MIN_ZOOM_TRACK

#define MIN_ZOOM_TRACK   0

Definition at line 23 of file toolsettings.cpp.

◆ X_TOOLSETTINGS

#define X_TOOLSETTINGS   0

Definition at line 12 of file toolsettings.cpp.

◆ Y_TOOLSETTINGS

#define Y_TOOLSETTINGS   (CY_TOOLBAR + 3)

Definition at line 13 of file toolsettings.cpp.

Function Documentation

◆ getAirBrushRects()

static INT getAirBrushRects ( RECT  rects[4],
LPCRECT  prc,
LPPOINT  ppt = NULL 
)
static

Definition at line 186 of file toolsettings.cpp.

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}
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
_Out_ LPRECT prc
Definition: ntgdi.h:1658
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)

Referenced by CToolSettingsWindow::drawAirBrush(), and CToolSettingsWindow::OnLButtonDown().

◆ getBoxRects()

static INT getBoxRects ( RECT  rects[3],
LPCRECT  prc,
LPPOINT  ppt = NULL 
)
inlinestatic

Definition at line 236 of file toolsettings.cpp.

237{
238 return getSplitRects(rects, 1, 3, prc, ppt);
239}
static INT getSplitRects(RECT *rects, INT cColumns, INT cRows, LPCRECT prc, LPPOINT ppt)

Referenced by CToolSettingsWindow::drawBox(), and CToolSettingsWindow::OnLButtonDown().

◆ getBrushRects()

static INT getBrushRects ( RECT  rects[12],
LPCRECT  prc,
LPPOINT  ppt = NULL 
)
inlinestatic

Definition at line 112 of file toolsettings.cpp.

113{
114 return getSplitRects(rects, 3, 4, prc, ppt);
115}

Referenced by CToolSettingsWindow::drawBrush(), and CToolSettingsWindow::OnLButtonDown().

◆ getLineRects()

static INT getLineRects ( RECT  rects[5],
LPCRECT  prc,
LPPOINT  ppt = NULL 
)
inlinestatic

Definition at line 157 of file toolsettings.cpp.

158{
159 return getSplitRects(rects, 1, 5, prc, ppt);
160}

Referenced by CToolSettingsWindow::drawLine(), and CToolSettingsWindow::OnLButtonDown().

◆ getRubberRects()

static INT getRubberRects ( RECT  rects[4],
LPCRECT  prc,
LPPOINT  ppt = NULL 
)
inlinestatic

Definition at line 80 of file toolsettings.cpp.

81{
82 return getSplitRects(rects, 1, 4, prc, ppt);
83}

Referenced by CToolSettingsWindow::drawRubber(), and CToolSettingsWindow::OnLButtonDown().

◆ getSplitRects()

static INT getSplitRects ( RECT rects,
INT  cColumns,
INT  cRows,
LPCRECT  prc,
LPPOINT  ppt 
)
static

Definition at line 43 of file toolsettings.cpp.

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}

Referenced by getBoxRects(), getBrushRects(), getLineRects(), getRubberRects(), and getTransRects().

◆ getTransRects()

static INT getTransRects ( RECT  rects[2],
LPCRECT  prc,
LPPOINT  ppt = NULL 
)
inlinestatic

Definition at line 63 of file toolsettings.cpp.

64{
65 return getSplitRects(rects, 1, 2, prc, ppt);
66}

Referenced by CToolSettingsWindow::drawTrans(), and CToolSettingsWindow::OnLButtonDown().

Variable Documentation

◆ c_BrushPresets

const BrushStyleAndWidth c_BrushPresets[]
static
Initial value:
=
{
}
@ BrushStyleForeSlash
Definition: toolsmodel.h:35
@ BrushStyleRound
Definition: toolsmodel.h:33
@ BrushStyleBackSlash
Definition: toolsmodel.h:36
@ BrushStyleSquare
Definition: toolsmodel.h:34

Definition at line 123 of file toolsettings.cpp.

Referenced by CToolSettingsWindow::drawBrush(), and CToolSettingsWindow::OnLButtonDown().

◆ s_AirRadius

const BYTE s_AirRadius[4] = { 5, 8, 3, 12 }
static

◆ toolSettingsWindow