dmz::V8Value
dmz::JsModuleUiV8QtBasic::_event_type (const v8::Arguments &Args) {

   v8::HandleScope scope;
   V8Value result = v8::Undefined ();

   JsModuleUiV8QtBasic *self = _to_self (Args);
   if (self) {

      QEvent *event = self->_to_qevent (Args.This ());
      if (event) { result = v8::Number::New (event->type ()); }
   }

   return scope.Close (result);
}
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_resize_event_size (const v8::Arguments &Args) {

   v8::HandleScope scope;
   V8Value result = v8::Undefined ();

   JsModuleUiV8QtBasic *self = _to_self (Args);
   if (self) {

      QResizeEvent *event = (QResizeEvent *)self->_to_qevent (Args.This ());
      if (event) { result = qsize_to_v8 (event->size ()); }
   }

   return scope.Close (result);
}
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_mouse_event_buttons (const v8::Arguments &Args) {

   v8::HandleScope scope;
   V8Value result = v8::Undefined ();

   JsModuleUiV8QtBasic *self = _to_self (Args);
   if (self) {

      QMouseEvent *event = (QMouseEvent *)self->_to_qevent (Args.This ());
      if (event) { result = v8::Integer::New (event->buttons ()); }
   }

   return scope.Close (result);
}
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_gscene_mouse_event_screen_pos (const v8::Arguments &Args) {

   v8::HandleScope scope;
   V8Value result = v8::Undefined ();

   JsModuleUiV8QtBasic *self = _to_self (Args);
   if (self) {

      QGraphicsSceneMouseEvent *event =
         (QGraphicsSceneMouseEvent *)self->_to_qevent (Args.This ());
      if (event) { result = qpoint_to_v8 (event->screenPos ()); }
   }

   return scope.Close (result);
}
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_mouse_event_posf (const v8::Arguments &Args) {

   v8::HandleScope scope;
   V8Object result;

   JsModuleUiV8QtBasic *self = _to_self (Args);
   if (self) {

      QMouseEvent *event = (QMouseEvent *)self->_to_qevent (Args.This ());
      if (event) {

         QPointF pos = event->posF ();
         result = v8::Object::New ();
         result->Set(v8::String::NewSymbol ("x"), v8::Number::New (pos.x ()));
         result->Set(v8::String::NewSymbol ("y"), v8::Number::New (pos.y ()));
      }
   }

   return scope.Close (result);
}
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_gscene_mouse_event_button_down_screen_pos (const v8::Arguments &Args) {

   v8::HandleScope scope;
   V8Value result = v8::Undefined ();

   JsModuleUiV8QtBasic *self = _to_self (Args);
   if (self) {

      QGraphicsSceneMouseEvent *event =
         (QGraphicsSceneMouseEvent *)self->_to_qevent (Args.This ());
      if (event) {

         if (Args.Length ()) {

            Qt::MouseButton button = (Qt::MouseButton) v8_to_uint32 (Args[0]);
            result = qpoint_to_v8 (event->buttonDownScreenPos (button));
         }
      }
   }

   return scope.Close (result);
}