Sha256: 309461c89e2958f6b3462f34f17a129afc86495d74925c384f2f3975a3ee7101

Contents?: true

Size: 974 Bytes

Versions: 6

Compression:

Stored size: 974 Bytes

Contents

#include "reflex/ruby/event.h"


#include <rucy.h>
#include "defs.h"


using namespace Rucy;


RUCY_DEFINE_VALUE_FROM_TO(Reflex::Event)

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

#define CHECK RUCY_CHECK_OBJ(Reflex::Event, self)


static
RUCY_DEF_ALLOC(alloc, klass)
{
	return new_type<Reflex::Event>(klass);
}
RUCY_END

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

static
RUCY_DEF0(block)
{
	CHECK;
	THIS->block();
}
RUCY_END

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


static Class cEvent;

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

	cEvent = mReflex.define_class("Event");
	cEvent.define_alloc_func(alloc);
	cEvent.define_private_method("initialize_copy", initialize_copy);
	cEvent.define_method("block", block);
	cEvent.define_method("block?", is_blocked);
}


namespace Reflex
{


	Class
	event_class ()
	{
		return cEvent;
	}


}// Reflex

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reflexion-0.1.12 ext/reflex/event.cpp
reflexion-0.1.11 ext/reflex/event.cpp
reflexion-0.1.10 ext/reflex/event.cpp
reflexion-0.1.9.1 ext/reflex/event.cpp
reflexion-0.1.9 ext/reflex/event.cpp
reflexion-0.1.8 ext/reflex/event.cpp