Sha256: c1ac228791944046445737b745987d2fbc9a128faa7c82c50aee73f86368c49b
Contents?: true
Size: 1.85 KB
Versions: 2
Compression:
Stored size: 1.85 KB
Contents
#include "reflex/ruby/event.h" #include "reflex/ruby/view.h" #include "defs.h" RUCY_DEFINE_VALUE_FROM_TO(Reflex::FocusEvent) #define THIS to<Reflex::FocusEvent*>(self) #define CHECK RUCY_CHECK_OBJ(Reflex::FocusEvent, self) static VALUE alloc(VALUE klass) { return new_type<Reflex::FocusEvent>(klass); } static VALUE initialize(VALUE self, VALUE type, VALUE current, VALUE last) { CHECK; THIS->type = (Reflex::FocusEvent::Type) to<uint>(type); THIS->current = to<Reflex::View*>(current); THIS->last = to<Reflex::View*>(last); return rb_call_super(0, NULL); } static VALUE initialize_copy(VALUE self, VALUE obj) { CHECK; *THIS = to<Reflex::FocusEvent&>(obj); return self; } static VALUE get_type(VALUE self) { CHECK; return value(THIS->type); } static VALUE get_current(VALUE self) { CHECK; return THIS->current ? value(THIS->current) : nil(); } static VALUE get_last(VALUE self) { CHECK; return THIS->last ? value(THIS->last) : nil(); } static Class cFocusEvent; void Init_focus_event () { Module mReflex = rb_define_module("Reflex"); cFocusEvent = mReflex.define_class("FocusEvent", Reflex::event_class()); rb_define_alloc_func(cFocusEvent, alloc); rb_define_private_method(cFocusEvent, "initialize", RUBY_METHOD_FUNC(initialize), 3); rb_define_private_method(cFocusEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1); rb_define_method(cFocusEvent, "type", RUBY_METHOD_FUNC(get_type), 0); rb_define_method(cFocusEvent, "current", RUBY_METHOD_FUNC(get_current), 0); rb_define_method(cFocusEvent, "last", RUBY_METHOD_FUNC(get_last), 0); cFocusEvent.define_const("TYPE_NONE", Reflex::FocusEvent::NONE); cFocusEvent.define_const("TYPE_FOCUS", Reflex::FocusEvent::FOCUS); cFocusEvent.define_const("TYPE_BLUR", Reflex::FocusEvent::BLUR); } namespace Reflex { Class focus_event_class () { return cFocusEvent; } }// Reflex
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
reflexion-0.1.23 | .doc/ext/reflex/focus_event.cpp |
reflexion-0.1.22 | .doc/ext/reflex/focus_event.cpp |