Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions
Mozilla.XPCOM.TypeInfo Class Reference

List of all members.

Classes

class  MethodDescriptor
struct  ParamDescriptor
struct  TypeDescriptor

Public Types

enum  TypeFlags
enum  TypeTag
enum  ParamFlags
enum  MethodFlags

Public Member Functions

static IntPtr typeinfo_EnumerateInterfacesStart ()
static String typeinfo_EnumerateInterfacesNext (IntPtr e)
static void typeinfo_EnumerateInterfacesStop (IntPtr e)
static int typeinfo_GetParentInfo (String name, out String parentName, out UInt16 methodCount)

Static Public Member Functions

static String GetParentInfo (String name, out UInt16 methodCount)
static MethodDescriptor[] GetMethodData (string ifaceName)
static MethodDescriptor GetMethodData (Guid iid, int index)
static String NameForIID (Guid iid)
static Type TypeForIID (Guid iid)
static MethodDescriptor GetMethodData (string ifaceName, string methodName)
static MethodDescriptor GetMethodData (String ifaceName, int methodIndex)

Private Member Functions

static int typeinfo_GetAllMethodData (String iface, out IntPtr infos, out UInt16 count)
static int typeinfo_GetMethodData (String iface, int method, out IntPtr info)
static int typeinfo_GetMethodData_byname (String iface, String method, out UInt16 index, out IntPtr info)
static int typeinfo_GetMethodData_iid_index (ref Guid iid, int index, out IntPtr xptinfo)
static int typeinfo_GetIIDForParam (String iface, int method, int param, out Guid iid)
static int typeinfo_GetNameForIID (ref Guid iid, out String name)

Static Private Member Functions

static ParamDescriptor BuildParamDescriptor (IntPtr paramptr, int index, MethodDescriptor method)
static ParamDescriptor BuildRetValDescriptor (IntPtr paramptr, MethodDescriptor method)
static ParamDescriptor[] BuildParamDescriptorArray (IntPtr paramptr, int count, MethodDescriptor method)
static MethodDescriptor ConvertMethodDescriptor (IntPtr xptinfo, string ifaceName, int index)

Detailed Description

Definition at line 49 of file typeinfo.cs.


Member Enumeration Documentation

Definition at line 237 of file typeinfo.cs.

                            : byte
    {
        Getter = 0x80, Setter = 0x40, NotXPCOM = 0x20, Constructor = 0x10,
        Hidden = 0x08
    }

Definition at line 163 of file typeinfo.cs.

                           : byte
    {
        In = 0x80, Out = 0x40, RetVal = 0x20, Shared = 0x10, Dipper = 0x08
    }

Definition at line 52 of file typeinfo.cs.

                          : byte
    {
        Pointer = 0x80, UniquePointer = 0x40, Reference = 0x20
    }

Definition at line 57 of file typeinfo.cs.

                        : byte
    {
        Int8 = 0, Int16 = 1, Int32 = 2, Int64 = 3,
        UInt8 = 4, UInt16 = 5, UInt32 = 6, UInt64 = 7,
        Float = 8, Double = 9, Bool = 10, Char = 11,
        WChar = 12, Void = 13, NSIdPtr = 14, AString = 15,
        String = 16, WString = 17, Interface = 18, InterfaceIs = 19,
        Array = 20, StringSizeIs = 21, WStringSizeIs = 22, UTF8String = 23,
        CString = 24, AString_dup = 25
    }

Member Function Documentation

static ParamDescriptor Mozilla.XPCOM.TypeInfo.BuildParamDescriptor ( IntPtr  paramptr,
int  index,
MethodDescriptor  method 
) [inline, static, private]

Definition at line 371 of file typeinfo.cs.

    {
        XPTParamDescriptor xptpd = (XPTParamDescriptor)
            Marshal.PtrToStructure(paramptr, typeof(XPTParamDescriptor));
        ParamDescriptor pd = new ParamDescriptor();
        pd.method = method;
        pd.index = index;
        pd.flags = (ParamFlags) xptpd.param_flags;
        pd.type = xptpd.type;
        return pd;
    }
