3 #include "HintListCtrl.h"
\r
5 #include "CommonResource.h"
\r
7 #include "ProjectProperties.h"
\r
8 #include "TGitPath.h"
\r
9 #include "registry.h"
\r
10 #include "SplitterControl.h"
\r
12 #include "MenuButton.h"
\r
13 #include "LogDlgHelper.h"
\r
14 #include "FilterEdit.h"
\r
16 #include "Tooltip.h"
\r
17 #include "HintListCtrl.h"
\r
18 //#include "GitLogList.h"
\r
20 #include "GitLogCache.h"
\r
23 #if (NTDDI_VERSION < NTDDI_LONGHORN)
\r
25 enum LISTITEMSTATES_MINE {
\r
30 LISS_SELECTEDNOTFOCUS = 5,
\r
31 LISS_HOTSELECTED = 6,
\r
34 #define MCS_NOTRAILINGDATES 0x0040
\r
35 #define MCS_SHORTDAYSOFWEEK 0x0080
\r
36 #define MCS_NOSELCHANGEONNAV 0x0100
\r
38 #define DTM_SETMCSTYLE (DTM_FIRST + 11)
\r
42 #define ICONITEMBORDER 5
\r
44 #define GITLOG_START 0
\r
45 #define GITLOG_START_ALL 1
\r
46 #define GITLOG_END 100
\r
48 #define LOGFILTER_ALL 1
\r
49 #define LOGFILTER_MESSAGES 2
\r
50 #define LOGFILTER_PATHS 3
\r
51 #define LOGFILTER_AUTHORS 4
\r
52 #define LOGFILTER_REVS 5
\r
53 #define LOGFILTER_REGEX 6
\r
54 #define LOGFILTER_BUGID 7
\r
56 //typedef void CALLBACK_PROCESS(void * data, int progress);
\r
57 #define MSG_LOADED (WM_USER+110)
\r
58 #define MSG_LOAD_PERCENTAGE (WM_USER+111)
\r
60 class CGitLogListBase : public CHintListCtrl
\r
62 DECLARE_DYNAMIC(CGitLogListBase)
\r
66 virtual ~CGitLogListBase();
\r
67 volatile LONG m_bNoDispUpdates;
\r
68 BOOL m_IsIDReplaceAction;
\r
70 BOOL m_IsRebaseReplaceGraph;
\r
73 BOOL m_bStrictStopped;
\r
74 BOOL m_bShowBugtraqColumn;
\r
75 BOOL m_bSearchIndex;
\r
77 unsigned __int64 m_ContextMenuMask;
\r
81 volatile LONG m_bThreadRunning;
\r
82 CLogCache m_LogCache;
\r
92 LOGLIST_MESSAGE_MAX=300,
\r
93 LOGLIST_MESSAGE_MIN=200
\r
98 // needs to start with 1, since 0 is the return value if *nothing* is clicked on in the context menu
\r
128 ID_COMPAREWITHPREVIOUS,
\r
129 ID_BLAMEWITHPREVIOUS,
\r
142 inline unsigned __int64 GetContextMenuBit(int i){ return ((unsigned __int64 )0x1)<<i ;}
\r
143 void InsertGitColumn();
\r
144 void ResizeAllListCtrlCols();
\r
145 void CopySelectionToClipBoard(bool hashonly=FALSE);
\r
146 void DiffSelectedRevWithPrevious();
\r
147 bool IsSelectionContinuous();
\r
148 int FillGitShortLog();
\r
149 int FillGitLog(CTGitPath *path,int infomask=CGit:: LOG_INFO_STAT| CGit::LOG_INFO_FILESTATE,CString *from=NULL,CString *to=NULL);
\r
151 inline int ShownCountWithStopped() const { return (int)m_arShownList.GetCount() + (m_bStrictStopped ? 1 : 0); }
\r
152 int FetchLogAsync(void * data=NULL);
\r
153 CPtrArray m_arShownList;
\r
155 void RecalculateShownList(CPtrArray * pShownlist);
\r
158 int m_nSelectedFilter;
\r
159 CLogDataVector m_logEntries;
\r
160 void RemoveFilter();
\r
161 void StartFilter();
\r
162 bool ValidateRegexp(LPCTSTR regexp_str, tr1::wregex& pat, bool bMatchCase = false );
\r
163 CString m_sFilterText;
\r
170 void GetTimeRange(CTime &oldest,CTime &latest);
\r
171 virtual void ContextMenuAction(int cmd,int FirstSelect, int LastSelect)=0;
\r
172 void ReloadHashMap()
\r
175 g_Git.GetMapHashToFriendName(m_HashMap);
\r
176 m_CurrentBranch=g_Git.GetCurrentBranch();
\r
178 void TerminateThread()
\r
180 if(this->m_LoadingThread)
\r
181 AfxTermThread((HINSTANCE)m_LoadingThread->m_hThread);
\r
184 bool IsInWorkingThread()
\r
186 return (AfxGetThread() == m_LoadingThread);
\r
189 volatile bool m_bExitThread;
\r
190 CWinThread* m_LoadingThread;
\r
192 DECLARE_MESSAGE_MAP()
\r
193 afx_msg void OnDestroy();
\r
194 afx_msg void OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult);
\r
195 afx_msg void OnLvnGetdispinfoLoglist(NMHDR *pNMHDR, LRESULT *pResult);
\r
196 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
\r
197 afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
\r
198 afx_msg LRESULT OnLoad(WPARAM wParam, LPARAM lParam);
\r
199 void OnNMDblclkLoglist(NMHDR * /*pNMHDR*/, LRESULT *pResult);
\r
200 afx_msg void OnLvnOdfinditemLoglist(NMHDR *pNMHDR, LRESULT *pResult);
\r
201 void PreSubclassWindow();
\r
202 virtual BOOL PreTranslateMessage(MSG* pMsg);
\r
203 static UINT LogThreadEntry(LPVOID pVoid);
\r
205 void FetchFullLogInfoOrig();
\r
206 void FetchFullLogInfo();
\r
207 void FillBackGround(HDC hdc, int Index,CRect &rect);
\r
208 void DrawTagBranch(HDC,CRect &rect,INT_PTR index);
\r
209 void DrawGraph(HDC,CRect &rect,INT_PTR index);
\r
211 BOOL GetShortName(CString ref, CString &shortname,CString prefix);
\r
212 void paintGraphLane(HDC hdc,int laneHeight, int type, int x1, int x2,
\r
213 const COLORREF& col,int top) ;
\r
214 void DrawLine(HDC hdc, int x1, int y1, int x2, int y2){::MoveToEx(hdc,x1,y1,NULL);::LineTo(hdc,x2,y2);}
\r
216 * Save column widths to the registry
\r
218 void SaveColumnWidths(); // save col widths to the registry
\r
220 BOOL IsEntryInDateRange(int i);
\r
224 bool m_bFilterWithRegex;
\r
230 HICON m_hModifiedIcon;
\r
231 HICON m_hReplacedIcon;
\r
232 HICON m_hAddedIcon;
\r
233 HICON m_hDeletedIcon;
\r
237 CRegDWORD m_regMaxBugIDColWidth;
\r
238 int m_nSearchIndex;
\r
241 CStoreSelection* m_pStoreSelection;
\r
242 MAP_HASH_NAME m_HashMap;
\r
246 CString m_CurrentBranch;
\r
248 COLORREF m_LineColors[Lanes::COLORS_NUM];
\r
249 DWORD m_DateFormat; // DATE_SHORTDATE or DATE_LONGDATE
\r
250 bool m_bRelativeTimes; // Show relative times
\r