;                                                         -*-Scheme-*-
;;; 
;;; Common init file for gaf
;;;

; The following global variables are defined by libgeda:
;
; path-sep       -- system path separator
; geda-data-path -- path to gEDA system-wide data directory
; geda-rc-path   -- path to gEDA system-wide config directory

;; Set some flags to aid in debugging rc files
(debug-enable 'debug)
(debug-enable 'backtrace)
(read-enable 'positions)

;; The directory containing gaf Scheme code.
(define geda-scheme-path (string-append geda-data-path path-sep "scheme"))
; We need to add gaf's scheme library to the Guile load path.
(set! %load-path (append (list geda-scheme-path) %load-path))
; This is used in some places for error messages/listing gnetlist
; backends
(scheme-directory geda-scheme-path)

; The libgeda Scheme library provides a number of useful functions for
; writing Scheme code for embedding in gaf.
(load-from-path "geda.scm")


;; The directory containing various bitmaps (e.g. icons)
(bitmap-directory (build-path geda-data-path "bitmap"))

; Set the name of the postscript prolog file that will be 
; pasted into the postscript output after the DSC comments, but
; before the main script.
(postscript-prolog (build-path geda-data-path "prolog.ps"))

;
; Start of attribute promotion keywords
; 

; attribute-promotion string
;
; This keyword controls if attribute promotion occurs when you instanciate a
; component.  Attribute promotion basically means that any floating attribute
; (unattached) which is inside a symbol gets "promoted" or attached to the 
; newly inserted component.  This only occurs when the component is 
; instanciated.
;
(attribute-promotion "enabled")
;(attribute-promotion "disabled")

; promote-invisible string
;
; If attribute-promotion is enabled, then this controls if invisible floating
; attributes are promoted (attached to the outside of the component) if the 
; text string is invisible.  There are cases where it is undesirable, so the 
; default is disabled.
;
;(promote-invisible "enabled")
(promote-invisible "disabled")

; keep-invisible string
;
; If both attribute-promotion and promote-invisible are enabled, then this 
; controls if invisible floating attributes are kept around in memory and
; NOT deleted.  Having this enabled will keeps component slotting working.
; If attribute-promotion and promote-invisible are enabled and this
; keyword is disabled, then component slotting will NOT work (and maybe 
; other functions which depend on hidden attributes, since those attributes
; are deleted from memory).
;
;(keep-invisible "disabled")
(keep-invisible "enabled")

; always-promote-attributes
;
; Set the list of attributes that are always promoted regardless of
; their visibility. The list should be a scm list of strings. The
; space separated attribute names are deprecated.
;
;(always-promote-attributes "footprint device value model-name")
(always-promote-attributes '("footprint" "device" "value" "model-name"))

;
; End of attribute promotion keywords
; 

;;;; Color maps

;; Load functions for handling color maps
(load-from-path "color-map.scm")

;; Make the printing color map more user-friendly
(color-map-make-friendly print-color-map)

;; Load up a color scheme for printing optimised for a dark background.
; Comment out the first line and comment in the second line for a
; white background. The dark background is the original look.
;
(load (build-path geda-rc-path "print-colormap-darkbg")) ; dark background
;(load (build-path geda-rc-path "print-colormap-lightbg")) ; light background


;;;; Process configuration script directory

;; The directory containing any extra scheme files to load
(define geda-confd-path (build-path geda-data-path "gafrc.d"))

;; Execute any scheme files found in the geda-confd-path directory.
(load-scheme-dir geda-confd-path)
