anchor.diff:     (width :accessor width :initarg :width :initform 0)
      (height :accessor height :initarg :height :initform 0)
      (operation :accessor operation :initarg :operation :initform nil)))
  -
  -#|
  -(defclass wl-region ()
  -  ((->region :accessor ->region :initarg :->region :initform nil)
  -   (rects :accessor rects :initarg :rects :initform nil)))
  -|#
   
   (defclass isurface ()
     ((x :accessor x :initarg :x :initform 0.0)
  
positive.code:   (let ((client (find-if (lambda (client)
  			   (cffi:pointer-eq (->client client) client-ptr))
  			 *clients*)))
      ;;(format t "GET-CLIENT! Client found: ~A~%" client)
      (if client
  	client
  	(let ((new-client (make-instance 'wl-client :->client client-ptr)))
  
negative.code: 			,@(apply #'concatenate 'list (mapcar (lambda (x)
  							       `(,(first x) (cffi:callback ,(second x))))
  							     impls)))))
         (defun ,make-fn (client version id &key (resource (cffi:null-pointer) supplied) (delete-fn (cffi:callback empty-delete-function)) (implementation? t))
  	 (when (not ,impl)
  	   (setf ,impl (,impl-fn
  			,@(apply #'concatenate 'list (mapcar (lambda (x)
  							       `(,(first x) (cffi:callback ,(second x))))
  							     impls)))))
  	 (if supplied
  	     (make-instance ',name :client client :id id :version version :implementation ,impl :interface ,iface :data (->resource resource) :delete delete-fn :implementation? implementation?)
  	     (make-instance ',name :client client :id id :version version :implementation ,impl :interface ,iface :delete delete-fn  :implementation? implementation?))))))
  
  (defmethod initialize-instance :before ((resource wl-resource) &key client version id implementation interface (data (cffi:null-pointer) supplied) delete implementation?)
    (let* ((resource-ptr (wl-resource-create (->client client) interface version id)))
      (setf (->resource resource) resource-ptr)
      (setf (id resource) id)
      (setf (interface resource) interface)
      (when implementation?
        (setf (implementation resource) implementation)
        (wl-resource-set-implementation resource-ptr
  				      implementation
  				      (if supplied
  					  data
  					  resource-ptr)
  				      delete))
      (setf (client resource) client)
      (push resource (resources client))))
  
  