stdole2.tlb

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Jul 20 07:50:25 CDT 2005


Here's a semi-complete stdole2.tlb.  There are a few small issues with
widl and enums that mean that the uuids of two enums are commented
out, as is one function that takes a defaultvalue parameter that is an
enum.  It should be easy enough to fix widl to cope with these.

The harder problem is that coclass StdFont contains dispinterface
FontEvents, which appears later on in the typelib than the coclass
itself.  It's not possible to do this in idl, so we'll need to come up
with some sort of widl extension to let us do so.  For the time being
the reference to FontEvents in StdFont is commented out.

I've not tested this with an InstallShield installer - feedback
welcome.

        Huw Davies <huw at codeweavers.com>
        Implement stdole2.tlb.
-- 
Huw Davies
huw at codeweavers.com
Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.376
diff -u -p -r1.376 configure.ac
--- configure.ac	15 Jul 2005 16:39:42 -0000	1.376
+++ configure.ac	20 Jul 2005 12:38:17 -0000
@@ -1686,6 +1686,7 @@ dlls/shfolder/Makefile
 dlls/shlwapi/Makefile
 dlls/shlwapi/tests/Makefile
 dlls/snmpapi/Makefile
+dlls/stdole2.tlb/Makefile
 dlls/stdole32.tlb/Makefile
 dlls/sti/Makefile
 dlls/strmiids/Makefile
