(in-package "COMMON-LISP-USER")
;;;*************************************************************************
;;;      -----  USER CHANGES MAY BE DONE IN THIS FILE ------
;;;   Places where some action is usually essential are marked with !!! below.
;;;*************************************************************************
;;;
;;; File: configuration.lisp
;;;
;;; Provides one point where all the necessary paths for using KPML
;;; may be set. These may be copied and used in any file that is loaded
;;; prior to loading KPML, for example in some application-specific
;;; general startup file. It is always the FIRST setting of these
;;; paths that will be taken by KPML: subsequent resettings are ignored.
;;; Places where changes are essential are marked with !!! below.
;;;
;;; The simplest option is just to leave these definitions  here and 
;;; load the required KPML startup file:
;;;
;;;  start-kpml.lisp          for starting an already compiled version of KPML
;;;  compile-kpml.lisp        for fully compiling KPML
;;;
;;;  KPML-INSTALLATION.lisp   for a dialog-driven installation of KPML
;;;
;;; all of the startup files make reference to the paths defined here.
;;; Note it is important that all directory pathnames end with a final Slash.
;;;
;;; As of KPML 4.1+ (Aug 09) can also rely on environment variables 
;;; instead of setting / resetting paths in code here. Environment
;;; variables are ONLY considered, if no values have been assigned
;;; to the Lisp variables before this file is loaded! This enables
;;; the entire start-up procedure to be embedded in other Lisp
;;; code flexibly without consideration of the environment.
;;;
;;; In addition, we make a few more default assumptions about
;;; where other components are (e.g., that resources and kr systems
;;; are parallel to the KPML code directory), so that the defaults
;;; that are tried if we don't change anything can be used in more
;;; cases.
;;;**************************************************************************

;; ----------------------------------------------------------------------
;; ROOT OF KPML DIRECTORY STRUCTURE...  KPML will assume that it has
;; been placed in the same directory as this file. So the following
;; can be left as is...
;; ----------------------------------------------------------------------

(eval-when 
 (compile load eval)
 (unless (boundp '*root-of-kpml*)
   (setq *root-of-kpml*
         (make-pathname 
	  ;; KPML4 device added for PC Allegro...
	  :device (pathname-device cl-user::*load-truename*) 
          :host (pathname-host cl-user::*load-truename*) 
          :directory (pathname-directory cl-user::*load-truename*)))))

;; get us access to the environment variables regardless of Lisp version...
(load (merge-pathnames "Processes/x-platform/getenv.lisp" *root-of-kpml*))

;; ----------------------------------------------------------------------
;; !!! ROOT OF LINGUISTIC RESOURCES... say where linguistic resources
;;     are to be found. This can also be set from a dialogue box during
;;     running of KPML or in the kpmlconf each-time configuration file
;;     or by setting the environment variable KPMLRESOURCEBASE.
;; ----------------------------------------------------------------------
(defvar *root-of-resources* 
  (kpml-getenv "KPMLRESOURCEBASE"
	       (merge-pathnames "Resources/" 
				(kpml-parent-directory *root-of-kpml*))
	       ;; --- or just add some absolute path if you prefer... --- 
	       ;; "C:/john/systems/kpml/Resources/"
	       ;; -------------------------------------------------------------------
	       ))

;; ----------------------------------------------------------------------
;; !!! the file that loads the kr system to be used...
;;     *and* (and this is the important bit) also loads
;;     the necessary interface functions that provide access
;;     between KPML and the KR system. Three are currently
;;     provided: Loom (2.0, 2.1, 3.0, 4.0), a CLOS-based kr
;;     developed for the EU Agile project, and a Racer-based KR.
;;     The default that is currently active is in the file
;;     "selected-kpml-kr", so this can be changed here 
;;     if required.
;;
;;     This can also be configured away during compilation/loading.
;; ----------------------------------------------------------------------
(defvar *kpml-kr-loader* 
  (merge-pathnames "selected-kpml-kr.lisp" *root-of-kpml*))

;; ----------------------------------------------------------------------
;; !!! where Loom is IF YOU ARE USING LOOM... (if not, ignore)
;;      As is will guess that Loom 4 is kept parallel to 
;;      KPML in the directory structure...  Change if you 
;;      do something else.
;; ----------------------------------------------------------------------
(defvar *loom-pathname-default* 
  (kpml-getenv 
   "KPMLKRBASE"
   (merge-pathnames "loom4.0/" (kpml-parent-directory *root-of-kpml*))
   ;; --- or just add some absolute path if you prefer... --- 
   ;; "C:/john/systems/kpml/loom4.0/"
   ;; -------------------------------------------------------------------
   ))

;; ----------------------------------------------------------------------
;; !!! Where Agile KR code is IF YOU ARE USING AGILE CODE... (if not, ignore)
;; ----------------------------------------------------------------------
(defvar *agile-pathname-default* 
  (kpml-getenv "KPMLKRBASE"
	       "D:/Agile-code/core/"))

;; ----------------------------------------------------------------------
;; T/nil: whether the general upper model from the resource directory
;; General/Semantics is to be loaded on start up or not...
;; When this is set, KPML will often try to load a KR system, so loading
;; an Upper Model only makes sense if you have a KR system to use.
;; ----------------------------------------------------------------------
(defvar *load-general-upper-model* T)

;; ----------------------------------------------------------------------
;; T/nil: should the interface be brought up in colour (T) or not (nil)
;; (only relevant when the interface is used)
;; ----------------------------------------------------------------------
(defvar *kpml-gui-in-colour* T)