// 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 // 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 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@