source: trunk/source/cocoa-ide/defsystem.lisp @ 13027

Last change on this file since 13027 was 13027, checked in by greg, 10 years ago

Initial commit of a project window for the IDE. You can open a project with (gui::make-project-window :project), where :project is the name of an ASDF system.

File size: 3.2 KB
Line 
1;;-*-Mode: LISP; Package: CCL -*-
2;;;
3;;;   Copyright (C) 2007 Clozure Associates
4;;;
5
6(in-package "CCL")
7
8(eval-when (:compile-toplevel :execute)
9  (use-interface-dir :cocoa))
10
11;; These are used to communicate with ide-bundle, which must be loaded before objc-support.
12;; They are defvar'ed so the caller can set them before loading us.
13(defvar *cocoa-application-path* nil)
14(defvar *cocoa-application-copy-headers-p* nil)
15(require "IDE-BUNDLE")
16
17(require "OBJC-SUPPORT")
18
19(defpackage "GUI"
20  (:use :common-lisp :ccl)
21  (:import-from
22   "CCL"
23   ;; symbols defined here
24   *cocoa-application-path*
25   *cocoa-application-copy-headers-p*
26   load-ide
27   build-ide
28   ;; Misc symbols that perhaps should be exported from CCL but currently aren't.
29   report-bad-arg
30   native-translated-namestring
31   make-id-map
32   assign-id-map-id
33   id-map-free-object
34   process-thread
35   process-serial-number
36   ensure-directory-pathname
37   recursive-copy-directory
38   application
39   ;; Symbols that perhaps should be exported by ObjC support but aren't
40   @selector
41   *nsapp*
42   with-nsstr
43   %make-nsstring
44   lisp-string-from-nsstring
45   with-autorelease-pool
46   ns-height
47   ns-width
48   *cocoa-event-process*
49   create-autorelease-pool
50   release-autorelease-pool
51   release-canonical-nsobject
52   objc-message-send
53   open-main-bundle
54   )
55  (:export
56   "ABSTRACT-NS-LISP-STRING"
57   "NS-LISP-STRING"
58   "NS-LISP-STRING-STRING"
59
60   "EXECUTE-IN-GUI"
61   ))
62
63(defparameter *ide-files*
64  '(;"ide-bundle" - loaded by hand above
65    "cocoa-utils"
66    "cocoa-defaults"
67    "cocoa-prefs"
68    "cocoa-typeout"
69    "console-window"
70    "cocoa-window"
71    "cocoa-doc"
72    "compile-hemlock"
73    "hemlock"  ;; treated specially below, compile-hemlock must come before.
74    "cocoa-editor"
75    "cocoa-listener"
76    "cocoa-grep"
77    "cocoa-backtrace"
78    "inspector"
79    "project"
80    "preferences"
81    "processes-window"
82    "apropos-window"
83    "xapropos"
84    "file-dialogs"
85    "app-delegate"
86    "ide-self-update"
87    "search-files"
88    "start"
89    ))
90
91(defparameter *leopard-only-ide-files*
92  '("xinspector"
93    ))
94
95(defun load-ide (&optional force-compile)
96  (declare (special *hemlock-files*)) ;; kludge
97  (let ((src-dir "ccl:cocoa-ide;")
98        (bin-dir "ccl:cocoa-ide;fasls;"))
99    (ensure-directories-exist bin-dir)
100    ;; kludge to limit experimental files to Leopard
101    #+darwin-target
102    (rlet ((p :int))
103      (#_Gestalt #$gestaltSystemVersion p)
104      (when (>= (%get-long p) #x1050)
105        (setq *ide-files* (append *ide-files* *leopard-only-ide-files*))))
106    (with-compilation-unit ()
107      (dolist (name *ide-files*)
108        (let* ((source (make-pathname :name name :type (pathname-type *.lisp-pathname*)
109                                      :defaults src-dir))
110               (fasl (make-pathname :name name :type (pathname-type *.fasl-pathname*)
111                                    :defaults bin-dir))
112               (sources (cons source
113                              (and (equalp name "hemlock")
114                                   ;; This is defined in compile-hemlock, which is loaded first
115                                   (mapcar #'hemlock-source-pathname *hemlock-files*)))))
116          (if (needs-compile-p fasl sources force-compile)
117            (progn
118              ;; Once compile something, keep compiling, in case macros changed.
119              (setq force-compile t)
120              (compile-file source :output-file fasl :verbose t :load t))
121            (load fasl :verbose t)))))
122    (provide "COCOA")))
Note: See TracBrowser for help on using the repository browser.