+(defbinding %pdf-surface-create () pointer
+ (filename pathname)
+ (width double-float)
+ (height double-float))
+
+(defbinding %pdf-surface-create-for-stream (stream width height) pointer
+ (stream-write-func callback)
+ (stream pointer-data)
+ (width double-float)
+ (height double-float))
+
+(defbinding pdf-surface-set-size () nil
+ (surface pdf-surface)
+ (width double-float)
+ (height double-float))
+
+
+;;; PS Surface
+
+(defmethod allocate-foreign ((surface ps-surface)
+ &key filename stream width height)
+ (cond
+ ((and filename stream)
+ (error "Only one of the arguments :filename and :stream may be specified"))
+ (filename (%ps-surface-create filename width height))
+ (stream
+ (let* ((stream-id (register-user-data stream))
+ (location (%ps-surface-create-for-stream stream-id width height)))
+ (%surface-set-user-data location 'stream stream-id)
+ location))))
+
+(defbinding %ps-surface-create () pointer
+ (filename pathname)
+ (width double-float)
+ (height double-float))
+
+(defbinding %ps-surface-create-for-stream (stream width height) pointer
+ (stream-write-func callback)
+ (stream pointer-data)
+ (width double-float)
+ (height double-float))
+
+(defbinding ps-surface-set-size () nil
+ (surface ps-surface)
+ (width double-float)
+ (height double-float))
+
+(defbinding ps-surface-dsc-begin-setup () nil
+ (surface ps-surface))
+
+(defbinding ps-surface-dsc-begin-page-setup () nil
+ (surface ps-surface))
+
+(defbinding ps-surface-dsc-comment () nil
+ (surface ps-surface)
+ (comment string))
+
+
+;;; SVG Surface
+
+(defmethod allocate-foreign ((surface svg-surface)
+ &key filename stream width height)
+ (cond
+ ((and filename stream)
+ (error "Only one of the arguments :filename and :stream may be specified"))
+ (filename (%svg-surface-create filename width height))
+ (stream
+ (let* ((stream-id (register-user-data stream))
+ (location (%svg-surface-create-for-stream stream-id width height)))
+ (%surface-set-user-data location 'stream stream-id)
+ location))))
+
+(defbinding %svg-surface-create () pointer
+ (filename pathname)
+ (width double-float)
+ (height double-float))
+
+(defbinding %svg-surface-create-for-stream (stream width height) pointer
+ (stream-write-func callback)
+ (stream pointer-data)
+ (width double-float)
+ (height double-float))
+
+(defbinding svg-surface-restrict-to-version () nil
+ (surface svg-surface)
+ (version svg-version))