static ParamDescriptor [] Mozilla.XPCOM.TypeInfo.BuildParamDescriptorArray ( IntPtr  paramptr,
int  count,
MethodDescriptor  method 
) [inline, static, private]

Definition at line 390 of file typeinfo.cs.

    {
        ParamDescriptor[] parr = new ParamDescriptor[count];
        
        for (int i = 0; i < count; i++) {
            parr[i] = BuildParamDescriptor(paramptr, i, method);
            paramptr = (IntPtr)(paramptr.ToInt32() + 8);
        }
        return parr;
    }
static ParamDescriptor Mozilla.XPCOM.TypeInfo.BuildRetValDescriptor ( IntPtr  paramptr,
MethodDescriptor  method 
) [inline, static, private]

Definition at line 384 of file typeinfo.cs.

    {
        return BuildParamDescriptor(paramptr, -1, method);
    }
static MethodDescriptor Mozilla.XPCOM.TypeInfo.ConvertMethodDescriptor ( IntPtr  xptinfo,
string  ifaceName,
int  index 
) [inline, static, private]

Definition at line 403 of file typeinfo.cs.

    {
        XPTMethodDescriptor info;
        info = (XPTMethodDescriptor)
            Marshal.PtrToStructure(xptinfo, typeof(XPTMethodDescriptor));
        MethodDescriptor meth = new MethodDescriptor();
        meth.ifaceName = ifaceName;
        meth.index = index;
        meth.name = System.Char.ToUpper(info.name[0]) + info.name.Substring(1);
        meth.flags = (MethodFlags)info.flags;
        meth.args = BuildParamDescriptorArray(info.args, info.numArgs, meth);
        meth.result = BuildRetValDescriptor(info.result, meth);
        if (meth.IsVisible()) {
            meth.resultType = meth.FindResultType();
            meth.BuildArgTypes();
        }
        return meth;
    }

Here is the call graph for this function:

static MethodDescriptor [] Mozilla.XPCOM.TypeInfo.GetMethodData ( string  ifaceName) [inline, static]

