xref: /reactos/base/applications/mspaint/history.h (revision 7353af1e)
1 /*
2  * PROJECT:     PAINT for ReactOS
3  * LICENSE:     LGPL
4  * FILE:        base/applications/mspaint/history.h
5  * PURPOSE:     Undo and redo functionality
6  * PROGRAMMERS: Benedikt Freisen
7  */
8 
9 #pragma once
10 
11 class ImageModel
12 {
13 private:
14     void NotifyDimensionsChanged();
15     void NotifyImageChanged();
16     HDC hDrawingDC;
17 public:
18     HBITMAP hBms[HISTORYSIZE];
19 private:
20     int currInd;
21     int undoSteps;
22     int redoSteps;
23 public:
24     ImageModel();
25     void CopyPrevious(void);
26     void Undo(void);
27     void Redo(void);
28     void ResetToPrevious(void);
29     void ClearHistory(void);
30     void Insert(HBITMAP hbm);
31     void Crop(int nWidth, int nHeight, int nOffsetX = 0, int nOffsetY = 0);
32     void SaveImage(LPTSTR lpFileName);
33     BOOL IsImageSaved();
34     BOOL HasUndoSteps();
35     BOOL HasRedoSteps();
36     void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX = 0, int nSkewDegY = 0);
37     int GetWidth();
38     int GetHeight();
39     void InvertColors();
40     void Clear(COLORREF color = 0x00ffffff);
41     HDC GetDC();
42     void FlipHorizontally();
43     void FlipVertically();
44     void RotateNTimes90Degrees(int iN);
45 };
46