Sha256: 1f2a9f80d61584af36e03536ca1c44f1db7d00702f25f4bfd70f597ca2f8dd17

Contents?: true

Size: 663 Bytes

Versions: 30

Compression:

Stored size: 663 Bytes

Contents

#include <cairo_callbacks.h>

cairo_status_t cairoSvgSurfaceCallback (void *closure, const unsigned char *data, unsigned int length)
{
  VALUE self = (VALUE) closure;
  if (rb_iv_get(self, "@svg") == Qnil) {
    rb_iv_set(self, "@svg", rb_str_new2(""));
  }

  rb_str_cat(rb_iv_get(self, "@svg"), data, length);

  return CAIRO_STATUS_SUCCESS;
}

cairo_status_t cairoPngSurfaceCallback (void *closure, const unsigned char *data, unsigned int length)
{
  VALUE self = (VALUE) closure;
  if (rb_iv_get(self, "@png") == Qnil) {
    rb_iv_set(self, "@png", rb_str_new2(""));
  }

  rb_str_cat(rb_iv_get(self, "@png"), data, length);

  return CAIRO_STATUS_SUCCESS;
}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mathematical-1.6.20 ext/mathematical/cairo_callbacks.c
mathematical-1.6.18 ext/mathematical/cairo_callbacks.c
mathematical-1.6.17 ext/mathematical/cairo_callbacks.c
mathematical-1.6.14 ext/mathematical/cairo_callbacks.c
mathematical-1.6.13 ext/mathematical/cairo_callbacks.c
mathematical-1.6.12 ext/mathematical/cairo_callbacks.c
mathematical-1.6.11 ext/mathematical/cairo_callbacks.c
mathematical-1.6.10 ext/mathematical/cairo_callbacks.c
mathematical-1.6.9 ext/mathematical/cairo_callbacks.c
mathematical-1.6.8 ext/mathematical/cairo_callbacks.c
mathematical-1.6.7 ext/mathematical/cairo_callbacks.c
mathematical-1.6.6 ext/mathematical/cairo_callbacks.c
mathematical-1.6.5 ext/mathematical/cairo_callbacks.c
mathematical-1.6.4 ext/mathematical/cairo_callbacks.c
mathematical-1.6.3 ext/mathematical/cairo_callbacks.c
mathematical-1.6.2 ext/mathematical/cairo_callbacks.c
mathematical-1.6.1 ext/mathematical/cairo_callbacks.c
mathematical-1.6.0 ext/mathematical/cairo_callbacks.c
mathematical-1.5.12 ext/mathematical/cairo_callbacks.c
mathematical-1.5.0 ext/mathematical/cairo_callbacks.c