Beispiel #1
0
static VALUE
rg_union(VALUE self, VALUE other)
{
    GdkRectangle dest;
    gdk_rectangle_union(_SELF(self), _SELF(other), &dest);
    return GDKRECTANGLE2RVAL(&dest);
}
Beispiel #2
0
static VALUE
rg_intersect(VALUE self, VALUE other)
{
    GdkRectangle dest;
    gboolean ret = gdk_rectangle_intersect(_SELF(self), _SELF(other), &dest);
    return ret ? GDKRECTANGLE2RVAL(&dest) : Qnil;
}
static VALUE
rg_cell_size(VALUE self)
{
    GdkRectangle cell_area;
    gint x_offset, y_offset, width, height;
    VALUE cell;

    /* Is this collect implement for cell_area ? */
    cell_area.x = -1;
    cell_area.y = -1;
    cell_area.width = -1;
    cell_area.height = -1;

    gtk_tree_view_column_cell_get_size(_SELF(self), &cell_area,
                                       &x_offset, &y_offset,
                                       &width, &height);
    if (cell_area.x == -1 || cell_area.y == -1 ||
            cell_area.width == -1 || cell_area.height == -1) {
        cell = Qnil;
    } else {
        cell = GDKRECTANGLE2RVAL(&cell_area);
    }
    return rb_ary_new3(5, cell,
                       x_offset ? INT2NUM(x_offset) : Qnil,
                       y_offset ? INT2NUM(y_offset) : Qnil,
                       width ? INT2NUM(width) : Qnil,
                       height ? INT2NUM(height) : Qnil);
}
static VALUE
rg_frame_extents(VALUE self)
{
    GdkRectangle rect;
    gdk_window_get_frame_extents(_SELF(self), &rect);
    return GDKRECTANGLE2RVAL(&rect);
}
static VALUE
rg_embedded_rect(VALUE self)
{
    GdkRectangle rectangle;
    gboolean ret = gtk_icon_info_get_embedded_rect(_SELF(self), &rectangle);

    if (ret)
        return GDKRECTANGLE2RVAL(&rectangle);
    else
        return Qnil;
}
Beispiel #6
0
/* GdkEventExpose */
static VALUE
gdkeventexpose_area(VALUE self)
{
    return GDKRECTANGLE2RVAL(&RVAL2GDKEVENT(self)->expose.area);
}
Beispiel #7
0
static VALUE
rg_to_rect(VALUE self)
{
    return GDKRECTANGLE2RVAL(_SELF(self));
}