Definition at line 424 of file typeinfo.cs.

    {
        IntPtr buffer;
        UInt16 count;

        int res = typeinfo_GetAllMethodData(ifaceName, out buffer, out count);
        if (res != 0) {
            throw new Exception(String.Format("GetAllMethodData({0}) " +
                                              "failed: {1:X8}",
                                              ifaceName, res));
        }            

        MethodDescriptor[] methods = new MethodDescriptor[count];

        for (int i = 0; i < (UInt16)count; i++) {
            IntPtr infoptr = Marshal.ReadIntPtr(buffer, i * 
                                                Marshal.SizeOf(typeof(IntPtr)));
            try {
                methods[i] = ConvertMethodDescriptor(infoptr, ifaceName, i);
            } catch (Exception e) {
                Console.WriteLine("skipping {0}[{1}]: {2}",
                                  ifaceName, i, e.Message);
            }
        }

        if (count > 0)
            Marshal.FreeCoTaskMem(buffer);

        return methods;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static MethodDescriptor Mozilla.XPCOM.TypeInfo.GetMethodData ( Guid  iid,
int  index 
) [inline, static]

Definition at line 455 of file typeinfo.cs.

    {
        IntPtr xptinfo;
        int res = typeinfo_GetMethodData_iid_index(ref iid, index,
                                                   out xptinfo);
        if (res != 0) {
            throw new Exception(String.Format("GetMethodData({0}.{1}) " +
                                              "failed: {2:X8}",
                                              iid, index, res));
        }

        String name;
        res = typeinfo_GetNameForIID(ref iid, out name);
        if (res != 0) {
            throw new Exception(String.Format("GetNameForIID failed: {0:X8}",
                                              res));
        }
        return ConvertMethodDescriptor(xptinfo, name, index);
    }

Here is the call graph for this function:

static MethodDescriptor Mozilla.XPCOM.TypeInfo.GetMethodData ( string  ifaceName,
string  methodName 
) [inline, static]

Definition at line 494 of file typeinfo.cs.

    {
        IntPtr xptinfo;
        UInt16 index;
        int res = typeinfo_GetMethodData_byname(ifaceName, methodName,
                                                out index, out xptinfo);

        if (res != 0) {
            throw new Exception(String.Format("GetMethodData({0}.{1}) " +
                                              "failed: {2:X8}",
                                              ifaceName, methodName, res));
        }

        // Console.WriteLine("{0} is index {1}", methodName, index);

        return ConvertMethodDescriptor(xptinfo, ifaceName, (int)index);
    }

Here is the call graph for this function:

static MethodDescriptor Mozilla.XPCOM.TypeInfo.GetMethodData ( String  ifaceName,
int  methodIndex 
) [inline, static]

Definition at line 513 of file typeinfo.cs.

    {
        IntPtr xptinfo;
        
        int res = typeinfo_GetMethodData(ifaceName, methodIndex, out xptinfo);

        if (xptinfo == IntPtr.Zero) {
            throw new Exception(String.Format("GetMethodData({0}:{1}) failed:" +
                                              " {2:X8}",
                                              ifaceName, methodIndex, res));
        }

        return ConvertMethodDescriptor(xptinfo, ifaceName, methodIndex);
    }

Here is the call graph for this function:

static String Mozilla.XPCOM.TypeInfo.GetParentInfo ( String  name,
out UInt16  methodCount 
) [inline, static]

Definition at line 359 of file typeinfo.cs.

    {
        String parentName;
        int res = typeinfo_GetParentInfo(name, out parentName,
                                         out methodCount);
        if (res != 0) {
            throw new Exception(String.Format("GetParentInfo({0}) " +
                                              "failed: {1:X8}", name, res));
        }
        return parentName;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static String Mozilla.XPCOM.TypeInfo.NameForIID ( Guid  iid) [inline, static]

Definition at line 475 of file typeinfo.cs.

    {
        String name;
        int res = typeinfo_GetNameForIID(ref iid, out name);
        if (res != 0) {
            throw new 
                Exception(String.Format("GetNameForIID failed: {0:X8}",
                                        res));
        }
        return name;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static Type Mozilla.XPCOM.TypeInfo.TypeForIID ( Guid  iid) [inline, static]

Definition at line 487 of file typeinfo.cs.

    {
        String ifaceName = "Mozilla.XPCOM.Interfaces." + NameForIID(iid) +
            ",Mozilla.XPCOM.Interfaces";
        return System.Type.GetType(ifaceName);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

static int Mozilla.XPCOM.TypeInfo.typeinfo_GetAllMethodData ( String  iface,
out IntPtr  infos,
out UInt16  count 
) [private]
static int Mozilla.XPCOM.TypeInfo.typeinfo_GetIIDForParam ( String  iface,
int  method,
int  param,
out Guid  iid 
) [private]
static int Mozilla.XPCOM.TypeInfo.typeinfo_GetMethodData ( String  iface,
int  method,
out IntPtr  info 
) [private]
static int Mozilla.XPCOM.TypeInfo.typeinfo_GetMethodData_byname ( String  iface,
String  method,
out UInt16  index,
out IntPtr  info 
) [private]
static int Mozilla.XPCOM.TypeInfo.typeinfo_GetMethodData_iid_index ( ref Guid  iid,
int  index,
out IntPtr  xptinfo 
) [private]
static int Mozilla.XPCOM.TypeInfo.typeinfo_GetNameForIID ( ref Guid  iid,
out String  name 
) [private]
static int Mozilla.XPCOM.TypeInfo.typeinfo_GetParentInfo ( String  name,
out String  parentName,
out UInt16  methodCount 
)

The documentation for this class was generated from the following file: