Hi, the attached patch introduces GeckoEdit -----|> GeckoEmbed Editor -----|> Browser geckoembed.Edit -----|> geckoembed.Embed
It's a bit more intrusive than I had hoped: because of the gecko-embed/src dir layout (rather than gecko-embed/gecko-embed) the public headers cannot easily include each other. Therefore gecko-embed-private.h has been split out of gecko-embed.h. The -private header is included from the subclass' gecko-edit-private.h. The editable subclass does not yet provide any methods but attached you will find test samples that show it works. Python bindings are updated to wrap the new class. Ok to commit? - Rob
gecko-edit.diff.gz
Description: GNU Zip compressed data
#include <glib/gstdio.h>
#include <gtk/gtk.h>
#include <gecko-embed/gecko-edit.h>
void
realize_cb (GtkWidget *gecko,
gpointer data)
{
g_printf ("%s '%s'\n", __FUNCTION__, (gchar *) data);
if (data)
gecko_embed_load_address (GECKO_EDIT (gecko), (gchar *) data);
}
int
main (int argc,
char **argv)
{
GtkWidget *win;
GeckoEdit *gecko;
gchar *address;
gtk_init (&argc, &argv);
address = NULL;
if (argc > 1) {
address = argv[1];
}
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (win), "delete-event", G_CALLBACK (gtk_main_quit), NULL);
gecko = gecko_edit_new ();
g_signal_connect (G_OBJECT (gecko), "realize", G_CALLBACK (realize_cb), address);
gtk_container_add (GTK_CONTAINER (win), GTK_WIDGET (gecko));
gtk_widget_show_all (win);
gtk_main ();
return 0;
}
import gtk
import geckoembed
def realize_cb (gecko):
gecko.load_address ("http://google.at")
win = gtk.Window ()
win.connect ("delete-event", gtk.main_quit)
gecko = geckoembed.Embed ()
gecko.connect ("realize", realize_cb)
win.add (gecko)
win.show_all ()
gtk.main ()
_______________________________________________ Sugar mailing list [email protected] http://mailman.laptop.org/mailman/listinfo/sugar
