"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/src/include/svggenerator.h" (12 May 2020, 2435 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /***************************************************************************
    2                           xmlcode.h  -  description
    3                              -------------------
    4     begin                : Mo 23.06.2008
    5     copyright            : (C) 2008 by Andre Simon
    6     email                : a.simon@mailbox.org
    7  ***************************************************************************/
    8 
    9 
   10 /*
   11 This file is part of Highlight.
   12 
   13 Highlight is free software: you can redistribute it and/or modify
   14 it under the terms of the GNU General Public License as published by
   15 the Free Software Foundation, either version 3 of the License, or
   16 (at your option) any later version.
   17 
   18 Highlight is distributed in the hope that it will be useful,
   19 but WITHOUT ANY WARRANTY; without even the implied warranty of
   20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   21 GNU General Public License for more details.
   22 
   23 You should have received a copy of the GNU General Public License
   24 along with Highlight.  If not, see <http://www.gnu.org/licenses/>.
   25 */
   26 
   27 
   28 #ifndef SVGGenerator_H
   29 #define SVGGenerator_H
   30 
   31 #include "codegenerator.h"
   32 
   33 namespace highlight
   34 {
   35 
   36 /**
   37    \brief This class generates SVG.
   38 
   39    It contains information about the resulting document structure (document
   40    header and footer), the colour system, white space handling and text
   41    formatting attributes.
   42 
   43 * @author Andre Simon
   44 */
   45 
   46 class SVGGenerator : public highlight::CodeGenerator
   47 {
   48 public:
   49 
   50     SVGGenerator();
   51     ~SVGGenerator();
   52 
   53     /** Set SVG dimensions
   54         \param w page width
   55         \param h page height
   56     */
   57     void setSVGSize ( const string& w, const string& h );
   58 
   59 private:
   60 
   61     /** prints document header
   62      */
   63     string getHeader();
   64 
   65     /** Prints document footer*/
   66     string getFooter();
   67 
   68     /** Prints document body*/
   69     void printBody();
   70 
   71     /** initialize tags in specific format according to colouring information provided in DucumentStyle */
   72     void initOutputTags();
   73 
   74     string styleDefinitionCache;
   75     string width, height;
   76 
   77     string getStyleDefinition();
   78 
   79     string getAttributes ( const string &, const ElementStyle & );
   80 
   81     /** \return escaped character*/
   82     virtual string maskCharacter ( unsigned char );
   83 
   84     string getOpenTag ( const string& );
   85 
   86     string getKeywordOpenTag ( unsigned int styleID );
   87     string getKeywordCloseTag ( unsigned int styleID );
   88 
   89     /** @return Newline string */
   90     string getNewLine();
   91 };
   92 
   93 }
   94 
   95 #endif