/////////////////////////////////////////////////////////////////////////////
// WinMerge: an interactive diff/merge utility
// Copyright (C) 1997 Dean P. Grimm
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
+// SPDX-License-Identifier: GPL-2.0-or-later
/////////////////////////////////////////////////////////////////////////////
/**
* @file ImgMergeFrm.h
#include "WinIMergeLib.h"
#include "LocationBar.h"
#include "FileLocation.h"
+#include "MergeFrameCommon.h"
+#include "FileTransform.h"
class CDirDoc;
/**
* @brief Frame class for file compare, handles panes, statusbar etc.
*/
-class CImgMergeFrame : public CMDIChildWnd, public IMergeDoc
+class CImgMergeFrame : public CMergeFrameCommon,public IMergeDoc
{
private:
- enum BUFFERTYPE
+ enum class BUFFERTYPE
{
- BUFFER_NORMAL = 0, /**< Normal, file loaded from disk */
- BUFFER_NORMAL_NAMED, /**< Normal, description given */
- BUFFER_UNNAMED, /**< Empty, created buffer */
- BUFFER_UNNAMED_SAVED, /**< Empty buffer saved with filename */
+ NORMAL = 0, /**< Normal, file loaded from disk */
+ NORMAL_NAMED, /**< Normal, description given */
+ UNNAMED, /**< Empty, created buffer */
+ UNNAMED_SAVED, /**< Empty buffer saved with filename */
};
using CMDIChildWnd::Create;
// Operations
public:
- bool OpenDocs(int nFiles, const FileLocation fileloc[], const bool bRO[], const String strDesc[], int nPane, CMDIFrameWnd *pParent);
+ bool OpenDocs(int nFiles, const FileLocation fileloc[], const bool bRO[], const String strDesc[], CMDIFrameWnd *pParent);
+ void MoveOnLoad(int nPane = -1, int nLineIndex = -1);
void ChangeFile(int pane, const String& path);
- void SetDirDoc(CDirDoc * pDirDoc);
+ CDirDoc* GetDirDoc() const override { return m_pDirDoc; };
+ void SetDirDoc(CDirDoc * pDirDoc) override;
void UpdateResources();
- bool CloseNow();
- void DirDocClosing(CDirDoc * pDirDoc) { m_pDirDoc = NULL; }
- void SetSharedMenu(HMENU hMenu) { m_hMenuShared = hMenu; };
- void SetLastCompareResult(int nResult);
+ bool CloseNow() override;
+ void DirDocClosing(CDirDoc * pDirDoc) override { m_pDirDoc = nullptr; }
void UpdateLastCompareResult();
void UpdateAutoPaneResize();
void UpdateSplitter();
- bool GenerateReport(const String& sFileName) const;
+ bool GenerateReport(const String& sFileName) const override;
+ const PackingInfo* GetUnpacker() const override { return &m_infoUnpacker; };
+ void SetUnpacker(const PackingInfo* infoUnpacker) override { if (infoUnpacker) m_infoUnpacker = *infoUnpacker; };
+ const PrediffingInfo* GetPrediffer() const override { return nullptr; };
+ int GetFileCount() const override { return m_filePaths.GetSize(); }
+ String GetPath(int pane) const override { return m_filePaths[pane]; }
+ bool GetReadOnly(int pane) const override { return m_bRO[pane]; }
void DoAutoMerge(int dstPane);
bool IsModified() const;
- bool IsFileChangedOnDisk(int pane) const;
- void CheckFileChanged(void);
+ IMergeDoc::FileChange IsFileChangedOnDisk(int pane) const;
+ void CheckFileChanged(void) override;
String GetDescription(int pane) const { return m_strDesc[pane]; }
static bool IsLoadable();
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CImgMergeFrame)
public:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
virtual BOOL DestroyWindow();
virtual BOOL PreTranslateMessage(MSG *);
void LoadOptions();
void SaveOptions();
void SavePosition();
+ void SaveActivePane();
virtual ~CImgMergeFrame();
void CreateImgWndStatusBar(CStatusBar &, CWnd *);
// Generated message map functions
private:
+ bool OpenImages();
int UpdateDiffItem(CDirDoc * pDirDoc);
void UpdateHeaderSizes();
void UpdateHeaderPath(int pane);
void SetTitle(LPCTSTR lpszTitle);
bool DoFileSave(int pane);
- bool DoFileSaveAs(int pane);
+ bool DoFileSaveAs(int pane, bool packing = true);
bool PromptAndSaveIfNeeded(bool bAllowCancel);
bool MergeModeKeyDown(MSG* pMsg);
static void OnChildPaneEvent(const IImgMergeWindow::Event& evt);
void OnDropFiles(int pane, const std::vector<String>& files);
- int m_nLastSplitPos[2];
- HICON m_hIdentical;
- HICON m_hDifferent;
+ static void TranslateLocationPane(int id, const wchar_t *org, size_t dstbufsize, wchar_t *dst);
CLocationBar m_wndLocationBar;
IImgMergeWindow *m_pImgMergeWindow;
IImgToolWindow *m_pImgToolWindow;
bool m_bRO[3];
bool m_bAutoMerged;
CDirDoc *m_pDirDoc;
+ int m_nActivePane;
+ PackingInfo m_infoUnpacker;
+ std::vector<int> m_unpackerSubcodes[3];
//{{AFX_MSG(CImgMergeFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);
- afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
afx_msg void OnClose();
+ afx_msg void OnDestroy();
afx_msg void OnFileSave();
afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
afx_msg void OnFileSaveLeft();
afx_msg void OnUpdateRightReadOnly(CCmdUI* pCmdUI);
afx_msg void OnFileReload();
afx_msg void OnFileClose();
- afx_msg void OnFileRecompare(UINT nId);
- afx_msg void OnUpdateFileRecompare(CCmdUI* pCmdUI);
+ afx_msg void OnFileRecompareAs(UINT nID);
+ afx_msg void OnUpdateFileRecompareAs(CCmdUI* pCmdUI);
+ afx_msg void OnOpenWithUnpacker();
afx_msg void OnWindowChangePane();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnIdleUpdateCmdUI();
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
afx_msg void OnEditRedo();
afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
+ afx_msg void OnEditCut();
+ afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
+ afx_msg void OnEditCopy();
+ afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
+ afx_msg void OnEditPaste();
+ afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
+ afx_msg void OnEditSelectAll();
afx_msg void OnViewZoomIn();
afx_msg void OnViewZoomOut();
afx_msg void OnViewZoomNormal();
afx_msg void OnUpdateImgDiffBlockSize(CCmdUI* pCmdUI);
afx_msg void OnImgThreshold(UINT nId);
afx_msg void OnUpdateImgThreshold(CCmdUI* pCmdUI);
+ afx_msg void OnImgInsertionDeletionDetectionMode(UINT nId);
+ afx_msg void OnUpdateImgInsertionDeletionDetectionMode(CCmdUI* pCmdUI);
afx_msg void OnImgPrevPage();
afx_msg void OnUpdateImgPrevPage(CCmdUI* pCmdUI);
afx_msg void OnImgNextPage();
afx_msg void OnImgCurPaneNextPage();
afx_msg void OnUpdateImgCurPaneNextPage(CCmdUI* pCmdUI);
afx_msg void OnImgUseBackColor();
+ afx_msg void OnImgVectorImageScaling(UINT nId);
+ afx_msg void OnUpdateImgVectorImageScaling(CCmdUI* pCmdUI);
afx_msg void OnUpdateImgUseBackColor(CCmdUI* pCmdUI);
+ afx_msg void OnImgCompareExtractedText();
afx_msg void OnToolsGenerateReport();
afx_msg void OnRefresh();
+ afx_msg void OnSetFocus(CWnd *pNewWnd);
+ afx_msg void OnHelp();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};