;; cairo.ffi				-*- Scheme -*-

;; Copyright (C) 2018 Matthew R. Wette
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
;; License as published by the Free Software Foundation; either
;; version 3 of the License, or (at your option) any later version.
;;
;; This library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with this library; if not, see <http://www.gnu.org/licenses/>

(define-ffi-module (ffi cairo)
  #:pkg-config "cairo"
  #:include '("cairo.h"
	      ;;"cairo-ft.h"
	      ;;"cairo-gobject.h"
	      "cairo-pdf.h"
	      ;;"cairo-ps.h"
	      ;;"cairo-quartz-image.h"
	      ;;"cairo-quartz.h"
	      "cairo-svg.h"
	      ;;"cairo-tee.h"
	      ;;"cairo-xml.h"
	      )
  ;;#:renamer (lambda (name)
  ;;            (string-map (lambda (c) (if (char=? c #\_) #\- c)) name))
  #:export (M_PI M_2PI make-cairo-unit-matrix)
  )

(define-public cairo_raster_source_acquire_func_t*-desc
  (fh:pointer  cairo_raster_source_acquire_func_t-desc))
(define-fh-pointer-type cairo_raster_source_acquire_func_t*
  cairo_raster_source_acquire_func_t*-desc
  cairo_raster_source_acquire_func_t*?
  make-cairo_raster_source_acquire_func_t*)
(export cairo_raster_source_acquire_func_t*
	cairo_raster_source_acquire_func_t*?
	make-cairo_raster_source_acquire_func_t*)
(fh-ref<=>deref! cairo_raster_source_acquire_func_t*
	      make-cairo_raster_source_acquire_func_t*
	      cairo_raster_source_acquire_func_t
	      make-cairo_raster_source_acquire_func_t)

(define-public cairo_raster_source_release_func_t*-desc
  (fh:pointer  cairo_raster_source_release_func_t-desc))
(define-fh-pointer-type cairo_raster_source_release_func_t*
  cairo_raster_source_release_func_t*-desc
  cairo_raster_source_release_func_t*?
  make-cairo_raster_source_release_func_t*)
(export cairo_raster_source_release_func_t*
	cairo_raster_source_release_func_t*?
	make-cairo_raster_source_release_func_t*)
(fh-ref<=>deref! cairo_raster_source_release_func_t*
		 make-cairo_raster_source_release_func_t*
		 cairo_raster_source_release_func_t
		 make-cairo_raster_source_release_func_t)

(define M_PI 3.14159265358979323846)
(define M_2PI 6.283185307179586)

(define (make-cairo-unit-matrix)
  (make-cairo_matrix_t #(1.0 0.0 0.0 1.0 0.0 0.0)))

;; --- last line ---
