source: trunk/ccl/examples/addressbook.lisp @ 5864

Last change on this file since 5864 was 5864, checked in by gb, 13 years ago

Change the initialization code a bit.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1;;; This code is adapted from the webkit example and with help
2;;; from Richard Cook and Gary Byers on the OpenMCL list.
3
4(in-package ccl)
5
6;;; We need to be able to point the CoreFoundation and Cocoa libraries
7;;; at some bundle very early in the process.  If you want to use some
8;;; other bundle path, you may need to change the call to FAKE-CFBUNDLE-PATH
9;;; below.
10
11#+darwin-target
12(progn
13  (require "FAKE-CFBUNDLE-PATH")
14  (fake-cfbundle-path "ccl:OpenMCL.app;Contents;MacOS;dppccl"))
15
16
17(eval-when (:compile-toplevel :load-toplevel :execute)
18  (require "OBJC-SUPPORT")
19  (augment-objc-interfaces :addressbook))
20
21(let* ((checked-for-addressbook nil)
22       (addressbook-loaded nil))
23  (defun reset-checked-for-addressbook ()
24    (setq checked-for-addressbook nil
25          addressbook-loaded nil))
26  (defun check-for-addressbook ()
27    (if checked-for-addressbook
28      addressbook-loaded
29      (setq checked-for-addressbook t
30            addressbook-loaded (load-objc-extension-framework "AddressBook")))))
31
32(defun require-addressbook () 
33  (or (check-for-addressbook)
34      (error "The AddressBook framework doesn't seem to be installed on this machine.")))
35
36(eval-when (:compile-toplevel :load-toplevel :execute)
37  (require-addressbook))
Note: See TracBrowser for help on using the repository browser.