[maemo-developers] Hybrid Web/Python apps with gtkmozembed

From: Hannes Wallnoefer hannesw at gmail.com
Date: Mon Mar 10 17:24:53 EET 2008
2008/3/6, tonikitoo (Antonio Gomes) <tonikitoo at gmail.com>:
> Hi,
>
>
>  > Hi there,
>  >
>  >  I spent a few days working on a Maemo Python app that embed mozilla
>  >  via gtkmozembed. This ITT posting has a short description and
>  >  screenshots, source and debian packages are available on the linked
>  >  page:
>  >
>  >  http://www.internettablettalk.com/forums/showpost.php?p=150211&postcount=40
>  >
>  >  Since libgtkmozembed packages are now in the maemo chinook repository,
>  >  all that is missing is the python binding for gtkmozembed, which is
>  >  part of the gnome-python-extras package. Thankfully, Owen Williams had
>  >  already built this for maemo [1], and also helped me build it myself.
>  >
>  >  [1] http://ywwg.com/maemo/
>  >
>  >  The good: Although the gtkmozembed API [2] is rather coarse, it is
>  >  possible to have two-way communication between gtk/python and
>  >  javascript running in the browser quite easily. For python to
>  >  javascript, simply send "javascript:foo()" URLs to the browser like
>  >  bookmarklets do. Javascript to python is a bit more tricky. What I do
>  >  is open URLs like "http://cmd/dosomething#arg" from javascript, and
>  >  catch them in a python function bound to the browser's "open-uri"
>  >  signal [3]. So it's really possible to have both worlds integrated
>  >  seamlessly.
>  >
>  >  [2] http://www.pygtk.org/pygtkmozembed/class-gtkmozembed.html
>  >  [3] http://www.pygtk.org/pygtkmozembed/class-gtkmozembed.html#signal-gtkmozembed--open-uri
>  >
>  >  And now the bad: the embedded browser is not hildonized. At least I
>  >  couldn't get the virutal keyboard to pop up by clicking into a HTML
>  >  form input field. Also, scrolling via dragging did not work. Do these
>  >  features have to be enabled by some init code, or are they implemented
>  >  on top of libgtkmozembed? What amount of work would be involved to get
>  >  a fully hildonized embedded browser widget?
>
>
>
>
> This "hildonization" (vkb handling) is implemented in another microb
>  layer, microb-eal (see
>  https://garage.maemo.org/svn/browser/mozilla/trunk/microb-eal/src/gmozillaengine.c).
>
>  instead of straight using gtkmozembed , you could maybe use
>  browser/microb-eal to access browser functionalities.
>

Thanks for the link! I browsed through this repository before, but now
it really makes sense.

>From a quick look, it looks like microb-eal mirrors some but not all
of the functionality of gtkmozembed. So maybe if the missing
gtkmozembed functions could be added to microb-eal, it could become a
hildonmozembed to be used as direct replacement (eg for the python
bindings)?

That would be great, but I'm not really enough of C person to try.
Maybe somebody else wants to give it a try?

hannes

>
>  >  I think that hybrid GTK/Web apps have a lot of potential. I'd love to
>  >  have this well supported on maemo!
>
>
> Absolutely.
>
>  regards
>
>  --
>
> --Antonio Gomes
>

More information about the maemo-developers mailing list