Moved #include "git2.h" to stdafx.h
[TortoiseGit.git] / src / TortoiseShell / GITPropertyPage.h
blobaa23bdc3e4516e3c1d8ce5cc9ee0cff06b6ca5a4
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2006 - Stefan Kueng
4 // Copyright (C) 2008-2013 - TortoiseGit
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
21 #include "ShellUpdater.h"
23 #define ListView_GetItemTextEx(hwndLV, i, iSubItem_, __buf) \
24 { \
25 int nLen = 1024;\
26 int nRes;\
27 LV_ITEM _ms_lvi;\
28 _ms_lvi.iSubItem = iSubItem_;\
29 do\
31 nLen += 2;\
32 _ms_lvi.cchTextMax = nLen;\
33 if (__buf)\
34 delete[] __buf;\
35 __buf = new TCHAR[nLen];\
36 _ms_lvi.pszText = __buf;\
37 nRes = (int)::SendMessage((hwndLV), LVM_GETITEMTEXT, (WPARAM)(i), (LPARAM)(LV_ITEM *)&_ms_lvi);\
38 } while (nRes == nLen-1);\
40 #define GetDlgItemTextEx(hwndDlg, _id, __buf) \
42 int nLen = 1024;\
43 int nRes;\
44 do\
46 nLen *= 2;\
47 if (__buf)\
48 delete [] __buf;\
49 __buf = new TCHAR[nLen];\
50 nRes = GetDlgItemText(hwndDlg, _id, __buf, nLen);\
51 } while (nRes == nLen-1);\
54 /**
55 * \ingroup TortoiseShell
56 * Displays and updates all controls on the property page. The property
57 * page itself is shown by explorer.
59 class CGitPropertyPage
61 public:
62 CGitPropertyPage(const std::vector<stdstring> &filenames);
63 virtual ~CGitPropertyPage();
65 /**
66 * Sets the window handle.
67 * \param hwnd the handle.
69 virtual void SetHwnd(HWND hwnd);
70 /**
71 * Callback function which receives the window messages of the
72 * property page. See the Win32 API for PropertySheets for details.
74 virtual BOOL PageProc(HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
76 const static UINT m_UpdateLastCommit;
78 protected:
79 /**
80 * Initializes the property page.
82 virtual void InitWorkfileView();
83 void DisplayCommit(git_commit * commit, UINT hashLabel, UINT subjectLabel, UINT authorLabel, UINT dateLabel);
84 static void LogThreadEntry(void *param);
85 int LogThread();
86 void Time64ToTimeString(__time64_t time, TCHAR * buf, size_t buflen);
87 void PageProcOnCommand(WPARAM wParam);
88 void RunCommand(const tstring& command);
90 HWND m_hwnd;
91 std::vector<stdstring> filenames;
92 /**
93 * Were executable, assumeValid or skip-worktree flags changes
95 bool m_bChanged;