Patch to allow access to KHTMLPart's KJS::Interpreter
Richard Moore
rich at xmelegance.org
Sun Nov 9 16:20:34 GMT 2003
The current KHTMLPart API does not allow access to the Interpreter object it
uses internally, this appears to be a relic from the dlopening days. This
lack means that subclasses cannot add new objects to the interpreter and
means that it cannot be used in conjunction with KJSEmbed. The lack also
prevents kexi from using khtml as a way to allow people to code pretty front
ends to a db. This idea has been ok'd with dfaure.
Here's a tiny patch - comments?
Rich.
Index: khtml_part.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_part.h,v
retrieving revision 1.242
diff -r1.242 khtml_part.h
64a65,69
> namespace KJS
> {
> class Interpreter;
> }
>
300a306,310
> * Returns the JavaScript interpreter the part is using.
> */
> KJS::Interpreter *jsInterpreter();
>
> /**
Index: khtml_part.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v
retrieving revision 1.933
diff -r1.933 khtml_part.cpp
767a768,776
> KJS::Interpreter *KHTMLPart::jsInterpreter()
> {
> KJSProxy *proxy = jScript();
> if (!proxy || proxy->paused())
> return 0;
>
> return proxy->interpreter();
> }
>
More information about the kfm-devel
mailing list