(in-package :gdk)
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (define-foreign-library gdk
- (:unix (:or "libgdk-x11-2.0.so.0" "libgdk-x11-2.0.so"))
- (:windows "libgdk-win32-2.0-0.dll")
- (t "libgdk-2.0"))
- (define-foreign-library gdk-pixbuf
- (:unix (:or "libgdk_pixbuf-2.0.so.0" "libgdk_pixbuf-2.0.so"))
- (:windows (:or "libgdk_pixbuf-win32-2.0-0" "libgdk_pixbuf-2.0-0.dll"))
- (t "libgdk_pixbuf-2.0")))
+(glib:at-init ()
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library gdk
+ (:unix (:or "libgdk-x11-2.0.so.0" "libgdk-x11-2.0.so"))
+ (:windows "libgdk-win32-2.0-0.dll")
+ (t "libgdk-2.0"))
+ (define-foreign-library gdk-pixbuf
+ (:unix (:or "libgdk_pixbuf-2.0.so.0" "libgdk_pixbuf-2.0.so"))
+ (:windows (:or "libgdk_pixbuf-win32-2.0-0" "libgdk_pixbuf-2.0-0.dll"))
+ (t "libgdk_pixbuf-2.0")))
-(use-foreign-library gdk)
-(use-foreign-library gdk-pixbuf)
\ No newline at end of file
+ (use-foreign-library gdk)
+ (use-foreign-library gdk-pixbuf))
\ No newline at end of file
(defmacro at-finalize ((&rest keys) &body body)
`(register-finalizer (list ,@keys ',body) (lambda () ,@body)))
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (define-foreign-library glib
- (:unix (:or "libglib-2.0.so.0" "libglib-2.0.so"))
- (:windows "libglib-2.0-0.dll")
- (t (:default "libglib-2.0"))))
-
-(use-foreign-library glib)
-
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (define-foreign-library gthread
- (:unix (:or "libgthread-2.0.so.0" "libgthread-2.0.so"))
- (:windows "libgthread-2.0-0.dll")
- (t "libgthread-2.0")))
-
-(use-foreign-library gthread)
+(at-init ()
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library glib
+ (:unix (:or "libglib-2.0.so.0" "libglib-2.0.so"))
+ (:windows "libglib-2.0-0.dll")
+ (t (:default "libglib-2.0"))))
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library gthread
+ (:unix (:or "libgthread-2.0.so.0" "libgthread-2.0.so"))
+ (:windows "libgthread-2.0-0.dll")
+ (t "libgthread-2.0")))
+
+ (use-foreign-library glib)
+ (use-foreign-library gthread))
;;
;; Glib Fundamentals
(defpackage :cl-gtk2-init
- (:use :cl))
+ (:use :cl :glib))
(in-package :cl-gtk2-init)
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (cffi:define-foreign-library gobject
- (:unix (:or "libgobject-2.0.so.0" "libgobject-2.0.so"))
- (:windows "libgobject-2.0-0.dll")
- (t "libgobject-2.0")))
+(at-init ()
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (cffi:define-foreign-library gobject
+ (:unix (:or "libgobject-2.0.so.0" "libgobject-2.0.so"))
+ (:windows "libgobject-2.0-0.dll")
+ (t "libgobject-2.0")))
-(cffi:use-foreign-library gobject)
+ (cffi:use-foreign-library gobject))
(in-package :gtkglext)
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (define-foreign-library gtkglext
- (:unix (:or "libgtkglext-x11-1.0.so.0" "libgtkglext-x11-1.0.so"))
- (:windows "libgtkglext-win32-1.0-0.dll")
- (t (:default "libgtkglext-1.0")))
- (define-foreign-library gdkglext
- (:unix (:or "libgdkglext-x11-1.0.so.0" "libgdkglext-x11-1.0.so"))
- (:windows "libgdkglext-win32-1.0-0.dll")
- (t (:default "libgdkglext-1.0"))))
+(at-init ()
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library gtkglext
+ (:unix (:or "libgtkglext-x11-1.0.so.0" "libgtkglext-x11-1.0.so"))
+ (:windows "libgtkglext-win32-1.0-0.dll")
+ (t (:default "libgtkglext-1.0")))
+ (define-foreign-library gdkglext
+ (:unix (:or "libgdkglext-x11-1.0.so.0" "libgdkglext-x11-1.0.so"))
+ (:windows "libgdkglext-win32-1.0-0.dll")
+ (t (:default "libgdkglext-1.0"))))
-(use-foreign-library gtkglext)
-(use-foreign-library gdkglext)
+ (use-foreign-library gtkglext)
+ (use-foreign-library gdkglext))
(in-package :gtk)
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (define-foreign-library gtk
- (:unix (:or "libgtk-x11-2.0.so.0" "libgtk-x11-2.0.so"))
- (:windows (:or "libgtk-2.0-0.dll" "libgtk-win32-2.0-0.dll"))
- (t "libgtk-2.0")))
+(at-init ()
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library gtk
+ (:unix (:or "libgtk-x11-2.0.so.0" "libgtk-x11-2.0.so"))
+ (:windows (:or "libgtk-2.0-0.dll" "libgtk-win32-2.0-0.dll"))
+ (t "libgtk-2.0")))
-(use-foreign-library gtk)
+ (use-foreign-library gtk))
#+sbcl (when (and (find-package "SB-EXT")
(find-symbol "SET-FLOATING-POINT-MODES" (find-package "SB-EXT")))
(in-package :pango)
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (define-foreign-library pango
- (:unix "libpango-1.0.so.0")
- (:windows "libpango-1.0-0.dll")
- (t (:default "libgpango-1.0"))))
+(glib:at-init ()
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library pango
+ (:unix "libpango-1.0.so.0")
+ (:windows "libpango-1.0-0.dll")
+ (t (:default "libgpango-1.0"))))
-(use-foreign-library pango)
+ (use-foreign-library pango))