[webkit-dev] Language Bindings
kevino at theolliviers.com
Fri Jan 8 11:37:11 PST 2010
On Jan 7, 2010, at 5:15 PM, AS wrote:
> I'm looking into adding bindings for Python to the webkit DOM objects.
> Ideally, what I would like to create is WebKit based application that can use Python for DHTML manipulation.
> From the generated files, I a bit unclear as to where the actual objects are instaniated, i.e. if some jscript created a new say node, is there a table of class names / ctores somewhere?
> Would it be possible for someone to give a quick overview of what process should be followed to create a new language binding.
The wx port actually has this capability to some degree. (Not sure if it has been implemented elsewhere yet.) You can check the wxPython release for Mac and Win (Ubuntu is coming hopefully soon) here:
There's also a sample HTML editor app that uses DOM APIs to do all it's property changes. The source for it is here:
Some methods in that code that touch the DOM are the GetParent method (finds if the current selection is inside a particular tag, such as A) and ShowEditorForTag, which uses a pre-defined attribute list to grab the current value from the DOM, show an editor, and then set the user-specified value on the DOM element when the editor is closed.
I haven't landed the bindings yet in trunk as they are a somewhat large project and I'm still working on them. To create them, what I did was add a new bindings generator in WebCore/bindings/scripts that generated C++ bindings. (I based it off the CodeGeneratorCOM.pm script but I had to modify it quite a bit to output COM-free C++ code.) Then I used SWIG to wrap those as Python objects.
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev