ReactOS  0.4.15-dev-4574-g434cf85
common.h
Go to the documentation of this file.
1 /*
2  * PROJECT: PAINT for ReactOS
3  * LICENSE: LGPL
4  * FILE: base/applications/mspaint/common.h
5  * PURPOSE: Commonly used functions and definitions
6  * PROGRAMMERS: Benedikt Freisen
7  * Stanislav Motylkov
8  * Katayama Hirofumi MZ
9  */
10 
11 #pragma once
12 
13 #define GRIP_SIZE 3
14 #define MIN_ZOOM 125
15 #define MAX_ZOOM 8000
16 
17 /* width of the rectangle defined by a RECT structure */
18 #define RECT_WIDTH(a) ((a).right - (a).left)
19 
20 /* height of the rectangle defined by a RECT structure */
21 #define RECT_HEIGHT(a) ((a).bottom - (a).top)
22 
23 /* this simplifies checking and unchecking menu items */
24 #define CHECKED_IF(a) ((a) ? (MF_CHECKED | MF_BYCOMMAND) : (MF_UNCHECKED | MF_BYCOMMAND))
25 
26 /* this simplifies enabling or graying menu items */
27 #define ENABLED_IF(a) ((a) ? (MF_ENABLED | MF_BYCOMMAND) : (MF_GRAYED | MF_BYCOMMAND))
28 
29 /* FUNCTIONS ********************************************************/
30 
31 BOOL zoomTo(int newZoom, int mouseX, int mouseY);
33 void placeSelWin(void);
35 void updateLast(LONG x, LONG y);
36 
37 static inline int Zoomed(int xy)
38 {
39  return xy * toolsModel.GetZoom() / 1000;
40 }
41 
42 static inline int UnZoomed(int xy)
43 {
44  return xy * 1000 / toolsModel.GetZoom();
45 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
static int Zoomed(int xy)
Definition: common.h:37
ToolsModel toolsModel
Definition: main.cpp:18
GLint x0
Definition: linetemp.h:95
void placeSelWin(void)
Definition: mouse.cpp:20
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int32_t INT
Definition: typedefs.h:58
BOOL nearlyEqualPoints(INT x0, INT y0, INT x1, INT y1)
Definition: mouse.cpp:57
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
void updateStartAndLast(LONG x, LONG y)
Definition: mouse.cpp:64
void updateLast(LONG x, LONG y)
Definition: mouse.cpp:70
int GetZoom() const
Definition: toolsmodel.cpp:148
BOOL zoomTo(int newZoom, int mouseX, int mouseY)
Definition: winproc.cpp:19
GLint y0
Definition: linetemp.h:96
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static int UnZoomed(int xy)
Definition: common.h:42