Webkit Message Views, GSoc Midterm report
Arnold Noronha
arnstein87 at gmail.com
Mon Jul 13 15:26:32 EDT 2009
Hi all!
I'm sorry for not being active on the list, but I've been in touch
with Sean. Here's a report of the work I've done so far, and I'll be
happy to hear suggestions and criticism.
Pidgin Webkit, Midterm Report
=============================
Currently, I'm working on a Git repository. (I'm sorry, I just
couldn't get the hang of Monotone, but I'll move to mtn as soon as
possible.)
Git repo: git://github.com/tdrhq/pidgin-clone.git
Git branch: "webkit"
This repo is based on a clone from Felipe's pidgin-clone at [1], and
I'm constantly pulling from the monotone repository.
The story so far
----------------
At all points, I've kept all code I've written independent of
GtkIMHtml. For example, I had to rewrite some parts of smiley code,
because the existing smiley code heavily depended on GtkIMHtmlSmiley.
As a warmup step, I replaced GtkIMHtml to WebkitWebView in many small
components. (User info, about dialog, chat logs.)
The first concrete step, was to replace GtkIMHtml to WebkitWebView in
only Message window. (I used the javascript "document.write" to append
text to the bottom of the webview to mimic the behaviour of
GtkIMHtml.) This step required lots of messing within the GtkConv
code, since GtkConv made lots of assumptions on GtkIMHtml (e.g. that
GtkIMHtml extends a GtkEntry), and also GtkIMHtml is actually quite
complex and does lots of things at one go (e.g. rendering, the
interface to add messages, smiley replacements and themes). Issues:
- Minimal formatting. (It looks ugly, yes.)
- Inline typing notification does not work. (And actually, I don't
know of an elegant way to make it work within this framework.)
Adium theming: After that, I took Sean's Adium plugin, cleaned it up
to assume that we're already using WebkitWebView in GtkConv, and got
Adium themes working. I also added things like changing theme
"variants" on-the-fly, enabling/disabling the plugin cleanly etc.
At this point I rewrote some of the smiley-replace-in-message code,
because the existing one was internal to GtkIMHtml. (More work needs
to be done on this!)
How to try out Adium Themes
---------------------------
If you want to try out Adium Themes, here's how:
* Download a Message Style from [2]. Extract it, and copy the
"Contents" directory to ~/.purple/style/Contents
* Get the webkit code from the git repository, build it, run it, and
enable "Adium IMs" plugin. That's it! You can change variants from
the plugin settings.
* (If you have issues with images in the theme, try running pidgin as
"pidgin --config $HOME/.purple", i.e. absolute path to
.purple/. There are a few places in the code where I need to fix
this.)
Things to do
------------
* Adium themes now is currently a plugin. I personally prefer it to
remain as a plugin (the append-to-bottom is something that cannot be
achieved by Adium themes, and some plugins might want to use it),
however, I'll be happy to integrate it as part of core code if
that's what people prefer. If we are to leave Adium themes as a
plugin, then I need to make the appearance of the message view
similar to Pidgin when *not* using the theming plugin. (e.g. typing
notification?)
* Chat windows don't work currently.
* Cleanup gtkconv.c. (Stale code at places.)
* gtkconv->entry. I'd like to remove this dependency on GtkIMHtml. One
of the options is to just use a GtkEntry, and display smileys as
text. (Adium seems to do something like this.)
* Theme selection. (Currently only _variants_ can be changed
on-the-fly.)
* Restore some core plugins that depended on gtkconv->imhtml.
* Inline typing notifications with themes. Needs to extend the Adium
theme specification.
Security considerations
-----------------------
* Need to be careful about javascript being injected from
messages. Since the message view is running in the "file://"
context, a script could potentially access any file on the
system. Suggestions?
Links
-----
[1] http://github.com/felipec/pidgin-clone/
[2] http://www.adiumxtras.com/
Thanks,
--Arnold
More information about the Devel
mailing list