Definition of class KLFBackend. More...
#include <QString>
#include <QStringList>
#include <QByteArray>
#include <QImage>
#include <QMutex>
#include <QMap>
#include <QVariant>
#include <klfdefs.h>
#include <klfpobj.h>
#include <klfutil.h>
Go to the source code of this file.
Classes | |
class | KLFBackend |
The main engine for KLatexFormula. More... | |
struct | KLFBackend::klfSettings |
General settings for KLFBackend::getLatexFormula() More... | |
struct | KLFBackend::klfInput |
Specific input to KLFBackend::getLatexFormula() More... | |
struct | KLFBackend::klfOutput |
KLFBackend::getLatexFormula() result. More... | |
class | KLFBackend::TemplateGenerator |
class | KLFBackend::DefaultTemplateGenerator |
class | KLFAbstractLatexMetaInfo |
Reading and writing klfbackend meta-info. More... | |
class | KLFImageLatexMetaInfo |
class | KLFPdfmarksWriteLatexMetaInfo |
Write metainfo to PDF files via pdfmarks for ghostscript. More... | |
Defines | |
#define | KLFERR_NOERROR 0 |
No Error. | |
#define | KLFERR_TEMPDIR_FAIL -48 |
Failed to create the temporary directory. | |
#define | KLFERR_MISSINGLATEXFORMULA -1 |
No LaTeX formula is specified (empty string) | |
#define | KLFERR_MISSINGMATHMODETHREEDOTS -2 |
The "..." is missing in math mode string. | |
#define | KLFERR_TEXWRITEFAIL -3 |
Error while opening .tex file for writing. | |
#define | KLFERR_LATEX_NORUN -4 |
Error while launching the given latex program. | |
#define | KLFERR_NOLATEXPROG KLFERR_LATEX_NORUN |
obsolete, same as KLFERR_LATEX_NORUN | |
#define | KLFERR_LATEX_NONORMALEXIT -5 |
latex program did not exit properly (program killed) (see also KLFERR_PROGERR_LATEX) | |
#define | KLFERR_LATEXNONORMALEXIT KLFERR_LATEX_NONORMALEXIT |
obsolete, same as KLFERR_LATEX_NONORMALEXIT | |
#define | KLFERR_LATEX_NOOUTPUT -6 |
No .dvi file appeared after runnig latex program. | |
#define | KLFERR_NODVIFILE KLFERR_LATEX_NOOUTPUT |
obsolete, same as KLFERR_LATEX_NOOUTPUT | |
#define | KLFERR_LATEX_OUTPUTREADFAIL -24 |
Error while opening .dvi file for reading. | |
#define | KLFERR_DVIREADFAIL KLFERR_LATEX_OUTPUTREADFAIL |
obsolete, same as KLFERR_LATEX_OUTPUTREADFAIL | |
#define | KLFERR_DVIPS_NORUN -7 |
Error while launching the given dvips program. | |
#define | KLFERR_NODVIPSPROG KLFERR_DVIPS_NORUN |
obsolete, same as KLFERR_DVIPS_NORUN | |
#define | KLFERR_DVIPS_NONORMALEXIT -8 |
dvips program did not exit properly (program killed) (see also KLFERR_PROGERR_DVIPS) | |
#define | KLFERR_DVIPSNONORMALEXIT KLFERR_DVIPS_NONORMALEXIT |
obsolete, same as KLFERR_DVIPS_NONORMALEXIT | |
#define | KLFERR_DVIPS_NOOUTPUT -9 |
no .eps file appeared after running dvips program | |
#define | KLFERR_NOEPSFILE KLFERR_DVIPS_NOOUTPUT |
obsolete, same as KLFERR_DVIPS_NOOUTPUT | |
#define | KLFERR_DVIPS_OUTPUTREADFAIL -10 |
Error while opening .eps file for reading. | |
#define | KLFERR_EPSREADFAIL KLFERR_DVIPS_OUTPUTREADFAIL |
obsolete, same as KLFERR_DVIPS_OUTPUTREADFAIL | |
#define | KLFERR_DVIPS_OUTPUTNOBBOX -11 |
Error while reading/parsing %BoundingBox: in dvips output. | |
#define | KLFERR_NOEPSBBOX KLFERR_DVIPS_OUTPUTNOBBOX |
obsolete, same as KLFERR_DVIPS_OUTPUTNOBBOX | |
#define | KLFERR_GSBBOX_NORUN -25 |
Program 'gs' cannot be executed to calculate bounding box. | |
#define | KLFERR_GSBBOX_NONORMALEXIT -26 |
Program 'gs' crashed while calculating bbox (see also KLFERR_PROGERR_GSBBOX) | |
#define | KLFERR_GSBBOX_NOOUTPUT -27 |
Program 'gs' didn't provide any output. | |
#define | KLFERR_GSBBOX_NOBBOX -28 |
Program 'gs' calculating bbox didn't provide parsable output. | |
#define | KLFERR_GSPOSTPROC_NORUN -29 |
Program 'gs' cannot be executed to post-process EPS file (page size, outline fonts) | |
#define | KLFERR_GSPOSTPROC_NONORMALEXIT -30 |
Program 'gs' crashed while post-processing EPS file (see also KLFERR_PROGERR_GSPOSTPROC) | |
#define | KLFERR_GSPOSTPROC_NOOUTPUT -22 |
Program 'gs' didn't provide any data after post-processing EPS file. | |
#define | KLFERR_GSPOSTPROC_NOOUTLINEFONTS -49 |
'gs' cannot outline fonts: need version <= 9.07 (pswrite -dNOCACHE) or >= 9.15 (ps2write -dNoOutputFonts) | |
#define | KLFERR_NOEPSFILE_OF KLFERR_GSPOSTPROC_NOOUTPUT |
obsolete, same as KLFERR_GSPOSTPROC_NOOUTPUT | |
#define | KLFERR_GSPOSTPROC_OUTPUTREADFAIL -23 |
Couldn't read output provided by 'gs' program after post-processing EPS file. | |
#define | KLFERR_EPSREADFAIL_OF KLFERR_GSPOSTPROC_OUTPUTREADFAIL |
obsolete, same as KLFERR_GSPOSTPROC_OUTPUTREADFAIL | |
#define | KLFERR_GSPNG_NORUN -14 |
Program 'gs' couldn't be executed to generate PNG. | |
#define | KLFERR_NOGSPROG KLFERR_GSPNG_NORUN |
obsolete, same as KLFERR_GSPNG_NORUN | |
#define | KLFERR_GSPNG_NONORMALEXIT -15 |
Program 'gs' didn't exit noramally (crashed) while generating PNG (see also KLFERR_PROGERR_GSPNG) | |
#define | KLFERR_GSNONORMALEXIT KLFERR_GSPNG_NONORMALEXIT |
obsolete, same as KLFERR_GSPNG_NONORMALEXIT | |
#define | KLFERR_GSPNG_NOOUTPUT -16 |
No PNG file appeared after running 'gs'. | |
#define | KLFERR_NOPNGFILE KLFERR_GSPNG_NOOUTPUT |
obsolete, same as KLFERR_GSPNG_NOOUTPUT | |
#define | KLFERR_GSPNG_OUTPUTREADFAIL -17 |
Failed to read PNG file produced by 'gs'. | |
#define | KLFERR_PNGREADFAIL KLFERR_GSPNG_OUTPUTREADFAIL |
obsolete, same as KLFERR_GSPNG_OUTPUTREADFAIL | |
#define | KLFERR_PDFMARKSWRITEFAIL -47 |
Error while opening pdfmarks file for writing. | |
#define | KLFERR_GSPDF_NORUN -31 |
Program 'gs' couldn't be executed to generate PDF. | |
#define | KLFERR_GSPDF_NONORMALEXIT -19 |
Program 'gs' didn't exit noramally (crashed) while generating PDF (see also KLFERR_PROGERR_GSPDF) | |
#define | KLFERR_EPSTOPDFNONORMALEXIT KLFERR_GSPDF_NONORMALEXIT |
obsolete, same as KLFERR_GSPDF_NONORMALEXIT | |
#define | KLFERR_GSPDF_NOOUTPUT -20 |
No PDF file appeared after running 'gs'. | |
#define | KLFERR_NOPDFFILE KLFERR_GSPDF_NOOUTPUT |
obsolete, same as KLFERR_GSPDF_NOOUTPUT | |
#define | KLFERR_GSPDF_OUTPUTREADFAIL -21 |
Failed to read PDF file produced by 'gs'. | |
#define | KLFERR_PDFREADFAIL KLFERR_GSPDF_OUTPUTREADFAIL |
obsolete, same as KLFERR_GSPDF_OUTPUTREADFAIL | |
#define | KLFERR_NOGSVERSION -32 |
Failed to query gs version. | |
#define | KLFERR_GSSVG_NOSVG -33 |
This version of gs cannot produce SVG. | |
#define | KLFERR_GSSVG_NORUN -34 |
Program 'gs' couldn't be executed to generate SVG. | |
#define | KLFERR_GSSVG_NONORMALEXIT -35 |
Program 'gs' didn't exit noramally (crashed) while generating SVG (see also KLFERR_PROGERR_GSSVG) | |
#define | KLFERR_GSSVG_NOOUTPUT -36 |
No SVG file appeared after running 'gs'. | |
#define | KLFERR_GSSVG_OUTPUTREADFAIL -37 |
Failed to read SVG file produced by 'gs'. | |
#define | KLFERR_USERSCRIPT_NORUN -38 |
Failed to execute user wrapper script. | |
#define | KLFERR_USERSCRIPT_NONORMALEXIT -39 |
#define | KLFERR_USERSCRIPT_NOSCRIPTINFO -40 |
#define | KLFERR_USERSCRIPT_INVALIDSCRIPTINFO -41 |
#define | KLFERR_USERSCRIPT_NOOUTPUT -42 |
#define | KLFERR_USERSCRIPT_OUTPUTREADFAIL -43 |
#define | KLFERR_USERSCRIPT_BADKLFVERSION -44 |
#define | KLFERR_USERSCRIPT_BADSKIPFORMATS -45 |
#define | KLFERR_USERSCRIPT_BADCATEGORY -46 |
#define | KLFERR_PROGERR_LATEX 1 |
latex exited with a non-zero status | |
#define | KLFERR_PROGERR_DVIPS 2 |
dvips exited with a non-zero status | |
#define | KLFERR_PROGERR_GSBBOX 6 |
gs exited with non-zero status while calculating bbox of EPS file generated by dvips | |
#define | KLFERR_PROGERR_GSPOSTPROC 5 |
gs exited with non-zero status while post-processing EPS file (page size, font outlines) | |
#define | KLFERR_PROGERR_GS_OF KLFERR_PROGERR_GSPOSTPROC |
obsolete, same as KLFERR_PROGERR_GSPOSTPROC | |
#define | KLFERR_PROGERR_GSPNG 3 |
gs exited with a non-zero status while producing PNG | |
#define | KLFERR_PROGERR_GS KLFERR_PROGERR_GSPNG |
obsolete, same as KLFERR_PROGERR_GSPNG | |
#define | KLFERR_PROGERR_GSPDF 4 |
gs exited with non-zero status while producing PDF | |
#define | KLFERR_PROGERR_EPSTOPDF KLFERR_PROGERR_GSPDF |
obsolete, same as KLFERR_PROGERR_GSPDF | |
#define | KLFERR_PROGERR_GSSVG 7 |
gs exited with non-zero status while producing SVG | |
#define | KLFERR_PROGERR_USERSCRIPT 8 |
user wrapper script exited with non-zero status | |
Functions | |
KLF_EXPORT bool | operator== (const KLFBackend::klfInput &a, const KLFBackend::klfInput &b) |
KLF_EXPORT bool | operator== (const KLFBackend::klfSettings &a, const KLFBackend::klfSettings &b) |
KLF_EXPORT bool | klf_detect_execenv (KLFBackend::klfSettings *settings) |
detects any additional settings to environment variables | |
KLF_EXPORT QStringList | klfSettingsToEnvironmentForUserScript (const KLFBackend::klfSettings &settings) |
KLF_EXPORT QStringList | klfInputToEnvironmentForUserScript (const KLFBackend::klfInput &in) |
Definition of class KLFBackend.
This file defines the KLFBackend class, which is the base engine providing our core functionality of transforming LaTeX code into graphics.
Definition in file klfbackend.h.
KLF_EXPORT bool klf_detect_execenv | ( | KLFBackend::klfSettings * | settings | ) |
detects any additional settings to environment variables
Detects whether the given values of latex, dvips, gs and epstopdf in the given (initialized) settings settings
need extra environment set, and sets the execenv
member of settings
accordingly.
Note that the environment settings already existing in settings->execenv
are kept; only those variables for which new values are detected are updated, or if new declarations are needed they are appended.
Definition at line 1870 of file klfbackend.cpp.
References QFileInfo::absolutePath(), KLFBackend::klfSettings::execenv, QFileInfo::fileName(), KLFBackend::klfSettings::gsexec, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, KLF_PATH_SEP, klfDbg, klfSetEnvironmentVariable(), and QDir::toNativeSeparators().
KLF_EXPORT bool operator== | ( | const KLFBackend::klfInput & | a, |
const KLFBackend::klfInput & | b | ||
) |
Compare two inputs for equality
Definition at line 1608 of file klfbackend.cpp.
References KLFBackend::klfInput::bg_color, KLFBackend::klfInput::bypassTemplate, KLFBackend::klfInput::dpi, KLFBackend::klfInput::fontsize, KLFBackend::klfInput::latex, KLFBackend::klfInput::mathmode, operator==(), KLFBackend::klfInput::preamble, KLFBackend::klfInput::userScript, and KLFBackend::klfInput::vectorscale.