----Next_Part(Wed_Nov__1_11:28:05_2000_809)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

うえの@ぶるーすかいとます。

Ruby/GTK にいくつかバグを見つけました。
snapshot へのパッチを添付します。

  1. Gtk::Widget#size_request

       Gtk::Requisition オブジェクトを引数に取るのではなく、
       Gtk::Requisition オブジェクトを返すように機

  荻 粕觝災繿蜩蜚蜿遑閙甃 粕觝坐跛閭癆蜿遑閙

       瀕垈燐忘れ。
       # 元が gint16 なので INT2FIX でも良い?


また、最近こんなモノをい討い襪里任垢;

  蔗雕碎絎鼡闥褓癆繻蜈鬲r矣
以下のメドが必要になったので追加してみました。

    Gtk::CList#get_selection_info
    Gtk::Widget#set_app_paintable
    Gdk::screen_width
    Gdk::screen_height
    Gdk::Window#set_override_redirect



---
   うえの かつひろ @ BLUE-SKYNET    <unnie / blue.sky.or.jp>  --------                    http://www.blue.sky.or.jp/  -
----Next_Part(Wed_Nov__1_11:28:05_2000_809)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="ruby-gtk-20001101.patch"

Index: gtk/src/rbgtkwidget.c
--- gtk/src/rbgtkwidget.c.orig	Tue Oct 31 22:32:25 2000
+++ gtk/src/rbgtkwidget.c	Tue Oct 31 22:46:44 2000
@@ -145,11 +145,12 @@
 }
 */
 static VALUE
-widget_size_request(self, req)
-    VALUE self, req;
+widget_size_request(self)
+    VALUE self;
 {
-    gtk_widget_size_request(get_widget(self), get_grequisition(req));
-    return self;
+    GtkRequisition req;
+    gtk_widget_size_request(get_widget(self), &req);
+    return make_grequisition(&req);
 }
 
 static VALUE
@@ -311,6 +312,14 @@
 }
 
 static VALUE
+widget_set_app_paintable(self, app_paintable)
+    VALUE self, app_paintable;
+{
+    gtk_widget_set_app_paintable(get_widget(self), RTEST(app_paintable));
+    return self;
+}
+
+static VALUE
 widget_set_parent(self, parent)
     VALUE self, parent;
 {
@@ -1010,7 +1019,7 @@
     /* 1.2.x
        rb_define_method(gWidget, "draw_children", widget_draw_children, 0);
     */
-    rb_define_method(gWidget, "size_request", widget_size_request, 1);
+    rb_define_method(gWidget, "size_request", widget_size_request, 0);
     rb_define_method(gWidget, "size_allocate", widget_size_allocate, 1);
     /* 1.2.x
        rb_define_method(gWidget, "install_accelerator", widget_inst_accel, 4);
@@ -1038,6 +1047,7 @@
     rb_define_method(gWidget, "set_usize", widget_set_usize, 2);
     rb_define_method(gWidget, "set_uposition", widget_set_uposition, 2);
     rb_define_method(gWidget, "set_style", widget_set_style, 1);
+    rb_define_method(gWidget, "set_app_paintable", widget_set_app_paintable, 1);
     rb_define_method(gWidget, "set_events", widget_set_events, 1);
     rb_define_method(gWidget, "add_events", widget_add_events, 1);
     rb_define_method(gWidget, "set_extension_events", widget_set_eevents, 1);
Index: gtk/src/rbgtkclist.c
--- gtk/src/rbgtkclist.c.orig	Tue Oct 31 22:35:33 2000
+++ gtk/src/rbgtkclist.c	Tue Oct 31 22:37:21 2000
@@ -277,6 +277,20 @@
 }
 
 static VALUE
+clist_get_selection_info(self, x, y)
+    VALUE self, x, y;
+{
+    gint n, row, column;
+    n  tk_clist_get_selection_info(GTK_CLIST(get_widget(self)),
+				     NUM2INT(x), NUM2INT(y),
+				     &row, &column);
+    if (!n)
+	return Qnil;
+    else
+	return rb_assoc_new(INT2NUM(row), INT2NUM(column));
+}
+
+static VALUE
 clist_moveto(self, row, col, row_align, col_align)
     VALUE self, row, col, row_align, col_align;
 {
@@ -741,6 +755,7 @@
     rb_define_method(gCList, "set_row_height", clist_set_row_height, 1);
     rb_define_method(gCList, "row_height clist_set_row_height, 1);
     rb_define_method(gCList, "row_height", clist_get_row_height, 0);
+    rb_define_method(gCList, "get_selection_info", clist_get_selection_info, 2);
     rb_define_method(gCList, "moveto", clist_moveto, 4);
     rb_define_method(gCList, "set_text", clist_set_text, 3);
     rb_define_method(gCList, "set_pixmap", clist_set_pixmap, 4);
Index: gtk/src/rbgdk.c
--- gtk/src/rbgdk.c.orig	Tue Oct 31 22:37:35 2000
+++ gtk/src/rbgdk.c	Tue Oct 31 22:39:29 2000
@@ -484,6 +484,24 @@
 
 
 /*
+ * Gdk
+ */
+static VALUE
+gdk_s_screen_width(self)
+    VALUE self;
+{
+    return INT2NUM(gdk_screen_width());
+}
+
+static VALUE
+gdk_s_screen_height(self)
+   VALUE self;
+{
+    return INT2NUM(gdk_screen_height());
+}
+
+
+/*
  * Gdk::Font
  */
 static VALUE
@@ -856,6 +874,8 @@
 
     /* Gdk */
     mGdk  b_define_module("Gdk");
+    rb_define_singleton_method(mGdk, "screen_width", gdk_s_screen_width, 0);
+    rb_define_singleton_method(mGdk, "screen_height", gdk_s_screen_height, 0);
 
     /* Gdk::Color, Gdk::Colormap, Gdk::ColorContext */
     Init_gtk_gdk_color();
Index: gtk/src/rbgdkwindow.c
--- gtk/src/rbgdkwindow.c.orig	Tue Oct 31 22:42:38 2000
+++ gtk/src/rbgdkwindow.c	Tue Oct 31 22:44:13 2000
@@ -196,6 +196,15 @@
 }
 
 static VALUE
