Method: XCB::Connection#poly_point

Defined in:
ext/xproto.c

#poly_point(r_coordinate_mode, r_drawable, r_gc, r_points) ⇒ Object



5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
# File 'ext/xproto.c', line 5520

static VALUE
r_XCB_Connection_poly_point(VALUE r_self, VALUE r_coordinate_mode, VALUE r_drawable, VALUE r_gc, VALUE r_points)
{
  xcb_connection_t *connection;
  Data_Get_Struct(r_self, xcb_connection_t, connection);
  uint8_t __coordinate_mode = FIX2INT(r_coordinate_mode);
  uint32_t __drawable = FIX2INT(r_drawable);
  uint32_t __gc = FIX2INT(r_gc);
  Check_Type(r_points, T_ARRAY);
  int __points_len = RARRAY_LEN(r_points);
  xcb_point_t __points[__points_len];
  int i;
  for (i = 0; i < __points_len; i += 1) {
    xcb_point_t *data;
    VALUE r_data = rb_ary_entry(r_points, i);
    if (TYPE(r_data) != T_DATA || RBASIC(r_data)->klass != r_XCB_POINT)
      rb_raise(rb_eTypeError, "expected POINT");
    Data_Get_Struct(r_data, xcb_point_t, data);
    __points[i] = *data;
  }
  xcb_poly_point(connection, __coordinate_mode, __drawable, __gc, __points_len, __points);
  return Qnil;
}