|
wxMaxima
|
Document serializers extracted from the Worksheet class. More...
#include <wx/gdicmn.h>#include <wx/string.h>#include <wx/textfile.h>#include <memory>#include <vector>Go to the source code of this file.
Functions | |
| bool | WorksheetExport::ExportToHTML (GroupCell *tree, Configuration *configuration, const wxString &file, CellPointers *cellPointers, GroupCell *hCaret) |
| Export the tree to an HTML file. | |
| std::unique_ptr< Cell > | WorksheetExport::CopySelection (Cell *start, Cell *end, bool asData=false) |
| Copy the cell range into a fresh list of cells. | |
| wxSize | WorksheetExport::CopyToFile (const wxString &file, Cell *start, Cell *end, bool asData, double scale, const Configuration *const *configuration) |
| Render the cell range into an image file; returns the image's size. | |
| bool | WorksheetExport::ExportToTeX (GroupCell *tree, Configuration *configuration, const wxString &file) |
| Export the tree to a LaTeX document; images go to a <name>_img directory. | |
| void | WorksheetExport::ExportToMAC (wxTextFile &output, GroupCell *tree, bool wxm, const std::vector< int > &cellMap, bool fixReorderedIndices) |
| Serialize the tree as .wxm (wxm = true) or .mac lines into output. | |
| void | WorksheetExport::AddLineToFile (wxTextFile &output, const wxString &s) |
| Add a (possibly multi-line) string to output as individual lines. | |
| void | WorksheetExport::CalculateReorderedCellIndices (GroupCell *tree, int &cellIndex, std::vector< int > &cellMap) |
| Determine the (iN)/(oN) indices a fresh evaluation would assign. | |
| wxString | WorksheetExport::RTFStart (Configuration *configuration) |
| The RTF document header: font, color and stylesheet tables. | |
| wxString | WorksheetExport::RTFEnd () |
| The RTF document footer matching RTFStart(). | |
Document serializers extracted from the Worksheet class.
These functions turn a worksheet's cell tree into HTML, LaTeX and .mac/.wxm batch files, plus the RTF document frame used by the clipboard code. They are document functionality, not view functionality: they read only the cell tree and the Configuration, never the scrolling/cursor/mouse state, which is why they live outside the Worksheet class. Worksheet keeps thin wrappers that add the view-side bracketing (busy cursor, clip-region toggling, the saved-flag and backup-file dance).
test_WorksheetExport pins the byte-exact output of everything in here.
| void WorksheetExport::CalculateReorderedCellIndices | ( | GroupCell * | tree, |
| int & | cellIndex, | ||
| std::vector< int > & | cellMap | ||
| ) |
Determine the (iN)/(oN) indices a fresh evaluation would assign.
Fills cellMap with old-index -> new-index so ExportToMAC can renumber references inside the exported code.
| std::unique_ptr< Cell > WorksheetExport::CopySelection | ( | Cell * | start, |
| Cell * | end, | ||
| bool | asData = false |
||
| ) |
Copy the cell range into a fresh list of cells.
| asData |
|
| bool WorksheetExport::ExportToHTML | ( | GroupCell * | tree, |
| Configuration * | configuration, | ||
| const wxString & | file, | ||
| CellPointers * | cellPointers, | ||
| GroupCell * | hCaret | ||
| ) |
Export the tree to an HTML file.
Writes the HTML to file and the stylesheet, the equation images (in the format selected by Configuration::HTMLequationFormat()) and a .wxmx copy of the document into a <name>_htmlimg directory next to it.
| cellPointers | and |
| hCaret | are only passed through to the embedded .wxmx copy, which stores the cursor position. |
| void WorksheetExport::ExportToMAC | ( | wxTextFile & | output, |
| GroupCell * | tree, | ||
| bool | wxm, | ||
| const std::vector< int > & | cellMap, | ||
| bool | fixReorderedIndices | ||
| ) |
Serialize the tree as .wxm (wxm = true) or .mac lines into output.
| cellMap | With fixReorderedIndices, the (iN)/(oN) indices are rewritten through this map (see CalculateReorderedCellIndices) so the numbering matches a fresh evaluation order. |