Sha256: 3c46ae2c2c1cad3a4e8c7435b1003ef313c5e6a432dfce73222946a372c13f6d
Contents?: true
Size: 1.59 KB
Versions: 5
Compression:
Stored size: 1.59 KB
Contents
#include "reflex/ruby/shape_view.h" #include <rucy.h> using namespace Rucy; using Reflex::coord; RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Reflex::EllipseShape) #define THIS to<Reflex::EllipseShape*>(self) #define CHECK RUCY_CHECK_OBJECT(Reflex::EllipseShape, self) #define CALL(fun) RUCY_WRAPPER_CALL(Reflex::EllipseShape, THIS, fun) static VALUE alloc(VALUE klass) { return value(new Reflex::RubyShapeView<Reflex::EllipseShape>, klass); } static VALUE set_radius_min(VALUE self, VALUE radius) { CHECK; THIS->set_radius_min(radius.as_f(true)); return radius; } static VALUE get_radius_min(VALUE self) { CHECK; return value(THIS->radius_min()); } static VALUE set_nsegment(VALUE self, VALUE nsegment) { CHECK; THIS->set_nsegment(nsegment.as_i(true)); return nsegment; } static VALUE get_nsegment(VALUE self) { CHECK; return value(THIS->nsegment()); } static RUCY_DEF_clear_override_flags(cof, Reflex::EllipseShape); static Class cEllipseShape; void Init_ellipse_shape () { Module mReflex = rb_define_module("Reflex"); cEllipseShape = mReflex.define_class("EllipseShape", Reflex::shape_view_class()); rb_define_alloc_func(cEllipseShape, alloc); rb_define_private_method(cEllipseShape, "radius_min=", RUBY_METHOD_FUNC(set_radius_min), 1); rb_define_method(cEllipseShape, "radius_min", RUBY_METHOD_FUNC(get_radius_min), 0); rb_define_private_method(cEllipseShape, "nsegment=", RUBY_METHOD_FUNC(set_nsegment), 1); rb_define_method(cEllipseShape, "nsegment", RUBY_METHOD_FUNC(get_nsegment), 0); } namespace Reflex { Class ellipse_shape_class () { return cEllipseShape; } }// Reflex
Version data entries
5 entries across 5 versions & 1 rubygems