X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;ds=sidebyside;f=Src%2FImgMergeFrm.h;h=fa718fa032af00a3edb6a79e2d9241dca08a01a6;hb=5ba83f07ae744cd249a0b9f4c4b385d693ac3cd6;hp=b0ea500563ae8218097fcfd96d479eb2c0dba6c0;hpb=9c16ef83b2fadfe258d6de03322075d6d4acf423;p=winmerge-jp%2Fwinmerge-jp.git diff --git a/Src/ImgMergeFrm.h b/Src/ImgMergeFrm.h index b0ea50056..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 @@ -33,6 +19,7 @@ #include "LocationBar.h" #include "FileLocation.h" #include "MergeFrameCommon.h" +#include "FileTransform.h" class CDirDoc; @@ -42,12 +29,12 @@ class CDirDoc; 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; @@ -62,6 +49,7 @@ public: 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); + CDirDoc* GetDirDoc() const override { return m_pDirDoc; }; void SetDirDoc(CDirDoc * pDirDoc) override; void UpdateResources(); bool CloseNow() override; @@ -70,6 +58,12 @@ public: void UpdateAutoPaneResize(); void UpdateSplitter(); 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; IMergeDoc::FileChange IsFileChangedOnDisk(int pane) const; @@ -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 *); @@ -101,20 +94,23 @@ private: 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); + static void TranslateLocationPane(int id, const wchar_t *org, size_t dstbufsize, wchar_t *dst); CLocationBar m_wndLocationBar; IImgMergeWindow *m_pImgMergeWindow; IImgToolWindow *m_pImgToolWindow; @@ -126,11 +122,14 @@ private: 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 OnClose(); + afx_msg void OnDestroy(); afx_msg void OnFileSave(); afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI); afx_msg void OnFileSaveLeft(); @@ -149,8 +148,9 @@ private: afx_msg void OnUpdateRightReadOnly(CCmdUI* pCmdUI); afx_msg void OnFileReload(); afx_msg void OnFileClose(); - afx_msg void OnFileRecompareAs(UINT nId); + 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(); @@ -160,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(); @@ -216,10 +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() };