Method: XCB::MotionNotifyEvent.new

Defined in:
ext/xproto.c

.new(r_detail, r_time, r_root, r_event, r_child, r_root_x, r_root_y, r_event_x, r_event_y, r_state, r_same_screen) ⇒ Object



2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
# File 'ext/xproto.c', line 2322

static VALUE
r_XCB_MotionNotifyEvent_new(VALUE r_klass, VALUE r_detail, VALUE r_time, VALUE r_root, VALUE r_event, VALUE r_child, VALUE r_root_x, VALUE r_root_y, VALUE r_event_x, VALUE r_event_y, VALUE r_state, VALUE r_same_screen)
{
  xcb_motion_notify_event_t *self = malloc(sizeof(xcb_motion_notify_event_t));
  if (self == NULL)
    rb_raise(rb_eNoMemError, "NoMemoryError");
  VALUE r_self = Data_Wrap_Struct(r_klass, NULL, NULL, self);
  self->response_type = XCB_MOTION_NOTIFY;
  self->sequence = 0;
  self->detail = FIX2INT(r_detail);
  self->time = FIX2INT(r_time);
  self->root = FIX2INT(r_root);
  self->event = FIX2INT(r_event);
  self->child = FIX2INT(r_child);
  self->root_x = FIX2INT(r_root_x);
  self->root_y = FIX2INT(r_root_y);
  self->event_x = FIX2INT(r_event_x);
  self->event_y = FIX2INT(r_event_y);
  self->state = FIX2INT(r_state);
  self->same_screen = RTEST(r_same_screen);
  return r_self;
}