The Mozilla
Organization
Our Mission
Who We Are
Getting Involved
Community
Editorials
What's New
Newsbot
Development
Roadmap
Module Owners
Blue Sky
Projects
Status
Tools
Products
Source Code
Binaries
Documentation
License Terms
Bug Reports
Quality
Search
Feedback


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. We want to incorporate xpidl into the build process so that we can use it to generate the headers used by XPCOM components. When it's there, libIDL and glib must be part of the build environment. To get them:
  • Unixes: Source tarballs and Linux RPMs for libIDL are available through the Mozilla ftp site. glib should already be around on unix builds as a dependence of gtk.
  • Win32: libIDL and glib libraries are available in the wintools.zip file; ftp it, or get the buildtools distribution via cvs from mozilla with 'cvs -z3 checkout buildtools'. If you've set the MOZ_TOOLS variable, buildtools/windows/install.bat will put the library files in the proper places.
  • Macintosh: Patrick Beard has ported xpidl to the Macintosh as a CodeWarrior plugin. See the documentation for details, or see the Macintosh build page for details on how to download and install it.

Using xpidl

From the xpidl usage message:
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
       -s emit JS stub declarations in headers for use with -m stub
       -m specify output mode:
          header        Generate C++ header            (.h)
          stub          Generate C++ JS API stubs      (.cpp)
          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 href="http://lxr.mozilla.org/mozilla/source/xpcom/ds">xpcom/ds directories of the Mozilla tree.

Information on XPIDL syntax is available here, as well as an IDL author's guide here.

xpidl in the Mozilla build

We've added a number of build rules to make it easy to create XPIDL interfaces for your components. See the XPIDL build page for details.

mccabe@netscape.com

Last modified: Fri May 28 12:35:45 PDT 1999



Copyright © 1998 The Mozilla Organization.