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