This file is indexed.

/usr/share/xml/xgridfit/lib/move-lib.xsl is in xgridfit 2.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:xgf="http://xgridfit.sourceforge.net/Xgridfit2"
		version="1.0">

  <!-- This file is part of xgridfit.
       It is distributed under the GNU Public License, version 2.
       Copyright (c) 2006-11 by Peter S. Baker
  -->
  
  <!--

      do-mirp

      If "round" is "yes," we just go with the cut-in value. The cut-in
        actually determines how we set bit 3, because having the cut-in
        off implies that rounding MUST be off, while the round state can
        be anything (including "no") if the cut-in is "yes."
      If "round" is anything but "yes," we explicitly set the round state,
        calling the template that changes round state (but we do not store).
        Then, at the end, we call the template that restores the stored
        round state (it will be the previous one). Thus the round state that
        is specified for this instruction applies only to this instruction.
      If "ref-pt" is specified, we set RP0 before we do the MIRP or MDRP.
  -->
  <xsl:template name="do-mirp">
    <xsl:param name="distance"/>
    <xsl:param name="round" select="'yes'"/>
    <xsl:param name="cut-in" select="true()"/>
    <xsl:param name="min-distance" select="true()"/>
    <xsl:param name="set-rp0" select="false()"/>
    <xsl:param name="l-color" select="'gray'"/>
    <xsl:param name="move-pt"/>
    <xsl:param name="ref-pt"/>
    <xsl:param name="suppress-set-rp0" select="false()"/>
    <xsl:param name="mp-container"/>
    <xsl:variable name="need-set-round"
      select="boolean($round != 'yes' and ($round != 'no' or $cut-in))"/>
    <xsl:if test="$round != 'no' and not($cut-in)">
      <xsl:call-template name="warning">
        <xsl:with-param name="msg">
          <xsl:text>In the MIRP instruction round state cannot be "on" </xsl:text>
          <xsl:text>and CVT cut-in "off." Rounding will not be used.</xsl:text>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:if>
    <xsl:if test="$need-set-round">
      <!-- Set round state without saving it, so we can restore the
           previous one when done. -->
      <xsl:call-template name="do-set-round">
        <xsl:with-param name="round-state" select="$round"/>
	<xsl:with-param name="push-current" select="true()"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:if test="not($suppress-set-rp0) and $ref-pt">
      <!-- Set RP0 if a reference point has been specified. ZP0 for this point. -->
      <xsl:call-template name="push-point">
        <xsl:with-param name="pt" select="$ref-pt"/>
        <xsl:with-param name="zp" select="'0'"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
      <xsl:call-template name="simple-command">
        <xsl:with-param name="cmd" select="'SRP0'"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:call-template name="push-point-and-distance">
      <xsl:with-param name="pt" select="$move-pt"/>
      <xsl:with-param name="ds" select="$distance"/>
      <xsl:with-param name="zp" select="'1'"/>
      <xsl:with-param name="mp-container" select="$mp-container"/>
    </xsl:call-template>
    <!-- Do the move. -->
    <xsl:call-template name="simple-command">
      <xsl:with-param name="cmd" select="'MIRP'"/>
      <xsl:with-param name="modifier">
        <xsl:call-template name="mirp-mdrp-bits">
          <xsl:with-param name="set-rp0" select="$set-rp0"/>
          <xsl:with-param name="min-distance" select="$min-distance"/>
          <xsl:with-param name="round-cut-in" select="$cut-in"/>
          <xsl:with-param name="l-color" select="$l-color"/>
        </xsl:call-template>
      </xsl:with-param>
    </xsl:call-template>
    <xsl:if test="$need-set-round">
      <xsl:call-template name="restore-round-state">
	<xsl:with-param name="from-stack" select="true()"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:call-template name="set-zone-pointers-to-glyph"/>
  </xsl:template>
  
  <!--

       do-miap

       Similar to "do-mirp" but there's no reference point, no minimum distance,
       no color, and no choice about whether to set RP0. We do the same thing
       to sort out the relationship between rounding and the CVT cut-in.
  -->
  <xsl:template name="do-miap">
    <xsl:param name="distance"/>
    <xsl:param name="round" select="'yes'"/>
    <xsl:param name="cut-in" select="true()"/>
    <xsl:param name="move-pt"/>
    <xsl:param name="mp-container"/>
    <xsl:variable name="need-set-round"
      select="boolean($round != 'yes' and ($round != 'no' or $cut-in))"/>
    <xsl:if test="$round != 'no' and not($cut-in)">
      <xsl:call-template name="warning">
        <xsl:with-param name="msg">
          <xsl:text>In the MIAP instruction round state cannot be "on" </xsl:text>
          <xsl:text>and CVT cut-in "off." Rounding will not be used.</xsl:text>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:if>
    <xsl:if test="$need-set-round">
      <!-- We don't save this round state; so what we have stored is the
           previous one. -->
      <xsl:call-template name="do-set-round">
        <xsl:with-param name="round-state" select="$round"/>
	<xsl:with-param name="push-current" select="true()"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:call-template name="push-point-and-distance">
      <xsl:with-param name="pt" select="$move-pt"/>
      <xsl:with-param name="ds" select="$distance"/>
      <xsl:with-param name="zp" select="'0'"/>
      <xsl:with-param name="mp-container" select="$mp-container"/>
    </xsl:call-template>
    <!-- Do the move -->
    <xsl:call-template name="simple-command">
      <xsl:with-param name="cmd" select="'MIAP'"/>
      <xsl:with-param name="modifier">
        <xsl:call-template name="round-and-cut-in-bit">
          <xsl:with-param name="b" select="$cut-in"/>
        </xsl:call-template>
      </xsl:with-param>
    </xsl:call-template>
    <xsl:if test="$need-set-round">
      <xsl:call-template name="restore-round-state">
	<xsl:with-param name="from-stack" select="true()"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:call-template name="set-zone-pointers-to-glyph"/>
  </xsl:template>
  
  
  <!--

      do-mdrp

      Similar to do-mirp, but there's no distance and no cut-in, so no
      confusion about the relationship between rounding and the cut-in.
  -->
  <xsl:template name="do-mdrp">
    <xsl:param name="round" select="'yes'"/>
    <xsl:param name="min-distance" select="true()"/>
    <xsl:param name="set-rp0" select="false()"/>
    <xsl:param name="l-color" select="'gray'"/>
    <xsl:param name="move-pt"/>
    <xsl:param name="ref-pt"/>
    <xsl:param name="suppress-set-rp0" select="false()"/>
    <xsl:param name="mp-container"/>
    <xsl:variable name="rnotno" select="boolean($round != 'no')"/>
    <xsl:variable name="rnot" select="boolean($rnotno and $round != 'yes')"/>
    <xsl:if test="$rnot">
      <!-- We don't save this round state; so what we have stored is the
           previous one. -->
      <xsl:call-template name="do-set-round">
        <xsl:with-param name="round-state" select="$round"/>
	<xsl:with-param name="push-current" select="true()"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:if test="not($suppress-set-rp0) and $ref-pt">
      <!-- Set RP0 if a reference point has been specified. -->
      <xsl:call-template name="push-point">
        <xsl:with-param name="pt" select="$ref-pt"/>
        <xsl:with-param name="zp" select="'0'"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
      <xsl:call-template name="simple-command">
        <xsl:with-param name="cmd" select="'SRP0'"/>
      </xsl:call-template>
    </xsl:if>
    <!-- Push the point we're going to move. -->
    <xsl:call-template name="push-point">
      <xsl:with-param name="pt" select="$move-pt"/>
      <xsl:with-param name="zp" select="'1'"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
    </xsl:call-template>
    <!-- Do the move. -->
    <xsl:call-template name="simple-command">
      <xsl:with-param name="cmd" select="'MDRP'"/>
      <xsl:with-param name="modifier">
        <xsl:call-template name="mirp-mdrp-bits">
          <xsl:with-param name="set-rp0" select="$set-rp0"/>
          <xsl:with-param name="min-distance" select="$min-distance"/>
          <xsl:with-param name="round-cut-in" select="$rnotno"/>
          <xsl:with-param name="l-color" select="$l-color"/>
        </xsl:call-template>
      </xsl:with-param>
    </xsl:call-template>
    <xsl:if test="$rnot">
      <xsl:call-template name="restore-round-state">
	<xsl:with-param name="from-stack" select="true()"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:call-template name="set-zone-pointers-to-glyph"/>
  </xsl:template>
  
  <!--

      do-mdap

  -->
  <xsl:template name="do-mdap">
    <xsl:param name="round" select="'yes'"/>
    <xsl:param name="move-pt"/>
    <xsl:param name="mp-container"/>
    <xsl:variable name="rnotno" select="boolean($round != 'no')"/>
    <xsl:variable name="rnot" select="boolean($rnotno and $round != 'yes')"/>
    <xsl:if test="$rnot">
      <!-- We don't save this round state; so what we have stored is the
           previous one. -->
      <xsl:call-template name="do-set-round">
        <xsl:with-param name="round-state" select="$round"/>
	<xsl:with-param name="push-current" select="true()"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
    </xsl:if>
    <!-- Push the point we're going to move. ZP0 for this point. -->
    <xsl:call-template name="push-point">
      <xsl:with-param name="pt" select="$move-pt"/>
      <xsl:with-param name="zp" select="'0'"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
    </xsl:call-template>
    <!-- Do the move. -->
    <xsl:call-template name="simple-command">
      <xsl:with-param name="cmd" select="'MDAP'"/>
      <xsl:with-param name="modifier">
        <xsl:call-template name="round-and-cut-in-bit">
          <xsl:with-param name="b" select="$rnotno"/>
        </xsl:call-template>
      </xsl:with-param>
    </xsl:call-template>
    <!-- Restore round state if we changed it. -->
    <xsl:if test="$rnot">
      <xsl:call-template name="restore-round-state">
	<xsl:with-param name="from-stack" select="true()"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:call-template name="set-zone-pointers-to-glyph"/>
  </xsl:template>
  
  <xsl:template name="do-alignrp">
    <xsl:param name="move-pts"/>
    <xsl:param name="ref-pt"/>
    <xsl:param name="phantom-ref-pt"/>
    <xsl:param name="mp-container"/>
    <xsl:if test="$ref-pt">
      <xsl:call-template name="push-point">
        <xsl:with-param name="pt" select="$ref-pt"/>
        <xsl:with-param name="zp" select="'0'"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
      <xsl:call-template name="simple-command">
        <xsl:with-param name="cmd" select="'SRP0'"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:if test="$move-pts">
      <xsl:call-template name="push-points">
        <xsl:with-param name="pts" select="$move-pts"/>
        <xsl:with-param name="zp" select="'1'"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
      <xsl:if test="count($move-pts) &gt; 1">
        <xsl:call-template name="number-command">
          <xsl:with-param name="num" select="count($move-pts)"/>
          <xsl:with-param name="cmd" select="'SLOOP'"/>
        </xsl:call-template>
      </xsl:if>
      <xsl:call-template name="simple-command">
        <xsl:with-param name="cmd" select="'ALIGNRP'"/>
      </xsl:call-template>
      <xsl:if test="$move-pts[1]/@zone">
        <xsl:call-template name="set-zone-pointer">
          <xsl:with-param name="z" select="'glyph'"/>
          <xsl:with-param name="zp" select="'1'"/>
        </xsl:call-template>
      </xsl:if>
    </xsl:if>
    <xsl:call-template name="set-zone-pointers-to-glyph"/>
  </xsl:template>
  
  <xsl:template name="do-iup">
    <xsl:param name="axis"/>
    <xsl:choose>
      <xsl:when test="$axis">
        <xsl:call-template name="simple-command">
          <xsl:with-param name="cmd" select="'IUP'"/>
          <xsl:with-param name="modifier">
            <xsl:call-template name="axis-bit">
              <xsl:with-param name="axis" select="$axis"/>
            </xsl:call-template>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="simple-command">
          <xsl:with-param name="cmd" select="'IUP'"/>
          <xsl:with-param name="modifier">
            <xsl:call-template name="axis-bit">
              <xsl:with-param name="axis" select="'x'"/>
            </xsl:call-template>
          </xsl:with-param>
        </xsl:call-template>
        <xsl:call-template name="simple-command">
          <xsl:with-param name="cmd" select="'IUP'"/>
          <xsl:with-param name="modifier">
            <xsl:call-template name="axis-bit">
              <xsl:with-param name="axis" select="'y'"/>
            </xsl:call-template>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <xsl:template name="do-isect">
    <xsl:param name="move-pt"/>
    <xsl:param name="line-a"/>
    <xsl:param name="line-b"/>
    <xsl:param name="mp-container"/>
    <xsl:call-template name="push-point">
      <xsl:with-param name="pt" select="$move-pt"/>
      <xsl:with-param name="zp" select="'2'"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
    </xsl:call-template>
    <xsl:apply-templates mode="push-it" select="$line-a">
      <xsl:with-param name="zp" select="'0'"/>
      <xsl:with-param name="zones" select="1"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
    </xsl:apply-templates>
    <xsl:apply-templates mode="push-it" select="$line-b">
      <xsl:with-param name="zp" select="'0'"/>
      <xsl:with-param name="zones" select="1"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
    </xsl:apply-templates>
    <xsl:call-template name="simple-command">
      <xsl:with-param name="cmd" select="'ISECT'"/>
    </xsl:call-template>
    <xsl:call-template name="set-zone-pointers-to-glyph"/>
  </xsl:template>
  
  <xsl:template name="do-shpix">
    <xsl:param name="pts"/>
    <xsl:param name="val"/>
    <xsl:param name="mp-container"/>
    <xsl:if test="$pts">
      <xsl:call-template name="push-points">
        <xsl:with-param name="pts" select="$pts"/>
        <xsl:with-param name="zp" select="'2'"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
      <xsl:call-template name="expression">
        <xsl:with-param name="val" select="$val"/>
        <xsl:with-param name="permitted" select="'1xfvnc'"/>
        <xsl:with-param name="cvt-mode" select="'value'"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
	<xsl:with-param name="to-stack" select="true()"/>
      </xsl:call-template>
      <xsl:if test="count($pts) &gt; 1">
        <xsl:call-template name="number-command">
          <xsl:with-param name="num" select="count($pts)"/>
          <xsl:with-param name="cmd" select="'SLOOP'"/>
        </xsl:call-template>
      </xsl:if>
      <xsl:call-template name="simple-command">
        <xsl:with-param name="cmd" select="'SHPIX'"/>
      </xsl:call-template>
      <xsl:if test="$pts[1]/@zone">
        <xsl:call-template name="set-zone-pointer">
          <xsl:with-param name="z" select="'glyph'"/>
          <xsl:with-param name="zp" select="'2'"/>
        </xsl:call-template>
      </xsl:if>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="do-flippt">
    <xsl:param name="pts"/>
    <xsl:param name="mp-container"/>
    <xsl:if test="$pts">
      <xsl:call-template name="push-points">
        <xsl:with-param name="pts" select="$pts"/>
        <xsl:with-param name="zp" select="'0'"/>
	<xsl:with-param name="mp-container"
			select="$mp-container"/>
      </xsl:call-template>
      <xsl:if test="count($pts) &gt; 1">
        <xsl:call-template name="number-command">
          <xsl:with-param name="num" select="count($pts)"/>
          <xsl:with-param name="cmd" select="'SLOOP'"/>
        </xsl:call-template>
      </xsl:if>
      <xsl:call-template name="simple-command">
        <xsl:with-param name="cmd" select="'FLIPPT'"/>
      </xsl:call-template>
      <xsl:if test="$pts[1]/@zone">
        <xsl:call-template name="set-zone-pointer">
          <xsl:with-param name="z" select="'glyph'"/>
          <xsl:with-param name="zp" select="'0'"/>
        </xsl:call-template>
      </xsl:if>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="do-alignpts">
    <xsl:param name="pt-one"/>
    <xsl:param name="pt-two"/>
    <xsl:param name="mp-container"/>
    <xsl:call-template name="push-point">
      <xsl:with-param name="pt" select="$pt-one"/>
      <xsl:with-param name="zp" select="'1'"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
    </xsl:call-template>
    <xsl:call-template name="push-point">
      <xsl:with-param name="pt" select="$pt-two"/>
      <xsl:with-param name="zp" select="'0'"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
    </xsl:call-template>
    <xsl:call-template name="simple-command">
      <xsl:with-param name="cmd" select="'ALIGNPTS'"/>
    </xsl:call-template>
    <xsl:call-template name="set-zone-pointers-to-glyph"/>
  </xsl:template>
  
  <xsl:template name="do-set-coordinate">
    <xsl:param name="pt"/>
    <xsl:param name="coord"/>
    <xsl:param name="mp-container"/>
    <xsl:call-template name="push-point">
      <xsl:with-param name="pt" select="$pt"/>
      <xsl:with-param name="zp" select="'2'"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
    </xsl:call-template>
    <xsl:call-template name="expression">
      <xsl:with-param name="val" select="$coord"/>
      <xsl:with-param name="cvt-mode" select="'value'"/>
      <xsl:with-param name="permitted" select="'1xfvnc'"/>
      <xsl:with-param name="mp-container"
		      select="$mp-container"/>
      <xsl:with-param name="to-stack" select="true()"/>
    </xsl:call-template>
    <xsl:call-template name="simple-command">
      <xsl:with-param name="cmd" select="'SCFS'"/>
    </xsl:call-template>
  </xsl:template>

  <xsl:template name="round-points-with-scfs">
    <xsl:param name="pts"/>
    <xsl:param name="round"/>
    <xsl:param name="mp-container"/>
    <xsl:if test="$round != 'no'">
      <xsl:variable name="must-set-round" select="$round != 'yes'"/>
      <xsl:if test="$must-set-round">
	<xsl:call-template name="do-set-round">
	  <xsl:with-param name="round-state" select="$round"/>
	  <xsl:with-param name="push-current" select="true()"/>
	  <xsl:with-param name="mp-container"
			  select="$mp-container"/>
	</xsl:call-template>
      </xsl:if>
      <xsl:for-each select="$pts">
	<xsl:call-template name="push-point">
	  <xsl:with-param name="pt" select="."/>
	  <xsl:with-param name="zp" select="'2'"/>
	  <xsl:with-param name="mp-container"
			  select="$mp-container"/>
	</xsl:call-template>
	<xsl:call-template name="simple-command">
	  <xsl:with-param name="cmd" select="'DUP'"/>
	</xsl:call-template>
	<xsl:call-template name="simple-command">
	  <xsl:with-param name="cmd" select="'GC'"/>
	  <xsl:with-param name="modifier">
	    <xsl:call-template name="grid-fitted-bit">
	      <xsl:with-param name="grid-fitted" select="true()"/>
	    </xsl:call-template>
	  </xsl:with-param>
	</xsl:call-template>
	<xsl:call-template name="simple-command">
	  <xsl:with-param name="cmd" select="'ROUND'"/>
	  <xsl:with-param name="modifier">
	    <xsl:call-template name="color-bits">
	      <xsl:with-param name="l-color" select="$color"/>
	    </xsl:call-template>
	  </xsl:with-param>
	</xsl:call-template>
	<xsl:call-template name="simple-command">
	  <xsl:with-param name="cmd" select="'SCFS'"/>
	</xsl:call-template>
      </xsl:for-each>
      <xsl:if test="$must-set-round">
	<xsl:call-template name="restore-round-state">
	  <xsl:with-param name="from-stack" select="true()"/>
	</xsl:call-template>
      </xsl:if>
    </xsl:if>
  </xsl:template>

  <!-- Helper for move with pixel-distance -->
  <xsl:template name="round-stack-top">
    <xsl:param name="rnd"/>
    <xsl:param name="col"/>
    <xsl:param name="mp-container"/>
    <xsl:variable name="rnd-not-yes" select="boolean($rnd != 'yes')"/>
    <xsl:if test="$rnd != 'no'">
      <xsl:if test="$rnd-not-yes">
        <xsl:call-template name="do-set-round">
          <xsl:with-param name="round-state" select="$rnd"/>
          <xsl:with-param name="save" select="false()"/>
	  <xsl:with-param name="mp-container"
			  select="$mp-container"/>
        </xsl:call-template>
      </xsl:if>
      <xsl:call-template name="simple-command">
        <xsl:with-param name="cmd" select="'ROUND'"/>
        <xsl:with-param name="modifier">
          <xsl:call-template name="color-bits">
            <xsl:with-param name="l-color" select="$col"/>
          </xsl:call-template>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:if test="$rnd-not-yes">
        <xsl:call-template name="restore-round-state"/>
      </xsl:if>
    </xsl:if>
  </xsl:template>
  
</xsl:stylesheet>