[cairo-commit] rcairo/packages/cairo/ext gen-Cairo.c, NONE, 1.1 gen-CairoMatrix.c, NONE, 1.1 gen-CairoSurface.c, NONE, 1.1 gen-constants.c, NONE, 1.1

OEyvind Kolaas commit at pdx.freedesktop.org
Wed Sep 1 08:31:07 PDT 2004


Committed by: pippin

Update of /cvs/cairo/rcairo/packages/cairo/ext
In directory gabe:/tmp/cvs-serv31784

Added Files:
	gen-Cairo.c gen-CairoMatrix.c gen-CairoSurface.c 
	gen-constants.c 
Log Message:
for now, added automatically generated files to make it possible to install directly
on the long term,. the autogenerated files should disappear and all aspects of cairo
should be mapped by custom functions, this will allow a tighter coupling with the
ruby language as well.


--- NEW FILE: gen-Cairo.c ---
/* ruby-cairo - Ruby bindings for Cairo.
 * Copyright (C) 2003 Evan Martin <martine at danga.com>
 *
 * vim: tabstop=4 shiftwidth=4 noexpandtab :
 */

/* this file was autogenerated by gen.rb, available in the ruby-cairo cvs. */

#include "rbcairo.h"

static VALUE
rcairo_set_target_surface(VALUE self, VALUE surface) {
	cairo_set_target_surface(rcairo_get_cairo(self), rsurface_get_surface(surface));
	return Qnil;
}
static VALUE
rcairo_set_operator(VALUE self, VALUE op) {
	cairo_set_operator(rcairo_get_cairo(self), NUM2INT(op));
	return Qnil;
}
static VALUE
rcairo_set_rgb_color(VALUE self, VALUE red, VALUE green, VALUE blue) {
	cairo_set_rgb_color(rcairo_get_cairo(self), NUM2DBL(red), NUM2DBL(green), NUM2DBL(blue));
	return Qnil;
}
static VALUE
rcairo_set_alpha(VALUE self, VALUE alpha) {
	cairo_set_alpha(rcairo_get_cairo(self), NUM2DBL(alpha));
	return Qnil;
}
static VALUE
rcairo_set_tolerance(VALUE self, VALUE tolerance) {
	cairo_set_tolerance(rcairo_get_cairo(self), NUM2DBL(tolerance));
	return Qnil;
}
static VALUE
rcairo_set_fill_rule(VALUE self, VALUE fill_rule) {
	cairo_set_fill_rule(rcairo_get_cairo(self), NUM2INT(fill_rule));
	return Qnil;
}
static VALUE
rcairo_set_line_width(VALUE self, VALUE width) {
	cairo_set_line_width(rcairo_get_cairo(self), NUM2DBL(width));
	return Qnil;
}
static VALUE
rcairo_set_line_cap(VALUE self, VALUE line_cap) {
	cairo_set_line_cap(rcairo_get_cairo(self), NUM2INT(line_cap));
	return Qnil;
}
static VALUE
rcairo_set_line_join(VALUE self, VALUE line_join) {
	cairo_set_line_join(rcairo_get_cairo(self), NUM2INT(line_join));
	return Qnil;
}
static VALUE
rcairo_set_miter_limit(VALUE self, VALUE limit) {
	cairo_set_miter_limit(rcairo_get_cairo(self), NUM2DBL(limit));
	return Qnil;
}
static VALUE
rcairo_set_matrix(VALUE self, VALUE matrix) {
	cairo_set_matrix(rcairo_get_cairo(self), rmatrix_get_matrix(matrix));
	return Qnil;
}

