PATCH: olepic things

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Ciao, Marcus

Changelog:
	Support DllGetClassObject of CLSID_StdPicture.
	PICTYPE_NONE has width/height 0.

Index: dlls/oleaut32/oleaut.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/oleaut.c,v
retrieving revision 1.25
diff -u -r1.25 oleaut.c
--- dlls/oleaut32/oleaut.c	12 Dec 2002 22:24:45 -0000	1.25
+++ dlls/oleaut32/oleaut.c	28 Dec 2002 20:10:14 -0000
@@ -507,6 +507,7 @@
 }
 
 extern void _get_STDFONT_CF(LPVOID);
+extern void _get_STDPIC_CF(LPVOID);
 
 /***********************************************************************
  *		DllGetClassObject (OLEAUT32.1)
@@ -517,6 +518,13 @@
     if (IsEqualGUID(rclsid,&CLSID_StdFont)) {
 	if (IsEqualGUID(iid,&IID_IClassFactory)) {
 	    _get_STDFONT_CF(ppv);
+	    IClassFactory_AddRef((IClassFactory*)*ppv);
+	    return S_OK;
+	}
+    }
+    if (IsEqualGUID(rclsid,&CLSID_StdPicture)) {
+	if (IsEqualGUID(iid,&IID_IClassFactory)) {
+	    _get_STDPIC_CF(ppv);
 	    IClassFactory_AddRef((IClassFactory*)*ppv);
 	    return S_OK;
 	}
Index: dlls/oleaut32/olepicture.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/olepicture.c,v
retrieving revision 1.20
diff -u -r1.20 olepicture.c
--- dlls/oleaut32/olepicture.c	11 Nov 2002 19:54:22 -0000	1.20
+++ dlls/oleaut32/olepicture.c	28 Dec 2002 20:10:14 -0000
@@ -219,6 +219,11 @@
 	newObject->himetricHeight = pictDesc->u.wmf.yExt;
 	break;
 
+      case PICTYPE_NONE:
+	/* not sure what to do here */
+	newObject->himetricWidth = newObject->himetricHeight = 0;
+	break;
+
       case PICTYPE_ICON:
       case PICTYPE_ENHMETAFILE:
       default:
@@ -997,6 +1002,8 @@
     } else {
 	This->desc.picType = PICTYPE_ICON;
 	This->desc.u.icon.hicon = hicon;
+	This->himetricWidth = cifd->idEntries[i].bWidth;
+	This->himetricHeight = cifd->idEntries[i].bHeight;
 	hr = S_OK;
     }
     break;
@@ -1308,3 +1315,63 @@
   IPicture_Release(newpic);
   return hr;
 }
+
+/*******************************************************************************
+ * StdPic ClassFactory
+ */
+typedef struct
+{
+    /* IUnknown fields */
+    ICOM_VFIELD(IClassFactory);
+    DWORD                       ref;
+} IClassFactoryImpl;
+
+static HRESULT WINAPI
+SPCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
+	ICOM_THIS(IClassFactoryImpl,iface);
+
+	FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
+	return E_NOINTERFACE;
+}
+
+static ULONG WINAPI
+SPCF_AddRef(LPCLASSFACTORY iface) {
+	ICOM_THIS(IClassFactoryImpl,iface);
+	return ++(This->ref);
+}
+
+static ULONG WINAPI SPCF_Release(LPCLASSFACTORY iface) {
+	ICOM_THIS(IClassFactoryImpl,iface);
+	/* static class, won't be  freed */
+	return --(This->ref);
+}
+
+static HRESULT WINAPI SPCF_CreateInstance(
+	LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
+) {
+	PICTDESC	pd;
+
+	FIXME("(%p,%p,%s,%p), creating stdpic with PICTYPE_NONE.\n",iface,pOuter,debugstr_guid(riid),ppobj);
+	pd.cbSizeofstruct = sizeof(pd);
+	pd.picType = PICTYPE_NONE;
+	return OleCreatePictureIndirect(&pd,riid,TRUE,ppobj);
+
+}
+
+static HRESULT WINAPI SPCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
+	ICOM_THIS(IClassFactoryImpl,iface);
+	FIXME("(%p)->(%d),stub!\n",This,dolock);
+	return S_OK;
+}
+
+static ICOM_VTABLE(IClassFactory) SPCF_Vtbl = {
+	ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
+	SPCF_QueryInterface,
+	SPCF_AddRef,
+	SPCF_Release,
+	SPCF_CreateInstance,
+	SPCF_LockServer
+};
+static IClassFactoryImpl STDPIC_CF = {&SPCF_Vtbl, 1 };
+
+void _get_STDPIC_CF(LPVOID *ppv) { *ppv = (LPVOID)&STDPIC_CF; }


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux