ReactOS  0.4.15-dev-4869-g35a816a
selectionmodel.h
Go to the documentation of this file.
1 /*
2  * PROJECT: PAINT for ReactOS
3  * LICENSE: LGPL
4  * FILE: base/applications/mspaint/selectionmodel.h
5  * PURPOSE: Keep track of selection parameters, notify listeners
6  * PROGRAMMERS: Benedikt Freisen
7  * Katayama Hirofumi MZ
8  */
9 
10 #pragma once
11 
12 /* DEFINES **********************************************************/
13 
14 #define ACTION_MOVE 0
15 #define ACTION_RESIZE_TOP_LEFT 1
16 #define ACTION_RESIZE_TOP 2
17 #define ACTION_RESIZE_TOP_RIGHT 3
18 #define ACTION_RESIZE_LEFT 4
19 #define ACTION_RESIZE_RIGHT 5
20 #define ACTION_RESIZE_BOTTOM_LEFT 6
21 #define ACTION_RESIZE_BOTTOM 7
22 #define ACTION_RESIZE_BOTTOM_RIGHT 8
23 
24 /* CLASSES **********************************************************/
25 
27 {
28 private:
35  int m_iPtSP;
36 
37 // void NotifySelectionChanging();
38 // void NotifySelectionChanged();
39  void NotifyRefreshNeeded();
40 
41 public:
44  void ResetPtStack();
45  void PushToPtStack(LONG x, LONG y);
46  void CalculateBoundingBoxAndContents(HDC hDCImage);
47  void CalculateContents(HDC hDCImage);
48  void DrawBackgroundPoly(HDC hDCImage, COLORREF crBg);
49  void DrawBackgroundRect(HDC hDCImage, COLORREF crBg);
50  void DrawSelection(HDC hDCImage, COLORREF crBg = 0, BOOL bBgTransparent = FALSE);
51  void DrawSelectionStretched(HDC hDCImage);
52  void ScaleContentsToFit();
53  void InsertFromHBITMAP(HBITMAP hBm, INT x = 0, INT y = 0);
54  void FlipHorizontally();
55  void FlipVertically();
56  void RotateNTimes90Degrees(int iN);
57  void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX = 0, int nSkewDegY = 0);
58  HBITMAP GetBitmap() const;
59  int PtStackSize() const;
60  void DrawFramePoly(HDC hDCImage);
61  void SetSrcAndDestRectFromPoints(const POINT& ptFrom, const POINT& ptTo);
62  void SetSrcRectSizeToZero();
63  BOOL IsSrcRectSizeNonzero() const;
64  void ModifyDestRect(POINT& ptDelta, int iAction);
65  LONG GetDestRectWidth() const;
66  LONG GetDestRectHeight() const;
67  LONG GetDestRectLeft() const;
68  LONG GetDestRectTop() const;
69  void GetRect(LPRECT prc) const;
70 
71 private:
74 };
void DrawSelectionStretched(HDC hDCImage)
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX=0, int nSkewDegY=0)
int PtStackSize() const
void RotateNTimes90Degrees(int iN)
void DrawFramePoly(HDC hDCImage)
LONG GetDestRectLeft() const
void InsertFromHBITMAP(HBITMAP hBm, INT x=0, INT y=0)
void PushToPtStack(LONG x, LONG y)
static HDC
Definition: imagelist.c:92
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
void CalculateContents(HDC hDCImage)
LONG GetDestRectWidth() const
SelectionModel & operator=(const SelectionModel &)
void GetRect(LPRECT prc) const
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
void DrawBackgroundPoly(HDC hDCImage, COLORREF crBg)
void ModifyDestRect(POINT &ptDelta, int iAction)
void DrawBackgroundRect(HDC hDCImage, COLORREF crBg)
DWORD COLORREF
Definition: windef.h:300
BOOL IsSrcRectSizeNonzero() const
LONG GetDestRectHeight() const
void SetSrcRectSizeToZero()
HBITMAP GetBitmap() const
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
void DrawSelection(HDC hDCImage, COLORREF crBg=0, BOOL bBgTransparent=FALSE)
void CalculateBoundingBoxAndContents(HDC hDCImage)
LONG GetDestRectTop() const
void NotifyRefreshNeeded()
static HBITMAP
Definition: button.c:44
_Out_ LPRECT prc
Definition: ntgdi.h:1658
void SetSrcAndDestRectFromPoints(const POINT &ptFrom, const POINT &ptTo)