anchor.diff:  ;; 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.7 2001-01-28 14:11:20 espen Exp $
  +;; $Id: gtype.lisp,v 1.8 2001-04-29 20:17:07 espen Exp $
   
   (in-package "GLIB")
   
  
positive.code: (setf (alien-type-name 'unsigned-int) "guint")
  (setf (alien-type-name 'long) "glong")
  (setf (alien-type-name 'unsigned-long) "gulong")
  (setf (alien-type-name 'enum) "GEnum")
  (setf (alien-type-name 'flags) "GFlags")
  (setf (alien-type-name 'single-float) "gfloat")
  (setf (alien-type-name 'double-float) "gdouble")
  (setf (alien-type-name 'string) "gstring")
  (setf (find-type-number 'fixnum) (find-type-number 'int))
  
negative.code: 
  (deftype type-number () '(unsigned 32))
  
  (eval-when (:compile-toplevel :load-toplevel :execute)
    (defclass type-query (alien-structure)
      ((type-number :allocation :alien :type type-number)
       (name :allocation :alien :type string)
       (class-size :allocation :alien :type unsigned-int)
       (instance-size :allocation :alien :type unsigned-int))
      (:metaclass proxy-class)))
  
  
  (defbinding ("g_type_name" alien-type-name) (type) (static string)
    ((find-type-number type) type-number))
  
  (defbinding %type-from-name () type-number
    (name string))
  
  (defbinding type-parent () type-number
    (type type-number))
  
  (defbinding %type-query () nil
    (type type-number)
    (query type-query))
  
  (defun type-query (type)
    (let ((query (make-instance 'type-query)))
      (%type-query (find-type-number type) query)
      query))
  
  (defun type-instance-size (type)
    (slot-value (type-query type) 'instance-size))
  
  (defun type-class-size (type)
    (slot-value (type-query type) 'class-size))
  
  (defbinding type-class-ref () pointer
    (type type-number))
  
  (defbinding type-class-unref () nil
    (type type-number))
  
  (defbinding type-class-peek () pointer
    (type type-number))
  
  (defbinding type-create-instance (type) pointer
    ((find-type-number type) type-number))
  
  (defbinding type-free-instance () nil
    (instance pointer))
  
  
  