ReactOS  0.4.15-dev-4872-g8a3db97
history.h
Go to the documentation of this file.
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 /* HISTORYSIZE = number of possible undo-steps + 1 */
12 #define HISTORYSIZE 11
13 
15 {
16 private:
18  void NotifyImageChanged();
20 public:
22 private:
23  int currInd;
24  int undoSteps;
25  int redoSteps;
26 public:
27  ImageModel();
28  void CopyPrevious(void);
29  void Undo(BOOL bClearRedo = FALSE);
30  void Redo(void);
31  void ResetToPrevious(void);
32  void ClearHistory(void);
33  void Insert(HBITMAP hbm);
34  void Crop(int nWidth, int nHeight, int nOffsetX = 0, int nOffsetY = 0);
36  BOOL IsImageSaved() const;
37  BOOL HasUndoSteps() const;
38  BOOL HasRedoSteps() const;
39  void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX = 0, int nSkewDegY = 0);
40  int GetWidth() const;
41  int GetHeight() const;
42  void InvertColors();
43  void Clear(COLORREF color = 0x00ffffff);
44  HDC GetDC();
45  void FlipHorizontally();
46  void FlipVertically();
47  void RotateNTimes90Degrees(int iN);
49  void DeleteSelection();
50  void Bound(POINT& pt);
51 };
int redoSteps
Definition: history.h:25
void FlipHorizontally()
Definition: history.cpp:244
void SaveImage(LPTSTR lpFileName)
Definition: history.cpp:169
ImageModel()
Definition: history.cpp:27
void CopyPrevious(void)
Definition: history.cpp:47
int currInd
Definition: history.h:23
#define HISTORYSIZE
Definition: history.h:12
BOOL HasUndoSteps() const
Definition: history.cpp:179
#define pt(x, y)
Definition: drawing.c:79
static HDC
Definition: imagelist.c:92
HDC hDrawingDC
Definition: history.h:19
void InvertColors()
Definition: history.cpp:225
void Redo(void)
Definition: history.cpp:81
BOOL HasRedoSteps() const
Definition: history.cpp:184
CHAR * LPTSTR
Definition: xmlstorage.h:192
void Crop(int nWidth, int nHeight, int nOffsetX=0, int nOffsetY=0)
Definition: history.cpp:131
#define FALSE
Definition: types.h:117
void ClearHistory(void)
Definition: history.cpp:109
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint color
Definition: glext.h:6243
HDC GetDC()
Definition: history.cpp:239
void Insert(HBITMAP hbm)
Definition: history.cpp:115
int GetWidth() const
Definition: history.cpp:215
void Clear(COLORREF color=0x00ffffff)
Definition: history.cpp:233
int undoSteps
Definition: history.h:24
DWORD COLORREF
Definition: windef.h:300
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX=0, int nSkewDegY=0)
Definition: history.cpp:189
void RotateNTimes90Degrees(int iN)
Definition: history.cpp:260
int GetHeight() const
Definition: history.cpp:220
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
void NotifyDimensionsChanged()
Definition: history.cpp:15
void DrawSelectionBackground(COLORREF rgbBG)
Definition: history.cpp:285
void FlipVertically()
Definition: history.cpp:252
void Bound(POINT &pt)
Definition: history.cpp:305
void NotifyImageChanged()
Definition: history.cpp:21
static HBITMAP
Definition: button.c:44
void DeleteSelection()
Definition: history.cpp:293
void Undo(BOOL bClearRedo=FALSE)
Definition: history.cpp:60
void ResetToPrevious(void)
Definition: history.cpp:100
HBITMAP hBms[HISTORYSIZE]
Definition: history.h:21
_In_ LPCSTR lpFileName
Definition: winbase.h:3055
BOOL IsImageSaved() const
Definition: history.cpp:174