summaryrefslogtreecommitdiff
path: root/README.Tcl
blob: 9a78bc7dc51b45e362d6b7de87b2c93ddb0af67f (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
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
Tcl command summary (ASCII text version)
-------------------------------------------------
This list can be found in HTML format at URL:
    http://opencircuitdesign.com/xcircuit/tcl.html
-------------------------------------------------

I. Built-in commands (C source)
--------------------------------
A. Elements:  Main command to create and manipulate objects.  "element" is
	partly a superset of the individual elements, when the command is
	given a <handle> value and the element type is unknown.  A <handle>
	is an integer pointer to the element's location in memory.  The
	notation <handle...> represents a list of handles to elements.
	<handle> can also be the keyword "selected", in which case it
	implies all selected elements.  The <handle> is represented as a
	new Tcl type called "handle", and has an "H" followed by an 8-digit
	hexidecimal number.  This distinguishes it from integers and
	allows the command line to be parsed correctly.  It also discourages
	the practice of manipulating handles, as arithmetic cannot be
	performed directly on handle types.
	
	One option, "type", does not apply to individual elements.
	When no <handle> is supplied, the option operates on all currently
	selected elements in the drawing.  If no <handle> is supplied and
	no elements are currently selected, then the program goes into an
	interactive mode, prompting for an element to select and apply the
	option to.  Option "deselect" behaves differently in that 

   1. element [<handle...>] type
	Returns the type of the element, which may be one of "label",
	"polygon", "instance", "spline", "path", or "arc".

   2. <element> [<handle...>] <option>
	Where <element> may be any of "element", "label", "polygon",
	"instance", "spline", "path", or "arc".
	Options are:

	<element> [<handle...>] deselect
	   deselect the indicated element(s).
	<element> [<handle...>] parameter <option...>
	   Option may be one of the following:
	   a) allowed
		List the parameter types which are allowed for the
		indicated element type.
	   b) make <type> [<key>]
		Generate a parameter of the indicated type for
		the indicated element.  <type> may be one of:
		"position", "substring", "x position", "y position",
		"style", "justification", "start angle", "end angle",
		"radius", "minor axis", "rotation", "scale", "linewidth",
		or "color".  Items with more than one word must be
		quoted.  The initial value given to the parameter is
		the default.  <key> is a unique name given to the
		parameter.  It is necessary for substring parameters but
		may be omitted for other parameter types.
	   c) set <key> <value> [-forward]
		Change the value of the parameter with key <key>.  This
		assumes that the parameter exists;  if not, option "make"
		must be used.
	   c) get [<type|key>] [-forward]
		List the parameters of the indicated element(s).  If
		<type> is given, get the instance value of the parameter(s)
		of type <type>.   If <key> is given, then get the instance
		value of the parameter with key <key>.  If the parameter
		takes the default value, a null list is returned.  If the
		parameter type does not exist for the element, an error is
		generated.
	   e) default <type|key> [-forward]
		Get the default value of the indicated parameter, if <key>
		specified, or all parameters of the indicated type, if
		<type> is specified.
	   f) forget <type|key> [-forward]
		Delete the indicated parameter, if <key> is specified, or
		delete all parameters of the indicated type, if <type> is
		specified.  The parameter is removed entirely from the
		object.

	   Note that several commands take the optional argument "-forward".
	   The "-forward" argument applied only to selected object
	   instances, and indicates a forward-referenced parameter, that is,
	   a parameter belonging to the object of the selected instance,
	   and not the top-level object.
	<element> [<handle...>] delete
	   Deletes the indicated element(s).
	<element> [<handle...>] copy [relative] <position>
	   Makes a copy of the indicated element(s).  <position> is a list of
	   2 elements representing absolute X and Y positions, unless the
	   keyword "relative" is present, in which case they represent positions
	   relative to the current element position.  If more than one element
	   is specified, the position *must* be indicated as relative.
	<element> [<handle...>] move [relative] <position>
	   Moves the indicated element(s).  <position> is a list of
	   2 elements representing absolute X and Y positions, unless the
	   keyword "relative" is present, in which case they represent positions
	   relative to the current element position.  If more than one element
	   is specified, the position *must* be indicated as relative.
	<element> [<handle...>] flip horizontal|vertical [<position>]
	   Flips the indicated element(s) around the horizontal or vertical axis.
	   If <position> is specified, then element or element group will be
	   flipped around the indicated point.  <position> may be a single
	   number, representing an X value for horizontal flips and a Y value
	   for vertical flips.
	<element> [<handle...>] rotate <angle> [<position>]
	   Rotates the indicated element(s) by the specified angle (in degrees).
	   Positive angles are clockwise, negative angles are counterclockwise.
	   If <position> is specified, then element or element group will be
	   rotated around the indicated point.
	<element> [<handle...>] edit
	   Puts the specified element(s) into interactive edit mode.
	<element> [<handle...>] select
	   Selects the specified element(s).
	<element> [<handle...>] snap [<direction>]
	   Snaps the indicated elements onto the snap grid.  If <direction> is
	   specified (n, s, e, w, ne, nw, se, or sw), elements will be snapped
	   in that direction.  Otherwise, elements will be snapped to the
	   closest point.
	<element> [<handle...>] raise [<number>]
	   Raise the position of the indicated element(s) toward the drawing
	   front (end of list; last to be drawn).  If <number> is specified,
	   it is raised in front of the next <number> elements in the list.
	   If no <number> is specified, it is raised to the front of the drawing.
	<element> [<handle...>] lower [<number>]
	   Lower the position of the indicated element(s) toward the drawing
	   back (beginning of list; first to be drawn).  If <number> is specified,
	   it is lowered behind the next <number> elements in the list.  If no
	   <number> is specified, it is lowered to the back of the drawing.
	<element> [<handle1> [<handle2>]] exchange
	   Exchanges the positions of the two elements in the list.  If no
	   handles are specified, then exactly one or two objects must be
	   previously selected.  If only one handle is specified or only
	   one object previously selected, the behavior is to raise it to the
	   front of the drawing, unless it is already at the front of the
	   drawing, in which case it is moved to the back.
	<element> [<handle...>] color [<idx>]
	   Sets the color of the specified element(s) to value <idx>, an index
	   into xcircuit's color table.  With no arguments, returns the color
	   of the indicated element.

   3. <path_element> [<handle...>] <option>
	Where <path_element> may be any of  "polygon", "spline", "arc", or "path".
	Options are:
	<path_element> [<handle...>] border [<value>]
	    Set the border linewidth scaling to floating-point value <value>,
	    or return the current scale if <value> is not given.
	<path_element> [<handle...>] border [<type>]
	    Set the border style of the indicated element(s) to <type>, or return
	    the type (or list of types) if <type> is not given. <type> may be one
	    of "solid", "dashed", "dotted", or "closed"
	<path_element> [<handle...>] fill [<type>]
	    Set the fill style of the indicated element(s) to <type>, or return
	    the type (or list of types) if <type> is not given.  <type> may be
	    a fill percentage (representing a stipple pattern) or the keyword
	    "opaque".

   4. <segmented_element> [<handle...>] point <option>
	Where <segmented_element> may be any of "polygon", "spline", or "path".
	Options are:
	<segmented_element> [<handle...>] point [<number>] insert [after|before]
		[relative] [<position>]
	   Insert a new point before or after point <number> or the current
	   point if editing interactively.  If non-interactive, the point must
	   be given a position as a list of size 2, which is either an absolute
	   position, or a relative position if the keyword "relative" is given.
	<segmented_element> [<handle...>] point [<number>] delete [<number>]
	   Delete point <number>, or the current point if editing interactively.
	<segmented_element> [<handle...>] point [<number>] parameter
	   Parameterize the position of point <number>, or the current point
	   if editing interactively.
	<segmented_element> [<handle...>] point [<number>] break
	   Break the element at point <number>, or at the current point if
	   editing interactively.  Returns a handle to the new element
	   generated by the break.
	<segmented_element> [<handle...>] point [<number>] next
	   Return the point following point <number>, if specified, or move
	   to the next point if editing interactively.
	<segmented_element> [<handle...>] point [<number>] snap [<direction>]
	   Snap the indicated point <number> to the snap-to grid.  Snapping
	   is in the indicated direction, if supplied, or the closest point,
	   if not.  <direction> may be one of "n", "s", "e", "w", "ne", "nw",
	   "se", or "sw".

   4. instance [<handle...>] <option>
	instance make <object_name> [<position>]
	instance [<handle>] push
	   Edit the indicated instance by "pushing" down in the hierarchy.
	   Exactly one handle must be specified or one object instance
	   selected prior to executing the command.  This command operates
	   like "object push" except that if any values in the object are
	   parameterized, the instance values will be changed, not the default
	   values.
	instance [<handle...>] scale [<value>]
	   Change the scale of the indicated instance to <value>.  If no value
	   is specified, return the current scale of the instance.
   5. label [<handle...>] <option>
	label make
	   Interactively create a new label element.
	label make [pin|global|info] <string_list> <position>
	   Create a new label element with the text specified by <string_list>
	   and origin at <position>.  Optional keywords "pin", "global", or
	   "info" make the label a schematic pin type.  <string_list> is a
	   list of string parts or a single string.  String parts 
	label [<handle...>] append <string_list>
	   Add <string_list> to the end of the indicated label.
	label [<handle...>] insert <position> <string_list>
	   Insert <string_list> into the indicated label at the indicated position.
	label [<handle...>] delete <start> <end>
	   Delete a substring of the indicated label beginning at position <start>
	   and ending before position <end>.
	label [<handle...>] get <start> <end>
	   Return the substring (list) between beginning at position <start> and
	   ending before position <end>
	label [<handle...>] scale [<value>]
	   Change the scale of the indicated label.  Return the scale if <value>
	   is not specified.
	label [<handle...>] justify [<hjust>] [<vjust>]
	   Change the justification of the indicated label, where <hjust> may be
	   one of "left", "center", "right", and <vjust> may be one of "top",
	   "middle", or "bottom".  If neither <hjust> nor <vjust> is specified,
	   command returns a list of size 2 containing the horizontal and
	   vertical justifications.
	label [<handle...>] flipinvariant [true|false]
	   Set the flip-invariance of the indicated label.  If no value is
	   supplied, return the state of the flip-invariance on the label.
	label [<handle...>] style [<font_style>]
	   Set the label style to <font_style>, which may be one of "normal",
	   "bold", "italic", or "bolditalic".  If no style is specified,
	   return the current font style.
	label [<handle...>] family [<font_family>]
	   Set the label font family to <font_family>.  If no font family
	   is specified, return the current font family.
	label [<handle...>] encoding [<font_encoding>]
	   Set the label encoding to <font_encoding>, which may be one of
	   "standard", "special", or "ISO-Latin1" through "ISO-Latin6".
	   If no font encoding is specified, return the current font encoding.
   6. polygon [<handle...>] <option>
	polygon make [box]
	   Interactively create a new polygon element.  A rectangle is
	   created if "box" is specified.  Otherwise, the polygon is
	   generated point by point, in wire-drawing mode.
	polygon make <N> <position1> <position2> ... <positionN>
	   Create a new polygon element with <N> points.  Each <position>
	   is a list of size 2 with X, Y coordinates.
	polygon make box <position1> <position2> <position3> <position4>
	   Create a new polygon element with 4 points and with border style
	   "closed".  Each <position> is a list of size 2 with X, Y
	   coordinates.
   7. spline [<handle...>] <option>
	spline make
	   Interactively create a new spline element.
	spline make [<position1> <position2> <position3> <position4>]
	   Create a new spline object with endpoints <position1> and
	   <position4> and control points <position2> and <position3>.
   8. arc [<handle...>] <option>
	arc make
	   Interactively create a new arc element.
	arc make [<position> <radius> [<minor>] [<angle1> <angle2>]]
	   Create a new arc element with the indicated values.
	   By default, <minor> is set to the value of <radius>, <angle1>
	   is zero, and <angle2> is 360.  Angle values are in degrees.
	arc [<handle...>] radius|minor [<value>]
	   Specify the major or minor axis radius for the indicated arc.
	arc [<handle...>] angle start|end [<value>]
	   Specify the start and end angles for the indicated arc.
   9. path [<handle...>] <option>
	path make [<handles...>]
	   Generate a path element from the indicated components.
  10. object [<handle...>|<name...>] <option>
	object make [<handle...>] [<library>] [<name>]
	   Creates a new object out of the elements specified by <handle...>,
	   or from the selected elements if <handle...> is not specified.
	   The new object is placed into library <library>, or the User
	   Library, if not specified.  The object is given the name <name>,
	   if specified; otherwise the user is prompted for a name
	object [<handle|name>] push
	   Edit the indicated object.  This is like an instance edit except
	   that it is the library object itself, with default values for
	   parameters, that is edited.  If the object takes no parameters,
	   then there is no difference between editing an object and editing
	   any of its instances.
	object [<handle|name>] center [<position>]
	   Set the object's origin to <position> (a list of X, Y values).
	   If <position> is not specified, then return the coordinates of
	   the center of the object's bounding box.
	object [<handle|name>] copy [<library>] [<name>]
	   A copy of the object is made and placed in the named <library>, or
	   in the User Library if not specified.  The new copy is given the
	   name <name>, or the original name prepended with an underscore if
	   the name is not specified.  If the originating and destination
	   libraries are the same, the copy will be a "virtual" copy.
	object [<handle>] move [<library>]
	   Move the object to the indicated library, or the User Library if
	   <library> is not specified.
	object [<handle>] hide
	   Hide the object from view in its library, unless hiding the object
	   would render the object unaccessible.

