Class: XCB::GetMotionEventsReply

Inherits:
Object
  • Object
show all
Defined in:
ext/xproto.c

Instance Method Summary collapse

Instance Method Details

#eventsObject



3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
# File 'ext/xproto.c', line 3461

static VALUE
r_XCB_GetMotionEventsReply_get_events(VALUE r_self)
{
	xcb_get_motion_events_reply_t *reply;
	Data_Get_Struct(r_self, xcb_get_motion_events_reply_t, reply);
	xcb_timecoord_iterator_t iterator = xcb_get_motion_events_events_iterator(reply);
	VALUE r_events = rb_ary_new();
	while (iterator.rem != 0) {
		xcb_timecoord_t *data = malloc(sizeof(xcb_timecoord_t));
		if (data == NULL)
			rb_raise(rb_eNoMemError, "NoMemoryError");
		VALUE r_data = Data_Wrap_Struct(r_XCB_TIMECOORD, NULL, NULL, data);
		*data = *iterator.data;
		rb_ary_push(r_events, r_data);
		xcb_timecoord_next(&iterator);
	}
	return r_events;
}

#events_lenObject



3454
3455
3456
3457
3458
3459
3460
# File 'ext/xproto.c', line 3454

static VALUE
r_XCB_GetMotionEventsReply_get_events_len(VALUE r_self)
{
	xcb_get_motion_events_reply_t *reply;
	Data_Get_Struct(r_self, xcb_get_motion_events_reply_t, reply);
	return INT2FIX(reply->events_len);
}