1 ;; Common Lisp bindings for GTK+ v2.0
2 ;; Copyright (C) 2000 Espen S. Johnsen <espejohn@online.no>
4 ;; This library is free software; you can redistribute it and/or
5 ;; modify it under the terms of the GNU Lesser General Public
6 ;; License as published by the Free Software Foundation; either
7 ;; version 2 of the License, or (at your option) any later version.
9 ;; This library is distributed in the hope that it will be useful,
10 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;; Lesser General Public License for more details.
14 ;; You should have received a copy of the GNU Lesser General Public
15 ;; License along with this library; if not, write to the Free Software
16 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ;; $Id: gobject.lisp,v 1.1 2000/08/14 16:44:30 espen Exp $
23 (eval-when (:compile-toplevel :load-toplevel :execute)
24 (defclass gobject (gtype)
26 (:metaclass gtype-class)
27 (:alien-name "GObject"))
29 (defclass gobject-class (gtype-class)))
32 ;;;; Methods for gobject
34 ;; Specializing reference-instance and unreference-instance on gobject
35 ;; is not really necessary but done for efficiency
37 (defmethod reference-instance ((object gobject))
41 (defmethod unreference-instance ((object gobject))
42 (%object-unref object))
44 (deftype-method alien-ref gobject (type-spec)
45 (declare (ignore type-spec))
48 (deftype-method alien-unref gobject (type-spec)
49 (declare (ignore type-spec))
52 (define-foreign %object-ref () pointer
53 (object (or gobject pointer)))
55 (define-foreign %object-unref () nil
56 (object (or gobject pointer)))
59 ;; Parameter stuff not yet implemented
61 ; (define-foreign object-set-param () nil
66 ; (define-foreign object-get-param () nil
69 ; (value gvalue :out))
71 ; (define-foreign object-queue-param-changed () nil
77 ;;;; Methods for gobject-class
79 (defmethod shared-initialize ((class gobject-class) names &rest initargs
81 (declare (ignore initargs names))
84 (alien::make-heap-alien-info
85 :type (alien::parse-alien-type '(function (unsigned 32)))
86 :sap-form (system:foreign-symbol-address
89 (default-alien-func-name
91 nil "~A_get_type" (or name (class-name class))))))))))
92 (alien:alien-funcall alien))
96 ; (define-foreign object-class-install-param () nil
99 ; (parameter parameter))
101 ; (define-foreign object-class-find-param-spec () parameter