Inkscape
Vector Graphics Editor
|
#include <units.h>
Public Member Functions | |
Unit () | |
Unit (UnitType type, double factor, Glib::ustring name, Glib::ustring name_plural, Glib::ustring abbr, Glib::ustring description) | |
void | clear () |
bool | isAbsolute () const |
int | defaultDigits () const |
Returns the suggested precision to use for displaying numbers of this unit. | |
bool | compatibleWith (Unit const *u) const |
Checks if a unit is compatible with the specified unit. | |
bool | compatibleWith (Glib::ustring const &) const |
bool | compatibleWith (char const *) const |
bool | operator== (Unit const &other) const |
Check if units are equal. | |
int | svgUnit () const |
Get SVG unit code. | |
double | convert (double from_dist, Unit const *to) const |
Convert value from this unit. | |
double | convert (double from_dist, Glib::ustring const &to) const |
double | convert (double from_dist, char const *to) const |
UnitMetric const * | getUnitMetric () const |
Get the ways this unit is subdivided in rulers. | |
Public Attributes | |
UnitType | type |
double | factor |
Glib::ustring | name |
Glib::ustring | name_plural |
Glib::ustring | abbr |
Glib::ustring | description |
Glib::ustring | metric_name |
Inkscape::Util::Unit::Unit | ( | ) |
Definition at line 150 of file units.cpp.
References Inkscape::Util::UNIT_TYPE_DIMENSIONLESS.
Referenced by clear().
Inkscape::Util::Unit::Unit | ( | UnitType | type, |
double | factor, | ||
Glib::ustring | name, | ||
Glib::ustring | name_plural, | ||
Glib::ustring | abbr, | ||
Glib::ustring | description | ||
) |
bool Inkscape::Util::Unit::compatibleWith | ( | char const * | ) | const |
bool Inkscape::Util::Unit::compatibleWith | ( | Glib::ustring const & | u | ) | const |
Definition at line 207 of file units.cpp.
References compatibleWith(), and Inkscape::Util::UnitTable::get().
bool Inkscape::Util::Unit::compatibleWith | ( | Unit const * | u | ) | const |
Checks if a unit is compatible with the specified unit.
Definition at line 192 of file units.cpp.
References type, and Inkscape::Util::UNIT_TYPE_DIMENSIONLESS.
Referenced by compatibleWith(), Inkscape::Util::Quantity::compatibleWith(), and Inkscape::Preferences::Entry::isConvertibleTo().
double Inkscape::Util::Unit::convert | ( | double | from_dist, |
char const * | to | ||
) | const |
Definition at line 248 of file units.cpp.
References convert(), and Inkscape::Util::UnitTable::get().
double Inkscape::Util::Unit::convert | ( | double | from_dist, |
Glib::ustring const & | to | ||
) | const |
Definition at line 244 of file units.cpp.
References convert(), and Inkscape::Util::UnitTable::get().
double Inkscape::Util::Unit::convert | ( | double | from_dist, |
Unit const * | to | ||
) | const |
Convert value from this unit.
Definition at line 229 of file units.cpp.
References factor, type, and Inkscape::Util::UNIT_TYPE_DIMENSIONLESS.
Referenced by convert(), convert(), Inkscape::Util::Quantity::convert(), and Inkscape::PaperSize::findPaperSize().
int Inkscape::Util::Unit::defaultDigits | ( | ) | const |
UnitMetric const * Inkscape::Util::Unit::getUnitMetric | ( | ) | const |
Get the ways this unit is subdivided in rulers.
Definition at line 253 of file units.cpp.
References Inkscape::Util::UnitTable::get(), Inkscape::Util::UnitTable::getUnitMetric(), and metric_name.
Referenced by Inkscape::UI::Widget::Ruler::draw_ruler().
|
inline |
Definition at line 64 of file units.h.
References type, and Inkscape::Util::UNIT_TYPE_DIMENSIONLESS.
Referenced by Inkscape::Util::ExpressionEvaluator::resolveUnit(), and sp_parse_document_units().
bool Inkscape::Util::Unit::operator== | ( | Unit const & | other | ) | const |
int Inkscape::Util::Unit::svgUnit | ( | ) | const |
Glib::ustring Inkscape::Util::Unit::abbr |
Definition at line 81 of file units.h.
Referenced by Inkscape::UI::Dialog::GuidelinePropertiesDialog::_setup(), Inkscape::UI::Widget::UnitTracker::addUnit(), Inkscape::Util::UnitTable::addUnit(), Inkscape::UI::Widget::calcScaleLineWidth(), Inkscape::UI::Tools::LpeTool::create_measuring_items(), Inkscape::LivePathEffect::LPEMeasureSegments::createLine(), Inkscape::LivePathEffect::LPEMeasureSegments::createTextLabel(), Inkscape::UI::Dialog::Transformation::desktopReplaced(), Inkscape::UI::Dialog::DocumentProperties::display_unit_change(), Inkscape::LivePathEffect::LPETiling::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPERuler::doEffect_pwd2(), SPPage::getBleedLabel(), SPPage::getMarginLabel(), Inkscape::LivePathEffect::LPETiling::LPETiling(), Inkscape::Display::SnapIndicator::make_alignment_indicator(), Inkscape::Display::SnapIndicator::make_distribution_indicators(), Inkscape::UI::Toolbar::PageToolbar::PageToolbar(), Inkscape::UI::Widget::UnitTracker::prependUnit(), Inkscape::LivePathEffect::LPERuler::ruler_mark(), Inkscape::UI::Widget::UnitTracker::setActiveUnit(), SPPage::setBleed(), SPNamedView::setDisplayUnit(), SPPage::setMargin(), SPPage::setMarginSide(), Inkscape::UI::Widget::StyleSwatch::setStyle(), Inkscape::UI::Dialog::SingleExport::setupUnits(), Inkscape::Extension::Internal::Metafile::setViewBoxIfMissing(), Inkscape::Util::Quantity::string(), Inkscape::UI::Widget::StrokeStyle::StrokeStyle(), svgUnit(), Inkscape::PaperSize::toDimsString(), Inkscape::UI::Widget::SelectedStyle::update(), Inkscape::UI::Tools::LpeTool::update_measuring_items(), Inkscape::UI::Dialog::DocumentProperties::update_widgets(), and Inkscape::UI::Widget::StrokeStyle::updateLine().
double Inkscape::Util::Unit::factor |
Definition at line 78 of file units.h.
Referenced by Inkscape::UI::Widget::UnitTracker::_fixupAdjustments(), SPDesktopWidget::_updateUnit(), convert(), defaultDigits(), and Unit().
Glib::ustring Inkscape::Util::Unit::metric_name |
Definition at line 83 of file units.h.
Referenced by getUnitMetric().
Glib::ustring Inkscape::Util::Unit::name |
Definition at line 79 of file units.h.
Referenced by operator==().
UnitType Inkscape::Util::Unit::type |
Definition at line 77 of file units.h.
Referenced by Inkscape::UI::Widget::UnitTracker::_fixupAdjustments(), Inkscape::Util::UnitTable::addUnit(), Inkscape::UI::Widget::calcScaleLineWidth(), compatibleWith(), convert(), isAbsolute(), Inkscape::UI::Widget::ScalarUnit::on_unit_changed(), Inkscape::Util::Quantity::operator<(), operator==(), Inkscape::UI::Widget::StrokeStyle::unitChangedCB(), and Inkscape::UI::Widget::StrokeStyle::updateLine().