B. Pages
   1. page
	Returns the current page
   2. page directory
	Go to the page directory listing (interactive command)
   3. page [<number>|<name>]
	Same as " page [<number>|<name>] goto" (see below)
   4. page make [<name>]
	Make a new page, giving it the optional name <name> if supplied,
	or "Page X" where X is the page number.  Generate a new menu button
	entry for the indicated page.  Go to the indicated page.
   4. page [<number>|<name>] <option>
	Where the page may be specfied either by page number or by page
	name (page label).  If neither number or name is supplied, then
	the current page is assumed.  Options are:

      load <filename...>
	Load the xcircuit file named <filename> into the indicated page.
      import <filename...>
	Import the xcircuit file named <filename> into the indicated page.
      background <filename>
	Read the PostScript file named <filename> into the indicated page
	as a background image.
      save [<filename>]
	Save the indicated page as <filename>.  Normally, <filename> is
	not specified and the filename given to the page by the "filename"
	command is used.
      goto
	Go to the page directory listing (interactive command)
      reset
	Resets (clears) the indicated page, or the current page if no
	arguements are given.
      links
	Returns the page labels of all pages which have the same filename
	as the current or indicated page.
      fit [true|false]
	If "true" or "false" is given, sets or clears the auto-fit
	function for the current page.  If no value is given, then
	it rescales the drawing to fit the output page.  Only valid
	in "full page" mode.
      filename [<name>]
	Sets the filename of the current page to <name>.  With no argument,
	returns the filename of the current page.
      label [<name>]
	Sets the name (page label) of the current page to <name>.  With no
	argument, returns the page label of the current page.
      scale [<value>]
	Sets the scale of the current page to <value>.  With no argument,
	returns the scale of the current page.
      width [<value>]
	Sets the scale of the current page such that the width is <value>.
	With no argument, returns the width of the object in the current
	page.
      height [<value>]
	Sets the scale of the current page such that the height is <value>
	With no argument, returns the height of the object in the current
	page.
      size [<dimension>]
	Sets the size of the output page for full-page mode to the given
	dimension, which can be a list of size 2 containing the page
	width and height, or a string in the format "width x height".
	With no argument, returns the size of the current page as a
	string in the format "width x height".

