Changes

Jump to: navigation, search

Researching XPIDL and IDL Technologies

713 bytes added, 12:21, 6 October 2006
Built In Types
== Introduction ==
XPIDL stands for XP Interface Description Language. It is a specification for XPCOM which is a cross platform adapter description language. An adapter description language is used to describe an adapter which unrelated with its machine language. The description of the adapter can use specialized tools to handle automatoc automatic generation of language that is unrelated to the adapter's specifications. Typically XPIDL is frequently used to generate C++ header files and typelib information.
== Language ==
=== Interfaces ===
An interface is declared with the interface keyword, and the simplest possible interface is a declaration without any methods or attributes.
interface nsToolbar {
};
};
C++ get and set methods for attributes are automatically declared for attributes in the
interface. For example attribute name foo generates accessor methods GetFoo and SetFoo.
=== Compiler ===
long PRInt32
long long PRInt64
unsigned short PRUint16
unsigned long PRUint32
unsigned long long PRUint64
float float
double double char char
wchar PRUnichar
string char*
wstring PRUnichar*
=== Include Terminology ===
To referencing interfaces defined in other files, you must type #include "filename.idl".
In XPIDL, #include only includes the file once, so the #include statement does not need the ifdfs ifdefs which will be neede with required for the
the C preprocessor.
 
=== Enumerations and Constants ===
C-style enumerations are not supported in XPIDL because the size of enums can be compiler specific. XPIDL alternatively supports defining constants that appear in the C++ and JavaScript mappings. They must be of type short or long and have to be present inside an interface declaration.
const long flag = 1 << 5; enum { flag = 32 };
const float invalid_constant = 6.0; Warning: const decl 'invalid_constant' was not of type short or long, ignored
 
== NewsGroups ==
 
[http://groups.google.com/group/netscape.public.mozilla.xpcom?lnk=sg netscape.public.mozilla.xpcom]
 
[http://groups.google.com/group/netscape.public.mozilla.os2?lnk=sg netscape.public.mozilla.os2]
 
These groups typically have topics that relate to XPIDL.
 
== Resources ==
 
[http://www.mozilla.org/scriptable/faq.html Frequently Asked Questions about XPConnect and XPIDL]
 
[http://64.233.179.104/translate_c?hl=en&sl=zh-CN&u=http://developer.mozilla.org/cn/docs/XPIDL&prev=/search%3Fq%3DXPIDL%2B%2Bwikipedia%26hl%3Den%26lr%3D%26sa%3DGXPIDL Documentation at Mozilla Development Centre]
 
[http://www.mozilla.org/scriptable/xpidl/idl-authors-guide/rules.html#interfaces Rules And Syntax]
1
edit

Navigation menu