A collection of common code used in rendering the cells to a non-default output, e.g. a graphics file.
More...
#include <OutCommon.h>
|
| class | DataObject |
| | An object that can be filled with output data in given format for the clipboard. More...
|
| |
|
|
std::unique_ptr< DataObject > | GetDataObject (const wxDataFormat &format) |
| | Returns the representation that can be placed on the clipboard. Removes the file the data was saved in.
|
| |
| | OutCommon (const Configuration *const *configuration, const wxString &filename, int fullWidth, double scale) |
| | Constructs the instance of the helper, temporarily overriding the configuration.
|
| |
|
| OutCommon (const Configuration *const *configuration, int fullWidth, double scale) |
| |
|
| OutCommon (const OutCommon &)=delete |
| |
|
void | operator= (const OutCommon &)=delete |
| |
|
int | Scale_Px (double px) const |
| |
|
double | GetScale () const |
| |
|
const wxString & | GetFilename () const |
| |
|
const wxString & | GetTempFilename () const |
| |
|
Configuration * | GetConfiguration () |
| | Get the configuration for the file/bitmap/... output.
|
| |
|
const Configuration & | GetScreenConfig () const |
| | Get the configuration for the screen output.
|
| |
|
wxSize | getPPI () const |
| |
|
void | SetRecalculationContext (wxDC *context) |
| | Sets the context for the configuration used in recalculating the cell dimensions.
|
| |
|
bool | PrepareLayout (Cell *tree) |
| | Prepares to render the tree to the output DC, and computes the size of the output.
|
| |
|
wxSize | GetSize () const |
| | Returns the size of the prepared output layout.
|
| |
|
void | SetSize (wxSize size) |
| | Sets the "default" size of the prepared layout.
|
| |
|
wxSize | GetScaledSize () const |
| | Returns the size of the prepared output layout multiplied by the scale factor.
|
| |
|
wxSize | GetInvScaledSize () const |
| | Returns the size of the prepared output layout divided by the scale factor.
|
| |
|
bool | ToClipboard (const wxDataFormat &format) |
| | Copies the representation of the list of cells that was passed to SetData() to the clipboard.
|
| |
|
void | Draw (Cell *tree) |
| | Recursively draws the cells.
|
| |
|
| static wxString | AccessibleText (const Cell *tree) |
| | The plain-text form of a cell list, for use as an accessible label.
|
| |
A collection of common code used in rendering the cells to a non-default output, e.g. a graphics file.
◆ OutCommon()
| OutCommon::OutCommon |
( |
const Configuration *const * |
configuration, |
|
|
const wxString & |
filename, |
|
|
int |
fullWidth, |
|
|
double |
scale |
|
) |
| |
|
explicit |
Constructs the instance of the helper, temporarily overriding the configuration.
- Parameters
-
| fullWidth | multiplied by scale is only used as maximum width during line breaking. |
| configuration | The configuration to build upon |
| filename | The name of the output file |
| scale | The scaling factor of the output document |
◆ AccessibleText()
| wxString OutCommon::AccessibleText |
( |
const Cell * |
tree | ) |
|
|
static |
The plain-text form of a cell list, for use as an accessible label.
Exported maths is a picture: an SVG draws it as anonymous paths, a PNG as pixels, and either way a screen reader has nothing to announce unless we hand it the text. This is the one place that text is derived, so the SVG's <title>/aria-label and the PNG's Description chunk cannot drift apart.
The text is what ListToString() gives - the same rendering the clipboard and the .wxm exporter use, so what is spoken matches what copying the cell as text would give.
Every run of whitespace collapses to a single space. 2-D ASCII-art maths pads its lines with long space runs and tabs to keep fraction bars and matrices aligned; that alignment is meaningless once the text is spoken rather than drawn, and leaving it in makes the label a stuttering mess. Line breaks go for the same reason: the result is a single label, not a document.
- Parameters
-
| tree | The cell list that was rendered, or null. |
- Returns
- The label, or an empty string if there is nothing to describe.
The documentation for this class was generated from the following files:
- src/graphical_io/OutCommon.h
- src/graphical_io/OutCommon.cpp