C. Libraries
   1. library
	Returns the current library, or "none" if none is being viewed.
   2. library directory
	Go to the library directory (interactive command).
   3. library make [<name>]
	Make a new library, giving it the optional name <name> if supplied,
	or "Library: X" where X is the library number.  Generate a new
	menu button entry for the indicated library.
   4. library [<number>|<name>] <option>
	Where the library is specified by number or by name.  If no
	library is specified, then the current library is assumed if
	a library page is currently in the xcircuit drawing window,
	or the User Library is assumed if not.  Options are:
      load <filename>
	Load the library from file <filename> into the indicated library.
      save <filename>
	Save the indicated library to the file <filename>.
      goto
	Go to the indicated library (interactive command).
   5. library <filename> [<number>]
	Backward compatibility;  same as "library [<number>] load <filename>"

D. Actions:  Actions are described under the "element" command.  These
   commands are exactly like the "element" subcommands except that the
   arguments are rearranged:  "element [<handle...>] <command> <options...>"
   becomes "<command> [<handle...>] <options...>".  In addition, these
   commands can take a position list <position> (list of size 2 containing X
   and Y values) in place of the handle, in which case the command attempts
   to select an element at the indicated position and apply the command to
   that element.

   1. delete [<handle...>|here] <options>
   2. undelete [<handle...>|here] <options>
   3. select [<handle...>|here|get] <options>
	The additional subcommand "get" returns a handle or list of handles
	of all currently selected elements.
   4. deselect [<handle...>|here] <options>
   5. copy [<handle...>|here] <options>
   6. edit [<handle...>|here] <options>
   7. parameter [<handle...>|here] <options>
   8. push [<handle...>|here] <options>
   9. pop [<handle...>|here] <options>
  10. rotate [<handle...>|here] <options>
  11. flip [<handle...>|here] <options>

