Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
svg-length.cpp File Reference

SVG data parser. More...

Go to the source code of this file.

Namespaces

namespace  Inkscape
 Helper class to stream background task notifications as a series of messages.
 

Functions

static unsigned sp_svg_length_read_lff (gchar const *str, SVGLength::Unit *unit, float *val, float *computed, char **next)
 
unsigned int sp_svg_number_read_f (gchar const *str, float *val)
 
unsigned int sp_svg_number_read_d (gchar const *str, double *val)
 
static std::string sp_svg_number_write_d (double val, unsigned int tprec, unsigned int fprec)
 
std::string sp_svg_number_write_de (double val, unsigned int tprec, int min_exp)
 
unsigned int sp_svg_length_read_computed_absolute (gchar const *str, float *length)
 
std::vector< SVGLengthsp_svg_length_list_read (gchar const *str)
 
unsigned int sp_svg_length_read_ldd (gchar const *str, SVGLength::Unit *unit, double *value, double *computed)
 
double sp_svg_read_percentage (char const *str, double def)
 
gchar const * sp_svg_length_get_css_units (SVGLength::Unit unit)
 
bool svg_length_absolute_unit (SVGLength::Unit u)
 
std::string sp_svg_length_write_with_units (SVGLength const &length)
 N.B. This routine will sometimes return strings with ‘e’ notation, so is unsuitable for CSS lengths (which don't allow scientific ‘e’ notation).
 
char const * Inkscape::refX_named_to_percent (char const *str)
 
char const * Inkscape::refY_named_to_percent (char const *str)
 

Detailed Description

SVG data parser.

Definition in file svg-length.cpp.

Function Documentation

◆ sp_svg_length_get_css_units()

◆ sp_svg_length_list_read()

std::vector< SVGLength > sp_svg_length_list_read ( gchar const *  str)

Definition at line 244 of file svg-length.cpp.

References sp_svg_length_read_lff().

Referenced by TextTagAttributes::readSingleAttribute().

◆ sp_svg_length_read_computed_absolute()

unsigned int sp_svg_length_read_computed_absolute ( gchar const *  str,
float *  length 
)

Definition at line 222 of file svg-length.cpp.

References sp_svg_length_read_lff(), and svg_length_absolute_unit().

Referenced by SPOffset::set(), and SPSpiral::set().

◆ sp_svg_length_read_ldd()

unsigned int sp_svg_length_read_ldd ( gchar const *  str,
SVGLength::Unit unit,
double *  value,
double *  computed 
)

Definition at line 431 of file svg-length.cpp.

References sp_svg_length_read_lff().

Referenced by SPStar::set().

◆ sp_svg_length_read_lff()

static unsigned sp_svg_length_read_lff ( gchar const *  str,
SVGLength::Unit unit,
float *  val,
float *  computed,
char **  next 
)
static

◆ sp_svg_length_write_with_units()

std::string sp_svg_length_write_with_units ( SVGLength const &  length)

N.B. This routine will sometimes return strings with ‘e’ notation, so is unsuitable for CSS lengths (which don't allow scientific ‘e’ notation).

Definition at line 621 of file svg-length.cpp.

References SVGLength::PERCENT, sp_svg_length_get_css_units(), and Inkscape::SVGOStringStream::str().

Referenced by SVGLength::write(), SPRoot::write(), SPSymbol::write(), and SPDimensions::writeDimensions().

◆ sp_svg_number_read_d()

◆ sp_svg_number_read_f()

unsigned int sp_svg_number_read_f ( gchar const *  str,
float *  val 
)

◆ sp_svg_number_write_d()

static std::string sp_svg_number_write_d ( double  val,
unsigned int  tprec,
unsigned int  fprec 
)
static

Definition at line 66 of file svg-length.cpp.

References buf, floor(), and MAX.

Referenced by sp_svg_number_write_de().

◆ sp_svg_number_write_de()

std::string sp_svg_number_write_de ( double  val,
unsigned int  tprec,
int  min_exp 
)

◆ sp_svg_read_percentage()

double sp_svg_read_percentage ( char const *  str,
double  def 
)

Definition at line 574 of file svg-length.cpp.

Referenced by SPStop::set(), SPText::set(), and GrDrag::styleSet().

◆ svg_length_absolute_unit()

bool svg_length_absolute_unit ( SVGLength::Unit  u)