Project: Cross-platform bindings for wxWebKit

doubi on 2009-06-05T11:46:41

While waiting for the WebKit source tree to check out, I thought it might be good to record here what it is I'm actually working at. The following is the interesting bits from my submission to TPF for GSoC. Any comments, feedback or advice would be welcomed, especially on the relative pros and cons of XS, which would mean my working from Dan Sugalski's Mac-specific module, or SWIG, which I imagine would let me make use of Python's wxWebKit implemenation.

==================================================

Name: Ryan Jendoubi

Email: ryan [dot] jendoubi [] gmail [] com

Project Title: Cross-platform Perl Bindings for wxWebKit

Synopsis

I will create cross-platform Perl bindings for the full functionality of the wxWebKit library, implement the new bindings in an existing Perl project as a proof-of-concept, and provide all necessary documentation and tutorial material to allow people to start using the new components quickly and easily.

Benefits to the Perl/Open Source Community

The WebKit engine is used in all kinds of applications: browsers, media players, web development apps, RSS readers, kiosk apps, IM & email clients, and more [1]. Having a cross-platform browser widget to play with would open up new possibilities to Perl programmers. For example, grappling with separate browser widgets for different platforms took up a lot of unnecessary time for dotReader [2], a cross-platform ebook reader project. With a cross-platform wxWebkit binding, the time taken would have been greatly reduced. Digsby [3], a Python app, shows the potential of using wxWebkit and other wxWidgets via a scripting language. I want to offer those same possibilities to the Perl community.

Further, wxWebkit itself has benefited greatly from the Digsby development effort. I hope that new cross-platform bindings for Perl will also raise interest in the wxWebkit project, so that it may benefit from testing and code contributions from our community.

Finally, the Perl / Open Source community will benefit from integrating a new member with enhanced understanding of GUI development and integrating external libraries with Perl, and the desire to apply my new knowledge in further projects as well as share it in an accessible way to give others an in-road to the community and FLOSS development.

Deliverables

  1. Common Perl bindings for wxWebKit proven to work on at least Linux, Mac and Windows.
  2. A thorough test suite.
  3. Documentation and example code.
  4. A proof-of-concept, integrating WebKit into dotReader [2] using the new bindings, with documentation of the process.
  5. Updating the POD viewer in Padre, the Perl IDE to use WebKit, as an additional use-case with documentation.

Project Details

There exists a Wx-WebKit CPAN module by Dan Sugalski [4] designed only for the Mac, WebKit being the Mac Apple API for WebCore. The first phase of my project will involve examining this module and adapting its concepts to the cross-platform API. I may also examine for reference the existing wxPython bindings for wxWebKit [5], although in contrast to the Wx-WebKit CPAN module these are implemented in SWIG rather than XS.

There are certain WebCore features which have not yet been implemented in wxWebKit, namely plugins, frames, cookies and printing support. Aside from these features then I plan to expose the full functionality of WebCore for Perl programmers.

In addition to standard POD for the new modules, I plan to use my knowledge gained in the proof-of-concept phase to write some introductory documentation for applying wxWebKit to an existing project. I would like to contribute this documentation to the wxPerl pages [6], to make it more easily accessible to newbies and community outsiders.

Project Schedule

  • Documentation to be made continuously throughout the project
  • Now - May 23rd: planning phase
    • Familiarize myself with previous work in the area: WebCore, wxWebKit, the wider wxPerl project, wxPython's WebKit bindings, Dan Sugalski's Wx-WebKit module.
    • Attempt to transfer Mac Wx-WebKit to Linux, use experience to inform course of action from there.
    • Comprehensively map current wxWebKit API to establish extent of required bindings (existing module not updated since 2006).
    • Discussion with mentor and others on how best to proceed.
    • Beginning to work ahead on some coding if possible, as the first three weeks after the official start date overlap with my university exam period.
  • May 25th - June 18th
    • Continue working through up-to-date wxWebKit API specs established in planning phase.
    • Write tests in parallel with new code.
    • Relatively low activity period, but expect to make decent progress.
  • June 18th - July 13th
    • Finish initial implementation.
    • Make sure tests are passing on all systems.
    • Make sure POD is complete and accurate.
  • July 13th - mid August
    • Publicise code available for review by the community.
    • Work new code into dotReader.
    • Work new code into Padre's POD viewer.
    • Write a 'How to' for embedding and interacting with WebKit in a wxPerl application.
    • Complete the project!

References and Likely Mentors

I have discussed this proposal with Eric Wilhelm and Kevin Ollivier, who believed it to be both worthwhile and achievable within the timescale. Their advice has been exceedingly helpful in guiding my planning for the project so far, although neither of them feel able to be the official mentor for the project.

Gabor Szabo has said that the Padre team would be willing to help me update their POD viewer.

Bio

I'm an almost-22-year-old final year undergraduate student, studying Japanese and Politics at the University of Sheffield in South Yorkshire, UK. I've used PHP and Javascript (and AMOS, believe it or not...) which taught me the fundamentals of programming. I've also looked at C++, so I understand some more intricate language features than are commonly found in scripting languages. This experience will be critical in helping me get to grips with XS/SWIG for this project.

I only began to look at Perl in-depth in the past six months, but the character and quality of the Perl community has made a big impression on me. My long-term goal is to create a set of applications for academic collaboration which could be a 'mini-BioPerl' for arts and social science disciplines, and I believe Perl's flexibility and diversity make it the ideal language in which to invest. In taking on this GSoC project I am very much thinking in terms of future uses for the resources I'm going to create. I believe this will give me the drive to see the project finished to the high standards the community demands.

[1] http://trac.webkit.org/wiki/Applications%20using%20WebKit

[2] http://dotreader.com

[3] http://www.digsby.com

[4] http://search.cpan.org/dist/Wx-WebKit/

[5] http://trac.webkit.org/browser/trunk/WebKit/wx/bindings/python

[6] http://wxperl.sourceforge.net/documentation.html

[7] http://socghop.appspot.com/document/show/program/google/gsoc2009/faqs#graduate

Created on: 2009-04-02 09:21:10.122604

Last Modified on: 2009-04-03 08:40:39.942025

==================================================

I didn't anticipate the amount of uni work I'd have for my last few projects and exams, so I'm behind on my schedule. Before getting swamped I spent a few days trying to get WebKit and wxWidgets compiling on WinXP - not having written up my exploits at the time, all I remember now is a strong feeling of frustration. I've uninstalled everything and am starting again, writing up as I go. I'll be putting up a concise and verbose account / how-to when I've got things working. I'm starting on Windows as Kevin Ollivier indicated it would be the trickiest to work with. Hmm, come to think of it, maybe it'd make more sense to get going on Linux first & transfer that knowledge over... oh well.