Re: ANNOUNCE: gob2 2.0.12 the "Long time no GOB" release

Nicolas Bruguier <[email protected]> Sat, 23 Jul 2005 17:01:00 +0200
Newsgroups gmane.comp.gnome.devtools.gob.general
Message-ID <[email protected]>
--=-TBxPuJ/aCApiQiUdon6H
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by zinc.5z.com id j6NF3IZR011991

I'm a stupid boy

here new patch,=20

Le samedi 23 juillet 2005 =E0 16:37 +0200, Jean-Yves Lefort a =E9crit :
> On Sat, 23 Jul 2005 12:39:00 +0200
> Nicolas Bruguier <[email protected]> wrote:
>=20
> > oups!  with syntax change it miss a condition in the function
> > print_initializer=20
> >=20
> > here the corrective patch
>=20
> It's still broken:
>=20
> [...]
> #line 6 "test.gob"
> static void=20
> test_window_init (TestWindow * self G_GNUC_UNUSED)
> #line 149 "test-window.c"
> {
> #define __GOB_FUNCTION__ "Test:Window::init"
> 	self->_priv =3D G_TYPE_INSTANCE_GET_PRIVATE(self,TEST_TYPE_WINDOW,Test=
WindowPrivate);
> 	{
> 	GtkWidget * root;
> 	o->_priv->_glade_xml =3D glade_xml_new("test.glade", "root", NULL);
> 	root =3D glade_xml_get_widget(o->_priv->_glade_xml, "root");
> 	gtk_widget_show(root);
> 	gtk_container_add(GTK_CONTAINER(o), root);
> 	glade_xml_signal_autoconnect_full(o->_priv->_glade_xml, (GladeXMLConne=
ctFunc)___glade_xml_connect_foreach, (gpointer)o);
> }
> 	self->_priv->a =3D (GtkWidget * )glade_xml_get_widget(self->_priv->_gl=
ade_xml, "a");
> 	self->_priv->b =3D (GtkWidget * )glade_xml_get_widget(self->_priv->_gl=
ade_xml, "b");
> }
> #undef __GOB_FUNCTION__
> [...]
>=20
> > Le samedi 23 juillet 2005 =E0 01:23 +0200, Jean-Yves Lefort a =E9crit=
 :
> > > On Fri, 22 Jul 2005 13:21:22 -0700
> > > George <[email protected]> wrote:
> > >=20
> > > > Here are the news in 2.0.12:
> > > >=20
> > > >         * libglade support (see manpage) (Nicolas Brugier)
> > >=20
> > > It's broken.
> > >=20
> > > =3D=3D=3D input
> > > class Test:Window from Gtk:Window (GladeXML "test.glade" "root")
> > > {
> > >   private Gtk:Widget *a GladeXML;
> > >   private Gtk:Widget *b GladeXML;
> > >=20
> > >   init (self)
> > >   {
> > >   }
> > > }
> > > =3D=3D=3D
> > >=20
> > > =3D=3D=3D output
> > > [...]
> > > #line 6 "test.gob"
> > > static void=20
> > > test_window_init (TestWindow * self G_GNUC_UNUSED)
> > > #line 149 "test-window.c"
> > > {
> > > #define __GOB_FUNCTION__ "Test:Window::init"
> > > 	self->_priv =3D G_TYPE_INSTANCE_GET_PRIVATE(self,TEST_TYPE_WINDOW,=
TestWindowPrivate);
> > > 	{
> > > 	GtkWidget * root;
> > > 	o->_priv->_glade_xml =3D glade_xml_new("test.glade", "root", NULL)=
;
> > > 	root =3D glade_xml_get_widget(o->_priv->_glade_xml, "root");
> > > 	gtk_widget_show(root);
> > > 	gtk_container_add(GTK_CONTAINER(o), root);
> > > 	glade_xml_signal_autoconnect_full(o->_priv->_glade_xml, (GladeXMLC=
onnectFunc)___glade_xml_connect_foreach, (gpointer)o);
> > > }
> > > 	self->_priv->a =3D 	{
> > > 	GtkWidget * root;
> > > 	o->_priv->_glade_xml =3D glade_xml_new("test.glade", "root", NULL)=
;
> > > 	root =3D glade_xml_get_widget(o->_priv->_glade_xml, "root");
> > > 	gtk_widget_show(root);
> > > 	gtk_container_add(GTK_CONTAINER(o), root);
> > > 	glade_xml_signal_autoconnect_full(o->_priv->_glade_xml, (GladeXMLC=
onnectFunc)___glade_xml_connect_foreach, (gpointer)o);
> > > }
> > > ;
> > > 	self->_priv->b =3D 	{
> > > 	GtkWidget * root;
> > > 	o->_priv->_glade_xml =3D glade_xml_new("test.glade", "root", NULL)=
;
> > > 	root =3D glade_xml_get_widget(o->_priv->_glade_xml, "root");
> > > 	gtk_widget_show(root);
> > > 	gtk_container_add(GTK_CONTAINER(o), root);
> > > 	glade_xml_signal_autoconnect_full(o->_priv->_glade_xml, (GladeXMLC=
onnectFunc)___glade_xml_connect_foreach, (gpointer)o);
> > > }
> > > ;
> > > 	self->_priv->a =3D (GtkWidget * )glade_xml_get_widget(self->_priv-=
>_glade_xml, "a");
> > > 	self->_priv->b =3D (GtkWidget * )glade_xml_get_widget(self->_priv-=
>_glade_xml, "b");
> > > }
> > > #undef __GOB_FUNCTION__
> > > [...]
> > > =3D=3D=3D
>=20

