Sha256: 7eaf34ace6cc91333f5bb435d74c551e5b6e7d7c7835e1568fc768f41867dcba

Contents?: true

Size: 1.16 KB

Versions: 21

Compression:

Stored size: 1.16 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_DEF1(initialize, gravity)
{
	CHECK;

	*THIS = Reflex::MotionEvent(to<Rays::Point>(gravity));

	return rb_call_super(0, NULL);
}
RUCY_END

static
RUCY_DEF1(initialize_copy, obj)
{
	CHECK;
	*THIS = to<Reflex::MotionEvent&>(obj).dup();
	return self;
}
RUCY_END

static
RUCY_DEF0(gravity)
{
	CHECK;
	return value(THIS->gravity());
}
RUCY_END


static Class cMotionEvent;

void
Init_reflex_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

21 entries across 21 versions & 1 rubygems

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