Sha256: b65715cf85110682e28def8bffa9e3651249cd8c3d9e70420609f934d8dbd477

Contents?: true

Size: 1.04 KB

Versions: 16

Compression:

Stored size: 1.04 KB

Contents

#include "reflex/ruby/shape.h"


#include "rays/ruby/polygon.h"
#include "defs.h"


RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Reflex::PolygonShape)

#define THIS      to<Reflex::PolygonShape*>(self)

#define CHECK     RUCY_CHECK_OBJ(Reflex::PolygonShape, self)

#define CALL(fun) RUCY_CALL_SUPER(THIS, fun)


static
RUCY_DEF_ALLOC(alloc, klass)
{
	return value(new Reflex::RubyShape<Reflex::PolygonShape>, klass);
}
RUCY_END

static
RUCY_DEF1(set_polygon, polygon)
{
	CHECK;

	THIS->set_polygon(to<Rays::Polygon&>(polygon));
	return polygon;
}
RUCY_END

static
RUCY_DEF0(get_polygon)
{
	CHECK;
	return value(THIS->polygon());
}
RUCY_END


static Class cPolygonShape;

void
Init_polygon_shape ()
{
	Module mReflex = define_module("Reflex");

	cPolygonShape = mReflex.define_class("PolygonShape", Reflex::shape_class());
	cPolygonShape.define_alloc_func(alloc);
	cPolygonShape.define_method("polygon=", set_polygon);
	cPolygonShape.define_method("polygon",  get_polygon);
}


namespace Reflex
{


	Class
	polygon_shape_class ()
	{
		return cPolygonShape;
	}


}// Reflex

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
reflexion-0.1.29 ext/reflex/polygon_shape.cpp
reflexion-0.1.28 ext/reflex/polygon_shape.cpp
reflexion-0.1.27 ext/reflex/polygon_shape.cpp
reflexion-0.1.26 ext/reflex/polygon_shape.cpp
reflexion-0.1.25 ext/reflex/polygon_shape.cpp
reflexion-0.1.24 ext/reflex/polygon_shape.cpp
reflexion-0.1.23 ext/reflex/polygon_shape.cpp
reflexion-0.1.22 ext/reflex/polygon_shape.cpp
reflexion-0.1.21 ext/reflex/polygon_shape.cpp
reflexion-0.1.20 ext/reflex/polygon_shape.cpp
reflexion-0.1.19 ext/reflex/polygon_shape.cpp
reflexion-0.1.17 ext/reflex/polygon_shape.cpp
reflexion-0.1.16 ext/reflex/polygon_shape.cpp
reflexion-0.1.15 ext/reflex/polygon_shape.cpp
reflexion-0.1.14 ext/reflex/polygon_shape.cpp
reflexion-0.1.13 ext/reflex/polygon_shape.cpp