The only way I can get D-Bus working in Javascript is to create an XPCOM object to work as a go-between. In this case, I'm trying to make a pair of C++ classes (dbusSender and dbusReceiver) that will be called by Javascript to do the actual communication for me.
If it wasn't for an article from the Mozilla Developer's Wiki, I wouldn't have been able to get anything done, and without an IDL Author's Guide, I could never have gotten the basic *.idl files written. As it stands, I cannot get it to fully compile (wrong libraries, namely cannot find the usual dbus.h file), but other than a few syntax errors like this, I've solves my major compilation problems.
A few things that might help people in the future
There are 2 trees you need to maintain: The original code, and the compiled (objdir) directory. Below are some things that may help others in the future...
The Tree
My tree in $(topsrcdir)/extensions/nmautologin:
.
|-- Makefile.in
|-- install.rdf
|-- public
| |-- Makefile.in
| |-- dbusReceiver.idl
| `-- dbusSender.idl
`-- src
|-- Makefile.in
|-- dbusComponent.cpp
|-- dbusReceiverImpl.cpp
|-- dbusReceiverImpl.h
|-- dbusSenderImpl.cpp
`-- dbusSenderImpl.h
Interfaces and *.h files
When you make the *.idl files, you cannot use these directly as your header files. In the src directory from above, I have a couple of Impl classes, which have includes for dbusReceiver.h and dbusSender.h. As you can see, these files don't exist!
When you compile the mozilla source into your objdir, the .h files are created in (for me) ~/dev/FF/obj-i686-pc-linux-gnu/extensions/nmautologin/public/_xpidlgen . These files contain example code you need to create a class based off of this interface. I have put the generated header file (with their code example) in a Pastebin so you van see what I mean. The example code from the objdir headers I put into the initial src directory. It's all contained within a #if 0 ... #endif to make sure they don't compile.
Conclusion
I hope this helps somebody else get XPCOM up and running in an extension, and while I have a bit more to go, I'm on the right track, and just have to look back into a couple notes I took from somebody on IRC, and as I write this, I re-compiled, and may have figured out the dbus header issues. The only thing I hate is that it takes over a minute before it gets to my code and it fails... There's info in the article on how to get around this, but I use the time to review my code.





