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
29 #include "wine/unicode.h"
30 #include "oleauto.h" /* for SysAllocString(....) */
31 #include "wine/obj_base.h"
32 #include "wine/obj_olefont.h"
33 #include "wine/obj_storage.h"
36 #include "wine/debug.h"
37 #include "connpt.h" /* for CreateConnectionPoint */
39 WINE_DEFAULT_DEBUG_CHANNEL(ole
);
41 /***********************************************************************
42 * Declaration of constants used when serializing the font object.
44 #define FONTPERSIST_ITALIC 0x02
45 #define FONTPERSIST_UNDERLINE 0x04
46 #define FONTPERSIST_STRIKETHROUGH 0x08
48 /***********************************************************************
49 * Declaration of the implementation class for the IFont interface
51 typedef struct OLEFontImpl OLEFontImpl
;
56 * This class supports many interfaces. IUnknown, IFont,
57 * IDispatch, IDispFont IPersistStream and IConnectionPointContainer.
58 * The first two are supported by the first vtable, the next two are
59 * supported by the second table and the last two have their own.
61 ICOM_VTABLE(IFont
)* lpvtbl1
;
62 ICOM_VTABLE(IDispatch
)* lpvtbl2
;
63 ICOM_VTABLE(IPersistStream
)* lpvtbl3
;
64 ICOM_VTABLE(IConnectionPointContainer
)* lpvtbl4
;
66 * Reference count for that instance of the class.
71 * This structure contains the description of the class.
76 * Contain the font associated with this object.
91 IConnectionPoint
*pCP
;
95 * Here, I define utility macros to help with the casting of the
97 * There is a version to accomodate all of the VTables implemented
100 #define _ICOM_THIS(class,name) class* this = (class*)name;
101 #define _ICOM_THIS_From_IDispatch(class, name) class* this = (class*)(((char*)name)-sizeof(void*));
102 #define _ICOM_THIS_From_IPersistStream(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*));
103 #define _ICOM_THIS_From_IConnectionPointContainer(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*));
106 /***********************************************************************
107 * Prototypes for the implementation functions for the IFont
110 static OLEFontImpl
* OLEFontImpl_Construct(LPFONTDESC fontDesc
);
111 static void OLEFontImpl_Destroy(OLEFontImpl
* fontDesc
);
112 static HRESULT WINAPI
OLEFontImpl_QueryInterface(IFont
* iface
, REFIID riid
, VOID
** ppvoid
);
113 static ULONG WINAPI
OLEFontImpl_AddRef(IFont
* iface
);
114 static ULONG WINAPI
OLEFontImpl_Release(IFont
* iface
);
115 static HRESULT WINAPI
OLEFontImpl_get_Name(IFont
* iface
, BSTR
* pname
);
116 static HRESULT WINAPI
OLEFontImpl_put_Name(IFont
* iface
, BSTR name
);
117 static HRESULT WINAPI
OLEFontImpl_get_Size(IFont
* iface
, CY
* psize
);
118 static HRESULT WINAPI
OLEFontImpl_put_Size(IFont
* iface
, CY size
);
119 static HRESULT WINAPI
OLEFontImpl_get_Bold(IFont
* iface
, BOOL
* pbold
);
120 static HRESULT WINAPI
OLEFontImpl_put_Bold(IFont
* iface
, BOOL bold
);
121 static HRESULT WINAPI
OLEFontImpl_get_Italic(IFont
* iface
, BOOL
* pitalic
);
122 static HRESULT WINAPI
OLEFontImpl_put_Italic(IFont
* iface
, BOOL italic
);
123 static HRESULT WINAPI
OLEFontImpl_get_Underline(IFont
* iface
, BOOL
* punderline
);
124 static HRESULT WINAPI
OLEFontImpl_put_Underline(IFont
* iface
, BOOL underline
);
125 static HRESULT WINAPI
OLEFontImpl_get_Strikethrough(IFont
* iface
, BOOL
* pstrikethrough
);
126 static HRESULT WINAPI
OLEFontImpl_put_Strikethrough(IFont
* iface
, BOOL strikethrough
);
127 static HRESULT WINAPI
OLEFontImpl_get_Weight(IFont
* iface
, short* pweight
);
128 static HRESULT WINAPI
OLEFontImpl_put_Weight(IFont
* iface
, short weight
);
129 static HRESULT WINAPI
OLEFontImpl_get_Charset(IFont
* iface
, short* pcharset
);
130 static HRESULT WINAPI
OLEFontImpl_put_Charset(IFont
* iface
, short charset
);
131 static HRESULT WINAPI
OLEFontImpl_get_hFont(IFont
* iface
, HFONT
* phfont
);
132 static HRESULT WINAPI
OLEFontImpl_Clone(IFont
* iface
, IFont
** ppfont
);
133 static HRESULT WINAPI
OLEFontImpl_IsEqual(IFont
* iface
, IFont
* pFontOther
);
134 static HRESULT WINAPI
OLEFontImpl_SetRatio(IFont
* iface
, long cyLogical
, long cyHimetric
);
135 static HRESULT WINAPI
OLEFontImpl_QueryTextMetrics(IFont
* iface
, TEXTMETRICOLE
* ptm
);
136 static HRESULT WINAPI
OLEFontImpl_AddRefHfont(IFont
* iface
, HFONT hfont
);
137 static HRESULT WINAPI
OLEFontImpl_ReleaseHfont(IFont
* iface
, HFONT hfont
);
138 static HRESULT WINAPI
OLEFontImpl_SetHdc(IFont
* iface
, HDC hdc
);
140 /***********************************************************************
141 * Prototypes for the implementation functions for the IDispatch
144 static HRESULT WINAPI
OLEFontImpl_IDispatch_QueryInterface(IDispatch
* iface
,
147 static ULONG WINAPI
OLEFontImpl_IDispatch_AddRef(IDispatch
* iface
);
148 static ULONG WINAPI
OLEFontImpl_IDispatch_Release(IDispatch
* iface
);
149 static HRESULT WINAPI
OLEFontImpl_GetTypeInfoCount(IDispatch
* iface
,
150 unsigned int* pctinfo
);
151 static HRESULT WINAPI
OLEFontImpl_GetTypeInfo(IDispatch
* iface
,
154 ITypeInfo
** ppTInfo
);
155 static HRESULT WINAPI
OLEFontImpl_GetIDsOfNames(IDispatch
* iface
,
161 static HRESULT WINAPI
OLEFontImpl_Invoke(IDispatch
* iface
,
166 DISPPARAMS
* pDispParams
,
168 EXCEPINFO
* pExepInfo
,
171 /***********************************************************************
172 * Prototypes for the implementation functions for the IPersistStream
175 static HRESULT WINAPI
OLEFontImpl_IPersistStream_QueryInterface(IPersistStream
* iface
,
178 static ULONG WINAPI
OLEFontImpl_IPersistStream_AddRef(IPersistStream
* iface
);
179 static ULONG WINAPI
OLEFontImpl_IPersistStream_Release(IPersistStream
* iface
);
180 static HRESULT WINAPI
OLEFontImpl_GetClassID(IPersistStream
* iface
,
182 static HRESULT WINAPI
OLEFontImpl_IsDirty(IPersistStream
* iface
);
183 static HRESULT WINAPI
OLEFontImpl_Load(IPersistStream
* iface
,
184 IStream
* pLoadStream
);
185 static HRESULT WINAPI
OLEFontImpl_Save(IPersistStream
* iface
,
188 static HRESULT WINAPI
OLEFontImpl_GetSizeMax(IPersistStream
* iface
,
189 ULARGE_INTEGER
* pcbSize
);
191 /***********************************************************************
192 * Prototypes for the implementation functions for the
193 * IConnectionPointContainer interface
195 static HRESULT WINAPI
OLEFontImpl_IConnectionPointContainer_QueryInterface(
196 IConnectionPointContainer
* iface
,
199 static ULONG WINAPI
OLEFontImpl_IConnectionPointContainer_AddRef(
200 IConnectionPointContainer
* iface
);
201 static ULONG WINAPI
OLEFontImpl_IConnectionPointContainer_Release(
202 IConnectionPointContainer
* iface
);
203 static HRESULT WINAPI
OLEFontImpl_EnumConnectionPoints(
204 IConnectionPointContainer
* iface
,
205 IEnumConnectionPoints
**ppEnum
);
206 static HRESULT WINAPI
OLEFontImpl_FindConnectionPoint(
207 IConnectionPointContainer
* iface
,
209 IConnectionPoint
**ppCp
);
212 * Virtual function tables for the OLEFontImpl class.
214 static ICOM_VTABLE(IFont
) OLEFontImpl_VTable
=
216 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
217 OLEFontImpl_QueryInterface
,
220 OLEFontImpl_get_Name
,
221 OLEFontImpl_put_Name
,
222 OLEFontImpl_get_Size
,
223 OLEFontImpl_put_Size
,
224 OLEFontImpl_get_Bold
,
225 OLEFontImpl_put_Bold
,
226 OLEFontImpl_get_Italic
,
227 OLEFontImpl_put_Italic
,
228 OLEFontImpl_get_Underline
,
229 OLEFontImpl_put_Underline
,
230 OLEFontImpl_get_Strikethrough
,
231 OLEFontImpl_put_Strikethrough
,
232 OLEFontImpl_get_Weight
,
233 OLEFontImpl_put_Weight
,
234 OLEFontImpl_get_Charset
,
235 OLEFontImpl_put_Charset
,
236 OLEFontImpl_get_hFont
,
239 OLEFontImpl_SetRatio
,
240 OLEFontImpl_QueryTextMetrics
,
241 OLEFontImpl_AddRefHfont
,
242 OLEFontImpl_ReleaseHfont
,
246 static ICOM_VTABLE(IDispatch
) OLEFontImpl_IDispatch_VTable
=
248 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
249 OLEFontImpl_IDispatch_QueryInterface
,
250 OLEFontImpl_IDispatch_AddRef
,
251 OLEFontImpl_IDispatch_Release
,
252 OLEFontImpl_GetTypeInfoCount
,
253 OLEFontImpl_GetTypeInfo
,
254 OLEFontImpl_GetIDsOfNames
,
258 static ICOM_VTABLE(IPersistStream
) OLEFontImpl_IPersistStream_VTable
=
260 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
261 OLEFontImpl_IPersistStream_QueryInterface
,
262 OLEFontImpl_IPersistStream_AddRef
,
263 OLEFontImpl_IPersistStream_Release
,
264 OLEFontImpl_GetClassID
,
268 OLEFontImpl_GetSizeMax
271 static ICOM_VTABLE(IConnectionPointContainer
)
272 OLEFontImpl_IConnectionPointContainer_VTable
=
274 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
275 OLEFontImpl_IConnectionPointContainer_QueryInterface
,
276 OLEFontImpl_IConnectionPointContainer_AddRef
,
277 OLEFontImpl_IConnectionPointContainer_Release
,
278 OLEFontImpl_EnumConnectionPoints
,
279 OLEFontImpl_FindConnectionPoint
282 /******************************************************************************
283 * OleCreateFontIndirect [OLEAUT32.420]
285 HRESULT WINAPI
OleCreateFontIndirect(
286 LPFONTDESC lpFontDesc
,
290 OLEFontImpl
* newFont
= 0;
293 TRACE("(%p, %s, %p)\n", lpFontDesc
, debugstr_guid(riid
), ppvObj
);
303 return NO_ERROR
; /* MSDN Oct 2001 */
306 * Try to construct a new instance of the class.
308 newFont
= OLEFontImpl_Construct(lpFontDesc
);
311 return E_OUTOFMEMORY
;
314 * Make sure it supports the interface required by the caller.
316 hr
= IFont_QueryInterface((IFont
*)newFont
, riid
, ppvObj
);
319 * Release the reference obtained in the constructor. If
320 * the QueryInterface was unsuccessful, it will free the class.
322 IFont_Release((IFont
*)newFont
);
328 /***********************************************************************
329 * Implementation of the OLEFontImpl class.
332 /***********************************************************************
333 * OLEFont_SendNotify (internal)
335 * Sends notification messages of changed properties to any interested
338 static void OLEFont_SendNotify(OLEFontImpl
* this, DISPID dispID
)
340 IEnumConnections
*pEnum
;
343 IConnectionPoint_EnumConnections(this->pCP
, &pEnum
);
345 while(IEnumConnections_Next(pEnum
, 1, &CD
, NULL
) == S_OK
) {
346 IPropertyNotifySink
*sink
;
348 IUnknown_QueryInterface(CD
.pUnk
, &IID_IPropertyNotifySink
, (LPVOID
)&sink
);
349 IPropertyNotifySink_OnChanged(sink
, dispID
);
350 IPropertyNotifySink_Release(sink
);
351 IUnknown_Release(CD
.pUnk
);
353 IEnumConnections_Release(pEnum
);
357 /************************************************************************
358 * OLEFontImpl_Construct
360 * This method will construct a new instance of the OLEFontImpl
363 * The caller of this method must release the object when it's
366 static OLEFontImpl
* OLEFontImpl_Construct(LPFONTDESC fontDesc
)
368 OLEFontImpl
* newObject
= 0;
371 * Allocate space for the object.
373 newObject
= HeapAlloc(GetProcessHeap(), 0, sizeof(OLEFontImpl
));
379 * Initialize the virtual function table.
381 newObject
->lpvtbl1
= &OLEFontImpl_VTable
;
382 newObject
->lpvtbl2
= &OLEFontImpl_IDispatch_VTable
;
383 newObject
->lpvtbl3
= &OLEFontImpl_IPersistStream_VTable
;
384 newObject
->lpvtbl4
= &OLEFontImpl_IConnectionPointContainer_VTable
;
387 * Start with one reference count. The caller of this function
388 * must release the interface pointer when it is done.
393 * Copy the description of the font in the object.
395 assert(fontDesc
->cbSizeofstruct
>= sizeof(FONTDESC
));
397 newObject
->description
.cbSizeofstruct
= sizeof(FONTDESC
);
398 newObject
->description
.lpstrName
= HeapAlloc(GetProcessHeap(),
400 (lstrlenW(fontDesc
->lpstrName
)+1) * sizeof(WCHAR
));
401 strcpyW(newObject
->description
.lpstrName
, fontDesc
->lpstrName
);
402 newObject
->description
.cySize
= fontDesc
->cySize
;
403 newObject
->description
.sWeight
= fontDesc
->sWeight
;
404 newObject
->description
.sCharset
= fontDesc
->sCharset
;
405 newObject
->description
.fItalic
= fontDesc
->fItalic
;
406 newObject
->description
.fUnderline
= fontDesc
->fUnderline
;
407 newObject
->description
.fStrikethrough
= fontDesc
->fStrikethrough
;
410 * Initializing all the other members.
412 newObject
->gdiFont
= 0;
413 newObject
->fontLock
= 0;
414 newObject
->cyHimetric
= 1;
415 newObject
->cyLogical
= 1;
417 CreateConnectionPoint((IUnknown
*)newObject
, &IID_IPropertyNotifySink
, &newObject
->pCP
);
419 TRACE("returning %p\n", newObject
);
423 /************************************************************************
424 * OLEFontImpl_Destroy
426 * This method is called by the Release method when the reference
427 * count goes down to 0. It will free all resources used by
430 static void OLEFontImpl_Destroy(OLEFontImpl
* fontDesc
)
432 TRACE("(%p)\n", fontDesc
);
434 if (fontDesc
->description
.lpstrName
!=0)
435 HeapFree(GetProcessHeap(), 0, fontDesc
->description
.lpstrName
);
437 if (fontDesc
->gdiFont
!=0)
438 DeleteObject(fontDesc
->gdiFont
);
440 HeapFree(GetProcessHeap(), 0, fontDesc
);
443 /************************************************************************
444 * OLEFontImpl_QueryInterface (IUnknown)
446 * See Windows documentation for more details on IUnknown methods.
448 HRESULT WINAPI
OLEFontImpl_QueryInterface(
453 _ICOM_THIS(OLEFontImpl
, iface
);
454 TRACE("(%p)->(%s, %p)\n", this, debugstr_guid(riid
), ppvObject
);
457 * Perform a sanity check on the parameters.
459 if ( (this==0) || (ppvObject
==0) )
463 * Initialize the return parameter.
468 * Compare the riid with the interface IDs implemented by this object.
470 if (memcmp(&IID_IUnknown
, riid
, sizeof(IID_IUnknown
)) == 0)
472 *ppvObject
= (IFont
*)this;
474 else if (memcmp(&IID_IFont
, riid
, sizeof(IID_IFont
)) == 0)
476 *ppvObject
= (IFont
*)this;
478 else if (memcmp(&IID_IDispatch
, riid
, sizeof(IID_IDispatch
)) == 0)
480 *ppvObject
= (IDispatch
*)&(this->lpvtbl2
);
482 else if (memcmp(&IID_IFontDisp
, riid
, sizeof(IID_IFontDisp
)) == 0)
484 *ppvObject
= (IDispatch
*)&(this->lpvtbl2
);
486 else if (memcmp(&IID_IPersistStream
, riid
, sizeof(IID_IPersistStream
)) == 0)
488 *ppvObject
= (IPersistStream
*)&(this->lpvtbl3
);
490 else if (memcmp(&IID_IConnectionPointContainer
, riid
,
491 sizeof(IID_IConnectionPointContainer
)) == 0)
493 *ppvObject
= (IPersistStream
*)&(this->lpvtbl4
);
497 * Check that we obtained an interface.
501 FIXME("() : asking for un supported interface %s\n",debugstr_guid(riid
));
502 return E_NOINTERFACE
;
506 * Query Interface always increases the reference count by one when it is
509 OLEFontImpl_AddRef((IFont
*)this);
514 /************************************************************************
515 * OLEFontImpl_AddRef (IUnknown)
517 * See Windows documentation for more details on IUnknown methods.
519 ULONG WINAPI
OLEFontImpl_AddRef(
522 _ICOM_THIS(OLEFontImpl
, iface
);
523 TRACE("(%p)->(ref=%ld)\n", this, this->ref
);
529 /************************************************************************
530 * OLEFontImpl_Release (IUnknown)
532 * See Windows documentation for more details on IUnknown methods.
534 ULONG WINAPI
OLEFontImpl_Release(
537 _ICOM_THIS(OLEFontImpl
, iface
);
538 TRACE("(%p)->(ref=%ld)\n", this, this->ref
);
541 * Decrease the reference count on this object.
546 * If the reference count goes down to 0, perform suicide.
550 OLEFontImpl_Destroy(this);
558 /************************************************************************
559 * OLEFontImpl_get_Name (IFont)
561 * See Windows documentation for more details on IFont methods.
563 static HRESULT WINAPI
OLEFontImpl_get_Name(
567 _ICOM_THIS(OLEFontImpl
, iface
);
568 TRACE("(%p)->(%p)\n", this, pname
);
575 if (this->description
.lpstrName
!=0)
576 *pname
= SysAllocString(this->description
.lpstrName
);
583 /************************************************************************
584 * OLEFontImpl_put_Name (IFont)
586 * See Windows documentation for more details on IFont methods.
588 static HRESULT WINAPI
OLEFontImpl_put_Name(
592 _ICOM_THIS(OLEFontImpl
, iface
);
593 TRACE("(%p)->(%p)\n", this, name
);
595 if (this->description
.lpstrName
==0)
597 this->description
.lpstrName
= HeapAlloc(GetProcessHeap(),
599 (lstrlenW(name
)+1) * sizeof(WCHAR
));
603 this->description
.lpstrName
= HeapReAlloc(GetProcessHeap(),
605 this->description
.lpstrName
,
606 (lstrlenW(name
)+1) * sizeof(WCHAR
));
609 if (this->description
.lpstrName
==0)
610 return E_OUTOFMEMORY
;
612 strcpyW(this->description
.lpstrName
, name
);
613 TRACE("new name %s\n", debugstr_w(this->description
.lpstrName
));
614 OLEFont_SendNotify(this, DISPID_FONT_NAME
);
618 /************************************************************************
619 * OLEFontImpl_get_Size (IFont)
621 * See Windows documentation for more details on IFont methods.
623 static HRESULT WINAPI
OLEFontImpl_get_Size(
627 _ICOM_THIS(OLEFontImpl
, iface
);
628 TRACE("(%p)->(%p)\n", this, psize
);
637 psize
->s
.Lo
= this->description
.cySize
.s
.Lo
;
642 /************************************************************************
643 * OLEFontImpl_put_Size (IFont)
645 * See Windows documentation for more details on IFont methods.
647 static HRESULT WINAPI
OLEFontImpl_put_Size(
651 _ICOM_THIS(OLEFontImpl
, iface
);
652 TRACE("(%p)->(%ld)\n", this, size
.s
.Lo
);
653 this->description
.cySize
.s
.Hi
= 0;
654 this->description
.cySize
.s
.Lo
= size
.s
.Lo
;
655 OLEFont_SendNotify(this, DISPID_FONT_SIZE
);
660 /************************************************************************
661 * OLEFontImpl_get_Bold (IFont)
663 * See Windows documentation for more details on IFont methods.
665 static HRESULT WINAPI
OLEFontImpl_get_Bold(
669 _ICOM_THIS(OLEFontImpl
, iface
);
670 TRACE("(%p)->(%p)\n", this, pbold
);
677 *pbold
= this->description
.sWeight
> 550;
682 /************************************************************************
683 * OLEFontImpl_put_Bold (IFont)
685 * See Windows documentation for more details on IFont methods.
687 static HRESULT WINAPI
OLEFontImpl_put_Bold(
691 _ICOM_THIS(OLEFontImpl
, iface
);
692 TRACE("(%p)->(%d)\n", this, bold
);
693 this->description
.sWeight
= bold
? FW_BOLD
: FW_NORMAL
;
694 OLEFont_SendNotify(this, DISPID_FONT_BOLD
);
699 /************************************************************************
700 * OLEFontImpl_get_Italic (IFont)
702 * See Windows documentation for more details on IFont methods.
704 static HRESULT WINAPI
OLEFontImpl_get_Italic(
708 _ICOM_THIS(OLEFontImpl
, iface
);
709 TRACE("(%p)->(%p)\n", this, pitalic
);
716 *pitalic
= this->description
.fItalic
;
721 /************************************************************************
722 * OLEFontImpl_put_Italic (IFont)
724 * See Windows documentation for more details on IFont methods.
726 static HRESULT WINAPI
OLEFontImpl_put_Italic(
730 _ICOM_THIS(OLEFontImpl
, iface
);
731 TRACE("(%p)->(%d)\n", this, italic
);
733 this->description
.fItalic
= italic
;
735 OLEFont_SendNotify(this, DISPID_FONT_ITALIC
);
739 /************************************************************************
740 * OLEFontImpl_get_Underline (IFont)
742 * See Windows documentation for more details on IFont methods.
744 static HRESULT WINAPI
OLEFontImpl_get_Underline(
748 _ICOM_THIS(OLEFontImpl
, iface
);
749 TRACE("(%p)->(%p)\n", this, punderline
);
757 *punderline
= this->description
.fUnderline
;
762 /************************************************************************
763 * OLEFontImpl_put_Underline (IFont)
765 * See Windows documentation for more details on IFont methods.
767 static HRESULT WINAPI
OLEFontImpl_put_Underline(
771 _ICOM_THIS(OLEFontImpl
, iface
);
772 TRACE("(%p)->(%d)\n", this, underline
);
774 this->description
.fUnderline
= underline
;
776 OLEFont_SendNotify(this, DISPID_FONT_UNDER
);
780 /************************************************************************
781 * OLEFontImpl_get_Strikethrough (IFont)
783 * See Windows documentation for more details on IFont methods.
785 static HRESULT WINAPI
OLEFontImpl_get_Strikethrough(
787 BOOL
* pstrikethrough
)
789 _ICOM_THIS(OLEFontImpl
, iface
);
790 TRACE("(%p)->(%p)\n", this, pstrikethrough
);
795 if (pstrikethrough
==0)
798 *pstrikethrough
= this->description
.fStrikethrough
;
803 /************************************************************************
804 * OLEFontImpl_put_Strikethrough (IFont)
806 * See Windows documentation for more details on IFont methods.
808 static HRESULT WINAPI
OLEFontImpl_put_Strikethrough(
812 _ICOM_THIS(OLEFontImpl
, iface
);
813 TRACE("(%p)->(%d)\n", this, strikethrough
);
815 this->description
.fStrikethrough
= strikethrough
;
816 OLEFont_SendNotify(this, DISPID_FONT_STRIKE
);
821 /************************************************************************
822 * OLEFontImpl_get_Weight (IFont)
824 * See Windows documentation for more details on IFont methods.
826 static HRESULT WINAPI
OLEFontImpl_get_Weight(
830 _ICOM_THIS(OLEFontImpl
, iface
);
831 TRACE("(%p)->(%p)\n", this, pweight
);
839 *pweight
= this->description
.sWeight
;
844 /************************************************************************
845 * OLEFontImpl_put_Weight (IFont)
847 * See Windows documentation for more details on IFont methods.
849 static HRESULT WINAPI
OLEFontImpl_put_Weight(
853 _ICOM_THIS(OLEFontImpl
, iface
);
854 TRACE("(%p)->(%d)\n", this, weight
);
856 this->description
.sWeight
= weight
;
858 OLEFont_SendNotify(this, DISPID_FONT_WEIGHT
);
862 /************************************************************************
863 * OLEFontImpl_get_Charset (IFont)
865 * See Windows documentation for more details on IFont methods.
867 static HRESULT WINAPI
OLEFontImpl_get_Charset(
871 _ICOM_THIS(OLEFontImpl
, iface
);
872 TRACE("(%p)->(%p)\n", this, pcharset
);
880 *pcharset
= this->description
.sCharset
;
885 /************************************************************************
886 * OLEFontImpl_put_Charset (IFont)
888 * See Windows documentation for more details on IFont methods.
890 static HRESULT WINAPI
OLEFontImpl_put_Charset(
894 _ICOM_THIS(OLEFontImpl
, iface
);
895 TRACE("(%p)->(%d)\n", this, charset
);
897 this->description
.sCharset
= charset
;
898 OLEFont_SendNotify(this, DISPID_FONT_CHARSET
);
903 /************************************************************************
904 * OLEFontImpl_get_hFont (IFont)
906 * See Windows documentation for more details on IFont methods.
908 static HRESULT WINAPI
OLEFontImpl_get_hFont(
912 _ICOM_THIS(OLEFontImpl
, iface
);
913 TRACE("(%p)->(%p)\n", this, phfont
);
918 * Realize the font if necessary
920 if (this->gdiFont
==0)
927 * The height of the font returned by the get_Size property is the
928 * height of the font in points multiplied by 10000... Using some
929 * simple conversions and the ratio given by the application, it can
930 * be converted to a height in pixels.
932 IFont_get_Size(iface
, &cySize
);
934 fontHeight
= MulDiv(cySize
.s
.Lo
, 2540L, 72L);
935 fontHeight
= MulDiv(fontHeight
, this->cyLogical
,this->cyHimetric
);
937 memset(&logFont
, 0, sizeof(LOGFONTW
));
939 logFont
.lfHeight
= ((fontHeight
%10000L)>5000L) ? (-fontHeight
/10000L)-1 :
940 (-fontHeight
/10000L);
941 logFont
.lfItalic
= this->description
.fItalic
;
942 logFont
.lfUnderline
= this->description
.fUnderline
;
943 logFont
.lfStrikeOut
= this->description
.fStrikethrough
;
944 logFont
.lfWeight
= this->description
.sWeight
;
945 logFont
.lfCharSet
= this->description
.sCharset
;
946 logFont
.lfOutPrecision
= OUT_CHARACTER_PRECIS
;
947 logFont
.lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
948 logFont
.lfQuality
= DEFAULT_QUALITY
;
949 logFont
.lfPitchAndFamily
= DEFAULT_PITCH
;
950 strcpyW(logFont
.lfFaceName
,this->description
.lpstrName
);
952 this->gdiFont
= CreateFontIndirectW(&logFont
);
955 *phfont
= this->gdiFont
;
956 TRACE("Returning %08x\n", *phfont
);
960 /************************************************************************
961 * OLEFontImpl_Clone (IFont)
963 * See Windows documentation for more details on IFont methods.
965 static HRESULT WINAPI
OLEFontImpl_Clone(
969 OLEFontImpl
* newObject
= 0;
973 _ICOM_THIS(OLEFontImpl
, iface
);
974 TRACE("(%p)->(%p)\n", this, ppfont
);
982 * Allocate space for the object.
984 newObject
= HeapAlloc(GetProcessHeap(), 0, sizeof(OLEFontImpl
));
987 return E_OUTOFMEMORY
;
991 /* We need to alloc new memory for the string, otherwise
992 * we free memory twice.
994 newObject
->description
.lpstrName
= HeapAlloc(
996 (1+strlenW(this->description
.lpstrName
))*2
998 /* We need to clone the HFONT too. This is just cut & paste from above */
999 IFont_get_Size(iface
, &cySize
);
1001 fontHeight
= MulDiv(cySize
.s
.Lo
, 2540L, 72L);
1002 fontHeight
= MulDiv(fontHeight
, this->cyLogical
,this->cyHimetric
);
1004 memset(&logFont
, 0, sizeof(LOGFONTW
));
1006 logFont
.lfHeight
= ((fontHeight
%10000L)>5000L) ? (-fontHeight
/10000L)-1 :
1007 (-fontHeight
/10000L);
1008 logFont
.lfItalic
= this->description
.fItalic
;
1009 logFont
.lfUnderline
= this->description
.fUnderline
;
1010 logFont
.lfStrikeOut
= this->description
.fStrikethrough
;
1011 logFont
.lfWeight
= this->description
.sWeight
;
1012 logFont
.lfCharSet
= this->description
.sCharset
;
1013 logFont
.lfOutPrecision
= OUT_CHARACTER_PRECIS
;
1014 logFont
.lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1015 logFont
.lfQuality
= DEFAULT_QUALITY
;
1016 logFont
.lfPitchAndFamily
= DEFAULT_PITCH
;
1017 strcpyW(logFont
.lfFaceName
,this->description
.lpstrName
);
1019 newObject
->gdiFont
= CreateFontIndirectW(&logFont
);
1022 /* The cloned object starts with a reference count of 1 */
1025 *ppfont
= (IFont
*)newObject
;
1030 /************************************************************************
1031 * OLEFontImpl_IsEqual (IFont)
1033 * See Windows documentation for more details on IFont methods.
1035 static HRESULT WINAPI
OLEFontImpl_IsEqual(
1043 /************************************************************************
1044 * OLEFontImpl_SetRatio (IFont)
1046 * See Windows documentation for more details on IFont methods.
1048 static HRESULT WINAPI
OLEFontImpl_SetRatio(
1053 _ICOM_THIS(OLEFontImpl
, iface
);
1054 TRACE("(%p)->(%ld, %ld)\n", this, cyLogical
, cyHimetric
);
1056 this->cyLogical
= cyLogical
;
1057 this->cyHimetric
= cyHimetric
;
1062 /************************************************************************
1063 * OLEFontImpl_QueryTextMetrics (IFont)
1065 * See Windows documentation for more details on IFont methods.
1067 static HRESULT WINAPI
OLEFontImpl_QueryTextMetrics(
1075 /************************************************************************
1076 * OLEFontImpl_AddRefHfont (IFont)
1078 * See Windows documentation for more details on IFont methods.
1080 static HRESULT WINAPI
OLEFontImpl_AddRefHfont(
1084 _ICOM_THIS(OLEFontImpl
, iface
);
1085 TRACE("(%p)->(%08x) (lock=%ld)\n", this, hfont
, this->fontLock
);
1087 if ( (hfont
== 0) ||
1088 (hfont
!= this->gdiFont
) )
1089 return E_INVALIDARG
;
1096 /************************************************************************
1097 * OLEFontImpl_ReleaseHfont (IFont)
1099 * See Windows documentation for more details on IFont methods.
1101 static HRESULT WINAPI
OLEFontImpl_ReleaseHfont(
1105 _ICOM_THIS(OLEFontImpl
, iface
);
1106 TRACE("(%p)->(%08x) (lock=%ld)\n", this, hfont
, this->fontLock
);
1108 if ( (hfont
== 0) ||
1109 (hfont
!= this->gdiFont
) )
1110 return E_INVALIDARG
;
1115 * If we just released our last font reference, destroy it.
1117 if (this->fontLock
==0)
1119 DeleteObject(this->gdiFont
);
1126 /************************************************************************
1127 * OLEFontImpl_SetHdc (IFont)
1129 * See Windows documentation for more details on IFont methods.
1131 static HRESULT WINAPI
OLEFontImpl_SetHdc(
1135 _ICOM_THIS(OLEFontImpl
, iface
);
1136 FIXME("(%p)->(%08x): Stub\n", this, hdc
);
1140 /************************************************************************
1141 * OLEFontImpl_IDispatch_QueryInterface (IUnknown)
1143 * See Windows documentation for more details on IUnknown methods.
1145 static HRESULT WINAPI
OLEFontImpl_IDispatch_QueryInterface(
1150 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1152 return IFont_QueryInterface(this, riid
, ppvoid
);
1155 /************************************************************************
1156 * OLEFontImpl_IDispatch_Release (IUnknown)
1158 * See Windows documentation for more details on IUnknown methods.
1160 static ULONG WINAPI
OLEFontImpl_IDispatch_Release(
1163 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1165 return IFont_Release(this);
1168 /************************************************************************
1169 * OLEFontImpl_IDispatch_AddRef (IUnknown)
1171 * See Windows documentation for more details on IUnknown methods.
1173 static ULONG WINAPI
OLEFontImpl_IDispatch_AddRef(
1176 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1178 return IFont_AddRef(this);
1181 /************************************************************************
1182 * OLEFontImpl_GetTypeInfoCount (IDispatch)
1184 * See Windows documentation for more details on IDispatch methods.
1186 static HRESULT WINAPI
OLEFontImpl_GetTypeInfoCount(
1188 unsigned int* pctinfo
)
1190 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1191 FIXME("(%p)->(%p): Stub\n", this, pctinfo
);
1196 /************************************************************************
1197 * OLEFontImpl_GetTypeInfo (IDispatch)
1199 * See Windows documentation for more details on IDispatch methods.
1201 static HRESULT WINAPI
OLEFontImpl_GetTypeInfo(
1205 ITypeInfo
** ppTInfo
)
1207 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1208 FIXME("(%p):Stub\n", this);
1213 /************************************************************************
1214 * OLEFontImpl_GetIDsOfNames (IDispatch)
1216 * See Windows documentation for more details on IDispatch methods.
1218 static HRESULT WINAPI
OLEFontImpl_GetIDsOfNames(
1221 LPOLESTR
* rgszNames
,
1226 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1227 FIXME("(%p):Stub\n", this);
1232 /************************************************************************
1233 * OLEFontImpl_Invoke (IDispatch)
1235 * See Windows documentation for more details on IDispatch methods.
1237 static HRESULT WINAPI
OLEFontImpl_Invoke(
1239 DISPID dispIdMember
,
1243 DISPPARAMS
* pDispParams
,
1244 VARIANT
* pVarResult
,
1245 EXCEPINFO
* pExepInfo
,
1248 _ICOM_THIS_From_IDispatch(IFont
, iface
);
1249 FIXME("%p->(%ld,%s,%lx,%x), stub!\n", this,dispIdMember
,debugstr_guid(riid
),lcid
,
1255 /************************************************************************
1256 * OLEFontImpl_IPersistStream_QueryInterface (IUnknown)
1258 * See Windows documentation for more details on IUnknown methods.
1260 static HRESULT WINAPI
OLEFontImpl_IPersistStream_QueryInterface(
1261 IPersistStream
* iface
,
1265 _ICOM_THIS_From_IPersistStream(IFont
, iface
);
1267 return IFont_QueryInterface(this, riid
, ppvoid
);
1270 /************************************************************************
1271 * OLEFontImpl_IPersistStream_Release (IUnknown)
1273 * See Windows documentation for more details on IUnknown methods.
1275 static ULONG WINAPI
OLEFontImpl_IPersistStream_Release(
1276 IPersistStream
* iface
)
1278 _ICOM_THIS_From_IPersistStream(IFont
, iface
);
1280 return IFont_Release(this);
1283 /************************************************************************
1284 * OLEFontImpl_IPersistStream_AddRef (IUnknown)
1286 * See Windows documentation for more details on IUnknown methods.
1288 static ULONG WINAPI
OLEFontImpl_IPersistStream_AddRef(
1289 IPersistStream
* iface
)
1291 _ICOM_THIS_From_IPersistStream(IFont
, iface
);
1293 return IFont_AddRef(this);
1296 /************************************************************************
1297 * OLEFontImpl_GetClassID (IPersistStream)
1299 * See Windows documentation for more details on IPersistStream methods.
1301 static HRESULT WINAPI
OLEFontImpl_GetClassID(
1302 IPersistStream
* iface
,
1308 memcpy(pClassID
, &CLSID_StdFont
, sizeof(CLSID_StdFont
));
1313 /************************************************************************
1314 * OLEFontImpl_IsDirty (IPersistStream)
1316 * See Windows documentation for more details on IPersistStream methods.
1318 static HRESULT WINAPI
OLEFontImpl_IsDirty(
1319 IPersistStream
* iface
)
1324 /************************************************************************
1325 * OLEFontImpl_Load (IPersistStream)
1327 * See Windows documentation for more details on IPersistStream methods.
1329 * This is the format of the standard font serialization as far as I
1332 * Offset Type Value Comment
1333 * 0x0000 Byte Unknown Probably a version number, contains 0x01
1334 * 0x0001 Short Charset Charset value from the FONTDESC structure
1335 * 0x0003 Byte Attributes Flags defined as follows:
1337 * 00000100 - Underline
1338 * 00001000 - Strikethrough
1339 * 0x0004 Short Weight Weight value from FONTDESC structure
1340 * 0x0006 DWORD size "Low" portion of the cySize member of the FONTDESC
1342 * 0x000A Byte name length Length of the font name string (no null character)
1343 * 0x000B String name Name of the font (ASCII, no nul character)
1345 static HRESULT WINAPI
OLEFontImpl_Load(
1346 IPersistStream
* iface
,
1347 IStream
* pLoadStream
)
1349 char readBuffer
[0x100];
1356 _ICOM_THIS_From_IPersistStream(OLEFontImpl
, iface
);
1359 * Read the version byte
1361 IStream_Read(pLoadStream
, &bVersion
, 1, &cbRead
);
1370 IStream_Read(pLoadStream
, &this->description
.sCharset
, 2, &cbRead
);
1378 IStream_Read(pLoadStream
, &bAttributes
, 1, &cbRead
);
1383 this->description
.fItalic
= (bAttributes
& FONTPERSIST_ITALIC
) != 0;
1384 this->description
.fStrikethrough
= (bAttributes
& FONTPERSIST_STRIKETHROUGH
) != 0;
1385 this->description
.fUnderline
= (bAttributes
& FONTPERSIST_UNDERLINE
) != 0;
1390 IStream_Read(pLoadStream
, &this->description
.sWeight
, 2, &cbRead
);
1398 IStream_Read(pLoadStream
, &this->description
.cySize
.s
.Lo
, 4, &cbRead
);
1403 this->description
.cySize
.s
.Hi
= 0;
1408 IStream_Read(pLoadStream
, &bStringSize
, 1, &cbRead
);
1413 IStream_Read(pLoadStream
, readBuffer
, bStringSize
, &cbRead
);
1415 if (cbRead
!=bStringSize
)
1418 if (this->description
.lpstrName
!=0)
1419 HeapFree(GetProcessHeap(), 0, this->description
.lpstrName
);
1421 len
= MultiByteToWideChar( CP_ACP
, 0, readBuffer
, bStringSize
, NULL
, 0 );
1422 this->description
.lpstrName
= HeapAlloc( GetProcessHeap(), 0, (len
+1) * sizeof(WCHAR
) );
1423 MultiByteToWideChar( CP_ACP
, 0, readBuffer
, bStringSize
, this->description
.lpstrName
, len
);
1424 this->description
.lpstrName
[len
] = 0;
1429 /************************************************************************
1430 * OLEFontImpl_Save (IPersistStream)
1432 * See Windows documentation for more details on IPersistStream methods.
1434 static HRESULT WINAPI
OLEFontImpl_Save(
1435 IPersistStream
* iface
,
1436 IStream
* pOutStream
,
1439 char* writeBuffer
= NULL
;
1441 BYTE bVersion
= 0x01;
1445 _ICOM_THIS_From_IPersistStream(OLEFontImpl
, iface
);
1448 * Read the version byte
1450 IStream_Write(pOutStream
, &bVersion
, 1, &cbWritten
);
1458 IStream_Write(pOutStream
, &this->description
.sCharset
, 2, &cbWritten
);
1468 if (this->description
.fItalic
)
1469 bAttributes
|= FONTPERSIST_ITALIC
;
1471 if (this->description
.fStrikethrough
)
1472 bAttributes
|= FONTPERSIST_STRIKETHROUGH
;
1474 if (this->description
.fUnderline
)
1475 bAttributes
|= FONTPERSIST_UNDERLINE
;
1477 IStream_Write(pOutStream
, &bAttributes
, 1, &cbWritten
);
1485 IStream_Write(pOutStream
, &this->description
.sWeight
, 2, &cbWritten
);
1493 IStream_Write(pOutStream
, &this->description
.cySize
.s
.Lo
, 4, &cbWritten
);
1501 if (this->description
.lpstrName
!=0)
1502 bStringSize
= WideCharToMultiByte( CP_ACP
, 0, this->description
.lpstrName
,
1503 strlenW(this->description
.lpstrName
), NULL
, 0, NULL
, NULL
);
1507 IStream_Write(pOutStream
, &bStringSize
, 1, &cbWritten
);
1514 if (!(writeBuffer
= HeapAlloc( GetProcessHeap(), 0, bStringSize
))) return E_OUTOFMEMORY
;
1515 WideCharToMultiByte( CP_ACP
, 0, this->description
.lpstrName
,
1516 strlenW(this->description
.lpstrName
),
1517 writeBuffer
, bStringSize
, NULL
, NULL
);
1519 IStream_Write(pOutStream
, writeBuffer
, bStringSize
, &cbWritten
);
1520 HeapFree(GetProcessHeap(), 0, writeBuffer
);
1522 if (cbWritten
!=bStringSize
)
1529 /************************************************************************
1530 * OLEFontImpl_GetSizeMax (IPersistStream)
1532 * See Windows documentation for more details on IPersistStream methods.
1534 static HRESULT WINAPI
OLEFontImpl_GetSizeMax(
1535 IPersistStream
* iface
,
1536 ULARGE_INTEGER
* pcbSize
)
1538 _ICOM_THIS_From_IPersistStream(OLEFontImpl
, iface
);
1543 pcbSize
->s
.HighPart
= 0;
1544 pcbSize
->s
.LowPart
= 0;
1546 pcbSize
->s
.LowPart
+= sizeof(BYTE
); /* Version */
1547 pcbSize
->s
.LowPart
+= sizeof(WORD
); /* Lang code */
1548 pcbSize
->s
.LowPart
+= sizeof(BYTE
); /* Flags */
1549 pcbSize
->s
.LowPart
+= sizeof(WORD
); /* Weight */
1550 pcbSize
->s
.LowPart
+= sizeof(DWORD
); /* Size */
1551 pcbSize
->s
.LowPart
+= sizeof(BYTE
); /* StrLength */
1553 if (this->description
.lpstrName
!=0)
1554 pcbSize
->s
.LowPart
+= lstrlenW(this->description
.lpstrName
);
1559 /************************************************************************
1560 * OLEFontImpl_IConnectionPointContainer_QueryInterface (IUnknown)
1562 * See Windows documentation for more details on IUnknown methods.
1564 static HRESULT WINAPI
OLEFontImpl_IConnectionPointContainer_QueryInterface(
1565 IConnectionPointContainer
* iface
,
1569 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1571 return IFont_QueryInterface((IFont
*)this, riid
, ppvoid
);
1574 /************************************************************************
1575 * OLEFontImpl_IConnectionPointContainer_Release (IUnknown)
1577 * See Windows documentation for more details on IUnknown methods.
1579 static ULONG WINAPI
OLEFontImpl_IConnectionPointContainer_Release(
1580 IConnectionPointContainer
* iface
)
1582 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1584 return IFont_Release((IFont
*)this);
1587 /************************************************************************
1588 * OLEFontImpl_IConnectionPointContainer_AddRef (IUnknown)
1590 * See Windows documentation for more details on IUnknown methods.
1592 static ULONG WINAPI
OLEFontImpl_IConnectionPointContainer_AddRef(
1593 IConnectionPointContainer
* iface
)
1595 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1597 return IFont_AddRef((IFont
*)this);
1600 /************************************************************************
1601 * OLEFontImpl_EnumConnectionPoints (IConnectionPointContainer)
1603 * See Windows documentation for more details on IConnectionPointContainer
1606 static HRESULT WINAPI
OLEFontImpl_EnumConnectionPoints(
1607 IConnectionPointContainer
* iface
,
1608 IEnumConnectionPoints
**ppEnum
)
1610 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1612 FIXME("(%p)->(%p): stub\n", this, ppEnum
);
1616 /************************************************************************
1617 * OLEFontImpl_FindConnectionPoint (IConnectionPointContainer)
1619 * See Windows documentation for more details on IConnectionPointContainer
1622 static HRESULT WINAPI
OLEFontImpl_FindConnectionPoint(
1623 IConnectionPointContainer
* iface
,
1625 IConnectionPoint
**ppCp
)
1627 _ICOM_THIS_From_IConnectionPointContainer(OLEFontImpl
, iface
);
1628 TRACE("(%p)->(%s, %p): stub\n", this, debugstr_guid(riid
), ppCp
);
1630 if(memcmp(riid
, &IID_IPropertyNotifySink
, sizeof(IID_IPropertyNotifySink
)) == 0) {
1631 return IConnectionPoint_QueryInterface(this->pCP
, &IID_IConnectionPoint
,
1634 FIXME("Tried to find connection point on %s\n", debugstr_guid(riid
));
1635 return E_NOINTERFACE
;
1639 /*******************************************************************************
1640 * StdFont ClassFactory
1644 /* IUnknown fields */
1645 ICOM_VFIELD(IClassFactory
);
1647 } IClassFactoryImpl
;
1649 static HRESULT WINAPI
1650 SFCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
1651 ICOM_THIS(IClassFactoryImpl
,iface
);
1653 FIXME("(%p)->(%s,%p),stub!\n",This
,debugstr_guid(riid
),ppobj
);
1654 return E_NOINTERFACE
;
1658 SFCF_AddRef(LPCLASSFACTORY iface
) {
1659 ICOM_THIS(IClassFactoryImpl
,iface
);
1660 return ++(This
->ref
);
1663 static ULONG WINAPI
SFCF_Release(LPCLASSFACTORY iface
) {
1664 ICOM_THIS(IClassFactoryImpl
,iface
);
1665 /* static class, won't be freed */
1666 return --(This
->ref
);
1669 static HRESULT WINAPI
SFCF_CreateInstance(
1670 LPCLASSFACTORY iface
,LPUNKNOWN pOuter
,REFIID riid
,LPVOID
*ppobj
1674 WCHAR fname
[] = { 'S','y','s','t','e','m',0 };
1676 fd
.cbSizeofstruct
= sizeof(fd
);
1677 fd
.lpstrName
= fname
;
1678 fd
.cySize
.s
.Lo
= 80000;
1684 fd
.fStrikethrough
= 0;
1685 return OleCreateFontIndirect(&fd
,riid
,ppobj
);
1689 static HRESULT WINAPI
SFCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
) {
1690 ICOM_THIS(IClassFactoryImpl
,iface
);
1691 FIXME("(%p)->(%d),stub!\n",This
,dolock
);
1695 static ICOM_VTABLE(IClassFactory
) SFCF_Vtbl
= {
1696 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1697 SFCF_QueryInterface
,
1700 SFCF_CreateInstance
,
1703 static IClassFactoryImpl STDFONT_CF
= {&SFCF_Vtbl
, 1 };
1705 void _get_STDFONT_CF(LPVOID
*ppv
) { *ppv
= (LPVOID
)&STDFONT_CF
; }