ReactOS  0.4.12-dev-18-gf469aca
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  */
8 
9 #pragma once
10 
11 /* DEFINES **********************************************************/
12 
13 #define ACTION_MOVE 0
14 #define ACTION_RESIZE_TOP_LEFT 1
15 #define ACTION_RESIZE_TOP 2
16 #define ACTION_RESIZE_TOP_RIGHT 3
17 #define ACTION_RESIZE_LEFT 4
18 #define ACTION_RESIZE_RIGHT 5
19 #define ACTION_RESIZE_BOTTOM_LEFT 6
20 #define ACTION_RESIZE_BOTTOM 7
21 #define ACTION_RESIZE_BOTTOM_RIGHT 8
22 
23 /* CLASSES **********************************************************/
24 
26 {
27 private:
34  int m_iPtSP;
35 
36 // void NotifySelectionChanging();
37 // void NotifySelectionChanged();
38  void NotifyRefreshNeeded();
39 
40 public:
42  void ResetPtStack();
43  void PushToPtStack(LONG x, LONG y);
44  void CalculateBoundingBoxAndContents(HDC hDCImage);
45  void CalculateContents(HDC hDCImage);
46  void DrawBackgroundPoly(HDC hDCImage, COLORREF crBg);
47  void DrawBackgroundRect(HDC hDCImage, COLORREF crBg);
48  void DrawSelection(HDC hDCImage, COLORREF crBg = 0, BOOL bBgTransparent = FALSE);
49  void DrawSelectionStretched(HDC hDCImage);
50  void ScaleContentsToFit();
51  void InsertFromHBITMAP(HBITMAP hBm);
52  void FlipHorizontally();
53  void FlipVertically();
54  void RotateNTimes90Degrees(int iN);
56  int PtStackSize();
57  void DrawFramePoly(HDC hDCImage);
58  void SetSrcAndDestRectFromPoints(POINT& ptFrom, POINT& ptTo);
59  void SetSrcRectSizeToZero();
61  void ModifyDestRect(POINT& ptDelta, int iAction);
66  void DrawTextToolText(HDC hDCImage, COLORREF crFg, COLORREF crBg, BOOL bBgTransparent = FALSE);
67 };
void DrawSelectionStretched(HDC hDCImage)
#define HDC
Definition: msvc.h:22
void RotateNTimes90Degrees(int iN)
void DrawFramePoly(HDC hDCImage)
#define HBITMAP
Definition: msvc.h:28
void PushToPtStack(LONG x, LONG y)
void CalculateContents(HDC hDCImage)
INT INT y
Definition: msvc.h:62
long LONG
Definition: pedump.c:60
void DrawBackgroundPoly(HDC hDCImage, COLORREF crBg)
void ModifyDestRect(POINT &ptDelta, int iAction)
void DrawBackgroundRect(HDC hDCImage, COLORREF crBg)
unsigned int BOOL
Definition: ntddk_ex.h:94
void SetSrcRectSizeToZero()
void InsertFromHBITMAP(HBITMAP hBm)
INT x
Definition: msvc.h:62
BOOL IsSrcRectSizeNonzero()
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)
DWORD COLORREF
Definition: windef.h:290
void SetSrcAndDestRectFromPoints(POINT &ptFrom, POINT &ptTo)