From 7ee4ccab86e2a4ef1e36384e830d9f2e856fa44b Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Tue, 15 Mar 2005 18:00:33 +0000 Subject: [PATCH] Implemented Evas::Image#get_border and Evas::Image#set_border. --- src/rb_image.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/rb_image.c b/src/rb_image.c index 275dc32..7bd0f06 100644 --- a/src/rb_image.c +++ b/src/rb_image.c @@ -1,5 +1,5 @@ /* - * $Id: rb_image.c 62 2004-08-12 19:35:01Z tilman $ + * $Id: rb_image.c 284 2005-03-15 18:00:33Z tilman $ * * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de) * @@ -223,6 +223,33 @@ static VALUE c_set_fill (VALUE self, VALUE x, VALUE y, VALUE w, VALUE h) return Qnil; } +static VALUE c_get_border (VALUE self) +{ + int x = 0, y = 0, w = 0, h = 0; + + GET_OBJ (self, RbEvasObject, e); + + evas_object_image_border_get (e->real, &x, &y, &w, &h); + + return rb_ary_new3 (4, INT2FIX (x), INT2FIX (y), + INT2FIX (w), INT2FIX (h)); +} + +static VALUE c_set_border (VALUE self, VALUE x, VALUE y, VALUE w, VALUE h) +{ + GET_OBJ (self, RbEvasObject, e); + + Check_Type (x, T_FIXNUM); + Check_Type (y, T_FIXNUM); + Check_Type (w, T_FIXNUM); + Check_Type (h, T_FIXNUM); + + evas_object_image_border_set (e->real, FIX2INT (x), FIX2INT (y), + FIX2INT (w), FIX2INT (h)); + + return Qnil; +} + /* * call-seq: * img.reload => nil @@ -251,5 +278,7 @@ void Init_Image (void) rb_define_method (c, "set_size", c_set_size, 2); rb_define_method (c, "get_fill", c_get_fill, 0); rb_define_method (c, "set_fill", c_set_fill, 4); + rb_define_method (c, "get_border", c_get_border, 0); + rb_define_method (c, "set_border", c_set_border, 4); rb_define_method (c, "reload", c_reload, 0); } -- 2.30.2