diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-12 20:08:11 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-12 20:08:11 (GMT) |
commit | 10b2b8fc694b60a17ccd2642f3a40c851e33b9da (patch) | |
tree | 9901c6f8603c20fd3422e9f068da1fb9cab13317 /src/formula.h | |
parent | b107d3412b12c37a6b87c7315bc4039446cd3338 (diff) | |
download | Doxygen-10b2b8fc694b60a17ccd2642f3a40c851e33b9da.zip Doxygen-10b2b8fc694b60a17ccd2642f3a40c851e33b9da.tar.gz Doxygen-10b2b8fc694b60a17ccd2642f3a40c851e33b9da.tar.bz2 |
Improve formula handling and rendering.
Also added option HTML_FORMULA_FORMAT to generate SVG files for images (requires pdf2svg)
Diffstat (limited to 'src/formula.h')
-rw-r--r-- | src/formula.h | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/src/formula.h b/src/formula.h index 422030c..4bd90af 100644 --- a/src/formula.h +++ b/src/formula.h @@ -18,45 +18,33 @@ #ifndef FORMULA_H #define FORMULA_H -#include <qlist.h> -#include <qdict.h> +#include <memory> +#include <qcstring.h> -/** Class representing a formula in the output. */ -class Formula +/*! Manager class to handle formulas */ +class FormulaManager { public: - Formula(const char *text); - ~Formula(); - int getId(); - QCString getFormulaText() const { return form; } - + struct DisplaySize + { + DisplaySize(int w,int h) : width(w), height(h) {} + int width; + int height; + }; + enum class Format { Bitmap, Vector }; + enum class HighDPI { On, Off }; + static FormulaManager &instance(); + void readFormulas(const char *dir,bool doCompare=false); + void clear(); + int addFormula(const char *formulaText); + void generateImages(const char *outputDir,Format format,HighDPI hd = HighDPI::Off) const; + QCString findFormula(int formulaId) const; + bool hasFormulas() const; + DisplaySize displaySize(int formulaId) const; private: - int number; - QCString form; -}; - -/** A list of Formula objects. */ -class FormulaList : public QList<Formula> -{ - public: - void generateBitmaps(const char *path); -}; - -/** Iterator for Formula objects in a FormulaList. */ -class FormulaListIterator : public QListIterator<Formula> -{ - public: - FormulaListIterator(const FormulaList &l) : - QListIterator<Formula>(l) {} -}; - -/** Unsorted dictionary of Formula objects. */ -class FormulaDict : public QDict<Formula> -{ - public: - FormulaDict(uint size) : - QDict<Formula>(size) {} - ~FormulaDict() {} + FormulaManager(); + struct Private; + std::unique_ptr<Private> p; }; #endif |