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.






like to see more of your submissions.
fan of the subjects discussed. I also enjoy reading the comments, but
notice that a lot of people should stay on topic to try and add value
to the original blog post. I would also encourage everyone to bookmark
this page to your favorite service to help spread the word. ....
Fake louis vuitton business as usual. Enda Kenny did indeed break an election party promise, and Louis Vuitton Antheia, as a result, rather than having a meaningful debate on whether or not these replica louis vuitton should be closed, we have a bout of handbags over who said what.
We also had the louis vuitton bags showing of hypocrisy that has recently enveloped Fianna Fail. Maybe someone should dig up the audio tape on that one discount louis vuitton, because for the past three months he has provided Louis Vuitton Cosmic.
Louis Vuitton Monogram handbags online shop, Buy cheap Louis vuitton Monogram replica handbag with free shipping to worldwide.
coach outlet online
is feature with top leather which is durable. Classic color is easy to match any clothes and different with other Coach bags. The bag with a large inside pocket and two outside pockets which are very convenient, you can take this bag in any occasions.
coach outlet
has a zippered closure and buckles for extra security. Shiny brass hardware, rounded leather handle, and an interior pocket. It also includes a limited edition Hawaii luggage tag and lock.