summaryrefslogtreecommitdiffstats
path: root/src/style-internal.h
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2018-09-21 19:09:12 +0000
committerMartin Owens <doctormo@gmail.com>2018-09-24 20:03:10 +0000
commit87928569d35f2df60115d8bcd364ad5dc56d8ef6 (patch)
treed45244c11eaab1f5d27859ea28e7665dd8f47319 /src/style-internal.h
parentRemove #include "config.h" from header files where possible (diff)
downloadinkscape-87928569d35f2df60115d8bcd364ad5dc56d8ef6.tar.gz
inkscape-87928569d35f2df60115d8bcd364ad5dc56d8ef6.zip
Remove most write overrides and replace to get_value plus one generic write method
Diffstat (limited to 'src/style-internal.h')
-rw-r--r--src/style-internal.h89
1 files changed, 24 insertions, 65 deletions
diff --git a/src/style-internal.h b/src/style-internal.h
index 22148b132..16877f9a5 100644
--- a/src/style-internal.h
+++ b/src/style-internal.h
@@ -181,9 +181,10 @@ public:
readIfUnset( repr->attribute( name.c_str() ), SP_STYLE_SRC_ATTRIBUTE );
}
+ virtual const Glib::ustring get_value() const = 0;
virtual const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const = 0;
+ SPIBase const *const base = nullptr ) const;
virtual void clear() {
set = false, inherit = false, important = false;
}
@@ -239,9 +240,7 @@ public:
~SPIFloat() override = default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
value = value_default;
@@ -316,9 +315,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
value = value_default;
@@ -384,9 +381,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
unit = SP_CSS_UNIT_NONE, value = value_default;
@@ -436,9 +431,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPILength::clear();
normal = true;
@@ -480,9 +473,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
axes.clear();
@@ -550,9 +541,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
value = value_default, computed = computed_default;
@@ -605,10 +594,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
-
+ const Glib::ustring get_value() const override;
};
@@ -632,9 +618,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
};
@@ -656,9 +640,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
};
@@ -680,9 +662,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
};
@@ -710,9 +690,7 @@ public:
}
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override; // TODO check about value and value_default
void cascade( const SPIBase* const parent ) override;
void merge( const SPIBase* const parent ) override;
@@ -758,9 +736,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
value.color.set(0);
@@ -840,9 +816,7 @@ public:
~SPIPaint() override; // Clear and delete href.
void read( gchar const *str ) override;
virtual void read( gchar const *str, SPStyle &style, SPDocument *document = nullptr);
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override;
virtual void reset( bool init ); // Used internally when reading or cascading
void cascade( const SPIBase* const parent ) override;
@@ -940,9 +914,7 @@ public:
}
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
for( unsigned i = 0; i < PAINT_ORDER_LAYERS; ++i ) {
@@ -993,9 +965,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
values.clear();
@@ -1028,9 +998,7 @@ public:
~SPIFilter() override;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override;
void cascade( const SPIBase* const parent ) override;
void merge( const SPIBase* const parent ) override;
@@ -1069,9 +1037,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
type = SP_FONT_SIZE_LITERAL, unit = SP_CSS_UNIT_NONE,
@@ -1118,9 +1084,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
}
@@ -1160,9 +1124,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
type=SP_BASELINE_SHIFT_LITERAL, unit=SP_CSS_UNIT_NONE,
@@ -1209,9 +1171,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
underline = false, overline = false, line_through = false, blink = false;
@@ -1250,9 +1210,7 @@ public:
= default;
void read( gchar const *str ) override;
- const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
- SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
- SPIBase const *const base = nullptr ) const override;
+ const Glib::ustring get_value() const override;
void clear() override {
SPIBase::clear();
solid = true, isdouble = false, dotted = false, dashed = false, wavy = false;
@@ -1299,6 +1257,7 @@ public:
= default;
void read( gchar const *str ) override;
+ const Glib::ustring get_value() const override;
const Glib::ustring write( guint const flags = SP_STYLE_FLAG_IFSET,
SPStyleSrc const &style_src_req = SP_STYLE_SRC_STYLE_PROP,
SPIBase const *const base = nullptr ) const override;