4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
|
# File 'ext/xproto.c', line 4124
static VALUE
r_XCB_QueryColorsReply_get_colors(VALUE r_self)
{
xcb_query_colors_reply_t *reply;
Data_Get_Struct(r_self, xcb_query_colors_reply_t, reply);
xcb_rgb_iterator_t iterator = xcb_query_colors_colors_iterator(reply);
VALUE r_colors = rb_ary_new();
while (iterator.rem != 0) {
xcb_rgb_t *data = malloc(sizeof(xcb_rgb_t));
if (data == NULL)
rb_raise(rb_eNoMemError, "NoMemoryError");
VALUE r_data = Data_Wrap_Struct(r_XCB_RGB, NULL, NULL, data);
*data = *iterator.data;
rb_ary_push(r_colors, r_data);
xcb_rgb_next(&iterator);
}
return r_colors;
}
|