1 /////////////////////////////////////////////////////////////////////////////
2 // WinMerge: an interactive diff/merge utility
3 // Copyright (C) 1997 Dean P. Grimm
4 // SPDX-License-Identifier: GPL-2.0-or-later
5 /////////////////////////////////////////////////////////////////////////////
9 * @brief Declaration of CHexMergeView class
13 #include "DiffFileInfo.h"
14 #include "IMergeDoc.h"
17 class IHexEditorWindow;
20 * @brief Document class for bytewise merging two files presented as hexdumps
22 class CHexMergeView : public CView
26 IHexEditorWindow *m_pif;
29 DiffFileInfo m_fileInfo;
30 protected: // create from serialization only
32 DECLARE_DYNCREATE(CHexMergeView)
33 std::vector<int> m_unpackerSubcodes;
35 HRESULT LoadFile(LPCTSTR);
36 HRESULT SaveFile(LPCTSTR, bool packing = true);
37 IHexEditorWindow *GetInterface() const { return m_pif; }
42 void ClearUndoRecords();
44 void SetReadOnly(bool);
46 IMergeDoc::FileChange IsFileChangedOnDisk(LPCTSTR);
47 void ZoomText(int amount);
48 static void CopySel(const CHexMergeView *src, CHexMergeView *dst);
49 static void CopyAll(const CHexMergeView *src, CHexMergeView *dst);
50 static bool IsLoadable();
53 virtual void OnDraw(CDC*);
54 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
55 virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
56 virtual BOOL PreTranslateMessage(MSG *);
57 // ClassWizard generated virtual function overrides
58 //{{AFX_VIRTUAL(CHexMergeView)
64 // Implementation data
66 // Generated message map functions
68 //{{AFX_MSG(CHexMergeView)
69 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
70 afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar);
71 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar);
72 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
73 afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
74 afx_msg void OnEditFind();
75 afx_msg void OnEditReplace();
76 afx_msg void OnEditRepeat();
77 afx_msg void OnEditUndo();
78 afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
79 afx_msg void OnEditRedo();
80 afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
81 afx_msg void OnEditCut();
82 afx_msg void OnEditCopy();
83 afx_msg void OnEditPaste();
84 afx_msg void OnEditClear();
85 afx_msg void OnEditSelectAll();
86 afx_msg void OnFirstdiff();
87 afx_msg void OnLastdiff();
88 afx_msg void OnNextdiff();
89 afx_msg void OnPrevdiff();
90 afx_msg void OnHelp();