OSDN Git Service

add TortoiseBlame
authorFrank Li <lznuaa@gmail.com>
Wed, 7 Jan 2009 05:18:45 +0000 (13:18 +0800)
committerFrank Li <lznuaa@gmail.com>
Wed, 7 Jan 2009 05:18:45 +0000 (13:18 +0800)
14 files changed:
src/TortoiseBlame/Lexer.cpp [new file with mode: 0644]
src/TortoiseBlame/Lexer.h [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlame.cpp [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlame.h [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlame.ico [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlame.rc [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlame.rc2 [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlame.vcproj [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlame.vcproj.FSL.B20596.user [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlameLang.vcproj [new file with mode: 0644]
src/TortoiseBlame/TortoiseBlameLang.vcproj.FSL.B20596.user [new file with mode: 0644]
src/TortoiseBlame/resource.h [new file with mode: 0644]
src/TortoiseBlame/stdafx.cpp [new file with mode: 0644]
src/TortoiseBlame/stdafx.h [new file with mode: 0644]

diff --git a/src/TortoiseBlame/Lexer.cpp b/src/TortoiseBlame/Lexer.cpp
new file mode 100644 (file)
index 0000000..cf8d238
--- /dev/null
@@ -0,0 +1,432 @@
+// TortoiseBlame - a Viewer for Subversion Blames\r
+\r
+// Copyright (C) 2003-2008 - TortoiseSVN\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+#include "stdafx.h"\r
+\r
+// disable "dead code eleminated" warning\r
+#pragma warning(disable:4505)\r
+\r
+#include "TortoiseBlame.h"\r
+\r
+void TortoiseBlame::SetupLexer(LPCSTR filename)\r
+{\r
+       char line[20];\r
+       const char * lineptr = _tcsrchr(filename, '.');\r
+\r
+       if (lineptr)\r
+       {\r
+               _tcscpy_s(line, 20, lineptr+1);\r
+               _tcslwr_s(line, 20);\r
+               if ((_tcscmp(line, _T("py"))==0)||\r
+                       (_tcscmp(line, _T("pyw"))==0)||\r
+                       (_tcscmp(line, _T("pyw"))==0))\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_PYTHON);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("and assert break class continue def del elif \\r
+else except exec finally for from global if import in is lambda None \\r
+not or pass print raise return try while yield"));\r
+                       SetAStyle(SCE_P_DEFAULT, black);\r
+                       SetAStyle(SCE_P_COMMENTLINE, darkGreen);\r
+                       SetAStyle(SCE_P_NUMBER, RGB(0, 0x80, 0x80));\r
+                       SetAStyle(SCE_P_STRING, RGB(0, 0, 0x80));\r
+                       SetAStyle(SCE_P_CHARACTER, RGB(0, 0, 0x80));\r
+                       SetAStyle(SCE_P_WORD, RGB(0x80, 0, 0x80));\r
+                       SetAStyle(SCE_P_TRIPLE, black);\r
+                       SetAStyle(SCE_P_TRIPLEDOUBLE, black);\r
+                       SetAStyle(SCE_P_CLASSNAME, darkBlue);\r
+                       SetAStyle(SCE_P_DEFNAME, darkBlue);\r
+                       SetAStyle(SCE_P_OPERATOR, darkBlue);\r
+                       SetAStyle(SCE_P_IDENTIFIER, darkBlue);\r
+                       SetAStyle(SCE_P_COMMENTBLOCK, darkGreen);\r
+                       SetAStyle(SCE_P_STRINGEOL, red);\r
+               }\r
+               if ((_tcscmp(line, _T("c"))==0)||\r
+                       (_tcscmp(line, _T("cc"))==0)||\r
+                       (_tcscmp(line, _T("cpp"))==0)||\r
+                       (_tcscmp(line, _T("cxx"))==0)||\r
+                       (_tcscmp(line, _T("h"))==0)||\r
+                       (_tcscmp(line, _T("hh"))==0)||\r
+                       (_tcscmp(line, _T("hpp"))==0)||\r
+                       (_tcscmp(line, _T("hxx"))==0)||\r
+                       (_tcscmp(line, _T("dlg"))==0)||\r
+                       (_tcscmp(line, _T("mak"))==0))\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_CPP);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("and and_eq asm auto bitand bitor bool break \\r
+case catch char class compl const const_cast continue \\r
+default delete do double dynamic_cast else enum explicit export extern false float for \\r
+friend goto if inline int long mutable namespace new not not_eq \\r
+operator or or_eq private protected public \\r
+register reinterpret_cast return short signed sizeof static static_cast struct switch \\r
+template this throw true try typedef typeid typename union unsigned using \\r
+virtual void volatile wchar_t while xor xor_eq"));\r
+                       SendEditor(SCI_SETKEYWORDS, 3, (LPARAM)_T("a addindex addtogroup anchor arg attention \\r
+author b brief bug c class code date def defgroup deprecated dontinclude \\r
+e em endcode endhtmlonly endif endlatexonly endlink endverbatim enum example exception \\r
+f$ f[ f] file fn hideinitializer htmlinclude htmlonly \\r
+if image include ingroup internal invariant interface latexonly li line link \\r
+mainpage name namespace nosubgrouping note overload \\r
+p page par param post pre ref relates remarks return retval \\r
+sa section see showinitializer since skip skipline struct subsection \\r
+test throw todo typedef union until \\r
+var verbatim verbinclude version warning weakgroup $ @ \\ & < > # { }"));\r
+                       SetupCppLexer();\r
+               }\r
+               if (_tcscmp(line, _T("cs"))==0)\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_CPP);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("abstract as base bool break byte case catch char checked class \\r
+const continue decimal default delegate do double else enum \\r
+event explicit extern false finally fixed float for foreach goto if \\r
+implicit in int interface internal is lock long namespace new null \\r
+object operator out override params private protected public \\r
+readonly ref return sbyte sealed short sizeof stackalloc static \\r
+string struct switch this throw true try typeof uint ulong \\r
+unchecked unsafe ushort using virtual void while"));\r
+                       SetupCppLexer();\r
+               }\r
+               if ((_tcscmp(line, _T("rc"))==0)||\r
+                       (_tcscmp(line, _T("rc2"))==0))\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_CPP);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("ACCELERATORS ALT AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON \\r
+BEGIN BITMAP BLOCK BUTTON CAPTION CHARACTERISTICS CHECKBOX CLASS \\r
+COMBOBOX CONTROL CTEXT CURSOR DEFPUSHBUTTON DIALOG DIALOGEX DISCARDABLE \\r
+EDITTEXT END EXSTYLE FONT GROUPBOX ICON LANGUAGE LISTBOX LTEXT \\r
+MENU MENUEX MENUITEM MESSAGETABLE POPUP \\r
+PUSHBUTTON RADIOBUTTON RCDATA RTEXT SCROLLBAR SEPARATOR SHIFT STATE3 \\r
+STRINGTABLE STYLE TEXTINCLUDE VALUE VERSION VERSIONINFO VIRTKEY"));\r
+                       SetupCppLexer();\r
+               }\r
+               if ((_tcscmp(line, _T("idl"))==0)||\r
+                       (_tcscmp(line, _T("odl"))==0))\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_CPP);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("aggregatable allocate appobject arrays async async_uuid \\r
+auto_handle \\r
+bindable boolean broadcast byte byte_count \\r
+call_as callback char coclass code comm_status \\r
+const context_handle context_handle_noserialize \\r
+context_handle_serialize control cpp_quote custom \\r
+decode default defaultbind defaultcollelem \\r
+defaultvalue defaultvtable dispinterface displaybind dllname \\r
+double dual \\r
+enable_allocate encode endpoint entry enum error_status_t \\r
+explicit_handle \\r
+fault_status first_is float \\r
+handle_t heap helpcontext helpfile helpstring \\r
+helpstringcontext helpstringdll hidden hyper \\r
+id idempotent ignore iid_as iid_is immediatebind implicit_handle \\r
+import importlib in include in_line int __int64 __int3264 interface \\r
+last_is lcid length_is library licensed local long \\r
+max_is maybe message methods midl_pragma \\r
+midl_user_allocate midl_user_free min_is module ms_union \\r
+ncacn_at_dsp ncacn_dnet_nsp ncacn_http ncacn_ip_tcp \\r
+ncacn_nb_ipx ncacn_nb_nb ncacn_nb_tcp ncacn_np \\r
+ncacn_spx ncacn_vns_spp ncadg_ip_udp ncadg_ipx ncadg_mq \\r
+ncalrpc nocode nonbrowsable noncreatable nonextensible notify \\r
+object odl oleautomation optimize optional out out_of_line \\r
+pipe pointer_default pragma properties propget propput propputref \\r
+ptr public \\r
+range readonly ref represent_as requestedit restricted retval \\r
+shape short signed size_is small source strict_context_handle \\r
+string struct switch switch_is switch_type \\r
+transmit_as typedef \\r
+uidefault union unique unsigned user_marshal usesgetlasterror uuid \\r
+v1_enum vararg version void wchar_t wire_marshal"));\r
+                       SetupCppLexer();\r
+               }\r
+               if (_tcscmp(line, _T("java"))==0)\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_CPP);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("abstract assert boolean break byte case catch char class \\r
+const continue default do double else extends final finally float for future \\r
+generic goto if implements import inner instanceof int interface long \\r
+native new null outer package private protected public rest \\r
+return short static super switch synchronized this throw throws \\r
+transient try var void volatile while"));\r
+                       SetupCppLexer();\r
+               }\r
+               if (_tcscmp(line, _T("js"))==0)\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_CPP);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("abstract boolean break byte case catch char class \\r
+const continue debugger default delete do double else enum export extends \\r
+final finally float for function goto if implements import in instanceof \\r
+int interface long native new package private protected public \\r
+return short static super switch synchronized this throw throws \\r
+transient try typeof var void volatile while with"));\r
+                       SetupCppLexer();\r
+               }\r
+               if ((_tcscmp(line, _T("pas"))==0)||\r
+                       (_tcscmp(line, _T("dpr"))==0)||\r
+                       (_tcscmp(line, _T("pp"))==0))\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_PASCAL);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("and array as begin case class const constructor \\r
+destructor div do downto else end except file finally \\r
+for function goto if implementation in inherited \\r
+interface is mod not object of on or packed \\r
+procedure program property raise record repeat \\r
+set shl shr then threadvar to try type unit \\r
+until uses var while with xor"));\r
+                       SetupCppLexer();\r
+               }\r
+               if ((_tcscmp(line, _T("as"))==0)||\r
+                       (_tcscmp(line, _T("asc"))==0)||\r
+                       (_tcscmp(line, _T("jsfl"))==0))\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_CPP);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("add and break case catch class continue default delete do \\r
+dynamic else eq extends false finally for function ge get gt if implements import in \\r
+instanceof interface intrinsic le lt ne new not null or private public return \\r
+set static super switch this throw true try typeof undefined var void while with"));\r
+                       SendEditor(SCI_SETKEYWORDS, 1, (LPARAM)_T("Array Arguments Accessibility Boolean Button Camera Color \\r
+ContextMenu ContextMenuItem Date Error Function Key LoadVars LocalConnection Math \\r
+Microphone Mouse MovieClip MovieClipLoader NetConnection NetStream Number Object \\r
+PrintJob Selection SharedObject Sound Stage String StyleSheet System TextField \\r
+TextFormat TextSnapshot Video Void XML XMLNode XMLSocket \\r
+_accProps _focusrect _global _highquality _parent _quality _root _soundbuftime \\r
+arguments asfunction call capabilities chr clearInterval duplicateMovieClip \\r
+escape eval fscommand getProperty getTimer getURL getVersion gotoAndPlay gotoAndStop \\r
+ifFrameLoaded Infinity -Infinity int isFinite isNaN length loadMovie loadMovieNum \\r
+loadVariables loadVariablesNum maxscroll mbchr mblength mbord mbsubstring MMExecute \\r
+NaN newline nextFrame nextScene on onClipEvent onUpdate ord parseFloat parseInt play \\r
+prevFrame prevScene print printAsBitmap printAsBitmapNum printNum random removeMovieClip \\r
+scroll set setInterval setProperty startDrag stop stopAllSounds stopDrag substring \\r
+targetPath tellTarget toggleHighQuality trace unescape unloadMovie unLoadMovieNum updateAfterEvent"));\r
+                       SetupCppLexer();\r
+               }\r
+               if ((_tcscmp(line, _T("html"))==0)||\r
+                       (_tcscmp(line, _T("htm"))==0)||\r
+                       (_tcscmp(line, _T("shtml"))==0)||\r
+                       (_tcscmp(line, _T("htt"))==0)||\r
+                       (_tcscmp(line, _T("xml"))==0)||\r
+                       (_tcscmp(line, _T("asp"))==0)||\r
+                       (_tcscmp(line, _T("xsl"))==0)||\r
+                       (_tcscmp(line, _T("php"))==0)||\r
+                       (_tcscmp(line, _T("xhtml"))==0)||\r
+                       (_tcscmp(line, _T("phtml"))==0)||\r
+                       (_tcscmp(line, _T("cfm"))==0)||\r
+                       (_tcscmp(line, _T("tpl"))==0)||\r
+                       (_tcscmp(line, _T("dtd"))==0)||\r
+                       (_tcscmp(line, _T("hta"))==0)||\r
+                       (_tcscmp(line, _T("htd"))==0)||\r
+                       (_tcscmp(line, _T("wxs"))==0))\r
+               {\r
+                       SendEditor(SCI_SETLEXER, SCLEX_HTML);\r
+                       SendEditor(SCI_SETSTYLEBITS, 7);\r
+                       SendEditor(SCI_SETKEYWORDS, 0, (LPARAM)_T("a abbr acronym address applet area b base basefont \\r
+bdo big blockquote body br button caption center \\r
+cite code col colgroup dd del dfn dir div dl dt em \\r
+fieldset font form frame frameset h1 h2 h3 h4 h5 h6 \\r
+head hr html i iframe img input ins isindex kbd label \\r
+legend li link map menu meta noframes noscript \\r
+object ol optgroup option p param pre q s samp \\r
+script select small span strike strong style sub sup \\r
+table tbody td textarea tfoot th thead title tr tt u ul \\r
+var xml xmlns abbr accept-charset accept accesskey action align alink \\r
+alt archive axis background bgcolor border \\r
+cellpadding cellspacing char charoff charset checked cite \\r
+class classid clear codebase codetype color cols colspan \\r
+compact content coords \\r
+data datafld dataformatas datapagesize datasrc datetime \\r
+declare defer dir disabled enctype event \\r
+face for frame frameborder \\r
+headers height href hreflang hspace http-equiv \\r
+id ismap label lang language leftmargin link longdesc \\r
+marginwidth marginheight maxlength media method multiple \\r
+name nohref noresize noshade nowrap \\r
+object onblur onchange onclick ondblclick onfocus \\r
+onkeydown onkeypress onkeyup onload onmousedown \\r
+onmousemove onmouseover onmouseout onmouseup \\r
+onreset onselect onsubmit onunload \\r
+profile prompt readonly rel rev rows rowspan rules \\r
+scheme scope selected shape size span src standby start style \\r
+summary tabindex target text title topmargin type usemap \\r
+valign value valuetype version vlink vspace width \\r
+text password checkbox radio submit reset \\r
+file hidden image"));\r
+                       SendEditor(SCI_SETKEYWORDS, 1, (LPARAM)_T("assign audio block break catch choice clear disconnect else elseif \\r
+emphasis enumerate error exit field filled form goto grammar help \\r
+if initial link log menu meta noinput nomatch object option p paragraph \\r
+param phoneme prompt property prosody record reprompt return s say-as \\r
+script sentence subdialog submit throw transfer value var voice vxml"));\r
+                       SendEditor(SCI_SETKEYWORDS, 2, (LPARAM)_T("accept age alphabet anchor application base beep bridge category charset \\r
+classid cond connecttimeout content contour count dest destexpr dtmf dtmfterm \\r
+duration enctype event eventexpr expr expritem fetchtimeout finalsilence \\r
+gender http-equiv id level maxage maxstale maxtime message messageexpr \\r
+method mime modal mode name namelist next nextitem ph pitch range rate \\r
+scope size sizeexpr skiplist slot src srcexpr sub time timeexpr timeout \\r
+transferaudio type value variant version volume xml:lang"));\r
+                       SendEditor(SCI_SETKEYWORDS, 3, (LPARAM)_T("and assert break class continue def del elif \\r
+else except exec finally for from global if import in is lambda None \\r
+not or pass print raise return try while yield"));\r
+                       SendEditor(SCI_SETKEYWORDS, 4, (LPARAM)_T("and argv as argc break case cfunction class continue declare default do \\r
+die echo else elseif empty enddeclare endfor endforeach endif endswitch \\r
+endwhile e_all e_parse e_error e_warning eval exit extends false for \\r
+foreach function global http_cookie_vars http_get_vars http_post_vars \\r
+http_post_files http_env_vars http_server_vars if include include_once \\r
+list new not null old_function or parent php_os php_self php_version \\r
+print require require_once return static switch stdclass this true var \\r
+xor virtual while __file__ __line__ __sleep __wakeup"));\r
+\r
+                       SetAStyle(SCE_H_TAG, darkBlue);\r
+                       SetAStyle(SCE_H_TAGUNKNOWN, red);\r
+                       SetAStyle(SCE_H_ATTRIBUTE, darkBlue);\r
+                       SetAStyle(SCE_H_ATTRIBUTEUNKNOWN, red);\r
+                       SetAStyle(SCE_H_NUMBER, RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_H_DOUBLESTRING, RGB(0,0x80,0));\r
+                       SetAStyle(SCE_H_SINGLESTRING, RGB(0,0x80,0));\r
+                       SetAStyle(SCE_H_OTHER, RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_H_COMMENT, RGB(0x80,0x80,0));\r
+                       SetAStyle(SCE_H_ENTITY, RGB(0x80,0,0x80));\r
+\r
+                       SetAStyle(SCE_H_TAGEND, darkBlue);\r
+                       SetAStyle(SCE_H_XMLSTART, darkBlue);    // <?\r
+                       SetAStyle(SCE_H_QUESTION, darkBlue);    // <?\r
+                       SetAStyle(SCE_H_XMLEND, darkBlue);              // ?>\r
+                       SetAStyle(SCE_H_SCRIPT, darkBlue);              // <script\r
+                       SetAStyle(SCE_H_ASP, RGB(0x4F, 0x4F, 0), RGB(0xFF, 0xFF, 0));   // <% ... %>\r
+                       SetAStyle(SCE_H_ASPAT, RGB(0x4F, 0x4F, 0), RGB(0xFF, 0xFF, 0)); // <%@ ... %>\r
+\r
+                       SetAStyle(SCE_HB_DEFAULT, black);\r
+                       SetAStyle(SCE_HB_COMMENTLINE, darkGreen);\r
+                       SetAStyle(SCE_HB_NUMBER, RGB(0,0x80,0x80));\r
+                       SetAStyle(SCE_HB_WORD, darkBlue);\r
+                       SendEditor(SCI_STYLESETBOLD, SCE_HB_WORD, 1);\r
+                       SetAStyle(SCE_HB_STRING, RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_HB_IDENTIFIER, black);\r
+\r
+                       // This light blue is found in the windows system palette so is safe to use even in 256 colour modes.\r
+                       // Show the whole section of VBScript with light blue background\r
+                       for (int bstyle=SCE_HB_DEFAULT; bstyle<=SCE_HB_STRINGEOL; bstyle++) {\r
+                               SendEditor(SCI_STYLESETFONT, bstyle, \r
+                                       reinterpret_cast<LPARAM>("Lucida Console"));\r
+                               SendEditor(SCI_STYLESETBACK, bstyle, lightBlue);\r
+                               // This call extends the backround colour of the last style on the line to the edge of the window\r
+                               SendEditor(SCI_STYLESETEOLFILLED, bstyle, 1);\r
+                       }\r
+                       SendEditor(SCI_STYLESETBACK, SCE_HB_STRINGEOL, RGB(0x7F,0x7F,0xFF));\r
+                       SendEditor(SCI_STYLESETFONT, SCE_HB_COMMENTLINE, \r
+                               reinterpret_cast<LPARAM>("Lucida Console"));\r
+\r
+                       SetAStyle(SCE_HBA_DEFAULT, black);\r
+                       SetAStyle(SCE_HBA_COMMENTLINE, darkGreen);\r
+                       SetAStyle(SCE_HBA_NUMBER, RGB(0,0x80,0x80));\r
+                       SetAStyle(SCE_HBA_WORD, darkBlue);\r
+                       SendEditor(SCI_STYLESETBOLD, SCE_HBA_WORD, 1);\r
+                       SetAStyle(SCE_HBA_STRING, RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_HBA_IDENTIFIER, black);\r
+\r
+                       // Show the whole section of ASP VBScript with bright yellow background\r
+                       for (int bastyle=SCE_HBA_DEFAULT; bastyle<=SCE_HBA_STRINGEOL; bastyle++) {\r
+                               SendEditor(SCI_STYLESETFONT, bastyle, \r
+                                       reinterpret_cast<LPARAM>("Lucida Console"));\r
+                               SendEditor(SCI_STYLESETBACK, bastyle, RGB(0xFF, 0xFF, 0));\r
+                               // This call extends the backround colour of the last style on the line to the edge of the window\r
+                               SendEditor(SCI_STYLESETEOLFILLED, bastyle, 1);\r
+                       }\r
+                       SendEditor(SCI_STYLESETBACK, SCE_HBA_STRINGEOL, RGB(0xCF,0xCF,0x7F));\r
+                       SendEditor(SCI_STYLESETFONT, SCE_HBA_COMMENTLINE, \r
+                               reinterpret_cast<LPARAM>("Lucida Console"));\r
+\r
+                       // If there is no need to support embedded Javascript, the following code can be dropped.\r
+                       // Javascript will still be correctly processed but will be displayed in just the default style.\r
+\r
+                       SetAStyle(SCE_HJ_START, RGB(0x80,0x80,0));\r
+                       SetAStyle(SCE_HJ_DEFAULT, black);\r
+                       SetAStyle(SCE_HJ_COMMENT, darkGreen);\r
+                       SetAStyle(SCE_HJ_COMMENTLINE, darkGreen);\r
+                       SetAStyle(SCE_HJ_COMMENTDOC, darkGreen);\r
+                       SetAStyle(SCE_HJ_NUMBER, RGB(0,0x80,0x80));\r
+                       SetAStyle(SCE_HJ_WORD, black);\r
+                       SetAStyle(SCE_HJ_KEYWORD, darkBlue);\r
+                       SetAStyle(SCE_HJ_DOUBLESTRING, RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_HJ_SINGLESTRING, RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_HJ_SYMBOLS, black);\r
+\r
+                       SetAStyle(SCE_HJA_START, RGB(0x80,0x80,0));\r
+                       SetAStyle(SCE_HJA_DEFAULT, black);\r
+                       SetAStyle(SCE_HJA_COMMENT, darkGreen);\r
+                       SetAStyle(SCE_HJA_COMMENTLINE, darkGreen);\r
+                       SetAStyle(SCE_HJA_COMMENTDOC, darkGreen);\r
+                       SetAStyle(SCE_HJA_NUMBER, RGB(0,0x80,0x80));\r
+                       SetAStyle(SCE_HJA_WORD, black);\r
+                       SetAStyle(SCE_HJA_KEYWORD, darkBlue);\r
+                       SetAStyle(SCE_HJA_DOUBLESTRING, RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_HJA_SINGLESTRING, RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_HJA_SYMBOLS, black);\r
+\r
+                       SetAStyle(SCE_HPHP_DEFAULT, black);\r
+                       SetAStyle(SCE_HPHP_HSTRING,  RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_HPHP_SIMPLESTRING,  RGB(0x80,0,0x80));\r
+                       SetAStyle(SCE_HPHP_WORD, darkBlue);\r
+                       SetAStyle(SCE_HPHP_NUMBER, RGB(0,0x80,0x80));\r
+                       SetAStyle(SCE_HPHP_VARIABLE, red);\r
+                       SetAStyle(SCE_HPHP_HSTRING_VARIABLE, red);\r
+                       SetAStyle(SCE_HPHP_COMPLEX_VARIABLE, red);\r
+                       SetAStyle(SCE_HPHP_COMMENT, darkGreen);\r
+                       SetAStyle(SCE_HPHP_COMMENTLINE, darkGreen);\r
+                       SetAStyle(SCE_HPHP_OPERATOR, darkBlue);\r
+\r
+                       // Show the whole section of Javascript with off white background\r
+                       for (int jstyle=SCE_HJ_DEFAULT; jstyle<=SCE_HJ_SYMBOLS; jstyle++) {\r
+                               SendEditor(SCI_STYLESETFONT, jstyle, \r
+                                       reinterpret_cast<LPARAM>("Lucida Console"));\r
+                               SendEditor(SCI_STYLESETBACK, jstyle, offWhite);\r
+                               SendEditor(SCI_STYLESETEOLFILLED, jstyle, 1);\r
+                       }\r
+                       SendEditor(SCI_STYLESETBACK, SCE_HJ_STRINGEOL, RGB(0xDF, 0xDF, 0x7F));\r
+                       SendEditor(SCI_STYLESETEOLFILLED, SCE_HJ_STRINGEOL, 1);\r
+\r
+                       // Show the whole section of Javascript with brown background\r
+                       for (int jastyle=SCE_HJA_DEFAULT; jastyle<=SCE_HJA_SYMBOLS; jastyle++) {\r
+                               SendEditor(SCI_STYLESETFONT, jastyle, \r
+                                       reinterpret_cast<LPARAM>("Lucida Console"));\r
+                               SendEditor(SCI_STYLESETBACK, jastyle, RGB(0xDF, 0xDF, 0x7F));\r
+                               SendEditor(SCI_STYLESETEOLFILLED, jastyle, 1);\r
+                       }\r
+                       SendEditor(SCI_STYLESETBACK, SCE_HJA_STRINGEOL, RGB(0x0,0xAF,0x5F));\r
+                       SendEditor(SCI_STYLESETEOLFILLED, SCE_HJA_STRINGEOL, 1);\r
+               }\r
+       }\r
+       else\r
+       {\r
+               SendEditor(SCI_SETLEXER, SCLEX_CPP);\r
+               SetupCppLexer();\r
+       }\r
+       SendEditor(SCI_COLOURISE, 0, -1);\r
+}\r
+\r
+void TortoiseBlame::SetupCppLexer()\r
+{\r
+       SetAStyle(SCE_C_DEFAULT, RGB(0, 0, 0));\r
+       SetAStyle(SCE_C_COMMENT, RGB(0, 0x80, 0));\r
+       SetAStyle(SCE_C_COMMENTLINE, RGB(0, 0x80, 0));\r
+       SetAStyle(SCE_C_COMMENTDOC, RGB(0, 0x80, 0));\r
+       SetAStyle(SCE_C_COMMENTLINEDOC, RGB(0, 0x80, 0));\r
+       SetAStyle(SCE_C_COMMENTDOCKEYWORD, RGB(0, 0x80, 0));\r
+       SetAStyle(SCE_C_COMMENTDOCKEYWORDERROR, RGB(0, 0x80, 0));\r
+       SetAStyle(SCE_C_NUMBER, RGB(0, 0x80, 0x80));\r
+       SetAStyle(SCE_C_WORD, RGB(0, 0, 0x80));\r
+       SendEditor(SCE_C_WORD, 1);\r
+       SetAStyle(SCE_C_STRING, RGB(0x80, 0, 0x80));\r
+       SetAStyle(SCE_C_IDENTIFIER, RGB(0, 0, 0));\r
+       SetAStyle(SCE_C_PREPROCESSOR, RGB(0x80, 0, 0));\r
+       SetAStyle(SCE_C_OPERATOR, RGB(0x80, 0x80, 0));\r
+}\r
diff --git a/src/TortoiseBlame/Lexer.h b/src/TortoiseBlame/Lexer.h
new file mode 100644 (file)
index 0000000..8a0c91b
--- /dev/null
@@ -0,0 +1,25 @@
+// TortoiseBlame - a Viewer for Subversion Blames\r
+\r
+// Copyright (C) 2003-2006 - Stefan Kueng\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+#pragma once\r
+\r
+class BlameLexer\r
+{\r
+public:\r
+       BlameLexer(); {}\r
+\r
+};
\ No newline at end of file
diff --git a/src/TortoiseBlame/TortoiseBlame.cpp b/src/TortoiseBlame/TortoiseBlame.cpp
new file mode 100644 (file)
index 0000000..1144f8f
--- /dev/null
@@ -0,0 +1,1884 @@
+// TortoiseBlame - a Viewer for Subversion Blames\r
+\r
+// Copyright (C) 2003-2008 - TortoiseSVN\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+\r
+#include "stdafx.h"\r
+#include "CmdLineParser.h"\r
+#include "TortoiseBlame.h"\r
+#include "registry.h"\r
+#include "LangDll.h"\r
+\r
+#define MAX_LOADSTRING 1000\r
+\r
+#pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")\r
+\r
+#pragma warning(push)\r
+#pragma warning(disable:4127)          // conditional expression is constant\r
+\r
+// Global Variables:\r
+TCHAR szTitle[MAX_LOADSTRING];                                 // The title bar text\r
+TCHAR szWindowClass[MAX_LOADSTRING];                   // the main window class name\r
+TCHAR szViewtitle[MAX_PATH];\r
+TCHAR szOrigPath[MAX_PATH];\r
+TCHAR searchstringnotfound[MAX_LOADSTRING];\r
+\r
+const bool ShowDate = false;\r
+const bool ShowAuthor = true;\r
+const bool ShowLine = true;\r
+bool ShowPath = false;\r
+\r
+static TortoiseBlame app;\r
+long TortoiseBlame::m_gotoline = 0;\r
+\r
+TortoiseBlame::TortoiseBlame()\r
+{\r
+       hInstance = 0;\r
+       hResource = 0;\r
+       currentDialog = 0;\r
+       wMain = 0;\r
+       wEditor = 0;\r
+       wLocator = 0;\r
+\r
+       m_font = 0;\r
+       m_italicfont = 0;\r
+       m_blamewidth = 0;\r
+       m_revwidth = 0;\r
+       m_datewidth = 0;\r
+       m_authorwidth = 0;\r
+       m_pathwidth = 0;\r
+       m_linewidth = 0;\r
+\r
+       m_windowcolor = ::GetSysColor(COLOR_WINDOW);\r
+       m_textcolor = ::GetSysColor(COLOR_WINDOWTEXT);\r
+       m_texthighlightcolor = ::GetSysColor(COLOR_HIGHLIGHTTEXT);\r
+       m_mouserevcolor = InterColor(m_windowcolor, m_textcolor, 20);\r
+       m_mouseauthorcolor = InterColor(m_windowcolor, m_textcolor, 10);\r
+       m_selectedrevcolor = ::GetSysColor(COLOR_HIGHLIGHT);\r
+       m_selectedauthorcolor = InterColor(m_selectedrevcolor, m_texthighlightcolor, 35);\r
+       m_mouserev = -2;\r
+\r
+       m_selectedrev = -1;\r
+       m_selectedorigrev = -1;\r
+       m_SelectedLine = -1;\r
+       m_directPointer = 0;\r
+       m_directFunction = 0;\r
+\r
+       m_lowestrev = LONG_MAX;\r
+       m_highestrev = 0;\r
+       m_colorage = true;\r
+}\r
+\r
+TortoiseBlame::~TortoiseBlame()\r
+{\r
+       if (m_font)\r
+               DeleteObject(m_font);\r
+       if (m_italicfont)\r
+               DeleteObject(m_italicfont);\r
+}\r
+\r
+std::string TortoiseBlame::GetAppDirectory()\r
+{\r
+       std::string path;\r
+       DWORD len = 0;\r
+       DWORD bufferlen = MAX_PATH;             // MAX_PATH is not the limit here!\r
+       do \r
+       {\r
+               bufferlen += MAX_PATH;          // MAX_PATH is not the limit here!\r
+               TCHAR * pBuf = new TCHAR[bufferlen];\r
+               len = GetModuleFileName(NULL, pBuf, bufferlen); \r
+               path = std::string(pBuf, len);\r
+               delete [] pBuf;\r
+       } while(len == bufferlen);\r
+       path = path.substr(0, path.rfind('\\') + 1);\r
+\r
+       return path;\r
+}\r
+\r
+// Return a color which is interpolated between c1 and c2.\r
+// Slider controls the relative proportions as a percentage:\r
+// Slider = 0  represents pure c1\r
+// Slider = 50 represents equal mixture\r
+// Slider = 100        represents pure c2\r
+COLORREF TortoiseBlame::InterColor(COLORREF c1, COLORREF c2, int Slider)\r
+{\r
+       int r, g, b;\r
+       \r
+       // Limit Slider to 0..100% range\r
+       if (Slider < 0)\r
+               Slider = 0;\r
+       if (Slider > 100)\r
+               Slider = 100;\r
+       \r
+       // The color components have to be treated individually.\r
+       r = (GetRValue(c2) * Slider + GetRValue(c1) * (100 - Slider)) / 100;\r
+       g = (GetGValue(c2) * Slider + GetGValue(c1) * (100 - Slider)) / 100;\r
+       b = (GetBValue(c2) * Slider + GetBValue(c1) * (100 - Slider)) / 100;\r
+       \r
+       return RGB(r, g, b);\r
+}\r
+\r
+LRESULT TortoiseBlame::SendEditor(UINT Msg, WPARAM wParam, LPARAM lParam)\r
+{\r
+       if (m_directFunction)\r
+       {\r
+               return ((SciFnDirect) m_directFunction)(m_directPointer, Msg, wParam, lParam);\r
+       }\r
+       return ::SendMessage(wEditor, Msg, wParam, lParam);     \r
+}\r
+\r
+void TortoiseBlame::GetRange(int start, int end, char *text) \r
+{\r
+       TEXTRANGE tr;\r
+       tr.chrg.cpMin = start;\r
+       tr.chrg.cpMax = end;\r
+       tr.lpstrText = text;\r
+       SendMessage(wEditor, EM_GETTEXTRANGE, 0, reinterpret_cast<LPARAM>(&tr));\r
+}\r
+\r
+void TortoiseBlame::SetTitle() \r
+{\r
+       char title[MAX_PATH + 100];\r
+       strcpy_s(title, MAX_PATH + 100, szTitle);\r
+       strcat_s(title, MAX_PATH + 100, " - ");\r
+       strcat_s(title, MAX_PATH + 100, szViewtitle);\r
+       ::SetWindowText(wMain, title);\r
+}\r
+\r
+BOOL TortoiseBlame::OpenLogFile(const char *fileName)\r
+{\r
+       char logmsgbuf[10000+1];\r
+       FILE * File;\r
+       fopen_s(&File, fileName, "rb");\r
+       if (File == 0)\r
+       {\r
+               return FALSE;\r
+       }\r
+       LONG rev = 0;\r
+       std::string msg;\r
+       int slength = 0;\r
+       int reallength = 0;\r
+       size_t len = 0;\r
+       wchar_t wbuf[MAX_LOG_LENGTH+6];\r
+       for (;;)\r
+       {\r
+               len = fread(&rev, sizeof(LONG), 1, File);\r
+               if (len == 0)\r
+               {\r
+                       fclose(File);\r
+            InitSize();\r
+                       return TRUE;\r
+               }\r
+               len = fread(&slength, sizeof(int), 1, File);\r
+               if (len == 0)\r
+               {\r
+                       fclose(File);\r
+            InitSize();\r
+                       return FALSE;\r
+               }\r
+               if (slength > MAX_LOG_LENGTH)\r
+               {\r
+                       reallength = slength;\r
+                       slength = MAX_LOG_LENGTH;\r
+               }\r
+               else\r
+                       reallength = 0;\r
+               len = fread(logmsgbuf, sizeof(char), slength, File);\r
+               if (len < (size_t)slength)\r
+               {\r
+                       fclose(File);\r
+            InitSize();\r
+                       return FALSE;\r
+               }\r
+               msg = std::string(logmsgbuf, slength);\r
+               if (reallength)\r
+               {\r
+                       fseek(File, reallength-MAX_LOG_LENGTH, SEEK_CUR);\r
+                       msg = msg + _T("\n...");\r
+               }\r
+               int len2 = ::MultiByteToWideChar(CP_UTF8, NULL, msg.c_str(), min(msg.size(), MAX_LOG_LENGTH+5), wbuf, MAX_LOG_LENGTH+5);\r
+               wbuf[len2] = 0;\r
+               len2 = ::WideCharToMultiByte(CP_ACP, NULL, wbuf, len2, logmsgbuf, MAX_LOG_LENGTH+5, NULL, NULL);\r
+               logmsgbuf[len2] = 0;\r
+               msg = std::string(logmsgbuf);\r
+               logmessages[rev] = msg;\r
+       }\r
+}\r
+\r
+BOOL TortoiseBlame::OpenFile(const char *fileName) \r
+{\r
+       SendEditor(SCI_SETREADONLY, FALSE);\r
+       SendEditor(SCI_CLEARALL);\r
+       SendEditor(EM_EMPTYUNDOBUFFER);\r
+       SetTitle();\r
+       SendEditor(SCI_SETSAVEPOINT);\r
+       SendEditor(SCI_CANCEL);\r
+       SendEditor(SCI_SETUNDOCOLLECTION, 0);\r
+       ::ShowWindow(wEditor, SW_HIDE);\r
+       std::ifstream File;\r
+       File.open(fileName);\r
+       if (!File.good())\r
+       {\r
+               return FALSE;\r
+       }\r
+       char line[100*1024];\r
+       char * lineptr = NULL;\r
+       char * trimptr = NULL;\r
+       //ignore the first two lines, they're of no interest to us\r
+       File.getline(line, sizeof(line)/sizeof(char));\r
+       File.getline(line, sizeof(line)/sizeof(char));\r
+       m_lowestrev = LONG_MAX;\r
+       m_highestrev = 0;\r
+       bool bUTF8 = true;\r
+       do\r
+       {\r
+               File.getline(line, sizeof(line)/sizeof(TCHAR));\r
+               if (File.gcount()>139)\r
+               {\r
+                       mergelines.push_back((line[0] != ' '));\r
+                       lineptr = &line[9];\r
+                       long rev = _ttol(lineptr);\r
+                       revs.push_back(rev);\r
+                       m_lowestrev = min(m_lowestrev, rev);\r
+                       m_highestrev = max(m_highestrev, rev);\r
+                       lineptr += 7;\r
+                       rev = _ttol(lineptr);\r
+                       origrevs.push_back(rev);\r
+                       lineptr += 7;\r
+                       dates.push_back(std::string(lineptr, 30));\r
+                       lineptr += 31;\r
+                       // unfortunately, the 'path' entry can be longer than the 60 chars\r
+                       // we made the column. We therefore have to step through the path\r
+                       // string until we find a space\r
+                       trimptr = lineptr;\r
+                       do \r
+                       {\r
+                               // TODO: how can we deal with the situation where the path has\r
+                               // a space in it, but the space is after the 60 chars reserved\r
+                               // for it?\r
+                               // The only way to deal with that would be to use a custom\r
+                               // binary format for the blame file.\r
+                               trimptr++;\r
+                               trimptr = _tcschr(trimptr, ' ');\r
+                       } while ((trimptr)&&(trimptr+1 < lineptr+61));\r
+                       if (trimptr)\r
+                               *trimptr = 0;\r
+                       else\r
+                               trimptr = lineptr;\r
+                       paths.push_back(std::string(lineptr));\r
+                       if (trimptr+1 < lineptr+61)\r
+                               lineptr +=61;\r
+                       else\r
+                               lineptr = (trimptr+1);\r
+                       trimptr = lineptr+30;\r
+                       while ((*trimptr == ' ')&&(trimptr > lineptr))\r
+                               trimptr--;\r
+                       *(trimptr+1) = 0;\r
+                       authors.push_back(std::string(lineptr));\r
+                       lineptr += 31;\r
+                       // in case we find an UTF8 BOM at the beginning of the line, we remove it\r
+                       if (((unsigned char)lineptr[0] == 0xEF)&&((unsigned char)lineptr[1] == 0xBB)&&((unsigned char)lineptr[2] == 0xBF))\r
+                       {\r
+                               lineptr += 3;\r
+                       }\r
+                       if (((unsigned char)lineptr[0] == 0xBB)&&((unsigned char)lineptr[1] == 0xEF)&&((unsigned char)lineptr[2] == 0xBF))\r
+                       {\r
+                               lineptr += 3;\r
+                       }\r
+                       // check each line for illegal utf8 sequences. If one is found, we treat\r
+                       // the file as ASCII, otherwise we assume an UTF8 file.\r
+                       char * utf8CheckBuf = lineptr;\r
+                       while ((bUTF8)&&(*utf8CheckBuf))\r
+                       {\r
+                               if ((*utf8CheckBuf == 0xC0)||(*utf8CheckBuf == 0xC1)||(*utf8CheckBuf >= 0xF5))\r
+                               {\r
+                                       bUTF8 = false;\r
+                                       break;\r
+                               }\r
+                               if ((*utf8CheckBuf & 0xE0)==0xC0)\r
+                               {\r
+                                       utf8CheckBuf++;\r
+                                       if (*utf8CheckBuf == 0)\r
+                                               break;\r
+                                       if ((*utf8CheckBuf & 0xC0)!=0x80)\r
+                                       {\r
+                                               bUTF8 = false;\r
+                                               break;\r
+                                       }\r
+                               }\r
+                               if ((*utf8CheckBuf & 0xF0)==0xE0)\r
+                               {\r
+                                       utf8CheckBuf++;\r
+                                       if (*utf8CheckBuf == 0)\r
+                                               break;\r
+                                       if ((*utf8CheckBuf & 0xC0)!=0x80)\r
+                                       {\r
+                                               bUTF8 = false;\r
+                                               break;\r
+                                       }\r
+                                       utf8CheckBuf++;\r
+                                       if (*utf8CheckBuf == 0)\r
+                                               break;\r
+                                       if ((*utf8CheckBuf & 0xC0)!=0x80)\r
+                                       {\r
+                                               bUTF8 = false;\r
+                                               break;\r
+                                       }\r
+                               }\r
+                               if ((*utf8CheckBuf & 0xF8)==0xF0)\r
+                               {\r
+                                       utf8CheckBuf++;\r
+                                       if (*utf8CheckBuf == 0)\r
+                                               break;\r
+                                       if ((*utf8CheckBuf & 0xC0)!=0x80)\r
+                                       {\r
+                                               bUTF8 = false;\r
+                                               break;\r
+                                       }\r
+                                       utf8CheckBuf++;\r
+                                       if (*utf8CheckBuf == 0)\r
+                                               break;\r
+                                       if ((*utf8CheckBuf & 0xC0)!=0x80)\r
+                                       {\r
+                                               bUTF8 = false;\r
+                                               break;\r
+                                       }\r
+                                       utf8CheckBuf++;\r
+                                       if (*utf8CheckBuf == 0)\r
+                                               break;\r
+                                       if ((*utf8CheckBuf & 0xC0)!=0x80)\r
+                                       {\r
+                                               bUTF8 = false;\r
+                                               break;\r
+                                       }\r
+                               }\r
+\r
+                               utf8CheckBuf++;\r
+                       }\r
+                       SendEditor(SCI_ADDTEXT, _tcslen(lineptr), reinterpret_cast<LPARAM>(static_cast<char *>(lineptr)));\r
+                       SendEditor(SCI_ADDTEXT, 2, (LPARAM)_T("\r\n"));\r
+               }\r
+       } while (File.gcount() > 0);\r
+\r
+       if (bUTF8)\r
+               SendEditor(SCI_SETCODEPAGE, SC_CP_UTF8);\r
+\r
+       SendEditor(SCI_SETUNDOCOLLECTION, 1);\r
+       ::SetFocus(wEditor);\r
+       SendEditor(EM_EMPTYUNDOBUFFER);\r
+       SendEditor(SCI_SETSAVEPOINT);\r
+       SendEditor(SCI_GOTOPOS, 0);\r
+       SendEditor(SCI_SETSCROLLWIDTHTRACKING, TRUE);\r
+       SendEditor(SCI_SETREADONLY, TRUE);\r
+\r
+       //check which lexer to use, depending on the filetype\r
+       SetupLexer(fileName);\r
+       ::ShowWindow(wEditor, SW_SHOW);\r
+       m_blamewidth = 0;\r
+       ::InvalidateRect(wMain, NULL, TRUE);\r
+       RECT rc;\r
+       GetWindowRect(wMain, &rc);\r
+       SetWindowPos(wMain, 0, rc.left, rc.top, rc.right-rc.left-1, rc.bottom - rc.top, 0);\r
+       return TRUE;\r
+}\r
+\r
+void TortoiseBlame::SetAStyle(int style, COLORREF fore, COLORREF back, int size, const char *face) \r
+{\r
+       SendEditor(SCI_STYLESETFORE, style, fore);\r
+       SendEditor(SCI_STYLESETBACK, style, back);\r
+       if (size >= 1)\r
+               SendEditor(SCI_STYLESETSIZE, style, size);\r
+       if (face) \r
+               SendEditor(SCI_STYLESETFONT, style, reinterpret_cast<LPARAM>(face));\r
+}\r
+\r
+void TortoiseBlame::InitialiseEditor() \r
+{\r
+       m_directFunction = SendMessage(wEditor, SCI_GETDIRECTFUNCTION, 0, 0);\r
+       m_directPointer = SendMessage(wEditor, SCI_GETDIRECTPOINTER, 0, 0);\r
+       // Set up the global default style. These attributes are used wherever no explicit choices are made.\r
+       SetAStyle(STYLE_DEFAULT, black, white, (DWORD)CRegStdWORD(_T("Software\\TortoiseSVN\\BlameFontSize"), 10), \r
+               ((stdstring)(CRegStdString(_T("Software\\TortoiseSVN\\BlameFontName"), _T("Courier New")))).c_str());\r
+       SendEditor(SCI_SETTABWIDTH, (DWORD)CRegStdWORD(_T("Software\\TortoiseSVN\\BlameTabSize"), 4));\r
+       SendEditor(SCI_SETREADONLY, TRUE);\r
+       LRESULT pix = SendEditor(SCI_TEXTWIDTH, STYLE_LINENUMBER, (LPARAM)_T("_99999"));\r
+       if (ShowLine)\r
+               SendEditor(SCI_SETMARGINWIDTHN, 0, pix);\r
+       else\r
+               SendEditor(SCI_SETMARGINWIDTHN, 0);\r
+       SendEditor(SCI_SETMARGINWIDTHN, 1);\r
+       SendEditor(SCI_SETMARGINWIDTHN, 2);\r
+       //Set the default windows colors for edit controls\r
+       SendEditor(SCI_STYLESETFORE, STYLE_DEFAULT, ::GetSysColor(COLOR_WINDOWTEXT));\r
+       SendEditor(SCI_STYLESETBACK, STYLE_DEFAULT, ::GetSysColor(COLOR_WINDOW));\r
+       SendEditor(SCI_SETSELFORE, TRUE, ::GetSysColor(COLOR_HIGHLIGHTTEXT));\r
+       SendEditor(SCI_SETSELBACK, TRUE, ::GetSysColor(COLOR_HIGHLIGHT));\r
+       SendEditor(SCI_SETCARETFORE, ::GetSysColor(COLOR_WINDOWTEXT));\r
+       m_regOldLinesColor = CRegStdWORD(_T("Software\\TortoiseSVN\\BlameOldColor"), RGB(230, 230, 255));\r
+       m_regNewLinesColor = CRegStdWORD(_T("Software\\TortoiseSVN\\BlameNewColor"), RGB(255, 230, 230));\r
+}\r
+\r
+void TortoiseBlame::StartSearch()\r
+{\r
+       if (currentDialog)\r
+               return;\r
+       bool bCase = false;\r
+       // Initialize FINDREPLACE\r
+       if (fr.Flags & FR_MATCHCASE)\r
+               bCase = true;\r
+       SecureZeroMemory(&fr, sizeof(fr));\r
+       fr.lStructSize = sizeof(fr);\r
+       fr.hwndOwner = wMain;\r
+       fr.lpstrFindWhat = szFindWhat;\r
+       fr.wFindWhatLen = 80;\r
+       fr.Flags = FR_HIDEUPDOWN | FR_HIDEWHOLEWORD;\r
+       fr.Flags |= bCase ? FR_MATCHCASE : 0;\r
+\r
+       currentDialog = FindText(&fr);\r
+}\r
+\r
+bool TortoiseBlame::DoSearch(LPSTR what, DWORD flags)\r
+{\r
+       TCHAR szWhat[80];\r
+       int pos = SendEditor(SCI_GETCURRENTPOS);\r
+       int line = SendEditor(SCI_LINEFROMPOSITION, pos);\r
+       bool bFound = false;\r
+       bool bCaseSensitive = !!(flags & FR_MATCHCASE);\r
+\r
+       strcpy_s(szWhat, sizeof(szWhat), what);\r
+\r
+       if(!bCaseSensitive)\r
+       {\r
+               char *p;\r
+               size_t len = strlen(szWhat);\r
+               for (p = szWhat; p < szWhat + len; p++)\r
+               {\r
+                       if (isupper(*p)&&__isascii(*p))\r
+                               *p = _tolower(*p);\r
+               }\r
+       }\r
+\r
+       std::string sWhat = std::string(szWhat);\r
+       \r
+       char buf[20];\r
+       int i=0;\r
+       for (i=line; (i<(int)authors.size())&&(!bFound); ++i)\r
+       {\r
+               int bufsize = SendEditor(SCI_GETLINE, i);\r
+               char * linebuf = new char[bufsize+1];\r
+               SecureZeroMemory(linebuf, bufsize+1);\r
+               SendEditor(SCI_GETLINE, i, (LPARAM)linebuf);\r
+               if (!bCaseSensitive)\r
+               {\r
+                       char *p;\r
+                       for (p = linebuf; p < linebuf + bufsize; p++)\r
+                       {\r
+                               if (isupper(*p)&&__isascii(*p))\r
+                                       *p = _tolower(*p);\r
+                       }\r
+               }\r
+               _stprintf_s(buf, 20, _T("%ld"), revs[i]);\r
+               if (authors[i].compare(sWhat)==0)\r
+                       bFound = true;\r
+               else if ((!bCaseSensitive)&&(_stricmp(authors[i].c_str(), szWhat)==0))\r
+                       bFound = true;\r
+               else if (strcmp(buf, szWhat) == 0)\r
+                       bFound = true;\r
+               else if (strstr(linebuf, szWhat))\r
+                       bFound = true;\r
+               delete [] linebuf;\r
+       }\r
+       if (!bFound)\r
+       {\r
+               for (i=0; (i<line)&&(!bFound); ++i)\r
+               {\r
+                       int bufsize = SendEditor(SCI_GETLINE, i);\r
+                       char * linebuf = new char[bufsize+1];\r
+                       SecureZeroMemory(linebuf, bufsize+1);\r
+                       SendEditor(SCI_GETLINE, i, (LPARAM)linebuf);\r
+                       if (!bCaseSensitive)\r
+                       {\r
+                               char *p;\r
+                               for (p = linebuf; p < linebuf + bufsize; p++)\r
+                               {\r
+                                       if (isupper(*p)&&__isascii(*p))\r
+                                               *p = _tolower(*p);\r
+                               }\r
+                       }\r
+                       _stprintf_s(buf, 20, _T("%ld"), revs[i]);\r
+                       if (authors[i].compare(sWhat)==0)\r
+                               bFound = true;\r
+                       else if ((!bCaseSensitive)&&(_stricmp(authors[i].c_str(), szWhat)==0))\r
+                               bFound = true;\r
+                       else if (strcmp(buf, szWhat) == 0)\r
+                               bFound = true;\r
+                       else if (strstr(linebuf, szWhat))\r
+                               bFound = true;\r
+                       delete [] linebuf;\r
+               }\r
+       }\r
+       if (bFound)\r
+       {\r
+               GotoLine(i);\r
+               int selstart = SendEditor(SCI_GETCURRENTPOS);\r
+               int selend = SendEditor(SCI_POSITIONFROMLINE, i);\r
+               SendEditor(SCI_SETSELECTIONSTART, selstart);\r
+               SendEditor(SCI_SETSELECTIONEND, selend);\r
+               m_SelectedLine = i-1;\r
+       }\r
+       else\r
+       {\r
+               ::MessageBox(wMain, searchstringnotfound, "TortoiseBlame", MB_ICONINFORMATION);\r
+       }\r
+       return true;\r
+}\r
+\r
+bool TortoiseBlame::GotoLine(long line)\r
+{\r
+       --line;\r
+       if (line < 0)\r
+               return false;\r
+       if ((unsigned long)line >= authors.size())\r
+       {\r
+               line = authors.size()-1;\r
+       }\r
+\r
+       int nCurrentPos = SendEditor(SCI_GETCURRENTPOS);\r
+       int nCurrentLine = SendEditor(SCI_LINEFROMPOSITION,nCurrentPos);\r
+       int nFirstVisibleLine = SendEditor(SCI_GETFIRSTVISIBLELINE);\r
+       int nLinesOnScreen = SendEditor(SCI_LINESONSCREEN);\r
+\r
+       if ( line>=nFirstVisibleLine && line<=nFirstVisibleLine+nLinesOnScreen)\r
+       {\r
+               // no need to scroll\r
+               SendEditor(SCI_GOTOLINE, line);\r
+       }\r
+       else\r
+       {\r
+               // Place the requested line one third from the top\r
+               if ( line > nCurrentLine )\r
+               {\r
+                       SendEditor(SCI_GOTOLINE, (WPARAM)(line+(int)nLinesOnScreen*(2/3.0)));\r
+               }\r
+               else\r
+               {\r
+                       SendEditor(SCI_GOTOLINE, (WPARAM)(line-(int)nLinesOnScreen*(1/3.0)));\r
+               }\r
+       }\r
+\r
+       // Highlight the line\r
+       int nPosStart = SendEditor(SCI_POSITIONFROMLINE,line);\r
+       int nPosEnd = SendEditor(SCI_GETLINEENDPOSITION,line);\r
+       SendEditor(SCI_SETSEL,nPosEnd,nPosStart);\r
+\r
+       return true;\r
+}\r
+\r
+bool TortoiseBlame::ScrollToLine(long line)\r
+{\r
+       if (line < 0)\r
+               return false;\r
+\r
+       int nCurrentLine = SendEditor(SCI_GETFIRSTVISIBLELINE);\r
+\r
+       int scrolldelta = line - nCurrentLine;\r
+       SendEditor(SCI_LINESCROLL, 0, scrolldelta);\r
+\r
+       return true;\r
+}\r
+\r
+void TortoiseBlame::CopySelectedLogToClipboard()\r
+{\r
+       if (m_selectedrev <= 0)\r
+               return;\r
+       std::map<LONG, std::string>::iterator iter;\r
+       if ((iter = app.logmessages.find(m_selectedrev)) != app.logmessages.end())\r
+       {\r
+               std::string msg;\r
+               msg += m_selectedauthor;\r
+               msg += "  ";\r
+               msg += app.m_selecteddate;\r
+               msg += '\n';\r
+               msg += iter->second;\r
+               msg += _T("\n");\r
+               if (OpenClipboard(app.wBlame))\r
+               {\r
+                       EmptyClipboard();\r
+                       HGLOBAL hClipboardData;\r
+                       hClipboardData = GlobalAlloc(GMEM_DDESHARE, msg.size()+1);\r
+                       char * pchData;\r
+                       pchData = (char*)GlobalLock(hClipboardData);\r
+                       strcpy_s(pchData, msg.size()+1, msg.c_str());\r
+                       GlobalUnlock(hClipboardData);\r
+                       SetClipboardData(CF_TEXT,hClipboardData);\r
+                       CloseClipboard();\r
+               }\r
+       }\r
+}\r
+\r
+void TortoiseBlame::BlamePreviousRevision()\r
+{\r
+       LONG nRevisionTo = m_selectedorigrev - 1;\r
+       if ( nRevisionTo<1 )\r
+       {\r
+               return;\r
+       }\r
+\r
+       // We now determine the smallest revision number in the blame file (but ignore "-1")\r
+       // We do this for two reasons:\r
+       // 1. we respect the "From revision" which the user entered\r
+       // 2. we speed up the call of "svn blame" because previous smaller revision numbers don't have any effect on the result\r
+       LONG nSmallestRevision = -1;\r
+       for (LONG line=0;line<(LONG)app.revs.size();line++)\r
+       {\r
+               const LONG nRevision = app.revs[line];\r
+               if ( nRevision > 0 )\r
+               {\r
+                       if ( nSmallestRevision < 1 )\r
+                       {\r
+                               nSmallestRevision = nRevision;\r
+                       }\r
+                       else\r
+                       {\r
+                               nSmallestRevision = min(nSmallestRevision,nRevision);\r
+                       }\r
+               }\r
+       }\r
+\r
+       char bufStartRev[20];\r
+       _stprintf_s(bufStartRev, 20, _T("%d"), nSmallestRevision);\r
+\r
+       char bufEndRev[20];\r
+       _stprintf_s(bufEndRev, 20, _T("%d"), nRevisionTo);\r
+\r
+       char bufLine[20];\r
+       _stprintf_s(bufLine, 20, _T("%d"), m_SelectedLine+1); //using the current line is a good guess.\r
+\r
+       STARTUPINFO startup;\r
+       PROCESS_INFORMATION process;\r
+       memset(&startup, 0, sizeof(startup));\r
+       startup.cb = sizeof(startup);\r
+       memset(&process, 0, sizeof(process));\r
+       stdstring tortoiseProcPath = GetAppDirectory() + _T("TortoiseProc.exe");\r
+       stdstring svnCmd = _T(" /command:blame ");\r
+       svnCmd += _T(" /path:\"");\r
+       svnCmd += szOrigPath;\r
+       svnCmd += _T("\"");\r
+       svnCmd += _T(" /startrev:");\r
+       svnCmd += bufStartRev;\r
+       svnCmd += _T(" /endrev:");\r
+       svnCmd += bufEndRev;\r
+       svnCmd += _T(" /line:");\r
+       svnCmd += bufLine;\r
+       if (bIgnoreEOL)\r
+               svnCmd += _T(" /ignoreeol");\r
+       if (bIgnoreSpaces)\r
+               svnCmd += _T(" /ignorespaces");\r
+       if (bIgnoreAllSpaces)\r
+               svnCmd += _T(" /ignoreallspaces");\r
+    if (CreateProcess(tortoiseProcPath.c_str(), const_cast<TCHAR*>(svnCmd.c_str()), NULL, NULL, FALSE, 0, 0, 0, &startup, &process))\r
+       {\r
+               CloseHandle(process.hThread);\r
+               CloseHandle(process.hProcess);\r
+       }\r
+}\r
+\r
+void TortoiseBlame::DiffPreviousRevision()\r
+{\r
+       LONG nRevisionTo = m_selectedorigrev;\r
+       if ( nRevisionTo<1 )\r
+       {\r
+               return;\r
+       }\r
+\r
+       LONG nRevisionFrom = nRevisionTo-1;\r
+\r
+       char bufStartRev[20];\r
+       _stprintf_s(bufStartRev, 20, _T("%d"), nRevisionFrom);\r
+\r
+       char bufEndRev[20];\r
+       _stprintf_s(bufEndRev, 20, _T("%d"), nRevisionTo);\r
+\r
+       STARTUPINFO startup;\r
+       PROCESS_INFORMATION process;\r
+       memset(&startup, 0, sizeof(startup));\r
+       startup.cb = sizeof(startup);\r
+       memset(&process, 0, sizeof(process));\r
+       stdstring tortoiseProcPath = GetAppDirectory() + _T("TortoiseProc.exe");\r
+       stdstring svnCmd = _T(" /command:diff ");\r
+       svnCmd += _T(" /path:\"");\r
+       svnCmd += szOrigPath;\r
+       svnCmd += _T("\"");\r
+       svnCmd += _T(" /startrev:");\r
+       svnCmd += bufStartRev;\r
+       svnCmd += _T(" /endrev:");\r
+       svnCmd += bufEndRev;\r
+       if (CreateProcess(tortoiseProcPath.c_str(), const_cast<TCHAR*>(svnCmd.c_str()), NULL, NULL, FALSE, 0, 0, 0, &startup, &process))\r
+       {\r
+               CloseHandle(process.hThread);\r
+               CloseHandle(process.hProcess);\r
+       }\r
+}\r
+\r
+void TortoiseBlame::ShowLog()\r
+{\r
+       char bufRev[20];\r
+       _stprintf_s(bufRev, 20, _T("%d"), m_selectedorigrev);\r
+\r
+       STARTUPINFO startup;\r
+       PROCESS_INFORMATION process;\r
+       memset(&startup, 0, sizeof(startup));\r
+       startup.cb = sizeof(startup);\r
+       memset(&process, 0, sizeof(process));\r
+       stdstring tortoiseProcPath = GetAppDirectory() + _T("TortoiseProc.exe");\r
+       stdstring svnCmd = _T(" /command:log ");\r
+       svnCmd += _T(" /path:\"");\r
+       svnCmd += szOrigPath;\r
+       svnCmd += _T("\"");\r
+       svnCmd += _T(" /startrev:");\r
+       svnCmd += bufRev;\r
+       svnCmd += _T(" /pegrev:");\r
+       svnCmd += bufRev;\r
+       if (CreateProcess(tortoiseProcPath.c_str(), const_cast<TCHAR*>(svnCmd.c_str()), NULL, NULL, FALSE, 0, 0, 0, &startup, &process))\r
+       {\r
+               CloseHandle(process.hThread);\r
+               CloseHandle(process.hProcess);\r
+       }\r
+}\r
+\r
+void TortoiseBlame::Notify(SCNotification *notification) \r
+{\r
+       switch (notification->nmhdr.code) \r
+       {\r
+       case SCN_SAVEPOINTREACHED:\r
+               break;\r
+\r
+       case SCN_SAVEPOINTLEFT:\r
+               break;\r
+       case SCN_PAINTED:\r
+               InvalidateRect(wBlame, NULL, FALSE);\r
+               InvalidateRect(wLocator, NULL, FALSE);\r
+               break;\r
+       case SCN_GETBKCOLOR:\r
+               if ((m_colorage)&&(notification->line < (int)revs.size()))\r
+               {\r
+                       notification->lParam = InterColor(DWORD(m_regOldLinesColor), DWORD(m_regNewLinesColor), (revs[notification->line]-m_lowestrev)*100/((m_highestrev-m_lowestrev)+1));\r
+               }\r
+               break;\r
+       }\r
+}\r
+\r
+void TortoiseBlame::Command(int id)\r
+{\r
+       switch (id) \r
+       {\r
+       case IDM_EXIT:\r
+               ::PostQuitMessage(0);\r
+               break;\r
+       case ID_EDIT_FIND:\r
+               StartSearch();\r
+               break;\r
+       case ID_COPYTOCLIPBOARD:\r
+               CopySelectedLogToClipboard();\r
+               break;\r
+       case ID_BLAME_PREVIOUS_REVISION:\r
+               BlamePreviousRevision();\r
+               break;\r
+       case ID_DIFF_PREVIOUS_REVISION:\r
+               DiffPreviousRevision();\r
+               break;\r
+       case ID_SHOWLOG:\r
+               ShowLog();\r
+               break;\r
+       case ID_EDIT_GOTOLINE:\r
+               GotoLineDlg();\r
+               break;\r
+       case ID_VIEW_COLORAGEOFLINES:\r
+               {\r
+                       m_colorage = !m_colorage;\r
+                       HMENU hMenu = GetMenu(wMain);\r
+                       UINT uCheck = MF_BYCOMMAND;\r
+                       uCheck |= m_colorage ? MF_CHECKED : MF_UNCHECKED;\r
+                       CheckMenuItem(hMenu, ID_VIEW_COLORAGEOFLINES, uCheck);\r
+                       m_blamewidth = 0;\r
+                       InitSize();\r
+               }\r
+               break;\r
+       case ID_VIEW_MERGEPATH:\r
+               {\r
+                       ShowPath = !ShowPath;\r
+                       HMENU hMenu = GetMenu(wMain);\r
+                       UINT uCheck = MF_BYCOMMAND;\r
+                       uCheck |= ShowPath ? MF_CHECKED : MF_UNCHECKED;\r
+                       CheckMenuItem(hMenu, ID_VIEW_MERGEPATH, uCheck);\r
+                       m_blamewidth = 0;\r
+                       InitSize();\r
+               }\r
+       default:\r
+               break;\r
+       };\r
+}\r
+\r
+void TortoiseBlame::GotoLineDlg()\r
+{\r
+       if (DialogBox(hResource, MAKEINTRESOURCE(IDD_GOTODLG), wMain, GotoDlgProc)==IDOK)\r
+       {\r
+               GotoLine(m_gotoline);\r
+       }\r
+}\r
+\r
+INT_PTR CALLBACK TortoiseBlame::GotoDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM /*lParam*/)\r
+{\r
+       switch (uMsg)\r
+       {\r
+       case WM_COMMAND:\r
+               {\r
+                       switch (LOWORD(wParam))\r
+                       {\r
+                       case IDOK:\r
+                               {\r
+                                       HWND hEditCtrl = GetDlgItem(hwndDlg, IDC_LINENUMBER);\r
+                                       if (hEditCtrl)\r
+                                       {\r
+                                               TCHAR buf[MAX_PATH];\r
+                                               if (::GetWindowText(hEditCtrl, buf, MAX_PATH))\r
+                                               {\r
+                                                       m_gotoline = _ttol(buf);\r
+                                               }\r
+\r
+                                       }\r
+                               }\r
+                       // fall through\r
+                       case IDCANCEL:\r
+                               EndDialog(hwndDlg, wParam);\r
+                               break;\r
+                       }\r
+               }\r
+               break;\r
+       }\r
+       return FALSE;\r
+}\r
+\r
+LONG TortoiseBlame::GetBlameWidth()\r
+{\r
+       if (m_blamewidth)\r
+               return m_blamewidth;\r
+       LONG blamewidth = 0;\r
+       SIZE width;\r
+       CreateFont();\r
+       HDC hDC = ::GetDC(wBlame);\r
+       HFONT oldfont = (HFONT)::SelectObject(hDC, m_font);\r
+       TCHAR buf[MAX_PATH];\r
+       _stprintf_s(buf, MAX_PATH, _T("%8ld "), 88888888);\r
+       ::GetTextExtentPoint(hDC, buf, _tcslen(buf), &width);\r
+       m_revwidth = width.cx + BLAMESPACE;\r
+       blamewidth += m_revwidth;\r
+       if (ShowDate)\r
+       {\r
+               _stprintf_s(buf, MAX_PATH, _T("%30s"), _T("31.08.2001 06:24:14"));\r
+               ::GetTextExtentPoint32(hDC, buf, _tcslen(buf), &width);\r
+               m_datewidth = width.cx + BLAMESPACE;\r
+               blamewidth += m_datewidth;\r
+       }\r
+       if (ShowAuthor)\r
+       {\r
+               SIZE maxwidth = {0};\r
+               for (std::vector<std::string>::iterator I = authors.begin(); I != authors.end(); ++I)\r
+               {\r
+                       ::GetTextExtentPoint32(hDC, I->c_str(), I->size(), &width);\r
+                       if (width.cx > maxwidth.cx)\r
+                               maxwidth = width;\r
+               }\r
+               m_authorwidth = maxwidth.cx + BLAMESPACE;\r
+               blamewidth += m_authorwidth;\r
+       }\r
+       if (ShowPath)\r
+       {\r
+               SIZE maxwidth = {0};\r
+               for (std::vector<std::string>::iterator I = paths.begin(); I != paths.end(); ++I)\r
+               {\r
+                       ::GetTextExtentPoint32(hDC, I->c_str(), I->size(), &width);\r
+                       if (width.cx > maxwidth.cx)\r
+                               maxwidth = width;\r
+               }\r
+               m_pathwidth = maxwidth.cx + BLAMESPACE;\r
+               blamewidth += m_pathwidth;\r
+       }\r
+       ::SelectObject(hDC, oldfont);\r
+       POINT pt = {blamewidth, 0};\r
+       LPtoDP(hDC, &pt, 1);\r
+       m_blamewidth = pt.x;\r
+       ReleaseDC(wBlame, hDC);\r
+       return m_blamewidth;\r
+}\r
+\r
+void TortoiseBlame::CreateFont()\r
+{\r
+       if (m_font)\r
+               return;\r
+       LOGFONT lf = {0};\r
+       lf.lfWeight = 400;\r
+       HDC hDC = ::GetDC(wBlame);\r
+       lf.lfHeight = -MulDiv((DWORD)CRegStdWORD(_T("Software\\TortoiseSVN\\BlameFontSize"), 10), GetDeviceCaps(hDC, LOGPIXELSY), 72);\r
+       lf.lfCharSet = DEFAULT_CHARSET;\r
+       CRegStdString fontname = CRegStdString(_T("Software\\TortoiseSVN\\BlameFontName"), _T("Courier New"));\r
+       _tcscpy_s(lf.lfFaceName, 32, ((stdstring)fontname).c_str());\r
+       m_font = ::CreateFontIndirect(&lf);\r
+\r
+       lf.lfItalic = TRUE;\r
+       m_italicfont = ::CreateFontIndirect(&lf);\r
+\r
+       ReleaseDC(wBlame, hDC);\r
+}\r
+\r
+void TortoiseBlame::DrawBlame(HDC hDC)\r
+{\r
+       if (hDC == NULL)\r
+               return;\r
+       if (m_font == NULL)\r
+               return;\r
+\r
+       HFONT oldfont = NULL;\r
+       LONG_PTR line = SendEditor(SCI_GETFIRSTVISIBLELINE);\r
+       LONG_PTR linesonscreen = SendEditor(SCI_LINESONSCREEN);\r
+       LONG_PTR height = SendEditor(SCI_TEXTHEIGHT);\r
+       LONG_PTR Y = 0;\r
+       TCHAR buf[MAX_PATH];\r
+       RECT rc;\r
+       BOOL sel = FALSE;\r
+       GetClientRect(wBlame, &rc);\r
+       for (LRESULT i=line; i<(line+linesonscreen); ++i)\r
+       {\r
+               sel = FALSE;\r
+               if (i < (int)revs.size())\r
+               {\r
+                       if (mergelines[i])\r
+                               oldfont = (HFONT)::SelectObject(hDC, m_italicfont);\r
+                       else\r
+                               oldfont = (HFONT)::SelectObject(hDC, m_font);\r
+                       ::SetBkColor(hDC, m_windowcolor);\r
+                       ::SetTextColor(hDC, m_textcolor);\r
+                       if (authors[i].size()>0)\r
+                       {\r
+                               if (authors[i].compare(m_mouseauthor)==0)\r
+                                       ::SetBkColor(hDC, m_mouseauthorcolor);\r
+                               if (authors[i].compare(m_selectedauthor)==0)\r
+                               {\r
+                                       ::SetBkColor(hDC, m_selectedauthorcolor);\r
+                                       ::SetTextColor(hDC, m_texthighlightcolor);\r
+                                       sel = TRUE;\r
+                               }\r
+                       }\r
+                       if ((revs[i] == m_mouserev)&&(!sel))\r
+                               ::SetBkColor(hDC, m_mouserevcolor);\r
+                       if (revs[i] == m_selectedrev)\r
+                       {\r
+                               ::SetBkColor(hDC, m_selectedrevcolor);\r
+                               ::SetTextColor(hDC, m_texthighlightcolor);\r
+                       }\r
+                       _stprintf_s(buf, MAX_PATH, _T("%8ld       "), revs[i]);\r
+                       rc.right = rc.left + m_revwidth;\r
+                       ::ExtTextOut(hDC, 0, Y, ETO_CLIPPED, &rc, buf, _tcslen(buf), 0);\r
+                       int Left = m_revwidth;\r
+                       if (ShowDate)\r
+                       {\r
+                               rc.right = rc.left + Left + m_datewidth;\r
+                               _stprintf_s(buf, MAX_PATH, _T("%30s            "), dates[i].c_str());\r
+                               ::ExtTextOut(hDC, Left, Y, ETO_CLIPPED, &rc, buf, _tcslen(buf), 0);\r
+                               Left += m_datewidth;\r
+                       }\r
+                       if (ShowAuthor)\r
+                       {\r
+                               rc.right = rc.left + Left + m_authorwidth;\r
+                               _stprintf_s(buf, MAX_PATH, _T("%-30s            "), authors[i].c_str());\r
+                               ::ExtTextOut(hDC, Left, Y, ETO_CLIPPED, &rc, buf, _tcslen(buf), 0);\r
+                               Left += m_authorwidth;\r
+                       }\r
+                       if (ShowPath)\r
+                       {\r
+                               rc.right = rc.left + Left + m_pathwidth;\r
+                               _stprintf_s(buf, MAX_PATH, _T("%-60s            "), paths[i].c_str());\r
+                               ::ExtTextOut(hDC, Left, Y, ETO_CLIPPED, &rc, buf, _tcslen(buf), 0);\r
+                               Left += m_authorwidth;\r
+                       }\r
+                       if ((i==m_SelectedLine)&&(currentDialog))\r
+                       {\r
+                               LOGBRUSH brush;\r
+                               brush.lbColor = m_textcolor;\r
+                               brush.lbHatch = 0;\r
+                               brush.lbStyle = BS_SOLID;\r
+                               HPEN pen = ExtCreatePen(PS_SOLID | PS_GEOMETRIC, 2, &brush, 0, NULL);\r
+                               HGDIOBJ hPenOld = SelectObject(hDC, pen);\r
+                               RECT rc2 = rc;\r
+                               rc2.top = Y;\r
+                               rc2.bottom = Y + height;\r
+                               ::MoveToEx(hDC, rc2.left, rc2.top, NULL);\r
+                               ::LineTo(hDC, rc2.right, rc2.top);\r
+                               ::LineTo(hDC, rc2.right, rc2.bottom);\r
+                               ::LineTo(hDC, rc2.left, rc2.bottom);\r
+                               ::LineTo(hDC, rc2.left, rc2.top);\r
+                               SelectObject(hDC, hPenOld); \r
+                               DeleteObject(pen); \r
+                       }\r
+                       Y += height;\r
+                       ::SelectObject(hDC, oldfont);\r
+               }\r
+               else\r
+               {\r
+                       ::SetBkColor(hDC, m_windowcolor);\r
+                       for (int j=0; j< MAX_PATH; ++j)\r
+                               buf[j]=' ';\r
+                       ::ExtTextOut(hDC, 0, Y, ETO_CLIPPED, &rc, buf, MAX_PATH-1, 0);\r
+                       Y += height;\r
+               }\r
+       }\r
+}\r
+\r
+void TortoiseBlame::DrawHeader(HDC hDC)\r
+{\r
+       if (hDC == NULL)\r
+               return;\r
+\r
+       RECT rc;\r
+       HFONT oldfont = (HFONT)::SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT));\r
+       GetClientRect(wHeader, &rc);\r
+\r
+       ::SetBkColor(hDC, ::GetSysColor(COLOR_BTNFACE));\r
+\r
+       TCHAR szText[MAX_LOADSTRING];\r
+       LoadString(app.hResource, IDS_HEADER_REVISION, szText, MAX_LOADSTRING);\r
+       ::ExtTextOut(hDC, LOCATOR_WIDTH, 0, ETO_CLIPPED, &rc, szText, _tcslen(szText), 0);\r
+       int Left = m_revwidth+LOCATOR_WIDTH;\r
+       if (ShowDate)\r
+       {\r
+               LoadString(app.hResource, IDS_HEADER_DATE, szText, MAX_LOADSTRING);\r
+               ::ExtTextOut(hDC, Left, 0, ETO_CLIPPED, &rc, szText, _tcslen(szText), 0);\r
+               Left += m_datewidth;\r
+       }\r
+       if (ShowAuthor)\r
+       {\r
+               LoadString(app.hResource, IDS_HEADER_AUTHOR, szText, MAX_LOADSTRING);\r
+               ::ExtTextOut(hDC, Left, 0, ETO_CLIPPED, &rc, szText, _tcslen(szText), 0);\r
+               Left += m_authorwidth;\r
+       }\r
+       if (ShowPath)\r
+       {\r
+               LoadString(app.hResource, IDS_HEADER_PATH, szText, MAX_LOADSTRING);\r
+               ::ExtTextOut(hDC, Left, 0, ETO_CLIPPED, &rc, szText, _tcslen(szText), 0);\r
+               Left += m_pathwidth;\r
+       }\r
+       LoadString(app.hResource, IDS_HEADER_LINE, szText, MAX_LOADSTRING);\r
+       ::ExtTextOut(hDC, Left, 0, ETO_CLIPPED, &rc, szText, _tcslen(szText), 0);\r
+\r
+       ::SelectObject(hDC, oldfont);\r
+}\r
+\r
+void TortoiseBlame::DrawLocatorBar(HDC hDC)\r
+{\r
+       if (hDC == NULL)\r
+               return;\r
+\r
+       LONG_PTR line = SendEditor(SCI_GETFIRSTVISIBLELINE);\r
+       LONG_PTR linesonscreen = SendEditor(SCI_LINESONSCREEN);\r
+       LONG_PTR Y = 0;\r
+       COLORREF blackColor = GetSysColor(COLOR_WINDOWTEXT);\r
+\r
+       RECT rc;\r
+       GetClientRect(wLocator, &rc);\r
+       RECT lineRect = rc;\r
+       LONG height = rc.bottom-rc.top;\r
+       LONG currentLine = 0;\r
+\r
+       // draw the colored bar\r
+       for (std::vector<LONG>::const_iterator it = revs.begin(); it != revs.end(); ++it)\r
+       {\r
+               currentLine++;\r
+               // get the line color\r
+               COLORREF cr = InterColor(DWORD(m_regOldLinesColor), DWORD(m_regNewLinesColor), (*it - m_lowestrev)*100/((m_highestrev-m_lowestrev)+1));\r
+               if ((currentLine > line)&&(currentLine <= (line + linesonscreen)))\r
+               {\r
+                       cr = InterColor(cr, blackColor, 10);\r
+               }\r
+               SetBkColor(hDC, cr);\r
+               lineRect.top = Y;\r
+               lineRect.bottom = (currentLine * height / revs.size());\r
+               ::ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &lineRect, NULL, 0, NULL);\r
+               Y = lineRect.bottom;\r
+       }\r
+\r
+       if (revs.size())\r
+       {\r
+               // now draw two lines indicating the scroll position of the source view\r
+               SetBkColor(hDC, blackColor);\r
+               lineRect.top = line * height / revs.size();\r
+               lineRect.bottom = lineRect.top+1;\r
+               ::ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &lineRect, NULL, 0, NULL);\r
+               lineRect.top = (line + linesonscreen) * height / revs.size();\r
+               lineRect.bottom = lineRect.top+1;\r
+               ::ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &lineRect, NULL, 0, NULL);\r
+       }\r
+}\r
+\r
+void TortoiseBlame::StringExpand(LPSTR str)\r
+{\r
+       char * cPos = str;\r
+       do\r
+       {\r
+               cPos = strchr(cPos, '\n');\r
+               if (cPos)\r
+               {\r
+                       memmove(cPos+1, cPos, strlen(cPos)*sizeof(char));\r
+                       *cPos = '\r';\r
+                       cPos++;\r
+                       cPos++;\r
+               }\r
+       } while (cPos != NULL);\r
+}\r
+void TortoiseBlame::StringExpand(LPWSTR str)\r
+{\r
+       wchar_t * cPos = str;\r
+       do\r
+       {\r
+               cPos = wcschr(cPos, '\n');\r
+               if (cPos)\r
+               {\r
+                       memmove(cPos+1, cPos, wcslen(cPos)*sizeof(wchar_t));\r
+                       *cPos = '\r';\r
+                       cPos++;\r
+                       cPos++;\r
+               }\r
+       } while (cPos != NULL);\r
+}\r
+\r
+// Forward declarations of functions included in this code module:\r
+ATOM                           MyRegisterClass(HINSTANCE hResource);\r
+ATOM                           MyRegisterBlameClass(HINSTANCE hResource);\r
+ATOM                           MyRegisterHeaderClass(HINSTANCE hResource);\r
+ATOM                           MyRegisterLocatorClass(HINSTANCE hResource);\r
+BOOL                           InitInstance(HINSTANCE, int);\r
+LRESULT CALLBACK       WndProc(HWND, UINT, WPARAM, LPARAM);\r
+LRESULT CALLBACK       WndBlameProc(HWND, UINT, WPARAM, LPARAM);\r
+LRESULT CALLBACK       WndHeaderProc(HWND, UINT, WPARAM, LPARAM);\r
+LRESULT CALLBACK       WndLocatorProc(HWND, UINT, WPARAM, LPARAM);\r
+UINT                           uFindReplaceMsg;\r
+\r
+int APIENTRY _tWinMain(HINSTANCE hInstance,\r
+                     HINSTANCE /*hPrevInstance*/,\r
+                     LPTSTR    lpCmdLine,\r
+                     int       nCmdShow)\r
+{\r
+       app.hInstance = hInstance;\r
+       MSG msg;\r
+       HACCEL hAccelTable;\r
+\r
+       if (::LoadLibrary("SciLexer.DLL") == NULL)\r
+               return FALSE;\r
+\r
+       CRegStdWORD loc = CRegStdWORD(_T("Software\\TortoiseSVN\\LanguageID"), 1033);\r
+       long langId = loc;\r
+\r
+       CLangDll langDLL;\r
+       app.hResource = langDLL.Init(_T("TortoiseBlame"), langId);\r
+       if (app.hResource == NULL)\r
+               app.hResource = app.hInstance;\r
+\r
+       // Initialize global strings\r
+       LoadString(app.hResource, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);\r
+       LoadString(app.hResource, IDC_TORTOISEBLAME, szWindowClass, MAX_LOADSTRING);\r
+       LoadString(app.hResource, IDS_SEARCHNOTFOUND, searchstringnotfound, MAX_LOADSTRING);\r
+       MyRegisterClass(app.hResource);\r
+       MyRegisterBlameClass(app.hResource);\r
+       MyRegisterHeaderClass(app.hResource);\r
+       MyRegisterLocatorClass(app.hResource);\r
+\r
+       // Perform application initialization:\r
+       if (!InitInstance (app.hResource, nCmdShow)) \r
+       {\r
+               langDLL.Close();\r
+               return FALSE;\r
+       }\r
+\r
+       SecureZeroMemory(szViewtitle, MAX_PATH);\r
+       SecureZeroMemory(szOrigPath, MAX_PATH);\r
+       char blamefile[MAX_PATH] = {0};\r
+       char logfile[MAX_PATH] = {0};\r
+\r
+       CCmdLineParser parser(lpCmdLine);\r
+\r
+\r
+       if (__argc > 1)\r
+       {\r
+               _tcscpy_s(blamefile, MAX_PATH, __argv[1]);\r
+       }\r
+       if (__argc > 2)\r
+       {\r
+               _tcscpy_s(logfile, MAX_PATH, __argv[2]);\r
+       }\r
+       if (__argc > 3)\r
+       {\r
+               _tcscpy_s(szViewtitle, MAX_PATH, __argv[3]);\r
+               if (parser.HasVal(_T("revrange")))\r
+               {\r
+                       _tcscat_s(szViewtitle, MAX_PATH, _T(" : "));\r
+                       _tcscat_s(szViewtitle, MAX_PATH, parser.GetVal(_T("revrange")));\r
+               }\r
+       }\r
+       if ((_tcslen(blamefile)==0) || parser.HasKey(_T("?")) || parser.HasKey(_T("help")))\r
+       {\r
+               TCHAR szInfo[MAX_LOADSTRING];\r
+               LoadString(app.hResource, IDS_COMMANDLINE_INFO, szInfo, MAX_LOADSTRING);\r
+               MessageBox(NULL, szInfo, _T("TortoiseBlame"), MB_ICONERROR);\r
+               langDLL.Close();\r
+               return 0;\r
+       }\r
+\r
+       if ( parser.HasKey(_T("path")) )\r
+       {\r
+               _tcscpy_s(szOrigPath, MAX_PATH, parser.GetVal(_T("path")));\r
+       }\r
+       app.bIgnoreEOL = parser.HasKey(_T("ignoreeol"));\r
+       app.bIgnoreSpaces = parser.HasKey(_T("ignorespaces"));\r
+       app.bIgnoreAllSpaces = parser.HasKey(_T("ignoreallspaces"));\r
+\r
+       app.SendEditor(SCI_SETCODEPAGE, GetACP());\r
+       app.OpenFile(blamefile);\r
+       if (_tcslen(logfile)>0)\r
+               app.OpenLogFile(logfile);\r
+\r
+       if (parser.HasKey(_T("line")))\r
+       {\r
+               app.GotoLine(parser.GetLongVal(_T("line")));\r
+       }\r
+\r
+       CheckMenuItem(GetMenu(app.wMain), ID_VIEW_COLORAGEOFLINES, MF_CHECKED|MF_BYCOMMAND);\r
+\r
+\r
+       hAccelTable = LoadAccelerators(app.hResource, (LPCTSTR)IDC_TORTOISEBLAME);\r
+\r
+       BOOL going = TRUE;\r
+       msg.wParam = 0;\r
+       while (going) \r
+       {\r
+               going = GetMessage(&msg, NULL, 0, 0);\r
+               if (app.currentDialog && going) \r
+               {\r
+                       if (!IsDialogMessage(app.currentDialog, &msg)) \r
+                       {\r
+                               if (TranslateAccelerator(msg.hwnd, hAccelTable, &msg) == 0) \r
+                               {\r
+                                       TranslateMessage(&msg);\r
+                                       DispatchMessage(&msg);\r
+                               }\r
+                       }\r
+               } \r
+               else if (going) \r
+               {\r
+                       if (TranslateAccelerator(app.wMain, hAccelTable, &msg) == 0) \r
+                       {\r
+                               TranslateMessage(&msg);\r
+                               DispatchMessage(&msg);\r
+                       }\r
+               }\r
+       }\r
+       langDLL.Close();\r
+       return msg.wParam;\r
+}\r
+\r
+ATOM MyRegisterClass(HINSTANCE hResource)\r
+{\r
+       WNDCLASSEX wcex;\r
+\r
+       wcex.cbSize = sizeof(WNDCLASSEX); \r
+\r
+       wcex.style                      = CS_HREDRAW | CS_VREDRAW;\r
+       wcex.lpfnWndProc        = (WNDPROC)WndProc;\r
+       wcex.cbClsExtra         = 0;\r
+       wcex.cbWndExtra         = 0;\r
+       wcex.hInstance          = hResource;\r
+       wcex.hIcon                      = LoadIcon(hResource, (LPCTSTR)IDI_TORTOISEBLAME);\r
+       wcex.hCursor            = LoadCursor(NULL, IDC_ARROW);\r
+       wcex.hbrBackground      = (HBRUSH)(COLOR_WINDOW+1);\r
+       wcex.lpszMenuName       = (LPCTSTR)IDC_TORTOISEBLAME;\r
+       wcex.lpszClassName      = szWindowClass;\r
+       wcex.hIconSm            = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);\r
+\r
+       return RegisterClassEx(&wcex);\r
+}\r
+\r
+ATOM MyRegisterBlameClass(HINSTANCE hResource)\r
+{\r
+       WNDCLASSEX wcex;\r
+\r
+       wcex.cbSize = sizeof(WNDCLASSEX); \r
+\r
+       wcex.style                      = CS_HREDRAW | CS_VREDRAW;\r
+       wcex.lpfnWndProc        = (WNDPROC)WndBlameProc;\r
+       wcex.cbClsExtra         = 0;\r
+       wcex.cbWndExtra         = 0;\r
+       wcex.hInstance          = hResource;\r
+       wcex.hIcon                      = LoadIcon(hResource, (LPCTSTR)IDI_TORTOISEBLAME);\r
+       wcex.hCursor            = LoadCursor(NULL, IDC_ARROW);\r
+       wcex.hbrBackground      = (HBRUSH)(COLOR_WINDOW+1);\r
+       wcex.lpszMenuName       = 0;\r
+       wcex.lpszClassName      = _T("TortoiseBlameBlame");\r
+       wcex.hIconSm            = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);\r
+\r
+       return RegisterClassEx(&wcex);\r
+}\r
+\r
+ATOM MyRegisterHeaderClass(HINSTANCE hResource)\r
+{\r
+       WNDCLASSEX wcex;\r
+\r
+       wcex.cbSize = sizeof(WNDCLASSEX); \r
+\r
+       wcex.style                      = CS_HREDRAW | CS_VREDRAW;\r
+       wcex.lpfnWndProc        = (WNDPROC)WndHeaderProc;\r
+       wcex.cbClsExtra         = 0;\r
+       wcex.cbWndExtra         = 0;\r
+       wcex.hInstance          = hResource;\r
+       wcex.hIcon                      = LoadIcon(hResource, (LPCTSTR)IDI_TORTOISEBLAME);\r
+       wcex.hCursor            = LoadCursor(NULL, IDC_ARROW);\r
+       wcex.hbrBackground      = (HBRUSH)(COLOR_BTNFACE+1);\r
+       wcex.lpszMenuName       = 0;\r
+       wcex.lpszClassName      = _T("TortoiseBlameHeader");\r
+       wcex.hIconSm            = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);\r
+\r
+       return RegisterClassEx(&wcex);\r
+}\r
+\r
+ATOM MyRegisterLocatorClass(HINSTANCE hResource)\r
+{\r
+       WNDCLASSEX wcex;\r
+\r
+       wcex.cbSize = sizeof(WNDCLASSEX); \r
+\r
+       wcex.style                      = CS_HREDRAW | CS_VREDRAW;\r
+       wcex.lpfnWndProc        = (WNDPROC)WndLocatorProc;\r
+       wcex.cbClsExtra         = 0;\r
+       wcex.cbWndExtra         = 0;\r
+       wcex.hInstance          = hResource;\r
+       wcex.hIcon                      = LoadIcon(hResource, (LPCTSTR)IDI_TORTOISEBLAME);\r
+       wcex.hCursor            = LoadCursor(NULL, IDC_ARROW);\r
+       wcex.hbrBackground      = (HBRUSH)(COLOR_WINDOW+1);\r
+       wcex.lpszMenuName       = 0;\r
+       wcex.lpszClassName      = _T("TortoiseBlameLocator");\r
+       wcex.hIconSm            = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);\r
+\r
+       return RegisterClassEx(&wcex);\r
+}\r
+\r
+BOOL InitInstance(HINSTANCE hResource, int nCmdShow)\r
+{\r
+   app.wMain = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,\r
+      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hResource, NULL);   \r
+\r
+   if (!app.wMain)\r
+   {\r
+      return FALSE;\r
+   }\r
+\r
+   CRegStdWORD pos(_T("Software\\TortoiseSVN\\TBlamePos"), 0);\r
+   CRegStdWORD width(_T("Software\\TortoiseSVN\\TBlameSize"), 0);\r
+   CRegStdWORD state(_T("Software\\TortoiseSVN\\TBlameState"), 0);\r
+   if (DWORD(pos) && DWORD(width))\r
+   {\r
+          RECT rc;\r
+          rc.left = LOWORD(DWORD(pos));\r
+          rc.top = HIWORD(DWORD(pos));\r
+          rc.right = rc.left + LOWORD(DWORD(width));\r
+          rc.bottom = rc.top + HIWORD(DWORD(width));\r
+          HMONITOR hMon = MonitorFromRect(&rc, MONITOR_DEFAULTTONULL);\r
+          if (hMon)\r
+          {\r
+                  // only restore the window position if the monitor is valid\r
+                  MoveWindow(app.wMain, LOWORD(DWORD(pos)), HIWORD(DWORD(pos)),\r
+                          LOWORD(DWORD(width)), HIWORD(DWORD(width)), FALSE);\r
+          }\r
+   }\r
+   if (DWORD(state) == SW_MAXIMIZE)\r
+          ShowWindow(app.wMain, SW_MAXIMIZE);\r
+   else\r
+          ShowWindow(app.wMain, nCmdShow);\r
+   UpdateWindow(app.wMain);\r
+\r
+   //Create the tooltips\r
+\r
+   INITCOMMONCONTROLSEX iccex; \r
+   app.hwndTT;                 // handle to the ToolTip control\r
+   TOOLINFO ti;\r
+   RECT rect;                  // for client area coordinates\r
+   iccex.dwICC = ICC_WIN95_CLASSES;\r
+   iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);\r
+   InitCommonControlsEx(&iccex);\r
+\r
+   /* CREATE A TOOLTIP WINDOW */\r
+   app.hwndTT = CreateWindowEx(WS_EX_TOPMOST,\r
+          TOOLTIPS_CLASS,\r
+          NULL,\r
+          WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,             \r
+          CW_USEDEFAULT,\r
+          CW_USEDEFAULT,\r
+          CW_USEDEFAULT,\r
+          CW_USEDEFAULT,\r
+          app.wBlame,\r
+          NULL,\r
+          app.hResource,\r
+          NULL\r
+          );\r
+\r
+   SetWindowPos(app.hwndTT,\r
+          HWND_TOPMOST,\r
+          0,\r
+          0,\r
+          0,\r
+          0,\r
+          SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);\r
+\r
+   /* GET COORDINATES OF THE MAIN CLIENT AREA */\r
+   GetClientRect (app.wBlame, &rect);\r
+\r
+   /* INITIALIZE MEMBERS OF THE TOOLINFO STRUCTURE */\r
+   ti.cbSize = sizeof(TOOLINFO);\r
+   ti.uFlags = TTF_TRACK | TTF_ABSOLUTE;//TTF_SUBCLASS | TTF_PARSELINKS;\r
+   ti.hwnd = app.wBlame;\r
+   ti.hinst = app.hResource;\r
+   ti.uId = 0;\r
+   ti.lpszText = LPSTR_TEXTCALLBACK;\r
+   // ToolTip control will cover the whole window\r
+   ti.rect.left = rect.left;    \r
+   ti.rect.top = rect.top;\r
+   ti.rect.right = rect.right;\r
+   ti.rect.bottom = rect.bottom;\r
+\r
+   /* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */\r
+   SendMessage(app.hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); \r
+   SendMessage(app.hwndTT, TTM_SETMAXTIPWIDTH, 0, 600);\r
+   //SendMessage(app.hwndTT, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAKELONG(50000, 0));\r
+   //SendMessage(app.hwndTT, TTM_SETDELAYTIME, TTDT_RESHOW, MAKELONG(1000, 0));\r
+   \r
+   uFindReplaceMsg = RegisterWindowMessage(FINDMSGSTRING);\r
+   \r
+   return TRUE;\r
+}\r
+\r
+void TortoiseBlame::InitSize()\r
+{\r
+    RECT rc;\r
+    RECT blamerc;\r
+    RECT sourcerc;\r
+    ::GetClientRect(wMain, &rc);\r
+    ::SetWindowPos(wHeader, 0, rc.left, rc.top, rc.right-rc.left, HEADER_HEIGHT, 0);\r
+    rc.top += HEADER_HEIGHT;\r
+    blamerc.left = rc.left;\r
+    blamerc.top = rc.top;\r
+       LONG w = GetBlameWidth();\r
+    blamerc.right = w > abs(rc.right - rc.left) ? rc.right : w + rc.left;\r
+    blamerc.bottom = rc.bottom;\r
+    sourcerc.left = blamerc.right;\r
+    sourcerc.top = rc.top;\r
+    sourcerc.bottom = rc.bottom;\r
+    sourcerc.right = rc.right;\r
+       if (m_colorage)\r
+       {\r
+               ::OffsetRect(&blamerc, LOCATOR_WIDTH, 0);\r
+               ::OffsetRect(&sourcerc, LOCATOR_WIDTH, 0);\r
+               sourcerc.right -= LOCATOR_WIDTH;\r
+       }\r
+       InvalidateRect(wMain, NULL, FALSE);\r
+    ::SetWindowPos(wEditor, 0, sourcerc.left, sourcerc.top, sourcerc.right - sourcerc.left, sourcerc.bottom - sourcerc.top, 0);\r
+       ::SetWindowPos(wBlame, 0, blamerc.left, blamerc.top, blamerc.right - blamerc.left, blamerc.bottom - blamerc.top, 0);\r
+       if (m_colorage)\r
+               ::SetWindowPos(wLocator, 0, 0, blamerc.top, LOCATOR_WIDTH, blamerc.bottom - blamerc.top, SWP_SHOWWINDOW);\r
+       else\r
+               ::ShowWindow(wLocator, SW_HIDE);\r
+}\r
+\r
+LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
+{\r
+       if (message == uFindReplaceMsg)\r
+       {\r
+               LPFINDREPLACE lpfr = (LPFINDREPLACE)lParam;\r
+\r
+               // If the FR_DIALOGTERM flag is set, \r
+               // invalidate the handle identifying the dialog box. \r
+               if (lpfr->Flags & FR_DIALOGTERM)\r
+               {\r
+                       app.currentDialog = NULL; \r
+                       return 0; \r
+               } \r
+               if (lpfr->Flags & FR_FINDNEXT)\r
+               {\r
+                       app.DoSearch(lpfr->lpstrFindWhat, lpfr->Flags);\r
+               }\r
+               return 0; \r
+       }\r
+       switch (message) \r
+       {\r
+       case WM_CREATE:\r
+               app.wEditor = ::CreateWindow(\r
+                       "Scintilla",\r
+                       "Source",\r
+                       WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_CLIPCHILDREN,\r
+                       0, 0,\r
+                       100, 100,\r
+                       hWnd,\r
+                       0,\r
+                       app.hResource,\r
+                       0);\r
+               app.InitialiseEditor();\r
+               ::ShowWindow(app.wEditor, SW_SHOW);\r
+               ::SetFocus(app.wEditor);\r
+               app.wBlame = ::CreateWindow(\r
+                       _T("TortoiseBlameBlame"), \r
+                       _T("blame"), \r
+                       WS_CHILD | WS_CLIPCHILDREN,\r
+                       CW_USEDEFAULT, 0, \r
+                       CW_USEDEFAULT, 0, \r
+                       hWnd, \r
+                       NULL, \r
+                       app.hResource, \r
+                       NULL);\r
+               ::ShowWindow(app.wBlame, SW_SHOW);\r
+               app.wHeader = ::CreateWindow(\r
+                       _T("TortoiseBlameHeader"), \r
+                       _T("header"), \r
+                       WS_CHILD | WS_CLIPCHILDREN | WS_BORDER,\r
+                       CW_USEDEFAULT, 0, \r
+                       CW_USEDEFAULT, 0, \r
+                       hWnd, \r
+                       NULL, \r
+                       app.hResource, \r
+                       NULL);\r
+               ::ShowWindow(app.wHeader, SW_SHOW);\r
+               app.wLocator = ::CreateWindow(\r
+                       _T("TortoiseBlameLocator"), \r
+                       _T("locator"), \r
+                       WS_CHILD | WS_CLIPCHILDREN | WS_BORDER,\r
+                       CW_USEDEFAULT, 0, \r
+                       CW_USEDEFAULT, 0, \r
+                       hWnd, \r
+                       NULL, \r
+                       app.hResource, \r
+                       NULL);\r
+               ::ShowWindow(app.wLocator, SW_SHOW);\r
+               return 0;\r
+\r
+       case WM_SIZE:\r
+               if (wParam != 1) \r
+               {\r
+            app.InitSize();\r
+               }\r
+               return 0;\r
+\r
+       case WM_COMMAND:\r
+               app.Command(LOWORD(wParam));\r
+               break;\r
+       case WM_NOTIFY:\r
+               app.Notify(reinterpret_cast<SCNotification *>(lParam));\r
+               return 0;\r
+       case WM_DESTROY:\r
+               PostQuitMessage(0);\r
+               break;\r
+       case WM_CLOSE:\r
+               {\r
+                       CRegStdWORD pos(_T("Software\\TortoiseSVN\\TBlamePos"), 0);\r
+                       CRegStdWORD width(_T("Software\\TortoiseSVN\\TBlameSize"), 0);\r
+                       CRegStdWORD state(_T("Software\\TortoiseSVN\\TBlameState"), 0);\r
+                       RECT rc;\r
+                       GetWindowRect(app.wMain, &rc);\r
+                       if ((rc.left >= 0)&&(rc.top >= 0))\r
+                       {\r
+                               pos = MAKELONG(rc.left, rc.top);\r
+                               width = MAKELONG(rc.right-rc.left, rc.bottom-rc.top);\r
+                       }\r
+                       WINDOWPLACEMENT wp = {0};\r
+                       wp.length = sizeof(WINDOWPLACEMENT);\r
+                       GetWindowPlacement(app.wMain, &wp);\r
+                       state = wp.showCmd;\r
+                       ::DestroyWindow(app.wEditor);\r
+                       ::PostQuitMessage(0);\r
+               }\r
+               return 0;\r
+       case WM_SETFOCUS:\r
+               ::SetFocus(app.wBlame);\r
+               break;\r
+       default:\r
+               return DefWindowProc(hWnd, message, wParam, lParam);\r
+       }\r
+       return 0;\r
+}\r
+\r
+LRESULT CALLBACK WndBlameProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
+{\r
+       PAINTSTRUCT ps;\r
+       TRACKMOUSEEVENT mevt;\r
+       HDC hDC;\r
+       switch (message) \r
+       {\r
+       case WM_CREATE:\r
+               return 0;\r
+       case WM_PAINT:\r
+               hDC = BeginPaint(app.wBlame, &ps);\r
+               app.DrawBlame(hDC);\r
+               EndPaint(app.wBlame, &ps);\r
+               break;\r
+       case WM_COMMAND:\r
+               app.Command(LOWORD(wParam));\r
+               break;\r
+       case WM_NOTIFY:\r
+               switch (((LPNMHDR)lParam)->code)\r
+               {\r
+               case TTN_GETDISPINFO:\r
+                       {\r
+                               LPNMHDR pNMHDR = (LPNMHDR)lParam;\r
+                               NMTTDISPINFOA* pTTTA = (NMTTDISPINFOA*)pNMHDR;\r
+                               NMTTDISPINFOW* pTTTW = (NMTTDISPINFOW*)pNMHDR;\r
+                               POINT point;\r
+                               DWORD ptW = GetMessagePos();\r
+                               point.x = GET_X_LPARAM(ptW);\r
+                               point.y = GET_Y_LPARAM(ptW);\r
+                               ::ScreenToClient(app.wBlame, &point);\r
+                               LONG_PTR line = app.SendEditor(SCI_GETFIRSTVISIBLELINE);\r
+                               LONG_PTR height = app.SendEditor(SCI_TEXTHEIGHT);\r
+                               line = line + (point.y/height);\r
+                               if (line >= (LONG)app.revs.size())\r
+                                       break;\r
+                               if (line < 0)\r
+                                       break;\r
+                               LONG rev = app.revs[line];\r
+                               if (line >= (LONG)app.revs.size())\r
+                                       break;\r
+\r
+                               SecureZeroMemory(app.m_szTip, sizeof(app.m_szTip));\r
+                               SecureZeroMemory(app.m_wszTip, sizeof(app.m_wszTip));\r
+                               std::map<LONG, std::string>::iterator iter;\r
+                               if ((iter = app.logmessages.find(rev)) != app.logmessages.end())\r
+                               {\r
+                                       std::string msg;\r
+                                       if (!ShowAuthor)\r
+                                       {\r
+                                               msg += app.authors[line];\r
+                                       }\r
+                                       if (!ShowDate)\r
+                                       {\r
+                                               if (!ShowAuthor) msg += "  ";\r
+                                               msg += app.dates[line];\r
+                                       }\r
+                                       if (!ShowAuthor || !ShowDate)\r
+                                               msg += '\n';\r
+                                       msg += iter->second;\r
+                                       // an empty tooltip string will deactivate the tooltips,\r
+                                       // which means we must make sure that the tooltip won't\r
+                                       // be empty.\r
+                                       if (msg.empty())\r
+                                               msg = _T(" ");\r
+                                       if (pNMHDR->code == TTN_NEEDTEXTA)\r
+                                       {\r
+                                               lstrcpyn(app.m_szTip, msg.c_str(), MAX_LOG_LENGTH*2);\r
+                                               app.StringExpand(app.m_szTip);\r
+                                               pTTTA->lpszText = app.m_szTip;\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               pTTTW->lpszText = app.m_wszTip;\r
+                                               ::MultiByteToWideChar( CP_ACP , 0, msg.c_str(), min(msg.size(), MAX_LOG_LENGTH*2), app.m_wszTip, MAX_LOG_LENGTH*2);\r
+                                               app.StringExpand(app.m_wszTip);\r
+                                       }\r
+                               }\r
+                       }\r
+                       break;\r
+               }\r
+               return 0;\r
+       case WM_DESTROY:\r
+               break;\r
+       case WM_CLOSE:\r
+               return 0;\r
+       case WM_MOUSELEAVE:\r
+               app.m_mouserev = -2;\r
+               app.m_mouseauthor.clear();\r
+               app.ttVisible = FALSE;\r
+               SendMessage(app.hwndTT, TTM_TRACKACTIVATE, FALSE, 0);\r
+               ::InvalidateRect(app.wBlame, NULL, FALSE);\r
+               break;\r
+       case WM_MOUSEMOVE:\r
+               {\r
+                       mevt.cbSize = sizeof(TRACKMOUSEEVENT);\r
+                       mevt.dwFlags = TME_LEAVE;\r
+                       mevt.dwHoverTime = HOVER_DEFAULT;\r
+                       mevt.hwndTrack = app.wBlame;\r
+                       ::TrackMouseEvent(&mevt);\r
+                       POINT pt = {((int)(short)LOWORD(lParam)), ((int)(short)HIWORD(lParam))};\r
+                       ClientToScreen(app.wBlame, &pt);\r
+                       pt.x += 15;\r
+                       pt.y += 15;\r
+                       SendMessage(app.hwndTT, TTM_TRACKPOSITION, 0, MAKELONG(pt.x, pt.y));\r
+                       if (!app.ttVisible)\r
+                       {\r
+                               TOOLINFO ti;\r
+                               ti.cbSize = sizeof(TOOLINFO);\r
+                               ti.hwnd = app.wBlame;\r
+                               ti.uId = 0;\r
+                               SendMessage(app.hwndTT, TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti);\r
+                       }\r
+                       int y = ((int)(short)HIWORD(lParam));\r
+                       LONG_PTR line = app.SendEditor(SCI_GETFIRSTVISIBLELINE);\r
+                       LONG_PTR height = app.SendEditor(SCI_TEXTHEIGHT);\r
+                       line = line + (y/height);\r
+                       app.ttVisible = (line < (LONG)app.revs.size());\r
+                       if ( app.ttVisible )\r
+                       {\r
+                               if (app.authors[line].compare(app.m_mouseauthor) != 0)\r
+                               {\r
+                                       app.m_mouseauthor = app.authors[line];\r
+                               }\r
+                               if (app.revs[line] != app.m_mouserev)\r
+                               {\r
+                                       app.m_mouserev = app.revs[line];\r
+                                       ::InvalidateRect(app.wBlame, NULL, FALSE);\r
+                                       SendMessage(app.hwndTT, TTM_UPDATE, 0, 0);\r
+                               }\r
+                       }\r
+               }\r
+               break;\r
+       case WM_RBUTTONDOWN:\r
+               // fall through\r
+       case WM_LBUTTONDOWN:\r
+               {\r
+                       int y = ((int)(short)HIWORD(lParam));\r
+                       LONG_PTR line = app.SendEditor(SCI_GETFIRSTVISIBLELINE);\r
+                       LONG_PTR height = app.SendEditor(SCI_TEXTHEIGHT);\r
+                       line = line + (y/height);\r
+                       if (line < (LONG)app.revs.size())\r
+                       {\r
+                               app.SetSelectedLine(line);\r
+                               if (app.revs[line] != app.m_selectedrev)\r
+                               {\r
+                                       app.m_selectedrev = app.revs[line];\r
+                                       app.m_selectedorigrev = app.origrevs[line];\r
+                                       app.m_selectedauthor = app.authors[line];\r
+                                       app.m_selecteddate = app.dates[line];\r
+                               }\r
+                               else\r
+                               {\r
+                                       app.m_selectedauthor.clear();\r
+                                       app.m_selecteddate.clear();\r
+                                       app.m_selectedrev = -2;\r
+                                       app.m_selectedorigrev = -2;\r
+                               }\r
+                               ::InvalidateRect(app.wBlame, NULL, FALSE);\r
+                       }\r
+                       else\r
+                       {\r
+                               app.SetSelectedLine(-1);\r
+                       }\r
+               }\r
+               break;\r
+       case WM_SETFOCUS:\r
+               ::SetFocus(app.wBlame);\r
+               app.SendEditor(SCI_GRABFOCUS);\r
+               break;\r
+       case WM_CONTEXTMENU:\r
+               {\r
+                       if (app.m_selectedrev <= 0)\r
+                               break;;\r
+                       int xPos = GET_X_LPARAM(lParam);\r
+                       int yPos = GET_Y_LPARAM(lParam);\r
+                       if ((xPos < 0)||(yPos < 0))\r
+                       {\r
+                               // requested from keyboard, not mouse pointer\r
+                               // use the center of the window\r
+                               RECT rect;\r
+                               GetClientRect(app.wBlame, &rect);\r
+                               xPos = rect.right-rect.left;\r
+                               yPos = rect.bottom-rect.top;\r
+                       }\r
+                       HMENU hMenu = LoadMenu(app.hResource, MAKEINTRESOURCE(IDR_BLAMEPOPUP));\r
+                       HMENU hPopMenu = GetSubMenu(hMenu, 0);\r
+\r
+                       if ( _tcslen(szOrigPath)==0 )\r
+                       {\r
+                               // Without knowing the original path we cannot blame the previous revision\r
+                               // because we don't know which filename to pass to tortoiseproc.\r
+                               EnableMenuItem(hPopMenu,ID_BLAME_PREVIOUS_REVISION, MF_DISABLED|MF_GRAYED);\r
+                       }\r
+                       \r
+                       TrackPopupMenu(hPopMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, xPos, yPos, 0, app.wBlame, NULL); \r
+                       DestroyMenu(hMenu);\r
+               }\r
+               break;\r
+       default:\r
+               return DefWindowProc(hWnd, message, wParam, lParam);\r
+       }\r
+       return 0;\r
+}\r
+\r
+LRESULT CALLBACK WndHeaderProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
+{\r
+       PAINTSTRUCT ps;\r
+       HDC hDC;\r
+       switch (message) \r
+       {\r
+       case WM_CREATE:\r
+               return 0;\r
+       case WM_PAINT:\r
+               hDC = BeginPaint(app.wHeader, &ps);\r
+               app.DrawHeader(hDC);\r
+               EndPaint(app.wHeader, &ps);\r
+               break;\r
+       case WM_COMMAND:\r
+               break;\r
+       case WM_DESTROY:\r
+               break;\r
+       case WM_CLOSE:\r
+               return 0;\r
+       default:\r
+               return DefWindowProc(hWnd, message, wParam, lParam);\r
+       }\r
+       return 0;\r
+}\r
+\r
+LRESULT CALLBACK WndLocatorProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
+{\r
+       PAINTSTRUCT ps;\r
+       HDC hDC;\r
+       switch (message) \r
+       {\r
+       case WM_PAINT:\r
+               hDC = BeginPaint(app.wLocator, &ps);\r
+               app.DrawLocatorBar(hDC);\r
+               EndPaint(app.wLocator, &ps);\r
+               break;\r
+       case WM_LBUTTONDOWN:\r
+       case WM_MOUSEMOVE:\r
+               if (wParam & MK_LBUTTON)\r
+               {\r
+                       RECT rect;\r
+                       ::GetClientRect(hWnd, &rect); \r
+                       int nLine = HIWORD(lParam)*app.revs.size()/(rect.bottom-rect.top);\r
+\r
+                       if (nLine < 0)\r
+                               nLine = 0;\r
+                       app.ScrollToLine(nLine);\r
+               }\r
+               break;\r
+       default:\r
+               return DefWindowProc(hWnd, message, wParam, lParam);\r
+       }\r
+       return 0;\r
+}\r
+\r
+#pragma warning(pop)\r
diff --git a/src/TortoiseBlame/TortoiseBlame.h b/src/TortoiseBlame/TortoiseBlame.h
new file mode 100644 (file)
index 0000000..d6a361b
--- /dev/null
@@ -0,0 +1,160 @@
+// TortoiseBlame - a Viewer for Subversion Blames\r
+\r
+// Copyright (C) 2003-2008 - TortoiseSVN\r
+\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU General Public License\r
+// as published by the Free Software Foundation; either version 2\r
+// of the License, or (at your option) any later version.\r
+\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software Foundation,\r
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
+#pragma once\r
+\r
+#include "resource.h"\r
+#include "Commdlg.h"\r
+#include "Scintilla.h"\r
+#include "SciLexer.h"\r
+#include "registry.h"\r
+\r
+const COLORREF black = RGB(0,0,0);\r
+const COLORREF white = RGB(0xff,0xff,0xff);\r
+const COLORREF red = RGB(0xFF, 0, 0);\r
+const COLORREF offWhite = RGB(0xFF, 0xFB, 0xF0);\r
+const COLORREF darkGreen = RGB(0, 0x80, 0);\r
+const COLORREF darkBlue = RGB(0, 0, 0x80);\r
+const COLORREF lightBlue = RGB(0xA6, 0xCA, 0xF0);\r
+const int blockSize = 128 * 1024;\r
+\r
+#define BLAMESPACE 20\r
+#define HEADER_HEIGHT 18\r
+#define LOCATOR_WIDTH 20\r
+\r
+#define MAX_LOG_LENGTH 2000\r
+\r
+\r
+#ifndef GET_X_LPARAM\r
+#define GET_X_LPARAM(lp)                        ((int)(short)LOWORD(lp))\r
+#endif\r
+#ifndef GET_Y_LPARAM\r
+#define GET_Y_LPARAM(lp)                        ((int)(short)HIWORD(lp))\r
+#endif\r
+\r
+/**\r
+ * \ingroup TortoiseBlame\r
+ * Main class for TortoiseBlame.\r
+ * Handles all child windows, loads the blame files, ...\r
+ */\r
+class TortoiseBlame\r
+{\r
+public:\r
+       TortoiseBlame();\r
+       ~TortoiseBlame();\r
+\r
+       HINSTANCE hInstance;\r
+       HINSTANCE hResource;\r
+       HWND currentDialog;\r
+       HWND wMain;\r
+       HWND wEditor;\r
+       HWND wBlame;\r
+       HWND wHeader;\r
+       HWND wLocator;\r
+       HWND hwndTT;\r
+\r
+       BOOL bIgnoreEOL;\r
+       BOOL bIgnoreSpaces;\r
+       BOOL bIgnoreAllSpaces;\r
+\r
+       LRESULT SendEditor(UINT Msg, WPARAM wParam=0, LPARAM lParam=0);\r
+\r
+       void GetRange(int start, int end, char *text);\r
+\r
+       void SetTitle();\r
+       BOOL OpenFile(const char *fileName);\r
+       BOOL OpenLogFile(const char *fileName);\r
+\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 InitialiseEditor();\r
+    void InitSize();\r
+       LONG GetBlameWidth();\r
+       void DrawBlame(HDC hDC);\r
+       void DrawHeader(HDC hDC);\r
+       void DrawLocatorBar(HDC hDC);\r
+       void StartSearch();\r
+       void CopySelectedLogToClipboard();\r
+       void BlamePreviousRevision();\r
+       void DiffPreviousRevision();\r
+       void ShowLog();\r
+       bool DoSearch(LPSTR what, DWORD flags);\r
+       bool GotoLine(long line);\r
+       bool ScrollToLine(long line);\r
+       void GotoLineDlg();\r
+       static INT_PTR CALLBACK GotoDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);\r
+\r
+       void SetSelectedLine(LONG line) { m_SelectedLine=line;};\r
+\r
+       LONG                                            m_mouserev;\r
+       std::string                                     m_mouseauthor;\r
+       LONG                                            m_selectedrev;\r
+       LONG                                            m_selectedorigrev;\r
+       std::string                                     m_selectedauthor;\r
+       std::string                                     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<std::string>        dates;\r
+       std::vector<std::string>        authors;\r
+       std::vector<std::string>        paths;\r
+       std::map<LONG, std::string>     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
+protected:\r
+       void CreateFont();\r
+       void SetupLexer(LPCSTR filename);\r
+       void SetupCppLexer();\r
+       COLORREF InterColor(COLORREF c1, COLORREF c2, int Slider);\r
+       std::string GetAppDirectory();\r
+       std::vector<COLORREF>           colors;\r
+       HFONT                                           m_font;\r
+       HFONT                                           m_italicfont;\r
+       LONG                                            m_blamewidth;\r
+       LONG                                            m_revwidth;\r
+       LONG                                            m_datewidth;\r
+       LONG                                            m_authorwidth;\r
+       LONG                                            m_pathwidth;\r
+       LONG                                            m_linewidth;\r
+       LONG                                            m_SelectedLine; ///< zero-based\r
+\r
+       COLORREF                                        m_mouserevcolor;\r
+       COLORREF                                        m_mouseauthorcolor;\r
+       COLORREF                                        m_selectedrevcolor;\r
+       COLORREF                                        m_selectedauthorcolor;\r
+       COLORREF                                        m_windowcolor;\r
+       COLORREF                                        m_textcolor;\r
+       COLORREF                                        m_texthighlightcolor;\r
+\r
+       LRESULT                                         m_directFunction;\r
+       LRESULT                                         m_directPointer;\r
+       FINDREPLACE                                     fr;\r
+       TCHAR                                           szFindWhat[80];\r
+\r
+       CRegStdWORD                                     m_regOldLinesColor;\r
+       CRegStdWORD                                     m_regNewLinesColor;\r
+};\r
diff --git a/src/TortoiseBlame/TortoiseBlame.ico b/src/TortoiseBlame/TortoiseBlame.ico
new file mode 100644 (file)
index 0000000..d2e7edd
Binary files /dev/null and b/src/TortoiseBlame/TortoiseBlame.ico differ
diff --git a/src/TortoiseBlame/TortoiseBlame.rc b/src/TortoiseBlame/TortoiseBlame.rc
new file mode 100644 (file)
index 0000000..134f68b
--- /dev/null
@@ -0,0 +1,213 @@
+// Microsoft Visual C++ generated resource script.\r
+//\r
+#include "resource.h"\r
+\r
+#define APSTUDIO_READONLY_SYMBOLS\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 2 resource.\r
+//\r
+#define APSTUDIO_HIDDEN_SYMBOLS\r
+#include "windows.h"\r
+#undef APSTUDIO_HIDDEN_SYMBOLS\r
+#ifndef APSTUDIO_INVOKED\r
+#include "TortoiseBlame.rc2"\r
+#endif\r
+/////////////////////////////////////////////////////////////////////////////\r
+#undef APSTUDIO_READONLY_SYMBOLS\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// English (U.S.) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Menu\r
+//\r
+\r
+IDC_TORTOISEBLAME MENU \r
+BEGIN\r
+    POPUP "&File"\r
+    BEGIN\r
+        MENUITEM "E&xit",                       IDM_EXIT\r
+    END\r
+    POPUP "&Edit"\r
+    BEGIN\r
+        MENUITEM "&Find...",                    ID_EDIT_FIND\r
+        MENUITEM "&Go To Line...",              ID_EDIT_GOTOLINE\r
+    END\r
+    POPUP "View"\r
+    BEGIN\r
+        MENUITEM "&Color age of lines",         ID_VIEW_COLORAGEOFLINES\r
+        MENUITEM "&Merge paths",                ID_VIEW_MERGEPATH\r
+    END\r
+END\r
+\r
+IDR_BLAMEPOPUP MENU \r
+BEGIN\r
+    POPUP "&Copy to clipboard"\r
+    BEGIN\r
+        MENUITEM "&Copy log message to clipboard", ID_COPYTOCLIPBOARD\r
+        MENUITEM SEPARATOR\r
+        MENUITEM "&Blame previous revision",    ID_BLAME_PREVIOUS_REVISION\r
+        MENUITEM "Show &changes",               ID_DIFF_PREVIOUS_REVISION\r
+        MENUITEM "Show &log",                   ID_SHOWLOG\r
+    END\r
+END\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Accelerator\r
+//\r
+\r
+IDC_TORTOISEBLAME ACCELERATORS \r
+BEGIN\r
+    "F",            ID_EDIT_FIND,           VIRTKEY, CONTROL, NOINVERT\r
+    VK_F3,          ID_EDIT_FIND,           VIRTKEY, NOINVERT\r
+    "G",            ID_EDIT_GOTOLINE,       VIRTKEY, CONTROL, NOINVERT\r
+    "/",            IDM_ABOUT,              ASCII,  ALT, NOINVERT\r
+    "?",            IDM_ABOUT,              ASCII,  ALT, NOINVERT\r
+    VK_ESCAPE,      IDM_EXIT,               VIRTKEY, NOINVERT\r
+    "O",            ID_VIEW_COLORAGEOFLINES, VIRTKEY, CONTROL, NOINVERT\r
+END\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Dialog\r
+//\r
+\r
+IDD_GOTODLG DIALOGEX 0, 0, 127, 52\r
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
+CAPTION "Go to line"\r
+FONT 8, "MS Shell Dlg", 400, 0, 0x1\r
+BEGIN\r
+    LTEXT           "Line:",IDC_STATIC,7,10,57,8\r
+    EDITTEXT        IDC_LINENUMBER,70,7,50,14,ES_AUTOHSCROLL | ES_NUMBER\r
+    DEFPUSHBUTTON   "OK",IDOK,7,31,50,14\r
+    PUSHBUTTON      "Cancel",IDCANCEL,70,31,50,14\r
+END\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// DESIGNINFO\r
+//\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+GUIDELINES DESIGNINFO \r
+BEGIN\r
+    IDD_GOTODLG, DIALOG\r
+    BEGIN\r
+        LEFTMARGIN, 7\r
+        RIGHTMARGIN, 120\r
+        VERTGUIDE, 64\r
+        VERTGUIDE, 70\r
+        TOPMARGIN, 7\r
+        BOTTOMMARGIN, 45\r
+    END\r
+END\r
+#endif    // APSTUDIO_INVOKED\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// String Table\r
+//\r
+\r
+STRINGTABLE \r
+BEGIN\r
+    IDS_APP_TITLE           "TortoiseBlame"\r
+    IDS_SEARCHNOTFOUND      "Search string not found!"\r
+    IDC_TORTOISEBLAME       "TORTOISEBLAME"\r
+END\r
+\r
+STRINGTABLE \r
+BEGIN\r
+    IDS_COMMANDLINE_INFO    "TortoiseBlame should not be started directly! Use\nTortoiseProc.exe /command:blame /path:""path\\to\\file""\ninstead.\n\nTortoiseBlame.exe blamefile [logfile [viewtitle]] [/line:linenumber] [/path:originalpath] [/ignoreeol] [/ignorespaces] [/ignoreallspaces]"\r
+END\r
+\r
+STRINGTABLE \r
+BEGIN\r
+    IDS_HEADER_REVISION     "Revision"\r
+    IDS_HEADER_DATE         "Date"\r
+    IDS_HEADER_AUTHOR       "Author"\r
+    IDS_HEADER_LINE         "Line"\r
+END\r
+\r
+STRINGTABLE \r
+BEGIN\r
+    IDS_HEADER_PATH         "Path"\r
+END\r
+\r
+#endif    // English (U.S.) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// German (Switzerland) resources\r
+\r
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DES)\r
+#ifdef _WIN32\r
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_SWISS\r
+#pragma code_page(1252)\r
+#endif //_WIN32\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Icon\r
+//\r
+\r
+// Icon with lowest ID value placed first to ensure application icon\r
+// remains consistent on all systems.\r
+IDI_TORTOISEBLAME       ICON                    "TortoiseBlame.ico"\r
+\r
+#ifdef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// TEXTINCLUDE\r
+//\r
+\r
+1 TEXTINCLUDE \r
+BEGIN\r
+    "resource.h\0"\r
+END\r
+\r
+2 TEXTINCLUDE \r
+BEGIN\r
+    "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"\r
+    "#include ""windows.h""\r\n"\r
+    "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"\r
+    "#ifndef APSTUDIO_INVOKED\r\n"\r
+    "#include ""TortoiseBlame.rc2""\r\n"\r
+    "#endi\0"\r
+END\r
+\r
+3 TEXTINCLUDE \r
+BEGIN\r
+    "\r\0"\r
+END\r
+\r
+#endif    // APSTUDIO_INVOKED\r
+\r
+#endif    // German (Switzerland) resources\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+\r
+\r
+#ifndef APSTUDIO_INVOKED\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Generated from the TEXTINCLUDE 3 resource.\r
+//\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+#endif    // not APSTUDIO_INVOKED\r
+\r
diff --git a/src/TortoiseBlame/TortoiseBlame.rc2 b/src/TortoiseBlame/TortoiseBlame.rc2
new file mode 100644 (file)
index 0000000..516b2c6
--- /dev/null
@@ -0,0 +1,46 @@
+//\r
+// TortoiseBlame.RC2 - resources Microsoft Visual C++ does not edit directly\r
+//\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
+// Add manually edited resources here...\r
+/////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Version\r
+//\r
+#include "..\version.h"\r
+VS_VERSION_INFO VERSIONINFO\r
+ FILEVERSION FILEVER\r
+ PRODUCTVERSION PRODUCTVER\r
+ FILEFLAGSMASK 0x3fL\r
+#ifdef _DEBUG\r
+ FILEFLAGS 0x1L\r
+#else\r
+ FILEFLAGS 0x0L\r
+#endif\r
+ FILEOS 0x4L\r
+ FILETYPE VFT_APP\r
+ FILESUBTYPE 0x0L\r
+BEGIN\r
+    BLOCK "StringFileInfo"\r
+    BEGIN\r
+        BLOCK "040004e4"\r
+        BEGIN\r
+            VALUE "CompanyName", "http://tortoisesvn.net\0"\r
+            VALUE "FileDescription", "TortoiseBlame\0"\r
+            VALUE "FileVersion", STRFILEVER\r
+            VALUE "InternalName", "TortoiseBlame.exe\0"\r
+            VALUE "LegalCopyright", "Copyright (C) 2003-2008 - TortoiseSVN\0"\r
+            VALUE "OriginalFilename", "TortoiseBlame.exe\0"\r
+            VALUE "ProductName", "TortoiseBlame\0"\r
+            VALUE "ProductVersion", STRPRODUCTVER\r
+        END\r
+    END\r
+    BLOCK "VarFileInfo"\r
+    BEGIN\r
+        VALUE "Translation", 0x400, 1252\r
+    END\r
+END\r
+\r
+/////////////////////////////////////////////////////////////////////////////\r
diff --git a/src/TortoiseBlame/TortoiseBlame.vcproj b/src/TortoiseBlame/TortoiseBlame.vcproj
new file mode 100644 (file)
index 0000000..5e9679b
--- /dev/null
@@ -0,0 +1,455 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="TortoiseBlame"\r
+       ProjectGUID="{4424F9D2-12EE-49A7-941E-45767900BEA3}"\r
+       RootNamespace="TortoiseBlame"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="131072"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+               <Platform\r
+                       Name="x64"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="..\..\bin\Debug\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseBlame\Debug"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="..\..\ext\scintilla\include;..\Utils"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               ForceConformanceInForLoopScope="true"\r
+                               UsePrecompiledHeader="2"\r
+                               WarningLevel="4"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="comctl32.lib"\r
+                               OutputFile="$(OutDir)/TortoiseBlame.exe"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               ProgramDatabaseFile="$(OutDir)/TortoiseBlame.pdb"\r
+                               SubSystem="2"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|x64"\r
+                       OutputDirectory="..\..\bin\Debug64\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseBlame\Debug64"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="..\..\ext\scintilla\include;..\Utils"\r
+                               PreprocessorDefinitions="WIN64;_DEBUG;_WINDOWS"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               ForceConformanceInForLoopScope="true"\r
+                               UsePrecompiledHeader="2"\r
+                               WarningLevel="4"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="comctl32.lib"\r
+                               OutputFile="$(OutDir)/TortoiseBlame.exe"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               ProgramDatabaseFile="$(OutDir)/TortoiseBlame.pdb"\r
+                               SubSystem="2"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="..\..\bin\Release\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseBlame\Release"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="1"\r
+                               FavorSizeOrSpeed="2"\r
+                               AdditionalIncludeDirectories="..\..\ext\scintilla\include;..\Utils"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"\r
+                               RuntimeLibrary="2"\r
+                               ForceConformanceInForLoopScope="true"\r
+                               UsePrecompiledHeader="2"\r
+                               WarningLevel="4"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="comctl32.lib"\r
+                               OutputFile="$(OutDir)/TortoiseBlame.exe"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               OptimizeForWindows98="0"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|x64"\r
+                       OutputDirectory="..\..\bin\Release64\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseBlame\Release64"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="1"\r
+                               FavorSizeOrSpeed="2"\r
+                               AdditionalIncludeDirectories="..\..\ext\scintilla\include;..\Utils"\r
+                               PreprocessorDefinitions="WIN64;NDEBUG;_WINDOWS"\r
+                               RuntimeLibrary="2"\r
+                               ForceConformanceInForLoopScope="true"\r
+                               UsePrecompiledHeader="2"\r
+                               WarningLevel="4"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="comctl32.lib"\r
+                               OutputFile="$(OutDir)/TortoiseBlame.exe"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               OptimizeForWindows98="1"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\Utils\CmdLineParser.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Utils\LangDll.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Lexer.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Utils\Registry.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\stdafx.cpp"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               UsePrecompiledHeader="1"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|x64"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               UsePrecompiledHeader="1"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               UsePrecompiledHeader="1"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|x64"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               UsePrecompiledHeader="1"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\TortoiseBlame.cpp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\Utils\CmdLineParser.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Utils\LangDll.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Utils\registry.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\stdafx.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\TortoiseBlame.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\TortoiseBlame.ico"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\TortoiseBlame.rc"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+               <Global\r
+                       Name="DevPartner_IsInstrumented"\r
+                       Value="0"\r
+               />\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/src/TortoiseBlame/TortoiseBlame.vcproj.FSL.B20596.user b/src/TortoiseBlame/TortoiseBlame.vcproj.FSL.B20596.user
new file mode 100644 (file)
index 0000000..16bbce6
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioUserFile\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       ShowAllFiles="false"\r
+       >\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       >\r
+                       <DebugSettings\r
+                               Command="$(TargetPath)"\r
+                               WorkingDirectory=""\r
+                               CommandArguments=""\r
+                               Attach="false"\r
+                               DebuggerType="3"\r
+                               Remote="1"\r
+                               RemoteMachine="B20596-01"\r
+                               RemoteCommand=""\r
+                               HttpUrl=""\r
+                               PDBPath=""\r
+                               SQLDebugging=""\r
+                               Environment=""\r
+                               EnvironmentMerge="true"\r
+                               DebuggerFlavor=""\r
+                               MPIRunCommand=""\r
+                               MPIRunArguments=""\r
+                               MPIRunWorkingDirectory=""\r
+                               ApplicationCommand=""\r
+                               ApplicationArguments=""\r
+                               ShimCommand=""\r
+                               MPIAcceptMode=""\r
+                               MPIAcceptFilter=""\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       >\r
+                       <DebugSettings\r
+                               Command="$(TargetPath)"\r
+                               WorkingDirectory=""\r
+                               CommandArguments=""\r
+                               Attach="false"\r
+                               DebuggerType="3"\r
+                               Remote="1"\r
+                               RemoteMachine="B20596-01"\r
+                               RemoteCommand=""\r
+                               HttpUrl=""\r
+                               PDBPath=""\r
+                               SQLDebugging=""\r
+                               Environment=""\r
+                               EnvironmentMerge="true"\r
+                               DebuggerFlavor=""\r
+                               MPIRunCommand=""\r
+                               MPIRunArguments=""\r
+                               MPIRunWorkingDirectory=""\r
+                               ApplicationCommand=""\r
+                               ApplicationArguments=""\r
+                               ShimCommand=""\r
+                               MPIAcceptMode=""\r
+                               MPIAcceptFilter=""\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+</VisualStudioUserFile>\r
diff --git a/src/TortoiseBlame/TortoiseBlameLang.vcproj b/src/TortoiseBlame/TortoiseBlameLang.vcproj
new file mode 100644 (file)
index 0000000..beee237
--- /dev/null
@@ -0,0 +1,377 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       Name="TortoiseBlameLang"\r
+       ProjectGUID="{ED498504-302E-4CE1-974A-A00CAD156C78}"\r
+       RootNamespace="TortoiseProcLang"\r
+       Keyword="Win32Proj"\r
+       TargetFrameworkVersion="131072"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+               <Platform\r
+                       Name="x64"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="..\..\bin\Release\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseBlameLang\Release"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TORTOISELANG_EXPORTS"\r
+                               RuntimeLibrary="0"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               AdditionalIncludeDirectories="..\TortoiseShell"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/$(ProjectName).dll"\r
+                               LinkIncremental="1"\r
+                               IgnoreAllDefaultLibraries="true"\r
+                               GenerateDebugInformation="false"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               ResourceOnlyDLL="true"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               ImportLibrary="$(OutDir)/$(TargetName).lib"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine=""\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|x64"\r
+                       OutputDirectory="..\..\bin\release64\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseBlameLang\Release64"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TORTOISELANG_EXPORTS"\r
+                               RuntimeLibrary="0"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               AdditionalIncludeDirectories="..\TortoiseShell"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/$(ProjectName).dll"\r
+                               LinkIncremental="1"\r
+                               IgnoreAllDefaultLibraries="true"\r
+                               GenerateDebugInformation="false"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               ResourceOnlyDLL="true"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               ImportLibrary="$(OutDir)/$(TargetName).lib"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine=""\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="..\..\bin\Debug\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseBlameLang\Debug"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TORTOISELANG_EXPORTS"\r
+                               RuntimeLibrary="0"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               AdditionalIncludeDirectories="..\TortoiseShell"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/$(ProjectName).dll"\r
+                               LinkIncremental="1"\r
+                               IgnoreAllDefaultLibraries="true"\r
+                               GenerateDebugInformation="false"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               ResourceOnlyDLL="true"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               ImportLibrary="$(OutDir)/$(TargetName).lib"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine=""\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|x64"\r
+                       OutputDirectory="..\..\bin\debug64\bin"\r
+                       IntermediateDirectory="..\..\obj\TortoiseBlameLang\Debug64"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TORTOISELANG_EXPORTS"\r
+                               RuntimeLibrary="0"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               AdditionalIncludeDirectories="..\TortoiseShell"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               OutputFile="$(OutDir)/$(ProjectName).dll"\r
+                               LinkIncremental="1"\r
+                               IgnoreAllDefaultLibraries="true"\r
+                               GenerateDebugInformation="false"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               ResourceOnlyDLL="true"\r
+                               RandomizedBaseAddress="1"\r
+                               DataExecutionPrevention="0"\r
+                               ImportLibrary="$(OutDir)/$(TargetName).lib"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine=""\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\resource.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\TortoiseBlame.rc"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+               <Global\r
+                       Name="DevPartner_IsInstrumented"\r
+                       Value="0"\r
+               />\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/src/TortoiseBlame/TortoiseBlameLang.vcproj.FSL.B20596.user b/src/TortoiseBlame/TortoiseBlameLang.vcproj.FSL.B20596.user
new file mode 100644 (file)
index 0000000..834912e
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioUserFile\r
+       ProjectType="Visual C++"\r
+       Version="9.00"\r
+       ShowAllFiles="false"\r
+       >\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       >\r
+                       <DebugSettings\r
+                               Command=""\r
+                               WorkingDirectory=""\r
+                               CommandArguments=""\r
+                               Attach="false"\r
+                               DebuggerType="3"\r
+                               Remote="1"\r
+                               RemoteMachine="B20596-01"\r
+                               RemoteCommand=""\r
+                               HttpUrl=""\r
+                               PDBPath=""\r
+                               SQLDebugging=""\r
+                               Environment=""\r
+                               EnvironmentMerge="true"\r
+                               DebuggerFlavor=""\r
+                               MPIRunCommand=""\r
+                               MPIRunArguments=""\r
+                               MPIRunWorkingDirectory=""\r
+                               ApplicationCommand=""\r
+                               ApplicationArguments=""\r
+                               ShimCommand=""\r
+                               MPIAcceptMode=""\r
+                               MPIAcceptFilter=""\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       >\r
+                       <DebugSettings\r
+                               Command=""\r
+                               WorkingDirectory=""\r
+                               CommandArguments=""\r
+                               Attach="false"\r
+                               DebuggerType="3"\r
+                               Remote="1"\r
+                               RemoteMachine="B20596-01"\r
+                               RemoteCommand=""\r
+                               HttpUrl=""\r
+                               PDBPath=""\r
+                               SQLDebugging=""\r
+                               Environment=""\r
+                               EnvironmentMerge="true"\r
+                               DebuggerFlavor=""\r
+                               MPIRunCommand=""\r
+                               MPIRunArguments=""\r
+                               MPIRunWorkingDirectory=""\r
+                               ApplicationCommand=""\r
+                               ApplicationArguments=""\r
+                               ShimCommand=""\r
+                               MPIAcceptMode=""\r
+                               MPIAcceptFilter=""\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+</VisualStudioUserFile>\r
diff --git a/src/TortoiseBlame/resource.h b/src/TortoiseBlame/resource.h
new file mode 100644 (file)
index 0000000..143ef17
--- /dev/null
@@ -0,0 +1,45 @@
+//{{NO_DEPENDENCIES}}\r
+// Microsoft Visual C++ generated include file.\r
+// Used by TortoiseBlame.rc\r
+//\r
+#define IDC_MYICON                      2\r
+#define IDD_TORTOISEBLAME_DIALOG        102\r
+#define IDS_APP_TITLE                   103\r
+#define IDM_ABOUT                       104\r
+#define IDS_SEARCHNOTFOUND              104\r
+#define IDM_EXIT                        105\r
+#define IDI_TORTOISEBLAME               107\r
+#define IDI_SMALL                       108\r
+#define IDC_TORTOISEBLAME               109\r
+#define IDR_MAINFRAME                   128\r
+#define IDR_BLAMEPOPUP                  129\r
+#define IDD_GOTODLG                     130\r
+#define IDS_COMMANDLINE_INFO            200\r
+#define IDS_HEADER_REVISION             300\r
+#define IDS_HEADER_DATE                 301\r
+#define IDS_HEADER_AUTHOR               302\r
+#define IDS_HEADER_LINE                 303\r
+#define IDS_HEADER_PATH                 304\r
+#define IDC_LINENUMBER                  1000\r
+#define ID_EDIT_FIND                    32771\r
+#define ID_COPYTOCLIPBOARD_COPYTOCLIPBOARD 32775\r
+#define ID_COPYTOCLIPBOARD              32776\r
+#define ID_EDIT_GOTOLINE                32779\r
+#define ID_BLAME_PREVIOUS_REVISION      32782\r
+#define ID_DIFF_PREVIOUS_REVISION       32783\r
+#define ID_SHOWLOG                      32784\r
+#define ID_VIEW_COLORAGEOFLINES         32785\r
+#define ID_VIEW_MERGEPATH               32786\r
+#define IDC_STATIC                      -1\r
+\r
+// Next default values for new objects\r
+// \r
+#ifdef APSTUDIO_INVOKED\r
+#ifndef APSTUDIO_READONLY_SYMBOLS\r
+#define _APS_NO_MFC                     1\r
+#define _APS_NEXT_RESOURCE_VALUE        131\r
+#define _APS_NEXT_COMMAND_VALUE         32787\r
+#define _APS_NEXT_CONTROL_VALUE         1001\r
+#define _APS_NEXT_SYMED_VALUE           110\r
+#endif\r
+#endif\r
diff --git a/src/TortoiseBlame/stdafx.cpp b/src/TortoiseBlame/stdafx.cpp
new file mode 100644 (file)
index 0000000..f848718
--- /dev/null
@@ -0,0 +1,5 @@
+// stdafx.cpp : source file that includes just the standard includes\r
+// TortoiseBlame.pch will be the pre-compiled header\r
+// stdafx.obj will contain the pre-compiled type information\r
+\r
+#include "stdafx.h"\r
diff --git a/src/TortoiseBlame/stdafx.h b/src/TortoiseBlame/stdafx.h
new file mode 100644 (file)
index 0000000..4db5a9c
--- /dev/null
@@ -0,0 +1,29 @@
+// stdafx.h : include file for standard system include files,\r
+// or project specific include files that are used frequently, but\r
+// are changed infrequently\r
+//\r
+\r
+#pragma once\r
+\r
+\r
+#define WIN32_LEAN_AND_MEAN            // Exclude rarely-used stuff from Windows headers\r
+#define _WIN32_WINNT 0x0500\r
+\r
+// Windows Header Files:\r
+#include <windows.h>\r
+// C RunTime Header Files\r
+#include <stdlib.h>\r
+#include <malloc.h>\r
+#include <memory.h>\r
+#include <tchar.h>\r
+#include <shlwapi.h>\r
+#include <richedit.h>\r
+#include <commctrl.h>\r
+\r
+#pragma warning(push)\r
+#pragma warning(disable: 4702) // Unreachable code warnings in xtree\r
+#include <string>\r
+#include <vector>\r
+#include <map>\r
+#include <fstream>\r
+#pragma warning(pop)\r