;; -*-theme-d-*-

;; Copyright (C) 2015 Tommi Höynälänmaa

(define-interface (gnome gobject)

  (import (standard-library core))

  ;; Maybe the superclass should be <gobject>.
  (define-normal-goops-class <gvalue> <gvalue> <object> #t #f #f)

  (define-normal-goops-class <gobject> <gobject> <object> #t #f #f)

  (define-normal-goops-class <gclosure> <gclosure> <gobject> #t #f #f)

  (define-normal-goops-class <gsignal> <gsignal> <gobject> #t #f #f)

  (define-normal-goops-class <gtype> <gtype> <gobject> #t #f #f)

  (define-normal-goops-class <giochannel> <giochannel> <gobject> #t #f #f)

  (define <signal-handler> (:procedure ((rest <object>)) <object> nonpure))
 
  (define-normal-goops-class <gboxed-scm> <gboxed-scm> <object> #t #f #f)

  (define-normal-goops-class <gboolean> <gboolean> <gvalue> #f #f #f)

  (define-normal-goops-class <guint> <guint> <gvalue> #f #f #f)

  (define-normal-goops-class <gchararray> <gchararray> <gvalue> #t #f #f)

  (declare make-gboolean (:simple-proc (<boolean>) <gboolean> pure))

  (declare gvalue->scm (:simple-proc (<gvalue>) <object> pure))

  (declare gobject-set-property (:simple-proc (<gobject> <symbol> <object>)
					      <none>
					      nonpure))

  (declare gtype-instance-signal-connect
	   (:simple-proc (<gobject> <symbol> <signal-handler>) <integer>
			 nonpure))
  
  (declare gtype-instance-signal-emit
	   (:simple-proc (<gobject> <symbol> <list>) <none>
			 nonpure))

  (declare-method connect
		  (:simple-proc (<gobject> <symbol> <signal-handler>)
				<integer>
				nonpure))

  (declare-method emit
		  (:simple-proc (<gobject> <symbol> <list>)
				<none>
				nonpure)))