Module: Cairo::SVGVersion

Defined in:
lib/cairo.rb,
ext/cairo/rb_cairo_constants.c

Constant Summary collapse

VERSION_1_1 =
INT2FIX (CAIRO_SVG_VERSION_1_1)
VERSION_1_2 =
INT2FIX (CAIRO_SVG_VERSION_1_2)

Class Method Summary collapse

Class Method Details

.listObject



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'ext/cairo/rb_cairo_constants.c', line 247

static VALUE
cr_svg_get_versions (VALUE self)
{
  VALUE rb_versions;
  int i, num_versions;
  cairo_svg_version_t const *versions;

  cairo_svg_get_versions (&versions, &num_versions);

  rb_versions = rb_ary_new2 (num_versions);

  for (i = 0; i < num_versions; i++)
    {
      rb_ary_push (rb_versions, INT2NUM (versions[i]));
    }

  return rb_versions;
}

.nameObject



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'ext/cairo/rb_cairo_constants.c', line 266

static VALUE
cr_svg_version_to_string (int argc, VALUE *argv, VALUE self)
{
  if (argc == 0)
    {
      return rb_call_super (argc, argv);
    }
  else
    {
      VALUE version;
      const char *ver_str;
      rb_scan_args (argc, argv, "1", &version);
      ver_str = cairo_svg_version_to_string (RVAL2CRSVGVERSION(version));
      return rb_str_new2 (ver_str);
    }
}

.namesObject



67
68
69
# File 'lib/cairo.rb', line 67

def names
  list.collect {|version| name(version)}
end