ReactOS 0.4.15-dev-7131-ge4d03f4
selectionmodel.h
Go to the documentation of this file.
1/*
2 * PROJECT: PAINT for ReactOS
3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4 * PURPOSE: Keep track of selection parameters, notify listeners
5 * COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
6 * Copyright 2019-2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7 */
8
9#pragma once
10
12{
13private:
16
17public:
21 CRect m_rc; // in image pixel coordinates
22 POINT m_ptHit; // in image pixel coordinates
23 CRect m_rcOld; // in image pixel coordinates
24
27
28 void SetRectFromPoints(const POINT& ptFrom, const POINT& ptTo);
29 void setMask(const CRect& rc, HBITMAP hbmMask);
30
31 BOOL TakeOff();
32 void Landing();
33 BOOL IsLanded() const;
34 void HideSelection();
35 void DeleteSelection();
36 HITTEST hitTest(POINT ptCanvas);
37 void drawFrameOnCanvas(HDC hCanvasDC);
38 void moveSelection(INT xDelta, INT yDelta);
39
41 void DrawBackground(HDC hDCImage, COLORREF crBg);
42 void DrawBackgroundPoly(HDC hDCImage, COLORREF crBg);
43 void DrawBackgroundRect(HDC hDCImage, COLORREF crBg);
44 void DrawSelection(HDC hDCImage, COLORREF crBg = 0, BOOL bBgTransparent = FALSE);
45 void InsertFromHBITMAP(HBITMAP hbmColor, INT x = 0, INT y = 0, HBITMAP hbmMask = NULL);
46
47 // operation
48 void FlipHorizontally();
49 void FlipVertically();
50 void RotateNTimes90Degrees(int iN);
51 void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX, int nSkewDegY);
52 void InvertSelection();
53
54 void Dragging(HITTEST hit, POINT pt);
55 void ClearMaskImage();
56 void ClearColorImage();
58
59 void StretchSelection(BOOL bShrink);
60
61private:
64
66 void SwapWidthAndHeight();
67};
HITTEST
Definition: precomp.h:55
HBITMAP m_hbmColor
void DrawBackground(HDC hDCImage, COLORREF crBg)
void DrawBackgroundPoly(HDC hDCImage, COLORREF crBg)
void RotateNTimes90Degrees(int iN)
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX, int nSkewDegY)
SelectionModel(const SelectionModel &)
HBITMAP GetSelectionContents()
void ShiftPtStack(INT dx, INT dy)
void InsertFromHBITMAP(HBITMAP hbmColor, INT x=0, INT y=0, HBITMAP hbmMask=NULL)
COLORREF m_rgbBack
void NotifyContentChanged()
void moveSelection(INT xDelta, INT yDelta)
void drawFrameOnCanvas(HDC hCanvasDC)
SelectionModel & operator=(const SelectionModel &)
void Dragging(HITTEST hit, POINT pt)
void setMask(const CRect &rc, HBITMAP hbmMask)
HITTEST hitTest(POINT ptCanvas)
BOOL IsLanded() const
void DrawSelection(HDC hDCImage, COLORREF crBg=0, BOOL bBgTransparent=FALSE)
void SetRectFromPoints(const POINT &ptFrom, const POINT &ptTo)
void DrawBackgroundRect(HDC hDCImage, COLORREF crBg)
void StretchSelection(BOOL bShrink)
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define pt(x, y)
Definition: drawing.c:79
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 dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
int32_t INT
Definition: typedefs.h:58
DWORD COLORREF
Definition: windef.h:300