summaryrefslogtreecommitdiff
path: root/doc/editor_configs/xmlmind/addon/config/scons/common.incl
blob: d03f74c8a79cfbc0edfd11b5fde1b78823d7a109 (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
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
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
<?xml version='1.0' encoding='ISO-8859-1'?>
<configuration
  xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"
  xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration">

  <translation location="docbook_en.properties" />

  <inclusionScheme name="XInclude">
    <class>com.xmlmind.xml.xinclude.XIncludeScheme</class>
  </inclusionScheme>

  <cfg:preserveSpace xmlns="" 
    elements="address funcsynopsisinfo classsynopsisinfo 
              literallayout programlisting screen synopsis
              sconstruct scons_example_file example_commands
              scons_output_command file directory" />

  <cfg:documentResources xmlns="">
    <cfg:resource path="//@fileref" />
  </cfg:documentResources>

  <!-- Fixes the cols attribute of tgroup and entrytbl if needed to -->
  <validateHook>
    <class>com.xmlmind.xmleditext.docbook.table.ValidateHookImpl</class>
  </validateHook>

  <cfg:spellCheckOptions xmlns=""
    useAutomaticSpellChecker="true"
    languageAttribute="lang"
    skippedElements="address programlisting screen synopsis code sgmltag 
                     classsynopsisinfo modifier package classname  
                     interfacename exceptionname varname methodname
                     funcsynopsisinfo modifier type function
                     initializer parameter funcparams
                     lhs rhs nonterminal" />

  <!-- Menu ============================================================== -->

  <command name="docb.tableEdit">
    <class>com.xmlmind.xmleditext.docbook.DBTableEdit</class>
  </command>

  <command name="docb.promote">
    <class>com.xmlmind.xmleditext.docbook.Promote</class>
  </command>
  <command name="docb.demote">
    <class>com.xmlmind.xmleditext.docbook.Demote</class>
  </command>

  <command name="docb.toggleInformal">
    <macro undoable="true"
           label="Convert informal&lt;element&gt; to/from &lt;element&gt;">
      <choice>
        <sequence>
          <command name="selectNode" 
            parameter="ancestorOrSelf[implicitElement]
                       informaltable informalfigure informalexample" />

          <!-- DocBook 4.3 supports HTML tables and we will *not* attempt to 
               transform an HTML informaltable to a HTML table 
               with a caption. -->

          <test context="$selected" 
                expression="local-name() != 'informaltable' or ./tgroup" />

          <command name="selectNode" parameter="children" />
          <command name="copy" />
          <command name="selectNode" parameter="parent" />
          <get context="$selected" 
               expression="substring-after(local-name(), 'informal')" />
	  <command name="replace" parameter="%_" />
          <set variable="selectedNodes" context="$selected"
               expression="./*[position() &gt; 1]" />
	  <command name="paste" parameter="to" />
        </sequence>

        <sequence>
          <command name="selectNode" 
            parameter="ancestorOrSelf[implicitElement] table figure example" />
          <!-- Assumes that first child is a title and not a blockinfo. -->
          <set variable="selectedNodes" context="$selected"
               expression="./*[position() &gt; 1]" />
          <command name="copy" />
          <command name="selectNode" parameter="parent" />
          <get context="$selected" 
               expression="concat('informal', local-name())" />
	  <command name="replace" parameter="%_" />
          <command name="selectNode" parameter="children" />
	  <command name="paste" parameter="to" />
        </sequence>
      </choice>
    </macro>
  </command>

  <menu label="_DocBook">
    <menu label="C_olumn">
      <item label="_Insert Before"
            icon="scons_icons/insertColumnBefore.png"
            command="docb.tableEdit" parameter="insertColumnBefore"/>
      <item label="I_nsert After"
            icon="scons_icons/insertColumnAfter.png"
            command="docb.tableEdit" parameter="insertColumnAfter"/>
      <separator />
      <item label="_Cut"
            icon="scons_icons/cut.png"
            command="docb.tableEdit" parameter="cutColumn"/>
      <item label="C_opy"
            icon="scons_icons/copy.png"
            command="docb.tableEdit" parameter="copyColumn"/>
      <item label="_Paste Before"
            icon="scons_icons/pasteBefore.png"
            command="docb.tableEdit" parameter="pasteColumnBefore"/>
      <item label="P_aste After"
            icon="scons_icons/pasteAfter.png"
            command="docb.tableEdit" parameter="pasteColumnAfter"/>
      <item label="_Delete"
            icon="scons_icons/deleteColumn.png"
            command="docb.tableEdit" parameter="deleteColumn"/>
    </menu>
    <menu label="_Row">
      <item label="_Insert Before"
            icon="scons_icons/insertRowBefore.png"
            command="docb.tableEdit" parameter="insertRowBefore"/>
      <item label="I_nsert After"
            icon="scons_icons/insertRowAfter.png"
            command="docb.tableEdit" parameter="insertRowAfter"/>
      <separator />
      <item label="_Cut"
            icon="scons_icons/cut.png"
            command="docb.tableEdit" parameter="cutRow"/>
      <item label="C_opy"
            icon="scons_icons/copy.png"
            command="docb.tableEdit" parameter="copyRow"/>
      <item label="_Paste Before"
            icon="scons_icons/pasteBefore.png"
            command="docb.tableEdit" parameter="pasteRowBefore"/>
      <item label="P_aste After"
            icon="scons_icons/pasteAfter.png"
            command="docb.tableEdit" parameter="pasteRowAfter"/>
      <item label="_Delete"
            icon="scons_icons/deleteRow.png"
            command="docb.tableEdit" parameter="deleteRow"/>
    </menu>
    <menu label="C_ell">
      <item label="_Increment Column Span"
            icon="scons_icons/incrementColumnSpan.png"
            command="docb.tableEdit" parameter="incrColumnSpan"/>
      <item label="_Decrement Column Span"
            icon="scons_icons/decrementColumnSpan.png"
            command="docb.tableEdit" parameter="decrColumnSpan"/>
      <separator />
      <item label="I_ncrement Row Span"
            icon="scons_icons/incrementRowSpan.png"
            command="docb.tableEdit" parameter="incrRowSpan"/>
      <item label="D_ecrement Row Span"
            icon="scons_icons/decrementRowSpan.png"
            command="docb.tableEdit" parameter="decrRowSpan"/>
    </menu>
    <separator />
    <item label="Convert in_formal&lt;element&gt; to/from &lt;element&gt;" 
          command="docb.toggleInformal"/>
    <separator />
    <item label="_Go to Opposite Link End"
          command="selectById" parameter="swapIdAndReference"/>
    <item label="Go to _Next Link"
          command="selectById" parameter="nextReference"/>
    <item label="Go to _Previous Link"
          command="selectById" parameter="previousReference"/>
    <separator />
    <item label="Move _Up"
          icon="scons_icons/up.png"
          command="moveElement" parameter="up" />
    <item label="Move Do_wn"
          icon="scons_icons/down.png"
          command="moveElement" parameter="down" />
  </menu>

  <!-- Toolbar ============================================================ -->

  <command name="docb.convertWithAttribute">
    <macro repeatable="true" undoable="true" label="Convert">
      <sequence>
        <choice>
	  <command name="selectNode" 
                   parameter="self[implicitElement] %0" />
	  <command name="convert" 
                   parameter="[implicitElement] %0" />
        </choice>
        <command name="putAttribute" parameter="%1 %2" />
      </sequence>
    </macro>
  </command>

  <!-- Easier to implement with "add" instead of "insertNode" but slower. -->

  <command name="docb.addListItem">
    <macro>
      <sequence>
	<command name="selectNode" 
           parameter="ancestor[implicitElement] itemizedlist orderedlist 
                      variablelist calloutlist procedure substeps
                      simplelist segmentedlist" />
        <command name="selectNode" parameter="child" />
        <command name="insertNode" parameter="sameElement%0" />
      </sequence>
    </macro>
  </command>

  <!-- This macro is required for DocBook where a para can contains
       lists, tables, etc.
       Note that this is not the case of para in Simplified DocBook. -->

  <command name="docb.addAfter">
    <macro>
      <choice>
        <sequence>
	  <command name="selectNode" 
                   parameter="ancestorOrSelf[implicitElement] para" />
          <command name="insert" parameter="after[implicitElement] %0" />
        </sequence>
        <command name="add" parameter="after[implicitElement] %0" />
      </choice>
    </macro>
  </command>

  <!-- Bindings =========================================================== -->

  <binding>
    <keyPressed code="F2" />
    <keyPressed code="UP" />
    <command name="moveElement" parameter="up" />
  </binding>

  <binding>
    <keyPressed code="F2" />
    <keyPressed code="DOWN" />
    <command name="moveElement" parameter="down" />
  </binding>

  <!-- Inside a para or simpara (and only inside a para or simpara), 
       XXE attempts to behave like a word-processor. -->

  <binding>
    <keyPressed code="ENTER" />
    <command name="docb.splitOrInsertNewLine" />
  </binding>

  <binding>
    <keyPressed code="DELETE" />
    <command name="docb.joinOrDeleteChar" />
  </binding>

  <binding>
    <keyPressed code="BACK_SPACE" />
    <command name="docb.joinOrDeleteChar" parameter="backwards" />
  </binding>

  <command name="docb.splitOrInsertNewLine">
    <macro>
      <choice>
        <command name="insertControlChar" parameter="\n" />

	<sequence>
          <command name="selectNode" 
	           parameter="ancestorOrSelf[implicitElement] simpara para" />
	  <command name="split" />
	</sequence>
      </choice>
    </macro>
  </command>

  <command name="docb.joinOrDeleteChar">
    <macro>
      <choice>
	<sequence>
          <test 
            expression="($dot/ancestor::para or $dot/ancestor::simpara) and 
                        not($selected) and not($mark)" />
          <command name="deleteSelectionOrJoinOrDeleteChar" parameter="%0" />
	</sequence>

        <command name="deleteSelectionOrDeleteChar" parameter="%0" />
      </choice>
    </macro>
  </command>

  <!-- Easy way to add paragraphs and list items -->

  <binding>
    <keyPressed code="ENTER" modifiers="mod" />
    <command name="docb.addSame" parameter="After" />
  </binding>

  <binding>
    <keyPressed code="ENTER" modifiers="mod shift" />
    <command name="docb.addSame" parameter="Before" />
  </binding>

  <command name="docb.addSame">
    <macro>
      <choice>
	<sequence>
          <command name="selectNode" 
	           parameter="ancestorOrSelf[implicitElement] simpara para" />

          <choice>
            <sequence>
              <match context="$selected" 
                     pattern="listitem/*[position() = 1]|
	                      callout/*[position() = 1]|
	                      step/*[position() = 1]" />
              <command name="docb.addListItem" parameter="%0" />
            </sequence>

	    <command name="insertNode" parameter="sameElement%0" />
          </choice>
	</sequence>

        <command name="docb.addListItem" parameter="%0" />
      </choice>
    </macro>
  </command>

  <!-- Note that Shift-Enter is not bound. -->

  <!-- An easy way to paste paragraphs copied from another application. -->

  <command name="docb.pasteAfterAsParagraphs">
    <macro>
      <sequence>
	<command name="makeParagraphs" parameter="%0" />
	<command name="paste" parameter="after[implicitElement] %_" />
      </sequence>
    </macro>
  </command>

  <binding>
    <keyPressed code="ESCAPE" />
    <charTyped char="w" />
    <command name="docb.pasteAfterAsParagraphs" parameter="para" />
  </binding>

  <!-- An easy way to specify the URL in ulink -->

  <binding>
    <appEvent name="drop" />
    <command name="docb.fileDrop" parameter="'%{value}'" />
  </binding>

  <command name="docb.fileDrop">
    <macro>
      <choice>
        <sequence>
          <match context="$clickedElement" pattern="ulink" />
          <set variable="selectedElement" expression="$clickedElement" />

          <set variable="dropped" context="$selectedElement" 
               expression="relativize-uri(uri-or-file-name('%0'))" />
          <get expression="$dropped" />
          <command name="putAttribute" parameter="url '%_'" />

          <get expression="$dropped" />
          <command name="status" parameter="url='%_'" />
        </sequence>

        <command name="XXE.open" parameter="%0" />
      </choice>
    </macro>
  </command>

  <!-- Element templates ================================================== -->

  <!-- Unlike graphic, mediaobject/imageobject is also supported by 
       simplified docbook. -->

  <elementTemplate name="image" selectable="override">
    <figure xmlns="">
      <title></title>
      <mediaobject cfg:template="image" />
    </figure>
  </elementTemplate>

  <elementTemplate name="screenshot">
    <figure xmlns="">
      <title></title>
      <screenshot cfg:template="simple" />
    </figure>
  </elementTemplate>

  <elementTemplate name="simple" selectable="override">
    <screenshot xmlns="">
      <screeninfo></screeninfo>
      <mediaobject cfg:template="image" />
    </screenshot>
  </elementTemplate>

  <!-- Replacement for automatically generated mediaobject
       (which contains a textobject) -->

  <elementTemplate name="image" selectable="override">
    <mediaobject xmlns="">
      <imageobject><imagedata cfg:template="simple" /></imageobject>
    </mediaobject>
  </elementTemplate>

  <elementTemplate name="image" selectable="override">
    <inlinemediaobject xmlns="">
      <imageobject><imagedata cfg:template="simple" /></imageobject>
    </inlinemediaobject>
  </elementTemplate>

  <!-- fileref is not a mandatory attribute of imagedata -->

  <elementTemplate name="simple" selectable="override">
    <imagedata xmlns="" fileref="???" />
  </elementTemplate>

  <!-- Replacement for automatically generated caption of a mediaobject
       (which is empty) -->

  <elementTemplate name="simple" selectable="override">
    <caption xmlns="">
      <para></para>
    </caption>
  </elementTemplate>

  <!-- Replacement for automatically generated table 
       (which contains a graphic) -->

  <elementTemplate name="simple" selectable="override">
    <table xmlns="">
      <title></title>
      <tgroup cols="2">
        <tbody>
          <row>
            <entry></entry><entry></entry>
          </row>
          <row>
            <entry></entry><entry></entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </elementTemplate>

<!--
  <elementTemplate name="withPara" selectable="override">
    <entry xmlns=""><para></para></entry>
  </elementTemplate>

  <elementTemplate name="withPara" selectable="override">
    <entrytbl xmlns="" cols="2">
      <tbody>
	<row>
	  <entry><para></para></entry><entry><para></para></entry>
	</row>
	<row>
	  <entry><para></para></entry><entry><para></para></entry>
	</row>
      </tbody>
    </entrytbl>
  </elementTemplate>
-->

  <elementTemplate name="head_row">
    <table xmlns="">
      <title></title>
      <tgroup cols="2">
        <thead>
          <row>
            <entry align="center"></entry><entry align="center"></entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry></entry><entry></entry>
          </row>
          <row>
            <entry></entry><entry></entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </elementTemplate>

  <elementTemplate name="head_column">
    <table xmlns="">
      <title></title>
      <tgroup cols="2">
        <colspec align="center"/>
        <tbody>
          <row>
            <entry></entry><entry></entry>
          </row>
          <row>
            <entry></entry><entry></entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </elementTemplate>

  <elementTemplate name="head_row_column">
    <table xmlns="">
      <title></title>
      <tgroup cols="2">
        <colspec align="center" />
        <thead>
          <row>
            <entry align="center"></entry><entry align="center"></entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry></entry><entry></entry>
          </row>
          <row>
            <entry></entry><entry></entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </elementTemplate>

  <!-- Replacement for automatically generated informaltable 
       (which contains a graphic) -->

  <elementTemplate name="simple" selectable="override">
    <informaltable xmlns="">
      <tgroup cols="2">
        <tbody>
          <row>
            <entry></entry><entry></entry>
          </row>
          <row>
            <entry></entry><entry></entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </elementTemplate>

  <elementTemplate name="head_row">
    <informaltable xmlns="">
      <tgroup cols="2">
        <thead>
          <row>
            <entry align="center"></entry><entry align="center"></entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry></entry><entry></entry>
          </row>
          <row>
            <entry></entry><entry></entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </elementTemplate>

  <elementTemplate name="head_column">
    <informaltable xmlns="">
      <tgroup cols="2">
        <colspec align="center"/>
        <tbody>
          <row>
            <entry></entry><entry></entry>
          </row>
          <row>
            <entry></entry><entry></entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </elementTemplate>

  <elementTemplate name="head_row_column">
    <informaltable xmlns="">
      <tgroup cols="2">
        <colspec align="center" />
        <thead>
          <row>
            <entry align="center"></entry><entry align="center"></entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry></entry><entry></entry>
          </row>
          <row>
            <entry></entry><entry></entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </elementTemplate>

  <elementTemplate name="1x2">
    <entrytbl xmlns="" cols="2">
      <tbody>
	<row>
	  <entry></entry><entry></entry>
	</row>
      </tbody>
    </entrytbl>
  </elementTemplate>

  <elementTemplate name="2x1">
    <entrytbl xmlns="" cols="1">
      <tbody>
	<row>
	  <entry></entry>
	</row>
	<row>
	  <entry></entry>
	</row>
      </tbody>
    </entrytbl>
  </elementTemplate>

  <elementTemplate name="2x2">
    <entrytbl xmlns="" cols="2">
      <tbody>
	<row>
	  <entry></entry><entry></entry>
	</row>
	<row>
	  <entry></entry><entry></entry>
	</row>
      </tbody>
    </entrytbl>
  </elementTemplate>

  <!-- indexterm -->

  <elementTemplate name="singular" selectable="override">
    <indexterm xmlns=""><primary></primary></indexterm>
  </elementTemplate>

  <elementTemplate name="startofrange">
    <indexterm xmlns="" id="???"
               class="startofrange"><primary></primary></indexterm>
  </elementTemplate>

  <elementTemplate name="endofrange">
    <indexterm xmlns="" class="endofrange" startref="???" />
  </elementTemplate>

  <!-- DocBook 4.3, Simplified DocBook 1.1, etc, support
       both HTML and CALS tables. -->
  <include location="htmlTable.incl" />
</configuration>