Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use xpidl (header.py, typelib.py)

I am working on writing an XPCOM component. I have my idl file, it is very simple, containing only the following:

#include "nsISupports.idl"

[scriptable, uuid(4ead-ba5c-49c9-beb2=64209c7699a)]
interface nsIPageSummary : nsISupports
{
    boolean saveSummary(in nsIDOMDocument document,
                        out unsigned long numLinks,
                        out unsigned long numImages);
};

I downloaded the xulrunner sdk and am trying to generate my headers via the following command, from the directory containing the above file (nsIPageSummary.idl):

~/xulrunner-sdk/sdk/bin/header.py --cachedir=~/xulrunner-sdk/idl/ -o nsIPageSummary.h nsIPageSummary.idl

When this runs, I get the following message:

$ ~/xulrunner-sdk/sdk/bin/header.py --cachedir=~/xulrunner-sdk/idl -o nsIPageSummary.h nsIPageSummary.idl 
Traceback (most recent call last):
  File "~/xulrunner/xulrunner-sdk/sdk/bin/header.py", line 497, in <module>
    idl.resolve(options.incdirs, p)
  File "~/xulrunner/xulrunner-sdk/sdk/bin/xpidl.py", line 285, in resolve
    p.resolve(self)
  File "~/xulrunner-sdk/sdk/bin/xpidl.py", line 255, in resolve
    raise IDLError("File '%s' not found" % self.filename, self.location)
xpidl.IDLError: error: File 'nsISupports.idl' not found, nsIPageSummary.idl line 1:0
#include "nsISupports.idl"

I have verified that the files exist in the above folder. I am using the MDN link (https://developer.mozilla.org/en-US/docs/XPIDL/pyxpidl) as a guide but it isn't helping much. How do I use these tools?

like image 986
basil Avatar asked Oct 02 '12 20:10

basil


1 Answers

You should define ~/xulrunner-sdk/idl/ as your include path:

~/xulrunner-sdk/sdk/bin/header.py -I ~/xulrunner-sdk/idl/ ...

The cache directory on the other hand should really be some temporary directory as the documentation suggests.

like image 157
Wladimir Palant Avatar answered Sep 22 '22 04:09

Wladimir Palant