OSDN Git Service

Del RefLog work.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseBlame / TortoiseBlame.h
1 // TortoiseBlame - a Viewer for Subversion Blames\r
2 \r
3 // Copyright (C) 2003-2008 - TortoiseSVN\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 #pragma once\r
19 \r
20 #include "resource.h"\r
21 #include "Commdlg.h"\r
22 #include "Scintilla.h"\r
23 #include "SciLexer.h"\r
24 #include "registry.h"\r
25 \r
26 const COLORREF black = RGB(0,0,0);\r
27 const COLORREF white = RGB(0xff,0xff,0xff);\r
28 const COLORREF red = RGB(0xFF, 0, 0);\r
29 const COLORREF offWhite = RGB(0xFF, 0xFB, 0xF0);\r
30 const COLORREF darkGreen = RGB(0, 0x80, 0);\r
31 const COLORREF darkBlue = RGB(0, 0, 0x80);\r
32 const COLORREF lightBlue = RGB(0xA6, 0xCA, 0xF0);\r
33 const int blockSize = 128 * 1024;\r
34 \r
35 #define BLAMESPACE 20\r
36 #define HEADER_HEIGHT 18\r
37 #define LOCATOR_WIDTH 20\r
38 \r
39 #define MAX_LOG_LENGTH 2000\r
40 \r
41 \r
42 #ifndef GET_X_LPARAM\r
43 #define GET_X_LPARAM(lp)                        ((int)(short)LOWORD(lp))\r
44 #endif\r
45 #ifndef GET_Y_LPARAM\r
46 #define GET_Y_LPARAM(lp)                        ((int)(short)HIWORD(lp))\r
47 #endif\r
48 \r
49 /**\r
50  * \ingroup TortoiseBlame\r
51  * Main class for TortoiseBlame.\r
52  * Handles all child windows, loads the blame files, ...\r
53  */\r
54 class TortoiseBlame\r
55 {\r
56 public:\r
57         TortoiseBlame();\r
58         ~TortoiseBlame();\r
59 \r
60         HINSTANCE hInstance;\r
61         HINSTANCE hResource;\r
62         HWND currentDialog;\r
63         HWND wMain;\r
64         HWND wEditor;\r
65         HWND wBlame;\r
66         HWND wHeader;\r
67         HWND wLocator;\r
68         HWND hwndTT;\r
69 \r
70         BOOL bIgnoreEOL;\r
71         BOOL bIgnoreSpaces;\r
72         BOOL bIgnoreAllSpaces;\r
73 \r
74         LRESULT SendEditor(UINT Msg, WPARAM wParam=0, LPARAM lParam=0);\r
75 \r
76         void GetRange(int start, int end, char *text);\r
77 \r
78         void SetTitle();\r
79         BOOL OpenFile(const char *fileName);\r
80         BOOL OpenLogFile(const char *fileName);\r
81 \r
82         void Command(int id);\r
83         void Notify(SCNotification *notification);\r
84 \r
85         void SetAStyle(int style, COLORREF fore, COLORREF back=::GetSysColor(COLOR_WINDOW), int size=-1, const char *face=0);\r
86         void InitialiseEditor();\r
87     void InitSize();\r
88         LONG GetBlameWidth();\r
89         void DrawBlame(HDC hDC);\r
90         void DrawHeader(HDC hDC);\r
91         void DrawLocatorBar(HDC hDC);\r
92         void StartSearch();\r
93         void CopySelectedLogToClipboard();\r
94         void BlamePreviousRevision();\r
95         void DiffPreviousRevision();\r
96         void ShowLog();\r
97         bool DoSearch(LPSTR what, DWORD flags);\r
98         bool GotoLine(long line);\r
99         bool ScrollToLine(long line);\r
100         void GotoLineDlg();\r
101         static INT_PTR CALLBACK GotoDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);\r
102 \r
103         void SetSelectedLine(LONG line) { m_SelectedLine=line;};\r
104 \r
105         LONG                                            m_mouserev;\r
106         std::string                                     m_mouseauthor;\r
107         LONG                                            m_selectedrev;\r
108         LONG                                            m_selectedorigrev;\r
109         std::string                                     m_selectedauthor;\r
110         std::string                                     m_selecteddate;\r
111         static long                                     m_gotoline;\r
112         long                                            m_lowestrev;\r
113         long                                            m_highestrev;\r
114         bool                                            m_colorage;\r
115 \r
116         std::vector<bool>                       mergelines;\r
117         std::vector<LONG>                       revs;\r
118         std::vector<LONG>                       origrevs;\r
119         std::vector<std::string>        dates;\r
120         std::vector<std::string>        authors;\r
121         std::vector<std::string>        paths;\r
122         std::map<LONG, std::string>     logmessages;\r
123         char                                            m_szTip[MAX_LOG_LENGTH*2+6];\r
124         wchar_t                                         m_wszTip[MAX_LOG_LENGTH*2+6];\r
125         void StringExpand(LPSTR str);\r
126         void StringExpand(LPWSTR str);\r
127         BOOL                                            ttVisible;\r
128 protected:\r
129         void CreateFont();\r
130         void SetupLexer(LPCSTR filename);\r
131         void SetupCppLexer();\r
132         COLORREF InterColor(COLORREF c1, COLORREF c2, int Slider);\r
133         std::string GetAppDirectory();\r
134         std::vector<COLORREF>           colors;\r
135         HFONT                                           m_font;\r
136         HFONT                                           m_italicfont;\r
137         LONG                                            m_blamewidth;\r
138         LONG                                            m_revwidth;\r
139         LONG                                            m_datewidth;\r
140         LONG                                            m_authorwidth;\r
141         LONG                                            m_pathwidth;\r
142         LONG                                            m_linewidth;\r
143         LONG                                            m_SelectedLine; ///< zero-based\r
144 \r
145         COLORREF                                        m_mouserevcolor;\r
146         COLORREF                                        m_mouseauthorcolor;\r
147         COLORREF                                        m_selectedrevcolor;\r
148         COLORREF                                        m_selectedauthorcolor;\r
149         COLORREF                                        m_windowcolor;\r
150         COLORREF                                        m_textcolor;\r
151         COLORREF                                        m_texthighlightcolor;\r
152 \r
153         LRESULT                                         m_directFunction;\r
154         LRESULT                                         m_directPointer;\r
155         FINDREPLACE                                     fr;\r
156         TCHAR                                           szFindWhat[80];\r
157 \r
158         CRegStdWORD                                     m_regOldLinesColor;\r
159         CRegStdWORD                                     m_regNewLinesColor;\r
160 };\r