Object
Returns a new Imlib2::Border object.
Examples:
left, top, right, bottom = 10, 10, 20, 20
border = Imlib2::Border.new left, top, right, bottom
values = [10, 10, 20, 20]
border = Imlib2::Border.new values
edges = {
'left' => 10,
'right' => 20,
'top' => 10,
'bottom' => 20,
}
border = Imlib2::Border.new edges
VALUE border_new(int argc, VALUE *argv, VALUE klass) {
Imlib_Border *border;
VALUE b_o;
border = malloc(sizeof(Imlib_Border));
memset(border, 0, sizeof(Imlib_Border));
b_o = Data_Wrap_Struct(klass, 0, free, border);
rb_obj_call_init(b_o, argc, argv);
return b_o;
}
Get the bottom height (in pixels) of a border.
Examples:
edge = border.bottom edge = border.b
static VALUE border_bottom(VALUE self) {
Imlib_Border *b;
Data_Get_Struct(self, Imlib_Border, b);
return INT2FIX(b->bottom);
}
Set the bottom height (in pixels) of a border.
Examples:
border.bottom = 10 border.b = 10
static VALUE border_set_bottom(VALUE self, VALUE val) {
Imlib_Border *b;
Data_Get_Struct(self, Imlib_Border, b);
b->bottom = NUM2INT(val);
return val;
}
Get the left width (in pixels) of a border.
Examples:
edge = border.left edge = border.l
static VALUE border_left(VALUE self) {
Imlib_Border *b;
Data_Get_Struct(self, Imlib_Border, b);
return INT2FIX(b->left);
}
Set the left width (in pixels) of a border.
Examples:
border.left = 10 border.l = 10
static VALUE border_set_left(VALUE self, VALUE val) {
Imlib_Border *b;
Data_Get_Struct(self, Imlib_Border, b);
b->left = NUM2INT(val);
return val;
}
Get the right width (in pixels) of a border.
Examples:
edge = border.right edge = border.r
static VALUE border_right(VALUE self) {
Imlib_Border *b;
Data_Get_Struct(self, Imlib_Border, b);
return INT2FIX(b->right);
}
Set the right width (in pixels) of a border.
Examples:
border.right = 10 border.r = 10
static VALUE border_set_right(VALUE self, VALUE val) {
Imlib_Border *b;
Data_Get_Struct(self, Imlib_Border, b);
b->right = NUM2INT(val);
return val;
}
Get the top height (in pixels) of a border.
Examples:
edge = border.top edge = border.t
static VALUE border_top(VALUE self) {
Imlib_Border *b;
Data_Get_Struct(self, Imlib_Border, b);
return INT2FIX(b->top);
}
Set the top height (in pixels) of a border.
Examples:
border.top = 10 border.t = 10
static VALUE border_set_top(VALUE self, VALUE val) {
Imlib_Border *b;
Data_Get_Struct(self, Imlib_Border, b);
b->top = NUM2INT(val);
return val;
}
Generated with the Darkfish Rdoc Generator 2.