X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Src%2FImgMergeFrm.h;h=fa718fa032af00a3edb6a79e2d9241dca08a01a6;hb=5ba83f07ae744cd249a0b9f4c4b385d693ac3cd6;hp=73f503fa9769914b6d8af86ad6607c3905107a40;hpb=3159ca4b49d142a35901672a246f3cd70d098e14;p=winmerge-jp%2Fwinmerge-jp.git diff --git a/Src/ImgMergeFrm.h b/Src/ImgMergeFrm.h index 73f503fa9..fa718fa03 100644 --- a/Src/ImgMergeFrm.h +++ b/Src/ImgMergeFrm.h @@ -1,21 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // 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 @@ -32,21 +18,23 @@ #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; @@ -58,22 +46,28 @@ public: // 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(); @@ -86,7 +80,6 @@ public: // 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 *); @@ -97,27 +90,27 @@ public: // Implementation private: - BOOL EnsureValidDockState(CDockState& state); + bool EnsureValidDockState(CDockState& state); 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& 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; @@ -128,12 +121,15 @@ private: bool m_bRO[3]; bool m_bAutoMerged; CDirDoc *m_pDirDoc; + int m_nActivePane; + PackingInfo m_infoUnpacker; + std::vector 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(); @@ -152,7 +148,9 @@ private: afx_msg void OnUpdateRightReadOnly(CCmdUI* pCmdUI); afx_msg void OnFileReload(); afx_msg void OnFileClose(); - afx_msg void OnFileRecompareAsBinary(); + 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(); @@ -162,6 +160,13 @@ private: 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(); @@ -207,6 +212,8 @@ private: 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(); @@ -216,9 +223,14 @@ private: 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() };