+gdkwin_set_override_redirect(self, override_redirect)
+    VALUE self, override_redirect;
+{
+    gdk_window_set_override_redirect(get_gdkwindow(self),
+				     RTEST(override_redirect));
+    return self;
+}
+
+static VALUE
 gdkwin_get_root_origin(self)
     VALUE self;
 {
@@ -295,6 +304,7 @@
     rb_define_method(gdkWindow, "set_icon_name", gdkwin_set_icon_name, 1);
     rb_define_method(gdkWindow, "set_decorations", gdkwin_set_decorations, 1);
     rb_define_method(gdkWindow, "set_functions", gdkwin_set_functions, 1);
+    rb_define_method(gdkWindow, "set_override_redirect", gdkwin_set_override_redirect, 1);
     rb_define_method(gdkWindow, "get_root_origin", gdkwin_get_root_origin, 0);
     rb_define_method(gdkWindow, "get_events", gdkwin_get_events, 0);
     rb_define_method(gdkWindow, "set_events", gdkwin_set_events, 1);
Index: gtk/src/rbgtk.c
--- gtk/src/rbgtk.c.orig	Tue Oct 31 22:54:08 2000
+++ gtk/src/rbgtk.c	Tue Oct 31 22:55:45 2000
@@ -517,7 +517,8 @@
     GtkAllocation *a;
 
     a  et_gallocation(self);
-    return rb_ary_new3(4, a->x, a->y, a->width, a->height);
+    return rb_ary_new3(4, INT2NUM(a->x), INT2NUM(a->y),
+		       INT2NUM(a->width), INT2NUM(a->height));
 }
 
 static VALUE
@@ -595,7 +596,7 @@
     GtkRequisition *r;
 
     r  et_grequisition(self);
-    return rb_ary_new3(2, r->width, r->height);
+    return rb_ary_new3(2, INT2NUM(r->width), INT2NUM(r->height));
 }
 
 static VALUE

----Next_Part(Wed_Nov__1_11:28:05_2000_809)----