1 This is geda-scheme.info, produced by makeinfo version 6.7 from
4 This manual is for gEDA/gaf, version 1.10.2.
6 Copyright © 2011-2013 Peter TB Brett
8 The text of and illustrations in this document are licensed under a
9 Creative Commons Attribution–Share Alike 3.0 Unported license
10 ("CC-BY-SA"). An explanation of CC-BY-SA is available at
11 <http://creativecommons.org/licenses/by-sa/3.0/>. The original authors
12 of this document designate the gEDA Project as the "Attribution Party"
13 for purposes of CC-BY-SA. In accordance with CC-BY-SA, if you distribute
14 this document or an adaptation of it, you must provide the URL for the
16 INFO-DIR-SECTION The Algorithmic Language Scheme
18 * gEDA Scheme: (geda-scheme). gEDA extensibility with Guile Scheme.
22 File: geda-scheme.info, Node: Top, Next: Introduction, Up: (dir)
24 gEDA Scheme Reference Manual
25 ****************************
27 This manual is for gEDA/gaf, version 1.10.2.
29 Copyright © 2011-2013 Peter TB Brett
31 The text of and illustrations in this document are licensed under a
32 Creative Commons Attribution–Share Alike 3.0 Unported license
33 ("CC-BY-SA"). An explanation of CC-BY-SA is available at
34 <http://creativecommons.org/licenses/by-sa/3.0/>. The original authors
35 of this document designate the gEDA Project as the "Attribution Party"
36 for purposes of CC-BY-SA. In accordance with CC-BY-SA, if you distribute
37 this document or an adaptation of it, you must provide the URL for the
44 * Schematic Document Model::
45 * Core API Reference::
46 * gschem API Reference::
53 File: geda-scheme.info, Node: Introduction, Next: Schematic Document Model, Prev: Top, Up: Top
61 “gEDA”, or _GPL Electronic Design Automation_, is a suite of free
62 software tools for designing electronics. The gEDA project has produced
63 and continues working on a full GPL’d suite and toolkit of Electronic
64 Design Automation (EDA) tools. These tools are used for electrical
65 circuit design, schematic capture, simulation, prototyping, and
66 production. Currently, the gEDA project offers a mature suite of free
67 software applications for electronics design, including schematic
68 capture, attribute management, bill of materials (BOM) generation,
69 netlisting into over 20 netlist formats, analog and digital simulation,
70 and printed circuit board (PCB) layout.
72 The gEDA project was started because of the lack of free EDA tools
73 for POSIX systems with the primary purpose of advancing the state of
74 free hardware or open source hardware. The suite is mainly being
75 developed on the GNU/Linux platform with some development effort going
76 into making sure the tools run on other platforms as well.
78 About the gEDA Scheme API
79 =========================
81 The “gEDA Scheme API”, documented in this manual, is a set of Scheme
82 functions which can be used to enhance gEDA applications by adding new
83 functionality or modify existing behaviour.
85 gEDA has always used a Scheme interpreter for interpreting
86 configuration files, managing keybindings in gschem, and implementing
87 netlist exporter backends in gnetlist. However, for a long time the
88 utility of embedding a Scheme interpreter was diminished by the lack of
89 a low-level API for inspecting and modifying schematic documents. The
90 Scheme types and functions documented here were added to gEDA to address
93 gEDA uses the _Guile_ Scheme implementation (otherwise known as the
94 _GNU Ubiquitous Intelligent Language for Extensions_) as its embedded
95 Scheme. For more information about Guile, please visit
96 <http://www.gnu.org/s/guile/>.
98 Getting Additional Help
99 =======================
101 If you think you have found a bug, please file a bug report in
102 Launchpad: <http://bugs.launchpad.net/geda>. Please add the tag
103 ‘scheme-api’. It will help us to fix your bug quickly if you can
104 describe in detail how to reproduce the bug.
106 If you have a question about using gEDA, or about extending gEDA
107 using Scheme, you may wish to send a message to one of the gEDA mailing
108 lists. You may also find additional information in the gEDA wiki.
110 Both the mailing lists and wiki can be accessed from the main gEDA
111 website: <http://www.geda-project.org/>.
116 If you find a typographical error in this manual, or if you have thought
117 of a way to make this manual better, we would love to hear from you!
118 Please submit a report in Launchpad: <http://bugs.launchpad.net/geda>,
119 with the tag ‘scheme-api’.
122 File: geda-scheme.info, Node: Schematic Document Model, Next: Core API Reference, Prev: Introduction, Up: Top
124 1 The Schematic Document Model
125 ******************************
127 When using gEDA to design an electronic circuit, users use the schematic
128 editor, gschem, to choose and place _schematic symbols_ on a _schematic
129 page_, and connect the _pins_ of the symbols together by drawing _nets_.
130 The user may add various _attributes_ to symbols, nets or pins to modify
131 how the circuit diagrams should be interpreted. The resulting
132 schematics are then processed with the gnetlist tool to generate a
135 This chapter describes the different data types used by the Scheme
136 API to represent gEDA documents (both schematics and symbols), and how
137 they relate to each other.
143 * Component objects::
145 * Coordinate system::
148 File: geda-scheme.info, Node: Pages, Next: Objects, Up: Schematic Document Model
153 Schematics and symbols are presented as different types of document to
154 the user, with different file extensions, icons and mime-types.
155 However, when they are loaded into a gEDA application such as gschem for
156 editing, they are internally represented in exactly the same way, by the
157 ‘page’ type. The ‘page’ is the top-level gEDA document data type.
159 Internally, the main difference between a ‘page’ for a schematic and
160 a ‘page’ for a symbol is the types of schematic element they are
161 permitted to contain (*note Objects::). For example, a symbol is not
162 permitted to contain nets, buses, or instances of other symbols, and a
163 schematic is not permitted to contain pins.
165 *Note*: Although the restrictions on what types of primitive element
166 schematics and symbols may contain are not enforced by the API, designs
167 which violate these restrictions may cause the netlister not to work as
170 Each ‘page’ is associated with a filename, although the filename is
171 not required by the API either to be valid or to be associated with a
172 accessible file in the filesystem.
174 Pages are not garbage-collected; once you create a ‘page’, you are
175 responsible for making sure that it is disposed of when it is no longer
179 File: geda-scheme.info, Node: Objects, Next: Component objects, Prev: Pages, Up: Schematic Document Model
184 Each ‘page’ contains some number of “schematic elements”, represented by
185 the ‘object’ type. There are several sub-types of ‘object’, including:
187 • graphical lines, circles, arcs, rectangles and paths;
191 • buses and bus pins;
197 • and symbol instances, known as ’components’.
199 Each ‘object’ can be part of at most a single ‘page’ – they cannot be
200 shared between pages. ‘object’s are automatically garbage collected.
202 Most of different ‘object’ sub-types are quite straightforward to
203 understand. The main exceptions are components, and the text
204 ‘object’-based attribute mechanism, which are described in the following
208 File: geda-scheme.info, Node: Component objects, Next: Attributes, Prev: Objects, Up: Schematic Document Model
210 1.3 Component objects
211 =====================
213 When a symbol is instantiated in a schematic (e.g. by the user
214 selecting it from the gschem component library and placing it on the
215 page), a compound ‘object’ known as a “component” is created.
217 Like a ‘page’, a component contains some number of ‘object’ elements.
218 When a component is created from a symbol, the contents of the symbol’s
219 ‘page’ are copied into the component.
221 In order to allow the component to appear in the correct place on the
222 schematic page, at the correct orientation, etc., a transformation is
223 applied to every ‘object’ in the component.
225 Normally, when the schematic ‘page’ is closed, the parameters of the
226 transformation are stored in the schematic file along with the basename
227 of the original symbol, but the ‘object’ contents of the component are
228 discarded. When the schematic is subsequently re-opened, the original
229 symbol is retrieved from the component library, and used to recreate the
232 However, a component may optionally be _embedded_. In this case, its
233 contents _are_ stored in the schematic file.
235 *Note*: A component cannot contain another component – only other
239 File: geda-scheme.info, Node: Attributes, Next: Coordinate system, Prev: Component objects, Up: Schematic Document Model
244 A gEDA user is able to annotate schematic elements with additional data,
245 such as footprints for components or net names for nets. This is
246 carried out using “attributes”.
248 An attribute is text ‘object’ which contains a text string in the
249 form ‘NAME=VALUE’. Currently, the restrictions on attribute format that
250 are enforced by the API are:
254 1. must contain at least one character;
255 2. must not contain a ‘=’ character (Unicode ‘U+003D’);
256 3. must not end with a space (‘ ’, Unicode ‘U+0020’).
260 1. must contain at least one character;
261 2. must not begin with a space (‘ ’, Unicode ‘U+0020’).
263 *Note*: Due to assumptions made by some gEDA tools, it is _strongly
264 recommended_ that you use attribute NAMEs which contain only lower-case
265 Latin characters, decimal digits, full stops ‘.’ (‘U+002E’), and hyphens
268 There are two types of attribute:
270 _Attached attributes_ are attribute text ‘object’s that are linked to
271 another ‘object’. To attach an attribute to another schematic element,
272 both ‘object’s must be part of the same component or part of the same
273 ‘object’. For example, a ‘netname=NAME’ attribute attached to a net
274 ‘object’ can be used to give that net a specific name in netlist output,
275 such as ‘VCC’ or ‘GND’.
277 _Floating attributes_ are attribute text ‘object’s that are not
278 linked to another ‘object’. These attributes affect the schematic or
279 symbol that they’re part of as a whole. For example, a floating
280 ‘documentation=URL’ attribute in a symbol tells gschem’s *Help →
281 Component Documentation* command how to find the component’s data sheet.
284 File: geda-scheme.info, Node: Coordinate system, Prev: Attributes, Up: Schematic Document Model
286 1.5 Coordinate system
287 =====================
289 gEDA documents use a “coordinate system” (internally referred to as
290 ‘world’ coordinates) with coordinates increasing upwards and to the
291 right (i.e. a conventional right-handed Cartesian coordinate system).
293 Although all coordinates may be positive or negative, gschem only
294 displays objects with positive coordinates (i.e. in the upper right
295 quadrant of the coordinate system). It is therefore recommended to use
296 only positive coordinates.
298 In the Scheme API, the coordinate of a point is expressed in the
303 and a set of “bounds” (i.e. a rectangular area in the document
304 plane) is expressed in the format:
306 ((left . top) . (right . bottom))
308 where ‘left’ is the smaller x coordinate, ‘right’ is the larger x
309 coordinate, and ‘bottom’ and ‘top’ are respectively the smaller and
310 larger y coordinates.
313 File: geda-scheme.info, Node: Core API Reference, Next: gschem API Reference, Prev: Schematic Document Model, Up: Top
318 The Scheme modules and functions described in this chapter are primitive
319 operations for working with schematics and symbols, and are available to
320 be used in all gEDA applications.
324 * Core page functions::
325 * Core object functions::
326 * Core attribute functions::
327 * Configuration functions::
328 * Logging functions::
329 * System information::
332 File: geda-scheme.info, Node: Core page functions, Next: Core object functions, Up: Core API Reference
334 2.1 Core page functions
335 =======================
337 To use the functions described in this section, you will need to load
338 the ‘(geda page)’ module.
342 -- Function: page? obj
343 Returns ‘#t’ if and only if OBJ is a ‘page’.
345 -- Function: active-pages
346 Returns a list of all open ‘page’s.
348 2.1.1 Page creation, disposal and filenames
349 -------------------------------------------
351 Every ‘page’ is associated with a _filename_. The filename does not
352 necessarily have to be a file which exists and/or is accessible in the
355 -- Function: make-page filename
356 Creates and returns a new, empty ‘page’, with the given string
359 -- Function: close-page! page
360 Destroys PAGE. The returned value is undefined.
362 *Warning*: This function closes and destroys PAGE immediately,
363 regardless of whether the page has been modified since loading or
364 saving, and without asking the user.
366 -- Function: page-filename page
367 Returns the filename associated with PAGE as a string, or ‘#f’ if
370 -- Function: set-page-filename! page filename
371 Sets the filename of PAGE to FILENAME. Returns PAGE.
373 2.1.2 Page serialisation
374 ------------------------
376 Pages can be converted to and from strings in the gEDA schematic file
379 -- Function: string->page filename string
380 Parses STRING, which should be in the gEDA file format, to create a
381 new ‘page’. The initial filename for the new ‘page’ is FILENAME.
383 If the string is not in gEDA format, raises an ‘string-format’
386 -- Function: page->string page
387 Returns a string representation of PAGE in the gEDA file format.
392 A schematic or symbol ‘page’ is composed of a set of ‘object’s which
393 determine both its graphical appearance and its electrical meaning.
395 -- Function: page-contents page
396 Returns a list of the ‘object’s which make up PAGE. The list can
397 be freely modified without changing the contents of PAGE.
399 -- Function: page-append! page objects...
400 Appends zero or more OBJECTS to the contents of PAGE in the order
403 If any of the OBJECTS is already part of a ‘page’ other than PAGE,
404 or is part of a component ‘object’, raises an ‘object-state’ error.
405 Any of the OBJECTS that are already in the PAGE are ignored.
407 -- Function: page-remove! page objects...
408 Removes zero or more OBJECTS from the contents of PAGE. Returns
411 Any OBJECTS that are not part of a ‘page’ or component ‘object’ are
414 An ‘object-state’ error will be thrown if any of the OBJECTS
415 satisfies any of the following conditions:
417 • part of a ‘page’ other than PAGE;
418 • part of component ‘object’;
419 • has attached attributes (*note Attributes::);
420 • is attached as an attribute.
422 -- Function: object-page object
423 Returns the ‘page’ which contains OBJECT (either directly or
424 indirectly), or ‘#f’ if OBJECT is not part of a ‘page’.
426 *Note*: If the OBJECT argument to ‘object-page’ is part of a
427 component ‘object’ which is itself part of a ‘page’, that ‘page’
430 2.1.4 Page dirty flags
431 ----------------------
433 A ‘page’ has a _dirty flag_ that is used to indicate to applications
434 that the ‘page’ has been modified since it was last loaded or saved.
436 -- Function: page-dirty? page
437 Returns ‘#t’ if the PAGE’s page has been marked as dirty;
438 otherwise, returns ‘#f’.
440 -- Function: set-page-dirty! page [state]
441 Sets the dirty flag for PAGE. If STATE is ‘#f’, clears the dirty
442 flag; otherwise, or if STATE is omitted, marks the page as dirty.
446 File: geda-scheme.info, Node: Core object functions, Next: Core attribute functions, Prev: Core page functions, Up: Core API Reference
448 2.2 Core object functions
449 =========================
451 To use the functions described in this section, you will need to load
452 the ‘(geda object)’ module.
456 * General object functions::
469 File: geda-scheme.info, Node: General object functions, Next: Lines, Up: Core object functions
471 2.2.1 General object functions
472 ------------------------------
474 -- Function: object? obj
475 Returns ‘#t’ if and only if OBJ is an ‘object’.
477 -- Function: copy-object object
478 Returns a deep copy of OBJECT. The new ‘object’ returned has no
479 attached attributes, and is not part of a ‘page’ or part of a
482 -- Function: object-component object
483 Returns the component ‘object’ that contains OBJECT, or ‘#f’ if
484 OBJECT is not part of a component.
486 -- Function: object-connections object
487 Returns a list of other ‘object’s that are _directly_ connected to
488 OBJECT. If ‘object’ is not included in a ‘page’, raises an
489 ‘object-state’ error. The connections reported are independent of
490 inclusion in components.
492 For example, consider a page containing a net and a component, and
493 the component contains a single pin. If the connectable end of the
494 pin intersects the net, then ‘(object-connections <net>)’ will
495 return a list containing the pin ‘object’, and _not_ the component.
500 * Object transformations::
503 * Object fill and stroke::
506 File: geda-scheme.info, Node: Object sub-types, Next: Object transformations, Up: General object functions
508 2.2.1.1 Object sub-types
509 ........................
511 Schematic element ‘object’s come in several subtypes.
513 -- Function: object-type object
514 Returns the sub-type of OBJECT as a symbol. The subtype will be
515 one of the following symbols:
521 • ‘complex’ (indicates a component ‘object’)
529 -- Function: object-type? object type
530 Returns ‘#t’ if and only if OBJECT is an ‘object’ and that its
531 subtype is TYPE, which should be a symbol.
534 File: geda-scheme.info, Node: Object transformations, Next: Object bounds, Prev: Object sub-types, Up: General object functions
536 2.2.1.2 Object transformations
537 ..............................
539 Objects can be translated, rotated, or mirrored about a point.
541 -- Function: translate-objects! vector [objects...]
542 Translate OBJECTS by VECTOR, a world coordinate distance in the
543 form ‘(x . y)’. Returns a list of the modified OBJECTS.
545 -- Function: rotate-objects! center angle [objects...]
546 Translate OBJECTS anti-clockwise by ANGLE about CENTER, a world
547 coordinate position in the form ‘(x . y)’. ANGLE must be an
548 integer multiple of 90 degrees. Returns a list of the modified
551 -- Function: mirror-objects! x-offset [objects...]
552 Mirror OBJECTS in the line ‘x = X-OFFSET’. Returns a list of the
556 File: geda-scheme.info, Node: Object bounds, Next: Object color, Prev: Object transformations, Up: General object functions
558 2.2.1.3 Object bounds
559 .....................
561 The bounds of an object is the smallest bounding rectangle of the
562 object, expressed in document coordinates (*note Coordinate system::).
564 -- Function: object-bounds objects...
565 Returns the world coordinate bounding box containing all of the
566 OBJECTS passed as arguments, or ‘#f’ if none of the OBJECTS have
567 bounds (for example, this can occur if no OBJECTS are specified, or
568 if they are all empty component ‘object’s).
570 *Note*: ‘object-bounds’ always returns the actual bounds of the
571 OBJECTS, not the visible bounds. This means that the bounds of
572 invisible text is always included.
574 -- Function: fold-bounds bounds...
575 Calculates the union of several sets of BOUNDS (as returned by
576 ‘object-bounds’). If any of the BOUNDS are ‘#f’, they are skipped;
577 if all of the BOUNDS are ‘#f’, ‘#f’ is returned.
580 File: geda-scheme.info, Node: Object color, Next: Object fill and stroke, Prev: Object bounds, Up: General object functions
585 Object colors in gEDA documents are specified as indices into a color
586 map. This allows users to specify the color map that suits them when
587 viewing schematics and symbols.
589 -- Function: object-color object
590 Returns the integer color map index of the color used to draw
593 -- Function: set-object-color! object color
594 Sets the integer color map index for OBJECT to COLOR. Returns
598 File: geda-scheme.info, Node: Object fill and stroke, Prev: Object color, Up: General object functions
600 2.2.1.5 Object fill and stroke
601 ..............................
603 Graphical object subtypes – lines, boxes, circles, arcs and paths – are
604 drawn with a stroke pattern that can be configured in detail.
606 -- Function: object-stroke object
607 Returns the stroke settings of the OBJECT, which must be a line,
608 box, circle, arc or path ‘object’. The return value is a list of
611 1. stroke width, as an integer number of world units
612 2. cap style, one of the symbols ‘none’, ‘square’ or ‘round’.
613 3. dash style, one of the symbols ‘solid’, ‘dotted’, ‘dashed’,
614 ‘center’ or ‘phantom’.
615 4. up to two dash parameters, depending on the dash style:
616 • for solid lines, no parameters;
617 • for dotted lines, dot spacing;
618 • for other styles, dot/dash spacing and dash length.
620 -- Function: set-object-stroke! object width cap dash [dash-space
622 Set the stroke settings of the OBJECT, which must be a line, box,
623 circle, arc or path ‘object’. The arguments are the same as the
624 contents of the list returned by ‘object-stroke’. Returns OBJECT.
626 -- Function: object-stroke-width object
627 Returns the integer stroke width of OBJECT, which must be a line,
628 box, circle, arc or path ‘object’.
630 -- Function: object-stroke-cap object
631 Returns the stroke cap style of OBJECT, which must be a line, box,
632 circle, arc or path ‘object’. The returned value is one of the
633 symbols ‘none’, ‘square’ or ‘round’.
635 -- Function: object-stroke-dash object
636 Returns the dash style of OBJECT, which must be a line, box,
637 circle, arc or path ‘object’. The return value is a list of
638 between one and three parameters:
640 1. dash style, one of the symbols ‘solid’, ‘dotted’, ‘dashed’,
641 ‘center’ or ‘phantom’.
642 2. for styles other than ‘solid’, dot/dash spacing;
643 3. for ‘dashed’, ‘center’ and ‘phantom’, dash length.
645 Some types of ‘object’ – boxes, circles and paths – can have their
646 interiors filled with a variety of patterns.
648 -- Function: object-fill object
649 Returns the fill settings of OBJECT, which must be a box, circle or
650 path ‘object’. The return value is a list of one to six
653 1. fill style, one of the symbols ‘hollow’, ‘solid’, ‘mesh’ or
655 2. up to five fill parameters, depending on fill style:
656 1. none for ‘hollow’ or ‘solid’ fills;
657 2. line width, line spacing and line angle (in degrees) for
659 3. line width, first spacing and angle, and second spacing
660 and angle for ‘mesh’ fills.
662 -- Function: set-object-fill! object fill-type . fill-args
663 Sets the fill settings of OBJECT, which must be a box, circle or
664 path ‘object’. The arguments are the same as the contents of the
665 list returned by ‘object-fill’. Returns OBJECT.
668 File: geda-scheme.info, Node: Lines, Next: Nets and buses, Prev: General object functions, Up: Core object functions
673 Line ‘object’s are straight graphical line segments with no electrical
674 meaning. A line’s geometrical parameters are a start point and end
675 point, and it supports different colors and stroke styles.
677 Many of the functions for manipulating lines are also used to
678 manipulate line-like objects such as nets, buses or pins.
680 -- Function: line? object
681 Returns ‘#t’ if and only if OBJECT is a line ‘object’.
683 -- Function: make-line start end [color]
684 Creates and returns a new line ‘object’. START is the position of
685 the start of the new line in the form ‘(x . y)’ and END is the
686 position of end of the line. If COLOR is specified, it should be
687 the integer color map index of the color with which to draw the
688 line. If COLOR is not specified, the default line color is used.
690 -- Function: set-line! line start end [color]
691 Sets the parameters of LINE (which may be a line, net, bus or pin
692 ‘object’). The arguments are the same as to ‘make-line’. Returns
695 -- Function: line-info line
696 Returns the parameters of LINE (which may be a line, net, bus or
697 pin ‘object’). The return value is a list in the form:
699 ((start-x . start-y) (end-x . end-y) color)
701 *Note*: For pin ‘object’s, first coordinate is the connectable
704 -- Function: line-start line
705 Returns the position ‘(x . y)’ of the start of LINE (which may be a
706 line, net, bus or pin ‘object’). For pin ‘objects’, this is the
707 position of the connectable point on the pin.
709 -- Function: line-end line
710 Returns the position ‘(x . y)’ of the end of LINE (which may be a
711 line, net, bus or pin ‘object’).
714 File: geda-scheme.info, Node: Nets and buses, Next: Pins, Prev: Lines, Up: Core object functions
719 Net and bus ‘object’s are straight line segments which represent
720 electrical connectivity. Nets represent single wires, and buses
721 multi-wire connections of arbitrary composition.
723 All of the functions that work on line ‘object’s also work with nets
724 and buses (*note Lines::). Note that ‘line?’ will return ‘#f’ if called
725 with a net or bus argument.
727 -- Function: net? object
728 Returns ‘#t’ if and only if OBJECT is a net.
730 -- Function: make-net start end [color]
731 Creates and returns a new net ‘object’. START is the position of
732 the start of the new net in the form ‘(x . y)’ and END is the
733 position of end of the net. If COLOR is specified, it should be
734 the integer color map index of the color with which to draw the
735 net. If COLOR is not specified, the default net color is used.
737 -- Function: bus? object
738 Returns ‘#t’ if and only if OBJECT is a bus.
740 -- Function: make-bus start end [color]
741 Creates and returns a new bus ‘object’. Arguments are as for
745 File: geda-scheme.info, Node: Pins, Next: Boxes, Prev: Nets and buses, Up: Core object functions
750 Pin ‘objects’ are straight line segments which represent connectable
751 points in symbols or subcircuits, such as the pins of a semiconductor
752 package. Only one end of a pin can be connected to nets, buses or other
753 pins; the rest of a pin is purely graphical.
755 Pins come in two varieties: “net pins” and “bus pins”, which are used
756 for connections to nets and buses respectively (*note Nets and buses::).
758 All of the functions that work on line ‘object’s also work with pins
759 (*note Lines::). Note that ‘line?’ will return ‘#f’ if called with a
762 -- Function: pin? object
763 Returns ‘#t’ if and only if OBJECT is a pin ‘object’.
765 -- Function: net-pin? object
766 Returns ‘#t’ if and only if OBJECT is a net pin.
768 -- Function: make-net-pin start end [color]
769 Creates and returns a new net pin ‘object’. START is the position
770 of the start of the new pin (the connectable end) in the form ‘(x .
771 y)’ and END is the position of end of the pin. If COLOR is
772 specified, it should be the integer color map index of the color
773 with which to draw the pin. If COLOR is not specified, the default
776 -- Function: bus-pin? object
777 Returns ‘#t’ if and only if OBJECT is a bus pin.
779 -- Function: make-bus-pin start end [color]
780 Creates and returns a new bus pin ‘object’. Arguments are as for
784 File: geda-scheme.info, Node: Boxes, Next: Circles, Prev: Pins, Up: Core object functions
789 Boxes are rectangles specified by the coordinates of their top left and
790 bottom right corners. They are purely graphical, and have no electrical
791 meaning. They can be drawn in different colors, and with various stroke
794 *Note Object color::. *Note Object fill and stroke::.
796 -- Function: box? object
797 Returns ‘#t’ if and only if OBJECT is a box ‘object’.
799 -- Function: make-box top-left bottom-right [color]
800 Creates and returns a new box ‘object’. TOP-LEFT is the position
801 of the top left of the new box in the form ‘(x . y)’, and
802 BOTTOM-RIGHT is the position of the bottom right of the box. If
803 COLOR is specified, it should be the integer color map index of the
804 color with which to draw the box. If COLOR is not specified, the
805 default box color is used.
807 -- Function: set-box! box top-left bottom-right [color]
808 Sets the parameters of BOX. The arguments are the same as to
809 ‘make-box’. Returns BOX.
811 -- Function: box-info box
812 Returns the parameters of BOX. The return value is a list in the
815 ((top-left-x . top-left-y) (bottom-right-x . bottom-right-y) color)
817 -- Function: box-top-left box
818 Returns the position of the top left corner of BOX in the form ‘(x
821 -- Function: box-bottom-right box
822 Returns the position of the bottom right corner of BOX in the form
826 File: geda-scheme.info, Node: Circles, Next: Arcs, Prev: Boxes, Up: Core object functions
831 Circle ‘objects’ are specified by center position and radius, and are
832 purely graphical with no electrical meaning. They can be drawn in
833 different colors, and with various stroke and fill settings.
835 *Note Object color::. *Note Object fill and stroke::.
837 -- Function: circle? object
838 Returns ‘#t’ if and only if OBJECT is a circle ‘object’.
840 -- Function: make-circle center radius [color]
841 Creates and returns a new circle ‘object’. CENTER is the position
842 of the center of the new circle in the form ‘(x . y)’, and RADIUS
843 is the integer radius of the circle. If COLOR is specified, it
844 should be the integer color map index of the color with which to
845 draw the circle. If COLOR is not specified, the default circle
848 -- Function: set-circle! circle center radius [color]
849 Sets the parameters of CIRCLE. The arguments are the same as to
850 ‘make-circle’. Returns CIRCLE.
852 -- Function: circle-info circle
853 Returns the parameters of CIRCLE as a list of the form:
855 ((center-x . center-y) radius color)
857 -- Function: circle-center circle
858 Returns the position of the center of CIRCLE as in the form ‘(x .
861 -- Function: circle-radius circle
862 Returns the radius of CIRCLE as an integer.
865 File: geda-scheme.info, Node: Arcs, Next: Paths, Prev: Circles, Up: Core object functions
870 Arc ‘objects’ are specified by center position, radius, and start and
871 end angles. They are purely graphical with no electrical meaning. They
872 can be drawn in different colors, and with various stroke settings.
874 -- Function: arc? object
875 Returns ‘#t’ if and only if OBJECT is an arc ‘object’.
877 -- Function: make-arc center radius start-angle end-angle [color]
878 Creates and returns a new arc ‘object’. CENTER is the position of
879 the center of the new arc in the form ‘(x . y)’, and RADIUS is the
880 integer radius of the arc. START-ANGLE and END-ANGLE are the
881 angles at which to start and end the arc, in degrees. If COLOR is
882 specified, it should be the integer color map index of the color
883 with which to draw the arc. If COLOR is not specified, the default
886 -- Function: set-arc! arc center radius start-angle end-angle [color]
887 Sets the parameters of ARC. The arguments are the same as to
888 ‘make-arc’. Returns ARC.
890 -- Function: arc-info arc
891 Returns the parameters of ARC as a list of the form:
893 ((center-x . center-y) radius start-angle end-angle color)
895 -- Function: arc-center arc
896 Returns the position of the center of ARC in the form ‘(x . y)’.
898 -- Function: arc-radius arc
899 Returns the radius of ARC as an integer.
901 -- Function: arc-start-angle arc
902 Returns the start angle of ARC as an integer number of degrees.
904 -- Function: arc-end-angle arc
905 Returns the end angle of ARC as an integer number of degrees.
908 File: geda-scheme.info, Node: Paths, Next: Pictures, Prev: Arcs, Up: Core object functions
913 Paths are arbitrary shapes comprised of straight lines and Bézier
914 curves. Each path contains a sequence of _path elements_, each of which
915 requires zero or more absolute position parameters. The element types
916 supported by gEDA are:
918 • ‘moveto’ elements represent a step (without drawing) to another
919 point in the schematic, and begin a new subpath. ‘moveto’ elements
920 need a single position parameter, which is the position of the
921 endpoint of the move.
922 • ‘lineto’ elements draw a straight line from the current point to
923 the point specified by a single position parameter.
924 • ‘curveto’ elements draw a Bézier curve from the current point. The
925 curve requires three position parameters: the position of the first
926 control point; the position of the second control point; and the
927 endpoint of the curve.
928 • ‘closepath’ elements close the current subpath by drawing a
929 straight line from the current point to the subpath’s initial
930 point. They take no parameters.
932 -- Function: path? object
933 Returns ‘#t’ if and only if OBJECT is a path ‘object’.
935 -- Function: make-path [color]
936 Creates and returns a new path ‘object’. If COLOR is specified, it
937 should be the integer color map index of the color with which to
938 draw the path. If COLOR is not specified, the default path color
941 -- Function: path-length path
942 Returns the number of path elements in PATH.
944 -- Function: path-ref path K
945 Returns the Kth element in PATH. The return value is a list. The
946 first item in the list is a symbol indicating the type of element,
947 and any additional items are the position parameters of the
948 element. For example, a call to ‘path-ref’ might return:
950 (curveto (800 . 525) (700 . 700) (500 . 700))
952 If K is not a valid offset into PATH, raises an ‘out-of-range’
955 -- Function: path-remove! path K
956 Removes the Kth element in PATH, returning PATH. If K is not a
957 valid offset, raises an ‘out-of-range’ error.
959 -- Function: path-insert! path K type [positions...]
960 Inserts a new element into PATH at index K. TYPE is a symbol
961 indicating the type of element to insert, using the parameters
962 POSITIONS. If K is less than zero or greater than the number of
963 elements PATH already contains, the new element is appended to the
964 path. For example, to append a straight line section to the
967 (path-insert! path -1 'lineto '(500 . 100))
970 File: geda-scheme.info, Node: Pictures, Next: Text, Prev: Paths, Up: Core object functions
975 A picture object displays an image in the schematic, and is a purely
976 graphical element. Pictures may be in any format supported by the
977 user’s GdkPixbuf installation (but note that images that can’t be loaded
978 for some reason are preserved). The TOP-LEFT, BOTTOM-RIGHT, ANGLE and
979 MIRROR properties of a picture object indicate the transformation that
980 was applied to the original image. The transformation is applied as
983 1. If MIRROR is true, the picture is reflected about its vertical
985 2. The picture is rotated by ANGLE anticlockwise about its center
986 (ANGLE may only be an integer multiple of 90 degrees).
987 3. The picture is scaled and translated to fit within the rectangle
988 defined by the points TOP-LEFT and BOTTOM-RIGHT.
990 -- Function: picture? object
991 Returns ‘#t’ if and only if OBJECT is a picture ‘object’.
993 -- Function: make-picture/vector vector filename top-left bottom-right
995 Creates and returns a new picture object for FILENAME, by reading
996 image data from VECTOR (which should be in a standard image file
997 format). If VECTOR could not be loaded, an error is raised.
998 TOP-LEFT, BOTTOM-RIGHT, ANGLE and MIRROR specify the picture
1001 The points TOP-LEFT and BOTTOM-RIGHT should be specified in the
1004 -- Function: set-picture! picture top-left bottom-right angle mirror
1005 Sets the picture transformation for PICTURE.
1007 -- Function: picture-info picture
1008 Returns the parameters of PICTURE as a list in the form:
1010 (filename (top-left-x . top-left-y) (bottom-right-x . bottom-right-y) angle mirror)
1012 -- Function: picture-filename picture
1013 Returns the filename associated with PICTURE as a string.
1015 -- Function: picture-top-left picture
1016 Returns the position of the top left corner of ‘picture’ in the
1019 -- Function: picture-bottom-right picture
1020 Returns the position of the bottom right corner of ‘picture’ in the
1023 -- Function: picture-angle picture
1024 Returns the angle to rotate ‘picture’ by, as an integer number of
1027 -- Function: picture-mirror? picture
1028 Returns true if ‘picture’ is mirrored.
1031 File: geda-scheme.info, Node: Text, Next: Components, Prev: Pictures, Up: Core object functions
1036 Text fulfils two roles, as straightforward labels and notes on
1037 schematics and symbols, and as attached or floating attributes (*note
1038 Attributes::). A text ‘object’ can be aligned in different ways
1039 relative to its anchor position, and can be displayed in different font
1042 Any text can be set to be visible or invisible on printed output (and
1043 gschem provides ways to preview invisible text). When a text ‘object’
1044 is an attribute (i.e. its string is in a ‘NAME=VALUE’ format) then the
1045 visibility settings are more fine-grained: the text can be set to
1046 display just the attribute name, just the attribute value, or both.
1050 -- Function: text? object
1051 Returns ‘#t’ if and only if OBJECT is a text ‘object’.
1053 -- Function: make-text anchor align angle string size visible show
1055 Creates and returns a new text ‘object’. ANCHOR is the position of
1056 the anchor of the new text in the form ‘(x . y)’, and ALIGN is a
1057 symbol determining how the text should be aligned relative to the
1058 anchor. ALIGN must be one of the following symbols:
1070 For example, if ALIGN is ‘upper-center’, the anchor will be located
1071 at the top center of the rendered text block.
1073 ANGLE should be an integer multiple of 90 degrees, determining the
1074 angle which the text should be displayed at. STRING is the string
1075 contents for the ‘text’ object, and must not contain any null
1076 characters (‘#\0’ in Scheme, Unicode ‘U+0000’). SIZE is the font
1077 size to use. If VISIBLE is ‘#f’, the text will be invisible;
1078 otherwise, it will be visible.
1080 When the STRING is in an attribute format (*note Attributes::), the
1081 SHOW argument determines which parts of the STRING will be
1082 displayed. It must be one of the following symbols:
1088 If COLOR is specified, it should be the integer color map index of
1089 the color with which to draw the text. If COLOR is not specified,
1090 the default text color is used.
1092 -- Function: set-text! text anchor align angle string size visible show
1094 Sets the parameters of TEXT. The arguments are the same as to
1095 ‘make-text’. Returns TEXT.
1097 -- Function: text-info text
1098 Returns the parameters of TEXT as a list in the form:
1100 ((anchor-x . anchor-y) align angle string size visible show color)
1102 See ‘make-text’ for a description of all of these parameters.
1104 -- Function: text-anchor text
1105 Returns the position of the anchor of TEXT in the form ‘(x . y)’.
1107 -- Function: text-align text
1108 Returns the alignment of TEXT as one of the following symbols:
1120 -- Function: text-angle text
1121 Returns the angle that TEXT is displayed at as an integer multiple
1124 -- Function: text-string text
1125 Returns the string content of TEXT.
1127 -- Function: set-text-string! text str
1128 Set the string content of TEXT to STR. STR must not contain any
1129 null characters (‘#\0’ in Scheme, Unicode ‘U+0000’).
1131 -- Function: text-size text
1132 Return the font size of TEXT as an integer.
1134 -- Function: text-visible? text
1135 Returns ‘#t’ if and only if TEXT is set to be visible.
1137 -- Function: set-text-visibility! text visible?
1138 If VISIBLE? is ‘#f’, sets TEXT to be invisible; otherwise, sets it
1141 -- Function: text-attribute-mode text
1142 Returns a symbol indicating which parts of TEXT will be displayed
1143 when TEXT is a valid attribute. The returned value will be one of
1144 the following symbols:
1151 File: geda-scheme.info, Node: Components, Prev: Text, Up: Core object functions
1156 Component ‘object’s represent instances of symbols. They contain other
1157 ‘object’s copied from the original symbol when it is instantiated into a
1160 A component’s BASENAME is a string used to identify which symbol it
1161 originated from. When instantiating a symbol on initial placement in a
1162 schematic, or when recreating a component while loading a schematic, the
1163 BASENAME is used to find the underlying symbol file in the component
1166 *Note Component objects::.
1168 *Note*: In the gEDA C source code, these are normally called
1169 “complex” objects. However, as Guile Scheme supports complex numbers,
1170 and the procedures related to working with complex numbers use the word
1171 ‘complex’ to describe them, this API uses ‘component’ to avoid
1174 The POSITION, ANGLE and MIRROR flag of a component indicates the
1175 transformation that was applied to the contents of the original symbol.
1176 The transformation is applied in the following order:
1178 1. If MIRROR is true, the symbol is reflected in the line x = 0.
1179 2. The symbol is rotated anti-clockwise by ANGLE degrees about the
1180 point (0,0) (ANGLE may only be an integer multiple of 90 degrees).
1181 3. Finally, the symbol is translated by POSITION.
1183 The component’s contents (as returned by ‘component-contents’) have
1184 the transformation already applied to them. Updating the translation
1185 information using e.g. ‘set-component!’ will not alter them – that must
1186 be done separately (e.g. by reloading the symbol).
1188 -- Function: component? object
1189 Returns ‘#t’ if and only if OBJECT is a component ‘object’.
1191 -- Function: make-component basename position angle mirror locked
1192 Creates and returns a new, empty component ‘object’ with the given
1193 BASENAME. POSITION, ANGLE and MIRROR specify the symbol
1194 transformation. If LOCKED is true, the component will be protected
1195 against accidental selection by the user (this is used in gschem
1196 e.g. for titleblocks).
1198 No attempt is made to load a symbol matching BASENAME from
1199 component libraries, and the returned component is flagged as
1202 -- Function: make-component/library basename position angle mirror
1204 Searches the component libraries for a symbol matching BASENAME,
1205 and if found, instantiates the symbol and returns the resulting
1206 component (which is not flagged as embedded). Arguments are as for
1209 If no match for BASENAME is found, ‘#f’ is returned.
1211 -- Function: set-component! component position angle mirror locked
1212 Sets the parameters of COMPONENT. Arguments are the same as to
1213 ‘make-component’. Returns COMPONENT.
1215 *Note*: Remember that modifying the transformation parameters of a
1216 component does not update the component’s contents.
1218 -- Function: set-component-with-transform! component position angle
1220 Sets the parameters of COMPONENT. Arguments are the same as to
1221 ‘make-component’. Returns COMPONENT.
1223 *Note*: All transformations are applied immediately.
1225 -- Function: component-info component
1226 Returns the parameters of COMPONENT as a list of the form:
1228 (basename (x . y) angle mirror locked)
1230 -- Function: component-basename component
1231 Returns the basename of COMPONENT.
1233 -- Function: component-position component
1234 Returns the position to which the original symbol was translated
1235 when creating COMPONENT.
1237 -- Function: component-angle component
1238 Returns the angle by which the original symbol was rotated when
1239 creating COMPONENT, as an integer number of degrees.
1241 -- Function: component-mirror? component
1242 Returns true if the original symbol was mirrored when creating
1245 -- Function: component-locked? component
1246 Returns true if COMPONENT is non-selectable.
1248 -- Function: component-contents component
1249 Returns the contents of COMPONENTS as a list of objects.
1251 -- Function: component-append! component objects...
1252 Appends OBJECTS (which must not be component ‘object’s) to the
1253 contents of COMPONENT. Any OBJECTS which are already included in
1254 COMPONENT are ignored. If any OBJECTS are already part of a ‘page’
1255 or of another component ‘object’, an ‘object-state’ error is
1256 raised. Returns COMPONENT.
1258 -- Function: component-remove! component objects...
1259 Removes OBJECTS from the contents of COMPONENT. Any OBJECTS which
1260 are not part of a component or of a page are ignored. Returns
1263 An ‘object-state’ error will be raised if any OBJECTS satisfy any
1264 of the following conditions:
1266 • are part of a ‘page’;
1267 • are part of a component ‘object’ other than COMPONENT;
1268 • have attached attributes
1269 • are attached as an attribute.
1272 File: geda-scheme.info, Node: Core attribute functions, Next: Configuration functions, Prev: Core object functions, Up: Core API Reference
1274 2.3 Core attribute functions
1275 ============================
1277 To use the functions described in this section, you will need to load
1278 the ‘(geda attrib)’ module.
1280 Attributes are text ‘object’s with a particular format of string.
1281 They can be floating, or they can be attached to another ‘object’.
1283 -- Function: attribute? object
1284 Returns true if and only if OBJECT is an attribute (i.e. a text
1285 ‘object’ and in attribute format).
1287 2.3.1 Attribute names and values
1288 --------------------------------
1290 -- Function: parse-attrib text
1291 Splits the string from TEXT (a text ‘object’) into name and value,
1292 if it is in attribute format. If it is not in attribute format,
1293 raises an ‘attribute-format’ error. The return value is in the
1294 form ‘(NAME . VALUE)’.
1296 -- Function: attrib-name attrib
1297 Returns the name part of ATTRIB, as a string.
1299 -- Function: attrib-value attrib
1300 Returns the value part of ATTRIB, as a string.
1302 -- Function: set-attrib-value! attrib value
1303 Sets the value part of ATTRIB to VALUE.
1305 2.3.2 Attribute attachment
1306 --------------------------
1308 -- Function: attrib-attachment attrib
1309 If ATTRIB is attached to another ‘object’, returns that object.
1310 Otherwise, returns ‘#f’.
1312 -- Function: object-attribs object
1313 Returns a list of all attributes attached to OBJECT.
1315 -- Function: attach-attribs! object [attribs...]
1316 Attach ATTRIBS to OBJECT. All the ATTRIBS must be text ‘object’s.
1317 The following conditions must be satisfied, or an ‘object-state’
1318 error will be raised:
1320 • Neither OBJECT nor any of the ATTRIBS may be already attached
1322 • Both OBJECT and all ATTRIBS must be part of the same ‘page’
1323 and/or component ‘object’;
1325 Any ATTRIBS that are already attached to OBJECT are ignored.
1328 *Note*: For historical reasons, ‘attach-attribs!’ does not require
1329 that all ATTRIBS satisfy ‘attribute?’. Nevertheless, avoid
1330 attaching non-attribute text objects as attributes.
1332 -- Function: detach-attribs! object [attribs...]
1333 Detach ATTRIBS from OBJECT. Any ATTRIBS that are not attached as
1334 attributes are ignored. If any ATTRIBS are attached to ‘object’s
1335 other than OBJECT, an ‘object-state’ error is raised.
1337 2.3.3 Inherited and promoted attributes
1338 ---------------------------------------
1340 “Inherited attributes” are unattached attributes inside a component
1343 -- Function: inherited-attribs object
1344 Returns the inherited attributes of OBJECT, if OBJECT is a
1345 component. If OBJECT is not a component, returns the empty list.
1347 -- Function: attrib-inherited? attrib
1348 Returns ‘#t’ if ATTRIB is an inherited attribute.
1350 “promotable attributes” are inherited attributes that are both
1351 visible and have names that are in the list of promotable attributes set
1352 with the ‘always-promote-attributes’ rc file parameter.
1354 -- Function: promotable-attribs component
1355 Returns a list of promotable attributes of COMPONENT.
1357 -- Function: promote-attribs! component
1358 Promote all promotable attributes from COMPONENT into the ‘page’
1359 that contains COMPONENT. If COMPONENT is not in a page, an
1360 ‘object-state’ error is raised.
1362 All promotable attributes are copied, and made invisible. The
1363 copies are added to the ‘page’, and attached as attributes of
1366 The promoted attributes are returned. If COMPONENT is not in fact
1367 a component ‘object’, does nothing and returns the empty list.
1370 File: geda-scheme.info, Node: Configuration functions, Next: Logging functions, Prev: Core attribute functions, Up: Core API Reference
1372 2.4 Configuration functions
1373 ===========================
1375 To use the functions described in this section, you will need to load
1376 the ‘(geda config)’ module.
1378 This section describes some functions for accessing, monitoring and
1379 modifying the configuration of gEDA libraries and applications.
1383 * Configuration contexts::
1384 * Configuration parameters::
1385 * Configuration events::
1386 * Configuration errors::
1389 File: geda-scheme.info, Node: Configuration contexts, Next: Configuration parameters, Up: Configuration functions
1391 2.4.1 Configuration contexts
1392 ----------------------------
1394 A configuration parameter is always evaluated within a “configuration
1395 context”. Each context is associated with a configuration file
1396 (although the file does not necessarily need to exist).
1398 Each configuration context may have a “parent context”. If, when
1399 looking up a parameter, it has no value set in the selected context, the
1400 parent context is checked, and so on.
1402 Three special contexts are always automatically defined: the “default
1403 context”, the “system context” and the “user context”. The user context
1404 is the default parent context for all other configuration contexts,
1405 including newly-created ones.
1407 2.4.1.1 Obtaining a context
1408 ...........................
1410 -- Function: path-config-context path
1411 Normally, you shouldn’t create a configuration context directly;
1412 you should obtain the configuration context associated with a PATH.
1414 ‘path-config-context’ looks for a configuration file named
1415 ‘geda.conf’. If PATH is not a directory, it is truncated, and then
1416 a file named ‘geda.conf’ is looked for in that directory. If none
1417 is found, the parent directory is checked, and so on until a
1418 configuration file is found or the filesystem root is reached. If
1419 no configuration file was found, the returned context will be
1420 associated with a ‘geda.conf’ in the same directory as PATH.
1422 *Warning*: Do not assume that the configuration file associated
1423 with the context returned by ‘path-config-context’ is located in
1424 the directory specified by PATH.
1426 -- Function: default_config_context
1427 The default context is not associated with any physical path or
1428 on-disk configuration file, and has no parent context. It contains
1429 the default configuration used when no configuration file can be
1432 *Note*: Normally, the default context should be populated with
1433 built-in default configuration settings on start-up, before loading
1434 any further configuration files. This approach is strongly
1435 recommended, because it means that configuration parameters can
1436 then be safely read without having to use ‘config-has-group?’ and
1437 ‘config-has-key?’ to check if they are set (*note Configuration
1438 groups and keys: Configuration parameters.).
1442 -- Function: system-config-context
1443 The system context is used for system-wide configuration. Its
1444 parent context is the default context. It is located:
1446 1. By searching ‘XDG_CONFIG_DIRS’ for a ‘gEDA/geda-system.conf’
1448 2. By checking the system configuration directory specified at
1449 compile-time for a ‘gEDA/geda-system.conf’ file.
1453 -- Function: user-config-context
1454 The user context is used for user-specific configuration, and is
1455 loaded from ‘gEDA/geda-user.conf’ in ‘XDG_CONFIG_HOME’. Its parent
1456 context is the system context.
1460 2.4.1.2 Loading and saving configuration files
1461 ..............................................
1463 Other than the default context, all configuration contexts are
1464 associated with an on-disk configuration file.
1466 -- Function: config-filename cfg
1467 Return the filename of the configuration file associated with the
1468 context CFG. For some contexts (including the default context),
1469 this will return ‘#f’.
1473 -- Function: config-load! cfg
1474 Attempt to load configuration parameters for the context CFG from
1475 its associated file.
1477 -- Function: config-loaded? cfg
1478 Determine whether the context CFG has been successfully loaded from
1483 -- Function: config-save! cfg
1484 Attempt to save configuration parameters for the context CFG to its
1489 -- Function: config-changed? cfg
1490 Determine whether the context CFG has been altered since it was
1491 last synchronised with the on-disk version by loading or saving it.
1495 2.4.1.3 Context parents
1496 .......................
1498 A configuration context may have a “parent context”, from which it
1499 inherits configuration values. Configuration inheritance loops are not
1502 *Note Configuration inheritance: Configuration parameters.
1504 -- Function: context-parent cfg
1505 Return the parent context of the context CFG, if it has one.
1509 -- Function: set-config-parent! cfg parent
1510 Sets PARENT as the parent context of CFG. If PARENT is ‘#f’, sets
1511 CFG as having no parent context.
1513 *Note*: Normally, application code should avoid using this
1514 function; keeping to the default configuration inheritance
1515 structure is recommended in order to ensure consistent behaviour of
1516 all libgeda applications.
1520 2.4.1.4 Context trust
1521 .....................
1523 Some configuration parameters are dangerous; in particular, parameters
1524 that may lead to arbitrary code execution need to be handled carefully.
1525 Such settings might include:
1527 • Preferred PDF reader
1528 • Preferred web browser
1529 • Search path for Scheme plugins
1531 Configuration contexts can be flagged as being “trusted”. This
1532 allows code that needs to access such dangerous parameters to determine
1533 whether the value has been obtained from a safe source.
1535 By default, the default context, system context and user context are
1536 trusted, and all other contexts untrusted.
1538 -- Function: config-trusted? cfg
1539 Test whether CFG is a trusted configuration context.
1543 -- Function: set-config-trusted! cfg trusted?
1544 Set whether the configuration context CFG should be trusted as a
1545 source for dangerous configuration parameters.
1547 *Warning*: You should not set a configuration context as trusted
1548 unless you are certain that it originated from a safe source (e.g.
1549 by interacting with the user to verify it).
1553 -- Function: config-trusted-context cfg
1554 If CFG is trusted, returns CFG; otherwise, returns the first parent
1555 context of CFG that is a trusted context. If no trusted context
1556 can be found, returns ‘#f’.
1561 File: geda-scheme.info, Node: Configuration parameters, Next: Configuration events, Prev: Configuration contexts, Up: Configuration functions
1563 2.4.2 Configuration parameters
1564 ------------------------------
1566 A gEDA “configuration parameter” consists of three components:
1569 A string which identifies the general category in which the
1570 parameter lies (e.g. which application and/or plugin).
1572 A string which specifically identifies the parameter within the
1575 The value of the parameter. This is stored as a string, but can be
1576 converted to a number of possible scalar and list types.
1578 Groups, names and values are all case-sensitive.
1580 2.4.2.1 Configuration groups and keys
1581 .....................................
1583 -- Function: config-groups cfg
1584 Returns a list of all groups available in CFG and its parent
1589 -- Function: config-has-group? cfg group
1590 Determines whether CFG or its parent contexts contain the specified
1595 -- Function: config-keys cfg group
1596 Returns a list of all keys available in the specified GROUP in CFG
1597 and its parent contexts.
1601 -- Function: config-has-key? cfg group key
1602 Determines whether CFG or its parent contexts contains KEY in the
1607 2.4.2.2 Configuration inheritance
1608 .................................
1610 If a configuration context does not directly specify a value for a
1611 configuration parameter, it inherits the value from its parent context.
1613 *Note Context parents: Configuration contexts.
1615 -- Function: config-inherited? cfg group key
1616 Returns ‘#f’ if value of the configuration parameter with the given
1617 GROUP and KEY is specified in the context CFG, and ‘#t’ if it is
1618 inherited from a parent context of CFG.
1622 -- Function: config-source cfg group key
1623 Returns the configuration context (either CFG or one of its parent
1624 contexts) in which the configuration parameter with the given GROUP
1625 and KEY has its value defined.
1629 2.4.2.3 Configuration values
1630 ............................
1632 Each value is stored as a UTF-8 string in the configuration file.
1633 However, this string can be parsed a several different types. All of
1634 the following types are supported:
1639 • Inexact real numbers
1641 In addition, lists of all the above are supported.
1643 -- Function: config-string cfg group key
1644 Retrieve configuration value as a string.
1648 -- Function: config-boolean cfg group key
1649 Retrieve configuration value as a boolean.
1653 -- Function: config-int cfg group key
1654 Retrieve configuration value as an exact integer.
1658 -- Function: config-real cfg group key
1659 Retrieve configuration value as an inexact real number.
1663 -- Function: config-string-list cfg group key
1664 Retrieve configuration value as a list of strings.
1668 -- Function: config-boolean-list cfg group key
1669 Retrieve configuration value as a list of booleans.
1672 -- Function: config-int-list cfg group key
1673 Retrieve configuration value as a list of exact integers.
1677 -- Function: config-real-list cfg group key
1678 Retrieve configuration value as a list of inexact real numbers.
1682 -- Function: config-set! cfg group key value
1683 Set the configuration parameter identified by the given GROUP and
1684 KEY in the configuration context CFG. The type of value to set is
1685 inferred from VALUE.
1690 File: geda-scheme.info, Node: Configuration events, Next: Configuration errors, Prev: Configuration parameters, Up: Configuration functions
1692 2.4.3 Configuration events
1693 --------------------------
1695 When the value of a configuration parameter is altered, either directly
1696 or by loading a configuration file, a “configuration event” is
1697 generated. Handlers can be registered to be notified when a
1698 configuration event occurs. A configuration event is associated with
1699 the group and key that had its value modified.
1701 If a configuration event is emitted by a configuration context, it
1702 propagates to all configuration contexts which inherit that group and
1705 A configuration event handler must be a closure that accepts three
1708 handler cfg group key
1710 CFG is always the configuration context that received the event, and
1711 the GROUP and KEY identify the configuration parameter that changed.
1713 -- Function: add-config-event! cfg handler
1714 Registers HANDLER to be called when configuration changes in the
1719 -- Function: remove-config-event! cfg handler
1720 Stops HANDLER from being called when configuration changes in the
1726 File: geda-scheme.info, Node: Configuration errors, Prev: Configuration events, Up: Configuration functions
1728 2.4.4 Configuration errors
1729 --------------------------
1731 All errors in functions in the ‘(geda config)’ are reported using one of
1734 1. File errors (e.g. “Access denied” or “File not found” are
1735 indicated with the ‘system-error’ key.
1736 2. All other errors are indicated using the ‘config-error’ key.
1738 When a ‘config-error’ is signalled, ‘data’ part of the error
1739 arguments is a list containing one of the following symbols:
1742 The text being parsed was in an unknown encoding.
1744 The configuration data wass ill-formed.
1746 A requested configuration key was not found.
1748 A requested configuration group was not found.
1750 A configuration value could not be parsed into the requested
1754 File: geda-scheme.info, Node: Logging functions, Next: System information, Prev: Configuration functions, Up: Core API Reference
1756 2.5 Logging functions
1757 =====================
1759 To use the functions described in this section, you will need to load
1760 the ‘(geda log)’ module.
1762 -- Function: log! level message [format-args...]
1763 Emit a log message with the specified LEVEL. The MESSAGE is
1764 interpreted as a format string, with FORMAT-ARGS as its parameters.
1766 The LEVEL should be one of the symbols ‘error’, ‘critical’,
1767 ‘warning’, ‘message’, ‘info’ or ‘debug’.
1769 Generally, if the LEVEL is not ‘debug’, then the message should be
1773 File: geda-scheme.info, Node: System information, Prev: Logging functions, Up: Core API Reference
1775 2.6 System information
1776 ======================
1778 To use the functions described in this section, you will need to load
1779 the ‘(geda os)’ module.
1781 This section describes some functions and variables that are useful
1782 for Scheme code that needs to behave differently depending on which
1783 operating system gEDA is running on.
1785 -- Variable: separator-char
1786 The directory separator character that should be used on the host
1789 The ‘separator-char’ function is deprecated and must not be used in
1790 the newly written code. It will be removed after version 1.10.
1791 There is no replacement for it.
1793 -- Variable: separator
1794 A string containing ‘separator-char’.
1796 The ‘separator’ function is deprecated and must not be used in the
1797 newly written code. It will be removed after version 1.10. Use
1798 the guile function ‘file-name-separator-string’ instead.
1800 -- Variable: path-separator-char
1801 The character used for separating the elements in ‘PATH’-like
1802 environment variables on the host platform.
1804 -- Variable: path-separator
1805 A string containing ‘path-separator-char’.
1807 -- Function: platform
1808 Returns a list of symbols describing the host platform. The
1809 returned symbols may include:
1817 -- Function: platform? type
1818 Returns ‘#t’ if the platform description list returned by
1819 ‘platform’ contains the symbol TYPE, and ‘#f’ otherwise.
1821 -- Function: sys-data-dirs
1822 Returns an ordered list of directories in which to access
1823 system-wide gEDA data.
1825 -- Function: sys-config-dirs
1826 Returns an ordered list of directories in which to access
1827 system-wide gEDA configuration information.
1829 -- Function: user-data-dir
1830 Returns the directory in which to store user-specific gEDA data.
1832 -- Function: user-config-dir
1833 Returns the directory in which to store user-specific gEDA
1834 configuration information.
1836 -- Function: expand-env-variables str
1837 Recursively expands STR until no more environment variables can be
1838 expanded, and return the expanded string. Environment variables
1839 are in the form ‘${VAR}’.
1841 (expand-env-variables "${HOME}/path/to/dir")
1844 File: geda-scheme.info, Node: gschem API Reference, Next: Concept Index, Prev: Core API Reference, Up: Top
1846 3 gschem API Reference
1847 **********************
1849 The Scheme modules and functions described in this chapter are available
1850 in the gschem schematic editor application. They are more focused on
1851 enabling and responding to user editing operations.
1855 * Windows and views::
1860 * Miscellanous gschem functions::
1863 File: geda-scheme.info, Node: Windows and views, Next: Key mapping, Up: gschem API Reference
1865 3.1 Windows and views
1866 =====================
1868 To use the functions described in this section, you will need to load
1869 the ‘(gschem window)’ module.
1871 -- Function: active-page
1872 Returns the ‘page’ currently being displayed for editing.
1874 -- Function: set-active-page! page
1875 Sets the current ‘page’ to PAGE.
1877 -- Function: pointer-position
1878 Returns the current mouse pointer position in world coordinates in
1879 the form ‘(x . y)’. If the pointer is outside the display area,
1882 -- Function: snap-point point
1883 Snaps the given POINT to the current snap grid, i.e. returns the
1884 closest grid location to POINT. Expects a point in the form ‘(x .
1885 y)’, and returns a point in the same format.
1888 File: geda-scheme.info, Node: Key mapping, Next: Selections, Prev: Windows and views, Up: gschem API Reference
1893 To use the functions described in this section, you will need to load
1894 the ‘(gschem keymap)’ module.
1896 3.2.1 Key combinations
1897 ----------------------
1899 gschem treats key combinations as first-class objects. A key
1900 combination consists of a non-modifier key press with some number of
1901 modifiers applied. For example, the key combination ‘Ctrl+Shift+A’
1902 (which calls *Edit→Deselect* by default) is typed by holding the <Ctrl>
1903 and <Shift> keys down, and then pressing <A>.
1905 -- Function: key? obj
1906 Returns ‘#t’ if and only if OBJ is a key combination.
1908 -- Function: string->key str
1909 Parses STR to create a new key combination. The expected format
1910 looks like ‘<Control>a’ or ‘<Shift><Alt>F1’. Key names are parsed
1911 using ‘gdk_keyval_from_name()’, and modifiers may appear in any
1912 order. If STR has invalid syntax or does not represent a valid key
1913 combination, raises a ‘key-format’ error.
1915 -- Function: key->string key
1916 Converts KEY to a string, using a format suitable for passing to
1919 -- Function: key->display-string key
1920 Converts KEY to a string, using a format suitable for display.
1921 This should be used when the key combination needs to be displayed
1922 to the user e.g. in the gschem menus or status area. The returned
1923 string is translated according to the user’s current locale.
1925 (key->display-string (string->key ``<Control>bracketright''))
1931 Most gschem functionality is bound not to single key combinations but to
1932 sequences of them. For example, *File→New* is bound to ‘F N’ by default
1933 (i.e. press <F> followed by <N>). Key sequences are simply vectors of
1934 key bindings. For example:
1936 (string->keys ``F N'')
1937 => #(#<gschem-key "F"> #<gschem-key "N">)
1939 In this case, <F> is a “prefix key”, because pressing it does not
1940 cause an action to be carried out directly, but just changes the effect
1941 of pressing subsequent keys.
1943 -- Function: keys? obj
1944 Returns ‘#t’ if and only if OBJ is a valid key sequence.
1946 -- Function: string->keys str
1947 Parses STR into a key sequence. The expected format is a sequence
1948 of key combination specifications (as could be passed to
1949 ‘string->key’) separated by spaces.
1951 -- Function: keys->string keys
1952 Converts the key sequence KEYS to a string, using a format suitable
1953 for passing to ‘string->keys’.
1955 -- Function: keys->display-string keys
1956 Converts the key sequence KEYS to a string, using a format suitable
1962 A “keymap” maps key combinations to values (usually actions) or to other
1963 keymaps. *Note Actions::.
1965 -- Function: keymap? obj
1966 Returns ‘#t’ if and only if OBJ is a keymap.
1968 -- Function: make-keymap
1969 Creates and returns a new, empty keymap.
1971 -- Function: keymap-bind-key! keymap key [bindable]
1972 Binds KEY to BINDABLE in KEYMAP. If BINDABLE is ‘#f’ or not
1973 specified, removes the binding for KEY. BINDABLE should be a thunk
1976 -- Function: keymap-lookup-key keymap key
1977 Looks up the binding for KEY in KEYMAP. If KEY is not bound,
1980 -- Function: keymap-lookup-binding keymap bindable
1981 Carries out a reverse lookup in KEYMAP to find the key bound to
1982 BINDABLE. If BINDABLE is not bound in KEYMAP, returns ‘#f’.
1984 -- Function: keymap-for-each proc keymap
1985 Applies PROC to each binding in KEYMAP. PROC should take two
1986 arguments: the bound key, and its binding.
1988 Actions are bound to key sequences by binding the first key
1989 combination to a keymap, then in the resulting keymap binding the second
1990 key combination, etc. This results in a directed graph of keymaps.
1992 For example, to bind the key sequence ‘F N’, a keymap is created
1993 containing a binding for <N> to the desired action, and then in the main
1994 keymap the prefix key <F> is bound to the new keymap.
1996 Three helper functions are provided for working with key sequence
1999 -- Function: bind-keys! keymap keys [bindable]
2000 Bind KEYS to BINDABLE. Keys may be a key sequence vector, a single
2001 key combination, or a string representing a key sequence or key
2002 combination. If BINDABLE is ‘#f’ or not specified, removes the
2003 binding for KEYS. BINDABLE should be a thunk or a keymap.
2005 If KEYS contains invalid prefix keys (e.g. because one of the
2006 prefix keys is already bound to something other than a keymap),
2007 raises an error. Missing prefix keymaps are created as required.
2009 -- Function: lookup-keys keymap keys
2010 Looks up the binding for KEYS in KEYMAP. KEYS is interpreted the
2011 same as for ‘bind-keys!’. If KEYS is not bound, returns ‘#f’.
2013 -- Function: lookup-binding keymap bindable
2014 Recursively searches KEYMAP for the key sequence bound to BINDABLE,
2015 which should be a thunk or a keymap. If BINDABLE is not bound,
2019 File: geda-scheme.info, Node: Selections, Next: Hooks, Prev: Key mapping, Up: gschem API Reference
2024 To use the functions described in this section, you will need to load
2025 the ‘(gschem selection)’ module.
2027 Each ‘page’ in gschem has a “selection” associated with it, which is
2028 some subset of the ‘page’s contents. Most actions in gschem operate on
2029 the currently selected objects.
2031 -- Function: page-selection page
2032 Returns the current selection for PAGE, as a list of ‘object’s.
2034 -- Function: object-selected? object
2035 Returns ‘#t’ if OBJECT is in its containing page’s selection.
2036 Otherwise, returns ‘#f’. If OBJECT is not in a ‘page’, raises an
2037 ‘object-state’ error.
2039 *Note*: OBJECT must be _directly_ included in a ‘page’, not via
2040 inclusion in a component ‘object’.
2042 -- Function: select-object! object
2043 Adds OBJECT to the selection of its containing ‘page’. If OBJECT
2044 is not directly included in a ‘page’, raises an ‘object-state’
2045 error. If OBJECT is already selected, does nothing. Returns
2048 *Note*: This function does not call ‘select-objects-hook’.
2050 -- Function: deselect-object! object
2051 Removes OBJECT from the selection of its containing ‘page’. If
2052 OBJECT is not directly included in a ‘page’, raises an
2053 ‘object-state’ error. If OBJECT is not selected, does nothing.
2056 *Note*: This function does not call ‘deselect-objects-hook’.
2059 File: geda-scheme.info, Node: Hooks, Next: Actions, Prev: Selections, Up: gschem API Reference
2064 To use the hooks described in this section, you will need to load the
2065 ‘(gschem hook)’ module.
2067 gschem defines a number of hooks that allow functions to be
2068 automatically run whenever a number of built-in actions are invoked by
2071 Most Scheme functions do not call these hooks. If it makes sense for
2072 your code to invoke a standard hook, you should normally do so
2075 *Warning*: Functions added to these standard hooks should not
2076 normally modify their arguments.
2078 For more information on hooks in Guile, *note Hooks: (guile)Hooks.
2080 -- Variable: add-objects-hook
2081 Called after objects are added to the page, at their initial
2082 creation. The argument is a list of the objects being added.
2084 -- Variable: copy-objects-hook
2085 Called after objects are copied, either via *Edit → Copy Mode* or
2086 similar, or to buffers, or to the clipboard. Argument is a list of
2087 the objects that were copied.
2089 -- Variable: remove-objects-hook
2090 Called after objects are removed from the page. Argument is a list
2091 of the objects being removed.
2093 -- Variable: move-objects-hook
2094 Called after objects are moved. Argument is a list of the objects
2097 -- Variable: mirror-objects-hook
2098 Called after objects are mirrored. Argument is a list of the
2099 objects that were mirrored.
2101 -- Variable: rotate-objects-hook
2102 Called after objects are rotated. Argument is a list of the
2103 objects that were rotated.
2105 -- Variable: paste-objects-hook
2106 Called after objects are pasted to the page, either via *Edit →
2107 Copy Mode* or similar, or via buffers, or via the clipboard.
2108 Argument is a list of the objects that were pasted.
2110 -- Variable: attach-attribs-hook
2111 Called after attributes are attached to something. The argument is
2112 a list of the attributes that were attached.
2114 -- Variable: detach-attribs-hook
2115 Called after attributes are detached from something. The argument
2116 is a list of the attributes that were detached.
2118 -- Variable: select-objects-hook
2119 Called after objects are added to the selection. The argument is a
2120 list of objects that were selected.
2122 -- Variable: deselect-objects-hook
2123 Called after objects are removed from the selection. The argument
2124 is a list of objects that were deselected.
2126 -- Variable: new-page-hook
2127 Called when a new page is created. The argument is the new page.
2129 -- Variable: action-property-hook
2130 Called when an action property is set. The arguments are the
2131 action, the property key and the property value. *Note Actions::.
2135 -- Variable: bind-keys-hook
2136 Called when a key binding is set or modified. The arguments are
2137 the keymap, the key sequence and the binding’s target.
2139 *Note*: ‘bind-keys-hook’ may be run multiple times for a single key
2140 binding event if the target keymap is bound within a superior
2146 File: geda-scheme.info, Node: Actions, Next: Miscellanous gschem functions, Prev: Hooks, Up: gschem API Reference
2151 To use the functions described in this section, you will need to load
2152 the ‘(gschem action)’ module.
2154 3.5.1 Action objects
2155 --------------------
2157 Usually, it is sufficient to use normal Scheme functions when extending
2158 gschem. However, when integrating an extension function with the gschem
2159 GUI (e.g. via keybindings), it is often useful to couple a Scheme
2160 function with metadata such as the label and icon to show in menus, etc.
2162 You can do this by creating a gschem action. Actions can be called
2163 just like a normal Scheme function, but get executed via the gschem
2164 action dispatcher ‘eval-action!’ rather than being invoked directly.
2165 Normally, actions have names begining with an ‘&’ symbol.
2167 -- Macro: define-action (name [keyword value ...]) body
2168 Create a new action, bound to the given NAME in the current module.
2169 The BODY is a sequence of Scheme expressions which are evaluated in
2170 order when the action is invoked. The following meta-information
2171 can be specified for the action by providing pairs of KEYWORDs and
2174 • ‘#:icon’ sets the name of the icon to be used for the action.
2175 This can be either a GTK stock identifier, in which case the
2176 GTK stock icon is used, or an icon name in the current icon
2178 • ‘#:name’ sets the generic name of the action. This is
2179 displayed as a tooltip for toolbar buttons, and in the hotkey
2180 list. It should be understandable without any context and not
2181 contain a mnemonic or ellipsis.
2182 • ‘#:label’ sets the generic label of the action. This is
2183 displayed in the context menu. It should be suitable to be
2184 used as a menu label but be understandable without any context
2185 and not contain a mnemonic.
2186 • ‘#:menu-label’ sets the label for the action when shown in the
2187 main menu. This should be identical to the generic label
2188 except for the mnemonic (a character preceded by an underscore
2189 for easier keyboard access) and omissions based on the menu
2191 • ‘#:tooltip’ sets a string explaining the action. This is
2192 displayed as an additional information when the user hovers
2193 the mouse cursor over the action. For tool buttons, it is
2194 displayed in addition to the action name. GTK tends to
2195 display tooltips quite aggressively, so use with care.
2198 (define-action (&report-bug
2199 #:icon "web-browser"
2201 #:label "Report Bug..."
2202 #:menu-label "Report _Bug...")
2203 (show-uri "http://bugs.launchpad.net/geda/+reportbug"))
2207 -- Function: make-action thunk [keyword value ...]
2208 Create and return a new action wrapping THUNK. KEYWORD-VALUE pairs
2209 specify the meta-information for the action as with
2214 -- Function: action? obj
2215 Returns ‘#t’ iff OBJ is a gschem action, and ‘#f’ otherwise.
2219 3.5.2 Evaluating actions
2220 ------------------------
2222 All of gschem’s built-in actions are callable just like normal Scheme
2223 functions. However, it’s sometimes useful to explicitly evaluate an
2224 action in the same way that the gschem GUI (menus, toolbars or
2225 keybindings) would do so.
2227 -- Function: eval-action! action
2228 Invoke ACTION, returning ‘#t’ on success and raising an error on
2229 failure. There are a number of possible types for ACTION that
2230 ‘eval-action!’ will accept:
2234 • A symbol naming an action or a thunk in the current module.
2236 The special symbol ‘repeat-last-command’ is interpreted as a
2237 request to repeat the last action evaluated via ‘eval-action!’.
2239 *Note*: If you have an action object ‘&action’, then the following
2240 to calls are equivalent and interchangeable:
2242 (eval-action! &action)
2247 3.5.3 Action positions
2248 ----------------------
2250 Often in gschem actions it may be useful not to use the actual current
2251 mouse pointer position but to use the mouse pointer position that was
2252 current when the action was invoked.
2254 -- Function: eval-action-at-point! action [point]
2255 Evaluate ACTION at a particular point on the schematic plane. If
2256 POINT is omitted, the action is evaluated at the current mouse
2261 -- Function: action-position
2262 Return the current action pointer position, as set when the action
2263 was invoked (via ‘eval-action-at-point!’). This only makes sense
2264 to call from inside an action.
2268 *Note*: The pointer position can only be considered reliable when the
2269 user was actually clicking on or pointing at the schematic view area to
2270 invoke the action, rather than on a menu or toolbar button. At the
2271 moment this means that an action position is only set when a command is
2275 File: geda-scheme.info, Node: Miscellanous gschem functions, Prev: Actions, Up: gschem API Reference
2277 3.6 Miscellaneous gschem functions
2278 ==================================
2280 3.6.1 gschem Attribute Helpers
2281 ------------------------------
2283 To use the functions described in this section, you will need to load
2284 the ‘(gschem attrib)’ module.
2286 -- Function: add-attrib! target name value visible show
2287 Create a new attribute, either attached to a TARGET ‘object’ in the
2288 current ‘page’, or floating in the current ‘page’ if TARGET is
2289 ‘#f’. The NAME and VALUE for the attribute must be strings, and if
2290 visible is ‘#f’, the attribute will be invisible. The SHOW
2291 argument controls which parts of the attribute will be visible, and
2292 must be one of the following symbols:
2298 This function exists to provide a way for actions defined in Scheme
2299 to use the same attribute placement heuristics as gschem’s built-in
2300 *Add Attribute* action.
2302 *Note Text::, *note Attributes:: and *note Windows and views::.
2304 3.6.2 Miscellaneous utility functions
2305 -------------------------------------
2307 To use the functions described in this section, you will need to load
2308 the ‘(gschem util)’ module.
2310 -- Function: show-uri uri
2311 Open URI in the registered default application associated for that
2312 type of file or protocol. URI should be fully-qualified URI; which
2313 URIs can be handled by ‘show-uri’ will depend on the system
2316 -- Function: show-file filename
2317 Displays a file in the registered default application for files of
2318 that type. FILENAME should be the absolute path and filename of a
2322 File: geda-scheme.info, Node: Concept Index, Next: Function Index, Prev: gschem API Reference, Up: Top
2330 * Action evaluation: Actions. (line 77)
2331 * Action objects: Actions. (line 12)
2332 * Action positions: Actions. (line 105)
2333 * Action properties: Actions. (line 12)
2334 * Actions: Actions. (line 6)
2335 * Attached attribute: Attributes. (line 32)
2336 * Attribute: Attributes. (line 6)
2337 * Attribute format: Attributes. (line 6)
2338 * Component: Component objects. (line 6)
2339 * Component library: Component objects. (line 6)
2340 * Configuration: Configuration functions.
2342 * Configuration context: Configuration contexts.
2344 * Configuration errors: Configuration errors.
2346 * Configuration events: Configuration events.
2348 * Configuration group: Configuration parameters.
2350 * Configuration key: Configuration parameters.
2352 * Configuration notifications: Configuration events.
2354 * Configuration parameter: Configuration parameters.
2356 * Configuration trust: Configuration contexts.
2358 * Configuration value: Configuration parameters.
2360 * Context parent: Configuration contexts.
2362 * Context trust: Configuration contexts.
2364 * Default configuration contex: Configuration contexts.
2366 * Embedded component: Component objects. (line 6)
2367 * Evaluating actions: Actions. (line 77)
2368 * Floating attribute: Attributes. (line 39)
2369 * Getting configuration parameters: Configuration parameters.
2371 * Loading configuration: Configuration contexts.
2373 * Objects: Objects. (line 6)
2374 * Pages: Pages. (line 6)
2375 * Parent configuration context: Configuration contexts.
2377 * Reporting bugs: Introduction. (line 49)
2378 * Saving configuration: Configuration contexts.
2380 * Schematic elements: Objects. (line 6)
2381 * Schematics: Pages. (line 6)
2382 * Setting configuration parameters: Configuration parameters.
2384 * Symbols: Pages. (line 6)
2385 * System configuration context: Configuration contexts.
2387 * Trusted configuration context: Configuration contexts.
2389 * User configuration context: Configuration contexts.
2393 File: geda-scheme.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top
2401 * action-position: Actions. (line 116)
2402 * action?: Actions. (line 69)
2403 * active-page: Windows and views. (line 9)
2404 * active-pages: Core page functions. (line 14)
2405 * add-attrib!: Miscellanous gschem functions.
2407 * add-config-event!: Configuration events.
2409 * arc-center: Arcs. (line 31)
2410 * arc-end-angle: Arcs. (line 40)
2411 * arc-info: Arcs. (line 26)
2412 * arc-radius: Arcs. (line 34)
2413 * arc-start-angle: Arcs. (line 37)
2414 * arc?: Arcs. (line 10)
2415 * attach-attribs!: Core attribute functions.
2417 * attrib-attachment: Core attribute functions.
2419 * attrib-inherited?: Core attribute functions.
2421 * attrib-name: Core attribute functions.
2423 * attrib-value: Core attribute functions.
2425 * attribute?: Core attribute functions.
2427 * bind-keys!: Key mapping. (line 112)
2428 * box-bottom-right: Boxes. (line 38)
2429 * box-info: Boxes. (line 28)
2430 * box-top-left: Boxes. (line 34)
2431 * box?: Boxes. (line 13)
2432 * bus-pin?: Pins. (line 32)
2433 * bus?: Nets and buses. (line 24)
2434 * circle-center: Circles. (line 32)
2435 * circle-info: Circles. (line 27)
2436 * circle-radius: Circles. (line 36)
2437 * circle?: Circles. (line 12)
2438 * close-page!: Core page functions. (line 28)
2439 * component-angle: Components. (line 87)
2440 * component-append!: Components. (line 101)
2441 * component-basename: Components. (line 80)
2442 * component-contents: Components. (line 98)
2443 * component-info: Components. (line 75)
2444 * component-locked?: Components. (line 95)
2445 * component-mirror?: Components. (line 91)
2446 * component-position: Components. (line 83)
2447 * component-remove!: Components. (line 108)
2448 * component?: Components. (line 38)
2449 * config-boolean: Configuration parameters.
2451 * config-boolean-list: Configuration parameters.
2453 * config-changed?: Configuration contexts.
2455 * config-filename: Configuration contexts.
2457 * config-groups: Configuration parameters.
2459 * config-has-group?: Configuration parameters.
2461 * config-has-key?: Configuration parameters.
2463 * config-inherited?: Configuration parameters.
2465 * config-int: Configuration parameters.
2467 * config-int-list: Configuration parameters.
2469 * config-keys: Configuration parameters.
2471 * config-load!: Configuration contexts.
2473 * config-loaded?: Configuration contexts.
2475 * config-real: Configuration parameters.
2477 * config-real-list: Configuration parameters.
2479 * config-save!: Configuration contexts.
2481 * config-set!: Configuration parameters.
2483 * config-source: Configuration parameters.
2485 * config-string: Configuration parameters.
2487 * config-string-list: Configuration parameters.
2489 * config-trusted-context: Configuration contexts.
2491 * config-trusted?: Configuration contexts.
2493 * context-parent: Configuration contexts.
2495 * copy-object: General object functions.
2497 * default_config_context: Configuration contexts.
2499 * define-action: Actions. (line 22)
2500 * deselect-object!: Selections. (line 32)
2501 * detach-attribs!: Core attribute functions.
2503 * eval-action!: Actions. (line 82)
2504 * eval-action-at-point!: Actions. (line 109)
2505 * expand-env-variables: System information. (line 64)
2506 * fold-bounds: Object bounds. (line 19)
2507 * inherited-attribs: Core attribute functions.
2509 * key->display-string: Key mapping. (line 32)
2510 * key->string: Key mapping. (line 28)
2511 * key?: Key mapping. (line 18)
2512 * keymap-bind-key!: Key mapping. (line 84)
2513 * keymap-for-each: Key mapping. (line 97)
2514 * keymap-lookup-binding: Key mapping. (line 93)
2515 * keymap-lookup-key: Key mapping. (line 89)
2516 * keymap?: Key mapping. (line 78)
2517 * keys->display-string: Key mapping. (line 68)
2518 * keys->string: Key mapping. (line 64)
2519 * keys?: Key mapping. (line 56)
2520 * line-end: Lines. (line 42)
2521 * line-info: Lines. (line 28)
2522 * line-start: Lines. (line 37)
2523 * line?: Lines. (line 13)
2524 * log!: Logging functions. (line 9)
2525 * lookup-binding: Key mapping. (line 126)
2526 * lookup-keys: Key mapping. (line 122)
2527 * make-action: Actions. (line 62)
2528 * make-arc: Arcs. (line 13)
2529 * make-box: Boxes. (line 16)
2530 * make-bus: Nets and buses. (line 27)
2531 * make-bus-pin: Pins. (line 35)
2532 * make-circle: Circles. (line 15)
2533 * make-component: Components. (line 41)
2534 * make-component/library: Components. (line 52)
2535 * make-keymap: Key mapping. (line 81)
2536 * make-line: Lines. (line 16)
2537 * make-net: Nets and buses. (line 17)
2538 * make-net-pin: Pins. (line 24)
2539 * make-page: Core page functions. (line 24)
2540 * make-path: Paths. (line 28)
2541 * make-picture/vector: Pictures. (line 24)
2542 * make-text: Text. (line 23)
2543 * mirror-objects!: Object transformations.
2545 * net-pin?: Pins. (line 21)
2546 * net?: Nets and buses. (line 14)
2547 * object-attribs: Core attribute functions.
2549 * object-bounds: Object bounds. (line 9)
2550 * object-color: Object color. (line 10)
2551 * object-component: General object functions.
2553 * object-connections: General object functions.
2555 * object-fill: Object fill and stroke.
2557 * object-page: Core page functions. (line 91)
2558 * object-selected?: Selections. (line 16)
2559 * object-stroke: Object fill and stroke.
2561 * object-stroke-cap: Object fill and stroke.
2563 * object-stroke-dash: Object fill and stroke.
2565 * object-stroke-width: Object fill and stroke.
2567 * object-type: Object sub-types. (line 8)
2568 * object-type?: Object sub-types. (line 24)
2569 * object?: General object functions.
2571 * page->string: Core page functions. (line 55)
2572 * page-append!: Core page functions. (line 68)
2573 * page-contents: Core page functions. (line 64)
2574 * page-dirty?: Core page functions. (line 105)
2575 * page-filename: Core page functions. (line 35)
2576 * page-remove!: Core page functions. (line 76)
2577 * page-selection: Selections. (line 13)
2578 * page?: Core page functions. (line 11)
2579 * parse-attrib: Core attribute functions.
2581 * path-config-context: Configuration contexts.
2583 * path-insert!: Paths. (line 52)
2584 * path-length: Paths. (line 34)
2585 * path-ref: Paths. (line 37)
2586 * path-remove!: Paths. (line 48)
2587 * path?: Paths. (line 25)
2588 * picture-angle: Pictures. (line 54)
2589 * picture-bottom-right: Pictures. (line 50)
2590 * picture-filename: Pictures. (line 43)
2591 * picture-info: Pictures. (line 38)
2592 * picture-mirror?: Pictures. (line 58)
2593 * picture-top-left: Pictures. (line 46)
2594 * picture?: Pictures. (line 21)
2595 * pin?: Pins. (line 18)
2596 * platform: System information. (line 35)
2597 * platform?: System information. (line 45)
2598 * pointer-position: Windows and views. (line 15)
2599 * promotable-attribs: Core attribute functions.
2601 * promote-attribs!: Core attribute functions.
2603 * remove-config-event!: Configuration events.
2605 * rotate-objects!: Object transformations.
2607 * select-object!: Selections. (line 24)
2608 * set-active-page!: Windows and views. (line 12)
2609 * set-arc!: Arcs. (line 22)
2610 * set-attrib-value!: Core attribute functions.
2612 * set-box!: Boxes. (line 24)
2613 * set-circle!: Circles. (line 23)
2614 * set-component!: Components. (line 61)
2615 * set-component-with-transform!: Components. (line 68)
2616 * set-config-parent!: Configuration contexts.
2618 * set-config-trusted!: Configuration contexts.
2620 * set-line!: Lines. (line 23)
2621 * set-object-color!: Object color. (line 14)
2622 * set-object-fill!: Object fill and stroke.
2624 * set-object-stroke!: Object fill and stroke.
2626 * set-page-dirty!: Core page functions. (line 109)
2627 * set-page-filename!: Core page functions. (line 39)
2628 * set-picture!: Pictures. (line 35)
2629 * set-text!: Text. (line 62)
2630 * set-text-string!: Text. (line 97)
2631 * set-text-visibility!: Text. (line 107)
2632 * show-file: Miscellanous gschem functions.
2634 * show-uri: Miscellanous gschem functions.
2636 * snap-point: Windows and views. (line 20)
2637 * string->key: Key mapping. (line 21)
2638 * string->keys: Key mapping. (line 59)
2639 * string->page: Core page functions. (line 48)
2640 * sys-config-dirs: System information. (line 53)
2641 * sys-data-dirs: System information. (line 49)
2642 * system-config-context: Configuration contexts.
2644 * text-align: Text. (line 77)
2645 * text-anchor: Text. (line 74)
2646 * text-angle: Text. (line 90)
2647 * text-attribute-mode: Text. (line 111)
2648 * text-info: Text. (line 67)
2649 * text-size: Text. (line 101)
2650 * text-string: Text. (line 94)
2651 * text-visible?: Text. (line 104)
2652 * text?: Text. (line 20)
2653 * translate-objects!: Object transformations.
2655 * user-config-context: Configuration contexts.
2657 * user-config-dir: System information. (line 60)
2658 * user-data-dir: System information. (line 57)
2661 File: geda-scheme.info, Node: Variable Index, Prev: Function Index, Up: Top
2669 * action-property-hook: Hooks. (line 71)
2670 * add-objects-hook: Hooks. (line 22)
2671 * attach-attribs-hook: Hooks. (line 52)
2672 * bind-keys-hook: Hooks. (line 77)
2673 * copy-objects-hook: Hooks. (line 26)
2674 * deselect-objects-hook: Hooks. (line 64)
2675 * detach-attribs-hook: Hooks. (line 56)
2676 * mirror-objects-hook: Hooks. (line 39)
2677 * move-objects-hook: Hooks. (line 35)
2678 * new-page-hook: Hooks. (line 68)
2679 * paste-objects-hook: Hooks. (line 47)
2680 * path-separator: System information. (line 32)
2681 * path-separator-char: System information. (line 28)
2682 * remove-objects-hook: Hooks. (line 31)
2683 * rotate-objects-hook: Hooks. (line 43)
2684 * select-objects-hook: Hooks. (line 60)
2685 * separator: System information. (line 21)
2686 * separator-char: System information. (line 13)
2692 Node: Introduction
\x7f1705
2693 Node: Schematic Document Model
\x7f4652
2695 Node: Objects
\x7f6886
2696 Node: Component objects
\x7f7773
2697 Node: Attributes
\x7f9123
2698 Node: Coordinate system
\x7f11058
2699 Node: Core API Reference
\x7f12073
2700 Node: Core page functions
\x7f12584
2701 Node: Core object functions
\x7f16552
2702 Node: General object functions
\x7f17005
2703 Node: Object sub-types
\x7f18332
2704 Node: Object transformations
\x7f19152
2705 Node: Object bounds
\x7f20033
2706 Node: Object color
\x7f21087
2707 Node: Object fill and stroke
\x7f21676
2708 Node: Lines
\x7f24898
2709 Node: Nets and buses
\x7f26783
2711 Node: Boxes
\x7f29554
2712 Node: Circles
\x7f31106
2714 Node: Paths
\x7f34209
2715 Node: Pictures
\x7f36900
2717 Node: Components
\x7f43706
2718 Node: Core attribute functions
\x7f48722
2719 Node: Configuration functions
\x7f52503
2720 Node: Configuration contexts
\x7f53057
2721 Node: Configuration parameters
\x7f59394
2722 Node: Configuration events
\x7f63092
2723 Node: Configuration errors
\x7f64324
2724 Node: Logging functions
\x7f65285
2725 Node: System information
\x7f65985
2726 Node: gschem API Reference
\x7f68418
2727 Node: Windows and views
\x7f68894
2728 Node: Key mapping
\x7f69746
2729 Node: Selections
\x7f74911
2730 Node: Hooks
\x7f76471
2731 Node: Actions
\x7f79557
2732 Node: Miscellanous gschem functions
\x7f84832
2733 Node: Concept Index
\x7f86607
2734 Node: Function Index
\x7f91060
2735 Node: Variable Index
\x7f109644