Sha256: db8090f282d6afa0d7184c72bf50bdf863c4a52a77c692b27a7978b38f7e47a0

Contents?: true

Size: 1.13 KB

Versions: 30

Compression:

Stored size: 1.13 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
RUCY_DEF_ALLOC(alloc, klass)
{
	return value(new Reflex::RubyView<Reflex::ImageView>, klass);
}
RUCY_END

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

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


static Class cImageView;

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

	cImageView = mReflex.define_class("ImageView", Reflex::view_class());
	cImageView.define_alloc_func(alloc);
	cImageView.define_private_method("set_image", set_image);
	cImageView.define_method(            "image", get_image);
}


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 ext/reflex/image_view.cpp
reflexion-0.2 ext/reflex/image_view.cpp
reflexion-0.1.57 ext/reflex/image_view.cpp
reflexion-0.1.56 ext/reflex/image_view.cpp
reflexion-0.1.55 ext/reflex/image_view.cpp
reflexion-0.1.54 ext/reflex/image_view.cpp
reflexion-0.1.53 ext/reflex/image_view.cpp
reflexion-0.1.52 ext/reflex/image_view.cpp
reflexion-0.1.51 ext/reflex/image_view.cpp
reflexion-0.1.50 ext/reflex/image_view.cpp
reflexion-0.1.49 ext/reflex/image_view.cpp
reflexion-0.1.48 ext/reflex/image_view.cpp
reflexion-0.1.47 ext/reflex/image_view.cpp
reflexion-0.1.46 ext/reflex/image_view.cpp
reflexion-0.1.45 ext/reflex/image_view.cpp
reflexion-0.1.44 ext/reflex/image_view.cpp
reflexion-0.1.43 ext/reflex/image_view.cpp
reflexion-0.1.42 ext/reflex/image_view.cpp
reflexion-0.1.41 ext/reflex/image_view.cpp
reflexion-0.1.40 ext/reflex/image_view.cpp