source: trunk/src/oleaut32/olepicture.c@ 7504

Last change on this file since 7504 was 7501, checked in by phaller, 24 years ago

Fixed out-of-scope TRACEs and FIXMEs

File size: 36.9 KB
Line 
1/*
2 * OLE Picture object
3 *
4 * Implementation of OLE IPicture and related interfaces
5 *
6 * Copyright 2000 Huw D M Davies for CodeWeavers.
7 * Copyright 2001 Marcus Meissner
8 *
9 *
10 * BUGS
11 *
12 * Support PICTYPE_BITMAP and PICTYPE_ICON, altough only bitmaps very well..
13 * Lots of methods are just stubs.
14 *
15 *
16 * NOTES (or things that msdn doesn't tell you)
17 *
18 * The width and height properties are returned in HIMETRIC units (0.01mm)
19 * IPicture::Render also uses these to select a region of the src picture.
20 * A bitmap's size is converted into these units by using the screen resolution
21 * thus an 8x8 bitmap on a 96dpi screen has a size of 212x212 (8/96 * 2540).
22 *
23 */
24#ifdef __WIN32OS2__
25#define HAVE_FLOAT_H
26#define WINE_LARGE_INTEGER
27#include "oleaut32.h"
28#endif
29
30#include "config.h"
31
32#include <unistd.h>
33#include <stdio.h>
34#include <string.h>
35#include "winerror.h"
36#include "winbase.h"
37#include "wingdi.h"
38#include "winuser.h"
39#include "ole2.h"
40#include "olectl.h"
41#include "oleauto.h"
42#include "wine/obj_picture.h"
43#include "wine/obj_connection.h"
44#include "connpt.h"
45#include "debugtools.h"
46
47#include "wine/wingdi16.h"
48#include "cursoricon.h"
49
50#ifdef HAVE_LIBJPEG
51/* This is a hack, so jpeglib.h does not redefine INT32 and the like*/
52#define XMD_H
53#ifdef HAVE_JPEGLIB_H
54# include <jpeglib.h>
55#endif
56#endif
57
58#ifdef __WIN32OS2__
59#undef FIXME
60#undef TRACE
61#ifdef DEBUG
62// PH 2001-11-30
63// this macro definition causes the control leave the scope of a
64// non-curly-braced preceeding if statement. Therefore,
65// if (p!=NULL)
66// TRACE("p->a=%d", p->a)
67// crashes.
68//
69// !!! ENSURE TRACES AND FIXMES WITH PRECEEDING IF STATEMENT
70// !!! ARE PUT INTO CURLY BRACES
71#define TRACE WriteLog("%s", __FUNCTION__); WriteLog
72#define FIXME WriteLog("FIXME %s", __FUNCTION__); WriteLog
73#else
74#define TRACE 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
75#define FIXME 1 ? (void)0 : (void)((int (*)(char *, ...)) NULL)
76#endif
77#endif
78
79DEFAULT_DEBUG_CHANNEL(ole);
80
81/*************************************************************************
82 * Declaration of implementation class
83 */
84
85typedef struct OLEPictureImpl {
86
87 /*
88 * IPicture handles IUnknown
89 */
90
91 ICOM_VTABLE(IPicture) *lpvtbl1;
92 ICOM_VTABLE(IDispatch) *lpvtbl2;
93 ICOM_VTABLE(IPersistStream) *lpvtbl3;
94 ICOM_VTABLE(IConnectionPointContainer) *lpvtbl4;
95
96 /* Object referenece count */
97 DWORD ref;
98
99 /* We own the object and must destroy it ourselves */
100 BOOL fOwn;
101
102 /* Picture description */
103 PICTDESC desc;
104
105 /* These are the pixel size of a bitmap */
106 DWORD origWidth;
107 DWORD origHeight;
108
109 /* And these are the size of the picture converted into HIMETRIC units */
110 OLE_XSIZE_HIMETRIC himetricWidth;
111 OLE_YSIZE_HIMETRIC himetricHeight;
112
113 IConnectionPoint *pCP;
114
115 BOOL keepOrigFormat;
116 HDC hDCCur;
117} OLEPictureImpl;
118
119/*
120 * Macros to retrieve pointer to IUnknown (IPicture) from the other VTables.
121 */
122#define ICOM_THIS_From_IDispatch(impl, name) \
123 impl *This = (impl*)(((char*)name)-sizeof(void*));
124#define ICOM_THIS_From_IPersistStream(impl, name) \
125 impl *This = (impl*)(((char*)name)-2*sizeof(void*));
126#define ICOM_THIS_From_IConnectionPointContainer(impl, name) \
127 impl *This = (impl*)(((char*)name)-3*sizeof(void*));
128
129/*
130 * Predeclare VTables. They get initialized at the end.
131 */
132static ICOM_VTABLE(IPicture) OLEPictureImpl_VTable;
133static ICOM_VTABLE(IDispatch) OLEPictureImpl_IDispatch_VTable;
134static ICOM_VTABLE(IPersistStream) OLEPictureImpl_IPersistStream_VTable;
135static ICOM_VTABLE(IConnectionPointContainer) OLEPictureImpl_IConnectionPointContainer_VTable;
136
137/***********************************************************************
138 * Implementation of the OLEPictureImpl class.
139 */
140
141static void OLEPictureImpl_SetBitmap(OLEPictureImpl*This) {
142 BITMAP bm;
143 HDC hdcRef;
144
145 TRACE("bitmap handle %08x\n", This->desc.u.bmp.hbitmap);
146 if(GetObjectA(This->desc.u.bmp.hbitmap, sizeof(bm), &bm) != sizeof(bm)) {
147 ERR("GetObject fails\n");
148 return;
149 }
150 This->origWidth = bm.bmWidth;
151 This->origHeight = bm.bmHeight;
152 /* The width and height are stored in HIMETRIC units (0.01 mm),
153 so we take our pixel width divide by pixels per inch and
154 multiply by 25.4 * 100 */
155 /* Should we use GetBitmapDimension if available? */
156 hdcRef = CreateCompatibleDC(0);
157 This->himetricWidth =(bm.bmWidth *2540)/GetDeviceCaps(hdcRef, LOGPIXELSX);
158 This->himetricHeight=(bm.bmHeight*2540)/GetDeviceCaps(hdcRef, LOGPIXELSY);
159 DeleteDC(hdcRef);
160}
161
162/************************************************************************
163 * OLEPictureImpl_Construct
164 *
165 * This method will construct a new instance of the OLEPictureImpl
166 * class.
167 *
168 * The caller of this method must release the object when it's
169 * done with it.
170 */
171static OLEPictureImpl* OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn)
172{
173 OLEPictureImpl* newObject = 0;
174
175 if (pictDesc)
176 {
177 // PH 2001-11-29 TRACE must be in curly braces otherwise
178 // the scope of the if statement is left and we'll crash
179 // on picDesc == NULL
180 TRACE("(%p) type = %d\n", pictDesc, pictDesc->picType);
181 }
182
183 /*
184 * Allocate space for the object.
185 */
186 newObject = HeapAlloc(GetProcessHeap(), 0, sizeof(OLEPictureImpl));
187
188 if (newObject==0)
189 return newObject;
190
191 /*
192 * Initialize the virtual function table.
193 */
194 newObject->lpvtbl1 = &OLEPictureImpl_VTable;
195 newObject->lpvtbl2 = &OLEPictureImpl_IDispatch_VTable;
196 newObject->lpvtbl3 = &OLEPictureImpl_IPersistStream_VTable;
197 newObject->lpvtbl4 = &OLEPictureImpl_IConnectionPointContainer_VTable;
198
199 CreateConnectionPoint((IUnknown*)newObject,&IID_IPropertyNotifySink,&newObject->pCP);
200
201 /*
202 * Start with one reference count. The caller of this function
203 * must release the interface pointer when it is done.
204 */
205 newObject->ref = 1;
206 newObject->hDCCur = 0;
207
208 newObject->fOwn = fOwn;
209
210 /* dunno about original value */
211 newObject->keepOrigFormat = TRUE;
212
213 if (pictDesc) {
214 if(pictDesc->cbSizeofstruct != sizeof(PICTDESC)) {
215 FIXME("struct size = %d\n", pictDesc->cbSizeofstruct);
216 }
217 memcpy(&newObject->desc, pictDesc, sizeof(PICTDESC));
218
219
220 switch(pictDesc->picType) {
221 case PICTYPE_BITMAP:
222 OLEPictureImpl_SetBitmap(newObject);
223 break;
224
225 case PICTYPE_METAFILE:
226 TRACE("metafile handle %08x\n", pictDesc->u.wmf.hmeta);
227 newObject->himetricWidth = pictDesc->u.wmf.xExt;
228 newObject->himetricHeight = pictDesc->u.wmf.yExt;
229 break;
230
231 case PICTYPE_ICON:
232 case PICTYPE_ENHMETAFILE:
233 default:
234 FIXME("Unsupported type %d\n", pictDesc->picType);
235 newObject->himetricWidth = newObject->himetricHeight = 0;
236 break;
237 }
238 } else {
239 newObject->desc.picType = PICTYPE_UNINITIALIZED;
240 }
241
242 TRACE("returning %p\n", newObject);
243 return newObject;
244}
245
246/************************************************************************
247 * OLEPictureImpl_Destroy
248 *
249 * This method is called by the Release method when the reference
250 * count goes down to 0. It will free all resources used by
251 * this object. */
252static void OLEPictureImpl_Destroy(OLEPictureImpl* Obj)
253{
254 TRACE("(%p)\n", Obj);
255
256 if(Obj->fOwn) { /* We need to destroy the picture */
257 switch(Obj->desc.picType) {
258 case PICTYPE_BITMAP:
259 DeleteObject(Obj->desc.u.bmp.hbitmap);
260 break;
261 case PICTYPE_METAFILE:
262 DeleteMetaFile(Obj->desc.u.wmf.hmeta);
263 break;
264 case PICTYPE_ICON:
265 DestroyIcon(Obj->desc.u.icon.hicon);
266 break;
267 case PICTYPE_ENHMETAFILE:
268 DeleteEnhMetaFile(Obj->desc.u.emf.hemf);
269 break;
270 default:
271 FIXME("Unsupported type %d - unable to delete\n", Obj->desc.picType);
272 break;
273 }
274 }
275 HeapFree(GetProcessHeap(), 0, Obj);
276}
277
278static ULONG WINAPI OLEPictureImpl_AddRef(IPicture* iface);
279
280/************************************************************************
281 * OLEPictureImpl_QueryInterface (IUnknown)
282 *
283 * See Windows documentation for more details on IUnknown methods.
284 */
285static HRESULT WINAPI OLEPictureImpl_QueryInterface(
286 IPicture* iface,
287 REFIID riid,
288 void** ppvObject)
289{
290 ICOM_THIS(OLEPictureImpl, iface);
291 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject);
292
293 /*
294 * Perform a sanity check on the parameters.
295 */
296 if ( (This==0) || (ppvObject==0) )
297 return E_INVALIDARG;
298
299 /*
300 * Initialize the return parameter.
301 */
302 *ppvObject = 0;
303
304 /*
305 * Compare the riid with the interface IDs implemented by this object.
306 */
307 if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
308 {
309 *ppvObject = (IPicture*)This;
310 }
311 else if (memcmp(&IID_IPicture, riid, sizeof(IID_IPicture)) == 0)
312 {
313 *ppvObject = (IPicture*)This;
314 }
315 else if (memcmp(&IID_IDispatch, riid, sizeof(IID_IDispatch)) == 0)
316 {
317 *ppvObject = (IDispatch*)&(This->lpvtbl2);
318 }
319 else if (memcmp(&IID_IPictureDisp, riid, sizeof(IID_IPictureDisp)) == 0)
320 {
321 *ppvObject = (IDispatch*)&(This->lpvtbl2);
322 }
323 else if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0)
324 {
325 *ppvObject = (IPersistStream*)&(This->lpvtbl3);
326 }
327 else if (memcmp(&IID_IConnectionPointContainer, riid, sizeof(IID_IConnectionPointContainer)) == 0)
328 {
329 *ppvObject = (IConnectionPointContainer*)&(This->lpvtbl4);
330 }
331 /*
332 * Check that we obtained an interface.
333 */
334 if ((*ppvObject)==0)
335 {
336 FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid));
337 return E_NOINTERFACE;
338 }
339
340 /*
341 * Query Interface always increases the reference count by one when it is
342 * successful
343 */
344 OLEPictureImpl_AddRef((IPicture*)This);
345
346 return S_OK;;
347}
348/***********************************************************************
349 * OLEPicture_SendNotify (internal)
350 *
351 * Sends notification messages of changed properties to any interested
352 * connections.
353 */
354static void OLEPicture_SendNotify(OLEPictureImpl* this, DISPID dispID)
355{
356 IEnumConnections *pEnum;
357 CONNECTDATA CD;
358
359 if (IConnectionPoint_EnumConnections(this->pCP, &pEnum))
360 return;
361 while(IEnumConnections_Next(pEnum, 1, &CD, NULL) == S_OK) {
362 IPropertyNotifySink *sink;
363
364 IUnknown_QueryInterface(CD.pUnk, &IID_IPropertyNotifySink, (LPVOID)&sink);
365 IPropertyNotifySink_OnChanged(sink, dispID);
366 IPropertyNotifySink_Release(sink);
367 IUnknown_Release(CD.pUnk);
368 }
369 IEnumConnections_Release(pEnum);
370 return;
371}
372
373/************************************************************************
374 * OLEPictureImpl_AddRef (IUnknown)
375 *
376 * See Windows documentation for more details on IUnknown methods.
377 */
378static ULONG WINAPI OLEPictureImpl_AddRef(
379 IPicture* iface)
380{
381 ICOM_THIS(OLEPictureImpl, iface);
382 TRACE("(%p)->(ref=%ld)\n", This, This->ref);
383 This->ref++;
384
385 return This->ref;
386}
387
388/************************************************************************
389 * OLEPictureImpl_Release (IUnknown)
390 *
391 * See Windows documentation for more details on IUnknown methods.
392 */
393static ULONG WINAPI OLEPictureImpl_Release(
394 IPicture* iface)
395{
396 ICOM_THIS(OLEPictureImpl, iface);
397 TRACE("(%p)->(ref=%ld)\n", This, This->ref);
398
399 /*
400 * Decrease the reference count on this object.
401 */
402 This->ref--;
403
404 /*
405 * If the reference count goes down to 0, perform suicide.
406 */
407 if (This->ref==0)
408 {
409 OLEPictureImpl_Destroy(This);
410
411 return 0;
412 }
413
414 return This->ref;
415}
416
417
418/************************************************************************
419 * OLEPictureImpl_get_Handle
420 */
421static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface,
422 OLE_HANDLE *phandle)
423{
424 ICOM_THIS(OLEPictureImpl, iface);
425 TRACE("(%p)->(%p)\n", This, phandle);
426 switch(This->desc.picType) {
427 case PICTYPE_BITMAP:
428 *phandle = This->desc.u.bmp.hbitmap;
429 break;
430 case PICTYPE_METAFILE:
431 *phandle = This->desc.u.wmf.hmeta;
432 break;
433 case PICTYPE_ICON:
434 *phandle = This->desc.u.icon.hicon;
435 break;
436 case PICTYPE_ENHMETAFILE:
437 *phandle = This->desc.u.emf.hemf;
438 break;
439 default:
440 FIXME("Unimplemented type %d\n", This->desc.picType);
441 return E_NOTIMPL;
442 }
443 TRACE("returning handle %08x\n", *phandle);
444 return S_OK;
445}
446
447/************************************************************************
448 * OLEPictureImpl_get_hPal
449 */
450static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface,
451 OLE_HANDLE *phandle)
452{
453 ICOM_THIS(OLEPictureImpl, iface);
454 FIXME("(%p)->(%p): stub\n", This, phandle);
455 return E_NOTIMPL;
456}
457
458/************************************************************************
459 * OLEPictureImpl_get_Type
460 */
461static HRESULT WINAPI OLEPictureImpl_get_Type(IPicture *iface,
462 short *ptype)
463{
464 ICOM_THIS(OLEPictureImpl, iface);
465 TRACE("(%p)->(%p): type is %d\n", This, ptype, This->desc.picType);
466 *ptype = This->desc.picType;
467 return S_OK;
468}
469
470/************************************************************************
471 * OLEPictureImpl_get_Width
472 */
473static HRESULT WINAPI OLEPictureImpl_get_Width(IPicture *iface,
474 OLE_XSIZE_HIMETRIC *pwidth)
475{
476 ICOM_THIS(OLEPictureImpl, iface);
477 TRACE("(%p)->(%p): width is %ld\n", This, pwidth, This->himetricWidth);
478 *pwidth = This->himetricWidth;
479 return S_OK;
480}
481
482/************************************************************************
483 * OLEPictureImpl_get_Height
484 */
485static HRESULT WINAPI OLEPictureImpl_get_Height(IPicture *iface,
486 OLE_YSIZE_HIMETRIC *pheight)
487{
488 ICOM_THIS(OLEPictureImpl, iface);
489 TRACE("(%p)->(%p): height is %ld\n", This, pheight, This->himetricHeight);
490 *pheight = This->himetricHeight;
491 return S_OK;
492}
493
494/************************************************************************
495 * OLEPictureImpl_Render
496 */
497static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
498 long x, long y, long cx, long cy,
499 OLE_XPOS_HIMETRIC xSrc,
500 OLE_YPOS_HIMETRIC ySrc,
501 OLE_XSIZE_HIMETRIC cxSrc,
502 OLE_YSIZE_HIMETRIC cySrc,
503 LPCRECT prcWBounds)
504{
505 ICOM_THIS(OLEPictureImpl, iface);
506 TRACE("(%p)->(%08x, (%ld,%ld), (%ld,%ld) <- (%ld,%ld), (%ld,%ld), %p)\n",
507 This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, prcWBounds);
508 if(prcWBounds)
509 {
510 TRACE("prcWBounds (%d,%d) - (%d,%d)\n", prcWBounds->left, prcWBounds->top,
511 prcWBounds->right, prcWBounds->bottom);
512 }
513
514 /*
515 * While the documentation suggests this to be here (or after rendering?)
516 * it does cause an endless recursion in my sample app. -MM 20010804
517 OLEPicture_SendNotify(This,DISPID_PICT_RENDER);
518 */
519
520 switch(This->desc.picType) {
521 case PICTYPE_BITMAP:
522 {
523 HBITMAP hbmpOld;
524 HDC hdcBmp;
525
526 /* Set a mapping mode that maps bitmap pixels into HIMETRIC units.
527 NB y-axis gets flipped */
528
529 hdcBmp = CreateCompatibleDC(0);
530 SetMapMode(hdcBmp, MM_ANISOTROPIC);
531 SetWindowOrgEx(hdcBmp, 0, 0, NULL);
532 SetWindowExtEx(hdcBmp, This->himetricWidth, This->himetricHeight, NULL);
533 SetViewportOrgEx(hdcBmp, 0, This->origHeight, NULL);
534 SetViewportExtEx(hdcBmp, This->origWidth, -This->origHeight, NULL);
535
536 hbmpOld = SelectObject(hdcBmp, This->desc.u.bmp.hbitmap);
537
538 StretchBlt(hdc, x, y, cx, cy, hdcBmp, xSrc, ySrc, cxSrc, cySrc, SRCCOPY);
539
540 SelectObject(hdcBmp, hbmpOld);
541 DeleteDC(hdcBmp);
542 }
543 break;
544 case PICTYPE_ICON:
545 FIXME("Not quite correct implementation of rendering icons...\n");
546 DrawIcon(hdc,x,y,This->desc.u.icon.hicon);
547 break;
548
549 case PICTYPE_METAFILE:
550 case PICTYPE_ENHMETAFILE:
551 default:
552 FIXME("type %d not implemented\n", This->desc.picType);
553 return E_NOTIMPL;
554 }
555 return S_OK;
556}
557
558/************************************************************************
559 * OLEPictureImpl_set_hPal
560 */
561static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface,
562 OLE_HANDLE hpal)
563{
564 ICOM_THIS(OLEPictureImpl, iface);
565 FIXME("(%p)->(%08x): stub\n", This, hpal);
566 OLEPicture_SendNotify(This,DISPID_PICT_HPAL);
567 return E_NOTIMPL;
568}
569
570/************************************************************************
571 * OLEPictureImpl_get_CurDC
572 */
573static HRESULT WINAPI OLEPictureImpl_get_CurDC(IPicture *iface,
574 HDC *phdc)
575{
576 ICOM_THIS(OLEPictureImpl, iface);
577 TRACE("(%p), returning %x\n", This, This->hDCCur);
578 if (phdc) *phdc = This->hDCCur;
579 return S_OK;
580}
581
582/************************************************************************
583 * OLEPictureImpl_SelectPicture
584 */
585static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface,
586 HDC hdcIn,
587 HDC *phdcOut,
588 OLE_HANDLE *phbmpOut)
589{
590 ICOM_THIS(OLEPictureImpl, iface);
591 TRACE("(%p)->(%08x, %p, %p)\n", This, hdcIn, phdcOut, phbmpOut);
592 if (This->desc.picType == PICTYPE_BITMAP) {
593 SelectObject(hdcIn,This->desc.u.bmp.hbitmap);
594
595 if (phdcOut)
596 *phdcOut = This->hDCCur;
597 This->hDCCur = hdcIn;
598 if (phbmpOut)
599 *phbmpOut = This->desc.u.bmp.hbitmap;
600 return S_OK;
601 } else {
602 FIXME("Don't know how to select picture type %d\n",This->desc.picType);
603 return E_FAIL;
604 }
605}
606
607/************************************************************************
608 * OLEPictureImpl_get_KeepOriginalFormat
609 */
610static HRESULT WINAPI OLEPictureImpl_get_KeepOriginalFormat(IPicture *iface,
611 BOOL *pfKeep)
612{
613 ICOM_THIS(OLEPictureImpl, iface);
614 TRACE("(%p)->(%p)\n", This, pfKeep);
615 if (!pfKeep)
616 return E_POINTER;
617 *pfKeep = This->keepOrigFormat;
618 return S_OK;
619}
620
621/************************************************************************
622 * OLEPictureImpl_put_KeepOriginalFormat
623 */
624static HRESULT WINAPI OLEPictureImpl_put_KeepOriginalFormat(IPicture *iface,
625 BOOL keep)
626{
627 ICOM_THIS(OLEPictureImpl, iface);
628 TRACE("(%p)->(%d)\n", This, keep);
629 This->keepOrigFormat = keep;
630 /* FIXME: what DISPID notification here? */
631 return S_OK;
632}
633
634/************************************************************************
635 * OLEPictureImpl_PictureChanged
636 */
637static HRESULT WINAPI OLEPictureImpl_PictureChanged(IPicture *iface)
638{
639 ICOM_THIS(OLEPictureImpl, iface);
640 TRACE("(%p)->()\n", This);
641 OLEPicture_SendNotify(This,DISPID_PICT_HANDLE);
642 return S_OK;
643}
644
645/************************************************************************
646 * OLEPictureImpl_SaveAsFile
647 */
648static HRESULT WINAPI OLEPictureImpl_SaveAsFile(IPicture *iface,
649 IStream *pstream,
650 BOOL SaveMemCopy,
651 LONG *pcbSize)
652{
653 ICOM_THIS(OLEPictureImpl, iface);
654 FIXME("(%p)->(%p, %d, %p): stub\n", This, pstream, SaveMemCopy, pcbSize);
655 return E_NOTIMPL;
656}
657
658/************************************************************************
659 * OLEPictureImpl_get_Attributes
660 */
661static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface,
662 DWORD *pdwAttr)
663{
664 ICOM_THIS(OLEPictureImpl, iface);
665 TRACE("(%p)->(%p).\n", This, pdwAttr);
666 *pdwAttr = 0;
667 switch (This->desc.picType) {
668 case PICTYPE_BITMAP: break; /* not 'truely' scalable, see MSDN. */
669 case PICTYPE_ICON: *pdwAttr = PICTURE_TRANSPARENT;break;
670 case PICTYPE_METAFILE: *pdwAttr = PICTURE_TRANSPARENT|PICTURE_SCALABLE;break;
671 default:FIXME("Unknown pictype %d\n",This->desc.picType);break;
672 }
673 return S_OK;
674}
675
676
677/************************************************************************
678 * IConnectionPointContainer
679 */
680
681static HRESULT WINAPI OLEPictureImpl_IConnectionPointContainer_QueryInterface(
682 IConnectionPointContainer* iface,
683 REFIID riid,
684 VOID** ppvoid
685) {
686 ICOM_THIS_From_IConnectionPointContainer(IPicture,iface);
687
688 return IPicture_QueryInterface(This,riid,ppvoid);
689}
690
691static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_AddRef(
692 IConnectionPointContainer* iface)
693{
694 ICOM_THIS_From_IConnectionPointContainer(IPicture, iface);
695
696 return IPicture_AddRef(This);
697}
698
699static ULONG WINAPI OLEPictureImpl_IConnectionPointContainer_Release(
700 IConnectionPointContainer* iface)
701{
702 ICOM_THIS_From_IConnectionPointContainer(IPicture, iface);
703
704 return IPicture_Release(This);
705}
706
707static HRESULT WINAPI OLEPictureImpl_EnumConnectionPoints(
708 IConnectionPointContainer* iface,
709 IEnumConnectionPoints** ppEnum
710) {
711 ICOM_THIS_From_IConnectionPointContainer(IPicture, iface);
712
713 FIXME("(%p,%p), stub!\n",This,ppEnum);
714 return E_NOTIMPL;
715}
716
717static HRESULT WINAPI OLEPictureImpl_FindConnectionPoint(
718 IConnectionPointContainer* iface,
719 REFIID riid,
720 IConnectionPoint **ppCP
721) {
722 ICOM_THIS_From_IConnectionPointContainer(OLEPictureImpl, iface);
723 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppCP);
724 if (!ppCP)
725 return E_POINTER;
726 *ppCP = NULL;
727 if (IsEqualGUID(riid,&IID_IPropertyNotifySink))
728 return IConnectionPoint_QueryInterface(This->pCP,&IID_IConnectionPoint,(LPVOID)ppCP);
729 FIXME("tried to find connection point on %s?\n",debugstr_guid(riid));
730 return 0x80040200;
731}
732/************************************************************************
733 * IPersistStream
734 */
735/************************************************************************
736 * OLEPictureImpl_IPersistStream_QueryInterface (IUnknown)
737 *
738 * See Windows documentation for more details on IUnknown methods.
739 */
740static HRESULT WINAPI OLEPictureImpl_IPersistStream_QueryInterface(
741 IPersistStream* iface,
742 REFIID riid,
743 VOID** ppvoid)
744{
745 ICOM_THIS_From_IPersistStream(IPicture, iface);
746
747 return IPicture_QueryInterface(This, riid, ppvoid);
748}
749
750/************************************************************************
751 * OLEPictureImpl_IPersistStream_AddRef (IUnknown)
752 *
753 * See Windows documentation for more details on IUnknown methods.
754 */
755static ULONG WINAPI OLEPictureImpl_IPersistStream_AddRef(
756 IPersistStream* iface)
757{
758 ICOM_THIS_From_IPersistStream(IPicture, iface);
759
760 return IPicture_AddRef(This);
761}
762
763/************************************************************************
764 * OLEPictureImpl_IPersistStream_Release (IUnknown)
765 *
766 * See Windows documentation for more details on IUnknown methods.
767 */
768static ULONG WINAPI OLEPictureImpl_IPersistStream_Release(
769 IPersistStream* iface)
770{
771 ICOM_THIS_From_IPersistStream(IPicture, iface);
772
773 return IPicture_Release(This);
774}
775
776/************************************************************************
777 * OLEPictureImpl_IPersistStream_GetClassID
778 */
779static HRESULT WINAPI OLEPictureImpl_GetClassID(
780 IPersistStream* iface,CLSID* pClassID)
781{
782 ICOM_THIS_From_IPersistStream(IPicture, iface);
783 FIXME("(%p),stub!\n",This);
784 return E_NOTIMPL;
785}
786
787/************************************************************************
788 * OLEPictureImpl_IPersistStream_IsDirty
789 */
790static HRESULT WINAPI OLEPictureImpl_IsDirty(
791 IPersistStream* iface)
792{
793 ICOM_THIS_From_IPersistStream(IPicture, iface);
794 FIXME("(%p),stub!\n",This);
795 return E_NOTIMPL;
796}
797
798#ifdef HAVE_LIBJPEG
799/* for the jpeg decompressor source manager. */
800static void _jpeg_init_source(j_decompress_ptr cinfo) { }
801
802static boolean _jpeg_fill_input_buffer(j_decompress_ptr cinfo) {
803 ERR("(), should not get here.\n");
804 return FALSE;
805}
806
807static void _jpeg_skip_input_data(j_decompress_ptr cinfo,long num_bytes) {
808 ERR("(%ld), should not get here.\n",num_bytes);
809}
810
811static boolean _jpeg_resync_to_restart(j_decompress_ptr cinfo, int desired) {
812 ERR("(desired=%d), should not get here.\n",desired);
813 return FALSE;
814}
815static void _jpeg_term_source(j_decompress_ptr cinfo) { }
816#endif /* HAVE_LIBJPEG */
817
818/************************************************************************
819 * OLEPictureImpl_IPersistStream_Load (IUnknown)
820 *
821 * Loads the binary data from the IStream. Starts at current position.
822 * There appears to be an 2 DWORD header:
823 * DWORD magic;
824 * DWORD len;
825 *
826 * Currently implemented: BITMAP, ICON, JPEG.
827 */
828static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
829 HRESULT hr = E_FAIL;
830 ULONG xread;
831 BYTE *xbuf;
832 DWORD header[2];
833 WORD magic;
834 ICOM_THIS_From_IPersistStream(OLEPictureImpl, iface);
835
836 TRACE("(%p,%p)\n",This,pStm);
837
838 hr=IStream_Read(pStm,header,8,&xread);
839 if (hr || xread!=8) {
840 FIXME("Failure while reading picture header (hr is %lx, nread is %ld).\n",hr,xread);
841 return hr;
842 }
843 xread = 0;
844 xbuf = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,header[1]);
845 while (xread < header[1]) {
846 ULONG nread;
847 hr = IStream_Read(pStm,xbuf+xread,header[1]-xread,&nread);
848 xread+=nread;
849 if (hr || !nread)
850 break;
851 }
852 if (xread != header[1])
853 {
854 FIXME("Could only read %ld of %ld bytes?\n",xread,header[1]);
855 }
856
857 magic = xbuf[0] + (xbuf[1]<<8);
858 switch (magic) {
859 case 0xd8ff: { /* JPEG */
860#ifdef HAVE_LIBJPEG
861 struct jpeg_decompress_struct jd;
862 struct jpeg_error_mgr jerr;
863 int ret;
864 JDIMENSION x;
865 JSAMPROW samprow;
866 BITMAPINFOHEADER bmi;
867 LPBYTE bits;
868 HDC hdcref;
869 struct jpeg_source_mgr xjsm;
870
871 /* This is basically so we can use in-memory data for jpeg decompression.
872 * We need to have all the functions.
873 */
874 xjsm.next_input_byte = xbuf;
875 xjsm.bytes_in_buffer = xread;
876 xjsm.init_source = _jpeg_init_source;
877 xjsm.fill_input_buffer = _jpeg_fill_input_buffer;
878 xjsm.skip_input_data = _jpeg_skip_input_data;
879 xjsm.resync_to_restart = _jpeg_resync_to_restart;
880 xjsm.term_source = _jpeg_term_source;
881
882 jd.err = jpeg_std_error(&jerr);
883 jpeg_create_decompress(&jd);
884 jd.src = &xjsm;
885 ret=jpeg_read_header(&jd,TRUE);
886 jpeg_start_decompress(&jd);
887 if (ret != JPEG_HEADER_OK) {
888 ERR("Jpeg image in stream has bad format, read header returned %d.\n",ret);
889 HeapFree(GetProcessHeap(),0,xbuf);
890 return E_FAIL;
891 }
892 bits = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,(jd.output_height+1)*jd.output_width*jd.output_components);
893 samprow=HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,jd.output_width*jd.output_components);
894 while ( jd.output_scanline<jd.output_height ) {
895 x = jpeg_read_scanlines(&jd,&samprow,1);
896 if (x != 1) {
897 FIXME("failed to read current scanline?\n");
898 break;
899 }
900 memcpy( bits+jd.output_scanline*jd.output_width*jd.output_components,
901 samprow,
902 jd.output_width*jd.output_components
903 );
904 }
905 bmi.biSize = sizeof(bmi);
906 bmi.biWidth = jd.output_width;
907 bmi.biHeight = -jd.output_height;
908 bmi.biPlanes = 1;
909 bmi.biBitCount = jd.output_components<<3;
910 bmi.biCompression = BI_RGB;
911 bmi.biSizeImage = jd.output_height*jd.output_width*jd.output_components;
912 bmi.biXPelsPerMeter = 0;
913 bmi.biYPelsPerMeter = 0;
914 bmi.biClrUsed = 0;
915 bmi.biClrImportant = 0;
916
917 HeapFree(GetProcessHeap(),0,samprow);
918 jpeg_finish_decompress(&jd);
919 jpeg_destroy_decompress(&jd);
920 hdcref = GetDC(0);
921 This->desc.u.bmp.hbitmap=CreateDIBitmap(
922 hdcref,
923 &bmi,
924 CBM_INIT,
925 bits,
926 (BITMAPINFO*)&bmi,
927 DIB_RGB_COLORS
928 );
929 DeleteDC(hdcref);
930 This->desc.picType = PICTYPE_BITMAP;
931 OLEPictureImpl_SetBitmap(This);
932 hr = S_OK;
933 HeapFree(GetProcessHeap(),0,bits);
934#else
935 ERR("Trying to load JPEG picture, but JPEG supported not compiled in.\n");
936 hr = E_FAIL;
937#endif
938 break;
939 }
940 case 0x4d42: { /* Bitmap */
941 BITMAPFILEHEADER *bfh = (BITMAPFILEHEADER*)xbuf;
942 BITMAPINFO *bi = (BITMAPINFO*)(bfh+1);
943 HDC hdcref;
944
945 /* Does not matter whether this is a coreheader or not, we only use
946 * components which are in both
947 */
948 hdcref = GetDC(0);
949 This->desc.u.bmp.hbitmap = CreateDIBitmap(
950 hdcref,
951 &(bi->bmiHeader),
952 CBM_INIT,
953 xbuf+bfh->bfOffBits,
954 bi,
955 (bi->bmiHeader.biBitCount<=8)?DIB_PAL_COLORS:DIB_RGB_COLORS
956 );
957 DeleteDC(hdcref);
958 This->desc.picType = PICTYPE_BITMAP;
959 OLEPictureImpl_SetBitmap(This);
960 hr = S_OK;
961 break;
962 }
963 case 0x0000: { /* ICON , first word is dwReserved */
964 HICON hicon;
965 CURSORICONFILEDIR *cifd = (CURSORICONFILEDIR*)xbuf;
966 int i;
967
968 /*
969 FIXME("icon.idReserved=%d\n",cifd->idReserved);
970 FIXME("icon.idType=%d\n",cifd->idType);
971 FIXME("icon.idCount=%d\n",cifd->idCount);
972
973 for (i=0;i<cifd->idCount;i++) {
974 FIXME("[%d] width %d\n",i,cifd->idEntries[i].bWidth);
975 FIXME("[%d] height %d\n",i,cifd->idEntries[i].bHeight);
976 FIXME("[%d] bColorCount %d\n",i,cifd->idEntries[i].bColorCount);
977 FIXME("[%d] bReserved %d\n",i,cifd->idEntries[i].bReserved);
978 FIXME("[%d] xHotspot %d\n",i,cifd->idEntries[i].xHotspot);
979 FIXME("[%d] yHotspot %d\n",i,cifd->idEntries[i].yHotspot);
980 FIXME("[%d] dwDIBSize %d\n",i,cifd->idEntries[i].dwDIBSize);
981 FIXME("[%d] dwDIBOffset %d\n",i,cifd->idEntries[i].dwDIBOffset);
982 }
983 */
984 i=0;
985 /* If we have more than one icon, try to find the best.
986 * this currently means '32 pixel wide'.
987 */
988 if (cifd->idCount!=1) {
989 for (i=0;i<cifd->idCount;i++) {
990 if (cifd->idEntries[i].bWidth == 32)
991 break;
992 }
993 if (i==cifd->idCount) i=0;
994 }
995
996 hicon = CreateIconFromResourceEx(
997 xbuf+cifd->idEntries[i].dwDIBOffset,
998 cifd->idEntries[i].dwDIBSize,
999 TRUE, /* is icon */
1000 0x00030000,
1001 cifd->idEntries[i].bWidth,
1002 cifd->idEntries[i].bHeight,
1003 0
1004 );
1005 if (!hicon) {
1006 FIXME("CreateIcon failed.\n");
1007 hr = E_FAIL;
1008 } else {
1009 This->desc.picType = PICTYPE_ICON;
1010 This->desc.u.icon.hicon = hicon;
1011 hr = S_OK;
1012 }
1013 break;
1014 }
1015 default:
1016 FIXME("Unknown magic %04x\n",magic);
1017 hr=E_FAIL;
1018 break;
1019 }
1020 HeapFree(GetProcessHeap(),0,xbuf);
1021
1022 /* FIXME: this notify is not really documented */
1023 if (hr==S_OK)
1024 OLEPicture_SendNotify(This,DISPID_PICT_TYPE);
1025 return hr;
1026}
1027
1028static HRESULT WINAPI OLEPictureImpl_Save(
1029 IPersistStream* iface,IStream*pStm,BOOL fClearDirty)
1030{
1031 ICOM_THIS_From_IPersistStream(IPicture, iface);
1032 FIXME("(%p,%p,%d),stub!\n",This,pStm,fClearDirty);
1033 return E_NOTIMPL;
1034}
1035
1036static HRESULT WINAPI OLEPictureImpl_GetSizeMax(
1037 IPersistStream* iface,ULARGE_INTEGER*pcbSize)
1038{
1039 ICOM_THIS_From_IPersistStream(IPicture, iface);
1040 FIXME("(%p,%p),stub!\n",This,pcbSize);
1041 return E_NOTIMPL;
1042}
1043
1044/************************************************************************
1045 * IDispatch
1046 */
1047/************************************************************************
1048 * OLEPictureImpl_IDispatch_QueryInterface (IUnknown)
1049 *
1050 * See Windows documentation for more details on IUnknown methods.
1051 */
1052static HRESULT WINAPI OLEPictureImpl_IDispatch_QueryInterface(
1053 IDispatch* iface,
1054 REFIID riid,
1055 VOID** ppvoid)
1056{
1057 ICOM_THIS_From_IDispatch(IPicture, iface);
1058
1059 return IPicture_QueryInterface(This, riid, ppvoid);
1060}
1061
1062/************************************************************************
1063 * OLEPictureImpl_IDispatch_AddRef (IUnknown)
1064 *
1065 * See Windows documentation for more details on IUnknown methods.
1066 */
1067static ULONG WINAPI OLEPictureImpl_IDispatch_AddRef(
1068 IDispatch* iface)
1069{
1070 ICOM_THIS_From_IDispatch(IPicture, iface);
1071
1072 return IPicture_AddRef(This);
1073}
1074
1075/************************************************************************
1076 * OLEPictureImpl_IDispatch_Release (IUnknown)
1077 *
1078 * See Windows documentation for more details on IUnknown methods.
1079 */
1080static ULONG WINAPI OLEPictureImpl_IDispatch_Release(
1081 IDispatch* iface)
1082{
1083 ICOM_THIS_From_IDispatch(IPicture, iface);
1084
1085 return IPicture_Release(This);
1086}
1087
1088/************************************************************************
1089 * OLEPictureImpl_GetTypeInfoCount (IDispatch)
1090 *
1091 * See Windows documentation for more details on IDispatch methods.
1092 */
1093static HRESULT WINAPI OLEPictureImpl_GetTypeInfoCount(
1094 IDispatch* iface,
1095 unsigned int* pctinfo)
1096{
1097 FIXME("():Stub\n");
1098
1099 return E_NOTIMPL;
1100}
1101
1102/************************************************************************
1103 * OLEPictureImpl_GetTypeInfo (IDispatch)
1104 *
1105 * See Windows documentation for more details on IDispatch methods.
1106 */
1107static HRESULT WINAPI OLEPictureImpl_GetTypeInfo(
1108 IDispatch* iface,
1109 UINT iTInfo,
1110 LCID lcid,
1111 ITypeInfo** ppTInfo)
1112{
1113 FIXME("():Stub\n");
1114
1115 return E_NOTIMPL;
1116}
1117
1118/************************************************************************
1119 * OLEPictureImpl_GetIDsOfNames (IDispatch)
1120 *
1121 * See Windows documentation for more details on IDispatch methods.
1122 */
1123static HRESULT WINAPI OLEPictureImpl_GetIDsOfNames(
1124 IDispatch* iface,
1125 REFIID riid,
1126 LPOLESTR* rgszNames,
1127 UINT cNames,
1128 LCID lcid,
1129 DISPID* rgDispId)
1130{
1131 FIXME("():Stub\n");
1132
1133 return E_NOTIMPL;
1134}
1135
1136/************************************************************************
1137 * OLEPictureImpl_Invoke (IDispatch)
1138 *
1139 * See Windows documentation for more details on IDispatch methods.
1140 */
1141static HRESULT WINAPI OLEPictureImpl_Invoke(
1142 IDispatch* iface,
1143 DISPID dispIdMember,
1144 REFIID riid,
1145 LCID lcid,
1146 WORD wFlags,
1147 DISPPARAMS* pDispParams,
1148 VARIANT* pVarResult,
1149 EXCEPINFO* pExepInfo,
1150 UINT* puArgErr)
1151{
1152 FIXME("(dispid: %ld):Stub\n",dispIdMember);
1153
1154 VariantInit(pVarResult);
1155 V_VT(pVarResult) = VT_BOOL;
1156 V_UNION(pVarResult,boolVal) = FALSE;
1157 return S_OK;
1158}
1159
1160
1161static ICOM_VTABLE(IPicture) OLEPictureImpl_VTable =
1162{
1163 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1164 OLEPictureImpl_QueryInterface,
1165 OLEPictureImpl_AddRef,
1166 OLEPictureImpl_Release,
1167 OLEPictureImpl_get_Handle,
1168 OLEPictureImpl_get_hPal,
1169 OLEPictureImpl_get_Type,
1170 OLEPictureImpl_get_Width,
1171 OLEPictureImpl_get_Height,
1172 OLEPictureImpl_Render,
1173 OLEPictureImpl_set_hPal,
1174 OLEPictureImpl_get_CurDC,
1175 OLEPictureImpl_SelectPicture,
1176 OLEPictureImpl_get_KeepOriginalFormat,
1177 OLEPictureImpl_put_KeepOriginalFormat,
1178 OLEPictureImpl_PictureChanged,
1179 OLEPictureImpl_SaveAsFile,
1180 OLEPictureImpl_get_Attributes
1181};
1182
1183static ICOM_VTABLE(IDispatch) OLEPictureImpl_IDispatch_VTable =
1184{
1185 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1186 OLEPictureImpl_IDispatch_QueryInterface,
1187 OLEPictureImpl_IDispatch_AddRef,
1188 OLEPictureImpl_IDispatch_Release,
1189 OLEPictureImpl_GetTypeInfoCount,
1190 OLEPictureImpl_GetTypeInfo,
1191 OLEPictureImpl_GetIDsOfNames,
1192 OLEPictureImpl_Invoke
1193};
1194
1195static ICOM_VTABLE(IPersistStream) OLEPictureImpl_IPersistStream_VTable =
1196{
1197 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1198 OLEPictureImpl_IPersistStream_QueryInterface,
1199 OLEPictureImpl_IPersistStream_AddRef,
1200 OLEPictureImpl_IPersistStream_Release,
1201 OLEPictureImpl_GetClassID,
1202 OLEPictureImpl_IsDirty,
1203 OLEPictureImpl_Load,
1204 OLEPictureImpl_Save,
1205 OLEPictureImpl_GetSizeMax
1206};
1207
1208static ICOM_VTABLE(IConnectionPointContainer) OLEPictureImpl_IConnectionPointContainer_VTable =
1209{
1210 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1211 OLEPictureImpl_IConnectionPointContainer_QueryInterface,
1212 OLEPictureImpl_IConnectionPointContainer_AddRef,
1213 OLEPictureImpl_IConnectionPointContainer_Release,
1214 OLEPictureImpl_EnumConnectionPoints,
1215 OLEPictureImpl_FindConnectionPoint
1216};
1217
1218/***********************************************************************
1219 * OleCreatePictureIndirect (OLEAUT32.419)
1220 */
1221HRESULT WINAPI OleCreatePictureIndirect(LPPICTDESC lpPictDesc, REFIID riid,
1222 BOOL fOwn, LPVOID *ppvObj )
1223{
1224 OLEPictureImpl* newPict = NULL;
1225 HRESULT hr = S_OK;
1226
1227 TRACE("(%p,%p,%d,%p)\n", lpPictDesc, riid, fOwn, ppvObj);
1228
1229 /*
1230 * Sanity check
1231 */
1232 if (ppvObj==0)
1233 return E_POINTER;
1234
1235 *ppvObj = NULL;
1236
1237 /*
1238 * Try to construct a new instance of the class.
1239 */
1240 newPict = OLEPictureImpl_Construct(lpPictDesc, fOwn);
1241
1242 if (newPict == NULL)
1243 return E_OUTOFMEMORY;
1244
1245 /*
1246 * Make sure it supports the interface required by the caller.
1247 */
1248 hr = IPicture_QueryInterface((IPicture*)newPict, riid, ppvObj);
1249
1250 /*
1251 * Release the reference obtained in the constructor. If
1252 * the QueryInterface was unsuccessful, it will free the class.
1253 */
1254 IPicture_Release((IPicture*)newPict);
1255
1256 return hr;
1257}
1258
1259
1260/***********************************************************************
1261 * OleLoadPicture (OLEAUT32.418)
1262 */
1263HRESULT WINAPI OleLoadPicture( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
1264 REFIID riid, LPVOID *ppvObj )
1265{
1266 LPPERSISTSTREAM ps;
1267 IPicture *newpic;
1268 HRESULT hr;
1269
1270 TRACE("(%p,%ld,%d,%s,%p), partially implemented.\n",
1271 lpstream, lSize, fRunmode, debugstr_guid(riid), ppvObj);
1272
1273 hr = OleCreatePictureIndirect(NULL,riid,!fRunmode,(LPVOID*)&newpic);
1274 if (hr)
1275 return hr;
1276 hr = IPicture_QueryInterface(newpic,&IID_IPersistStream, (LPVOID*)&ps);
1277 if (hr) {
1278 FIXME("Could not get IPersistStream iface from Ole Picture?\n");
1279 IPicture_Release(newpic);
1280 *ppvObj = NULL;
1281 return hr;
1282 }
1283 IPersistStream_Load(ps,lpstream);
1284 IPersistStream_Release(ps);
1285 hr = IPicture_QueryInterface(newpic,riid,ppvObj);
1286 if (hr)
1287 {
1288 FIXME("Failed to get interface %s from IPicture.\n",debugstr_guid(riid));
1289 }
1290 IPicture_Release(newpic);
1291 return hr;
1292}
1293
1294/***********************************************************************
1295 * OleLoadPictureEx (OLEAUT32.425)
1296 */
1297HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
1298 REFIID reed, DWORD xsiz, DWORD ysiz, DWORD flags, LPVOID *ppvObj )
1299{
1300 FIXME("(%p,%ld,%d,%p,%lx,%lx,%lx,%p), not implemented\n",
1301 lpstream, lSize, fRunmode, reed, xsiz, ysiz, flags, ppvObj);
1302 return S_OK;
1303}
1304
1305#ifdef __WIN32OS2__
1306
1307// ----------------------------------------------------------------------
1308// OleLoadPictureFile
1309// ----------------------------------------------------------------------
1310HRESULT WIN32API OleLoadPictureFile(VARIANT varFileName, LPDISPATCH* lplpdispPicture)
1311{
1312 dprintf(("OLEAUT32: OleLoadPictureFile - stub"));
1313 return S_OK;
1314}
1315
1316// ----------------------------------------------------------------------
1317// OleSavePictureFile
1318// ----------------------------------------------------------------------
1319HRESULT WIN32API OleSavePictureFile(LPDISPATCH lpdispPicture,
1320 BSTR bstrFileName)
1321{
1322 dprintf(("OLEAUT32: OleSavePictureFile - stub"));
1323 return S_OK;
1324}
1325
1326// ----------------------------------------------------------------------
1327// OleLoadPicturePath
1328// ----------------------------------------------------------------------
1329HRESULT WIN32API OleLoadPicturePath
1330 (LPOLESTR szURLorPath,
1331 LPUNKNOWN punkCaller,
1332 DWORD dwReserved,
1333 OLE_COLOR clrReserved,
1334 REFIID riid,
1335 LPVOID * ppvRet )
1336{
1337 dprintf(("OLEAUT32: OleLoadPicturePath - stub"));
1338 return S_OK;
1339}
1340#endif
Note: See TracBrowser for help on using the repository browser.