OSDN Git Service

Use new method to update log So the user don't wait for log full log
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / GitLogList.h
1 #pragma once\r
2 \r
3 #include "HintListCtrl.h"\r
4 #include "XPTheme.h"\r
5 #include "resource.h"\r
6 #include "Git.h"\r
7 #include "ProjectProperties.h"\r
8 #include "StandAloneDlg.h"\r
9 #include "TGitPath.h"\r
10 #include "registry.h"\r
11 #include "SplitterControl.h"\r
12 #include "Colors.h"\r
13 #include "MenuButton.h"\r
14 #include "LogDlgHelper.h"\r
15 #include "FilterEdit.h"\r
16 #include "GitRev.h"\r
17 #include "Tooltip.h"\r
18 #include "HintListCtrl.h"\r
19 #include "GitLogList.h"\r
20 #include "lanes.h"\r
21 \r
22 #include <regex>\r
23 // CGitLogList\r
24 #if (NTDDI_VERSION < NTDDI_LONGHORN)\r
25 \r
26 enum LISTITEMSTATES_MINE {\r
27         LISS_NORMAL = 1,\r
28         LISS_HOT = 2,\r
29         LISS_SELECTED = 3,\r
30         LISS_DISABLED = 4,\r
31         LISS_SELECTEDNOTFOCUS = 5,\r
32         LISS_HOTSELECTED = 6,\r
33 };\r
34 \r
35 #define MCS_NOTRAILINGDATES  0x0040\r
36 #define MCS_SHORTDAYSOFWEEK  0x0080\r
37 #define MCS_NOSELCHANGEONNAV 0x0100\r
38 \r
39 #define DTM_SETMCSTYLE    (DTM_FIRST + 11)\r
40 \r
41 #endif\r
42 \r
43 #define ICONITEMBORDER 5\r
44 \r
45 #define GITLOG_START 0\r
46 #define GITLOG_START_ALL 1\r
47 #define GITLOG_END   100\r
48 \r
49 typedef void CALLBACK_PROCESS(void * data, int progress);\r
50 \r
51 class CGitLogList : public CHintListCtrl\r
52 {\r
53         DECLARE_DYNAMIC(CGitLogList)\r
54 \r
55 public:\r
56         CGitLogList();\r
57         virtual ~CGitLogList();\r
58         volatile LONG           m_bNoDispUpdates;\r
59         BOOL m_bStrictStopped;\r
60         BOOL m_bShowBugtraqColumn;\r
61         BOOL m_bSearchIndex;\r
62         BOOL m_bCancelled;\r
63         bool                            m_hasWC;\r
64         GitRev                          m_wcRev;\r
65         volatile LONG           m_bThreadRunning;\r
66 \r
67         enum\r
68         {\r
69                 LOGLIST_GRAPH,\r
70                 LOGLIST_ACTION,\r
71                 LOGLIST_MESSAGE,\r
72                 LOGLIST_AUTHOR,\r
73                 LOGLIST_DATE,\r
74                 LOGLIST_BUG,\r
75                 LOGLIST_MESSAGE_MAX=300,\r
76                 LOGLIST_MESSAGE_MIN=200\r
77         };\r
78 \r
79         enum \r
80         {\r
81         // needs to start with 1, since 0 is the return value if *nothing* is clicked on in the context menu\r
82         ID_COMPARE = 1,\r
83         ID_SAVEAS,\r
84         ID_COMPARETWO,\r
85         ID_UPDATE,\r
86         ID_COPY,\r
87         ID_REVERTREV,\r
88         ID_MERGEREV,\r
89         ID_GNUDIFF1,\r
90         ID_GNUDIFF2,\r
91         ID_FINDENTRY,\r
92         ID_OPEN,\r
93         ID_BLAME,\r
94         ID_REPOBROWSE,\r
95         ID_LOG,\r
96         ID_POPPROPS,\r
97         ID_EDITAUTHOR,\r
98         ID_EDITLOG,\r
99         ID_DIFF,\r
100         ID_OPENWITH,\r
101         ID_COPYCLIPBOARD,\r
102         ID_COPYHASH,\r
103         ID_CHECKOUT,\r
104         ID_REVERTTOREV,\r
105         ID_BLAMECOMPARE,\r
106         ID_BLAMETWO,\r
107         ID_BLAMEDIFF,\r
108         ID_VIEWREV,\r
109         ID_VIEWPATHREV,\r
110         ID_EXPORT,\r
111         ID_COMPAREWITHPREVIOUS,\r
112         ID_BLAMEWITHPREVIOUS,\r
113         ID_GETMERGELOGS,\r
114         ID_REVPROPS,\r
115         ID_CHERRY_PICK,\r
116         ID_CREATE_BRANCH,\r
117         ID_CREATE_TAG,\r
118         ID_SWITCHTOREV\r
119         };\r
120         void InsertGitColumn();\r
121         void ResizeAllListCtrlCols();\r
122         void CopySelectionToClipBoard(bool hashonly=FALSE);\r
123         void DiffSelectedRevWithPrevious();\r
124         bool IsSelectionContinuous();\r
125         int  FillGitShortLog();\r
126         inline int ShownCountWithStopped() const { return (int)m_arShownList.GetCount() + (m_bStrictStopped ? 1 : 0); }\r
127         int FetchLogAsync(CALLBACK_PROCESS *proc=NULL, void * data=NULL);\r
128         CPtrArray                       m_arShownList;\r
129 \r
130 protected:\r
131         DECLARE_MESSAGE_MAP()\r
132         afx_msg void OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult);\r
133         afx_msg void OnLvnGetdispinfoLoglist(NMHDR *pNMHDR, LRESULT *pResult);\r
134         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);\r
135         afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);\r
136         void OnNMDblclkLoglist(NMHDR * /*pNMHDR*/, LRESULT *pResult);\r
137         afx_msg void OnLvnOdfinditemLoglist(NMHDR *pNMHDR, LRESULT *pResult);\r
138         void PreSubclassWindow();\r
139         virtual BOOL PreTranslateMessage(MSG* pMsg);\r
140         static UINT LogThreadEntry(LPVOID pVoid);\r
141         UINT LogThread();\r
142         void FillBackGround(HDC hdc, int Index,CRect &rect);\r
143         void DrawTagBranch(HDC,CRect &rect,INT_PTR index);\r
144         void DrawGraph(HDC,CRect &rect,INT_PTR index);\r
145 \r
146         BOOL GetShortName(CString ref, CString &shortname,CString prefix);\r
147         void paintGraphLane(HDC hdc,int laneHeight, int type, int x1, int x2,\r
148                                       const COLORREF& col,int top) ; \r
149         void DrawLine(HDC hdc, int x1, int y1, int x2, int y2){::MoveToEx(hdc,x1,y1,NULL);::LineTo(hdc,x2,y2);}\r
150         \r
151         CXPTheme                        m_Theme;\r
152         BOOL                            m_bVista;\r
153         \r
154         HICON                           m_hModifiedIcon;\r
155         HICON                           m_hReplacedIcon;\r
156         HICON                           m_hAddedIcon;\r
157         HICON                           m_hDeletedIcon;\r
158 \r
159         HFONT                           m_boldFont;\r
160 \r
161         CRegDWORD                       m_regMaxBugIDColWidth;\r
162         int                                     m_nSearchIndex;\r
163         CLogDataVector          m_logEntries;\r
164         CALLBACK_PROCESS    *m_ProcCallBack;\r
165         void                            *m_ProcData;\r
166         CStoreSelection*        m_pStoreSelection;\r
167         MAP_HASH_NAME           m_HashMap;\r
168 };\r
169 \r
170 \r