(in-package "KPML-I")

;;; File: variables.lisp
;;;
;;; General variable declarations for the new interface...

(defvar *OWN-WINDOW* 
  #-lispworks
  '(:right-margin (20 :character))
  #+lispworks
  (:version-case (":LISPWORKS")
   ("4.0" '(:right-margin (20 :character)))
   ((+ "4.0") T)))

(defvar *WIDE-OWN-WINDOW*
  #-lispworks
  '(:right-margin (100 :character))
  #+lispworks
  (:version-case (":LISPWORKS")
   ("4.0" '(:right-margin (100 :character)))
   ((+ "4.0") T)))

;;;--------------------------------------------------------
;;;			      Variables
;;;--------------------------------------------------------

(defvar *DEVELOPMENT-FRAME-ONLY*     nil)

;;; The globals for the various windows and processes...

(defvar *RESOURCE-MANAGER-FRAME*     nil "Frame for the root window")
(defvar *RESOURCE-DEVELOPMENT-FRAME* nil "Frame for the generation window")
(defvar *RESOURCE-INSPECTOR-FRAME*   nil "Frame for the inspection window")
(defvar *FAT-FRAME*                  nil)
(defvar *GENERATION-HISTORY-FRAME*   nil)

;;; ----------------------------------------------------------------------
;;; Following makes all started processes for the new KPML interface
;;; startup in the KPML package... This is too strong but will do
;;; for now; move to initargs of process-run sometime...

#+allegro
(push '(*package* find-package :kpml) excl:*cl-default-special-bindings*)

(defvar *FRAME-PROCESS-ALIST*       nil 
  "Provides mapping from frames to their processes")

;;; ----------------------------------------------------------------------
(defvar *ROOT*                       nil)
(defvar *ROOT-GI*                    nil)
(defvar *ROOT-GENERATION*            nil)
(defvar *INSPECTOR*                  nil)
(defvar *STRUCTURE-GRAPHER*          nil)

(defvar *SAY-PROCESS*                nil)
(defvar *STRUCTURE-PROCESS*          nil)

(defvar *MONOCHROME?*                T)

(defvar *DISPLAY-STRUCTURES*         nil)
(defvar *OL-BRACKETTING*             "(")
(defvar *OR-BRACKETTING*             ")")
(defvar kpml::STRING-BRACKETTING     T)

;;; Additional variables for smaller windows are:
(defvar *MENU-FRAME*       nil "for the menu and interaction window")
(defvar *GI-FRAME*         nil "for general output")
(defvar *GENERATION-FRAME* nil "for system traversal information")
(defvar *EXTRAS-FRAME*     nil "for miscellaneous...")

;;; ... and those for the processes:
(defvar *GENERATION-INFO-PROCESS* nil)
(defvar *MENU-PROCESS*            nil)
(defvar *GI-PROCESS*              nil)

;;; ... and a flag for the distributed small screen case:
(defvar *DISTRIBUTED-WINDOWS*     nil)

(defvar *STRUCTURE-GRAPH-WIDTH*   600)
(defvar	*STRUCTURE-GRAPH-HEIGHT*  325)
(defvar *RESOURCE-GRAPH-WIDTH*    1100)
(defvar *RESOURCE-GRAPH-HEIGHT*   600)

;;; ... toggles whether the generate sentence menu shows desired
;;; results, actual results, or nothing...
(defvar *EXAMPLE-DISPLAY-DESIRED-MODE* :target)

;;; ... toggles whether just the examples for a given language
;;; are shown or all examples
(defvar *EXAMPLE-OFFERS-LANGUAGE-RESTRICTED* t)
(defvar *EXAMPLE-AUTO-CREATION*              nil)
(defvar KPML-INTERFACE-COMMAND-TABLE         nil)
(defvar *HARDCOPY-STRUCTURE-ORIENTATION*     :vertical
  "orientation selection of structure graphs")
(defvar *ONE-GENERATION-PER-GRAPH-SEMAPHOR*  nil)

(defvar *SMALL-GRAPH*  t)
(defvar *BIG-GRAPH*    t)
(defvar *MODE-COMMAND* nil)
(defvar *DEBUG-MODE*   nil)
(defvar *AUTO-PRINT*   nil)
(defvar *GRAPHICAL-TRAVERSAL*)
(defvar *GRAPHICAL-START-PTS*)

(defvar *CUMULATIVE-DISPLAY-FLAG-OPTIONS*
    '(:hubs :id :formal-parameters))
(defvar *CUMULATIVE-DISPLAY-FLAGS* '(:hubs :formal-parameters))
(defvar *CUMULATIVE-GH-FRAME*      nil)

(defvar *RESET-GENERATION-HISTORY-EACH-GENERATION* T)

(defvar *TRAV-GRAPH-COUNT-FLAG* T 
  "If set, nodes get numbered in traversal graphs")

;;; Basic support for structuring use of extensions...
(defvar *KPML-TOOL-LIST* nil)

(defvar *INDIRECT-RELOAD-FILENAME* nil)

(defvar *SHOW-SPL-ON-GENERATION* nil)

;;; 4.0 minor additions

(defvar *concept-info-as-popups?* T "Concept definitions popup in concept graphs")


;;; 3.0 fix the position of popup dialogues and confirmation boxes...
;;;     following brings them up right of center at the top on a
;;;     1024x768 screen. May conditionalize for screens.
(defvar *CONFIRMATION-POPUPS-XY* '(350 30))

;;; Curious characters in ACL5+ treatment in the self-built window
;;; buttons when running under Windows98, OK under NT...
(defvar +launch-dev-window-label+
  #-allegro
  "                  Launch Development Windows                    "
  #+allegro 
  (:version-case (":ALLEGRO-V")
   ((- "5.0")
    "                  Launch Development Windows                    ")
   ((+ "4.9")
        "Launch Development Windows")))

;;; ----------------------------------------------------------------------
;;; Some macro odds and ends...

(defmacro DIALOG-END-SPACING ()
  '(loop for i from 1 to 4 do (format stream "  ")(kpml-i-terpri stream)))

(defmacro REGISTER-KPML-TOOL (label starter)
  `(pushnew '(,label :value (,starter))
	    kpml-i::*kpml-tool-list*
	    :test #'equal))

