use super::content::Block;
use super::identifiers::{RelId, VmlShapeId};
#[derive(Clone, Debug)]
pub struct Pict {
pub shape_type: Option<VmlShapeType>,
pub shapes: Vec<VmlShape>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlPathCoord {
Literal(i64),
FormulaRef(u32),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlPathCommand {
MoveTo { x: VmlPathCoord, y: VmlPathCoord },
LineTo { x: VmlPathCoord, y: VmlPathCoord },
CurveTo {
x1: VmlPathCoord,
y1: VmlPathCoord,
x2: VmlPathCoord,
y2: VmlPathCoord,
x: VmlPathCoord,
y: VmlPathCoord,
},
RLineTo { dx: VmlPathCoord, dy: VmlPathCoord },
RCurveTo {
dx1: VmlPathCoord,
dy1: VmlPathCoord,
dx2: VmlPathCoord,
dy2: VmlPathCoord,
dx: VmlPathCoord,
dy: VmlPathCoord,
},
RMoveTo { dx: VmlPathCoord, dy: VmlPathCoord },
Close,
End,
QuadrantX { x: VmlPathCoord, y: VmlPathCoord },
QuadrantY { x: VmlPathCoord, y: VmlPathCoord },
NoFill,
NoStroke,
Arc {
kind: VmlArcKind,
bounding_x1: VmlPathCoord,
bounding_y1: VmlPathCoord,
bounding_x2: VmlPathCoord,
bounding_y2: VmlPathCoord,
start_x: VmlPathCoord,
start_y: VmlPathCoord,
end_x: VmlPathCoord,
end_y: VmlPathCoord,
},
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlArcKind {
WA,
WR,
AT,
AR,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct VmlFormula {
pub operation: VmlFormulaOp,
pub args: [VmlFormulaArg; 3],
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlFormulaOp {
Val,
Sum,
Product,
Mid,
Abs,
Min,
Max,
If,
Sqrt,
Mod,
Sin,
Cos,
Tan,
Atan2,
SinAtan2,
CosAtan2,
SumAngle,
Ellipse,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlFormulaArg {
Literal(i64),
AdjRef(u32),
FormulaRef(u32),
Guide(VmlGuide),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlGuide {
Width,
Height,
XCenter,
YCenter,
XRange,
YRange,
PixelWidth,
PixelHeight,
PixelLineWidth,
EmuWidth,
EmuHeight,
EmuWidth2,
EmuHeight2,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct VmlVector2D {
pub x: i64,
pub y: i64,
}
#[derive(Clone, Debug)]
pub struct VmlShapeType {
pub id: Option<VmlShapeId>,
pub coord_size: Option<VmlVector2D>,
pub spt: Option<f32>,
pub adj: Vec<i64>,
pub path: Vec<VmlPathCommand>,
pub filled: Option<bool>,
pub stroked: Option<bool>,
pub stroke: Option<VmlStroke>,
pub vml_path: Option<VmlPath>,
pub formulas: Vec<VmlFormula>,
pub lock: Option<VmlLock>,
}
#[derive(Clone, Debug)]
pub struct VmlShape {
pub id: Option<VmlShapeId>,
pub shape_type_ref: Option<VmlShapeId>,
pub style: VmlStyle,
pub fill_color: Option<VmlColor>,
pub stroked: Option<bool>,
pub stroke: Option<VmlStroke>,
pub vml_path: Option<VmlPath>,
pub text_box: Option<VmlTextBox>,
pub wrap: Option<VmlWrap>,
pub image_data: Option<VmlImageData>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct VmlWrap {
pub wrap_type: Option<VmlWrapType>,
pub side: Option<VmlWrapSide>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlWrapType {
TopAndBottom,
Square,
None,
Tight,
Through,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlWrapSide {
Both,
Left,
Right,
Largest,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct VmlLock {
pub aspect_ratio: Option<bool>,
pub ext: Option<VmlExtHandling>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlExtHandling {
Edit,
View,
BackwardCompatible,
}
#[derive(Clone, Debug)]
pub struct VmlImageData {
pub rel_id: Option<RelId>,
pub title: Option<String>,
}
#[derive(Clone, Debug, Default)]
pub struct VmlStyle {
pub position: Option<CssPosition>,
pub left: Option<VmlLength>,
pub top: Option<VmlLength>,
pub width: Option<VmlLength>,
pub height: Option<VmlLength>,
pub margin_left: Option<VmlLength>,
pub margin_top: Option<VmlLength>,
pub margin_right: Option<VmlLength>,
pub margin_bottom: Option<VmlLength>,
pub z_index: Option<i64>,
pub rotation: Option<f64>,
pub flip: Option<VmlFlip>,
pub visibility: Option<CssVisibility>,
pub mso_position_horizontal: Option<MsoPositionH>,
pub mso_position_horizontal_relative: Option<MsoPositionHRelative>,
pub mso_position_vertical: Option<MsoPositionV>,
pub mso_position_vertical_relative: Option<MsoPositionVRelative>,
pub mso_wrap_distance_left: Option<VmlLength>,
pub mso_wrap_distance_right: Option<VmlLength>,
pub mso_wrap_distance_top: Option<VmlLength>,
pub mso_wrap_distance_bottom: Option<VmlLength>,
pub mso_wrap_style: Option<MsoWrapStyle>,
}
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub enum VmlColor {
Rgb(u8, u8, u8),
Named(VmlNamedColor),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum VmlNamedColor {
Black,
Silver,
Gray,
White,
Maroon,
Red,
Purple,
Fuchsia,
Green,
Lime,
Olive,
Yellow,
Navy,
Blue,
Teal,
Aqua,
Orange,
AliceBlue,
AntiqueWhite,
Beige,
Bisque,
BlanchedAlmond,
BlueViolet,
Brown,
BurlyWood,
CadetBlue,
Chartreuse,
Chocolate,
Coral,
CornflowerBlue,
Cornsilk,
Crimson,
Cyan,
DarkBlue,
DarkCyan,
DarkGoldenrod,
DarkGray,
DarkGreen,
DarkKhaki,
DarkMagenta,
DarkOliveGreen,
DarkOrange,
DarkOrchid,
DarkRed,
DarkSalmon,
DarkSeaGreen,
DarkSlateBlue,
DarkSlateGray,
DarkTurquoise,
DarkViolet,
DeepPink,
DeepSkyBlue,
DimGray,
DodgerBlue,
Firebrick,
FloralWhite,
ForestGreen,
Gainsboro,
GhostWhite,
Gold,
Goldenrod,
GreenYellow,
Honeydew,
HotPink,
IndianRed,
Indigo,
Ivory,
Khaki,
Lavender,
LavenderBlush,
LawnGreen,
LemonChiffon,
LightBlue,
LightCoral,
LightCyan,
LightGoldenrodYellow,
LightGray,
LightGreen,
LightPink,
LightSalmon,
LightSeaGreen,
LightSkyBlue,
LightSlateGray,
LightSteelBlue,
LightYellow,
LimeGreen,
Linen,
Magenta,
MediumAquamarine,
MediumBlue,
MediumOrchid,
MediumPurple,
MediumSeaGreen,
MediumSlateBlue,
MediumSpringGreen,
MediumTurquoise,
MediumVioletRed,
MidnightBlue,
MintCream,
MistyRose,
Moccasin,
NavajoWhite,
OldLace,
OliveDrab,
OrangeRed,
Orchid,
PaleGoldenrod,
PaleGreen,
PaleTurquoise,
PaleVioletRed,
PapayaWhip,
PeachPuff,
Peru,
Pink,
Plum,
PowderBlue,
RosyBrown,
RoyalBlue,
SaddleBrown,
Salmon,
SandyBrown,
SeaGreen,
Seashell,
Sienna,
SkyBlue,
SlateBlue,
SlateGray,
Snow,
SpringGreen,
SteelBlue,
Tan,
Thistle,
Tomato,
Turquoise,
Violet,
Wheat,
WhiteSmoke,
YellowGreen,
ButtonFace,
ButtonHighlight,
ButtonShadow,
ButtonText,
CaptionText,
GrayText,
Highlight,
HighlightText,
InactiveBorder,
InactiveCaption,
InactiveCaptionText,
InfoBackground,
InfoText,
Menu,
MenuText,
Scrollbar,
ThreeDDarkShadow,
ThreeDFace,
ThreeDHighlight,
ThreeDLightShadow,
ThreeDShadow,
Window,
WindowFrame,
WindowText,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CssPosition {
Static,
Relative,
Absolute,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CssVisibility {
Visible,
Hidden,
Inherit,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlFlip {
X,
Y,
XY,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MsoPositionH {
Absolute,
Left,
Center,
Right,
Inside,
Outside,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MsoPositionHRelative {
Margin,
Page,
Text,
Char,
LeftMarginArea,
RightMarginArea,
InnerMarginArea,
OuterMarginArea,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MsoPositionV {
Absolute,
Top,
Center,
Bottom,
Inside,
Outside,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MsoPositionVRelative {
Margin,
Page,
Text,
Line,
TopMarginArea,
BottomMarginArea,
InnerMarginArea,
OuterMarginArea,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MsoWrapStyle {
Square,
None,
Tight,
Through,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct VmlLength {
pub value: f64,
pub unit: VmlLengthUnit,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlLengthUnit {
Pt,
In,
Cm,
Mm,
Px,
Em,
Percent,
None,
}
#[derive(Clone, Debug)]
pub struct VmlStroke {
pub dash_style: Option<VmlDashStyle>,
pub join_style: Option<VmlJoinStyle>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlDashStyle {
Solid,
ShortDash,
ShortDot,
ShortDashDot,
ShortDashDotDot,
Dot,
Dash,
LongDash,
DashDot,
LongDashDot,
LongDashDotDot,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlJoinStyle {
Round,
Bevel,
Miter,
}
#[derive(Clone, Debug)]
pub struct VmlPath {
pub gradient_shape_ok: Option<bool>,
pub connect_type: Option<VmlConnectType>,
pub extrusion_ok: Option<bool>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VmlConnectType {
None,
Rect,
Segments,
Custom,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct VmlTextBoxInset {
pub left: Option<VmlLength>,
pub top: Option<VmlLength>,
pub right: Option<VmlLength>,
pub bottom: Option<VmlLength>,
}
#[derive(Clone, Debug)]
pub struct VmlTextBox {
pub style: VmlStyle,
pub inset: Option<VmlTextBoxInset>,
pub content: Vec<Block>,
}