SvgElement.cs 37.8 KB
Newer Older
joreg's avatar
joreg committed
1001
            {
1002
                handler(sender, e);
joreg's avatar
joreg committed
1003
1004
            }
        }
1005
        
Tebjan Halm's avatar
Tebjan Halm committed
1006
1007
        #endregion graphical EVENTS
    }
1008
    
Tebjan Halm's avatar
Tebjan Halm committed
1009
1010
1011
1012
1013
1014
    public class SVGArg : EventArgs
    {
    	public string SessionID;
    }
    	
    
1015
1016
1017
    /// <summary>
    /// Describes the Attribute which was set
    /// </summary>
Tebjan Halm's avatar
Tebjan Halm committed
1018
    public class AttributeEventArgs : SVGArg
1019
1020
1021
1022
    {
    	public string Attribute;
    	public object Value;
    }
tebjan's avatar
tebjan committed
1023
    
tebjan's avatar
tebjan committed
1024
1025
1026
1027
1028
1029
1030
1031
    /// <summary>
    /// Content of this whas was set
    /// </summary>
    public class ContentEventArgs : SVGArg
    {
    	public string Content;
    }
    
tebjan's avatar
tebjan committed
1032
1033
1034
1035
1036
1037
    /// <summary>
    /// Describes the Attribute which was set
    /// </summary>
    public class ChildAddedEventArgs : SVGArg
    {
    	public SvgElement NewChild;
1038
    	public SvgElement BeforeSibling;
tebjan's avatar
tebjan committed
1039
    }
Tebjan Halm's avatar
Tebjan Halm committed
1040

Eric Domke's avatar
Eric Domke committed
1041
#if Net4
1042
1043
1044
    //deriving class registers event actions and calls the actions if the event occurs
    public interface ISvgEventCaller
    {
1045
        void RegisterAction(string rpcID, Action action);
1046
1047
1048
1049
        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
1050
        void RegisterAction<T1, T2, T3, T4, T5>(string rpcID, Action<T1, T2, T3, T4, T5> action);
1051
1052
1053
        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);
1054
        void UnregisterAction(string rpcID);
1055
    }
Eric Domke's avatar
Eric Domke committed
1056
#endif
1057

Tebjan Halm's avatar
Tebjan Halm committed
1058
1059
1060
    /// <summary>
    /// Represents the state of the mouse at the moment the event occured.
    /// </summary>
Tebjan Halm's avatar
Tebjan Halm committed
1061
    public class MouseArg : SVGArg
Tebjan Halm's avatar
Tebjan Halm committed
1062
1063
1064
1065
1066
    {
        public float x;
        public float y;

        /// <summary>
1067
        /// 1 = left, 2 = middle, 3 = right
Tebjan Halm's avatar
Tebjan Halm committed
1068
        /// </summary>
1069
        public int Button;
1070
        
1071
1072
1073
        /// <summary>
        /// Amount of mouse clicks, e.g. 2 for double click
        /// </summary>
1074
        public int ClickCount = -1;
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
    }
joreg's avatar
joreg committed
1091
1092
1093
1094
    
    /// <summary>
    /// Represents a string argument
    /// </summary>
Tebjan Halm's avatar
Tebjan Halm committed
1095
    public class StringArg : SVGArg
joreg's avatar
joreg committed
1096
1097
1098
    {
        public string s;
    }
1099
1100
1101
1102
    
    public class MouseScrollArg : SVGArg
    {
    	public int Scroll;
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
    	
    	/// <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;
1118
    }
1119

1120
1121
1122
1123
1124
    public interface ISvgNode
    {
        string Content { get; }
    }

davescriven's avatar
davescriven committed
1125
1126
    internal interface ISvgElement
    {
1127
1128
		SvgElement Parent {get;}
		SvgElementCollection Children { get; }
1129
        IList<ISvgNode> Nodes { get; }
1130

Eric Domke's avatar
Eric Domke committed
1131
        void Render(ISvgRenderer renderer);
davescriven's avatar
davescriven committed
1132
1133
    }
}