module Cairo - cairo-1.12.9 Documentation

# module Cairo

### Constants

BINDINGS_VERSION
BUILD_VERSION
MAJOR_VERSION
MICRO_VERSION
MINOR_VERSION
VERSION
WIN32Surface

### Public Class Methods

satisfied_version?(*args) click to toggle source

    static VALUE
    rb_cairo_satisfied_version (int argc, VALUE *argv, VALUE self)
    {
      VALUE major, minor, micro;

      rb_scan_args (argc, argv, "21", &major, &minor, &micro);

      if (NIL_P (micro))
        micro = UINT2NUM (0);

      return CBOOL2RVAL (CAIRO_VERSION_MAJOR > NUM2UINT(major) ||
                         (CAIRO_VERSION_MAJOR == NUM2UINT(major) &&
                          CAIRO_VERSION_MINOR > NUM2UINT(minor)) ||
                         (CAIRO_VERSION_MAJOR == NUM2UINT(major) &&
                          CAIRO_VERSION_MINOR == NUM2UINT(minor) &&
                          CAIRO_VERSION_MICRO >= NUM2UINT(micro)));
    }

### Public Instance Methods

__add_one_arg_setter(klass) click to toggle source

    # File lib/cairo.rb, line 22
    def __add_one_arg_setter(klass)
      names = klass.instance_methods(false)
      names.each do |name|
        if /^set_(.*)/ =~ name and
            not names.include? "#{$1}=" and
            klass.instance_method(name).arity == 1
          klass.module_eval("def #{$1}=(val); set_#{$1}(val); val; end")
        end
      end
    end

bindings_version() click to toggle source

    # File lib/cairo.rb, line 54
    def bindings_version
      major, minor, micro, tag = BINDINGS_VERSION
      version = [major, minor, micro].join('.')
      version << "-#{tag}" if tag
      version
    end

exit_application(exception, status) click to toggle source

    # File lib/cairo.rb, line 61
    def exit_application(exception, status)
      puts("#{exception.class}: #{exception}")
      puts(exception.backtrace)
      exit(status)
    end

normalize_const_name(name) click to toggle source

    # File lib/cairo.rb, line 33
    def normalize_const_name(name)
      name.to_s.upcase.gsub(/[\s\-_.]+/, "_")
    end