static VALUE
rcairo_current_operator(VALUE self) {
	return INT2FIX(cairo_current_operator(rcairo_get_cairo(self)));
}
static VALUE
rcairo_current_alpha(VALUE self) {
	return rb_float_new(cairo_current_alpha(rcairo_get_cairo(self)));
}
static VALUE
rcairo_current_tolerance(VALUE self) {
	return rb_float_new(cairo_current_tolerance(rcairo_get_cairo(self)));
}
static VALUE
rcairo_current_fill_rule(VALUE self) {
	return INT2FIX(cairo_current_fill_rule(rcairo_get_cairo(self)));
}
static VALUE
rcairo_current_line_width(VALUE self) {
	return rb_float_new(cairo_current_line_width(rcairo_get_cairo(self)));
}
static VALUE
rcairo_current_line_cap(VALUE self) {
	return INT2FIX(cairo_current_line_cap(rcairo_get_cairo(self)));
}
static VALUE
rcairo_current_line_join(VALUE self) {
	return INT2FIX(cairo_current_line_join(rcairo_get_cairo(self)));
}
static VALUE
rcairo_current_miter_limit(VALUE self) {
	return rb_float_new(cairo_current_miter_limit(rcairo_get_cairo(self)));
}
static VALUE
rcairo_current_target_surface(VALUE self) {
	return rsurface_new_from(cairo_current_target_surface(rcairo_get_cairo(self)));
}
static VALUE
rcairo_status(VALUE self) {
	return INT2FIX(cairo_status(rcairo_get_cairo(self)));
}
static VALUE
rcairo_status_string(VALUE self) {
	return rb_str_new2(cairo_status_string(rcairo_get_cairo(self)));
}

