admin管理员组文章数量:1415420
I have to admit I'm new to WebKit so asking the right question is not that easy.
What I have is the WebKit from WebKit. It updates, builds, I can debug - I got it working on Windows.
What I'm interested in is how to generate the stub files for some IDL files that I have. I understand the high level picture:
- Write the interfaces using the IDL language
- Generate stub files (.h & .cpp files).
- Add your code in the previously generated stub files.
I've specified my IDL files in "WebCore.gypi". I've specified then the path to my IDL files in "WebCore.gyp". Apparently this is not enough as building the WebKit doesn't generate the stub files for my IDL files.
I've suspected at one point that maybe my IDL files contain undefined attributes but everything seems fine.
Any tips? Also, do you know of any explicit "How to"?
Thanks!
Edit 130206:
I dug some more and apparently WebKit interacts with several build systems; for example GYP is for Chromium. I honestly didn't expect that plication so I didn't mention I needed to generate binding for Safari which has a different build system and as such its own unique "how to". So, the question would now be, how does the Safari build system work? Where do I need to place my IDL files? Thanks!
I have to admit I'm new to WebKit so asking the right question is not that easy.
What I have is the WebKit from WebKit. It updates, builds, I can debug - I got it working on Windows.
What I'm interested in is how to generate the stub files for some IDL files that I have. I understand the high level picture:
- Write the interfaces using the IDL language
- Generate stub files (.h & .cpp files).
- Add your code in the previously generated stub files.
I've specified my IDL files in "WebCore.gypi". I've specified then the path to my IDL files in "WebCore.gyp". Apparently this is not enough as building the WebKit doesn't generate the stub files for my IDL files.
I've suspected at one point that maybe my IDL files contain undefined attributes but everything seems fine.
Any tips? Also, do you know of any explicit "How to"?
Thanks!
Edit 130206:
I dug some more and apparently WebKit interacts with several build systems; for example GYP is for Chromium. I honestly didn't expect that plication so I didn't mention I needed to generate binding for Safari which has a different build system and as such its own unique "how to". So, the question would now be, how does the Safari build system work? Where do I need to place my IDL files? Thanks!
Share Improve this question edited Feb 6, 2013 at 6:49 takanokage asked Jan 31, 2013 at 13:40 takanokagetakanokage 1717 bronze badges1 Answer
Reset to default 8Well, I can tell you what helped me. Unfortunately I still couldn't find any documentation so a lot of trial and error was involved.
If you want to generate JS bindings for Safari you have to:
- Modify 'DerivedSources.make'.
- Make sure your IDL files are correct.
'DerivedSources.make' can be found in '\WebKit\Source\WebCore\'. Inside this make file you have to specify the following:
- The path to your folder (containing the IDL files) in 'VPATH'.
- Each and all of your IDL files in 'BINDINGS_IDLS'.
- Again the path to your folder in 'IDL_INCLUDES'.
Build WebKit. If after this step you still can't see your JSXXX.h and JSXXX.cpp files (genererated for each XXX.IDL file) than you have to check your IDL files.
In my case nothing was generated after the build step and I got an error like this:
6>Next token should be implements, but MyModule at module MyModule {
6> IDLParser.pm:750 at /WebKit/Source/WebCore/bindings/scripts//IDLParser.pm line 129.
6> in /WebKit/Source/WebCore/MyFolder/XXX.idl at /WebKit/Source/WebCore/bindings/scripts//IDLParser.pm line 173.
6>/WebKit/Source/WebCore/DerivedSources.make:1024: recipe for target `XXX.h' failed
6>make: * [XXX.h] Error 255
The problem was that each of the IDL interfaces where enclosed in a module (namespace) called MyModule as you can see above. I've removed all this modules (keeping the interfaces of course) and at the next build everything was generated just fine. Using your own module name seems to not be as straight-forward as enclosing the IDL interfaces with it; most probably you'd be forced to write custom bindings to acplish this (which is not remended by the WebKit team).
So that was it for me, hope it's also helpful to you.
本文标签: javascriptWebKit JS bindings step by step how toStack Overflow
版权声明:本文标题:javascript - WebKit JS bindings: step by step how to - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745201680a2647408.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论