E. Options
   1. config <option> [value...]
	Main option setting.  Options are:
	config axis|axes [on|off]
		Turn axis drawing on or off.  If no argument supplied,
		toggle the state of axis drawing.
	config grid [on|off]
		Turn grid drawing on or off.  If no argument supplied,
		toggle the state of grid drawing.
	config grid spacing <value>
		Set the grid spacing to <value>.  <value> is a number
		representing distance in the current coordinate system.
		Currently, coordinate system specifiers like "in" and "cm"
		may be included but are ignored.
	config snap [on|off]
		Turn snap point drawing on or off.  If no argument supplied,
		toggle the state of snap point drawing.
	config snap spacing <value>
		Set the snap spacing to <value>.  <value> is a number
		representing distance in the current coordinate system.
		Currently, coordinate system specifiers like "in" and "cm"
		may be included but are ignored.
	config bbox [on|off]
		Turn bounding box drawing on or off.  If no argument supplied,
		toggle the state of bounding box drawing.
	config editinplace [on|off]
		Turn edit-in-place on or off.  If no argument supplied,
		toggle the state of edit-in-place.  If "on", when the
		drawing hierarchy is descended, the entire drawing is drawn
		from the top level, but everything above the current edit
		level is drawn in gray.
	config pinpositions [on|off]
		Turn pin position drawing on or off.  If no argument supplied,
		toggle the state of pin position drawing.  If "on", pin
		positions inside an object instance appear in levels of the
		drawing hierarchy outside of the object.
	config linewidth <value>
		Set global line scaling.  All linewidths in the drawing are
		determined relative to this overall scaling value (default
		1.0).
	config colorscheme normal|inverse
		Set the overall colorscheme.  "normal" is black-on-white.
		"inverse" is white-on-dark gray.
	config drawingscale <scale>
		Set the drawing scale.  <scale> is represented as
		<divisor>:<multiplier>.  Positions reported in the message
		bars are scaled by <multiplier>/<divisor> with respect to
		the scale of the actual output.
	config manhattan [on|off]
		Sets the style of polygon drawing.  When "on", lines can
		only be drawn vertical and horizontal.  If no argument is
		supplied, the current polygon drawing mode is toggled.
	config boxedit	manhattan|rhomboidx|rhomboidy|rhomboida|normal
		Sets the style of polygon editing.  "manhattan" forces
		lines to remain vertical or horizontal, but does not
		affect lines which are already diagonal.  "normal"
		places no restrictions on line position.  The "rhomboid"
		styles place manhattan restrictions on horizontal or vertical
		lines, but not both, and are of limited practicality.
	config coordstyle "decimal inches"|"fractional inches"|centimeters
		Sets the coordinate measurement system to metric or standard.
		"fractional inches" reports values in whole number fractions
		when possible.
   2. color [<option>]
	Where option is one of:
	a) set inherit|<idx>
		Sets color to the indicated color index (from xcircuit's
		color table).  "inherit" is the same as <idx>=-1, and
		represents a color which is inherited from the parent
		element in the drawing hierarchy.
	b) get
		Returns the color of the currently selected element,
		or the default color if nothing is selected.
	c) add <name>
		Adds a new color to the color index table (including
		adding an entry to the GUI color selection menu).
		Color may be specified by name (a la rgb.txt) or by
		"#RRGGBB" notation.
	
   3. fill [<option>|<fillfactor>]
	Given an integer between 0 and 100 inclusive, sets the fill style
	to the given fillfactor.  Values are rounded to the nearest known
	fillfactor value.  Know values are 0, 12, 25, 37, 50, 62, 75, 87,
	and 100.  Other options include "solid" (equivalent to "100"),
	"opaque", and "transparent".  With no arguments, returns a list
	of all the fill styles of the currently selected element, or the
	default fill style if nothing is selected.

   4. border [<option>]
	Sets the border style to the given option, which is one of "solid",
	"dashed", "dotted", "unbordered", "bounding box", "closed", and
	"unclosed".  The two-word "bounding box" must be quoted or in
	braces ({}).  "bounding box" takes an additional argument, "true"
	or "false".  With no option, returns a list of all border styles
	of the currently selected element, or the default border style
	if nothing is selected.

