Belligero Productions

  • Increase font size
  • Default font size
  • Decrease font size
Open Source

C++ And XPCOM, and some useful hints

E-mail Print PDF

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...

Last Updated on Friday, 10 October 2008 08:15 Read more...
 

D-Bus C API Compilation Problems

E-mail Print PDF

Well, ignore my last post.  At this point, I essentially have nothing done for my project, since I cannot get anything to compile.  I figure it would be essentially impossible to learn Python well enough in time to get my 0.1 release coded, so I started looking into the C API for DBus.

However, I cannot get it to compile.  My first hassle was getting the compiler to find the dbus.h file, which I was able to solve with the proper flags.  Now, when I try to compile, the compiler cannot find required functions.  My code and the compilation errors are posted at http://pastebin.ca/1219504

If i can't get this to compile, then I'm screwed for Friday's due date. Does anybody have any suggestions on how to get this to work?

Last Updated on Saturday, 04 October 2008 22:29
 

Extensions, d-bus, and Python, oh my!

E-mail Print PDF

So far, my project seems to be going fairly well.  Firefox extensions use javascript as their primary language, which unfortunately does not have a wrapper for d-bus, which I need to communicate with NetworkManager.  Fortunately, Python has these wrappers, and I can use Python classes in the Javascript using XPCOM.

What this means, is that I can link Python and Javascript together: use Python for the lower-level stuff, the actual communication, and pass ifno back to the javascript, which can then talk with Firefox, and do the actual login itself.  While I don't know python yet, it looks like a simplistic enough language, and will be the first I've learned that is not C-style.

This should be an intereting experience, and if nothing else, I can add Python to my resume.

 

Scouring the Source

E-mail Print PDF

For the Mozilla Source Code Reading Lab, I have decided to look into how the browser closes a tab.

What I have found, is that from one of many places (I cannot tell exactly where), the function "removeTab" is called, with "aTab" passed in. This then calls "this._endRemoveTab" passing in theaTab, and true.  As near as I can tell, this line is the one that actually removes the tab, however, while the mTabContainer is of type tabcontainer, I am unable to find the definition of the tabcontainer to follow this further

 

Experiences Building Firefox

E-mail Print PDF

So, for the OSD600 lab, I downloaded and built Firefox (Minefield, to be more accurate, otherwise Humphrey's gonna kill me...).  Seeing as when I first got into Linux, we didn't have such fancy things as "Package managers" and had to compile everything from source...  I jest, really, they were there, but I had just never heard of them, nor were they as good as they are now.  but anyways, I used to always build things from source, including the Linux kernel itself, and so this really wasn't all that new of an experience.

What I did learn, though, was a bit about Mercurial, and autoconf.  Wanting to get the latest version, I used mercurial to clone the Mozilla repository to my local machine, and compile it from there.  When this was done, I had the problem of there not being the configure script I was expecting.  Since it was not an official release, it didn't come with one, so I would have to generate one myself.  This took me a little while to figure out, until I came across something in the build documentation (don't ask where, I couldn't find it when I went looking for it) telling me that I needed to use autoconf2.13.  After learning that the newer version of Autoconf I had installed wouldn't work, and I got the 2.13 release, I was finally able to build the newest Minefield.

I've noticed that my build times were substantially less than those from people using similar systems, but I think this is because I had no particular desire to run the tests the make scripts run, so I disabled these is my .mozconfig file.At some point, I should try building this thing on Windows, but that would require me to actually use the OS for somehting more than gaming, which I have no real desire to do...

 


Page 4 of 6

User Login

RSS Feed

feed-image Global