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.
24 * Class to create an svg file.
25 * Provides method to add svg primitives like lines, rectangles, text.
27 * \remark this class is specifically tailored to the TSVN revision graph.
28 * That's why the color params are Gdiplus::Color and not simple COLORREFs,
29 * and also the styles and attributes of the used primitives are set
30 * the way it's required for the revision graph.
38 bool Save(const CString
& path
);
40 void StartGroup() { objects
.push_back("<g>"); }
41 void EndGroup() { objects
.push_back("</g>"); }
42 void SetViewSize(int w
, int h
) { viewportWidth
= w
; viewportHeight
= h
; }
43 void RoundedRectangle(int x
, int y
, int width
, int height
, Gdiplus::Color stroke
, int penWidth
, Gdiplus::Color fill
, int radius
= 0);
44 void Polygon(const Gdiplus::PointF
* points
, int numPoints
, Gdiplus::Color stroke
, int penWidth
, Gdiplus::Color fill
);
45 void GradientRectangle(int x
, int y
, int width
, int height
, Gdiplus::Color topColor
, Gdiplus::Color bottomColor
, Gdiplus::Color stroke
);
46 void PolyBezier(const POINT
* points
, int numPoints
, Gdiplus::Color stroke
);
47 void Ellipse(int x
, int y
, int width
, int height
, Gdiplus::Color stroke
, int penWidth
, Gdiplus::Color fill
);
48 void CenteredText(int x
, int y
, LPCSTR font
, int fontsize
, bool italic
, bool bold
, Gdiplus::Color color
, LPCSTR text
);
50 DWORD
GetColor(Gdiplus::Color c
);
52 std::vector
<CStringA
> objects
;