F. Netlists
   1. netlist <option>
	Perform various netlist functions.  Options are:
	a) write <format>
		Generate a netlist output file in one of the following
		formats:  "spice", "spiceflat", "sim", or "pcb".
	b) highlight
		Highlight connectivity of any selected network element
		(wire or pin), or start an interactive method for
		selecting a network to highlight.
	c) make
		Generates and returns a Tcl list element representing
		the netlist for the current circuit schematic.  The
		list is heavily nested.  The outermost list contains
		four elements:  The string "globals", a list of
		global networks, the string "circuit", and a list of
		circuit netlists.  These are further subdivided into
		hierarchical lists, a description of which is not
		contained here.
	d) autonumber
		Automatically substitues indices for unnumbered
		circuit components.
   2. schematic <option>
	Perform various netlist functions.  Options are:
	a) associate [<name>]
		Associate the schematic with the symbol named <name>.
		If <name> is not specified, xcircuit starts an interactive
		method for selecting a symbol for association.
	b) disassociate
		Disassociate any existing symbol from the schematic.
	c) make [<name>]
		Generate a new symbol associated with the current
		schematic.  The new symbol will be named after the
		page.  If the current page has not been named, then 
		option <name> must be provided.
	d) goto
		Change the current page to the associated symbol, if
		it exists
	e) get
		Return the name of the associated symbol, or {}
		(empty list) if no symbol is associated.
	f) type [<value>]
		Return the type of the current page, which may be one
		of "schematic", "symbol", "trivial", or "fundamental".
		If "value" is specified, change the current type to
		"value".  It is only possible to change types between
		"symbol", "trivial", and "fundamental", which are all
		symbol classes.  It is not possible to change symbols
		to schematics and vice versa.
   3. symbol
	"symbol" is simply an alias for "schematic".  Whether the command
	operates on a symbol or a schematic is determined purely from
	context.
	

