LMFL#!C(:PADDED T :HOST "SYS" :BACKUP-DATE 2773681952. :SYSTEM-TYPE :LOGICAL :VERSION 7. :TYPE "LISP" :NAME "BASIC-DEFS" :DIRECTORY ("REL3-2" "COLOR-MAP-EDITOR") :SOURCE-PATTERN "( :DIRECTORY (\"REL3-2\") :NAME :WILD :TYPE :WILD :VERSION :NEWEST)" :CHARACTERS T :NOT-BACKED-UP T :CREATION-DATE 2770922750. :AUTHOR "REL3-2" :LENGTH-IN-BYTES 6091. :LENGTH-IN-BLOCKS 6. :BYTE-SIZE 8.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ;;; -*- Mode:Common-Lisp; Package:COLOR; Base:10 -*-;;; (C) Texas Instruments May 1987(DEFVAR *color-editor-instance* nil)(DEFVAR *color-selector-command-menu* nil)(DEFVAR *color-selector-command-table* nil)(DEFVAR *color-map-selector* nil)(defvar *mouse-column* nil  "The column whose slide bar the mouse was most recently in (or is in now).")(defvar toggle-flag :background)(defvar doit nil)(defvar margin-choice-list '(("Abort" nil tv::multiple-choice-abort nil nil) ("Do It" (setq doit t))))(defparameter *system-default* (tv:copy-color-map (tv:create-color-map)))   (defparameter *color-map-pathname* (make-pathname :host "lm"  :directory '("color-maps")  :name :wild  :type :wild  :version :newest))(defparameter *models-assoc-alist* '((:RGB (:RED   1 "R" 255)                                           (:GREEN 2 "G" 255)                                           (:BLUE  3 "B" 255))                                     (:HSV (:HUE        1 "H" 360)                                           (:SATURATION 2 "S" 1.0)                                           (:VALUE      3 "V" 1.0)))    "Association list of the form (:model-name (:col1-name col1-label col1-range) (:col2 ...) (:col3 ...))")(DEFUN range-of-model-column (model-name column-name)  (FOURTH (ASSOC column-name (REST (ASSOC model-name *Models-Assoc-AList*)))))(DEFUN title-of-model-column (model-name column-name)  (THIRD (ASSOC column-name (REST (ASSOC model-name *Models-Assoc-Alist*)))))(DEFUN column-of-model-column (model-name column-name)  (SECOND (ASSOC column-name (REST (ASSOC model-name *Models-Assoc-Alist*)))))(DEFUN col-n-color-of-model (n model-name)  "Returns the color-name of the nth column (1, 2, or 3) for model MODEL-NAME"  (FIRST (NTH n (ASSOC model-name *Models-Assoc-Alist*))))(DEFUN make-name (side-name name)  (INTERN (CONCATENATE 'STRING side-name name ) 'color))(DEFUN  find-frame-coordinates (&optional (size-x 400) (size-y 400))  "This function finds the coordinates of the color editor window.  It is assumed that the left top corner of the window corresponds to   where the mouse is positioned.  The right bottom corner of the window  is computed by using the  default value of the width and hieght of the  color editor.  If mouse is positioned in a way that the right bottom of  the color editor window falls ouside of the main window, then the color  editor window is positioned in the lower right side of the screen."  (LET* ((x1 w:mouse-x) (y1 w:mouse-y) (x2 (+ x1 size-x )) (y2 (+ y1 size-y )) max-x max-y)    (MULTIPLE-VALUE-SETQ (max-x max-y) (SEND w:default-screen :inside-size))    (WHEN (> x2 max-x)      (SETQ x2 max-x x1 (- x2 size-x)))    (WHEN (> y2 max-y)      (SETQ y2 max-y y1 (- y2 size-y)))    (list x1 y1 x2 y2)))(DEFSTRUCT column            up-arrow  slide-bar  down-arrow  numeric-readout)(DEFFLAVOR basic-color-pane ((current-position 0) range     column  model parent pane-type side     (io-buffer nil))      (w:borders-mixin    w:minimum-window    w:label-mixin)  (:documentation :basic "The flavor that is shared by slide-bar, arrow-pane, and                      readout panes.")  (:settable-instance-variables)  (:default-init-plist    :column nil    :model nil    :parent nil    :pane-type nil    :side nil))(DEFFLAVOR help-flavor ()   (w:truncating-pop-up-text-window-with-reset)  (:default-init-plist    :font-map '(fonts:tr12b)    :blinker-p nil    :label nil))(defparameter *help-window*(make-instance 'help-flavor       :width 610       :height 520))(defparameter *color-map-display-help*"                                 Color Map Display Help  The Color Map Display shows all the colors in the current color map. Click  the mouse on a location in the display to edit that color in the Color Map   Editor. Other operations can be performed by selecting a command from the   menu. Brief descriptions of menu commands are as follows:  * Copy Color - Copy the color of one slot to another.  * Exchange Colors - Exchange the colors of two specified slots.  * Ramp Colors - Evenly distribute the RGB values of two selected colors     among the slots between those colors in the color map.   * Get Map of Window - Display the color map of a window specified with     the mouse.  * Select Color Map - Display a previously loaded color map.  * Save Color Map - Save the current color map to a specified filename.   * Load Color Map - Load a color map from disk and display it.  * Create New Map - Create a new color map with a defaulted color table. ")(DEFPARAMETER *color-editor-help*"                                  Color Map Editor Help  The Color Map Editor (CME) provides a variety of ways to alter individual  colors in a color map. The mouse can be used on a slide bar to adjust its  level, on a numeric readout to select it for keyboard input, or on an  arrow pane to do continuous or precision adjustment of a column's value.  Position the mouse over a pane to see its mouse documentation. Other  operations can be performed  by selecting commands from the menu. Brief  descriptions of menu commands are as follows:  * Display Color Map - Activate the Color Map Display, showing the color    map of the current window. The mouse is used to select a color to edit     or to execute a command from the Color Map Display command menu.   * Screen Object - Allow editing of a color selected from the screen by a    left mouse click.   * Toggle Edit Contrast - Switch between editing the colors of the foreground     (inner) and background (outer) rectangles of the color display pane.      * Undo - Reset the color being edited to the value it had upon selection.  * Reset Map - Reset the current color map to the value it had when the CME    was most recently exposed. Changes made in previous editing sessions will     not be discarded.  * Install Map - Cause the current color map to be installed in a window     specified by a left mouse click.")