--=-TBxPuJ/aCApiQiUdon6H
Content-Disposition: attachment; filename=gob2-libglade-broken.patch
Content-Type: text/x-patch; name=gob2-libglade-broken.patch; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

Index: src/main.c
===================================================================
RCS file: /cvs/gnome/gob/src/main.c,v
retrieving revision 1.130
diff -u -r1.130 main.c
--- src/main.c	22 Jul 2005 19:56:32 -0000	1.130
+++ src/main.c	23 Jul 2005 14:57:25 -0000
@@ -618,7 +618,7 @@
 				 "id", "init",
 				 "args:steal", make_func_arg (cl->otype,
 							      FALSE /* is_class */,
-							      "o" /* name */),
+							      "self" /* name */),
 				 "unique_id", method_unique_id++,
 				 NULL);
 		cl->nodes = g_list_prepend(cl->nodes, node);
@@ -2001,6 +2001,9 @@
 print_initializer(Method *m, Variable *v)
 {
 	char *root;
+	
+	if(v->glade_widget)
+		return;
 
 	if(v->initializer == NULL)
 		return;
Index: src/parse.y
===================================================================
RCS file: /cvs/gnome/gob/src/parse.y,v
retrieving revision 1.66
diff -u -r1.66 parse.y
--- src/parse.y	22 Jul 2005 19:49:46 -0000	1.66
+++ src/parse.y	23 Jul 2005 14:57:29 -0000
@@ -481,11 +481,11 @@
 				 NULL);
 	initializer = g_strdup_printf("\t{\n"
 				      "\tGtkWidget * root;\n"
-				      "\to->_priv->_glade_xml = glade_xml_new(%s, %s, %s);\n"
-				      "\troot = glade_xml_get_widget(o->_priv->_glade_xml, %s);\n"
+				      "\tself->_priv->_glade_xml = glade_xml_new(%s, %s, %s);\n"
+				      "\troot = glade_xml_get_widget(self->_priv->_glade_xml, %s);\n"
 				      "\tgtk_widget_show(root);\n"
-				      "\tgtk_container_add(GTK_CONTAINER(o), root);\n"
-				      "\tglade_xml_signal_autoconnect_full(o->_priv->_glade_xml, (GladeXMLConnectFunc)___glade_xml_connect_foreach, (gpointer)o);\n"
+				      "\tgtk_container_add(GTK_CONTAINER(self), root);\n"
+				      "\tglade_xml_signal_autoconnect_full(self->_priv->_glade_xml, (GladeXMLConnectFunc)___glade_xml_connect_foreach, (gpointer)self);\n"
 				      "}\n", file, root, domain ? domain : "NULL", root);
 	
 	var = node_new (VARIABLE_NODE,

--=-TBxPuJ/aCApiQiUdon6H--

--
to unsubscribe:
send mail to [email protected] with "unsubscribe gob-list" in the subject