webcore in webkit gtk
In my project (which based on webkit gtk), i want to call some class in webcore. But webkit encapsulation webcore, so i can't call these function directly (I know these through google, so i don't know whether it's correct). eg:
Frame* frame = m_pPage->focusController()->focusedOrMainFrame();
Document* focusedDocument = frame->document();
frame = frame->tree()->top();
Node* focusedNode = focusedDocument->focusedNode();
These class and function are defined in webcore, so i can't call them directly. I want to kn开发者_Go百科ow how to access these? Modify the webkit?
I just need webcore module,so how can i installed webcore with out webkit?
You can try download the webkit source, and go to the last line of "Source/WebKit/gtk/webkit/webkitwebview.cpp" to see the "WebCore::Page* core(WebKitWebView* webView);" function, this the core of convert webkit things to webcore things.
You need let the compiler know the struct of "WebKitWebViewPrivate" which define in the file "webkitwebviewprivate.h". (or you can defined your own WebKitWebViewPrivate to cheat the compiler. At this stage you only let the compiler to know the offset of filed "corePage")
But the difficult thing is you need to export the class Frame, Node, Dcoument and many other class.
So this is possible but difficult.
If you really only want use Frame, Node... You can build the webkit, and in build/.libs dir will have an libWebCore.a which contain all of your needs except the head files.
精彩评论