Sha256: e809a1d834012789fb91d3103f9a18cbbcc5e005cc756c8ebe72233c7f0fde30

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

#include "reflex/ruby/shape.h"


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


RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(REFLEX_EXPORT, 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_reflex_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

5 entries across 5 versions & 1 rubygems

Version Path
reflexion-0.3.4 ext/reflex/polygon_shape.cpp
reflexion-0.3.3 ext/reflex/polygon_shape.cpp
reflexion-0.3.2 ext/reflex/polygon_shape.cpp
reflexion-0.3.1 ext/reflex/polygon_shape.cpp
reflexion-0.3 ext/reflex/polygon_shape.cpp