SvgElement.cs 36.5 KB
Newer Older
tebjan's avatar
tebjan committed
1001
1002
1003
    	public string Content;
    }
    
tebjan's avatar
tebjan committed
1004
1005
1006
1007
1008
1009
    /// <summary>
    /// Describes the Attribute which was set
    /// </summary>
    public class ChildAddedEventArgs : SVGArg
    {
    	public SvgElement NewChild;
1010
    	public SvgElement BeforeSibling;
tebjan's avatar
tebjan committed
1011
    }
Tebjan Halm's avatar
Tebjan Halm committed
1012

Eric Domke's avatar
Eric Domke committed
1013
#if Net4
1014
1015
1016
    //deriving class registers event actions and calls the actions if the event occurs
    public interface ISvgEventCaller
    {
1017
        void RegisterAction(string rpcID, Action action);
1018
1019
1020
1021
        void RegisterAction<T1>(string rpcID, Action<T1> action);
        void RegisterAction<T1, T2>(string rpcID, Action<T1, T2> action);
        void RegisterAction<T1, T2, T3>(string rpcID, Action<T1, T2, T3> action);
        void RegisterAction<T1, T2, T3, T4>(string rpcID, Action<T1, T2, T3, T4> action);
Tebjan Halm's avatar
Tebjan Halm committed
1022
        void RegisterAction<T1, T2, T3, T4, T5>(string rpcID, Action<T1, T2, T3, T4, T5> action);
1023
1024
1025
        void RegisterAction<T1, T2, T3, T4, T5, T6>(string rpcID, Action<T1, T2, T3, T4, T5, T6> action);
        void RegisterAction<T1, T2, T3, T4, T5, T6, T7>(string rpcID, Action<T1, T2, T3, T4, T5, T6, T7> action);
        void RegisterAction<T1, T2, T3, T4, T5, T6, T7, T8>(string rpcID, Action<T1, T2, T3, T4, T5, T6, T7, T8> action);
1026
        void UnregisterAction(string rpcID);
1027
    }
Eric Domke's avatar
Eric Domke committed
1028
#endif
1029

Tebjan Halm's avatar
Tebjan Halm committed
1030
1031
1032
    /// <summary>
    /// Represents the state of the mouse at the moment the event occured.
    /// </summary>
Tebjan Halm's avatar
Tebjan Halm committed
1033
    public class MouseArg : SVGArg
Tebjan Halm's avatar
Tebjan Halm committed
1034
1035
1036
1037
1038
    {
        public float x;
        public float y;

        /// <summary>
1039
        /// 1 = left, 2 = middle, 3 = right
Tebjan Halm's avatar
Tebjan Halm committed
1040
        /// </summary>
1041
        public int Button;
1042
        
1043
1044
1045
        /// <summary>
        /// Amount of mouse clicks, e.g. 2 for double click
        /// </summary>
1046
        public int ClickCount = -1;
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
        
        /// <summary>
        /// Alt modifier key pressed
        /// </summary>
        public bool AltKey;
        
        /// <summary>
        /// Shift modifier key pressed
        /// </summary>
        public bool ShiftKey;
        
        /// <summary>
        /// Control modifier key pressed
        /// </summary>
        public bool CtrlKey;
1062
    }
joreg's avatar
joreg committed
1063
1064
1065
1066
    
    /// <summary>
    /// Represents a string argument
    /// </summary>
Tebjan Halm's avatar
Tebjan Halm committed
1067
    public class StringArg : SVGArg
joreg's avatar
joreg committed
1068
1069
1070
    {
        public string s;
    }
1071
1072
1073
1074
    
    public class MouseScrollArg : SVGArg
    {
    	public int Scroll;
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
    	
    	/// <summary>
        /// Alt modifier key pressed
        /// </summary>
        public bool AltKey;
        
        /// <summary>
        /// Shift modifier key pressed
        /// </summary>
        public bool ShiftKey;
        
        /// <summary>
        /// Control modifier key pressed
        /// </summary>
        public bool CtrlKey;
1090
    }
1091

1092
1093
1094
1095
1096
    public interface ISvgNode
    {
        string Content { get; }
    }

davescriven's avatar
davescriven committed
1097
1098
    internal interface ISvgElement
    {
1099
1100
		SvgElement Parent {get;}
		SvgElementCollection Children { get; }
1101
        IList<ISvgNode> Nodes { get; }
1102

1103
        void Render(SvgRenderer renderer);
davescriven's avatar
davescriven committed
1104
1105
    }
}