gecko-embed API additions

Owen Williams ywwg at usa.net
Wed Sep 20 20:05:15 EDT 2006


On Thu, 2006-09-21 at 01:41 +0200, Marco Pesenti Gritti wrote:

> 
> Hi Owen,
> 
> this made me rethink a bit about the whole gecko embedding situation. I 
> will try to post about it later but the quick summary is... I dropped 
> gecko-embed and made sugar use gtkmozembed directly. Also, I added the 
> gtkmozembed bindings to sugar-jhbuild.
> 
> The remaining issue is open-uri being basically broken in the bindings, 
> right? It should be fixable, we can figure it out tomorrow.
> 
> Thanks,
> Marco
> 


Take a look at the code for the Democracy Player.  They have already
solved the open-uri bug in their own code.  I don't know if their method
is sound, but whatever they did, it works.

>From MozillaBrowser.pyx:
"Here's the deal on the open-uri callback hack:

GtkMozEmbed doesn't define the open-uri callback correctly.  The uri
value is declared as a gpointer, instead of a string.  It's not a
problem in C but it doesn't work in Python.

To get around this, we declare a C callback to handle things.  Since
this callback is coming straight from the C code, we need to acquire the
python GIL or we'll segfault.  Because of this, we can't create any
local python object because they will be DECREFed at the end of the
function -- after we've given back the GIL.  To make things less messy,
the C callback invokes OpenUriCallback to do most of the work."


owen





More information about the Devel mailing list