Method: XCB::Connection#fill_poly

Defined in:
ext/xproto.c

#fill_poly(r_drawable, r_gc, r_shape, r_coordinate_mode, r_points) ⇒ Object



5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
# File 'ext/xproto.c', line 5632

static VALUE
r_XCB_Connection_fill_poly(VALUE r_self, VALUE r_drawable, VALUE r_gc, VALUE r_shape, VALUE r_coordinate_mode, VALUE r_points)
{
  xcb_connection_t *connection;
  Data_Get_Struct(r_self, xcb_connection_t, connection);
  uint32_t __drawable = FIX2INT(r_drawable);
  uint32_t __gc = FIX2INT(r_gc);
  uint8_t __shape = FIX2INT(r_shape);
  uint8_t __coordinate_mode = FIX2INT(r_coordinate_mode);
  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_fill_poly(connection, __drawable, __gc, __shape, __coordinate_mode, __points_len, __points);
  return Qnil;
}