source: trunk/quest-plugin-mfc/data/ruleSchema.xsd @ 677

Last change on this file since 677 was 618, checked in by pharms, 12 years ago
  • added event parameters to correctly generate MFC Events for scrolls and list box selections
File size: 7.7 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>
[618]24      <xs:element name="idinfo" type="idInfoType" minOccurs="0" maxOccurs="1"/>
[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 
[618]171  <xs:complexType name="idInfoType">
172    <xs:group ref="valueGroup"/>
173    <xs:group ref="seqValueGroup"></xs:group>
174  </xs:complexType>
175 
[1]176  <xs:complexType name="paramValueType">
177    <xs:attribute name="obj" type="xs:string" use="required"/>
178    <xs:attribute name="param" type="xs:string" use="required"/>
179  </xs:complexType>
180  <xs:complexType name="constValueType">
181    <xs:attribute name="value" use="required"/>
182  </xs:complexType>
183  <xs:complexType name="winInfoValueType">
184    <xs:attribute name="obj" type="xs:string" use="required"/>
185    <xs:attribute name="winParam" type="winParamType" use="required"/>
186  </xs:complexType>
187  <xs:complexType name="msgInfoType">
188    <xs:attribute name="obj" type="xs:string" use="required"/>
189    <xs:attribute name="msgParam" type="msgParamType" use="required"/>
190  </xs:complexType>
191  <xs:simpleType name="winParamType">
192    <xs:restriction base="xs:string">
193      <xs:enumeration value="class"/>
194      <xs:enumeration value="resourceId"/>
195      <xs:enumeration value="hwnd"/>
[27]196      <xs:enumeration value="parentTarget"/>
[141]197      <xs:enumeration value="parentClass"/>
[1]198    </xs:restriction>
199  </xs:simpleType>
200  <xs:simpleType name="msgParamType">
201    <xs:restriction base="xs:string">
202      <xs:enumeration value="type"/>
203      <xs:enumeration value="target"/>
204    </xs:restriction>
205  </xs:simpleType>
206 
207
208  <xs:simpleType name="storVarName">
209    <xs:restriction base="xs:string">
210      <!-- this regex is formally not supported by XMLSchema, als look-arounds and \b are not supported :/ -->
211      <xs:pattern value="(?:(?!(?>\bthis\b))\w)+"/>
212    </xs:restriction>
213  </xs:simpleType>
214</xs:schema>
Note: See TracBrowser for help on using the repository browser.