2 * OLE Font encapsulation implementation
4 * This file contains an implementation of the IFont
5 * interface and the OleCreateFontIndirect API call.
7 * Copyright 1999 Francis Beaudet
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #define NONAMELESSUNION
27 #define NONAMELESSSTRUCT
32 #include "wine/unicode.h"
33 #include "oleauto.h" /* for SysAllocString(....) */
37 #include "wine/debug.h"
38 #include "connpt.h" /* for CreateConnectionPoint */
40 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
42 /***********************************************************************
43 * Declaration of constants used when serializing the font object.
45 #define FONTPERSIST_ITALIC 0x02
46 #define FONTPERSIST_UNDERLINE 0x04
47 #define FONTPERSIST_STRIKETHROUGH 0x08
49 /***********************************************************************
50 * Declaration of the implementation class for the IFont interface
52 typedef struct OLEFontImpl OLEFontImpl
;
57 * This class supports many interfaces. IUnknown, IFont,
58 * IDispatch, IDispFont IPersistStream and IConnectionPointContainer.
59 * The first two are supported by the first vtable, the next two are
60 * supported by the second table and the last two have their own.
62 ICOM_VTABLE(IFont
)* lpvtbl1
;
63 ICOM_VTABLE(IDispatch
)* lpvtbl2
;
64 ICOM_VTABLE(IPersistStream
)* lpvtbl3
;
65 ICOM_VTABLE(IConnectionPointContainer
)* lpvtbl4
;
67 * Reference count for that instance of the class.
72 * This structure contains the description of the class.
77 * Contain the font associated with this object.
92 IConnectionPoint
*pCP
;
96 * Here, I define utility macros to help with the casting of the
98 * There is a version to accomodate all of the VTables implemented
101 #define _ICOM_THIS(class,name) class* this = (class*)name;
102 #define _ICOM_THIS_From_IDispatch(class, name) class* this = (class*)(((char*)name)-sizeof(void*));
103 #define _ICOM_THIS_From_IPersistStream(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*));
104 #define _ICOM_THIS_From_IConnectionPointContainer(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*));
107 /***********************************************************************
108 * Prototypes for the implementation functions for the IFont
111 static OLEFontImpl
* OLEFontImpl_Construct(LPFONTDESC fontDesc
);
112 static void OLEFontImpl_Destroy(OLEFontImpl
* fontDesc
);
113 static HRESULT WINAPI
OLEFontImpl_QueryInterface(IFont
* iface
, REFIID riid
, VOID
** ppvoid
);
114 static ULONG WINAPI
OLEFontImpl_AddRef(IFont
* iface
);
115 static ULONG WINAPI
OLEFontImpl_Release(IFont
* iface
);
116 static HRESULT WINAPI
OLEFontImpl_get_Name(IFont
* iface
, BSTR
* pname
);
117 static HRESULT WINAPI
OLEFontImpl_put_Name(IFont
* iface
, BSTR name
);
118 static HRESULT WINAPI
OLEFontImpl_get_Size(IFont
* iface
, CY
* psize
);
119 static HRESULT WINAPI
OLEFontImpl_put_Size(IFont
* iface
, CY size
);
120 static HRESULT WINAPI
OLEFontImpl_get_Bold(IFont
* iface
, BOOL
* pbold
);
121 static HRESULT WINAPI
OLEFontImpl_put_Bold(IFont
* iface
, BOOL bold
);
122 static HRESULT WINAPI
OLEFontImpl_get_Italic(IFont
* iface
, BOOL
* pitalic
);
123 static HRESULT WINAPI
OLEFontImpl_put_Italic(IFont
* iface
, BOOL italic
);
124 static HRESULT WINAPI
OLEFontImpl_get_Underline(IFont
* iface
, BOOL
* punderline
);
125 static HRESULT WINAPI
OLEFontImpl_put_Underline(IFont
* iface
, BOOL underline
);
126 static HRESULT WINAPI
OLEFontImpl_get_Strikethrough(IFont
* iface
, BOOL
* pstrikethrough
);
127 static HRESULT WINAPI
OLEFontImpl_put_Strikethrough(IFont
* iface
, BOOL strikethrough
);
128 static HRESULT WINAPI
OLEFontImpl_get_Weight(IFont
* iface
, short* pweight
);
129 static HRESULT WINAPI
OLEFontImpl_put_Weight(IFont
* iface
, short weight
);
130 static HRESULT WINAPI
OLEFontImpl_get_Charset(IFont
* iface
, short* pcharset
);
131 static HRESULT WINAPI
OLEFontImpl_put_Charset(IFont
* iface
, short charset
);
132 static HRESULT WINAPI
OLEFontImpl_get_hFont(IFont
* iface
, HFONT
* phfont
);
133 static HRESULT WINAPI
OLEFontImpl_Clone(IFont
* iface
, IFont
** ppfont
);
134 static HRESULT WINAPI
OLEFontImpl_IsEqual(IFont
* iface
, IFont
* pFontOther
);
135 static HRESULT WINAPI
OLEFontImpl_SetRatio(IFont
* iface
, long cyLogical
, long cyHimetric
);
136 static HRESULT WINAPI
OLEFontImpl_QueryTextMetrics(IFont
* iface
, TEXTMETRICOLE
* ptm
);
137 static HRESULT WINAPI
OLEFontImpl_AddRefHfont(IFont
* iface
, HFONT hfont
);
138 static HRESULT WINAPI
OLEFontImpl_ReleaseHfont(IFont
* iface
, HFONT hfont
);
139 static HRESULT WINAPI
OLEFontImpl_SetHdc(IFont
* iface
, HDC hdc
);
141 /***********************************************************************
142 * Prototypes for the implementation functions for the IDispatch
145 static HRESULT WINAPI
OLEFontImpl_IDispatch_QueryInterface(IDispatch
* iface
,
148 static ULONG WINAPI
OLEFontImpl_IDispatch_AddRef(IDispatch
* iface
);
149 static ULONG WINAPI
OLEFontImpl_IDispatch_Release(IDispatch
* iface
);
150 static HRESULT WINAPI
OLEFontImpl_GetTypeInfoCount(IDispatch
* iface
,
151 unsigned int* pctinfo
);
152 static HRESULT WINAPI
OLEFontImpl_GetTypeInfo(IDispatch
* iface
,
155 ITypeInfo
** ppTInfo
);
156 static HRESULT WINAPI
OLEFontImpl_GetIDsOfNames(IDispatch
* iface
,
162 static HRESULT WINAPI
OLEFontImpl_Invoke(IDispatch
* iface
,
167 DISPPARAMS
* pDispParams
,
169 EXCEPINFO
* pExepInfo
,
172 /***********************************************************************
173 * Prototypes for the implementation functions for the IPersistStream
176 static HRESULT WINAPI
OLEFontImpl_IPersistStream_QueryInterface(IPersistStream
* iface
,
179 static ULONG WINAPI
OLEFontImpl_IPersistStream_AddRef(IPersistStream
* iface
);
180 static ULONG WINAPI
OLEFontImpl_IPersistStream_Release(IPersistStream
* iface
);
181 static HRESULT WINAPI
OLEFontImpl_GetClassID(IPersistStream
* iface
,
183 static HRESULT WINAPI
OLEFontImpl_IsDirty(IPersistStream
* iface
);
184 static HRESULT WINAPI
OLEFontImpl_Load(IPersistStream
* iface
,
185 IStream
* pLoadStream
);
186 static HRESULT WINAPI
OLEFontImpl_Save(IPersistStream
* iface
,
189 static HRESULT WINAPI
OLEFontImpl_GetSizeMax(IPersistStream
* iface
,
190 ULARGE_INTEGER
* pcbSize
);
192 /***********************************************************************
193 * Prototypes for the implementation functions for the
194 * IConnectionPointContainer interface
196 static HRESULT WINAPI
OLEFontImpl_IConnectionPointContainer_QueryInterface(
197 IConnectionPointContainer
* iface
,
200 static ULONG WINAPI
OLEFontImpl_IConnectionPointContainer_AddRef(
201 IConnectionPointContainer
* iface
);
202 static ULONG WINAPI
OLEFontImpl_IConnectionPointContainer_Release(
203 IConnectionPointContainer
* iface
);
204 static HRESULT WINAPI
OLEFontImpl_EnumConnectionPoints(
205 IConnectionPointContainer
* iface
,
206 IEnumConnectionPoints
**ppEnum
);
207 static HRESULT WINAPI
OLEFontImpl_FindConnectionPoint(
208 IConnectionPointContainer
* iface
,
210 IConnectionPoint
**ppCp
);
213 * Virtual function tables for the OLEFontImpl class.
215 static ICOM_VTABLE(IFont
) OLEFontImpl_VTable
=
217 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
218 OLEFontImpl_QueryInterface
,
221 OLEFontImpl_get_Name
,
222 OLEFontImpl_put_Name
,
223 OLEFontImpl_get_Size
,
224 OLEFontImpl_put_Size
,
225 OLEFontImpl_get_Bold
,
226 OLEFontImpl_put_Bold
,
227 OLEFontImpl_get_Italic
,
228 OLEFontImpl_put_Italic
,
229 OLEFontImpl_get_Underline
,
230 OLEFontImpl_put_Underline
,
231 OLEFontImpl_get_Strikethrough
,
232 OLEFontImpl_put_Strikethrough
,
233 OLEFontImpl_get_Weight
,
234 OLEFontImpl_put_Weight
,
235 OLEFontImpl_get_Charset
,
236 OLEFontImpl_put_Charset
,
237 OLEFontImpl_get_hFont
,
240 OLEFontImpl_SetRatio
,
241 OLEFontImpl_QueryTextMetrics
,
242 OLEFontImpl_AddRefHfont
,
243 OLEFontImpl_ReleaseHfont
,
247 static ICOM_VTABLE(IDispatch
) OLEFontImpl_IDispatch_VTable
=
249 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
250 OLEFontImpl_IDispatch_QueryInterface
,
251 OLEFontImpl_IDispatch_AddRef
,
252 OLEFontImpl_IDispatch_Release
,
253 OLEFontImpl_GetTypeInfoCount
,
254 OLEFontImpl_GetTypeInfo
,
255 OLEFontImpl_GetIDsOfNames
,
259 static ICOM_VTABLE(IPersistStream
) OLEFontImpl_IPersistStream_VTable
=
261 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
262 OLEFontImpl_IPersistStream_QueryInterface
,
263 OLEFontImpl_IPersistStream_AddRef
,
264 OLEFontImpl_IPersistStream_Release
,
265 OLEFontImpl_GetClassID
,
269 OLEFontImpl_GetSizeMax
272 static ICOM_VTABLE(IConnectionPointContainer
)
273 OLEFontImpl_IConnectionPointContainer_VTable
=
275 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
276 OLEFontImpl_IConnectionPointContainer_QueryInterface
,
277 OLEFontImpl_IConnectionPointContainer_AddRef
,
278 OLEFontImpl_IConnectionPointContainer_Release
,
279 OLEFontImpl_EnumConnectionPoints
,
280 OLEFontImpl_FindConnectionPoint
283 /******************************************************************************
284 * OleCreateFontIndirect [OLEAUT32.420]
286 HRESULT WINAPI
OleCreateFontIndirect(
287 LPFONTDESC lpFontDesc
,
291 OLEFontImpl
* newFont
= 0;
294 TRACE("(%p, %s, %p)\n", lpFontDesc
, debugstr_guid(riid
), ppvObj
);
304 return NO_ERROR
; /* MSDN Oct 2001 */
307 * Try to construct a new instance of the class.
309 newFont
= OLEFontImpl_Construct(lpFontDesc
);
312 return E_OUTOFMEMORY
;
315 * Make sure it supports the interface required by the caller.
317 hr
= IFont_QueryInterface((IFont
*)newFont
, riid
, ppvObj
);
320 * Release the reference obtained in the constructor. If
321 * the QueryInterface was unsuccessful, it will free the class.
323 IFont_Release((IFont
*)newFont
);
329 /***********************************************************************
330 * Implementation of the OLEFontImpl class.
333 /***********************************************************************
334 * OLEFont_SendNotify (internal)
336 * Sends notification messages of changed properties to any interested
339 static void OLEFont_SendNotify(OLEFontImpl
* this, DISPID dispID
)
341 IEnumConnections
*pEnum
;
344 IConnectionPoint_EnumConnections(this->pCP
, &pEnum
);
346 while(IEnumConnections_Next(pEnum
, 1, &CD
, NULL
) == S_OK
) {
347 IPropertyNotifySink
*sink
;
349 IUnknown_QueryInterface(CD
.pUnk
, &IID_IPropertyNotifySink
, (LPVOID
)&sink
);
350 IPropertyNotifySink_OnChanged(sink
, dispID
);
351 IPropertyNotifySink_Release(sink
);
352 IUnknown_Release(CD
.pUnk
);
354 IEnumConnections_Release(pEnum
);
358 /************************************************************************
359 * OLEFontImpl_Construct
361 * This method will construct a new instance of the OLEFontImpl
364 * The caller of this method must release the object when it's
367 static OLEFontImpl
* OLEFontImpl_Construct(LPFONTDESC fontDesc
)
369 OLEFontImpl
* newObject
= 0;
372 * Allocate space for the object.
374 newObject
= HeapAlloc(GetProcessHeap(), 0, sizeof(OLEFontImpl
));
380 * Initialize the virtual function table.
382 newObject
->lpvtbl1
= &OLEFontImpl_VTable
;
383 newObject
->lpvtbl2
= &OLEFontImpl_IDispatch_VTable
;
384 newObject
->lpvtbl3
= &OLEFontImpl_IPersistStream_VTable
;
385 newObject
->lpvtbl4
= &OLEFontImpl_IConnectionPointContainer_VTable
;
388 * Start with one reference count. The caller of this function
389 * must release the interface pointer when it is done.
394 * Copy the description of the font in the object.
396 assert(fontDesc
->cbSizeofstruct
>= sizeof(FONTDESC
));
398 newObject
->description
.cbSizeofstruct
= sizeof(FONTDESC
);
399 newObject
->description
.lpstrName
= HeapAlloc(GetProcessHeap(),
401 (lstrlenW(fontDesc
->lpstrName
)+1) * sizeof(WCHAR
));
402 strcpyW(newObject
->description
.lpstrName
, fontDesc
->lpstrName
);
403 newObject
->description
.cySize
= fontDesc
->cySize
;
404 newObject
->description
.sWeight
= fontDesc
->sWeight
;
405 newObject
->description
.sCharset
= fontDesc
->sCharset
;
406 newObject
->description
.fItalic
= fontDesc
->fItalic
;
407 newObject
->description
.fUnderline
= fontDesc
->fUnderline
;
408 newObject
->description
.fStrikethrough
= fontDesc
->fStrikethrough
;
411 * Initializing all the other members.
413 newObject
->gdiFont
= 0;
414 newObject
->fontLock
= 0;
415 newObject
->cyHimetric
= 1;
416 newObject
->cyLogical
= 1;
418 CreateConnectionPoint((IUnknown
*)newObject
, &IID_IPropertyNotifySink
, &newObject
->pCP
);
420 TRACE("returning %p\n", newObject
);
424 /************************************************************************
425 * OLEFontImpl_Destroy
427 * This method is called by the Release method when the reference
428 * count goes down to 0. It will free all resources used by
431 static void OLEFontImpl_Destroy(OLEFontImpl
* fontDesc
)
433 TRACE("(%p)\n", fontDesc
);
435 if (fontDesc
->description
.lpstrName
!=0)
436 HeapFree(GetProcessHeap(), 0, fontDesc
->description
.lpstrName
);
438 if (fontDesc
->gdiFont
!=0)
439 DeleteObject(fontDesc
->gdiFont
);
441 HeapFree(GetProcessHeap(), 0, fontDesc
);
444 /************************************************************************
445 * OLEFontImpl_QueryInterface (IUnknown)
447 * See Windows documentation for more details on IUnknown methods.
449 HRESULT WINAPI
OLEFontImpl_QueryInterface(
454 _ICOM_THIS(OLEFontImpl
, iface
);
455 TRACE("(%p)->(%s, %p)\n", this, debugstr_guid(riid
), ppvObject
);
458 * Perform a sanity check on the parameters.
460 if ( (this==0) || (ppvObject
==0) )
464 * Initialize the return parameter.
469 * Compare the riid with the interface IDs implemented by this object.
471 if (memcmp(&IID_IUnknown
, riid
, sizeof(IID_IUnknown
)) == 0)
473 *ppvObject
= (IFont
*)this;
475 else if (memcmp(&IID_IFont
, riid
, sizeof(IID_IFont
)) == 0)
477 *ppvObject
= (IFont
*)this;
479 else if (memcmp(&IID_IDispatch
, riid
, sizeof(IID_IDispatch
)) == 0)
481 *ppvObject
= (IDispatch
*)&(this->lpvtbl2
);
483 else if (memcmp(&IID_IFontDisp
, riid
, sizeof(IID_IFontDisp
)) == 0)
485 *ppvObject
= (IDispatch
*)&(this->lpvtbl2
);
487 else if (memcmp(&IID_IPersistStream
, riid
, sizeof(IID_IPersistStream
)) == 0)
489 *ppvObject
= (IPersistStream
*)&(this->lpvtbl3
);
491 else if (memcmp(&IID_IConnectionPointContainer
, riid
,
492 sizeof(IID_IConnectionPointContainer
)) == 0)
494 *ppvObject
= (IPersistStream
*)&(this->lpvtbl4
);
498 * Check that we obtained an interface.
502 FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid
));
503 return E_NOINTERFACE
;
507 * Query Interface always increases the reference count by one when it is
510 OLEFontImpl_AddRef((IFont
*)this);
515 /************************************************************************
516 * OLEFontImpl_AddRef (IUnknown)
518 * See Windows documentation for more details on IUnknown methods.
520 ULONG WINAPI
OLEFontImpl_AddRef(
523 _ICOM_THIS(OLEFontImpl
, iface
);
524 TRACE("(%p)->(ref=%ld)\n", this, this->ref
);
530 /************************************************************************
531 * OLEFontImpl_Release (IUnknown)
533 * See Windows documentation for more details on IUnknown methods.
535 ULONG WINAPI
OLEFontImpl_Release(
538 _ICOM_THIS(OLEFontImpl
, iface
);
539 TRACE("(%p)->(ref=%ld)\n", this, this->ref
);
542 * Decrease the reference count on this object.
547 * If the reference count goes down to 0, perform suicide.
551 OLEFontImpl_Destroy(this);
559 /************************************************************************
560 * OLEFontImpl_get_Name (IFont)
562 * See Windows documentation for more details on IFont methods.
564 static HRESULT WINAPI
OLEFontImpl_get_Name(
568 _ICOM_THIS(OLEFontImpl
, iface
);
569 TRACE("(%p)->(%p)\n", this, pname
);
576 if (this->description
.lpstrName
!=0)
577 *pname
= SysAllocString(this->description
.lpstrName
);
584 /************************************************************************
585 * OLEFontImpl_put_Name (IFont)
587 * See Windows documentation for more details on IFont methods.
589 static HRESULT WINAPI
OLEFontImpl_put_Name(
593 _ICOM_THIS(OLEFontImpl
, iface
);
594 TRACE("(%p)->(%p)\n", this, name
);
596 if (this->description
.lpstrName
==0)
598 this->description
.lpstrName
= HeapAlloc(GetProcessHeap(),
600 (lstrlenW(name
)+1) * sizeof(WCHAR
));
604 this->description
.lpstrName
= HeapReAlloc(GetProcessHeap(),
606 this->description
.lpstrName
,
607 (lstrlenW(name
)+1) * sizeof(WCHAR
));
610 if (this->description
.lpstrName
==0)
611 return E_OUTOFMEMORY
;
613 strcpyW(this->description
.lpstrName
, name
);
614 TRACE("new name %s\n", debugstr_w(this->description
.lpstrName
));
615 OLEFont_SendNotify(this, DISPID_FONT_NAME
);
619 /************************************************************************
620 * OLEFontImpl_get_Size (IFont)
622 * See Windows documentation for more details on IFont methods.
624 static HRESULT WINAPI
OLEFontImpl_get_Size(
628 _ICOM_THIS(OLEFontImpl
, iface
);
629 TRACE("(%p)->(%p)\n", this, psize
);
638 psize
->s
.Lo
= this->description
.cySize
.s
.Lo
;
643 /************************************************************************
644 * OLEFontImpl_put_Size (IFont)
646 * See Windows documentation for more details on IFont methods.
648 static HRESULT WINAPI
OLEFontImpl_put_Size(
652 _ICOM_THIS(OLEFontImpl
, iface
);
653 TRACE("(%p)->(%ld)\n", this, size
.s
.Lo
);
654 this->description
.cySize
.s
.Hi
= 0;
655 this->description
.cySize
.s
.Lo
= size
.s
.Lo
;
656 OLEFont_SendNotify(this, DISPID_FONT_SIZE
);
661 /************************************************************************
662 * OLEFontImpl_get_Bold (IFont)
664 * See Windows documentation for more details on IFont methods.
666 static HRESULT WINAPI
OLEFontImpl_get_Bold(
670 _ICOM_THIS(OLEFontImpl
, iface
);
671 TRACE("(%p)->(%p)\n", this, pbold
);
678 *pbold
= this->description
.sWeight
> 550;
683 /************************************************************************
684 * OLEFontImpl_put_Bold (IFont)
686 * See Windows documentation for more details on IFont methods.
688 static HRESULT WINAPI
OLEFontImpl_put_Bold(
692 _ICOM_THIS(OLEFontImpl
, iface
);
693 TRACE("(%p)->(%d)\n", this, bold
);
694 this->description
.sWeight
= bold
? FW_BOLD
: FW_NORMAL
;
695 OLEFont_SendNotify(this, DISPID_FONT_BOLD
);
700 /************************************************************************
701 * OLEFontImpl_get_Italic (IFont)
703 * See Windows documentation for more details on IFont methods.
705 static HRESULT WINAPI
OLEFontImpl_get_Italic(
709 _ICOM_THIS(OLEFontImpl
, iface
);
710 TRACE("(%p)->(%p)\n", this, pitalic
);
717 *pitalic
= this->description
.fItalic
;
722 /************************************************************************
723 * OLEFontImpl_put_Italic (IFont)
725 * See Windows documentation for more details on IFont methods.
727 static HRESULT WINAPI
OLEFontImpl_put_Italic(
731 _ICOM_THIS(OLEFontImpl
, iface
);
732 TRACE("(%p)->(%d)\n", this, italic
);
734 this->description
.fItalic
= italic
;
736 OLEFont_SendNotify(this, DISPID_FONT_ITALIC
);
740 /************************************************************************
741 * OLEFontImpl_get_Underline (IFont)
743 * See Windows documentation for more details on IFont methods.
745 static HRESULT WINAPI
OLEFontImpl_get_Underline(
749 _ICOM_THIS(OLEFontImpl
, iface
);
750 TRACE("(%p)->(%p)\n", this, punderline
);
758 *punderline
= this->description
.fUnderline
;
763 /************************************************************************
764 * OLEFontImpl_put_Underline (IFont)
766 * See Windows documentation for more details on IFont methods.
768 static HRESULT WINAPI
OLEFontImpl_put_Underline(
772 _ICOM_THIS(OLEFontImpl
, iface
);
773 TRACE("(%p)->(%d)\n", this, underline
);
775 this->description
.fUnderline
= underline
;
777 OLEFont_SendNotify(this, DISPID_FONT_UNDER
);
781 /************************************************************************
782 * OLEFontImpl_get_Strikethrough (IFont)
784 * See Windows documentation for more details on IFont methods.
786 static HRESULT WINAPI
OLEFontImpl_get_Strikethrough(
788 BOOL
* pstrikethrough
)
790 _ICOM_THIS(OLEFontImpl
, iface
);
791 TRACE("(%p)->(%p)\n", this, pstrikethrough
);
796 if (pstrikethrough
==0)
799 *pstrikethrough
= this->description
.fStrikethrough
;
804 /************************************************************************
805 * OLEFontImpl_put_Strikethrough (IFont)
807 * See Windows documentation for more details on IFont methods.
809 static HRESULT WINAPI
OLEFontImpl_put_Strikethrough(
813 _ICOM_THIS(OLEFontImpl
, iface
);
814 TRACE("(%p)->(%d)\n", this, strikethrough
);
816 this->description
.fStrikethrough
= strikethrough
;
817 OLEFont_SendNotify(this, DISPID_FONT_STRIKE
);
822 /************************************************************************
823 * OLEFontImpl_get_Weight (IFont)
825 * See Windows documentation for more details on IFont methods.
827 static HRESULT WINAPI
OLEFontImpl_get_Weight(
831 _ICOM_THIS(OLEFontImpl
, iface
);
832 TRACE("(%p)->(%p)\n", this, pweight
);
840 *pweight
= this->description
.sWeight
;
845 /************************************************************************
846 * OLEFontImpl_put_Weight (IFont)
848 * See Windows documentation for more details on IFont methods.
850 static HRESULT WINAPI
OLEFontImpl_put_Weight(
854 _ICOM_THIS(OLEFontImpl
, iface
);
855 TRACE("(%p)->(%d)\n", this, weight
);
857 this->description
.sWeight
= weight
;
859 OLEFont_SendNotify(this, DISPID_FONT_WEIGHT
);
863 /************************************************************************
864 * OLEFontImpl_get_Charset (IFont)
866 * See Windows documentation for more details on IFont methods.
868 static HRESULT WINAPI
OLEFontImpl_get_Charset(
872 _ICOM_THIS(OLEFontImpl
, iface
);
873 TRACE("(%p)->(%p)\n", this, pcharset
);
881 *pcharset
= this->description
.sCharset
;
886 /************************************************************************
887 * OLEFontImpl_put_Charset (IFont)
889 * See Windows documentation for more details on IFont methods.
891 static HRESULT WINAPI
OLEFontImpl_put_Charset(
895 _ICOM_THIS(OLEFontImpl
, iface
);
896 TRACE("(%p)->(%d)\n", this, charset
);
898 this->description
.sCharset
= charset
;
899 OLEFont_SendNotify(this, DISPID_FONT_CHARSET
);
904 /************************************************************************
905 * OLEFontImpl_get_hFont (IFont)
907 * See Windows documentation for more details on IFont methods.
909 static HRESULT WINAPI
OLEFontImpl_get_hFont(
913 _ICOM_THIS(OLEFontImpl
, iface
);
914 TRACE("(%p)->(%p)\n", this, phfont
);
919 * Realize the font if necessary
921 if (this->gdiFont
==0)
928 * The height of the font returned by the get_Size property is the
929 * height of the font in points multiplied by 10000... Using some
930 * simple conversions and the ratio given by the application, it can
931 * be converted to a height in pixels.
933 IFont_get_Size(iface
, &cySize
);
935 fontHeight
= MulDiv(cySize
.s
.Lo
, 2540L, 72L);
936 fontHeight
= MulDiv(fontHeight
, this->cyLogical
,this->cyHimetric
);
938 memset(&logFont
, 0, sizeof(LOGFONTW
));
940 logFont
.lfHeight
= ((fontHeight
%10000L)>5000L) ? (-fontHeight
/10000L)-1 :
941 (-fontHeight
/10000L);
942 logFont
.lfItalic
= this->description
.fItalic
;
943 logFont
.lfUnderline
= this->description
.fUnderline
;
944 logFont
.lfStrikeOut
= this->description
.fStrikethrough
;
945 logFont
.lfWeight
= this->description
.sWeight
;
946 logFont
.lfCharSet
= this->description
.sCharset
;
947 logFont
.lfOutPrecision
= OUT_CHARACTER_PRECIS
;
948 logFont
.lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
949 logFont
.lfQuality
= DEFAULT_QUALITY
;
950 logFont
.lfPitchAndFamily
= DEFAULT_PITCH
;
951 strcpyW(logFont
.lfFaceName
,this->description
.lpstrName
);
953 this->gdiFont
= CreateFontIndirectW(&logFont
);
956 *phfont
= this->gdiFont
;
957 TRACE("Returning %p\n", *phfont
);
961 /************************************************************************
962 * OLEFontImpl_Clone (IFont)
964 * See Windows documentation for more details on IFont methods.
966 static HRESULT WINAPI
OLEFontImpl_Clone(
970 OLEFontImpl
* newObject
= 0;
974 _ICOM_THIS(OLEFontImpl
, iface
);
975 TRACE("(%p)->(%p)\n", this, ppfont
);
983 * Allocate space for the object.
985 newObject
= HeapAlloc(GetProcessHeap(), 0, sizeof(OLEFontImpl
));
988 return E_OUTOFMEMORY
;
992 /* We need to alloc new memory for the string, otherwise
993 * we free memory twice.
995 newObject
->description
.lpstrName
= HeapAlloc(
997 (1+strlenW(this->description
.lpstrName
))*2
999 strcpyW(newObject
->description
.lpstrName
, this->description
.lpstrName
);
1000 /* We need to clone the HFONT too. This is just cut & paste from above */
1001 IFont_get_Size(iface
, &cySize
);
1003 fontHeight
= MulDiv(cySize
.s
.Lo
, 2540L, 72L);
1004 fontHeight
= MulDiv(fontHeight
, this->cyLogical
,this->cyHimetric
);
1006 memset(&logFont
, 0, sizeof(LOGFONTW
));
1008 logFont
.lfHeight
= ((fontHeight
%10000L)>5000L) ? (-fontHeight
/10000L)-1 :
1009 (-fontHeight
/10000L);
1010 logFont
.lfItalic
= this->description
.fItalic
;
1011 logFont
.lfUnderline
= this->description
.fUnderline
;
1012 logFont
.lfStrikeOut
= this->description
.fStrikethrough
;
1013 logFont
.lfWeight
= this->description
.sWeight
;
1014 logFont
.lfCharSet
= this->description
.sCharset
;
1015 logFont
.lfOutPrecision
= OUT_CHARACTER_PRECIS
;
1016 logFont
.lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1017 logFont
.lfQuality
= DEFAULT_QUALITY
;
1018 logFont
.lfPitchAndFamily
= DEFAULT_PITCH
;
1019 strcpyW(logFont
.lfFaceName
,this->description
.lpstrName
);
1021 newObject
->gdiFont
= CreateFontIndirectW(&logFont
);
1024 /* The cloned object starts with a reference count of 1 */
1027 *ppfont
= (IFont
*)newObject
;
1032 /************************************************************************
1033 * OLEFontImpl_IsEqual (IFont)
1035 * See Windows documentation for more details on IFont methods.
1037 static HRESULT WINAPI
OLEFontImpl_IsEqual(
1045 /************************************************************************
1046 * OLEFontImpl_SetRatio (IFont)
1048 * See Windows documentation for more details on IFont methods.
1050 static HRESULT WINAPI
OLEFontImpl_SetRatio(
1055 _ICOM_THIS(OLEFontImpl
, iface
);
1056 TRACE("(%p)->(%ld, %ld)\n", this, cyLogical
, cyHimetric
);
1058 this->cyLogical
= cyLogical
;
1059 this->cyHimetric
= cyHimetric
;
1064 /************************************************************************
1065 * OLEFontImpl_QueryTextMetrics (IFont)
1067 * See Windows documentation for more details on IFont methods.
1069 static HRESULT WINAPI
OLEFontImpl_QueryTextMetrics(
1077 /************************************************************************
1078 * OLEFontImpl_AddRefHfont (IFont)
1080 * See Windows documentation for more details on IFont methods.
1082 static HRESULT WINAPI
OLEFontImpl_AddRefHfont(
1086 _ICOM_THIS(OLEFontImpl
, iface
);
1087 TRACE("(%p)->(%p) (lock=%ld)\n", this, hfont
, this->fontLock
);
1089 if ( (hfont
== 0) ||
1090 (hfont
!= this->gdiFont
) )
1091 return E_INVALIDARG
;
1098 /************************************************************************
1099 * OLEFontImpl_ReleaseHfont (IFont)
1101 * See Windows documentation for more details on IFont methods.
1103 static HRESULT WINAPI
OLEFontImpl_ReleaseHfont(
1107 _ICOM_THIS(OLEFontImpl
, iface
);
1108 TRACE("(%p)->(%p) (lock=%ld)\n", this, hfont
, this->fontLock
);
1110 if ( (hfont
== 0) ||
1111 (hfont
!= this->gdiFont
) )
1112 return E_INVALIDARG
;
1117 * If we just released our last font reference, destroy it.
1119 if (this->fontLock
==0)
1121 DeleteObject(this->gdiFont
);
1128 /************************************************************************
1129 * OLEFontImpl_SetHdc (IFont)
1131 * See Windows documentation for more details on IFont methods.
1133 static HRESULT WINAPI
OLEFontImpl_SetHdc(
1137 _ICOM_THIS(OLEFontImpl
, iface
);
1138 FIXME("(%p)->(%p): Stub\n", this, hdc
);
1142 /************************************************************************
1143 * OLEFontImpl_IDispatch_QueryInterface (IUnknown)
1145 * See Windows documentation for more details on IUnknown methods.
1147 static HRESULT WINAPI
OLEFontImpl_IDispatch_QueryInterface(
1152 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1154 return IFont_QueryInterface(this, riid
, ppvoid
);
1157 /************************************************************************
1158 * OLEFontImpl_IDispatch_Release (IUnknown)
1160 * See Windows documentation for more details on IUnknown methods.
1162 static ULONG WINAPI
OLEFontImpl_IDispatch_Release(
1165 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1167 return IFont_Release(this);
1170 /************************************************************************
1171 * OLEFontImpl_IDispatch_AddRef (IUnknown)
1173 * See Windows documentation for more details on IUnknown methods.
1175 static ULONG WINAPI
OLEFontImpl_IDispatch_AddRef(
1178 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1180 return IFont_AddRef(this);
1183 /************************************************************************
1184 * OLEFontImpl_GetTypeInfoCount (IDispatch)
1186 * See Windows documentation for more details on IDispatch methods.
1188 static HRESULT WINAPI
OLEFontImpl_GetTypeInfoCount(
1190 unsigned int* pctinfo
)
1192 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1193 FIXME("(%p)->(%p): Stub\n", this, pctinfo
);
1198 /************************************************************************
1199 * OLEFontImpl_GetTypeInfo (IDispatch)
1201 * See Windows documentation for more details on IDispatch methods.
1203 static HRESULT WINAPI
OLEFontImpl_GetTypeInfo(
1207 ITypeInfo
** ppTInfo
)
1209 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1210 FIXME("(%p):Stub\n", this);
1215 /************************************************************************
1216 * OLEFontImpl_GetIDsOfNames (IDispatch)
1218 * See Windows documentation for more details on IDispatch methods.
1220 static HRESULT WINAPI
OLEFontImpl_GetIDsOfNames(
1223 LPOLESTR
* rgszNames
,
1228 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1229 FIXME("(%p):Stub\n", this);
1234 /************************************************************************
1235 * OLEFontImpl_Invoke (IDispatch)
1237 * See Windows documentation for more details on IDispatch methods.
1239 static HRESULT WINAPI
OLEFontImpl_Invoke(
1241 DISPID dispIdMember
,
1245 DISPPARAMS
* pDispParams
,
1246 VARIANT
* pVarResult
,
1247 EXCEPINFO
* pExepInfo
,
1250 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1251 FIXME("%p->(%ld,%s,%lx,%x), stub!\n", this,dispIdMember
,debugstr_guid(riid
),lcid
,
1257 /************************************************************************
1258 * OLEFontImpl_IPersistStream_QueryInterface (IUnknown)
1260 * See Windows documentation for more details on IUnknown methods.
1262 static HRESULT WINAPI
OLEFontImpl_IPersistStream_QueryInterface(
1263 IPersistStream
* iface
,
1267 _ICOM_THIS_From_IPersistStream(IFont
, iface
);
1269 return IFont_QueryInterface(this, riid
, ppvoid
);
1272 /************************************************************************
1273 * OLEFontImpl_IPersistStream_Release (IUnknown)
1275 * See Windows documentation for more details on IUnknown methods.
1277 static ULONG WINAPI
OLEFontImpl_IPersistStream_Release(
1278 IPersistStream
* iface
)
1280 _ICOM_THIS_From_IPersistStream(IFont
, iface
);
1282 return IFont_Release(this);
1285 /************************************************************************
1286 * OLEFontImpl_IPersistStream_AddRef (IUnknown)
1288 * See Windows documentation for more details on IUnknown methods.
1290 static ULONG WINAPI
OLEFontImpl_IPersistStream_AddRef(
1291 IPersistStream
* iface
)
1293 _ICOM_THIS_From_IPersistStream(IFont
, iface
);
1295 return IFont_AddRef(this);
1298 /************************************************************************
1299 * OLEFontImpl_GetClassID (IPersistStream)
1301 * See Windows documentation for more details on IPersistStream methods.
1303 static HRESULT WINAPI
OLEFontImpl_GetClassID(
1304 IPersistStream
* iface
,
1310 memcpy(pClassID
, &CLSID_StdFont
, sizeof(CLSID_StdFont
));
1315 /************************************************************************
1316 * OLEFontImpl_IsDirty (IPersistStream)
1318 * See Windows documentation for more details on IPersistStream methods.
1320 static HRESULT WINAPI
OLEFontImpl_IsDirty(
1321 IPersistStream
* iface
)
1326 /************************************************************************
1327 * OLEFontImpl_Load (IPersistStream)
1329 * See Windows documentation for more details on IPersistStream methods.
1331 * This is the format of the standard font serialization as far as I
1334 * Offset Type Value Comment
1335 * 0x0000 Byte Unknown Probably a version number, contains 0x01
1336 * 0x0001 Short Charset Charset value from the FONTDESC structure
1337 * 0x0003 Byte Attributes Flags defined as follows:
1339 * 00000100 - Underline
1340 * 00001000 - Strikethrough
1341 * 0x0004 Short Weight Weight value from FONTDESC structure
1342 * 0x0006 DWORD size "Low" portion of the cySize member of the FONTDESC
1344 * 0x000A Byte name length Length of the font name string (no null character)
1345 * 0x000B String name Name of the font (ASCII, no nul character)
1347 static HRESULT WINAPI
OLEFontImpl_Load(
1348 IPersistStream
* iface
,
1349 IStream
* pLoadStream
)
1351 char readBuffer
[0x100];
1358 _ICOM_THIS_From_IPersistStream(OLEFontImpl
, iface
);
1361 * Read the version byte
1363 IStream_Read(pLoadStream
, &bVersion
, 1, &cbRead
);
1372 IStream_Read(pLoadStream
, &this->description
.sCharset
, 2, &cbRead
);
1380 IStream_Read(pLoadStream
, &bAttributes
, 1, &cbRead
);
1385 this->description
.fItalic
= (bAttributes
& FONTPERSIST_ITALIC
) != 0;
1386 this->description
.fStrikethrough
= (bAttributes
& FONTPERSIST_STRIKETHROUGH
) != 0;
1387 this->description
.fUnderline
= (bAttributes
& FONTPERSIST_UNDERLINE
) != 0;
1392 IStream_Read(pLoadStream
, &this->description
.sWeight
, 2, &cbRead
);
1400 IStream_Read(pLoadStream
, &this->description
.cySize
.s
.Lo
, 4, &cbRead
);
1405 this->description
.cySize
.s
.Hi
= 0;
1410 IStream_Read(pLoadStream
, &bStringSize
, 1, &cbRead
);
1415 IStream_Read(pLoadStream
, readBuffer
, bStringSize
, &cbRead
);
1417 if (cbRead
!=bStringSize
)
1420 if (this->description
.lpstrName
!=0)
1421 HeapFree(GetProcessHeap(), 0, this->description
.lpstrName
);
1423 len
= MultiByteToWideChar( CP_ACP
, 0, readBuffer
, bStringSize
, NULL
, 0 );
1424 this->description
.lpstrName
= HeapAlloc( GetProcessHeap(), 0, (len
+1) * sizeof(WCHAR
) );
1425 MultiByteToWideChar( CP_ACP
, 0, readBuffer
, bStringSize
, this->description
.lpstrName
, len
);
1426 this->description
.lpstrName
[len
] = 0;
1428 /* Ensure use of this font causes a new one to be created @@@@ */
1429 DeleteObject(this->gdiFont
);
1435 /************************************************************************
1436 * OLEFontImpl_Save (IPersistStream)
1438 * See Windows documentation for more details on IPersistStream methods.
1440 static HRESULT WINAPI
OLEFontImpl_Save(
1441 IPersistStream
* iface
,
1442 IStream
* pOutStream
,
1445 char* writeBuffer
= NULL
;
1447 BYTE bVersion
= 0x01;
1451 _ICOM_THIS_From_IPersistStream(OLEFontImpl
, iface
);
1454 * Read the version byte
1456 IStream_Write(pOutStream
, &bVersion
, 1, &cbWritten
);
1464 IStream_Write(pOutStream
, &this->description
.sCharset
, 2, &cbWritten
);
1474 if (this->description
.fItalic
)
1475 bAttributes
|= FONTPERSIST_ITALIC
;
1477 if (this->description
.fStrikethrough
)
1478 bAttributes
|= FONTPERSIST_STRIKETHROUGH
;
1480 if (this->description
.fUnderline
)
1481 bAttributes
|= FONTPERSIST_UNDERLINE
;
1483 IStream_Write(pOutStream
, &bAttributes
, 1, &cbWritten
);
1491 IStream_Write(pOutStream
, &this->description
.sWeight
, 2, &cbWritten
);
1499 IStream_Write(pOutStream
, &this->description
.cySize
.s
.Lo
, 4, &cbWritten
);
1507 if (this->description
.lpstrName
!=0)
1508 bStringSize
= WideCharToMultiByte( CP_ACP
, 0, this->description
.lpstrName
,
1509 strlenW(this->description
.lpstrName
), NULL
, 0, NULL
, NULL
);
1513 IStream_Write(pOutStream
, &bStringSize
, 1, &cbWritten
);
1520 if (!(writeBuffer
= HeapAlloc( GetProcessHeap(), 0, bStringSize
))) return E_OUTOFMEMORY
;
1521 WideCharToMultiByte( CP_ACP
, 0, this->description
.lpstrName
,
1522 strlenW(this->description
.lpstrName
),
1523 writeBuffer
, bStringSize
, NULL
, NULL
);
1525 IStream_Write(pOutStream
, writeBuffer
, bStringSize
, &cbWritten
);
1526 HeapFree(GetProcessHeap(), 0, writeBuffer
);
1528 if (cbWritten
!=bStringSize
)
1535 /************************************************************************
1536 * OLEFontImpl_GetSizeMax (IPersistStream)
1538 * See Windows documentation for more details on IPersistStream methods.
1540 static HRESULT WINAPI
OLEFontImpl_GetSizeMax(
1541 IPersistStream
* iface
,
1542 ULARGE_INTEGER
* pcbSize
)
1544 _ICOM_THIS_From_IPersistStream(OLEFontImpl
, iface
);
1549 pcbSize
->s
.HighPart
= 0;
1550 pcbSize
->s
.LowPart
= 0;
1552 pcbSize
->s
.LowPart
+= sizeof(BYTE
); /* Version */
1553 pcbSize
->s
.LowPart
+= sizeof(WORD
); /* Lang code */
1554 pcbSize
->s
.LowPart
+= sizeof(BYTE
); /* Flags */
1555 pcbSize
->s
.LowPart
+= sizeof(WORD
); /* Weight */
1556 pcbSize
->s
.LowPart
+= sizeof(DWORD
); /* Size */
1557 pcbSize
->s
.LowPart
+= sizeof(BYTE
); /* StrLength */
1559 if (this->description
.lpstrName
!=0)
1560 pcbSize
->s
.LowPart
+= lstrlenW(this->description
.lpstrName
);
1565 /************************************************************************
1566 * OLEFontImpl_IConnectionPointContainer_QueryInterface (IUnknown)
1568 * See Windows documentation for more details on IUnknown methods.
1570 static HRESULT WINAPI
OLEFontImpl_IConnectionPointContainer_QueryInterface(
1571 IConnectionPointContainer
* iface
,
1575 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1577 return IFont_QueryInterface((IFont
*)this, riid
, ppvoid
);
1580 /************************************************************************
1581 * OLEFontImpl_IConnectionPointContainer_Release (IUnknown)
1583 * See Windows documentation for more details on IUnknown methods.
1585 static ULONG WINAPI
OLEFontImpl_IConnectionPointContainer_Release(
1586 IConnectionPointContainer
* iface
)
1588 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1590 return IFont_Release((IFont
*)this);
1593 /************************************************************************
1594 * OLEFontImpl_IConnectionPointContainer_AddRef (IUnknown)
1596 * See Windows documentation for more details on IUnknown methods.
1598 static ULONG WINAPI
OLEFontImpl_IConnectionPointContainer_AddRef(
1599 IConnectionPointContainer
* iface
)
1601 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1603 return IFont_AddRef((IFont
*)this);
1606 /************************************************************************
1607 * OLEFontImpl_EnumConnectionPoints (IConnectionPointContainer)
1609 * See Windows documentation for more details on IConnectionPointContainer
1612 static HRESULT WINAPI
OLEFontImpl_EnumConnectionPoints(
1613 IConnectionPointContainer
* iface
,
1614 IEnumConnectionPoints
**ppEnum
)
1616 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1618 FIXME("(%p)->(%p): stub\n", this, ppEnum
);
1622 /************************************************************************
1623 * OLEFontImpl_FindConnectionPoint (IConnectionPointContainer)
1625 * See Windows documentation for more details on IConnectionPointContainer
1628 static HRESULT WINAPI
OLEFontImpl_FindConnectionPoint(
1629 IConnectionPointContainer
* iface
,
1631 IConnectionPoint
**ppCp
)
1633 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1634 TRACE("(%p)->(%s, %p): stub\n", this, debugstr_guid(riid
), ppCp
);
1636 if(memcmp(riid
, &IID_IPropertyNotifySink
, sizeof(IID_IPropertyNotifySink
)) == 0) {
1637 return IConnectionPoint_QueryInterface(this->pCP
, &IID_IConnectionPoint
,
1640 FIXME("Tried to find connection point on %s\n", debugstr_guid(riid
));
1641 return E_NOINTERFACE
;
1645 /*******************************************************************************
1646 * StdFont ClassFactory
1650 /* IUnknown fields */
1651 ICOM_VFIELD(IClassFactory
);
1653 } IClassFactoryImpl
;
1655 static HRESULT WINAPI
1656 SFCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
1657 ICOM_THIS(IClassFactoryImpl
,iface
);
1659 FIXME("(%p)->(%s,%p),stub!\n",This
,debugstr_guid(riid
),ppobj
);
1660 return E_NOINTERFACE
;
1664 SFCF_AddRef(LPCLASSFACTORY iface
) {
1665 ICOM_THIS(IClassFactoryImpl
,iface
);
1666 return ++(This
->ref
);
1669 static ULONG WINAPI
SFCF_Release(LPCLASSFACTORY iface
) {
1670 ICOM_THIS(IClassFactoryImpl
,iface
);
1671 /* static class, won't be freed */
1672 return --(This
->ref
);
1675 static HRESULT WINAPI
SFCF_CreateInstance(
1676 LPCLASSFACTORY iface
,LPUNKNOWN pOuter
,REFIID riid
,LPVOID
*ppobj
1680 WCHAR fname
[] = { 'S','y','s','t','e','m',0 };
1682 fd
.cbSizeofstruct
= sizeof(fd
);
1683 fd
.lpstrName
= fname
;
1684 fd
.cySize
.s
.Lo
= 80000;
1690 fd
.fStrikethrough
= 0;
1691 return OleCreateFontIndirect(&fd
,riid
,ppobj
);
1695 static HRESULT WINAPI
SFCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
) {
1696 ICOM_THIS(IClassFactoryImpl
,iface
);
1697 FIXME("(%p)->(%d),stub!\n",This
,dolock
);
1701 static ICOM_VTABLE(IClassFactory
) SFCF_Vtbl
= {
1702 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1703 SFCF_QueryInterface
,
1706 SFCF_CreateInstance
,
1709 static IClassFactoryImpl STDFONT_CF
= {&SFCF_Vtbl
, 1 };
1711 void _get_STDFONT_CF(LPVOID
*ppv
) { *ppv
= (LPVOID
)&STDFONT_CF
; }