Code

Indent support for XSLT extensions output.
[inkscape.git] / src / style.h
index f1b5ec534cb622263372bb439e22cc174e8c15b4..b4663e8f6c043cb86434eafb514e9a08306611a6 100644 (file)
@@ -43,6 +43,7 @@ class SPIString;
 class SPILength;
 class SPIPaint;
 class SPIFontSize;
+class SPIBaselineShift;
 
 /// Float type internal to SPStyle.
 struct SPIFloat {
@@ -143,8 +144,6 @@ struct SPILength {
 
 #define SP_STYLE_FILL_SERVER(s) (((SPStyle *) (s))->getFillPaintServer())
 #define SP_STYLE_STROKE_SERVER(s) (((SPStyle *) (s))->getStrokePaintServer())
-#define SP_OBJECT_STYLE_FILL_SERVER(o) (SP_OBJECT (o)->style->getFillPaintServer())
-#define SP_OBJECT_STYLE_STROKE_SERVER(o) (SP_OBJECT (o)->style->getStrokePaintServer())
 
 class SVGICCColor;
 
@@ -160,6 +159,7 @@ struct SPIPaint {
          SPColor color;
     } value;
 
+    SPIPaint();
 
     bool isSet() const { return true; /* set || colorSet*/}
     bool isSameType( SPIPaint const & other ) const {return (isPaintserver() == other.isPaintserver()) && (colorSet == other.colorSet) && (currentcolor == other.currentcolor);}
@@ -175,6 +175,15 @@ struct SPIPaint {
     void setColor( float r, float g, float b ) {value.color.set( r, g, b ); colorSet = true;}
     void setColor( guint32 val ) {value.color.set( val ); colorSet = true;}
     void setColor( SPColor const& color ) {value.color = color; colorSet = true;}
+
+    void read( gchar const *str, SPStyle &tyle, SPDocument *document = 0);
+
+    // Win32 is a temp work-around until the emf extension is fixed:
+#ifndef WIN32
+private:
+    SPIPaint(SPIPaint const&);
+    SPIPaint &operator=(SPIPaint const &);
+#endif // WIN32
 };
 
 /// Filter type internal to SPStyle
@@ -190,6 +199,12 @@ enum {
     SP_FONT_SIZE_PERCENTAGE
 };
 
+enum {
+    SP_BASELINE_SHIFT_LITERAL,
+    SP_BASELINE_SHIFT_LENGTH,
+    SP_BASELINE_SHIFT_PERCENTAGE
+};
+
 #define SP_FONT_SIZE ((1 << 24) - 1)
 
 #define SP_F8_16_TO_FLOAT(v) ((gdouble) (v) / (1 << 16))
@@ -208,6 +223,17 @@ struct SPIFontSize {
     float computed;
 };
 
+/// Baseline shift type internal to SPStyle.
+struct SPIBaselineShift {
+    unsigned set : 1;
+    unsigned inherit : 1;
+    unsigned type : 2;
+    unsigned unit : 4;
+    unsigned literal: 2;
+    float value; // Can be negative
+    float computed;
+};
+
 /// Text decoration type internal to SPStyle.
 struct SPITextDecoration {
     unsigned set : 1;
@@ -287,6 +313,8 @@ struct SPStyle {
     SPIEnum block_progression;
     /** Writing mode (css3 text 3.2 and svg1.1 10.7.2) */
     SPIEnum writing_mode;
+    /** Baseline shift (svg1.1 10.9.2) */
+    SPIBaselineShift baseline_shift;
 
     /* SVG */
     /** Anchor of the text (svg1.1 10.9.1) */
@@ -500,6 +528,12 @@ enum SPTextAnchor {
     SP_CSS_TEXT_ANCHOR_END
 };
 
+enum SPCSSBaselineShift {
+  SP_CSS_BASELINE_SHIFT_BASELINE,
+  SP_CSS_BASELINE_SHIFT_SUB,
+  SP_CSS_BASELINE_SHIFT_SUPER
+};
+
 enum SPVisibility {
     SP_CSS_VISIBILITY_HIDDEN,
     SP_CSS_VISIBILITY_COLLAPSE,
@@ -578,4 +612,4 @@ gchar *css2_escape_quote(gchar const *val);
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :