blob: add11239199798e2c6ba0c4952ca0578ce30ebbd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
<?xml version="1.0" encoding="utf-8"?>
<!--
** Author: Marco Ladermann
** Date: Wed Jan 29 08:41:56 CET 2003 @362 /Internet Time/
** Purpose: Convert tags in the UI file to Qt classes
** Changed:
**
** This software is free software. It is released under the terms of the
** GNU Lesser General Public Licence (LGPL)
** see http://www.gnu.org/copyleft/lesser.html
**
** These stylesheets are distributed in the hope that they will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-->
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:kde="http://kde.org/functions"
>
<!--
** Start of mode 'classes'
** The patterns with mode "classes" construct a
** result tree fragment of "class" elements with the
** Qt classes that should be used for a ui tag.
-->
<xsl:template match="action" mode="classes">
<class>TQAction</class>
<class>TQKeySequence</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="actiongroup" mode="classes">
<class>TQActionGroup</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="color" mode="classes">
<class>TQColor</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="cursor" mode="classes">
<class>TQCursor</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="font" mode="classes">
<class>TQFont</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="grid" mode="classes">
<class>TQGridLayout</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="hbox" mode="classes">
<class>TQHBoxLayout</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="iconset" mode="classes">
<class>TQIconSet</class>
<class>TQPixmap</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="item" mode="classes">
<xsl:if test="name(..) = 'widget'">
<class><xsl:value-of select="concat(../@class, 'Item')"/></class>
</xsl:if>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="menubar" mode="classes">
<class>TQMenuBar</class>
<class>TQPopupMenu</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="pixmap" mode="classes">
<class>TQPixmap</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="rect" mode="classes">
<class>TQRect</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="size" mode="classes">
<xsl:if test="not(name(../..) = 'spacer')">
<class>TQSize</class>
</xsl:if>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="sizepolicy" mode="classes">
<class>TQSizePolicy</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="spacer" mode="classes">
<class>TQSpacerItem</class>
<class>TQSizePolicy</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="toolbar" mode="classes">
<class>TQToolBar</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="vbox" mode="classes">
<class>TQVBoxLayout</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="palette" mode="classes">
<class>TQPalette</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="active|disabled|inactive" mode="classes">
<class>TQColorGroup</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="signal|slot" mode="classes">
<xsl:message>Check <xsl:value-of select="name()"/>: <xsl:value-of select="."/></xsl:message>
<xsl:call-template name="kde:classes-in-signature">
<xsl:with-param name="signature" select="."/>
</xsl:call-template>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="widget" mode="classes">
<xsl:choose>
<xsl:when test="@class = 'TQLayoutWidget'">
<class>TQWidget</class>
</xsl:when>
<xsl:when test="@class = 'TQDataBrowser'">
<class>TQDataBrowser</class>
<class>TQSqlForm</class>
</xsl:when>
<xsl:otherwise>
<class><xsl:value-of select="@class"/></class>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="property[@name = 'accel']" mode="classes">
<class>TQKeySequence</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="property[@name = 'toolTip']" mode="classes">
<class>TQToolTip</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="property[@name = 'whatsThis']" mode="classes">
<class>TQWhatsThis</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="property[@name = 'database']" mode="classes">
<class>TQSqlDatabase</class>
<class>TQSqlCursor</class>
<xsl:apply-templates mode="classes"/>
</xsl:template>
<xsl:template match="text()|@*" mode="classes"/>
<!--
** End of mode 'classes'
-->
<!--
** A mode to get classes corresponding to the tag names. This templates
** do not recurse and return a simple text value
-->
<xsl:template match="action" mode="toClass">
<xsl:text>TQAction</xsl:text>
</xsl:template>
<xsl:template match="actiongroup" mode="toClass">
<xsl:text>TQActionGroup</xsl:text>
</xsl:template>
<xsl:template match="grid" mode="toClass">
<xsl:text>TQGridLayout</xsl:text>
</xsl:template>
<xsl:template match="hbox" mode="toClass">
<xsl:text>TQHBoxLayout</xsl:text>
</xsl:template>
<xsl:template match="iconset" mode="toClass">
<xsl:text>TQIconSet</xsl:text>
</xsl:template>
<xsl:template match="menubar" mode="toClass">
<xsl:text>TQMenuBar</xsl:text>
</xsl:template>
<xsl:template match="pixmap" mode="toClass">
<xsl:text>TQPixmap</xsl:text>
</xsl:template>
<xsl:template match="spacer" mode="toClass">
<xsl:text>TQSpacerItem</xsl:text>
</xsl:template>
<xsl:template match="toolbar" mode="toClass">
<xsl:text>TQToolBar</xsl:text>
</xsl:template>
<xsl:template match="vbox" mode="toClass">
<xsl:text>TQVBoxLayout</xsl:text>
</xsl:template>
<xsl:template match="widget" mode="toClass">
<xsl:choose>
<xsl:when test="@class = 'TQLayoutWidget'">
<class>TQWidget</class>
</xsl:when>
<xsl:otherwise>
<class><xsl:value-of select="@class"/></class>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="toClass">
<xsl:message terminate="yes">Upps! Which class? <xsl:value-of select="name(.)"/></xsl:message>
</xsl:template>
</xsl:stylesheet>
|