G. GUI
   1. refresh
	Redraws the current window.
		Automatically substitues indices for unnumbered
		circuit components.
   2. zoom [in [<amount>]|out [<amount>]|box|view|factor [<amount>]]
	With no option, same as "zoom view".
	Options:
	   in [<amount>]:  Zoom in by current zoom factor or by [<amount>].
	   out [<amount>]:  Zoom out by current zoom factor or by [<amount>].
	   box: prompt for zoom box.  Zoom occurs as soon as box is drawn and
		the mouse button is released.
	   view:  Fits the drawing to the xcircuit window.
	   factor:  Returns the current zoom factor.
	   factor <amount>:  Sets the current zoom factor to <amount>.
	<amount> is a floating-point number representing a scale multiplier.
	Values greater than 1.0 imply a zoom "in", while values less than one
	imply a zoom "out".  Zero or negative values not allowed.
   3. pan [here|<position>]
	Center the drawing window on the indicated position.  If "here",
	position is centered on the cursor.  Otherwise, <position> is a
	list of size 2 with X and Y values.
   4. quit
	Quit xcircuit, with a prompt if any files with outstanding changes
	have not been saved.
   5. promptsavepage [<page_number>]
	Start the page output dialog.  Currently, <page_number>, if present,
	must be the current page number.
   6. here
	Returns a list size two with the X and Y position of the cursor
	relative to the XCircuit coordinate system.

H. Files
   1. loadfont <fontname>
	Loads an xcircuit font.  Expects to see file <fontname>.xfe (Xcircuit
	Font Encoding) in the default system library path.
	
   2. filerecover
	Recovers files from a crash or Ctrl-C exit that are left in the /tmp
	directory.

