Hi,

the attached patch does away with gecko-embed's hardcoded .pc file and
adds an autogen'd one instead. So it becomes usable from a c
application.

The included sample can be built with
gcc `pkg-config --cflags --libs gtk+-2.0 gecko-embed` -lxul -o
gecko-embed-test gecko-embed-test.c
(there seems to be a bug in xulrunner, -lxul is not mentioned in any
of the installed .pc files)

Ok to commit?

- Rob
? gecko-embed-pc.diff
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gecko-embed/Makefile.am,v
retrieving revision 1.2
diff -a -u -p -r1.2 Makefile.am
--- Makefile.am	18 Apr 2006 02:57:15 -0000	1.2
+++ Makefile.am	26 Jul 2006 17:42:37 -0000
@@ -6,7 +6,10 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = gecko-embed.pc
 
 EXTRA_DIST = \
-	$(pkgconfig_DATA)
+	gecko-embed.pc.in
+
+CLEANFILES = \
+	gecko-embed.pc
 
 DISTCLEANFILES = 		\
 	gnome-doc-utils.make
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/gecko-embed/configure.ac,v
retrieving revision 1.5
diff -a -u -p -r1.5 configure.ac
--- configure.ac	16 Jul 2006 14:43:10 -0000	1.5
+++ configure.ac	26 Jul 2006 17:42:37 -0000
@@ -140,6 +140,7 @@ AC_MSG_RESULT($GNOME_PYTHON_ARGTYPES_DIR
 
 AC_CONFIG_FILES([
 Makefile
+gecko-embed.pc
 src/Makefile
 python/Makefile
 ],
Index: gecko-embed.pc
===================================================================
RCS file: gecko-embed.pc
diff -N gecko-embed.pc
--- gecko-embed.pc	18 Apr 2006 00:42:18 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-prefix=/usr
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include/gecko-embed
-features=
-
-Name: gecko-embed
-Description: GNOME Gecko Embed
-Version: 0.1
-Requires: mozilla-gtkmozembed
-Libs: -L${libdir} -lgeckoembed
-Cflags: -I${includedir}
Index: gecko-embed.pc.in
===================================================================
RCS file: gecko-embed.pc.in
diff -N gecko-embed.pc.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gecko-embed.pc.in	26 Jul 2006 17:42:37 -0000
@@ -0,0 +1,12 @@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+features=
+
+Name: gecko-embed
+Description: GNOME Gecko Embed
+Version: 0.1
+Requires: @[EMAIL PROTECTED] @[EMAIL PROTECTED]
+Libs: -L${libdir} -lgeckoembed
+Cflags: -I${includedir}
#include <glib/gstdio.h>
#include <gtk/gtk.h>
#include <gecko-embed/gecko-embed.h>

void
realize_cb (GtkWidget 	*gecko, 
	    gpointer	 data)
{
	g_printf ("%s\n", __FUNCTION__);
	gecko_embed_load_address (GECKO_EMBED (gecko), "http://google.at";);
}

int
main (int 	  argc, 
      char 	**argv)
{
	GtkWidget 	*win;
	GeckoEmbed	*gecko;

	gtk_init (&argc, &argv);

	win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (G_OBJECT (win), "delete-event", G_CALLBACK (gtk_main_quit), NULL);

	gecko = gecko_embed_new ();
	g_signal_connect (G_OBJECT (gecko), "realize", G_CALLBACK (realize_cb), NULL);
	gtk_container_add (GTK_CONTAINER (win), GTK_WIDGET (gecko));

	gtk_widget_show_all (win);
	gtk_main ();

	return 0;
}
_______________________________________________
Sugar mailing list
[email protected]
http://mailman.laptop.org/mailman/listinfo/sugar

Reply via email to