#include "Scintilla.h"\r
#include "SciLexer.h"\r
#include "registry.h"\r
+#include "SciEdit.h"\r
\r
+#include "GitBlameLogList.h"\r
+#include "Balloon.h"\r
\r
const COLORREF black = RGB(0,0,0);\r
const COLORREF white = RGB(0xff,0xff,0xff);\r
const COLORREF lightBlue = RGB(0xA6, 0xCA, 0xF0);\r
const int blockSize = 128 * 1024;\r
\r
-#define BLAMESPACE 20\r
+#define BLAMESPACE 5\r
#define HEADER_HEIGHT 18\r
-#define LOCATOR_WIDTH 20\r
+#define LOCATOR_WIDTH 10\r
\r
#define MAX_LOG_LENGTH 2000\r
\r
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))\r
#endif\r
\r
+class CSciEditBlame: public CSciEdit\r
+{\r
+ DECLARE_DYNAMIC(CSciEditBlame)\r
+public:\r
+ afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)\r
+ {\r
+ switch (nChar)\r
+ {\r
+ case (VK_ESCAPE):\r
+ {\r
+ if ((Call(SCI_AUTOCACTIVE)==0)&&(Call(SCI_CALLTIPACTIVE)==0))\r
+ {\r
+ ::SendMessage(::AfxGetApp()->GetMainWnd()->m_hWnd, WM_CLOSE, 0, 0);\r
+ return;\r
+ }\r
+ }\r
+ break;\r
+ }\r
+ CWnd::OnKeyDown(nChar, nRepCnt, nFlags);\r
+ }\r
+};\r
\r
class CTortoiseGitBlameView : public CView\r
{\r
\r
// Generated message map functions\r
protected:\r
+ BOOL PreTranslateMessage(MSG* pMsg);\r
+ afx_msg void OnEditFind();\r
+ afx_msg void OnEditGoto();\r
afx_msg void OnFilePrintPreview();\r
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);\r
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);\r
+ afx_msg int OnCreate(LPCREATESTRUCT lpcs);\r
+ afx_msg void OnSize(UINT nType, int cx, int cy);\r
+ afx_msg void OnSciPainted(NMHDR*, LRESULT*);\r
+ afx_msg void OnLButtonDown(UINT nFlags,CPoint point);\r
+ afx_msg void OnRButtonDown(UINT nFlags,CPoint point){OnLButtonDown(nFlags,point);CView::OnRButtonDown(nFlags,point);};\r
+ afx_msg void OnSciGetBkColor(NMHDR*, LRESULT*);\r
+ afx_msg void OnMouseHover(UINT nFlags, CPoint point);\r
+ afx_msg void OnMouseMove(UINT nFlags, CPoint point);\r
+ afx_msg LRESULT OnFindDialogMessage(WPARAM wParam, LPARAM lParam);\r
+ afx_msg void OnViewNext();\r
+ afx_msg void OnViewPrev();\r
+ \r
+ int FindNextLine(CString commithash, bool bUpOrDown=false);\r
+ int FindFirstLine(CString commithash, int line)\r
+ {\r
+ while(line>=0)\r
+ {\r
+ if( m_CommitHash[line] != commithash )\r
+ {\r
+ return line++;\r
+ }\r
+ line--;\r
+ }\r
+ return line;\r
+ }\r
+\r
DECLARE_MESSAGE_MAP()\r
\r
+ static UINT m_FindDialogMessage;\r
public:\r
+\r
+ void UpdateInfo();\r
+ void FocusOn(GitRev *pRev);\r
+\r
+ CSciEditBlame m_TextView;\r
+ CBalloon m_ToolTip;\r
+\r
HINSTANCE hInstance;\r
HINSTANCE hResource;\r
HWND currentDialog;\r
HWND wMain;\r
- HWND wEditor;\r
+ HWND m_wEditor;\r
HWND wBlame;\r
HWND wHeader;\r
HWND wLocator;\r
BOOL bIgnoreSpaces;\r
BOOL bIgnoreAllSpaces;\r
\r
+ BOOL m_bShowAuthor;\r
+ BOOL m_bShowDate;\r
+\r
+\r
LRESULT SendEditor(UINT Msg, WPARAM wParam=0, LPARAM lParam=0);\r
\r
void GetRange(int start, int end, char *text);\r
void Command(int id);\r
void Notify(SCNotification *notification);\r
\r
- void SetAStyle(int style, COLORREF fore, COLORREF back=::GetSysColor(COLOR_WINDOW), int size=-1, const char *face=0);\r
+ void SetAStyle(int style, COLORREF fore, COLORREF back=::GetSysColor(COLOR_WINDOW), int size=-1, CString *face=0);\r
+\r
void InitialiseEditor();\r
void InitSize();\r
LONG GetBlameWidth();\r
void BlamePreviousRevision();\r
void DiffPreviousRevision();\r
void ShowLog();\r
- bool DoSearch(LPSTR what, DWORD flags);\r
+ bool DoSearch(CString what, DWORD flags);\r
bool GotoLine(long line);\r
bool ScrollToLine(long line);\r
void GotoLineDlg();\r
void SetSelectedLine(LONG line) { m_SelectedLine=line;};\r
\r
LONG m_mouserev;\r
- CString m_mouseauthor;\r
+ LONG m_MouseLine;\r
LONG m_selectedrev;\r
LONG m_selectedorigrev;\r
- CString m_selectedauthor;\r
- CString m_selecteddate;\r
+ CString m_SelectedHash;\r
+ CString m_selecteddate;\r
static long m_gotoline;\r
long m_lowestrev;\r
long m_highestrev;\r
bool m_colorage;\r
\r
- std::vector<bool> mergelines;\r
- std::vector<LONG> revs;\r
- std::vector<LONG> origrevs;\r
- std::vector<CString> dates;\r
- std::vector<CString> authors;\r
- std::vector<CString> paths;\r
- std::map<LONG, CString> logmessages;\r
+// std::vector<bool> m_Mergelines;\r
+ std::vector<LONG> m_ID;\r
+ std::vector<LONG> m_LineNum;\r
+// std::vector<LONG> m_Origrevs;\r
+ std::vector<CString> m_Dates;\r
+ std::vector<CString> m_Authors;\r
+ std::vector<CString> m_CommitHash;\r
+\r
+ std::map<CString,GitRev> m_NoListCommit;\r
+\r
+// std::vector<CString> m_Paths;\r
+// std::map<LONG, CString> logmessages;\r
char m_szTip[MAX_LOG_LENGTH*2+6];\r
wchar_t m_wszTip[MAX_LOG_LENGTH*2+6];\r
void StringExpand(LPSTR str);\r
void StringExpand(LPWSTR str);\r
BOOL ttVisible;\r
+\r
+ CLogDataVector * GetLogData();\r
+\r
+ BOOL m_bShowLine;\r
+\r
protected:\r
void CreateFont();\r
- void SetupLexer(LPCSTR filename);\r
+ void SetupLexer(CString filename);\r
void SetupCppLexer();\r
COLORREF InterColor(COLORREF c1, COLORREF c2, int Slider);\r
CString GetAppDirectory();\r
CRegStdWORD m_regOldLinesColor;\r
CRegStdWORD m_regNewLinesColor;\r
\r
+ CGitBlameLogList * GetLogList();\r
+\r
+ CFindReplaceDialog *m_pFindDialog;\r
+\r
+ DWORD m_DateFormat; // DATE_SHORTDATE or DATE_LONGDATE\r
};\r
\r
#ifndef _DEBUG // debug version in TortoiseGitBlameView.cpp\r