From: Masao M. <mu...@us...> - 2005-07-30 10:25:14
|
Update of /cvsroot/ruby-gnome2/ruby-gnome2/gtk/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28967/src Modified Files: rbgtkdrag.c rbgtkitemfactory.c rbgtksizegroup.c Log Message: * sample/testgtk/spinbutton.rb: Fix a typo. * sample/misc/itemfactory2.rb: Fix warnings. * src/rbgtkitemfactory.c: Fix segfault on amd64. * sample/gtk-demo/changedisplay.rb: Fix a out-of-scope warning. * sample/misc/treeview.rb, treemodelfilter.rb: Quit program when destroy event is occured. * src/rbgtkdrag.c (gtkdrag_source_set): Fix type declaration. * src/rbgtksizegroup.c (sizegrp_initialize): ditto. Index: rbgtkdrag.c =================================================================== RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gtk/src/rbgtkdrag.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- rbgtkdrag.c 11 Jan 2005 17:01:40 -0000 1.20 +++ rbgtkdrag.c 30 Jul 2005 10:24:57 -0000 1.21 @@ -252,7 +252,7 @@ static VALUE gtkdrag_source_set(self, widget, flags, targets, actions) - VALUE self, flags, targets, actions; + VALUE self, widget, flags, targets, actions; { gtk_drag_source_set(RVAL2WIDGET(widget), RVAL2GFLAGS(flags, GDK_TYPE_MODIFIER_TYPE), rbgtk_get_target_entry(targets), Index: rbgtkitemfactory.c =================================================================== RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gtk/src/rbgtkitemfactory.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- rbgtkitemfactory.c 17 Jun 2004 22:07:31 -0000 1.21 +++ rbgtkitemfactory.c 30 Jul 2005 10:24:57 -0000 1.22 @@ -19,6 +19,9 @@ #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) #define RVAL2ACCEL(a) (GTK_ACCEL_GROUP(RVAL2GOBJ(a))) +static VALUE action_table; +static guint action_id = 0; + static VALUE ifact_initialize(self, type, path, accel) VALUE self; @@ -112,11 +115,13 @@ } static void -items_exec_callback_wrap(callback_data, action, widget) - VALUE callback_data, action; +items_exec_callback_wrap(callback_data, action_id, widget) + VALUE callback_data, action_id; GtkWidget* widget; { VALUE iter, data; + VALUE action = rb_hash_aref(action_table, UINT2NUM(action_id)); + iter = RARRAY(action)->ptr[0]; data = RARRAY(action)->ptr[1]; if (!NIL_P(iter)) { @@ -146,7 +151,9 @@ } action = rb_ary_new3(2, func, data); G_RELATIVE(self, action); - entry->callback_action = action; + rb_hash_aset(action_table, UINT2NUM(action_id), action); + entry->callback_action = action_id; + action_id++; if (NIL_P(extdata)){ entry->extra_data = NULL; @@ -297,4 +304,8 @@ rb_define_const(gItemFactory, "BRANCH", CSTR2RVAL("<Branch>")); rb_define_const(gItemFactory, "LAST_BRANCH", CSTR2RVAL("<LastBranch>")); rb_define_const(gItemFactory, "TEAROFF", CSTR2RVAL("<Tearoff>")); + + action_table = rb_hash_new(); + rb_global_variable(&action_table); } + Index: rbgtksizegroup.c =================================================================== RCS file: /cvsroot/ruby-gnome2/ruby-gnome2/gtk/src/rbgtksizegroup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- rbgtksizegroup.c 3 Dec 2003 16:00:24 -0000 1.5 +++ rbgtksizegroup.c 30 Jul 2005 10:24:57 -0000 1.6 @@ -6,6 +6,7 @@ $Author$ $Date$ + Copyright (C) 2003-2005 Ruby-GNOME2 Project Team Copyright (C) 2002,2003 OGASAWARA, Takeshi ************************************************/ #include "global.h" @@ -14,7 +15,7 @@ static VALUE sizegrp_initialize(self, mode) - VALUE self; + VALUE self, mode; { G_INITIALIZE(self, gtk_size_group_new(RVAL2GENUM(mode, GTK_TYPE_SIZE_GROUP_MODE))); return Qnil; |