Sha256: 26b8ba0cc71fab2fb2d6866db02da4920de74e8d05d005ef4e19f640c9eb90b9
Contents?: true
Size: 1.22 KB
Versions: 3
Compression:
Stored size: 1.22 KB
Contents
#include "reflex/ruby/event.h" #include "rays/ruby/point.h" #include "defs.h" RUCY_DEFINE_VALUE_FROM_TO(Reflex::MotionEvent) #define THIS to<Reflex::MotionEvent*>(self) #define CHECK RUCY_CHECK_OBJ(Reflex::MotionEvent, self) static RUCY_DEF_ALLOC(alloc, klass) { return new_type<Reflex::MotionEvent>(klass); } RUCY_END static RUCY_DEFN(initialize) { CHECK; check_arg_count(__FILE__, __LINE__, "MotionEvent#initialize", argc, 0, 1); if (argc >= 1) THIS->gravity = to<Rays::Point>(argv[0]); return rb_call_super(0, NULL); } RUCY_END static RUCY_DEF1(initialize_copy, obj) { CHECK; *THIS = to<Reflex::MotionEvent&>(obj); return self; } RUCY_END static RUCY_DEF0(gravity) { CHECK; return value(THIS->gravity); } RUCY_END static Class cMotionEvent; void Init_motion_event () { Module mReflex = define_module("Reflex"); cMotionEvent = mReflex.define_class("MotionEvent", Reflex::event_class()); cMotionEvent.define_alloc_func(alloc); cMotionEvent.define_private_method("initialize", initialize); cMotionEvent.define_private_method("initialize_copy", initialize_copy); cMotionEvent.define_method("gravity", gravity); } namespace Reflex { Class motion_event_class () { return cMotionEvent; } }// Reflex
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
reflexion-0.1.15 | ext/reflex/motion_event.cpp |
reflexion-0.1.14 | ext/reflex/motion_event.cpp |
reflexion-0.1.13 | ext/reflex/motion_event.cpp |