OSDN Git Service

Merge branch 'master' of https://github.com/winmerge/winmerge into jp
[winmerge-jp/winmerge-jp.git] / Src / LocationView.h
index dca0ae8..9f948c3 100644 (file)
@@ -12,22 +12,18 @@ class CMergeDoc;
 class CMergeEditView;
 
 /**
- * @brief Status for display moved block
- */
-enum DISPLAY_MOVED_BLOCKS
-{
-       DISPLAY_MOVED_NONE = 0,
-       DISPLAY_MOVED_ALL,
-       DISPLAY_MOVED_FOLLOW_DIFF,
-};
-
-/**
  * @brief Endpoints of line connecting moved blocks
  */
 struct MovedLine
 {
-       CPoint ptLeft;
-       CPoint ptRight;
+       int apparent0;
+       int apparent1;
+       int blockHeight;
+       CPoint ptLeftUpper;
+       CPoint ptLeftLower;
+       CPoint ptRightUpper;
+       CPoint ptRightLower;
+       bool currentDiff;
 };
 
 typedef CList<MovedLine, MovedLine&> MOVEDLINE_LIST;
@@ -64,7 +60,7 @@ public:
        CLocationView();
        ~CLocationView();
        DECLARE_DYNCREATE(CLocationView)
-       void SetConnectMovedBlocks(int displayMovedBlocks);
+       void SetConnectMovedBlocks(bool displayMovedBlocks);
        void UpdateVisiblePos(int nTopLine = -1, int nBottomLine = -1);
        void SetFrameHwnd(HWND hwndFrame);
        void ForceRecalculate();
@@ -81,9 +77,9 @@ protected:
 
 protected:
        CMergeDoc* GetDocument();
-       void DrawRect(CDC* pDC, const CRect& r, COLORREF cr, BOOL bSelected = FALSE);
-       bool GotoLocation(const CPoint& point, bool bRealLine = true);
-       int GetLineFromYPos(int nYCoord, int bar, BOOL bRealLine = TRUE);
+       void DrawRect(CDC* pDC, const CRect& r, COLORREF cr, bool bSelected = false);
+       bool GotoLocation(const CPoint& point, bool bRealLine = true, bool bMoveAnchor = true);
+       int GetLineFromYPos(int nYCoord, int bar, bool bRealLine = true);
        int IsInsideBar(const CRect& rc, const POINT& pt);
        void DrawVisibleAreaRect(CDC* pDC, int nTopLine = -1, int nBottomLine = -1);
        void DrawConnectLines(CDC* pDC);
@@ -92,11 +88,11 @@ protected:
        void CalculateBlocks();
        void CalculateBlocksPixel(int nBlockStart, int nBlockEnd, int nBlockLength,
                        int &nBeginY, int &nEndY);
+       COLORREF GetBackgroundColor();
        void DrawBackground(CDC* pDC);
 
 private:
-       CMergeEditView* m_view[3]; //*< Table for view pointers */
-       int m_displayMovedBlocks; //*< Setting for displaying moved blocks */
+       bool m_displayMovedBlocks; //*< Setting for displaying moved blocks */
        double m_pixInLines; //*< How many pixels is one line in bars */
        double m_lineInPix; //*< How many lines is one pixel?
        CRect m_bar[3]; //*< Left/middle/riggt bar */
@@ -108,7 +104,7 @@ private:
        std::unique_ptr<CBitmap> m_pSavedBackgroundBitmap; //*< Saved background */
        bool m_bDrawn; //*< Is already drawn in location pane? */
        std::vector<DiffBlock> m_diffBlocks; //*< List of pre-calculated diff blocks.
-       BOOL m_bRecalculateBlocks; //*< Recalculate diff blocks in next repaint.
+       bool m_bRecalculateBlocks; //*< Recalculate diff blocks in next repaint.
        CSize m_currentSize; //*< Current size of the panel.
 
        // Generated message map functions
@@ -117,17 +113,14 @@ protected:
        afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
        afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
        afx_msg void OnMouseMove(UINT nFlags, CPoint point);
+       afx_msg int  OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
+       afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
        afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
        afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
        afx_msg void OnClose();
        afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar * pScrollBar);
        afx_msg void OnSize(UINT nType, int cx, int cy);
        afx_msg BOOL OnEraseBkgnd(CDC* pDC);
-       afx_msg void OnSetFocus(CWnd* pOldWnd);
-       afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateFileSaveLeft(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateFileSaveMiddle(CCmdUI* pCmdUI);
-       afx_msg void OnUpdateFileSaveRight(CCmdUI* pCmdUI);
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 };
@@ -136,3 +129,12 @@ protected:
 inline CMergeDoc* CLocationView::GetDocument()
    { return reinterpret_cast<CMergeDoc*>(m_pDocument); }
 #endif
+
+/** 
+ * @brief Stores HWND of frame window (CMergeEditFrame).
+ */
+inline void CLocationView::SetFrameHwnd(HWND hwndFrame)
+{
+       m_hwndFrame = hwndFrame;
+}
+