ReactOS 0.4.15-dev-6047-gb29e82d
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#define MAX_LONG_PATH 512
18
19#define WM_TOOLSMODELTOOLCHANGED (WM_APP + 0)
20#define WM_TOOLSMODELSETTINGSCHANGED (WM_APP + 1)
21#define WM_TOOLSMODELZOOMCHANGED (WM_APP + 2)
22#define WM_PALETTEMODELCOLORCHANGED (WM_APP + 3)
23#define WM_PALETTEMODELPALETTECHANGED (WM_APP + 4)
24#define WM_IMAGEMODELDIMENSIONSCHANGED (WM_APP + 5)
25#define WM_IMAGEMODELIMAGECHANGED (WM_APP + 6)
26#define WM_SELECTIONMODELREFRESHNEEDED (WM_APP + 7)
27
28/* width of the rectangle defined by a RECT structure */
29#define RECT_WIDTH(a) ((a).right - (a).left)
30
31/* height of the rectangle defined by a RECT structure */
32#define RECT_HEIGHT(a) ((a).bottom - (a).top)
33
34/* this simplifies checking and unchecking menu items */
35#define CHECKED_IF(a) ((a) ? (MF_CHECKED | MF_BYCOMMAND) : (MF_UNCHECKED | MF_BYCOMMAND))
36
37/* this simplifies enabling or graying menu items */
38#define ENABLED_IF(a) ((a) ? (MF_ENABLED | MF_BYCOMMAND) : (MF_GRAYED | MF_BYCOMMAND))
39
40enum CANVAS_HITTEST // hit
41{
42 HIT_NONE = 0, // Nothing hit or outside
53};
54
55/* FUNCTIONS ********************************************************/
56
57BOOL zoomTo(int newZoom, int mouseX, int mouseY);
60void updateLast(LONG x, LONG y);
CANVAS_HITTEST
Definition: common.h:41
@ HIT_NONE
Definition: common.h:42
@ HIT_BORDER
Definition: common.h:51
@ HIT_LOWER_RIGHT
Definition: common.h:50
@ HIT_LOWER_CENTER
Definition: common.h:49
@ HIT_UPPER_LEFT
Definition: common.h:43
@ HIT_INNER
Definition: common.h:52
@ HIT_LOWER_LEFT
Definition: common.h:48
@ HIT_UPPER_CENTER
Definition: common.h:44
@ HIT_UPPER_RIGHT
Definition: common.h:45
@ HIT_MIDDLE_RIGHT
Definition: common.h:47
@ HIT_MIDDLE_LEFT
Definition: common.h:46
void updateLast(LONG x, LONG y)
Definition: mouse.cpp:60
BOOL nearlyEqualPoints(INT x0, INT y0, INT x1, INT y1)
Definition: mouse.cpp:47
BOOL zoomTo(int newZoom, int mouseX, int mouseY)
Definition: winproc.cpp:46
void updateStartAndLast(LONG x, LONG y)
Definition: mouse.cpp:54
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint y0
Definition: linetemp.h:96
GLint x0
Definition: linetemp.h:95
long LONG
Definition: pedump.c:60
int32_t INT
Definition: typedefs.h:58
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708