--- /dev/null	2004-02-23 21:02:56.000000000 +0000
+++ dlls/stdole2.tlb/.cvsignore	2005-07-20 13:38:00.356639425 +0100
@@ -0,0 +1,4 @@
+Makefile
+rsrc.res
+std_ole_v2.tlb
+stdole2.tlb.dbg.c
--- /dev/null	2004-02-23 21:02:56.000000000 +0000
+++ dlls/stdole2.tlb/stdole2.tlb.spec	2005-07-20 12:44:23.174992436 +0100
@@ -0,0 +1 @@
+# no exported entry points
--- /dev/null	2004-02-23 21:02:56.000000000 +0000
+++ dlls/stdole2.tlb/std_ole_v2.idl	2005-07-20 13:37:23.366514923 +0100
@@ -0,0 +1,438 @@
+/*
+ * Copyright (C) 2003 Robert Shearman
+ *               2005 Huw Davies
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+[
+  uuid(00020430-0000-0000-C000-000000000046),
+  version(2.0),
+  helpstring("OLE Automation")
+]
+library stdole
+{
+	/* typedefs aren't stored in the type library.
+           These type names are known by the type compiler so it
+           doesn't really matter what we define them as. */
+
+    typedef short VARIANT_BOOL;
+    typedef long BSTR;
+    typedef double CURRENCY;
+    typedef unsigned long HRESULT;
+    typedef void *VARIANT;
+    typedef unsigned long SCODE;
+    
+    typedef struct GUID {
+        unsigned long  Data1;
+        unsigned short Data2;
+        unsigned short Data3;
+        unsigned char  Data4[ 8 ];
+    } GUID;
+
+    typedef struct DISPPARAMS {
+        VARIANT *rgvarg;
+        long *rgdispidNamedArgs;
+        unsigned int cArgs;
+        unsigned int cNamedArgs;
+    } DISPPARAMS;
+
+    typedef struct EXCEPINFO {
+        unsigned short wCode;
+        unsigned short wReserved;
+        BSTR  bstrSource;
+        BSTR  bstrDescription;
+        BSTR  bstrHelpFile;
+        unsigned long dwHelpContext;
+        void *pvReserved;
+        void *pfnDeferredFillIn;
+        SCODE scode;
+    } EXCEPINFO;
+
+    [
+        odl,
+        uuid(00000000-0000-0000-C000-000000000046)
+    ]
+    interface IUnknown
+    {
+        [restricted]
+        HRESULT QueryInterface(
+                               [in] GUID *riid,
+                               [out] void **ppvObj);
+
+        [restricted]
+        unsigned long AddRef();
+
+        [restricted]
+        unsigned long Release();
+    }
+
+    [
+        odl,
+        uuid(00020400-0000-0000-C000-000000000046)
+    ]
+    interface IDispatch : IUnknown
+    {
+        [restricted]
+        HRESULT GetTypeInfoCount(
+                                 [out] unsigned int *pctinfo);
+
+        [restricted]
+        HRESULT GetTypeInfo(
+                            [in] unsigned int itinfo,
+                            [in] unsigned long lcid,
+                            [out] void **pptinfo);
+
+        [restricted]
+        HRESULT GetIDsOfNames(
+                              [in] GUID *riid,
+                              [in] char **rgszNames,
+                              [in] unsigned int cNames,
+                              [in] unsigned long lcid,
+                              [out] long *rgdispid);
+
+        [restricted]
+        HRESULT Invoke(
+                       [in] long dispidMember,
+                       [in] GUID *riid,
+                       [in] unsigned long lcid,
+                       [in] unsigned short wFlags,
+                       [in] DISPPARAMS *pdispparams,
+                       [out] VARIANT *pvarResult,
+                       [out] EXCEPINFO *pexcepinfo,
+                       [out] unsigned int *puArgErr);
+
+    }
+
+    [
+        odl,
+        uuid(00020404-0000-0000-C000-000000000046)
+    ]
+    interface IEnumVARIANT : IUnknown
+    {
+        HRESULT Next(
+                     [in] unsigned long celt,
+                     [in] VARIANT *rgvar,
+                     [out] unsigned long *pceltFetched);
+
+        HRESULT Skip(
+                     [in] unsigned long celt);
+
+        HRESULT Reset();
+
+        HRESULT Clone(
+                      [out] IEnumVARIANT **ppenum);
+    }
+
+    typedef [uuid(66504301-BE0F-101A-8BBB-00AA00300CAB), public]
+        unsigned long OLE_COLOR;
+
+    typedef [uuid(66504302-BE0F-101A-8BBB-00AA00300CAB), public]
+        long OLE_XPOS_PIXELS;
+
+    typedef [uuid(66504303-BE0F-101A-8BBB-00AA00300CAB), public]
+        long OLE_YPOS_PIXELS;
+
+    typedef [uuid(66504304-BE0F-101A-8BBB-00AA00300CAB), public]
+        long OLE_XSIZE_PIXELS;
+
+    typedef [uuid(66504305-BE0F-101A-8BBB-00AA00300CAB), public]
+        long OLE_YSIZE_PIXELS;
+
+    typedef [uuid(66504306-BE0F-101A-8BBB-00AA00300CAB), public]
+        long OLE_XPOS_HIMETRIC;
+
+    typedef [uuid(66504307-BE0F-101A-8BBB-00AA00300CAB), public]
+        long OLE_YPOS_HIMETRIC;
+
+    typedef [uuid(66504308-BE0F-101A-8BBB-00AA00300CAB), public]
+        long OLE_XSIZE_HIMETRIC;
+
+    typedef [uuid(66504309-BE0F-101A-8BBB-00AA00300CAB), public]
+        long OLE_YSIZE_HIMETRIC;
+
+    typedef [uuid(BF030640-9069-101B-AE2D-08002B2EC713), public]
+        float OLE_XPOS_CONTAINER;
+
+    typedef [uuid(BF030641-9069-101B-AE2D-08002B2EC713), public]
+        float OLE_YPOS_CONTAINER;
+
+    typedef [uuid(BF030642-9069-101B-AE2D-08002B2EC713), public]
+        float OLE_XSIZE_CONTAINER;
+
+    typedef [uuid(BF030643-9069-101B-AE2D-08002B2EC713), public]
+        float OLE_YSIZE_CONTAINER;
+
+    typedef [uuid(66504313-BE0F-101A-8BBB-00AA00300CAB), public]
+        int OLE_HANDLE;
+
+    typedef [uuid(6650430B-BE0F-101A-8BBB-00AA00300CAB), public]
+        VARIANT_BOOL OLE_OPTEXCLUSIVE;
+
+    typedef [uuid(BF030644-9069-101B-AE2D-08002B2EC713), public]
+        VARIANT_BOOL OLE_CANCELBOOL;
+
+    typedef [uuid(BF030645-9069-101B-AE2D-08002B2EC713), public]
+        VARIANT_BOOL OLE_ENABLEDEFAULTBOOL;
+
+    /* FIXME: widl can't cope with enum attributes yet */
+    /*
+    [
+     uuid(6650430A-BE0F-101A-8BBB-00AA00300CAB)
+    ]
+    */
+    enum OLE_TRISTATE {
+        Unchecked = 0,
+        Checked = 1,
+        Gray = 2
+    };
+
+    typedef [uuid(6650430D-BE0F-101A-8BBB-00AA00300CAB), public]
+        BSTR FONTNAME;
+
+    typedef [uuid(6650430E-BE0F-101A-8BBB-00AA00300CAB), public]
+        CURRENCY FONTSIZE;
+
+    typedef [uuid(6650430F-BE0F-101A-8BBB-00AA00300CAB), public]
+        VARIANT_BOOL FONTBOLD;
+
+    typedef [uuid(66504310-BE0F-101A-8BBB-00AA00300CAB), public]
+        VARIANT_BOOL FONTITALIC;
+
+    typedef [uuid(66504311-BE0F-101A-8BBB-00AA00300CAB), public]
+        VARIANT_BOOL FONTUNDERSCORE;
+
+    typedef [uuid(66504312-BE0F-101A-8BBB-00AA00300CAB), public]
+        VARIANT_BOOL FONTSTRIKETHROUGH;
+
+
+    [
+     odl,
+     uuid(BEF6E002-A874-101A-8BBA-00AA00300CAB),
+     helpstring("Font Object"),
+     hidden
+    ]
+    interface IFont {
+        [propget] HRESULT Name([out, retval] BSTR *pname);
+        [propput] HRESULT Name([in] BSTR pname);
+
+        [propget] HRESULT Size([out, retval] CURRENCY *psize);
+        [propput] HRESULT Size([in] BSTR psize);
+
+        [propget] HRESULT Bold([out, retval] VARIANT_BOOL *pbold);
+        [propput] HRESULT Bold([in] VARIANT_BOOL pbold);
+
+        [propget] HRESULT Italic([out, retval] VARIANT_BOOL *pitalic);
+        [propput] HRESULT Italic([in] VARIANT_BOOL pitalic);
+
+        [propget] HRESULT Underline([out, retval] VARIANT_BOOL *punderline);
+        [propput] HRESULT Underline([in] VARIANT_BOOL punderline);
+
+        [propget] HRESULT Strikethrough([out, retval] VARIANT_BOOL *pstrikethrough);
+        [propput] HRESULT Strikethrough([in] VARIANT_BOOL pstrikethrough);
+
+        [propget] HRESULT Weight([out, retval] short *pweight);
+        [propput] HRESULT Weight([in] short pweight);
+
+        [propget] HRESULT Charset([out, retval] short *pcharset);
+        [propput] HRESULT Charset([in] short pcharset);
+
+        [propget] HRESULT hFont([out, retval] OLE_HANDLE *phfont);
+        
+        HRESULT Clone([out] IFont **ppfont);
+
+        HRESULT IsEqual([in] IFont *pfontOther);
+
+        HRESULT SetRatio([in] long cyLogical, [in] long cyHimetric);
+
+        HRESULT AddRefHfont([in] OLE_HANDLE hFont);
+
+        HRESULT ReleaseHfont([in] OLE_HANDLE hFont);
+    };
+
+
+    [
+     odl,
+     uuid(BEF6E003-A874-101A-8BBA-00AA00300CAB)
+    ]
+    dispinterface Font {
+    properties:
+        [id(0x0)] BSTR Name;
+        [id(0x2)] CURRENCY Size;
+        [id(0x3)] VARIANT_BOOL Bold;
+        [id(0x4)] VARIANT_BOOL Italic;
+        [id(0x5)] VARIANT_BOOL Underline;
+        [id(0x6)] VARIANT_BOOL Strikethrough;
+        [id(0x7)] short Weight;
+        [id(0x8)] short Charset;
+    methods:
+    }
+
+    typedef [public] Font IFontDisp;
+
+    [
+     uuid(0BE35203-8F91-11CE-9DE3-00AA004BB851)
+    ]
+    coclass StdFont {
+        [default] dispinterface Font;
+        /* FIXME: We can't reference dispinterface FontEvents here because we need it to
+           appear at the end of the typelib. */
+/*      [default, source] dispinterface FontEvents;*/
+        interface IFont;
+    };
+
+    [
+     odl,
+     uuid(7BF80980-BF32-101A-8BBB-00AA00300CAB),
+     helpstring("Picture Object"),
+     hidden
+    ]
+        interface IPicture /*: IUnknown*/ {
+        [propget] HRESULT Handle([out, retval] OLE_HANDLE *phandle);
+
+        [propget] HRESULT hPal([out, retval] OLE_HANDLE *phpal);
+        
+        [propget] HRESULT Type([out, retval] short *ptype);
+
+        [propget] HRESULT Width([out, retval] OLE_XSIZE_HIMETRIC *pwidth);
+
+        [propget] HRESULT Height([out, retval] OLE_YSIZE_HIMETRIC *pheight);
+
+        HRESULT Render([in] int hdc,
+                       [in] long x,
+                       [in] long y,
+                       [in] long cx,
+                       [in] long cy,
+                       [in] OLE_XPOS_HIMETRIC xSrc,
+                       [in] OLE_YPOS_HIMETRIC ySrc,
+                       [in] OLE_XSIZE_HIMETRIC cxSrc,
+                       [in] OLE_YSIZE_HIMETRIC cySrc,
+                       [in] void *prcWBounds);
+
+        [propput] HRESULT hPal([in] OLE_HANDLE phpal);
+
+        [propget] HRESULT CurDC([out, retval] int *phdcOut);
+
+        HRESULT SelectPicture([in] int hdcIn,
+                              [out] int *phdcOut,
+                              [out] OLE_HANDLE *phbmpOut);
+        
+        [propget] HRESULT KeepOriginalFormat([out, retval] VARIANT_BOOL *pfkeep);
+        [propput] HRESULT KeepOriginalFormat([in] VARIANT_BOOL pfkeep);
+
+        HRESULT PictureChanged();
+
+        HRESULT SaveAsFile([in] void *pstm,
+                           [in] VARIANT_BOOL fSaveMemCopy,
+                           [out] long *pcbSize);
+
+        [propget] HRESULT Attributes([out, retval] long *pdwAttr);
+
+        HRESULT SetHdc([in] OLE_HANDLE hdc);
+    };
+
+    [
+     uuid(7BF80981-BF32-101A-8BBB-00AA00300CAB)
+    ]
+    dispinterface Picture {
+    properties:
+        [id(0x0), readonly] OLE_HANDLE Handle;
+        [id(0x2)] OLE_HANDLE hPal;
+        [id(0x3), readonly] short Type; 
+        [id(0x4), readonly] OLE_XSIZE_HIMETRIC Width;
+        [id(0x5), readonly] OLE_XSIZE_HIMETRIC Height;
+    methods:
+        [id(0x6)] void Render(int hdc,
+                              long x,
+                              long y,
+                              long cx,
+                              long cy,
+                              OLE_XPOS_HIMETRIC xSrc,
+                              OLE_YPOS_HIMETRIC ySrc,
+                              OLE_XSIZE_HIMETRIC cxSrc,
+                              OLE_YSIZE_HIMETRIC cySrc,
+                              void *prcWBounds);
+    };
+    
+    typedef [public] Picture IPictureDisp;
+
+    [
+     uuid(0BE35204-8F91-11CE-9DE3-00AA004BB851)
+    ]
+    coclass StdPicture {
+        [default] dispinterface Picture;
+        interface IPicture;
+    };
+
+    /* FIXME: widl can't cope with enum attributes yet */
+    /*
+    [
+     uuid(E6C8FA08-BD9F-11D0-985E-00C04FC29993)
+    ]
+    */
+    enum LoadPictureConstants {
+        Default = 0,
+        Monochrome = 1,
+        VgaColor = 2,
+        Color = 4
+    };
+
+    [
+     dllname("oleaut32.dll"),
+     uuid(91209AC0-60F6-11CF-9C5D-00AA00C1489E),
+     helpstring("Functions for Standard OLE Objects"),
+     helpcontext(0x2775)
+    ]
+    module StdFunctions{
+        /* FIXME: widl can't cope with a defaultvalue of an enum parameter yet. */
+        /* 
+        [
+         entry(0x60000000),
+         helpstring("Loads a picture from a file"),
+         helpcontext(0x2775)
+        ]
+        HRESULT LoadPicture([in, optional] VARIANT filename,
+                            [in, optional, defaultvalue(0)] int widthDesired,
+                            [in, optional, defaultvalue(0)] int heightDesired,
+                            [in, optional, defaultvalue(0)] enum LoadPictureConstants flags,
+                            [out, retval] IPictureDisp **retval);
+        */
+        [
+         entry(0x60000001),
+         helpstring("Saves a picture to a file"),
+         helpcontext(0x2775)
+        ]
+        HRESULT SavePicture([in] IPictureDisp *Picture,
+                            [in] BSTR filename);
+    };
+
+
+    [
+     uuid(4EF6100A-AF88-11D0-9846-00C04FC29993),
+     helpstring("Event Interface for the Font Object"),
+     hidden
+    ]
+    dispinterface FontEvents {
+    properties:
+    methods:
+        [id(0x9)] void FontChanged([in] BSTR PropertyName);
+    };
+
+    typedef [public] FontEvents IFontEventsDisp;
+
+
+};
+
--- /dev/null	2004-02-23 21:02:56.000000000 +0000
+++ dlls/stdole2.tlb/rsrc.rc	2005-07-20 12:38:42.466082003 +0100
@@ -0,0 +1,30 @@
+/*
+ * Resource file for stdole2
+ *
+ * Copyright 2005 Huw Davies
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winnls.h"
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#include "wine/wine_common_ver.rc"
+
+1 TYPELIB LOADONCALL DISCARDABLE std_ole_v2.tlb
--- /dev/null	2004-02-23 21:02:56.000000000 +0000
+++ dlls/stdole2.tlb/Makefile.in	2005-07-20 12:38:11.721355919 +0100
@@ -0,0 +1,12 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+MODULE    = stdole2.tlb
+
+RC_SRCS = rsrc.rc
+RC_TLB = std_ole_v2.tlb
+
+ at MAKE_DLL_RULES@
+
+### Dependencies:



More information about the wine-patches mailing list