1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2010 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 class LineColors
: public std::map
<int, linecolors_t
>
33 void AddShotColor(int pos
, COLORREF b
)
35 // make sure position exists
38 (*this)[pos
].shot
= b
;
41 void SetColor(int pos
, COLORREF f
, COLORREF b
)
50 void SetColor(int pos
, const linecolors_t
&c
)
52 linecolors_t cNew
= c
;
53 cNew
.shot
= c
.background
;
57 void SplitBlock(int pos
) /// insert colormark with same value as previous position defines
59 std::map
<int, linecolors_t
>::const_iterator it
= this->upper_bound(pos
);
60 if (it
!= this->cbegin())
62 if ((it
== this->cend()) || (it
->first
!= pos
))
64 SetColor(pos
, (--it
)->second
);
67 else if (it
!= this->cend())
69 SetColor(pos
, it
->second
);