source: trunk/EventBenchConsole/rules/ruleSchema.xsd @ 351

Last change on this file since 351 was 141, checked in by sherbold, 13 years ago

+ added "parentClass" as parameter for winInfoValue nodes for the MFC ruleset

File size: 7.5 KB
RevLine 
[1]1<?xml version="1.0" encoding="utf-8"?>
2<xs:schema targetNamespace="ul:rules"
3    elementFormDefault="qualified"
4    xmlns="ul:rules"
5    xmlns:xs="http://www.w3.org/2001/XMLSchema"
6>
7
8  <xs:element name="rules">
9    <xs:complexType>
10      <xs:sequence minOccurs="0" maxOccurs="unbounded">
11        <xs:element name="rule" type="ruleType"/>
12      </xs:sequence>
13    </xs:complexType>
14  </xs:element>
15
16  <!-- rule type definition -->
17  <xs:complexType name="ruleType">
18    <xs:sequence>
19      <xs:element name="msg" type="msgType" minOccurs="0" maxOccurs="unbounded"/>
20      <xs:choice minOccurs="0" maxOccurs="unbounded">
21        <xs:element name="genMsg" type="genMsgType"/>
22        <xs:element name="genMsgSeq" type="genMsgSeqType"/>
23      </xs:choice>
24      <xs:element name="idinfo" type="varType" minOccurs="0" maxOccurs="1"/>
25    </xs:sequence>
26    <xs:attribute name="name" type="xs:string" use="optional"/>
27  </xs:complexType>
28
29  <!-- message type definition -->
30  <xs:complexType name="msgType">
31    <xs:sequence minOccurs="0" maxOccurs="1">
32      <xs:choice minOccurs="0" maxOccurs="unbounded">
33        <xs:element name="equals" type="equalsType"/>
34        <xs:element name="equalsSeq" type="equalsSeqType"/>
35      </xs:choice>
36      <xs:choice minOccurs="0" maxOccurs="unbounded">
37        <xs:element name="store" type="storeType"/>
38        <xs:element name="storeSeq" type="storeSeqType"/>
39      </xs:choice>
40    </xs:sequence>
41    <xs:attribute name="type" type="xs:int" use="required"/>
42    <!-- problem: should be strings like WM_LBUTTONDOWN, but program needs ints -->
43    <!--<xs:attribute name="type" type="xs:string" use="required"/>-->
44    <xs:attribute name="multiple" type="xs:boolean" use="optional"/>
45  </xs:complexType>
46 
47  <!-- storage types for message nodes -->
48  <!-- a restriction forbidding "this" would be nice -->
49  <xs:complexType name="storeType">
50    <xs:sequence>
51      <xs:element name="resolveHwnd" type="resolveTargetType" minOccurs="0" maxOccurs="unbounded"/>
52    </xs:sequence>
53    <xs:attribute name="var" use="required" type="storVarName"/>
54  </xs:complexType>
55  <xs:complexType name="storeSeqType">
56    <xs:sequence>
57      <xs:element name="resolveHwnd" type="resolveTargetType" minOccurs="0" maxOccurs="unbounded"/>
58    </xs:sequence>
59    <xs:attribute name="varSeq" use="required" type="storVarName"/>
60  </xs:complexType>
61  <xs:complexType name="resolveTargetType">
62    <xs:attribute name="param" type="xs:string"/>
63    <xs:attribute name="storeParam" type="xs:string"/>
64  </xs:complexType>
65 
66  <!-- equals type for message nodes -->
67  <xs:complexType name="equalsType">
68    <xs:sequence minOccurs="2" maxOccurs="2">
69      <xs:group ref="valueGroup"/>
70    </xs:sequence>
71  </xs:complexType>
72  <xs:complexType name="equalsSeqType">
73    <xs:sequence>
74      <xs:element name="seqValue" type="seqValueType"/>
75      <xs:choice>
76        <xs:group ref="seqValueGroup"/>
77      </xs:choice>
78    </xs:sequence>
79  </xs:complexType>
80
81  <!-- types for generating messages -->
82  <xs:complexType name="genMsgType">
83    <xs:choice>
84      <xs:sequence>
85        <xs:element name="type" type="varType"/>
86        <xs:element name="target" type="varType"/>
87        <xs:element name="LPARAM" type="PARAMtype" minOccurs="0" maxOccurs="1"/>
88        <xs:element name="WPARAM" type="PARAMtype" minOccurs="0" maxOccurs="1"/>
89      </xs:sequence>
90      <xs:element name="storedVar">
91        <xs:complexType>
92          <xs:attribute name="obj" type="xs:string"/>
93        </xs:complexType>
94      </xs:element>
95    </xs:choice>
96    <xs:attribute name="delay" type="xs:int" use="required"/>
97  </xs:complexType>
98  <xs:complexType name="genMsgSeqType">
99    <xs:choice>
100      <xs:sequence>
101        <xs:element name="type" type="seqType"/>
102        <!-- target must be a variable! -->
103        <xs:element name="target">
104          <xs:complexType >
105            <xs:sequence>
106              <xs:element name="seqValue" type="seqValueType"/>
107            </xs:sequence>
108          </xs:complexType>
109        </xs:element>       
110        <xs:element name="LPARAM" type="seqPARAMtype" minOccurs="0" maxOccurs="1"/>
111        <xs:element name="WPARAM" type="seqPARAMtype" minOccurs="0" maxOccurs="1"/>
112      </xs:sequence>
113      <xs:element name="storedSeqVar">
114        <xs:complexType>
115          <xs:attribute name="seqObj" type="xs:string"/>
116        </xs:complexType>
117      </xs:element>
118    </xs:choice>
119    <xs:attribute name="delay" type="xs:int" use="required"/>
120  </xs:complexType>
121
122  <xs:complexType name="PARAMtype">
123    <xs:choice>
124      <xs:group ref="valueGroup"/>
125      <xs:sequence>
126        <xs:element name="LOWORD" type="varType"/>
127        <xs:element name="HIWORD" type="varType"/>
128      </xs:sequence>
129    </xs:choice>
130  </xs:complexType>
131 
132  <xs:complexType name="seqPARAMtype">
133    <xs:choice>
134      <xs:group ref="seqValueGroup"/>
135      <xs:sequence>
136        <xs:element name="LOWORD" type="seqType"/>
137        <xs:element name="HIWORD" type="seqType"/>
138      </xs:sequence>
139    </xs:choice>
140  </xs:complexType>
141 
142 
143  <xs:complexType name="seqValueType">
144    <xs:attribute name ="seqObj" type="xs:string" use="required"/>
145    <xs:attribute name ="param" type="xs:string" use="required"/>
146  </xs:complexType>
147
148  <!-- values that can be used by equals and genMsg nodes -->
149  <xs:group name="valueGroup">
150    <xs:choice>
151      <xs:element name="paramValue" type="paramValueType"/>
152      <xs:element name="constValue" type="constValueType"/>
153      <xs:element name="winInfoValue" type ="winInfoValueType"/>
154      <xs:element name="msgInfoValue" type="msgInfoType"/>
155    </xs:choice>
156  </xs:group>
157  <xs:complexType name="varType">
158    <xs:group ref="valueGroup"/>
159  </xs:complexType>
160 
161  <xs:group name="seqValueGroup">
162    <xs:choice>
163      <xs:element name="constValue" type="constValueType"/>
164      <xs:element name="seqValue" type="seqValueType"/>
165    </xs:choice>
166  </xs:group>
167  <xs:complexType name="seqType">
168    <xs:group ref="seqValueGroup"/>
169  </xs:complexType>
170 
171  <xs:complexType name="paramValueType">
172    <xs:attribute name="obj" type="xs:string" use="required"/>
173    <xs:attribute name="param" type="xs:string" use="required"/>
174  </xs:complexType>
175  <xs:complexType name="constValueType">
176    <xs:attribute name="value" use="required"/>
177  </xs:complexType>
178  <xs:complexType name="winInfoValueType">
179    <xs:attribute name="obj" type="xs:string" use="required"/>
180    <xs:attribute name="winParam" type="winParamType" use="required"/>
181  </xs:complexType>
182  <xs:complexType name="msgInfoType">
183    <xs:attribute name="obj" type="xs:string" use="required"/>
184    <xs:attribute name="msgParam" type="msgParamType" use="required"/>
185  </xs:complexType>
186  <xs:simpleType name="winParamType">
187    <xs:restriction base="xs:string">
188      <xs:enumeration value="class"/>
189      <xs:enumeration value="resourceId"/>
190      <xs:enumeration value="hwnd"/>
[27]191      <xs:enumeration value="parentTarget"/>
[141]192      <xs:enumeration value="parentClass"/>
[1]193    </xs:restriction>
194  </xs:simpleType>
195  <xs:simpleType name="msgParamType">
196    <xs:restriction base="xs:string">
197      <xs:enumeration value="type"/>
198      <xs:enumeration value="target"/>
199    </xs:restriction>
200  </xs:simpleType>
201 
202
203  <xs:simpleType name="storVarName">
204    <xs:restriction base="xs:string">
205      <!-- this regex is formally not supported by XMLSchema, als look-arounds and \b are not supported :/ -->
206      <xs:pattern value="(?:(?!(?>\bthis\b))\w)+"/>
207    </xs:restriction>
208  </xs:simpleType>
209</xs:schema>
Note: See TracBrowser for help on using the repository browser.