X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fecore_x%2Frb_window.c;h=f5af7c78d9a168fc17db7e565b846624866db2ba;hb=ddaa53d3761be0e96352e75e2002072d92389d10;hp=5ac66c0126107a0ac737211045226c05629db3b7;hpb=4150485fdc679e6ab0bb15925fabfa67cd001026;p=ruby-ecore.git diff --git a/src/ecore_x/rb_window.c b/src/ecore_x/rb_window.c index 5ac66c0..f5af7c7 100644 --- a/src/ecore_x/rb_window.c +++ b/src/ecore_x/rb_window.c @@ -1,5 +1,5 @@ /* - * $Id: rb_window.c 92 2004-08-22 23:07:16Z tilman $ + * $Id: rb_window.c 97 2004-08-23 18:30:28Z tilman $ * * Copyright (C) 2004 ruby-ecore team (see AUTHORS) * @@ -144,10 +144,16 @@ static VALUE c_delete (VALUE self) { GET_OBJ (self, RbWindow, win); - if (win->real) { - ecore_x_window_del (win->real); - win->real = 0; - } + ecore_x_window_del (win->real); + + return Qnil; +} + +static VALUE c_send_delete_request (VALUE self) +{ + GET_OBJ (self, RbWindow, win); + + ecore_x_window_delete_request_send (win->real); return Qnil; } @@ -242,11 +248,11 @@ static VALUE c_geometry_get (VALUE self) INT2FIX (w), INT2FIX (h)); } -static VALUE c_border_size_get (VALUE self) +static VALUE c_border_width_get (VALUE self) { GET_OBJ (self, RbWindow, win); - return INT2FIX (ecore_x_window_border_size_get (win->real)); + return INT2FIX (ecore_x_window_border_width_get (win->real)); } static VALUE c_depth_get (VALUE self) @@ -266,9 +272,13 @@ static VALUE c_parent_get (VALUE self) static VALUE c_title_get (VALUE self) { + char *s; + GET_OBJ (self, RbWindow, win); - return rb_str_new2 (ecore_x_window_prop_title_get (win->real)); + s = ecore_x_window_prop_title_get (win->real); + + return s ? rb_str_new2 (s) : Qnil; } static VALUE c_title_set (VALUE self, VALUE val) @@ -407,6 +417,8 @@ void Init_Window (void) rb_define_method (cWindow, "hide", c_hide, 0); rb_define_method (cWindow, "visible?", c_visible_get, 0); rb_define_method (cWindow, "delete", c_delete, 0); + rb_define_method (cWindow, "send_delete_request", + c_send_delete_request, 0); rb_define_method (cWindow, "raise", c_raise, 0); rb_define_method (cWindow, "lower", c_lower, 0); rb_define_method (cWindow, "reparent", c_reparent, 3); @@ -415,7 +427,7 @@ void Init_Window (void) rb_define_method (cWindow, "resize", c_resize, 2); rb_define_method (cWindow, "size", c_size_get, 0); rb_define_method (cWindow, "geometry", c_geometry_get, 0); - rb_define_method (cWindow, "border_size", c_border_size_get, 0); + rb_define_method (cWindow, "border_width", c_border_width_get, 0); rb_define_method (cWindow, "depth", c_depth_get, 0); rb_define_method (cWindow, "parent", c_parent_get, 0); rb_define_method (cWindow, "title", c_title_get, 0);