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 BOOL imageSaved; 25 26 ImageModel(); 27 void CopyPrevious(void); 28 void Undo(void); 29 void Redo(void); 30 void ResetToPrevious(void); 31 void ClearHistory(void); 32 void Insert(HBITMAP hbm); 33 void Crop(int nWidth, int nHeight, int nOffsetX = 0, int nOffsetY = 0); 34 void SaveImage(LPTSTR lpFileName); 35 BOOL IsImageSaved(); 36 BOOL HasUndoSteps(); 37 BOOL HasRedoSteps(); 38 void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX = 0, int nSkewDegY = 0); 39 int GetWidth(); 40 int GetHeight(); 41 void InvertColors(); 42 void Clear(COLORREF color = 0x00ffffff); 43 HDC GetDC(); 44 void FlipHorizontally(); 45 void FlipVertically(); 46 void RotateNTimes90Degrees(int iN); 47 }; 48