Sha256: 68ec4a65e04d424b66aef689312a78c52836143fae47e03ad81cf7669de7ba43

Contents?: true

Size: 1.16 KB

Versions: 30

Compression:

Stored size: 1.16 KB

Contents

#include "reflex/ruby/image_view.h"


#include <rays/ruby/point.h>
#include "reflex/ruby/view.h"
#include "defs.h"


RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Reflex::ImageView)

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

#define CHECK     RUCY_CHECK_OBJECT(Reflex::ImageView, self)

#define CALL(fun) RUCY_WRAPPER_CALL(Reflex::ImageView, THIS, fun)


static
VALUE alloc(VALUE klass)
{
	return value(new Reflex::RubyView<Reflex::ImageView>, klass);
}

static
VALUE get_image(VALUE self)
{
	CHECK;
	Rays::Image image = THIS->get_image();
	return image ? value(image) : nil();
}

static
VALUE set_image(VALUE self, VALUE image)
{
	CHECK;
	THIS->set_image(image ? to<Rays::Image&>(image) : Rays::Image());
	return image;
}


static Class cImageView;

void
Init_reflex_image_view ()
{
	Module mReflex = rb_define_module("Reflex");

	cImageView = mReflex.define_class("ImageView", Reflex::view_class());
	rb_define_alloc_func(cImageView, alloc);
	rb_define_private_method(cImageView, "set_image", RUBY_METHOD_FUNC(set_image), 1);
	rb_define_method(cImageView, "image", RUBY_METHOD_FUNC(get_image), 0);
}


namespace Reflex
{


	Class
	image_view_class ()
	{
		return cImageView;
	}


}// Reflex

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
reflexion-0.2.1 .doc/ext/reflex/image_view.cpp
reflexion-0.2 .doc/ext/reflex/image_view.cpp
reflexion-0.1.57 .doc/ext/reflex/image_view.cpp
reflexion-0.1.56 .doc/ext/reflex/image_view.cpp
reflexion-0.1.55 .doc/ext/reflex/image_view.cpp
reflexion-0.1.54 .doc/ext/reflex/image_view.cpp
reflexion-0.1.53 .doc/ext/reflex/image_view.cpp
reflexion-0.1.52 .doc/ext/reflex/image_view.cpp
reflexion-0.1.51 .doc/ext/reflex/image_view.cpp
reflexion-0.1.50 .doc/ext/reflex/image_view.cpp
reflexion-0.1.49 .doc/ext/reflex/image_view.cpp
reflexion-0.1.48 .doc/ext/reflex/image_view.cpp
reflexion-0.1.47 .doc/ext/reflex/image_view.cpp
reflexion-0.1.46 .doc/ext/reflex/image_view.cpp
reflexion-0.1.45 .doc/ext/reflex/image_view.cpp
reflexion-0.1.44 .doc/ext/reflex/image_view.cpp
reflexion-0.1.43 .doc/ext/reflex/image_view.cpp
reflexion-0.1.42 .doc/ext/reflex/image_view.cpp
reflexion-0.1.41 .doc/ext/reflex/image_view.cpp
reflexion-0.1.40 .doc/ext/reflex/image_view.cpp