I. General
   1. quitnocheck
	Immediate exit from xcircuit
   2. start <args>
	XCircuit startup.  Usually called internally from the wrapper
	script.  However, for purposes of debugging problems, it can
	be called manually from the Tcl command after loading the
	shared object file "xcircuit.so".
   3. simple <pathname>
	This is a Tk extension which generates a "simple" window, a blank
	area into which a C-source application is supposed to draw.
   4. image create xpm <name> -file <filename.xpm>
	This is an extension to the Tk "image" command which allows images
	to be generated from "xpm"-format files.  Since xpm files contain
	all color and size information, the options are fixed (although it
	might be nice to add things like color substitutions).
   5. tag <name> [<procedure>]
	Attach a procedure to a command, such that the procedure is
	executed after every call to the command "name".  The procedure
	may name a Tcl procedure or it may be entirely inline.
	"procedure" may make use of several escape sequence substitutions,
	as follows:
		%0 through %5:  Substitute the argument passed to <name>.
		%r:  Substitute the Tcl result from <name>.  The result
		     is transparent; any result produced by the tag
		     procedure will be ignored and the calling function
		     will get back the original result (%r).
		%R:  Substitute the Tcl result from <name>.  The result
		     is absorbed, and the tag function generates a new 
		     result which is passed back to the calling function.
		%%:  Substitute a single percent character.
	All other uses of the percent character within the tag procedure
	will be evaluated as-is.
	With only one argument, <name>, the "tag" command will return
	the procedure currently attached to that command.
	Tagging a procedure to a command which is already tagged will
	cause the new tag procedure to overwrite the old one.
	Any tag procedure which calls the function to which it is tagged
	should wrap the entire procedure inside
	   if {[info level] <= 1} {...}
	to prevent infinite recursion.

	
II. Scripted commands (Tcl source)
----------------------------------

A. Namespace (Toolscript)
   1. pushnamespace <namespace>
	Makes all commands in <namespace> available in the current namespace.
	Conflicting commands names are not pushed.
   2. popnamespace <namespace>
	Revert command names back to original set.

B. Dialogs 
   1. promptobjectsize
	Dialog to ask for object size
   2. promptborderwidth
	Dialog to ask for element border width
   3. promptlinewidth
	Dialog to ask for overall linewidth scaling
   4. promptgridspace
	Dialog to ask for grid spacing
   5. promptdrawingscale
	Dialog to ask for drawing scale
   6. promptsnapspace
	Dialog to ask for snap spacing
   7. promptmakeobject
	Dialog to ask for object name before making new library entry
   8. promptsavelib <library_number>|<library_name>
	Dialog to ask for filename of library to save.
   9. promptloadlibrary
	Dialog to ask for filename of library to load
  10. promptaddlibrary
	Dialog to ask for filename of library to add to current library page
  11. promptloadfile
	Dialog to ask for filename of xcircuit file to load
  12. promptimportfile
	Dialog to ask for filename of xcircuit file to add to current page
  13. promptimportbackground
	Dialog to ask for filename of PostScript file to use as background
  14. promptexecscript
	Dialog to ask for filename of Tcl file to execute
  15. prompttextsize
	Dialog to ask for label scaling
  16. promptnewfont
	Dialog to ask for name of font to load
  17. promptkern
	Dialog to ask for X Y kerning values inside a label
  18. promptmakesymbol
	Dialog to ask for a name for a page, if the page has not yet been
	named, before generating a matching symbol of the same name.

C. Menu manipulation:  These functions should only be called from inside
	xcircuit, as they change only the menu appearance and callbacks
	and not xcircuit's internal data structures.

   1. newcolorbutton <r> <g> <b> <idx>
	Adds a new button to the color menu
	<r> <g> and <b> are color components, and <idx> is the position in
	xcircuit's color table.
   2. newencodingbutton <encodingname>
	Adds a new button to the font encoding menu.  Valid encoding names
	are "special", "standard", and "ISO-Latin1" through "ISO-Latin6".
   3. newfontbutton <familyname>
	Adds a new button to the font family menu.
   4. newlibrarybutton <libraryname>
	Adds a new button to the library menu with a callback to switch to
	the indicated library.
   5. newpagebutton <pagename>
	Adds a new button to the page menu with a callback to switch to the
	indicated page.
   6. renamelib <number> <libraryname>
	Changes the name and callback function of the indicated library menu button.
	<number> is the index position of the button in the library menu.
   7. renamepage <number> <pagename>
	Changes the name and callback function of the indicated page menu button
	<number> is the index position of the button in the page menu.
   8. xschema true|false
	Turns the netlisting functions on or off.
   9. toolbar true|false
	Turns the toolbar functions on or off.

D. Command tag callbacks:  These functions are attached to specific xcircuit
	commands using the "tag" command, and execute after the tagged
	command has executed.  This keeps the GUI synchronized with commands
	called from the command-line.

   1. pageupdate [subcommand]
	Updates the file output window to match the current page status.
   2. setsymschem
	Updates the schematic and symbol buttons, and the netlist menu
	options, to match the current page.