// -*- c++ -*- #pragma once #ifndef __REFLEX_RUBY_WINDOW_H__ #define __REFLEX_RUBY_WINDOW_H__ #include #include #include #include #include namespace Reflex { Rucy::Class window_class (); // class Reflex::Window template class RubyWindow : public Rucy::ClassWrapper { public: RUCY_OVERRIDE_BEGIN(Rucy::ClassWrapper) RUCY_OVERRIDE_ID(on_update) RUCY_OVERRIDE_ID(on_draw) RUCY_OVERRIDE_ID(on_move) RUCY_OVERRIDE_ID(on_resize) RUCY_OVERRIDE_ID(on_key) RUCY_OVERRIDE_ID(on_key_down) RUCY_OVERRIDE_ID(on_key_up) RUCY_OVERRIDE_ID(on_pointer) RUCY_OVERRIDE_ID(on_pointer_down) RUCY_OVERRIDE_ID(on_pointer_up) RUCY_OVERRIDE_ID(on_pointer_move) RUCY_OVERRIDE_ID(on_wheel) RUCY_OVERRIDE_END virtual void on_show (Event* e) { RUCY_SYM(on_show); if (RUCY_IS_OVERRIDABLE()) this->value.call(on_show, Rucy::value(e)); else return Super::on_show(e); } virtual void on_hide (Event* e) { RUCY_SYM(on_hide); if (RUCY_IS_OVERRIDABLE()) this->value.call(on_hide, Rucy::value(e)); else return Super::on_hide(e); } virtual void on_close (Event* e) { RUCY_SYM(on_close); if (RUCY_IS_OVERRIDABLE()) this->value.call(on_close, Rucy::value(e)); else return Super::on_close(e); } virtual void on_update (UpdateEvent* e) { RUCY_SYM(on_update); if (RUCY_IS_OVERRIDDEN(on_update)) this->value.call(on_update, Rucy::value(e)); else Super::on_update(e); } virtual void on_draw (DrawEvent* e) { RUCY_SYM(on_draw); if (RUCY_IS_OVERRIDDEN(on_draw)) this->value.call(on_draw, Rucy::value(e)); else Super::on_draw(e); } virtual void on_move (FrameEvent* e) { RUCY_SYM(on_move); if (RUCY_IS_OVERRIDDEN(on_move)) this->value.call(on_move, Rucy::value(e)); else Super::on_move(e); } virtual void on_resize (FrameEvent* e) { RUCY_SYM(on_resize); if (RUCY_IS_OVERRIDDEN(on_resize)) this->value.call(on_resize, Rucy::value(e)); else Super::on_resize(e); } virtual void on_key (KeyEvent* e) { RUCY_SYM(on_key); if (RUCY_IS_OVERRIDDEN(on_key)) this->value.call(on_key, Rucy::value(e)); else Super::on_key(e); } virtual void on_key_down (KeyEvent* e) { RUCY_SYM(on_key_down); if (RUCY_IS_OVERRIDDEN(on_key_down)) this->value.call(on_key_down, Rucy::value(e)); else Super::on_key_down(e); } virtual void on_key_up (KeyEvent* e) { RUCY_SYM(on_key_up); if (RUCY_IS_OVERRIDDEN(on_key_up)) this->value.call(on_key_up, Rucy::value(e)); else Super::on_key_up(e); } virtual void on_pointer (PointerEvent* e) { RUCY_SYM(on_pointer); if (RUCY_IS_OVERRIDDEN(on_pointer)) this->value.call(on_pointer, Rucy::value(e)); else Super::on_pointer(e); } virtual void on_pointer_down (PointerEvent* e) { RUCY_SYM(on_pointer_down); if (RUCY_IS_OVERRIDDEN(on_pointer_down)) this->value.call(on_pointer_down, Rucy::value(e)); else Super::on_pointer_down(e); } virtual void on_pointer_up (PointerEvent* e) { RUCY_SYM(on_pointer_up); if (RUCY_IS_OVERRIDDEN(on_pointer_up)) this->value.call(on_pointer_up, Rucy::value(e)); else Super::on_pointer_up(e); } virtual void on_pointer_move (PointerEvent* e) { RUCY_SYM(on_pointer_move); if (RUCY_IS_OVERRIDDEN(on_pointer_move)) this->value.call(on_pointer_move, Rucy::value(e)); else Super::on_pointer_move(e); } virtual void on_wheel (WheelEvent* e) { RUCY_SYM(on_wheel); if (RUCY_IS_OVERRIDDEN(on_wheel)) this->value.call(on_wheel, Rucy::value(e)); else Super::on_wheel(e); } };// RubyWindow }// Reflex RUCY_DECLARE_WRAPPER_VALUE_FROM_TO(Reflex::Window) namespace Rucy { template <> inline Class get_ruby_class () { return Reflex::window_class(); } inline Value value (Reflex::Window::Ref& ref, Value klass = Reflex::window_class()) { return value(ref.get(), klass); } }// Rucy #endif//EOH