;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gdktypes.lisp,v 1.16 2005/03/06 17:26:22 espen Exp $
+;; $Id: gdktypes.lisp,v 1.17 2005/03/11 10:56:56 espen Exp $
(in-package "GDK")
(eval-when (:compile-toplevel :load-toplevel :execute)
(init-types-in-library #.(concatenate 'string
(pkg-config:pkg-variable "gtk+-2.0" "libdir")
- "/libgdk-x11-2.0.so") :prefix ("gdk_" "_gdk_"))
+ "/libgdk-x11-2.0.so") :prefix "gdk_")
(init-types-in-library #.(concatenate 'string
(pkg-config:pkg-variable "gtk+-2.0" "libdir")
"/libgdk_pixbuf-2.0.so") :prefix "gdk_"))
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gboxed.lisp,v 1.17 2005/03/06 17:26:23 espen Exp $
+;; $Id: gboxed.lisp,v 1.18 2005/03/11 10:56:58 espen Exp $
(in-package "GLIB")
,(unless forward-p
slots)
(:metaclass boxed-class)
- (:gtype ,(find-type-init-function type-number))))
+ (:gtype ,(register-type-as type-number))))
(register-derivable-type 'boxed "GBoxed" 'expand-boxed-type)
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: ginterface.lisp,v 1.9 2005/03/06 17:26:23 espen Exp $
+;; $Id: ginterface.lisp,v 1.10 2005/03/11 10:56:58 espen Exp $
(in-package "GLIB")
(defmethod shared-initialize ((class ginterface-class) names &key name gtype)
(declare (ignore names))
- (let ((class-name (or name (class-name class))))
- (unless (find-type-number class-name)
- (register-type class-name
- (or (first gtype) (default-type-init-name class-name)))))
+ (let* ((class-name (or name (class-name class)))
+ (type-number
+ (or
+ (find-type-number class-name)
+ (register-type class-name
+ (or (first gtype) (default-type-init-name class-name))))))
+ (type-default-interface-ref type-number))
(call-next-method))
,(unless forward-p
(slot-definitions class (query-object-interface-properties type) slots))
(:metaclass ginterface-class)
- (:gtype ,(find-type-init-function type)))))
+ (:gtype ,(register-type-as type)))))
(defun ginterface-dependencies (type)
(delete-duplicates
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gobject.lisp,v 1.34 2005/03/06 17:26:23 espen Exp $
+;; $Id: gobject.lisp,v 1.35 2005/03/11 10:56:58 espen Exp $
(in-package "GLIB")
(nreverse properties))))
(defun query-object-class-properties (type &optional inherited-p)
- (let* ((type-number (find-type-number type))
+ (let* ((type-number (find-type-number type t))
(class (type-class-ref type-number)))
(unwind-protect
(multiple-value-bind (array length)
`(,slot-name
:allocation :property :pname ,name
- ,@(cond
- ((find :unbound args) (list :unbound (getf args :unbound))))
+ ,@(when (find :unbound args) (list :unbound (getf args :unbound)))
+ ,@(when (find :getter args) (list :getter (getf args :getter)))
+ ,@(when (find :setter args) (list :setter (getf args :setter)))
;; accessors
,@(cond
(class (type-from-number type))
(slots (getf options :slots)))
`(defclass ,class ,supers
- ,(unless forward-p
- (slot-definitions class (query-object-class-properties type) slots))
- (:metaclass ,metaclass)
- (:gtype ,(find-type-init-function type)))))
+ ,(unless forward-p
+ (slot-definitions class (query-object-class-properties type) slots))
+ (:metaclass ,metaclass)
+ (:gtype ,(register-type-as type)))))
(defun gobject-dependencies (type)
(delete-duplicates
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gtype.lisp,v 1.27 2005/03/06 17:26:23 espen Exp $
+;; $Id: gtype.lisp,v 1.28 2005/03/11 10:56:58 espen Exp $
(in-package "GLIB")
(process-close process)))))
-(defmacro init-types-in-library (filename &key (prefix "") ignore)
+(defmacro init-types-in-library (filename &key prefix ignore)
(let ((names (%find-types-in-library filename prefix ignore)))
`(progn
,@(mapcar #'(lambda (name)
names))))
(defun find-type-init-function (type-number)
- (or
- (loop
- for type-init in *type-initializers*
- when (= type-number (funcall type-init))
- do (return type-init))
- (error "Can't find init function for type number ~D" type-number)))
+ (loop
+ for type-init in *type-initializers*
+ when (= type-number (funcall type-init))
+ do (return type-init)))
+
+(defun register-type-as (type-number)
+ (or
+ (find-type-init-function type-number)
+ (find-foreign-type-name type-number)
+ (error "Unknown type-number: ~A" type-number)))
(defun default-type-init-name (type)
(find-symbol (format nil "~A_~A_get_type"
(let ((name (find-foreign-type-name type-number)))
(register-type
(getf (type-options type-number) :type (default-type-name name))
- (find-type-init-function type-number))))
+ (register-type-as type-number))))
(let ((sorted-type-list (%sort-types-topologicaly type-list)))
`(progn
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gtkobject.lisp,v 1.24 2005/03/06 17:26:23 espen Exp $
+;; $Id: gtkobject.lisp,v 1.25 2005/03/11 10:58:41 espen Exp $
(in-package "GTK")
(eval-when (:compile-toplevel :load-toplevel :execute)
(init-types-in-library
#.(concatenate 'string (pkg-config:pkg-variable "gtk+-2.0" "libdir")
- "/libgtk-x11-2.0.so"))
+ "/libgtk-x11-2.0.so") :prefix "gtk_")
(defclass %object (gobject)
()