;;; -*- Mode: Lisp -*- #|CLARITY: Common Lisp Data Alignment Repository Copyright (c) 2006 Samantha Kleinberg All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA contact: Samantha AT Bioinformatics DOT nyu DOT edu 715 Broadway, 10th floor New York, NY 10003|# (in-package "CLARITY") (eval-when (:compile-toplevel :load-toplevel :execute) (require "sql") (require "odbc")) #.(sql:enable-sql-reader-syntax) ;;; Environment setting functions. (defun setup-clarity-logical-pathnames () (let* ((command (first system:*line-arguments-list*)) (executable-location (make-pathname :name nil :type nil :defaults (pathname command))) ) (setf (logical-pathname-translations "CLARITY") `(("*.*" ,(make-pathname :name :wild :type :wild :defaults executable-location)) ("*.*.*" ,(make-pathname :name :wild :type :wild :version :wild :defaults executable-location)) ("**;*.*" ,(merge-pathnames (make-pathname :name :wild :type :wild :directory (list :relative :wild-inferiors)) executable-location)) ("**;*.*.*" ,(merge-pathnames (make-pathname :name :wild :type :wild :version :wild :directory (list :relative :wild-inferiors)) executable-location)) ) ))) ;;; Startup functions. (defvar *clarity-init-file* (make-pathname :name ".clarity-init" :type nil :defaults (user-homedir-pathname))) (defvar *clarity-init-file-dos* (make-pathname :name "_clarity-init" :type nil :defaults (user-homedir-pathname))) (defun start-clarity-gui (&key(init-file (list *clarity-init-file* *clarity-init-file-dos*)) data-file (reset-logical-pathnames-p t) ) (flet ((load-init-file (init-file) (let ((*package* (find-package "CLARITY"))) (load init-file :print nil :verbose nil :if-does-not-exist nil))) ) (etypecase init-file (list (some #'load-init-file init-file)) ((or string pathname) (load-init-file init-file))) (capi:display-message "Starting CLARITY.") (clarity:make-clarity-handle) (clarity:connect clarity::*current-clarity-handle* (clarity::start-setup-interface)) (capi:display-message "DBS connected.") (let ((gui (make-instance 'clarity-interface :clarity-handle clarity::*current-clarity-handle*))) (capi:display gui) (when reset-logical-pathnames-p (setup-clarity-logical-pathnames)) (capi:execute-with-interface gui (lambda () (etypecase init-file (list (some #'load-init-file init-file)) ((or string pathname) (load-init-file init-file))) (when reset-logical-pathnames-p (setup-clarity-logical-pathnames)) )) (when data-file (load data-file :print nil :verbose nil)) gui))) #.(sql:disable-sql-reader-syntax) ;;; end of file -- start-gui.lisp --