You are currently viewing a snapshot of taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to, please file a bug.

The xpidl compiler

xpidl is a tool for generating XPCOM interface information, based on XPIDL interface description files. It generates headers for XPCOM objects, runtime type information to call them dynamically through XPConnect and XPCall, and (sometime soon) online documentation.

Building xpidl

xpidl is based on the libIDL idl compiler from the Gnome project. The libIDL compiler depends on glib, also from the gnome project. The xpidl compiler is now part of the build process so that we can use it to generate the headers used by XPCOM components. Please check the build instructions for information on where to get libIDL and glib.

(unix) If you just want to build xpidl, you only need to build a few directories. After pulling mozilla and executing 'configure', you should be able to build xpidl in dist/bin with

        make -C config
        make -C nsprpub
        make -C xpcom/typelib

Using xpidl

See the xpidl build page for instructions on how to add XPIDL files to the Mozilla build process. xpidl can also be used from the command line on unix and windows:
Usage: xpidl [-m mode] [-w] [-v] [-I path] [-o basename] filename.idl
       -w turn on warnings (recommended)
       -v verbose mode (NYI)
       -I add entry to start of include path for ``#include "nsIThing.idl"''
       -o use basename (e.g. ``/tmp/nsIThing'') for output
       -m specify output mode:
          header        Generate C++ header            (.h)
          typelib       Generate XPConnect typelib     (.xpt)
          doc           Generate HTML documentation    (.html)

Writing XPIDL interface files

XPIDL closely resembles OMG IDL, with extended syntax to handle IIDs and additional types. Some examples are in the xpcom/base and xpcom/ds directories of the Mozilla tree.


flames to &
Last modified: Tue Jun 15 03:53:44 PDT 1999