ReactOS  0.4.15-dev-345-g5d88487
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);
54  void FlipHorizontally();
55  void FlipVertically();
56  void RotateNTimes90Degrees(int iN);
58  int PtStackSize();
59  void DrawFramePoly(HDC hDCImage);
60  void SetSrcAndDestRectFromPoints(const POINT& ptFrom, const POINT& ptTo);
61  void SetSrcRectSizeToZero();
63  void ModifyDestRect(POINT& ptDelta, int iAction);
68  void DrawTextToolText(HDC hDCImage, COLORREF crFg, COLORREF crBg, BOOL bBgTransparent = FALSE);
69 
70 private:
73 };
void DrawSelectionStretched(HDC hDCImage)
void RotateNTimes90Degrees(int iN)
void DrawFramePoly(HDC hDCImage)
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)
SelectionModel & operator=(const SelectionModel &)
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
void SetSrcRectSizeToZero()
void InsertFromHBITMAP(HBITMAP hBm)
BOOL IsSrcRectSizeNonzero()
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)
void NotifyRefreshNeeded()
void DrawTextToolText(HDC hDCImage, COLORREF crFg, COLORREF crBg, BOOL bBgTransparent=FALSE)
static HBITMAP
Definition: button.c:44
void SetSrcAndDestRectFromPoints(const POINT &ptFrom, const POINT &ptTo)