source: tags/0.6.8/lib/css.cc @ 848

Last change on this file since 848 was 731, checked in by Peter Johansson, 13 years ago

update copyright statements

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.9 KB
Line 
1// $Id: css.cc 731 2008-12-15 19:03:04Z peter $
2
3/*
4  Copyright (C) 2006 Peter Johansson
5  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
6  Copyright (C) 2008 Peter Johansson
7
8  This file is part of svndigest, http://dev.thep.lu.se/svndigest
9
10  svndigest is free software; you can redistribute it and/or modify it
11  under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14
15  svndigest is distributed in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23  02111-1307, USA.
24*/
25
26#include "css.h"
27#include <config.h>
28
29#include <fstream>
30#include <string>
31
32namespace theplu{
33namespace svndigest{
34
35  void print_css(const std::string& str)
36  {
37    std::ofstream s(str.c_str());
38    s << "<-- svndigest.css generated by " << PACKAGE_STRING << "\n"
39
40      << "Copyright (C) 2006 Peter Johansson\n"
41      << "Copyright (C) 2007 Jari Häkkinen, Peter Johansson\n\n"
42      << "This file is part of svndigest, " 
43      << "http://dev.thep.lu.se/svndigest\n\n"
44
45      << "svndigest is free software; you can redistribute it and/or " 
46      << "modify it\n"
47      << "under the terms of the GNU General Public License as published by\n"
48      << "the Free Software Foundation; either version 2 of the License, or\n"
49      << "(at your option) any later version.\n\n"
50
51      << "svndigest is distributed in the hope that it will be useful, but\n"
52      << "WITHOUT ANY WARRANTY; without even the implied warranty of\n"
53      << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
54      << "General Public License for more details.\n\n"
55
56      << "You should have received a copy of the GNU General Public License\n"
57      << "along with this program; if not, write to the Free Software\n"
58      << "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n"
59      << "02111-1307, USA.\n\n"
60
61      << "This file was initially inspired by the cascading style sheet\n"
62      << "within the Trac open source project (http://trac.edgewall.org/)\n"
63      << "Copyright (C) 2003-2006 Edgewall Software\n"
64      << "All rights reserved.\n\n"
65
66      << "Redistribution and use in source and binary forms, with or without\n"
67      << "modification, are permitted provided that the following conditions\n"
68      << "are met:\n\n"
69     
70      << "1. Redistributions of source code must retain the above copyright\n"
71      << "   notice, this list of conditions and the following disclaimer.\n"
72      << "2. Redistributions in binary form must reproduce the above copyright\n"
73      << "   notice, this list of conditions and the following disclaimer in\n"
74      << "   the documentation and/or other materials provided with the\n"
75      << "   distribution.\n"
76      << "3. The name of the author may not be used to endorse or promote\n"
77      << "   products derived from this software without specific prior\n"
78      << "   written permission.\n\n"
79     
80      << "THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS\n"
81      << "OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n"
82      << "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n"
83      << "ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n"
84      << "DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n"
85      << "DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n"
86      << "GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n"
87      << "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n"
88      << "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n"
89      << "NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n"
90      << "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-->\n";
91
92    s << "body {\n";
93    s << " background: #fff; \n";
94    s << " color: #000; \n";
95    s << " margin: 0px; \n";
96    s << " padding: 0; \n";
97    s << "} \n";
98    s << "\n";
99
100    s << "#menu {\n";
101    s << " background: #eee;\n";
102    s << " width: 100%;\n";
103    s << " margin: 0px;\n";
104    s << " padding: 0px;\n";
105    s << "}\n\n";
106    s << "#menu ul\n";
107    s << "{ \n";
108    s << "padding: 0px;\n";
109    s << "margin: 0px;list-style-type: none; text-align: center;"
110      << "border-bottom: 1px solid black;}\n";
111    s << "#menu ul li { display: inline; border-right: 1px solid black;}\n";
112    s << "#menu ul li a {text-decoration: none; padding-right: 1em;" 
113      << "padding-left: 1em; margin: 0px;}\n";
114    s << "#menu ul li a:hover{ color: #000; background: #ddd;}\n";
115    s << "#menu ul li.highlight a {color: #fff; background: #777; }";
116    s << "\n";
117    s << "#main {\n";
118    s << " margin: 10px; \n";
119    s << "}\n";
120    s << "\n";
121
122    s << "body, th, td {\n";
123    s << " font: normal 13px verdana,arial,'Bitstream Vera Sans',"
124      << "helvetica,sans-serif;\n";
125    s << "}\n";
126    s << ":link, :visited {\n";
127    s << " text-decoration: none;\n";
128    s << " color: #b00;\n";
129    s << "}\n";
130    s << "\n";
131
132    s << "div.main {\n";
133    s << "margin-top: 50px;\n";         
134    s << "margin-left: 50px;\n";
135    s << " \n";
136    s << "}\n";
137
138    s << "table.main {\n"; 
139    s << " text-align: left;\n";
140    s << " padding: 0 1em .1em 0;\n";
141    s << "}\n";
142    s << "table.main th {\n";
143    s << " text-align: left;\n";
144    s << " padding: 0 1em 0.5em 0;\n";
145    s << " font-size: 150%;\n";
146    s << " font-wheight: bold;\n";
147    s << "}\n";
148    s << "table.main td {\n";
149    s << " padding: 0 1em .1em 0;\n";
150    s << "}\n\n";
151
152
153    s << "p.plot { text-align: center; }\n";
154    s << "p.plot img { border: 0; }\n";
155
156    s << "p.footer {\n";
157    s << "text-align: center;\n";
158    s << "font-size: 70%;\n";
159    s << "}\n\n";
160
161    s << "table.blame {\n";
162    s << " border: 1px solid #ddd;\n";
163    s << " border-spacing: 0;\n";
164    s << " border-top: 0;\n";
165    s << " empty-cells: show;\n";
166    s << " font-size: 12px;\n";
167    s << " line-height: 130%;\n";
168    s << " padding: 0;\n";
169    s << " margin: 0 auto;\n";
170    s << " table-layout: fixed;\n";
171    s << " width: 100%;\n";
172    s << "}\n";
173    s << "table.blame th {\n";
174    s << " border-right: 1px solid #d7d7d7;\n";
175    s << " border-bottom: 1px solid #998;\n";
176    s << " font-size: 11px;\n";
177    s << "}\n";
178    s << "table.blame th.author { width: 5em; text-align:right }\n";
179    s << "table.blame th.date { width: 8em; text-align:center }\n";
180    s << "table.blame th.rev { width: 3em }\n";
181    s << "table.blame th.line { width: 3em }\n";
182    s << "table.blame thead th {\n";
183    s << " background: #eee;\n";
184    s << " border-top: 1px solid #d7d7d7;\n";
185    s << " color: #999;\n";
186    s << " padding: 0 .25em;\n";
187    s << " text-align: center;\n";
188    s << " white-space: nowrap;\n";
189    s << "}\n";
190    s << "table.blame tbody td {\n";
191    s << " border-right: 1px solid #f0f0f0;\n";
192    s << " font: normal 11px monospace;\n";
193    s << " overflow: hidden;\n";
194    s << " padding: 1px 2px;\n";
195    s << " vertical-align: top;\n";
196    s << "}\n";
197    s << "table.blame tbody td.author { text-align: right; }\n";
198    s << "table.blame tbody td.date {text-align:right;padding-right:1.45em;}\n";
199    s << "table.blame tbody td.rev { text-align: right; }\n";
200    s << "table.blame tbody td.line-code { text-align: right; " 
201      << "background: #cfcfff; }\n";
202    s << "table.blame tbody td.line-comment { text-align: right; "
203      << "background: #e8e8ff; }\n";
204    s << "table.blame tbody td.line-other { text-align: right; "
205      << "background: #ffffff; }\n";
206    s << "table.blame tbody tr:hover { background: #eed; }\n";
207    s << "\n";
208
209    s << "table.listings {\n";
210    s << " clear: both;\n";
211    s << " border-bottom: 1px solid #d7d7d7;\n";
212    s << " border-collapse: collapse;\n";
213    s << " border-spacing: 0;\n";
214    s << " margin-top: 1em;\n";
215    s << " width: 100%;\n";
216    s << "}\n";
217    s << "\n";
218    s << "table.listings th {\n";
219    s << " text-align: left;\n";
220    s << " padding: 0 1em .1em 0;\n";
221    s << " font-size: 12px\n";
222    s << "}\n";
223    s << "table.listings thead { background: #f7f7f0 }\n";
224    s << "table.listings thead th {\n";
225    s << " border: 1px solid #d7d7d7;\n";
226    s << " border-bottom-color: #999;\n";
227    s << " font-size: 11px;\n";
228    s << " font-wheight: bold;\n";
229    s << " padding: 2px .5em;\n";
230    s << " vertical-align: bottom;\n";
231    s << "}\n";
232    s << "\n";
233    s << "table.listings tbody td, table.listing tbody th {\n";
234    s << " border: 1px dotted #ddd;\n";
235    s << " padding: .33em .5em;\n";
236    s << " vertical-align: top;\n";
237    s << "}\n";
238    s << "\n";
239    s << "table.listings tbody tr { border-top: 1px solid #ddd }\n";
240    s << "table.listings tbody tr.light { background-color: #fcfcfc }\n";
241    s << "table.listings tbody tr.dark { background-color: #f7f7f7 }\n";
242    s << "table.listings tbody tr:hover { background: #eed }\n";
243    s << "table.listings tbody td { text-align: left }\n";
244    s << "table.listings tbody td a { display: block; }\n";
245    s << "table.listings tbody td.directory a { font-weight: bold }\n";
246    s << "\n";
247
248    s << ".sep { color: #666}\n";
249    s.close();
250  }
251
252}} // end of namespace svndigest and namespace theplu
Note: See TracBrowser for help on using the repository browser.