Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/blahtexml/source/mainPng.h
blob: 3c79ffec80d588a1648da215aa4beff6687c5a95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// File "mainPng.h"
//
// blahtex (version 0.4.4)
// a TeX to MathML converter designed with MediaWiki in mind
// Copyright (C) 2006, David Harvey
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#ifndef BLAHTEX_MAINPNG_H
#define BLAHTEX_MAINPNG_H

#include <string>

// Records information about a PNG file generated by MakePngFile.
struct PngInfo
{
    // The PNG is stored in md5.png.
    std::string mMd5;
    
    // These are the height and depth reported by dvipng.
    // They are only valid if mDimensionsValid is set.
    bool mDimensionsValid;
    int mHeight;
    int mDepth;
    
    PngInfo() :
        mDimensionsValid(false)
    { }
};

// Generates a PNG file. Uses tempDirectory for storage of temporary files
// (.tex, .dvi, .log, .data). Expects tempDirectory and pngDirectory to
// include a terminating slash. The output file will be stored in the
// directory pngDirectory in the file pngFilename; if pngFilename is an
// empty string, MakePngFile will just use the md5 that it computes (which
// gets returned in PngInfo).
extern PngInfo MakePngFile(
    const std::wstring& purifiedTex,
    const std::string& tempDirectory,
    const std::string& pngDirectory,
    const std::string& pngFilename,
    const std::string& shellLatex,
    const std::string& shellDvipng,
    bool deleteTempFiles
);


#endif

// end of file @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@