Dear All,

For my small visualization project I need the functions
cairo-get-matrix and cairo-set-matrix. The cairo_matrix_t type is
defined in cairo.sdl as shown below:

(define-foreign-type cairo_matrix_t (c-pointer "cairo_matrix_t")
  values
  (cut tag-pointer <> 'cairo-matrix))

cairo-get-matrix expects a cairo_matrix_t pointer as shown below, but
I couldn't figure out how to create such a type. Is it correct that
define-foreign-type registers the type with CHICKEN's type system, but
does not create a constructor?

(define cairo-get-matrix
  (foreign-lambda void "cairo_get_matrix" cairo_t cairo_matrix_t))

For now I worked around it by using the code below. Is this correct
chickenwise? Is there a better solution?

(define cairo-get-matrix
  (foreign-lambda* cairo_matrix_t ((cairo_t ct))
                   "cairo_matrix_t cmt;
                    cairo_get_matrix(ct, &cmt);
                    C_return(&cmt);"))


Thanks in advance!
Markus

_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to