pub fn standard_tool_message(tool: ToolType, message_type: StandardToolMessageType) -> Option<ToolMessage> {
	match message_type {
		StandardToolMessageType::DocumentIsDirty => match tool {
			ToolType::Select => Some(SelectToolMessage::DocumentIsDirty.into()),
			ToolType::Artboard => Some(ArtboardToolMessage::DocumentIsDirty.into()),
			ToolType::Navigate => None,   // Some(NavigateToolMessage::DocumentIsDirty.into()),
			ToolType::Eyedropper => None, // Some(EyedropperToolMessage::DocumentIsDirty.into()),
			ToolType::Text => Some(TextMessage::DocumentIsDirty.into()),
			ToolType::Fill => None, // Some(FillToolMessage::DocumentIsDirty.into()),
			ToolType::Gradient => Some(GradientToolMessage::DocumentIsDirty.into()),
			ToolType::Brush => None,   // Some(BrushMessage::DocumentIsDirty.into()),
			ToolType::Heal => None,    // Some(HealMessage::DocumentIsDirty.into()),
			ToolType::Clone => None,   // Some(CloneMessage::DocumentIsDirty.into()),
			ToolType::Patch => None,   // Some(PatchMessage::DocumentIsDirty.into()),
			ToolType::Detail => None,  // Some(DetailToolMessage::DocumentIsDirty.into()),
			ToolType::Relight => None, // Some(RelightMessage::DocumentIsDirty.into()),
			ToolType::Path => Some(PathToolMessage::DocumentIsDirty.into()),
			ToolType::Pen => Some(PenToolMessage::DocumentIsDirty.into()),
			ToolType::Freehand => None,  // Some(FreehandToolMessage::DocumentIsDirty.into()),
			ToolType::Spline => None,    // Some(SplineToolMessage::DocumentIsDirty.into()),
			ToolType::Line => None,      // Some(LineToolMessage::DocumentIsDirty.into()),
			ToolType::Rectangle => None, // Some(RectangleToolMessage::DocumentIsDirty.into()),
			ToolType::Ellipse => None,   // Some(EllipseToolMessage::DocumentIsDirty.into()),
			ToolType::Shape => None,     // Some(ShapeToolMessage::DocumentIsDirty.into()),
		},
		StandardToolMessageType::Abort => match tool {
			ToolType::Select => Some(SelectToolMessage::Abort.into()),
			ToolType::Artboard => Some(ArtboardToolMessage::Abort.into()),
			ToolType::Navigate => Some(NavigateToolMessage::Abort.into()),
			ToolType::Eyedropper => Some(EyedropperToolMessage::Abort.into()),
			ToolType::Text => Some(TextMessage::Abort.into()),
			ToolType::Fill => Some(FillToolMessage::Abort.into()),
			ToolType::Gradient => Some(GradientToolMessage::Abort.into()),
			// ToolType::Brush => Some(BrushMessage::Abort.into()),
			// ToolType::Heal => Some(HealMessage::Abort.into()),
			// ToolType::Clone => Some(CloneMessage::Abort.into()),
			// ToolType::Patch => Some(PatchMessage::Abort.into()),
			// ToolType::Detail => Some(DetailToolMessage::Abort.into()),
			// ToolType::Relight => Some(RelightMessage::Abort.into()),
			ToolType::Path => Some(PathToolMessage::Abort.into()),
			ToolType::Pen => Some(PenToolMessage::Abort.into()),
			ToolType::Freehand => Some(FreehandToolMessage::Abort.into()),
			ToolType::Spline => Some(SplineToolMessage::Abort.into()),
			ToolType::Line => Some(LineToolMessage::Abort.into()),
			ToolType::Rectangle => Some(RectangleToolMessage::Abort.into()),
			ToolType::Ellipse => Some(EllipseToolMessage::Abort.into()),
			ToolType::Shape => Some(ShapeToolMessage::Abort.into()),
			_ => None,
		},
		StandardToolMessageType::SelectionChanged => match tool {
			ToolType::Path => Some(PathToolMessage::SelectionChanged.into()),
			_ => None,
		},
	}
}
// TODO: Find a nicer way in Rust to make this generic so we don't have to manually map to enum variants
Find a nicer way in Rust to make this generic so we don't have to manually map to enum variants
Find a nicer way in Rust to make this generic so we don ' t have to manually map to enum variants
pub fn standard_tool_message(tool: ToolType, message_type: StandardToolMessageType) -> Option<ToolMessage> {
	match message_type {
		StandardToolMessageType::DocumentIsDirty => match tool {
			ToolType::Select => Some(SelectToolMessage::DocumentIsDirty.into()),
			ToolType::Artboard => Some(ArtboardToolMessage::DocumentIsDirty.into()),
			ToolType::Navigate => None,   // Some(NavigateToolMessage::DocumentIsDirty.into()),
			ToolType::Eyedropper => None, // Some(EyedropperToolMessage::DocumentIsDirty.into()),
			ToolType::Text => Some(TextMessage::DocumentIsDirty.into()),
			ToolType::Fill => None, // Some(FillToolMessage::DocumentIsDirty.into()),
			ToolType::Gradient => Some(GradientToolMessage::DocumentIsDirty.into()),
			ToolType::Brush => None,   // Some(BrushMessage::DocumentIsDirty.into()),
			ToolType::Heal => None,    // Some(HealMessage::DocumentIsDirty.into()),
			ToolType::Clone => None,   // Some(CloneMessage::DocumentIsDirty.into()),
			ToolType::Patch => None,   // Some(PatchMessage::DocumentIsDirty.into()),
			ToolType::Detail => None,  // Some(DetailToolMessage::DocumentIsDirty.into()),
			ToolType::Relight => None, // Some(RelightMessage::DocumentIsDirty.into()),
			ToolType::Path => Some(PathToolMessage::DocumentIsDirty.into()),
			ToolType::Pen => Some(PenToolMessage::DocumentIsDirty.into()),
			ToolType::Freehand => None,  // Some(FreehandToolMessage::DocumentIsDirty.into()),
			ToolType::Spline => None,    // Some(SplineToolMessage::DocumentIsDirty.into()),
			ToolType::Line => None,      // Some(LineToolMessage::DocumentIsDirty.into()),
			ToolType::Rectangle => None, // Some(RectangleToolMessage::DocumentIsDirty.into()),
			ToolType::Ellipse => None,   // Some(EllipseToolMessage::DocumentIsDirty.into()),
			ToolType::Shape => None,     // Some(ShapeToolMessage::DocumentIsDirty.into()),
		},
		StandardToolMessageType::Abort => match tool {
			ToolType::Select => Some(SelectToolMessage::Abort.into()),
			ToolType::Artboard => Some(ArtboardToolMessage::Abort.into()),
			ToolType::Navigate => Some(NavigateToolMessage::Abort.into()),
			ToolType::Eyedropper => Some(EyedropperToolMessage::Abort.into()),
			ToolType::Text => Some(TextMessage::Abort.into()),
			ToolType::Fill => Some(FillToolMessage::Abort.into()),
			ToolType::Gradient => Some(GradientToolMessage::Abort.into()),
			// ToolType::Brush => Some(BrushMessage::Abort.into()),
			// ToolType::Heal => Some(HealMessage::Abort.into()),
			// ToolType::Clone => Some(CloneMessage::Abort.into()),
			// ToolType::Patch => Some(PatchMessage::Abort.into()),
			// ToolType::Detail => Some(DetailToolMessage::Abort.into()),
			// ToolType::Relight => Some(RelightMessage::Abort.into()),
			ToolType::Path => Some(PathToolMessage::Abort.into()),
			ToolType::Pen => Some(PenToolMessage::Abort.into()),
			ToolType::Freehand => Some(FreehandToolMessage::Abort.into()),
			ToolType::Spline => Some(SplineToolMessage::Abort.into()),
			ToolType::Line => Some(LineToolMessage::Abort.into()),
			ToolType::Rectangle => Some(RectangleToolMessage::Abort.into()),
			ToolType::Ellipse => Some(EllipseToolMessage::Abort.into()),
			ToolType::Shape => Some(ShapeToolMessage::Abort.into()),
			_ => None,
		},
		StandardToolMessageType::SelectionChanged => match tool {
			ToolType::Path => Some(PathToolMessage::SelectionChanged.into()),
			_ => None,
		},
	}
}
pub fn standard_tool_message ( tool : ToolType , message_type : StandardToolMessageType ) -> Option < ToolMessage > { match message_type { StandardToolMessageType :: DocumentIsDirty => match tool { ToolType :: Select => Some ( SelectToolMessage :: DocumentIsDirty . into ( ) ) , ToolType :: Artboard => Some ( ArtboardToolMessage :: DocumentIsDirty . into ( ) ) , ToolType :: Navigate => None , // Some(NavigateToolMessage::DocumentIsDirty.into()), ToolType :: Eyedropper => None , // Some(EyedropperToolMessage::DocumentIsDirty.into()), ToolType :: Text => Some ( TextMessage :: DocumentIsDirty . into ( ) ) , ToolType :: Fill => None , // Some(FillToolMessage::DocumentIsDirty.into()), ToolType :: Gradient => Some ( GradientToolMessage :: DocumentIsDirty . into ( ) ) , ToolType :: Brush => None , // Some(BrushMessage::DocumentIsDirty.into()), ToolType :: Heal => None , // Some(HealMessage::DocumentIsDirty.into()), ToolType :: Clone => None , // Some(CloneMessage::DocumentIsDirty.into()), ToolType :: Patch => None , // Some(PatchMessage::DocumentIsDirty.into()), ToolType :: Detail => None , // Some(DetailToolMessage::DocumentIsDirty.into()), ToolType :: Relight => None , // Some(RelightMessage::DocumentIsDirty.into()), ToolType :: Path => Some ( PathToolMessage :: DocumentIsDirty . into ( ) ) , ToolType :: Pen => Some ( PenToolMessage :: DocumentIsDirty . into ( ) ) , ToolType :: Freehand => None , // Some(FreehandToolMessage::DocumentIsDirty.into()), ToolType :: Spline => None , // Some(SplineToolMessage::DocumentIsDirty.into()), ToolType :: Line => None , // Some(LineToolMessage::DocumentIsDirty.into()), ToolType :: Rectangle => None , // Some(RectangleToolMessage::DocumentIsDirty.into()), ToolType :: Ellipse => None , // Some(EllipseToolMessage::DocumentIsDirty.into()), ToolType :: Shape => None , // Some(ShapeToolMessage::DocumentIsDirty.into()), } , StandardToolMessageType :: Abort => match tool { ToolType :: Select => Some ( SelectToolMessage :: Abort . into ( ) ) , ToolType :: Artboard => Some ( ArtboardToolMessage :: Abort . into ( ) ) , ToolType :: Navigate => Some ( NavigateToolMessage :: Abort . into ( ) ) , ToolType :: Eyedropper => Some ( EyedropperToolMessage :: Abort . into ( ) ) , ToolType :: Text => Some ( TextMessage :: Abort . into ( ) ) , ToolType :: Fill => Some ( FillToolMessage :: Abort . into ( ) ) , ToolType :: Gradient => Some ( GradientToolMessage :: Abort . into ( ) ) , // ToolType::Brush => Some(BrushMessage::Abort.into()), // ToolType::Heal => Some(HealMessage::Abort.into()), // ToolType::Clone => Some(CloneMessage::Abort.into()), // ToolType::Patch => Some(PatchMessage::Abort.into()), // ToolType::Detail => Some(DetailToolMessage::Abort.into()), // ToolType::Relight => Some(RelightMessage::Abort.into()), ToolType :: Path => Some ( PathToolMessage :: Abort . into ( ) ) , ToolType :: Pen => Some ( PenToolMessage :: Abort . into ( ) ) , ToolType :: Freehand => Some ( FreehandToolMessage :: Abort . into ( ) ) , ToolType :: Spline => Some ( SplineToolMessage :: Abort . into ( ) ) , ToolType :: Line => Some ( LineToolMessage :: Abort . into ( ) ) , ToolType :: Rectangle => Some ( RectangleToolMessage :: Abort . into ( ) ) , ToolType :: Ellipse => Some ( EllipseToolMessage :: Abort . into ( ) ) , ToolType :: Shape => Some ( ShapeToolMessage :: Abort . into ( ) ) , _ => None , } , StandardToolMessageType :: SelectionChanged => match tool { ToolType :: Path => Some ( PathToolMessage :: SelectionChanged . into ( ) ) , _ => None , } , } }
TODO: Find a nicer way in Rust to make this generic so we don't have to manually map to enum variants
TODO : Find a nicer way in Rust to make this generic so we don ' t have to manually map to enum variants
tool
ToolType
message_type
StandardToolMessageType
tool
ToolType
message_type
StandardToolMessageType