static VALUE
rcairo_save(VALUE self) {
	cairo_save(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_restore(VALUE self) {
	cairo_restore(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_translate(VALUE self, VALUE tx, VALUE ty) {
	cairo_translate(rcairo_get_cairo(self), NUM2DBL(tx), NUM2DBL(ty));
	return Qnil;
}
static VALUE
rcairo_scale(VALUE self, VALUE sx, VALUE sy) {
	cairo_scale(rcairo_get_cairo(self), NUM2DBL(sx), NUM2DBL(sy));
	return Qnil;
}
static VALUE
rcairo_rotate(VALUE self, VALUE angle) {
	cairo_rotate(rcairo_get_cairo(self), NUM2DBL(angle));
	return Qnil;
}
static VALUE
rcairo_concat_matrix(VALUE self, VALUE matrix) {
	cairo_concat_matrix(rcairo_get_cairo(self), rmatrix_get_matrix(matrix));
	return Qnil;
}
static VALUE
rcairo_default_matrix(VALUE self) {
	cairo_default_matrix(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_identity_matrix(VALUE self) {
	cairo_identity_matrix(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_new_path(VALUE self) {
	cairo_new_path(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_move_to(VALUE self, VALUE x, VALUE y) {
	cairo_move_to(rcairo_get_cairo(self), NUM2DBL(x), NUM2DBL(y));
	return Qnil;
}
static VALUE
rcairo_line_to(VALUE self, VALUE x, VALUE y) {
	cairo_line_to(rcairo_get_cairo(self), NUM2DBL(x), NUM2DBL(y));
	return Qnil;
}
static VALUE
rcairo_curve_to(VALUE self, VALUE x1, VALUE y1, VALUE x2, VALUE y2, VALUE x3, VALUE y3) {
	cairo_curve_to(rcairo_get_cairo(self), NUM2DBL(x1), NUM2DBL(y1), NUM2DBL(x2), NUM2DBL(y2), NUM2DBL(x3), NUM2DBL(y3));
	return Qnil;
}
static VALUE
rcairo_arc(VALUE self, VALUE xc, VALUE yc, VALUE radius, VALUE angle1, VALUE angle2) {
	cairo_arc(rcairo_get_cairo(self), NUM2DBL(xc), NUM2DBL(yc), NUM2DBL(radius), NUM2DBL(angle1), NUM2DBL(angle2));
	return Qnil;
}
static VALUE
rcairo_arc_negative(VALUE self, VALUE xc, VALUE yc, VALUE radius, VALUE angle1, VALUE angle2) {
	cairo_arc_negative(rcairo_get_cairo(self), NUM2DBL(xc), NUM2DBL(yc), NUM2DBL(radius), NUM2DBL(angle1), NUM2DBL(angle2));
	return Qnil;
}
static VALUE
rcairo_rel_move_to(VALUE self, VALUE dx, VALUE dy) {
	cairo_rel_move_to(rcairo_get_cairo(self), NUM2DBL(dx), NUM2DBL(dy));
	return Qnil;
}
static VALUE
rcairo_rel_line_to(VALUE self, VALUE dx, VALUE dy) {
	cairo_rel_line_to(rcairo_get_cairo(self), NUM2DBL(dx), NUM2DBL(dy));
	return Qnil;
}
static VALUE
rcairo_rel_curve_to(VALUE self, VALUE dx1, VALUE dy1, VALUE dx2, VALUE dy2, VALUE dx3, VALUE dy3) {
	cairo_rel_curve_to(rcairo_get_cairo(self), NUM2DBL(dx1), NUM2DBL(dy1), NUM2DBL(dx2), NUM2DBL(dy2), NUM2DBL(dx3), NUM2DBL(dy3));
	return Qnil;
}
static VALUE
rcairo_rectangle(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) {
	cairo_rectangle(rcairo_get_cairo(self), NUM2DBL(x), NUM2DBL(y), NUM2DBL(width), NUM2DBL(height));
	return Qnil;
}
static VALUE
rcairo_close_path(VALUE self) {
	cairo_close_path(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_copy_page(VALUE self) {
	cairo_copy_page(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_show_page(VALUE self) {
	cairo_show_page(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_init_clip(VALUE self) {
	cairo_init_clip(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_clip(VALUE self) {
	cairo_clip(rcairo_get_cairo(self));
	return Qnil;
}
static VALUE
rcairo_select_font(VALUE self, VALUE family, VALUE slant, VALUE weight) {
	cairo_select_font(rcairo_get_cairo(self), STR2CSTR(family), NUM2INT(slant), NUM2INT(weight));
	return Qnil;
}
static VALUE
rcairo_scale_font(VALUE self, VALUE scale) {
	cairo_scale_font(rcairo_get_cairo(self), NUM2DBL(scale));
	return Qnil;
}
static VALUE
rcairo_transform_font(VALUE self, VALUE matrix) {
	cairo_transform_font(rcairo_get_cairo(self), rmatrix_get_matrix(matrix));
	return Qnil;
}
static VALUE
rcairo_show_text(VALUE self, VALUE utf8) {
	cairo_show_text(rcairo_get_cairo(self), STR2CSTR(utf8));
	return Qnil;
}
static VALUE
rcairo_text_path(VALUE self, VALUE utf8) {
	cairo_text_path(rcairo_get_cairo(self), STR2CSTR(utf8));
	return Qnil;
}
static VALUE
rcairo_show_surface(VALUE self, VALUE surface, VALUE width, VALUE height) {
	cairo_show_surface(rcairo_get_cairo(self), rsurface_get_surface(surface), FIX2INT(width), FIX2INT(height));
	return Qnil;
}
static VALUE
rcairo_current_matrix(VALUE self, VALUE matrix) {
	cairo_current_matrix(rcairo_get_cairo(self), rmatrix_get_matrix(matrix));
	return Qnil;
}

VALUE gen_Cairo(void) {
	cCairo = rb_define_class_under(mCairo, "Cairo", rb_cObject);
	rb_define_method(cCairo, "save", rcairo_save, 0);
	rb_define_method(cCairo, "restore", rcairo_restore, 0);
	rb_define_method(cCairo, "translate", rcairo_translate, 2);
	rb_define_method(cCairo, "scale", rcairo_scale, 2);
	rb_define_method(cCairo, "rotate", rcairo_rotate, 1);
	rb_define_method(cCairo, "concat_matrix", rcairo_concat_matrix, 1);
	rb_define_method(cCairo, "default_matrix", rcairo_default_matrix, 0);
	rb_define_method(cCairo, "identity_matrix", rcairo_identity_matrix, 0);
	rb_define_method(cCairo, "new_path", rcairo_new_path, 0);
	rb_define_method(cCairo, "move_to", rcairo_move_to, 2);
	rb_define_method(cCairo, "line_to", rcairo_line_to, 2);
	rb_define_method(cCairo, "curve_to", rcairo_curve_to, 6);
	rb_define_method(cCairo, "arc", rcairo_arc, 5);
	rb_define_method(cCairo, "arc_negative", rcairo_arc_negative, 5);
	rb_define_method(cCairo, "rel_move_to", rcairo_rel_move_to, 2);
	rb_define_method(cCairo, "rel_line_to", rcairo_rel_line_to, 2);
	rb_define_method(cCairo, "rel_curve_to", rcairo_rel_curve_to, 6);
	rb_define_method(cCairo, "rectangle", rcairo_rectangle, 4);
	rb_define_method(cCairo, "close_path", rcairo_close_path, 0);
	rb_define_method(cCairo, "copy_page", rcairo_copy_page, 0);
	rb_define_method(cCairo, "show_page", rcairo_show_page, 0);
	rb_define_method(cCairo, "init_clip", rcairo_init_clip, 0);
	rb_define_method(cCairo, "clip", rcairo_clip, 0);
	rb_define_method(cCairo, "select_font", rcairo_select_font, 3);
	rb_define_method(cCairo, "scale_font", rcairo_scale_font, 1);
	rb_define_method(cCairo, "transform_font", rcairo_transform_font, 1);
	rb_define_method(cCairo, "show_text", rcairo_show_text, 1);
	rb_define_method(cCairo, "text_path", rcairo_text_path, 1);
	rb_define_method(cCairo, "show_surface", rcairo_show_surface, 3);
	rb_define_method(cCairo, "current_matrix", rcairo_current_matrix, 1);
	rb_define_method(cCairo, "set_target_surface", rcairo_set_target_surface, 1);
	rb_define_method(cCairo, "target_surface=", rcairo_set_target_surface, 1);
	rb_define_method(cCairo, "set_operator", rcairo_set_operator, 1);
	rb_define_method(cCairo, "operator=", rcairo_set_operator, 1);
	rb_define_method(cCairo, "set_rgb_color", rcairo_set_rgb_color, 3);
	rb_define_method(cCairo, "set_alpha", rcairo_set_alpha, 1);
	rb_define_method(cCairo, "alpha=", rcairo_set_alpha, 1);
	rb_define_method(cCairo, "set_tolerance", rcairo_set_tolerance, 1);
	rb_define_method(cCairo, "tolerance=", rcairo_set_tolerance, 1);
	rb_define_method(cCairo, "set_fill_rule", rcairo_set_fill_rule, 1);
	rb_define_method(cCairo, "fill_rule=", rcairo_set_fill_rule, 1);
	rb_define_method(cCairo, "set_line_width", rcairo_set_line_width, 1);
	rb_define_method(cCairo, "line_width=", rcairo_set_line_width, 1);
	rb_define_method(cCairo, "set_line_cap", rcairo_set_line_cap, 1);
	rb_define_method(cCairo, "line_cap=", rcairo_set_line_cap, 1);
	rb_define_method(cCairo, "set_line_join", rcairo_set_line_join, 1);
	rb_define_method(cCairo, "line_join=", rcairo_set_line_join, 1);
	rb_define_method(cCairo, "set_miter_limit", rcairo_set_miter_limit, 1);
	rb_define_method(cCairo, "miter_limit=", rcairo_set_miter_limit, 1);
	rb_define_method(cCairo, "set_matrix", rcairo_set_matrix, 1);
	rb_define_method(cCairo, "matrix=", rcairo_set_matrix, 1);
	rb_define_method(cCairo, "operator", rcairo_current_operator, 0);
	rb_define_method(cCairo, "alpha", rcairo_current_alpha, 0);
	rb_define_method(cCairo, "tolerance", rcairo_current_tolerance, 0);
	rb_define_method(cCairo, "fill_rule", rcairo_current_fill_rule, 0);
	rb_define_method(cCairo, "line_width", rcairo_current_line_width, 0);
	rb_define_method(cCairo, "line_cap", rcairo_current_line_cap, 0);
	rb_define_method(cCairo, "line_join", rcairo_current_line_join, 0);
	rb_define_method(cCairo, "miter_limit", rcairo_current_miter_limit, 0);
	rb_define_method(cCairo, "target_surface", rcairo_current_target_surface, 0);
	rb_define_method(cCairo, "status", rcairo_status, 0);
	rb_define_method(cCairo, "status_string", rcairo_status_string, 0);
	return cCairo;
}

--- NEW FILE: gen-CairoMatrix.c ---
/* ruby-cairo - Ruby bindings for Cairo.
 * Copyright (C) 2003 Evan Martin <martine at danga.com>
 *
 * vim: tabstop=4 shiftwidth=4 noexpandtab :
 */

/* this file was autogenerated by gen.rb, available in the ruby-cairo cvs. */

#include "rbcairo.h"

static VALUE
rcairo_matrix_set_affine(VALUE self, VALUE a, VALUE b, VALUE c, VALUE d, VALUE tx, VALUE ty) {
	cairo_matrix_set_affine(rmatrix_get_matrix(self), NUM2DBL(a), NUM2DBL(b), NUM2DBL(c), NUM2DBL(d), NUM2DBL(tx), NUM2DBL(ty));
	return Qnil;
}

static VALUE
rcairo_matrix_set_identity(VALUE self) {
	return INT2FIX(cairo_matrix_set_identity(rmatrix_get_matrix(self)));
}
static VALUE
rcairo_matrix_invert(VALUE self) {
	return INT2FIX(cairo_matrix_invert(rmatrix_get_matrix(self)));
}


VALUE gen_CairoMatrix(void) {
	cCairoMatrix = rb_define_class_under(mCairo, "Matrix", rb_cObject);
	rb_define_method(cCairoMatrix, "set_affine", rcairo_matrix_set_affine, 6);
	rb_define_method(cCairoMatrix, "set_identity", rcairo_matrix_set_identity, 0);
	rb_define_method(cCairoMatrix, "invert", rcairo_matrix_invert, 0);
	return cCairoMatrix;
}

--- NEW FILE: gen-CairoSurface.c ---
/* ruby-cairo - Ruby bindings for Cairo.
 * Copyright (C) 2003 Evan Martin <martine at danga.com>
 *
 * vim: tabstop=4 shiftwidth=4 noexpandtab :
 */

/* this file was autogenerated by gen.rb, available in the ruby-cairo cvs. */

#include "rbcairo.h"

static VALUE
rcairo_surface_set_repeat(VALUE self, VALUE repeat) {
	cairo_surface_set_repeat(rsurface_get_surface(self), FIX2INT(repeat));
	return Qnil;
}
static VALUE
rcairo_surface_set_matrix(VALUE self, VALUE matrix) {
	cairo_surface_set_matrix(rsurface_get_surface(self), rmatrix_get_matrix(matrix));
	return Qnil;
}
static VALUE
rcairo_surface_set_filter(VALUE self, VALUE filter) {
	cairo_surface_set_filter(rsurface_get_surface(self), NUM2INT(filter));
	return Qnil;
}

static VALUE
rcairo_surface_get_filter(VALUE self) {
	return INT2FIX(cairo_surface_get_filter(rsurface_get_surface(self)));
}


VALUE gen_CairoSurface(void) {
	cCairoSurface = rb_define_class_under(mCairo, "Surface", rb_cObject);
	rb_define_method(cCairoSurface, "set_repeat", rcairo_surface_set_repeat, 1);
	rb_define_method(cCairoSurface, "repeat=", rcairo_surface_set_repeat, 1);
	rb_define_method(cCairoSurface, "set_matrix", rcairo_surface_set_matrix, 1);
	rb_define_method(cCairoSurface, "matrix=", rcairo_surface_set_matrix, 1);
	rb_define_method(cCairoSurface, "set_filter", rcairo_surface_set_filter, 1);
	rb_define_method(cCairoSurface, "filter=", rcairo_surface_set_filter, 1);
	rb_define_method(cCairoSurface, "filter", rcairo_surface_get_filter, 0);
	return cCairoSurface;
}

--- NEW FILE: gen-constants.c ---
/* ruby-cairo - Ruby bindings for Cairo.
 * Copyright (C) 2003 Evan Martin <martine at danga.com>
 *
 * vim: tabstop=4 shiftwidth=4 noexpandtab :
 */

/* this file was autogenerated by gen.rb, available in the ruby-cairo cvs. */

#include "rbcairo.h"

static void
init_cairo_fill_rule(void) {
	VALUE mCairoFillRule = rb_define_module_under(mCairo, "FillRule");
	rb_define_const(mCairoFillRule, "WINDING", INT2NUM(CAIRO_FILL_RULE_WINDING));
	rb_define_const(mCairoFillRule, "EVEN_ODD", INT2NUM(CAIRO_FILL_RULE_EVEN_ODD));
}

static void
init_cairo_format(void) {
	VALUE mCairoFormat = rb_define_module_under(mCairo, "Format");
	rb_define_const(mCairoFormat, "ARGB32", INT2NUM(CAIRO_FORMAT_ARGB32));
	rb_define_const(mCairoFormat, "RGB24", INT2NUM(CAIRO_FORMAT_RGB24));
	rb_define_const(mCairoFormat, "A8", INT2NUM(CAIRO_FORMAT_A8));
	rb_define_const(mCairoFormat, "A1", INT2NUM(CAIRO_FORMAT_A1));
}

static void
init_cairo_filter(void) {
	VALUE mCairoFilter = rb_define_module_under(mCairo, "Filter");
	rb_define_const(mCairoFilter, "FAST", INT2NUM(CAIRO_FILTER_FAST));
	rb_define_const(mCairoFilter, "GOOD", INT2NUM(CAIRO_FILTER_GOOD));
	rb_define_const(mCairoFilter, "BEST", INT2NUM(CAIRO_FILTER_BEST));
	rb_define_const(mCairoFilter, "NEAREST", INT2NUM(CAIRO_FILTER_NEAREST));
	rb_define_const(mCairoFilter, "BILINEAR", INT2NUM(CAIRO_FILTER_BILINEAR));
	rb_define_const(mCairoFilter, "GAUSSIAN", INT2NUM(CAIRO_FILTER_GAUSSIAN));
}

static void
init_cairo_status(void) {
	VALUE mCairoStatus = rb_define_module_under(mCairo, "Status");
	rb_define_const(mCairoStatus, "SUCCESS", INT2NUM(CAIRO_STATUS_SUCCESS));
	rb_define_const(mCairoStatus, "NO_MEMORY", INT2NUM(CAIRO_STATUS_NO_MEMORY));
	rb_define_const(mCairoStatus, "INVALID_RESTORE", INT2NUM(CAIRO_STATUS_INVALID_RESTORE));
	rb_define_const(mCairoStatus, "INVALID_POP_GROUP", INT2NUM(CAIRO_STATUS_INVALID_POP_GROUP));
	rb_define_const(mCairoStatus, "NO_CURRENT_POINT", INT2NUM(CAIRO_STATUS_NO_CURRENT_POINT));
	rb_define_const(mCairoStatus, "INVALID_MATRIX", INT2NUM(CAIRO_STATUS_INVALID_MATRIX));
	rb_define_const(mCairoStatus, "NO_TARGET_SURFACE", INT2NUM(CAIRO_STATUS_NO_TARGET_SURFACE));
	rb_define_const(mCairoStatus, "NULL_POINTER", INT2NUM(CAIRO_STATUS_NULL_POINTER));
}

static void
init_cairo_line_join(void) {
	VALUE mCairoLineJoin = rb_define_module_under(mCairo, "LineJoin");
	rb_define_const(mCairoLineJoin, "MITER", INT2NUM(CAIRO_LINE_JOIN_MITER));
	rb_define_const(mCairoLineJoin, "ROUND", INT2NUM(CAIRO_LINE_JOIN_ROUND));
	rb_define_const(mCairoLineJoin, "BEVEL", INT2NUM(CAIRO_LINE_JOIN_BEVEL));
}

static void
init_cairo_line_cap(void) {
	VALUE mCairoLineCap = rb_define_module_under(mCairo, "LineCap");
	rb_define_const(mCairoLineCap, "BUTT", INT2NUM(CAIRO_LINE_CAP_BUTT));
	rb_define_const(mCairoLineCap, "ROUND", INT2NUM(CAIRO_LINE_CAP_ROUND));
	rb_define_const(mCairoLineCap, "SQUARE", INT2NUM(CAIRO_LINE_CAP_SQUARE));
}

static void
init_cairo_operator(void) {
	VALUE mCairoOperator = rb_define_module_under(mCairo, "Operator");
	rb_define_const(mCairoOperator, "CLEAR", INT2NUM(CAIRO_OPERATOR_CLEAR));
	rb_define_const(mCairoOperator, "SRC", INT2NUM(CAIRO_OPERATOR_SRC));
	rb_define_const(mCairoOperator, "DST", INT2NUM(CAIRO_OPERATOR_DST));
	rb_define_const(mCairoOperator, "OVER", INT2NUM(CAIRO_OPERATOR_OVER));
	rb_define_const(mCairoOperator, "OVER_REVERSE", INT2NUM(CAIRO_OPERATOR_OVER_REVERSE));
	rb_define_const(mCairoOperator, "IN", INT2NUM(CAIRO_OPERATOR_IN));
	rb_define_const(mCairoOperator, "IN_REVERSE", INT2NUM(CAIRO_OPERATOR_IN_REVERSE));
	rb_define_const(mCairoOperator, "OUT", INT2NUM(CAIRO_OPERATOR_OUT));
	rb_define_const(mCairoOperator, "OUT_REVERSE", INT2NUM(CAIRO_OPERATOR_OUT_REVERSE));
	rb_define_const(mCairoOperator, "ATOP", INT2NUM(CAIRO_OPERATOR_ATOP));
	rb_define_const(mCairoOperator, "ATOP_REVERSE", INT2NUM(CAIRO_OPERATOR_ATOP_REVERSE));
	rb_define_const(mCairoOperator, "XOR", INT2NUM(CAIRO_OPERATOR_XOR));
	rb_define_const(mCairoOperator, "ADD", INT2NUM(CAIRO_OPERATOR_ADD));
	rb_define_const(mCairoOperator, "SATURATE", INT2NUM(CAIRO_OPERATOR_SATURATE));
}

static void
init_cairo_extend(void) {
	VALUE mCairoExtend = rb_define_module_under(mCairo, "Extend");
	rb_define_const(mCairoExtend, "NONE", INT2NUM(CAIRO_EXTEND_NONE));
	rb_define_const(mCairoExtend, "REPEAT", INT2NUM(CAIRO_EXTEND_REPEAT));
	rb_define_const(mCairoExtend, "REFLECT", INT2NUM(CAIRO_EXTEND_REFLECT));
}

static void
init_cairo_font_weight(void) {
	VALUE mCairoFontWeight = rb_define_module_under(mCairo, "FontWeight");
	rb_define_const(mCairoFontWeight, "NORMAL", INT2NUM(CAIRO_FONT_WEIGHT_NORMAL));
	rb_define_const(mCairoFontWeight, "BOLD", INT2NUM(CAIRO_FONT_WEIGHT_BOLD));
}

static void
init_cairo_font_slant(void) {
	VALUE mCairoFontSlant = rb_define_module_under(mCairo, "FontSlant");
	rb_define_const(mCairoFontSlant, "NORMAL", INT2NUM(CAIRO_FONT_SLANT_NORMAL));
	rb_define_const(mCairoFontSlant, "ITALIC", INT2NUM(CAIRO_FONT_SLANT_ITALIC));
	rb_define_const(mCairoFontSlant, "OBLIQUE", INT2NUM(CAIRO_FONT_SLANT_OBLIQUE));
}


void
constants_init(void) {
	init_cairo_fill_rule();
	init_cairo_format();
	init_cairo_filter();
	init_cairo_status();
	init_cairo_line_join();
	init_cairo_line_cap();
	init_cairo_operator();
	init_cairo_extend();
	init_cairo_font_weight();
	init_cairo_font_slant();
}




More information about the cairo-commit mailing list