SvgElement.cs 37.3 KB
Newer Older
Tebjan Halm's avatar
Tebjan Halm committed
1001
1002
1003
    }
    	
    
1004
1005
1006
    /// <summary>
    /// Describes the Attribute which was set
    /// </summary>
Tebjan Halm's avatar
Tebjan Halm committed
1007
    public class AttributeEventArgs : SVGArg
1008
1009
1010
1011
    {
    	public string Attribute;
    	public object Value;
    }
tebjan's avatar
tebjan committed
1012
    
tebjan's avatar
tebjan committed
1013
1014
1015
1016
1017
1018
1019
1020
    /// <summary>
    /// Content of this whas was set
    /// </summary>
    public class ContentEventArgs : SVGArg
    {
    	public string Content;
    }
    
tebjan's avatar
tebjan committed
1021
1022
1023
1024
1025
1026
    /// <summary>
    /// Describes the Attribute which was set
    /// </summary>
    public class ChildAddedEventArgs : SVGArg
    {
    	public SvgElement NewChild;
1027
    	public SvgElement BeforeSibling;
tebjan's avatar
tebjan committed
1028
    }
Tebjan Halm's avatar
Tebjan Halm committed
1029

Eric Domke's avatar
Eric Domke committed
1030
#if Net4
1031
1032
1033
    //deriving class registers event actions and calls the actions if the event occurs
    public interface ISvgEventCaller
    {
1034
        void RegisterAction(string rpcID, Action action);
1035
1036
1037
1038
        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
1039
        void RegisterAction<T1, T2, T3, T4, T5>(string rpcID, Action<T1, T2, T3, T4, T5> action);
1040
1041
1042
        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);
1043
        void UnregisterAction(string rpcID);
1044
    }
Eric Domke's avatar
Eric Domke committed
1045
#endif
1046

Tebjan Halm's avatar
Tebjan Halm committed
1047
1048
1049
    /// <summary>
    /// Represents the state of the mouse at the moment the event occured.
    /// </summary>
Tebjan Halm's avatar
Tebjan Halm committed
1050
    public class MouseArg : SVGArg
Tebjan Halm's avatar
Tebjan Halm committed
1051
1052
1053
1054
1055
    {
        public float x;
        public float y;

        /// <summary>
1056
        /// 1 = left, 2 = middle, 3 = right
Tebjan Halm's avatar
Tebjan Halm committed
1057
        /// </summary>
1058
        public int Button;
1059
        
1060
1061
1062
        /// <summary>
        /// Amount of mouse clicks, e.g. 2 for double click
        /// </summary>
1063
        public int ClickCount = -1;
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
        
        /// <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;
1079
    }
joreg's avatar
joreg committed
1080
1081
1082
1083
    
    /// <summary>
    /// Represents a string argument
    /// </summary>
Tebjan Halm's avatar
Tebjan Halm committed
1084
    public class StringArg : SVGArg
joreg's avatar
joreg committed
1085
1086
1087
    {
        public string s;
    }
1088
1089
1090
1091
    
    public class MouseScrollArg : SVGArg
    {
    	public int Scroll;
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
    	
    	/// <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;
1107
    }
1108

1109
1110
1111
1112
1113
    public interface ISvgNode
    {
        string Content { get; }
    }

davescriven's avatar
davescriven committed
1114
1115
    internal interface ISvgElement
    {
1116
1117
		SvgElement Parent {get;}
		SvgElementCollection Children { get; }
1118
        IList<ISvgNode> Nodes { get; }
1119

1120
        void Render(SvgRenderer renderer);
davescriven's avatar
davescriven committed
1121
1122
    }
}