ReactOS 0.4.17-dev-573-g8315b8c
olefont.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/list.h"
#include "objbase.h"
#include "oleauto.h"
#include "ole2.h"
#include "olectl.h"
#include "wine/debug.h"
#include "connpt.h"
#include "oaidl.h"
Include dependency graph for olefont.c:

Go to the source code of this file.

Classes

struct  _HFONTItem
 
struct  OLEFontImpl
 
struct  enum_data
 
struct  IClassFactoryImpl
 

Macros

#define COBJMACROS
 
#define FONTPERSIST_ITALIC   0x02
 
#define FONTPERSIST_UNDERLINE   0x04
 
#define FONTPERSIST_STRIKETHROUGH   0x08
 

Typedefs

typedef struct _HFONTItem HFONTItem
 
typedef struct _HFONTItemPHFONTItem
 
typedef struct OLEFontImpl OLEFontImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static HDC get_dc (void)
 
static void delete_dc (void)
 
static void HFONTItem_Delete (PHFONTItem item)
 
static HFONTItemfind_hfontitem (HFONT hfont)
 
static HRESULT add_hfontitem (HFONT hfont)
 
static HRESULT inc_int_ref (HFONT hfont)
 
static HRESULT dec_int_ref (HFONT hfont)
 
static HRESULT inc_ext_ref (HFONT hfont)
 
static HRESULT dec_ext_ref (HFONT hfont)
 
static OLEFontImplimpl_from_IFont (IFont *iface)
 
static OLEFontImplimpl_from_IDispatch (IDispatch *iface)
 
static OLEFontImplimpl_from_IPersistStream (IPersistStream *iface)
 
static OLEFontImplimpl_from_IConnectionPointContainer (IConnectionPointContainer *iface)
 
static OLEFontImplimpl_from_IPersistPropertyBag (IPersistPropertyBag *iface)
 
static OLEFontImplOLEFontImpl_Construct (const FONTDESC *fontDesc)
 
static void OLEFontImpl_Destroy (OLEFontImpl *fontDesc)
 
static ULONG WINAPI OLEFontImpl_AddRef (IFont *iface)
 
HRESULT WINAPI OleCreateFontIndirect (LPFONTDESC lpFontDesc, REFIID riid, LPVOID *ppvObj)
 
static void OLEFont_SendNotify (OLEFontImpl *this, DISPID dispID)
 
static HRESULT WINAPI OLEFontImpl_QueryInterface (IFont *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI OLEFontImpl_Release (IFont *iface)
 
static int CALLBACK font_enum_proc (const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lp)
 
static void realize_font (OLEFontImpl *This)
 
static HRESULT WINAPI OLEFontImpl_get_Name (IFont *iface, BSTR *pname)
 
static HRESULT WINAPI OLEFontImpl_put_Name (IFont *iface, BSTR name)
 
static HRESULT WINAPI OLEFontImpl_get_Size (IFont *iface, CY *psize)
 
static HRESULT WINAPI OLEFontImpl_put_Size (IFont *iface, CY size)
 
static HRESULT WINAPI OLEFontImpl_get_Bold (IFont *iface, BOOL *pbold)
 
static HRESULT WINAPI OLEFontImpl_put_Bold (IFont *iface, BOOL bold)
 
static HRESULT WINAPI OLEFontImpl_get_Italic (IFont *iface, BOOL *pitalic)
 
static HRESULT WINAPI OLEFontImpl_put_Italic (IFont *iface, BOOL italic)
 
static HRESULT WINAPI OLEFontImpl_get_Underline (IFont *iface, BOOL *punderline)
 
static HRESULT WINAPI OLEFontImpl_put_Underline (IFont *iface, BOOL underline)
 
static HRESULT WINAPI OLEFontImpl_get_Strikethrough (IFont *iface, BOOL *pstrikethrough)
 
static HRESULT WINAPI OLEFontImpl_put_Strikethrough (IFont *iface, BOOL strikethrough)
 
static HRESULT WINAPI OLEFontImpl_get_Weight (IFont *iface, short *pweight)
 
static HRESULT WINAPI OLEFontImpl_put_Weight (IFont *iface, short weight)
 
static HRESULT WINAPI OLEFontImpl_get_Charset (IFont *iface, short *pcharset)
 
static HRESULT WINAPI OLEFontImpl_put_Charset (IFont *iface, short charset)
 
static HRESULT WINAPI OLEFontImpl_get_hFont (IFont *iface, HFONT *phfont)
 
static HRESULT WINAPI OLEFontImpl_Clone (IFont *iface, IFont **ppfont)
 
static HRESULT WINAPI OLEFontImpl_IsEqual (IFont *iface, IFont *pFontOther)
 
static HRESULT WINAPI OLEFontImpl_SetRatio (IFont *iface, LONG cyLogical, LONG cyHimetric)
 
static HRESULT WINAPI OLEFontImpl_QueryTextMetrics (IFont *iface, TEXTMETRICOLE *ptm)
 
static HRESULT WINAPI OLEFontImpl_AddRefHfont (IFont *iface, HFONT hfont)
 
static HRESULT WINAPI OLEFontImpl_ReleaseHfont (IFont *iface, HFONT hfont)
 
static HRESULT WINAPI OLEFontImpl_SetHdc (IFont *iface, HDC hdc)
 
static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface (IDispatch *iface, REFIID riid, VOID **ppvoid)
 
static ULONG WINAPI OLEFontImpl_IDispatch_Release (IDispatch *iface)
 
static ULONG WINAPI OLEFontImpl_IDispatch_AddRef (IDispatch *iface)
 
static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount (IDispatch *iface, unsigned int *pctinfo)
 
static HRESULT WINAPI OLEFontImpl_GetTypeInfo (IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI OLEFontImpl_GetIDsOfNames (IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI OLEFontImpl_Invoke (IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
 
static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface (IPersistStream *iface, REFIID riid, VOID **ppvoid)
 
static ULONG WINAPI OLEFontImpl_IPersistStream_Release (IPersistStream *iface)
 
static ULONG WINAPI OLEFontImpl_IPersistStream_AddRef (IPersistStream *iface)
 
static HRESULT WINAPI OLEFontImpl_GetClassID (IPersistStream *iface, CLSID *pClassID)
 
static HRESULT WINAPI OLEFontImpl_IsDirty (IPersistStream *iface)
 
static HRESULT WINAPI OLEFontImpl_Load (IPersistStream *iface, IStream *pLoadStream)
 
static HRESULT WINAPI OLEFontImpl_Save (IPersistStream *iface, IStream *pOutStream, BOOL fClearDirty)
 
static HRESULT WINAPI OLEFontImpl_GetSizeMax (IPersistStream *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI OLEFontImpl_IConnectionPointContainer_QueryInterface (IConnectionPointContainer *iface, REFIID riid, VOID **ppvoid)
 
static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_Release (IConnectionPointContainer *iface)
 
static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_AddRef (IConnectionPointContainer *iface)
 
static HRESULT WINAPI OLEFontImpl_EnumConnectionPoints (IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum)
 
static HRESULT WINAPI OLEFontImpl_FindConnectionPoint (IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **ppCp)
 
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_QueryInterface (IPersistPropertyBag *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_AddRef (IPersistPropertyBag *iface)
 
static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_Release (IPersistPropertyBag *iface)
 
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_GetClassID (IPersistPropertyBag *iface, CLSID *classid)
 
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_InitNew (IPersistPropertyBag *iface)
 
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load (IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog)
 
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Save (IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
 
static IClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI SFCF_QueryInterface (IClassFactory *iface, REFIID riid, void **obj)
 
static ULONG WINAPI SFCF_AddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI SFCF_Release (LPCLASSFACTORY iface)
 
static HRESULT WINAPI SFCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI SFCF_LockServer (LPCLASSFACTORY iface, BOOL dolock)
 
void _get_STDFONT_CF (LPVOID *ppv)
 

Variables

static HDC olefont_hdc
 
static struct list OLEFontImpl_hFontList = LIST_INIT(OLEFontImpl_hFontList)
 
static LONG ifont_cnt = 0
 
static CRITICAL_SECTION OLEFontImpl_csHFONTLIST = { &OLEFontImpl_csHFONTLIST_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG OLEFontImpl_csHFONTLIST_debug
 
static const IFontVtbl OLEFontImpl_VTable
 
static const IDispatchVtbl OLEFontImpl_IDispatch_VTable
 
static const IPersistStreamVtbl OLEFontImpl_IPersistStream_VTable
 
static const IConnectionPointContainerVtbl OLEFontImpl_IConnectionPointContainer_VTable
 
static const IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable
 
static const IClassFactoryVtbl SFCF_Vtbl
 
static IClassFactoryImpl STDFONT_CF = {{&SFCF_Vtbl}, 1 }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 28 of file olefont.c.

◆ FONTPERSIST_ITALIC

#define FONTPERSIST_ITALIC   0x02

Definition at line 48 of file olefont.c.

◆ FONTPERSIST_STRIKETHROUGH

#define FONTPERSIST_STRIKETHROUGH   0x08

Definition at line 50 of file olefont.c.

◆ FONTPERSIST_UNDERLINE

#define FONTPERSIST_UNDERLINE   0x04

Definition at line 49 of file olefont.c.

Typedef Documentation

◆ HFONTItem

◆ OLEFontImpl

Definition at line 229 of file olefont.c.

◆ PHFONTItem

Function Documentation

◆ _get_STDFONT_CF()

void _get_STDFONT_CF ( LPVOID ppv)

Definition at line 2138 of file olefont.c.

2138{ *ppv = &STDFONT_CF; }
static IClassFactoryImpl STDFONT_CF
Definition: olefont.c:2136
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by DllGetClassObject().

◆ add_hfontitem()

static HRESULT add_hfontitem ( HFONT  hfont)
static

Definition at line 134 of file olefont.c.

135{
136 HFONTItem *new_item = malloc(sizeof(*new_item));
137
138 if(!new_item) return E_OUTOFMEMORY;
139
140 new_item->int_refs = 1;
141 new_item->total_refs = 1;
142 new_item->gdiFont = hfont;
146 return S_OK;
147}
static HFONT hfont
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define malloc
Definition: debug_ros.c:4
static struct list OLEFontImpl_hFontList
Definition: olefont.c:73
static CRITICAL_SECTION OLEFontImpl_csHFONTLIST
Definition: olefont.c:81
#define S_OK
Definition: intsafe.h:52
HFONT gdiFont
Definition: olefont.c:69
LONG int_refs
Definition: olefont.c:63
LONG total_refs
Definition: olefont.c:66
struct list entry
Definition: olefont.c:60
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by realize_font().

◆ dec_ext_ref()

static HRESULT dec_ext_ref ( HFONT  hfont)
static

Definition at line 209 of file olefont.c.

210{
213
215
217 if(item)
218 {
219 if(--item->total_refs >= 0) hr = S_OK;
220 }
222
223 return hr;
224}
HRESULT hr
Definition: delayimp.cpp:582
static HFONTItem * find_hfontitem(HFONT hfont)
Definition: olefont.c:121
#define S_FALSE
Definition: winerror.h:3451

Referenced by OLEFontImpl_ReleaseHfont().

◆ dec_int_ref()

static HRESULT dec_int_ref ( HFONT  hfont)
static

Definition at line 170 of file olefont.c.

171{
174
177
178 if(item)
179 {
180 item->int_refs--;
181 item->total_refs--;
182 if(item->int_refs == 0 && item->total_refs == 0)
184 hr = S_OK;
185 }
187
188 return hr;
189}
static void HFONTItem_Delete(PHFONTItem item)
Definition: olefont.c:113

Referenced by OLEFontImpl_Load(), OLEFontImpl_Release(), and realize_font().

◆ delete_dc()

static void delete_dc ( void  )
static

Definition at line 102 of file olefont.c.

103{
105 if(olefont_hdc)
106 {
109 }
111}
#define NULL
Definition: types.h:112
static HDC olefont_hdc
Definition: olefont.c:52
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by OLEFontImpl_Release().

◆ find_hfontitem()

static HFONTItem * find_hfontitem ( HFONT  hfont)
static

Definition at line 121 of file olefont.c.

122{
124
126 {
127 if (item->gdiFont == hfont)
128 return item;
129 }
130 return NULL;
131}
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198

Referenced by dec_ext_ref(), dec_int_ref(), inc_ext_ref(), and inc_int_ref().

◆ font_enum_proc()

static int CALLBACK font_enum_proc ( const LOGFONTW elf,
const TEXTMETRICW ntm,
DWORD  type,
LPARAM  lp 
)
static

Definition at line 526 of file olefont.c.

527{
528 enum_data *data = (enum_data*)lp;
529
530 if(elf->lfCharSet == data->orig_cs)
531 {
532 data->avail_cs = data->orig_cs;
533 return 0;
534 }
535 if(data->avail_cs == -1) data->avail_cs = elf->lfCharSet;
536 return 1;
537}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BYTE lfCharSet
Definition: dimm.idl:67
short avail_cs
Definition: olefont.c:523

Referenced by realize_font().

◆ get_dc()

static HDC get_dc ( void  )
static

Definition at line 91 of file olefont.c.

92{
93 HDC hdc;
95 if(!olefont_hdc)
99 return hdc;
100}
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)

Referenced by OLEFontImpl_Construct(), and realize_font().

◆ HFONTItem_Delete()

static void HFONTItem_Delete ( PHFONTItem  item)
static

Definition at line 113 of file olefont.c.

114{
115 DeleteObject(item->gdiFont);
116 list_remove(&item->entry);
117 free(item);
118}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define free
Definition: debug_ros.c:5
pKey DeleteObject()

Referenced by dec_int_ref(), and OLEFontImpl_Release().

◆ impl_from_IClassFactory()

static IClassFactoryImpl * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 2081 of file olefont.c.

2082{
2083 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
2084}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by SFCF_AddRef(), SFCF_LockServer(), SFCF_QueryInterface(), and SFCF_Release().

◆ impl_from_IConnectionPointContainer()

static OLEFontImpl * impl_from_IConnectionPointContainer ( IConnectionPointContainer iface)
inlinestatic

◆ impl_from_IDispatch()

◆ impl_from_IFont()

◆ impl_from_IPersistPropertyBag()

static OLEFontImpl * impl_from_IPersistPropertyBag ( IPersistPropertyBag iface)
inlinestatic

◆ impl_from_IPersistStream()

static OLEFontImpl * impl_from_IPersistStream ( IPersistStream iface)
inlinestatic

◆ inc_ext_ref()

static HRESULT inc_ext_ref ( HFONT  hfont)
static

Definition at line 191 of file olefont.c.

192{
195
197
199 if(item)
200 {
201 item->total_refs++;
202 hr = S_OK;
203 }
205
206 return hr;
207}

Referenced by OLEFontImpl_AddRefHfont().

◆ inc_int_ref()

static HRESULT inc_int_ref ( HFONT  hfont)
static

Definition at line 149 of file olefont.c.

150{
153
156
157 if(item)
158 {
159 item->int_refs++;
160 item->total_refs++;
161 hr = S_OK;
162 }
164
165 return hr;
166}

Referenced by OLEFontImpl_Clone().

◆ OleCreateFontIndirect()

HRESULT WINAPI OleCreateFontIndirect ( LPFONTDESC  lpFontDesc,
REFIID  riid,
LPVOID ppvObj 
)

Definition at line 311 of file olefont.c.

315{
316 OLEFontImpl* newFont;
317 HRESULT hr;
318 FONTDESC fd;
319
320 TRACE("(%p, %s, %p)\n", lpFontDesc, debugstr_guid(riid), ppvObj);
321
322 if (!ppvObj) return E_POINTER;
323
324 *ppvObj = 0;
325
326 if (!lpFontDesc) {
327 static WCHAR fname[] = L"System";
328
329 fd.cbSizeofstruct = sizeof(fd);
330 fd.lpstrName = fname;
331 fd.cySize.Lo = 80000;
332 fd.cySize.Hi = 0;
333 fd.sWeight = 0;
334 fd.sCharset = 0;
335 fd.fItalic = FALSE;
336 fd.fUnderline = FALSE;
337 fd.fStrikethrough = FALSE;
338 lpFontDesc = &fd;
339 }
340 else if (!lpFontDesc->lpstrName)
342
343 newFont = OLEFontImpl_Construct(lpFontDesc);
344 if (!newFont) return E_OUTOFMEMORY;
345
346 hr = IFont_QueryInterface(&newFont->IFont_iface, riid, ppvObj);
347 IFont_Release(&newFont->IFont_iface);
348
349 return hr;
350}
#define FALSE
Definition: types.h:117
static OLEFontImpl * OLEFontImpl_Construct(const FONTDESC *fontDesc)
Definition: olefont.c:2002
#define L(x)
Definition: resources.c:13
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define CTL_E_INVALIDPROPERTYVALUE
Definition: olectl.h:292
short WCHAR
Definition: pedump.c:58
static int fd
Definition: io.c:51
#define TRACE(s)
Definition: solgame.cpp:4
IFont IFont_iface
Definition: olefont.c:239
LPOLESTR lpstrName
Definition: olectl.h:120
#define E_POINTER
Definition: winerror.h:3480

Referenced by SFCF_CreateInstance().

◆ OLEFont_SendNotify()

static void OLEFont_SendNotify ( OLEFontImpl this,
DISPID  dispID 
)
static

Definition at line 363 of file olefont.c.

364{
365 static const LPCWSTR dispid_mapping[] =
366 {
367 L"Name",
368 NULL,
369 L"Size",
370 L"Bold",
371 L"Italic",
372 L"Underline",
373 L"Strikethrough",
374 L"Weight",
375 L"Charset"
376 };
377
378 IEnumConnections *pEnum;
379 CONNECTDATA CD;
381
382 this->dirty = TRUE;
383
384 hres = IConnectionPoint_EnumConnections(this->pPropertyNotifyCP, &pEnum);
385 if (SUCCEEDED(hres))
386 {
387 while(IEnumConnections_Next(pEnum, 1, &CD, NULL) == S_OK) {
389
390 IUnknown_QueryInterface(CD.pUnk, &IID_IPropertyNotifySink, (void**)&sink);
391 IPropertyNotifySink_OnChanged(sink, dispID);
392 IPropertyNotifySink_Release(sink);
393 IUnknown_Release(CD.pUnk);
394 }
395 IEnumConnections_Release(pEnum);
396 }
397
398 hres = IConnectionPoint_EnumConnections(this->pFontEventsCP, &pEnum);
399 if (SUCCEEDED(hres))
400 {
401 DISPPARAMS dispparams;
402 VARIANTARG vararg;
403
404 VariantInit(&vararg);
405 V_VT(&vararg) = VT_BSTR;
406 V_BSTR(&vararg) = SysAllocString(dispid_mapping[dispID]);
407
408 dispparams.cArgs = 1;
409 dispparams.cNamedArgs = 0;
410 dispparams.rgdispidNamedArgs = NULL;
411 dispparams.rgvarg = &vararg;
412
413 while(IEnumConnections_Next(pEnum, 1, &CD, NULL) == S_OK) {
414 IFontEventsDisp *disp;
415
416 IUnknown_QueryInterface(CD.pUnk, &IID_IFontEventsDisp, (void**)&disp);
417 IFontEventsDisp_Invoke(disp, DISPID_FONT_CHANGED, &IID_NULL,
418 LOCALE_NEUTRAL, INVOKE_FUNC, &dispparams, NULL,
419 NULL, NULL);
420
421 IFontEventsDisp_Release(disp);
422 IUnknown_Release(CD.pUnk);
423 }
424 VariantClear(&vararg);
425 IEnumConnections_Release(pEnum);
426 }
427}
#define TRUE
Definition: types.h:120
@ VT_BSTR
Definition: compat.h:2303
r dirty
Definition: btrfs.c:3004
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define DISPID_FONT_CHANGED
Definition: olectl.h:435
const GUID IID_IPropertyNotifySink
const GUID IID_IFontEventsDisp
#define IID_NULL
Definition: guiddef.h:98
const uint16_t * LPCWSTR
Definition: typedefs.h:57
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:626
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:547

Referenced by OLEFontImpl_put_Bold(), OLEFontImpl_put_Charset(), OLEFontImpl_put_Italic(), OLEFontImpl_put_Name(), OLEFontImpl_put_Size(), OLEFontImpl_put_Strikethrough(), OLEFontImpl_put_Underline(), and OLEFontImpl_put_Weight().

◆ OLEFontImpl_AddRef()

static ULONG WINAPI OLEFontImpl_AddRef ( IFont iface)
static

Definition at line 480 of file olefont.c.

481{
482 OLEFontImpl *this = impl_from_IFont(iface);
483 ULONG ref = InterlockedIncrement(&this->ref);
484 TRACE("%p, refcount %lu.\n", iface, ref);
485 return ref;
486}
#define InterlockedIncrement
Definition: armddk.h:53
static OLEFontImpl * impl_from_IFont(IFont *iface)
Definition: olefont.c:274
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ OLEFontImpl_AddRefHfont()

static HRESULT WINAPI OLEFontImpl_AddRefHfont ( IFont iface,
HFONT  hfont 
)
static

Definition at line 1069 of file olefont.c.

1072{
1073 OLEFontImpl *this = impl_from_IFont(iface);
1074
1075 TRACE("(%p)->(%p)\n", this, hfont);
1076
1077 if (!hfont) return E_INVALIDARG;
1078
1079 return inc_ext_ref(hfont);
1080}
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT inc_ext_ref(HFONT hfont)
Definition: olefont.c:191

◆ OLEFontImpl_Clone()

static HRESULT WINAPI OLEFontImpl_Clone ( IFont iface,
IFont **  ppfont 
)
static

Definition at line 932 of file olefont.c.

935{
936 OLEFontImpl *this = impl_from_IFont(iface);
937 OLEFontImpl* newObject;
938
939 TRACE("(%p)->(%p)\n", this, ppfont);
940
941 if (ppfont == NULL)
942 return E_POINTER;
943
944 *ppfont = NULL;
945
946 newObject = malloc(sizeof(OLEFontImpl));
947 if (newObject==NULL)
948 return E_OUTOFMEMORY;
949
950 *newObject = *this;
951 /* allocate separate buffer */
952 newObject->description.lpstrName = wcsdup(this->description.lpstrName);
953
954 /* Increment internal ref in hfont item list */
955 if(newObject->gdiFont) inc_int_ref(newObject->gdiFont);
956
958
959 newObject->pPropertyNotifyCP = NULL;
960 newObject->pFontEventsCP = NULL;
962 &newObject->pPropertyNotifyCP);
964 &newObject->pFontEventsCP);
965
966 if (!newObject->pPropertyNotifyCP || !newObject->pFontEventsCP)
967 {
968 OLEFontImpl_Destroy(newObject);
969 return E_OUTOFMEMORY;
970 }
971
972 /* The cloned object starts with a reference count of 1 */
973 newObject->ref = 1;
974
975 *ppfont = &newObject->IFont_iface;
976
977 return S_OK;
978}
HRESULT CreateConnectionPoint(IUnknown *pUnk, REFIID riid, IConnectionPoint **pCP)
Definition: connpt.c:482
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
static HRESULT inc_int_ref(HFONT hfont)
Definition: olefont.c:149
static LONG ifont_cnt
Definition: olefont.c:76
static void OLEFontImpl_Destroy(OLEFontImpl *fontDesc)
Definition: olefont.c:2057
IConnectionPoint * pFontEventsCP
Definition: olefont.c:271
IConnectionPoint * pPropertyNotifyCP
Definition: olefont.c:270
HFONT gdiFont
Definition: olefont.c:257
LONG ref
Definition: olefont.c:247
FONTDESC description
Definition: olefont.c:252
const char * description
Definition: directx.c:2497

◆ OLEFontImpl_Construct()

static OLEFontImpl * OLEFontImpl_Construct ( const FONTDESC fontDesc)
static

Definition at line 2002 of file olefont.c.

2003{
2004 OLEFontImpl* newObject;
2005
2006 newObject = malloc(sizeof(OLEFontImpl));
2007
2008 if (newObject==0)
2009 return newObject;
2010
2011 newObject->IFont_iface.lpVtbl = &OLEFontImpl_VTable;
2012 newObject->IDispatch_iface.lpVtbl = &OLEFontImpl_IDispatch_VTable;
2016
2017 newObject->ref = 1;
2018
2019 newObject->description.cbSizeofstruct = sizeof(FONTDESC);
2020 newObject->description.lpstrName = wcsdup(fontDesc->lpstrName);
2021 newObject->description.cySize = fontDesc->cySize;
2022 newObject->description.sWeight = fontDesc->sWeight;
2023 newObject->description.sCharset = fontDesc->sCharset;
2024 newObject->description.fItalic = fontDesc->fItalic;
2025 newObject->description.fUnderline = fontDesc->fUnderline;
2026 newObject->description.fStrikethrough = fontDesc->fStrikethrough;
2027
2028 newObject->gdiFont = 0;
2029 newObject->dirty = TRUE;
2030 newObject->cyLogical = GetDeviceCaps(get_dc(), LOGPIXELSY);
2031 newObject->cyHimetric = 2540L;
2032 newObject->pPropertyNotifyCP = NULL;
2033 newObject->pFontEventsCP = NULL;
2034
2037
2038 if (!newObject->pPropertyNotifyCP || !newObject->pFontEventsCP)
2039 {
2040 OLEFontImpl_Destroy(newObject);
2041 return NULL;
2042 }
2043
2045
2046 TRACE("returning %p\n", newObject);
2047 return newObject;
2048}
static HDC get_dc(void)
Definition: olefont.c:91
static const IPersistStreamVtbl OLEFontImpl_IPersistStream_VTable
Definition: olefont.c:1723
static const IConnectionPointContainerVtbl OLEFontImpl_IConnectionPointContainer_VTable
Definition: olefont.c:1807
static const IFontVtbl OLEFontImpl_VTable
Definition: olefont.c:1110
static const IDispatchVtbl OLEFontImpl_IDispatch_VTable
Definition: olefont.c:1471
static const IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable
Definition: olefont.c:1981
struct tagFONTDESC FONTDESC
IPersistPropertyBag IPersistPropertyBag_iface
Definition: olefont.c:243
LONG cyHimetric
Definition: olefont.c:263
LONG cyLogical
Definition: olefont.c:262
IDispatch IDispatch_iface
Definition: olefont.c:240
BOOL dirty
Definition: olefont.c:258
IPersistStream IPersistStream_iface
Definition: olefont.c:241
IConnectionPointContainer IConnectionPointContainer_iface
Definition: olefont.c:242
UINT cbSizeofstruct
Definition: olectl.h:119
SHORT sWeight
Definition: olectl.h:122
BOOL fItalic
Definition: olectl.h:124
BOOL fUnderline
Definition: olectl.h:125
BOOL fStrikethrough
Definition: olectl.h:126
SHORT sCharset
Definition: olectl.h:123
CY cySize
Definition: olectl.h:121
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719

Referenced by OleCreateFontIndirect().

◆ OLEFontImpl_Destroy()

static void OLEFontImpl_Destroy ( OLEFontImpl fontDesc)
static

Definition at line 2057 of file olefont.c.

2058{
2059 TRACE("(%p)\n", fontDesc);
2060
2061 free(fontDesc->description.lpstrName);
2062
2063 if (fontDesc->pPropertyNotifyCP)
2064 IConnectionPoint_Release(fontDesc->pPropertyNotifyCP);
2065 if (fontDesc->pFontEventsCP)
2066 IConnectionPoint_Release(fontDesc->pFontEventsCP);
2067
2068 free(fontDesc);
2069}

Referenced by OLEFontImpl_Clone(), OLEFontImpl_Construct(), and OLEFontImpl_Release().

◆ OLEFontImpl_EnumConnectionPoints()

static HRESULT WINAPI OLEFontImpl_EnumConnectionPoints ( IConnectionPointContainer iface,
IEnumConnectionPoints **  ppEnum 
)
static

Definition at line 1773 of file olefont.c.

1776{
1778
1779 FIXME("(%p)->(%p): stub\n", this, ppEnum);
1780 return E_NOTIMPL;
1781}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
static OLEFontImpl * impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
Definition: olefont.c:289

◆ OLEFontImpl_FindConnectionPoint()

static HRESULT WINAPI OLEFontImpl_FindConnectionPoint ( IConnectionPointContainer iface,
REFIID  riid,
IConnectionPoint **  ppCp 
)
static

Definition at line 1786 of file olefont.c.

1790{
1792 TRACE("(%p)->(%s, %p)\n", this, debugstr_guid(riid), ppCp);
1793
1795 return IConnectionPoint_QueryInterface(this->pPropertyNotifyCP, &IID_IConnectionPoint,
1796 (void**)ppCp);
1797 } else if(IsEqualIID(riid, &IID_IFontEventsDisp)) {
1798 return IConnectionPoint_QueryInterface(this->pFontEventsCP, &IID_IConnectionPoint,
1799 (void**)ppCp);
1800 } else {
1801 FIXME("no connection point for %s\n", debugstr_guid(riid));
1803 }
1804}
#define CONNECT_E_NOCONNECTION
Definition: olectl.h:251
const GUID IID_IConnectionPoint
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ OLEFontImpl_get_Bold()

static HRESULT WINAPI OLEFontImpl_get_Bold ( IFont iface,
BOOL pbold 
)
static

Definition at line 701 of file olefont.c.

702{
703 OLEFontImpl *this = impl_from_IFont(iface);
704 TRACE("(%p)->(%p)\n", this, pbold);
705
706 if (!pbold) return E_POINTER;
707
708 realize_font(this);
709
710 *pbold = this->description.sWeight > 550;
711
712 return S_OK;
713}
static void realize_font(OLEFontImpl *This)
Definition: olefont.c:539

◆ OLEFontImpl_get_Charset()

static HRESULT WINAPI OLEFontImpl_get_Charset ( IFont iface,
short pcharset 
)
static

Definition at line 877 of file olefont.c.

880{
881 OLEFontImpl *this = impl_from_IFont(iface);
882 TRACE("(%p)->(%p)\n", this, pcharset);
883
884 if (pcharset==0)
885 return E_POINTER;
886
887 realize_font(this);
888
889 *pcharset = this->description.sCharset;
890
891 return S_OK;
892}

Referenced by OLEFontImpl_Invoke().

◆ OLEFontImpl_get_hFont()

static HRESULT WINAPI OLEFontImpl_get_hFont ( IFont iface,
HFONT *  phfont 
)
static

Definition at line 913 of file olefont.c.

916{
917 OLEFontImpl *this = impl_from_IFont(iface);
918 TRACE("(%p)->(%p)\n", this, phfont);
919 if (phfont==NULL)
920 return E_POINTER;
921
922 realize_font(this);
923
924 *phfont = this->gdiFont;
925 TRACE("Returning %p\n", *phfont);
926 return S_OK;
927}

◆ OLEFontImpl_get_Italic()

static HRESULT WINAPI OLEFontImpl_get_Italic ( IFont iface,
BOOL pitalic 
)
static

Definition at line 733 of file olefont.c.

736{
737 OLEFontImpl *this = impl_from_IFont(iface);
738 TRACE("(%p)->(%p)\n", this, pitalic);
739
740 if (pitalic==0)
741 return E_POINTER;
742
743 realize_font(this);
744
745 *pitalic = this->description.fItalic;
746
747 return S_OK;
748}

◆ OLEFontImpl_get_Name()

static HRESULT WINAPI OLEFontImpl_get_Name ( IFont iface,
BSTR pname 
)
static

Definition at line 627 of file olefont.c.

630{
631 OLEFontImpl *this = impl_from_IFont(iface);
632 TRACE("(%p)->(%p)\n", this, pname);
633
634 if (pname==0)
635 return E_POINTER;
636
637 realize_font(this);
638
639 *pname = SysAllocString(this->description.lpstrName);
640
641 return S_OK;
642}
GLenum pname
Definition: glext.h:5645

◆ OLEFontImpl_get_Size()

static HRESULT WINAPI OLEFontImpl_get_Size ( IFont iface,
CY psize 
)
static

Definition at line 669 of file olefont.c.

672{
673 OLEFontImpl *this = impl_from_IFont(iface);
674 TRACE("(%p)->(%p)\n", this, psize);
675
676 if (!psize) return E_POINTER;
677
678 realize_font(this);
679
680 /*
681 * Convert realized font height in pixels to points descaled by current
682 * scaling ratio then scaled up by 10000.
683 */
684 psize->Lo = MulDiv(this->nRealHeight, this->cyHimetric * 72 * 10000, this->cyLogical * 2540);
685 psize->Hi = 0;
686
687 return S_OK;
688}
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569

◆ OLEFontImpl_get_Strikethrough()

static HRESULT WINAPI OLEFontImpl_get_Strikethrough ( IFont iface,
BOOL pstrikethrough 
)
static

Definition at line 805 of file olefont.c.

808{
809 OLEFontImpl *this = impl_from_IFont(iface);
810 TRACE("(%p)->(%p)\n", this, pstrikethrough);
811
812 if (pstrikethrough==0)
813 return E_POINTER;
814
815 realize_font(this);
816
817 *pstrikethrough = this->description.fStrikethrough;
818
819 return S_OK;
820}

◆ OLEFontImpl_get_Underline()

static HRESULT WINAPI OLEFontImpl_get_Underline ( IFont iface,
BOOL punderline 
)
static

Definition at line 769 of file olefont.c.

772{
773 OLEFontImpl *this = impl_from_IFont(iface);
774 TRACE("(%p)->(%p)\n", this, punderline);
775
776 if (punderline==0)
777 return E_POINTER;
778
779 realize_font(this);
780
781 *punderline = this->description.fUnderline;
782
783 return S_OK;
784}

◆ OLEFontImpl_get_Weight()

static HRESULT WINAPI OLEFontImpl_get_Weight ( IFont iface,
short pweight 
)
static

Definition at line 841 of file olefont.c.

844{
845 OLEFontImpl *this = impl_from_IFont(iface);
846 TRACE("(%p)->(%p)\n", this, pweight);
847
848 if (pweight==0)
849 return E_POINTER;
850
851 realize_font(this);
852
853 *pweight = this->description.sWeight;
854
855 return S_OK;
856}

◆ OLEFontImpl_GetClassID()

static HRESULT WINAPI OLEFontImpl_GetClassID ( IPersistStream iface,
CLSID pClassID 
)
static

Definition at line 1520 of file olefont.c.

1523{
1524 TRACE("(%p,%p)\n",iface,pClassID);
1525 if (pClassID==0)
1526 return E_POINTER;
1527
1528 *pClassID = CLSID_StdFont;
1529
1530 return S_OK;
1531}
static const CLSID CLSID_StdFont
Definition: compobj.c:92

◆ OLEFontImpl_GetIDsOfNames()

static HRESULT WINAPI OLEFontImpl_GetIDsOfNames ( IDispatch iface,
REFIID  riid,
LPOLESTR *  rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 1219 of file olefont.c.

1226{
1227 ITypeInfo * pTInfo;
1228 HRESULT hres;
1229
1230 OLEFontImpl *this = impl_from_IDispatch(iface);
1231
1232 TRACE("(%p,%s,%p,cNames=%d,lcid=%04x,%p)\n", this, debugstr_guid(riid),
1233 rgszNames, cNames, (int)lcid, rgDispId);
1234
1235 if (cNames == 0) return E_INVALIDARG;
1236
1237 hres = IDispatch_GetTypeInfo(iface, 0, lcid, &pTInfo);
1238 if (FAILED(hres))
1239 {
1240 ERR("GetTypeInfo failed.\n");
1241 return hres;
1242 }
1243
1244 /* convert names to DISPIDs */
1245 hres = DispGetIDsOfNames (pTInfo, rgszNames, cNames, rgDispId);
1246 ITypeInfo_Release(pTInfo);
1247
1248 return hres;
1249}
#define ERR(fmt,...)
Definition: precomp.h:57
LCID lcid
Definition: locale.c:5660
HRESULT WINAPI DispGetIDsOfNames(ITypeInfo *ptinfo, OLECHAR **rgszNames, UINT cNames, DISPID *rgdispid)
Definition: dispatch.c:92
static OLEFontImpl * impl_from_IDispatch(IDispatch *iface)
Definition: olefont.c:279
#define FAILED(hr)
Definition: intsafe.h:51

◆ OLEFontImpl_GetSizeMax()

static HRESULT WINAPI OLEFontImpl_GetSizeMax ( IPersistStream iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 1697 of file olefont.c.

1700{
1702
1703 if (pcbSize==NULL)
1704 return E_POINTER;
1705
1706 pcbSize->u.HighPart = 0;
1707 pcbSize->u.LowPart = 0;
1708
1709 pcbSize->u.LowPart += sizeof(BYTE); /* Version */
1710 pcbSize->u.LowPart += sizeof(WORD); /* Lang code */
1711 pcbSize->u.LowPart += sizeof(BYTE); /* Flags */
1712 pcbSize->u.LowPart += sizeof(WORD); /* Weight */
1713 pcbSize->u.LowPart += sizeof(DWORD); /* Size */
1714 pcbSize->u.LowPart += sizeof(BYTE); /* StrLength */
1715
1716 pcbSize->u.LowPart += WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName,
1717 lstrlenW(this->description.lpstrName),
1718 NULL, 0, NULL, NULL );
1719
1720 return S_OK;
1721}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define lstrlenW
Definition: compat.h:750
static OLEFontImpl * impl_from_IPersistStream(IPersistStream *iface)
Definition: olefont.c:284
unsigned short WORD
Definition: ntddk_ex.h:93
#define DWORD
Definition: nt_native.h:44
struct _ULARGE_INTEGER::@4637 u
unsigned char BYTE
Definition: xxhash.c:193

◆ OLEFontImpl_GetTypeInfo()

static HRESULT WINAPI OLEFontImpl_GetTypeInfo ( IDispatch iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1190 of file olefont.c.

1195{
1196 ITypeLib *tl;
1197 HRESULT hres;
1198
1199 OLEFontImpl *this = impl_from_IDispatch(iface);
1200 TRACE("(%p, iTInfo=%d, lcid=%04x, %p)\n", this, iTInfo, (int)lcid, ppTInfo);
1201 if (iTInfo != 0)
1202 return E_FAIL;
1203 hres = LoadTypeLib(L"stdole2.tlb", &tl);
1204 if (FAILED(hres)) {
1205 ERR("Could not load the stdole2.tlb?\n");
1206 return hres;
1207 }
1208 hres = ITypeLib_GetTypeInfoOfGuid(tl, &IID_IFontDisp, ppTInfo);
1209 ITypeLib_Release(tl);
1210 if (FAILED(hres))
1211 FIXME("Did not IDispatch typeinfo from typelib, hres %#lx.\n", hres);
1212
1213 return hres;
1214}
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:434
const GUID IID_IFontDisp

◆ OLEFontImpl_GetTypeInfoCount()

static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount ( IDispatch iface,
unsigned int pctinfo 
)
static

Definition at line 1176 of file olefont.c.

1179{
1180 OLEFontImpl *this = impl_from_IDispatch(iface);
1181 TRACE("(%p)->(%p)\n", this, pctinfo);
1182 *pctinfo = 1;
1183
1184 return S_OK;
1185}

◆ OLEFontImpl_IConnectionPointContainer_AddRef()

static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_AddRef ( IConnectionPointContainer iface)
static

Definition at line 1762 of file olefont.c.

1764{
1766
1767 return IFont_AddRef(&this->IFont_iface);
1768}

◆ OLEFontImpl_IConnectionPointContainer_QueryInterface()

static HRESULT WINAPI OLEFontImpl_IConnectionPointContainer_QueryInterface ( IConnectionPointContainer iface,
REFIID  riid,
VOID **  ppvoid 
)
static

Definition at line 1738 of file olefont.c.

1742{
1744
1745 return IFont_QueryInterface(&this->IFont_iface, riid, ppvoid);
1746}

◆ OLEFontImpl_IConnectionPointContainer_Release()

static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_Release ( IConnectionPointContainer iface)
static

Definition at line 1751 of file olefont.c.

1753{
1755
1756 return IFont_Release(&this->IFont_iface);
1757}

◆ OLEFontImpl_IDispatch_AddRef()

static ULONG WINAPI OLEFontImpl_IDispatch_AddRef ( IDispatch iface)
static

Definition at line 1166 of file olefont.c.

1168{
1169 OLEFontImpl *this = impl_from_IDispatch(iface);
1170 return IFont_AddRef(&this->IFont_iface);
1171}

◆ OLEFontImpl_IDispatch_QueryInterface()

static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface ( IDispatch iface,
REFIID  riid,
VOID **  ppvoid 
)
static

Definition at line 1144 of file olefont.c.

1148{
1149 OLEFontImpl *this = impl_from_IDispatch(iface);
1150 return IFont_QueryInterface(&this->IFont_iface, riid, ppvoid);
1151}

◆ OLEFontImpl_IDispatch_Release()

static ULONG WINAPI OLEFontImpl_IDispatch_Release ( IDispatch iface)
static

Definition at line 1156 of file olefont.c.

1158{
1159 OLEFontImpl *this = impl_from_IDispatch(iface);
1160 return IFont_Release(&this->IFont_iface);
1161}

◆ OLEFontImpl_Invoke()

static HRESULT WINAPI OLEFontImpl_Invoke ( IDispatch iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExepInfo,
UINT puArgErr 
)
static

Definition at line 1255 of file olefont.c.

1265{
1266 OLEFontImpl *this = impl_from_IDispatch(iface);
1267 HRESULT hr;
1268
1269 TRACE("%p, %ld, %s, %#lx, %#x, %p, %p, %p, %p.\n", iface, dispIdMember,
1270 debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExepInfo,
1271 puArgErr);
1272
1273 /* validate parameters */
1274
1275 if (!IsEqualIID(riid, &IID_NULL))
1276 {
1277 ERR("riid was %s instead of IID_NULL\n", debugstr_guid(riid));
1279 }
1280
1282 {
1283 if (!pVarResult)
1284 {
1285 ERR("null pVarResult not allowed when DISPATCH_PROPERTYGET specified\n");
1287 }
1288 }
1289 else if (wFlags & DISPATCH_PROPERTYPUT)
1290 {
1291 if (!pDispParams)
1292 {
1293 ERR("null pDispParams not allowed when DISPATCH_PROPERTYPUT specified\n");
1295 }
1296 if (pDispParams->cArgs != 1)
1297 {
1298 ERR("param count for DISPATCH_PROPERTYPUT was %d instead of 1\n", pDispParams->cArgs);
1299 return DISP_E_BADPARAMCOUNT;
1300 }
1301 }
1302 else
1303 {
1304 ERR("one of DISPATCH_PROPERTYGET or DISPATCH_PROPERTYPUT must be specified\n");
1305 return DISP_E_MEMBERNOTFOUND;
1306 }
1307
1308 switch (dispIdMember) {
1309 case DISPID_FONT_NAME:
1311 V_VT(pVarResult) = VT_BSTR;
1312 return IFont_get_Name(&this->IFont_iface, &V_BSTR(pVarResult));
1313 } else {
1314 VARIANTARG vararg;
1315
1316 VariantInit(&vararg);
1317 hr = VariantChangeTypeEx(&vararg, &pDispParams->rgvarg[0], lcid, 0, VT_BSTR);
1318 if (FAILED(hr))
1319 return hr;
1320
1321 hr = IFont_put_Name(&this->IFont_iface, V_BSTR(&vararg));
1322
1323 VariantClear(&vararg);
1324 return hr;
1325 }
1326 break;
1327 case DISPID_FONT_BOLD:
1329 BOOL value;
1330 hr = IFont_get_Bold(&this->IFont_iface, &value);
1331 V_VT(pVarResult) = VT_BOOL;
1332 V_BOOL(pVarResult) = value ? VARIANT_TRUE : VARIANT_FALSE;
1333 return hr;
1334 } else {
1335 VARIANTARG vararg;
1336
1337 VariantInit(&vararg);
1338 hr = VariantChangeTypeEx(&vararg, &pDispParams->rgvarg[0], lcid, 0, VT_BOOL);
1339 if (FAILED(hr))
1340 return hr;
1341
1342 hr = IFont_put_Bold(&this->IFont_iface, V_BOOL(&vararg));
1343
1344 VariantClear(&vararg);
1345 return hr;
1346 }
1347 break;
1348 case DISPID_FONT_ITALIC:
1350 BOOL value;
1351 hr = IFont_get_Italic(&this->IFont_iface, &value);
1352 V_VT(pVarResult) = VT_BOOL;
1353 V_BOOL(pVarResult) = value ? VARIANT_TRUE : VARIANT_FALSE;
1354 return hr;
1355 } else {
1356 VARIANTARG vararg;
1357
1358 VariantInit(&vararg);
1359 hr = VariantChangeTypeEx(&vararg, &pDispParams->rgvarg[0], lcid, 0, VT_BOOL);
1360 if (FAILED(hr))
1361 return hr;
1362
1363 hr = IFont_put_Italic(&this->IFont_iface, V_BOOL(&vararg));
1364
1365 VariantClear(&vararg);
1366 return hr;
1367 }
1368 break;
1369 case DISPID_FONT_UNDER:
1371 BOOL value;
1372 hr = IFont_get_Underline(&this->IFont_iface, &value);
1373 V_VT(pVarResult) = VT_BOOL;
1374 V_BOOL(pVarResult) = value ? VARIANT_TRUE : VARIANT_FALSE;
1375 return hr;
1376 } else {
1377 VARIANTARG vararg;
1378
1379 VariantInit(&vararg);
1380 hr = VariantChangeTypeEx(&vararg, &pDispParams->rgvarg[0], lcid, 0, VT_BOOL);
1381 if (FAILED(hr))
1382 return hr;
1383
1384 hr = IFont_put_Underline(&this->IFont_iface, V_BOOL(&vararg));
1385
1386 VariantClear(&vararg);
1387 return hr;
1388 }
1389 break;
1390 case DISPID_FONT_STRIKE:
1392 BOOL value;
1393 hr = IFont_get_Strikethrough(&this->IFont_iface, &value);
1394 V_VT(pVarResult) = VT_BOOL;
1395 V_BOOL(pVarResult) = value ? VARIANT_TRUE : VARIANT_FALSE;
1396 return hr;
1397 } else {
1398 VARIANTARG vararg;
1399
1400 VariantInit(&vararg);
1401 hr = VariantChangeTypeEx(&vararg, &pDispParams->rgvarg[0], lcid, 0, VT_BOOL);
1402 if (FAILED(hr))
1403 return hr;
1404
1405 hr = IFont_put_Strikethrough(&this->IFont_iface, V_BOOL(&vararg));
1406
1407 VariantClear(&vararg);
1408 return hr;
1409 }
1410 break;
1411 case DISPID_FONT_SIZE:
1413 V_VT(pVarResult) = VT_CY;
1414 return IFont_get_Size(&this->IFont_iface, &V_CY(pVarResult));
1415 } else {
1416 VARIANTARG vararg;
1417
1418 VariantInit(&vararg);
1419 hr = VariantChangeTypeEx(&vararg, &pDispParams->rgvarg[0], lcid, 0, VT_CY);
1420 if (FAILED(hr))
1421 return hr;
1422
1423 hr = IFont_put_Size(&this->IFont_iface, V_CY(&vararg));
1424
1425 VariantClear(&vararg);
1426 return hr;
1427 }
1428 break;
1429 case DISPID_FONT_WEIGHT:
1431 V_VT(pVarResult) = VT_I2;
1432 return IFont_get_Weight(&this->IFont_iface, &V_I2(pVarResult));
1433 } else {
1434 VARIANTARG vararg;
1435
1436 VariantInit(&vararg);
1437 hr = VariantChangeTypeEx(&vararg, &pDispParams->rgvarg[0], lcid, 0, VT_I2);
1438 if (FAILED(hr))
1439 return hr;
1440
1441 hr = IFont_put_Weight(&this->IFont_iface, V_I2(&vararg));
1442
1443 VariantClear(&vararg);
1444 return hr;
1445 }
1446 break;
1449 V_VT(pVarResult) = VT_I2;
1450 return OLEFontImpl_get_Charset(&this->IFont_iface, &V_I2(pVarResult));
1451 } else {
1452 VARIANTARG vararg;
1453
1454 VariantInit(&vararg);
1455 hr = VariantChangeTypeEx(&vararg, &pDispParams->rgvarg[0], lcid, 0, VT_I2);
1456 if (FAILED(hr))
1457 return hr;
1458
1459 hr = IFont_put_Charset(&this->IFont_iface, V_I2(&vararg));
1460
1461 VariantClear(&vararg);
1462 return hr;
1463 }
1464 break;
1465 default:
1466 ERR("member not found for dispid %#lx.\n", dispIdMember);
1467 return DISP_E_MEMBERNOTFOUND;
1468 }
1469}
@ VT_CY
Definition: compat.h:2301
@ VT_BOOL
Definition: compat.h:2306
@ VT_I2
Definition: compat.h:2297
static HRESULT WINAPI OLEFontImpl_get_Charset(IFont *iface, short *pcharset)
Definition: olefont.c:877
unsigned int BOOL
Definition: ntddk_ex.h:94
#define V_BOOL(A)
Definition: oleauto.h:224
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
#define V_CY(A)
Definition: oleauto.h:229
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define V_I2(A)
Definition: oleauto.h:245
#define DISPID_FONT_SIZE
Definition: olectl.h:428
#define DISPID_FONT_NAME
Definition: olectl.h:427
#define DISPID_FONT_BOLD
Definition: olectl.h:429
#define DISPID_FONT_STRIKE
Definition: olectl.h:432
#define DISPID_FONT_ITALIC
Definition: olectl.h:430
#define DISPID_FONT_CHARSET
Definition: olectl.h:434
#define DISPID_FONT_WEIGHT
Definition: olectl.h:433
#define DISPID_FONT_UNDER
Definition: olectl.h:431
Definition: pdh_main.c:96
HRESULT WINAPI VariantChangeTypeEx(VARIANTARG *pvargDest, const VARIANTARG *pvargSrc, LCID lcid, USHORT wFlags, VARTYPE vt)
Definition: variant.c:965
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
#define DISP_E_UNKNOWNINTERFACE
Definition: winerror.h:3614
#define DISP_E_BADPARAMCOUNT
Definition: winerror.h:3626
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:3615
#define DISP_E_PARAMNOTOPTIONAL
Definition: winerror.h:3627

◆ OLEFontImpl_IPersistPropertyBag_AddRef()

static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_AddRef ( IPersistPropertyBag iface)
static

Definition at line 1826 of file olefont.c.

1828 {
1830 return IFont_AddRef(&this->IFont_iface);
1831}
static OLEFontImpl * impl_from_IPersistPropertyBag(IPersistPropertyBag *iface)
Definition: olefont.c:294

◆ OLEFontImpl_IPersistPropertyBag_GetClassID()

static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_GetClassID ( IPersistPropertyBag iface,
CLSID classid 
)
static

Definition at line 1840 of file olefont.c.

1842 {
1843 FIXME("(%p,%p), stub!\n", iface, classid);
1844 return E_FAIL;
1845}

◆ OLEFontImpl_IPersistPropertyBag_InitNew()

static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_InitNew ( IPersistPropertyBag iface)
static

Definition at line 1847 of file olefont.c.

1849 {
1850 FIXME("(%p), stub!\n", iface);
1851 return S_OK;
1852}

◆ OLEFontImpl_IPersistPropertyBag_Load()

static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load ( IPersistPropertyBag iface,
IPropertyBag pPropBag,
IErrorLog pErrorLog 
)
static

Definition at line 1854 of file olefont.c.

1856 {
1857/* (from Visual Basic 6 property bag)
1858 Name = "MS Sans Serif"
1859 Size = 13.8
1860 Charset = 0
1861 Weight = 400
1862 Underline = 0 'False
1863 Italic = 0 'False
1864 Strikethrough = 0 'False
1865*/
1867 VARIANT value;
1868 HRESULT iRes;
1869
1871
1872 iRes = IPropertyBag_Read(pPropBag, L"Name", &value, pErrorLog);
1873 if (iRes == S_OK)
1874 {
1875 iRes = VariantChangeType(&value, &value, 0, VT_BSTR);
1876 if (iRes == S_OK)
1877 iRes = IFont_put_Name(&this->IFont_iface, V_BSTR(&value));
1878 }
1879 else if (iRes == E_INVALIDARG)
1880 iRes = S_OK;
1881
1883
1884 if (iRes == S_OK) {
1885 iRes = IPropertyBag_Read(pPropBag, L"Size", &value, pErrorLog);
1886 if (iRes == S_OK)
1887 {
1888 iRes = VariantChangeType(&value, &value, 0, VT_CY);
1889 if (iRes == S_OK)
1890 iRes = IFont_put_Size(&this->IFont_iface, V_CY(&value));
1891 }
1892 else if (iRes == E_INVALIDARG)
1893 iRes = S_OK;
1894
1896 }
1897
1898 if (iRes == S_OK) {
1899 iRes = IPropertyBag_Read(pPropBag, L"Charset", &value, pErrorLog);
1900 if (iRes == S_OK)
1901 {
1902 iRes = VariantChangeType(&value, &value, 0, VT_I2);
1903 if (iRes == S_OK)
1904 iRes = IFont_put_Charset(&this->IFont_iface, V_I2(&value));
1905 }
1906 else if (iRes == E_INVALIDARG)
1907 iRes = S_OK;
1908
1910 }
1911
1912 if (iRes == S_OK) {
1913 iRes = IPropertyBag_Read(pPropBag, L"Weight", &value, pErrorLog);
1914 if (iRes == S_OK)
1915 {
1916 iRes = VariantChangeType(&value, &value, 0, VT_I2);
1917 if (iRes == S_OK)
1918 iRes = IFont_put_Weight(&this->IFont_iface, V_I2(&value));
1919 }
1920 else if (iRes == E_INVALIDARG)
1921 iRes = S_OK;
1922
1924 }
1925
1926 if (iRes == S_OK) {
1927 iRes = IPropertyBag_Read(pPropBag, L"Underline", &value, pErrorLog);
1928 if (iRes == S_OK)
1929 {
1930 iRes = VariantChangeType(&value, &value, 0, VT_BOOL);
1931 if (iRes == S_OK)
1932 iRes = IFont_put_Underline(&this->IFont_iface, V_BOOL(&value));
1933 }
1934 else if (iRes == E_INVALIDARG)
1935 iRes = S_OK;
1936
1938 }
1939
1940 if (iRes == S_OK) {
1941 iRes = IPropertyBag_Read(pPropBag, L"Italic", &value, pErrorLog);
1942 if (iRes == S_OK)
1943 {
1944 iRes = VariantChangeType(&value, &value, 0, VT_BOOL);
1945 if (iRes == S_OK)
1946 iRes = IFont_put_Italic(&this->IFont_iface, V_BOOL(&value));
1947 }
1948 else if (iRes == E_INVALIDARG)
1949 iRes = S_OK;
1950
1952 }
1953
1954 if (iRes == S_OK) {
1955 iRes = IPropertyBag_Read(pPropBag, L"Strikethrough", &value, pErrorLog);
1956 if (iRes == S_OK)
1957 {
1958 iRes = VariantChangeType(&value, &value, 0, VT_BOOL);
1959 if (iRes == S_OK)
1960 IFont_put_Strikethrough(&this->IFont_iface, V_BOOL(&value));
1961 }
1962 else if (iRes == E_INVALIDARG)
1963 iRes = S_OK;
1964
1966 }
1967
1968 if (FAILED(iRes))
1969 WARN("-- %#lx.\n", iRes);
1970 return iRes;
1971}
#define WARN(fmt,...)
Definition: precomp.h:61
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, const VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:939

◆ OLEFontImpl_IPersistPropertyBag_QueryInterface()

static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_QueryInterface ( IPersistPropertyBag iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 1819 of file olefont.c.

1821 {
1823 return IFont_QueryInterface(&this->IFont_iface,riid,ppvObj);
1824}

◆ OLEFontImpl_IPersistPropertyBag_Release()

static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_Release ( IPersistPropertyBag iface)
static

Definition at line 1833 of file olefont.c.

1835 {
1837 return IFont_Release(&this->IFont_iface);
1838}

◆ OLEFontImpl_IPersistPropertyBag_Save()

static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Save ( IPersistPropertyBag iface,
IPropertyBag pPropBag,
BOOL  fClearDirty,
BOOL  fSaveAllProperties 
)
static

Definition at line 1973 of file olefont.c.

1976 {
1977 FIXME("(%p,%p,%d,%d), stub!\n", iface, pPropBag, fClearDirty, fSaveAllProperties);
1978 return E_FAIL;
1979}

◆ OLEFontImpl_IPersistStream_AddRef()

static ULONG WINAPI OLEFontImpl_IPersistStream_AddRef ( IPersistStream iface)
static

Definition at line 1509 of file olefont.c.

1511{
1513
1514 return IFont_AddRef(&this->IFont_iface);
1515}

◆ OLEFontImpl_IPersistStream_QueryInterface()

static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface ( IPersistStream iface,
REFIID  riid,
VOID **  ppvoid 
)
static

Definition at line 1485 of file olefont.c.

1489{
1491
1492 return IFont_QueryInterface(&this->IFont_iface, riid, ppvoid);
1493}

◆ OLEFontImpl_IPersistStream_Release()

static ULONG WINAPI OLEFontImpl_IPersistStream_Release ( IPersistStream iface)
static

Definition at line 1498 of file olefont.c.

1500{
1502
1503 return IFont_Release(&this->IFont_iface);
1504}

◆ OLEFontImpl_IsDirty()

static HRESULT WINAPI OLEFontImpl_IsDirty ( IPersistStream iface)
static

Definition at line 1538 of file olefont.c.

1540{
1541 TRACE("(%p)\n",iface);
1542 return S_OK;
1543}

◆ OLEFontImpl_IsEqual()

static HRESULT WINAPI OLEFontImpl_IsEqual ( IFont iface,
IFont pFontOther 
)
static

Definition at line 983 of file olefont.c.

986{
988 OLEFontImpl *right = impl_from_IFont(pFontOther);
989 INT ret;
990 INT left_len,right_len;
991
992 if(pFontOther == NULL)
993 return E_POINTER;
994 else if (left->description.cySize.Lo != right->description.cySize.Lo)
995 return S_FALSE;
996 else if (left->description.cySize.Hi != right->description.cySize.Hi)
997 return S_FALSE;
998 else if (left->description.sWeight != right->description.sWeight)
999 return S_FALSE;
1000 else if (left->description.sCharset != right->description.sCharset)
1001 return S_FALSE;
1002 else if (left->description.fItalic != right->description.fItalic)
1003 return S_FALSE;
1004 else if (left->description.fUnderline != right->description.fUnderline)
1005 return S_FALSE;
1006 else if (left->description.fStrikethrough != right->description.fStrikethrough)
1007 return S_FALSE;
1008
1009 /* Check from string */
1010 left_len = lstrlenW(left->description.lpstrName);
1011 right_len = lstrlenW(right->description.lpstrName);
1012 ret = CompareStringW(0,0,left->description.lpstrName, left_len,
1013 right->description.lpstrName, right_len);
1014 if (ret != CSTR_EQUAL)
1015 return S_FALSE;
1016
1017 return S_OK;
1018}
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
Definition: locale.c:3946
return ret
Definition: mutex.c:146
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
int32_t INT
Definition: typedefs.h:58
#define CSTR_EQUAL
Definition: winnls.h:508

◆ OLEFontImpl_Load()

static HRESULT WINAPI OLEFontImpl_Load ( IPersistStream iface,
IStream pLoadStream 
)
static

Definition at line 1566 of file olefont.c.

1569{
1571 BYTE version, attributes, string_size;
1572 char readBuffer[0x100];
1573 ULONG cbRead;
1574 INT len;
1575
1576 /* Version */
1577 IStream_Read(pLoadStream, &version, sizeof(BYTE), &cbRead);
1578 if ((cbRead != sizeof(BYTE)) || (version != 0x01)) return E_FAIL;
1579
1580 /* Charset */
1581 IStream_Read(pLoadStream, &this->description.sCharset, sizeof(WORD), &cbRead);
1582 if (cbRead != sizeof(WORD)) return E_FAIL;
1583
1584 /* Attributes */
1585 IStream_Read(pLoadStream, &attributes, sizeof(BYTE), &cbRead);
1586 if (cbRead != sizeof(BYTE)) return E_FAIL;
1587
1588 this->description.fItalic = (attributes & FONTPERSIST_ITALIC) != 0;
1589 this->description.fStrikethrough = (attributes & FONTPERSIST_STRIKETHROUGH) != 0;
1590 this->description.fUnderline = (attributes & FONTPERSIST_UNDERLINE) != 0;
1591
1592 /* Weight */
1593 IStream_Read(pLoadStream, &this->description.sWeight, sizeof(WORD), &cbRead);
1594 if (cbRead != sizeof(WORD)) return E_FAIL;
1595
1596 /* Size */
1597 IStream_Read(pLoadStream, &this->description.cySize.Lo, sizeof(DWORD), &cbRead);
1598 if (cbRead != sizeof(DWORD)) return E_FAIL;
1599
1600 this->description.cySize.Hi = 0;
1601
1602 /* Name */
1603 IStream_Read(pLoadStream, &string_size, sizeof(BYTE), &cbRead);
1604 if (cbRead != sizeof(BYTE)) return E_FAIL;
1605
1606 IStream_Read(pLoadStream, readBuffer, string_size, &cbRead);
1607 if (cbRead != string_size) return E_FAIL;
1608
1609 free(this->description.lpstrName);
1610
1611 len = MultiByteToWideChar( CP_ACP, 0, readBuffer, string_size, NULL, 0 );
1612 this->description.lpstrName = malloc((len + 1) * sizeof(WCHAR));
1613 MultiByteToWideChar( CP_ACP, 0, readBuffer, string_size, this->description.lpstrName, len );
1614 this->description.lpstrName[len] = 0;
1615
1616 /* Ensure use of this font causes a new one to be created */
1617 dec_int_ref(this->gdiFont);
1618 this->gdiFont = 0;
1619 this->dirty = TRUE;
1620
1621 return S_OK;
1622}
#define MultiByteToWideChar
Definition: compat.h:110
static const WCHAR version[]
Definition: asmname.c:66
#define FONTPERSIST_UNDERLINE
Definition: olefont.c:49
#define FONTPERSIST_ITALIC
Definition: olefont.c:48
#define FONTPERSIST_STRIKETHROUGH
Definition: olefont.c:50
static HRESULT dec_int_ref(HFONT hfont)
Definition: olefont.c:170
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
static HANDLE ACCESS_MASK ULONG attributes
Definition: om.c:94

◆ OLEFontImpl_put_Bold()

static HRESULT WINAPI OLEFontImpl_put_Bold ( IFont iface,
BOOL  bold 
)
static

Definition at line 718 of file olefont.c.

721{
722 OLEFontImpl *this = impl_from_IFont(iface);
723 TRACE("(%p)->(%d)\n", this, bold);
724 this->description.sWeight = bold ? FW_BOLD : FW_NORMAL;
726
727 return S_OK;
728}
static void OLEFont_SendNotify(OLEFontImpl *this, DISPID dispID)
Definition: olefont.c:363
#define FW_BOLD
Definition: wingdi.h:378
#define FW_NORMAL
Definition: wingdi.h:373

◆ OLEFontImpl_put_Charset()

static HRESULT WINAPI OLEFontImpl_put_Charset ( IFont iface,
short  charset 
)
static

Definition at line 897 of file olefont.c.

900{
901 OLEFontImpl *this = impl_from_IFont(iface);
902 TRACE("(%p)->(%d)\n", this, charset);
903
904 this->description.sCharset = charset;
906
907 return S_OK;
908}
CFF_Charset charset
Definition: cffcmap.c:137

◆ OLEFontImpl_put_Italic()

static HRESULT WINAPI OLEFontImpl_put_Italic ( IFont iface,
BOOL  italic 
)
static

Definition at line 753 of file olefont.c.

756{
757 OLEFontImpl *this = impl_from_IFont(iface);
758 TRACE("(%p)->(%d)\n", this, italic);
759
760 this->description.fItalic = italic;
761
763 return S_OK;
764}

◆ OLEFontImpl_put_Name()

static HRESULT WINAPI OLEFontImpl_put_Name ( IFont iface,
BSTR  name 
)
static

Definition at line 647 of file olefont.c.

650{
652 TRACE("(%p)->(%p)\n", This, name);
653
654 if (!name)
656
657 free(This->description.lpstrName);
658 This->description.lpstrName = wcsdup(name);
659 if (!This->description.lpstrName) return E_OUTOFMEMORY;
660
661 TRACE("new name %s\n", debugstr_w(This->description.lpstrName));
663 return S_OK;
664}
#define debugstr_w
Definition: kernel32.h:32
Definition: name.c:39

◆ OLEFontImpl_put_Size()

static HRESULT WINAPI OLEFontImpl_put_Size ( IFont iface,
CY  size 
)
static

Definition at line 690 of file olefont.c.

691{
692 OLEFontImpl *this = impl_from_IFont(iface);
693 TRACE("%p, %ld.\n", iface, size.Lo);
694 this->description.cySize.Hi = 0;
695 this->description.cySize.Lo = size.Lo;
697
698 return S_OK;
699}
GLsizeiptr size
Definition: glext.h:5919
ULONG Lo
Definition: compat.h:2261

◆ OLEFontImpl_put_Strikethrough()

static HRESULT WINAPI OLEFontImpl_put_Strikethrough ( IFont iface,
BOOL  strikethrough 
)
static

Definition at line 825 of file olefont.c.

828{
829 OLEFontImpl *this = impl_from_IFont(iface);
830 TRACE("(%p)->(%d)\n", this, strikethrough);
831
832 this->description.fStrikethrough = strikethrough;
834
835 return S_OK;
836}

◆ OLEFontImpl_put_Underline()

static HRESULT WINAPI OLEFontImpl_put_Underline ( IFont iface,
BOOL  underline 
)
static

Definition at line 789 of file olefont.c.

792{
793 OLEFontImpl *this = impl_from_IFont(iface);
794 TRACE("(%p)->(%d)\n", this, underline);
795
796 this->description.fUnderline = underline;
797
799 return S_OK;
800}

◆ OLEFontImpl_put_Weight()

static HRESULT WINAPI OLEFontImpl_put_Weight ( IFont iface,
short  weight 
)
static

Definition at line 861 of file olefont.c.

864{
865 OLEFontImpl *this = impl_from_IFont(iface);
866 TRACE("(%p)->(%d)\n", this, weight);
867
868 this->description.sWeight = weight;
869
871 return S_OK;
872}
weight
Definition: sortkey.c:157

◆ OLEFontImpl_QueryInterface()

static HRESULT WINAPI OLEFontImpl_QueryInterface ( IFont iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 434 of file olefont.c.

438{
439 OLEFontImpl *this = impl_from_IFont(iface);
440
441 TRACE("(%p)->(%s, %p)\n", this, debugstr_guid(riid), ppvObject);
442
443 *ppvObject = 0;
444
447 {
448 *ppvObject = this;
449 }
450 else if (IsEqualGUID(&IID_IDispatch, riid) ||
452 {
453 *ppvObject = &this->IDispatch_iface;
454 }
455 else if (IsEqualGUID(&IID_IPersist, riid) ||
457 {
458 *ppvObject = &this->IPersistStream_iface;
459 }
461 {
462 *ppvObject = &this->IConnectionPointContainer_iface;
463 }
465 {
466 *ppvObject = &this->IPersistPropertyBag_iface;
467 }
468
469 if (!*ppvObject)
470 {
471 FIXME("() : asking for unsupported interface %s\n", debugstr_guid(riid));
472 return E_NOINTERFACE;
473 }
474
475 IFont_AddRef(iface);
476
477 return S_OK;
478}
const GUID IID_IUnknown
const GUID IID_IConnectionPointContainer
const GUID IID_IDispatch
const GUID IID_IFont
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistStream
Definition: proxy.cpp:13
const GUID IID_IPersistPropertyBag
Definition: proxy.cpp:11
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ OLEFontImpl_QueryTextMetrics()

static HRESULT WINAPI OLEFontImpl_QueryTextMetrics ( IFont iface,
TEXTMETRICOLE *  ptm 
)
static

Definition at line 1050 of file olefont.c.

1053{
1054 HDC hdcRef;
1055 HFONT hOldFont, hNewFont;
1056
1057 hdcRef = GetDC(0);
1058 IFont_get_hFont(iface, &hNewFont);
1059 hOldFont = SelectObject(hdcRef, hNewFont);
1060 GetTextMetricsW(hdcRef, ptm);
1061 SelectObject(hdcRef, hOldFont);
1062 ReleaseDC(0, hdcRef);
1063 return S_OK;
1064}
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

◆ OLEFontImpl_Release()

static ULONG WINAPI OLEFontImpl_Release ( IFont iface)
static

Definition at line 488 of file olefont.c.

489{
490 OLEFontImpl *this = impl_from_IFont(iface);
491 ULONG ref = InterlockedDecrement(&this->ref);
492
493 TRACE("%p, refcount %lu.\n", iface, ref);
494
495 if (ref == 0)
496 {
497 ULONG fontlist_refs = InterlockedDecrement(&ifont_cnt);
498
499 /* Final IFont object so destroy font cache */
500 if (fontlist_refs == 0)
501 {
502 HFONTItem *item, *cursor2;
503
508 delete_dc();
509 }
510 else
511 {
512 dec_int_ref(this->gdiFont);
513 }
515 }
516
517 return ref;
518}
#define InterlockedDecrement
Definition: armddk.h:52
static void delete_dc(void)
Definition: olefont.c:102
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204

◆ OLEFontImpl_ReleaseHfont()

static HRESULT WINAPI OLEFontImpl_ReleaseHfont ( IFont iface,
HFONT  hfont 
)
static

Definition at line 1085 of file olefont.c.

1088{
1089 OLEFontImpl *this = impl_from_IFont(iface);
1090
1091 TRACE("(%p)->(%p)\n", this, hfont);
1092
1093 if (!hfont) return E_INVALIDARG;
1094
1095 return dec_ext_ref(hfont);
1096}
static HRESULT dec_ext_ref(HFONT hfont)
Definition: olefont.c:209

◆ OLEFontImpl_Save()

static HRESULT WINAPI OLEFontImpl_Save ( IPersistStream iface,
IStream pOutStream,
BOOL  fClearDirty 
)
static

Definition at line 1627 of file olefont.c.

1631{
1633 BYTE attributes, string_size;
1634 const BYTE version = 0x01;
1635 char* writeBuffer = NULL;
1636 ULONG written;
1637
1638 TRACE("(%p)->(%p %d)\n", this, pOutStream, fClearDirty);
1639
1640 /* Version */
1641 IStream_Write(pOutStream, &version, sizeof(BYTE), &written);
1642 if (written != sizeof(BYTE)) return E_FAIL;
1643
1644 /* Charset */
1645 IStream_Write(pOutStream, &this->description.sCharset, sizeof(WORD), &written);
1646 if (written != sizeof(WORD)) return E_FAIL;
1647
1648 /* Attributes */
1649 attributes = 0;
1650
1651 if (this->description.fItalic)
1652 attributes |= FONTPERSIST_ITALIC;
1653
1654 if (this->description.fStrikethrough)
1655 attributes |= FONTPERSIST_STRIKETHROUGH;
1656
1657 if (this->description.fUnderline)
1658 attributes |= FONTPERSIST_UNDERLINE;
1659
1660 IStream_Write(pOutStream, &attributes, sizeof(BYTE), &written);
1661 if (written != sizeof(BYTE)) return E_FAIL;
1662
1663 /* Weight */
1664 IStream_Write(pOutStream, &this->description.sWeight, sizeof(WORD), &written);
1665 if (written != sizeof(WORD)) return E_FAIL;
1666
1667 /* Size */
1668 IStream_Write(pOutStream, &this->description.cySize.Lo, sizeof(DWORD), &written);
1669 if (written != sizeof(DWORD)) return E_FAIL;
1670
1671 /* FontName */
1672 string_size = WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName,
1673 lstrlenW(this->description.lpstrName), NULL, 0, NULL, NULL );
1674
1675 IStream_Write(pOutStream, &string_size, sizeof(BYTE), &written);
1676 if (written != sizeof(BYTE)) return E_FAIL;
1677
1678 if (string_size)
1679 {
1680 if (!(writeBuffer = malloc(string_size))) return E_OUTOFMEMORY;
1681 WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName,
1682 lstrlenW(this->description.lpstrName),
1683 writeBuffer, string_size, NULL, NULL );
1684
1685 IStream_Write(pOutStream, writeBuffer, string_size, &written);
1687
1688 if (written != string_size) return E_FAIL;
1689 }
1690
1691 return S_OK;
1692}
GLuint writeBuffer
Definition: glext.h:11008

◆ OLEFontImpl_SetHdc()

static HRESULT WINAPI OLEFontImpl_SetHdc ( IFont iface,
HDC  hdc 
)
static

Definition at line 1101 of file olefont.c.

1104{
1105 OLEFontImpl *this = impl_from_IFont(iface);
1106 FIXME("(%p)->(%p): Stub\n", this, hdc);
1107 return E_NOTIMPL;
1108}

◆ OLEFontImpl_SetRatio()

static HRESULT WINAPI OLEFontImpl_SetRatio ( IFont iface,
LONG  cyLogical,
LONG  cyHimetric 
)
static

Definition at line 1023 of file olefont.c.

1027{
1028 OLEFontImpl *this = impl_from_IFont(iface);
1029
1030 TRACE("%p, %ld, %ld.\n", iface, cyLogical, cyHimetric);
1031
1032 if(cyLogical == 0 || cyHimetric == 0)
1033 return E_FAIL;
1034
1035 /* cyLogical and cyHimetric both set to 1 is a special case that
1036 does not change the scaling but also does not fail */
1037 if(cyLogical == 1 && cyHimetric == 1)
1038 return S_OK;
1039
1040 this->cyLogical = cyLogical;
1041 this->cyHimetric = cyHimetric;
1042 this->dirty = TRUE;
1043
1044 return S_OK;
1045}

◆ realize_font()

static void realize_font ( OLEFontImpl This)
static

Definition at line 539 of file olefont.c.

540{
541 LOGFONTW logFont;
543 WCHAR text_face[LF_FACESIZE];
544 HDC hdc = get_dc();
545 HFONT old_font;
547
548 if (!This->dirty) return;
549
550 text_face[0] = 0;
551
552 if(This->gdiFont)
553 {
554 old_font = SelectObject(hdc, This->gdiFont);
555 GetTextFaceW(hdc, ARRAY_SIZE(text_face), text_face);
556 SelectObject(hdc, old_font);
557 dec_int_ref(This->gdiFont);
558 This->gdiFont = 0;
559 }
560
561 memset(&logFont, 0, sizeof(LOGFONTW));
562
563 lstrcpynW(logFont.lfFaceName, This->description.lpstrName, LF_FACESIZE);
564 logFont.lfCharSet = This->description.sCharset;
565
566 /* If the font name has been changed then enumerate all charsets
567 and pick one that'll result in the font specified being selected */
568 if(text_face[0] && lstrcmpiW(text_face, This->description.lpstrName))
569 {
571 data.orig_cs = This->description.sCharset;
572 data.avail_cs = -1;
573 logFont.lfCharSet = DEFAULT_CHARSET;
575 if(data.avail_cs != -1) logFont.lfCharSet = data.avail_cs;
576 }
577
578 /*
579 * The height of the font returned by the get_Size property is the
580 * height of the font in points multiplied by 10000... Using some
581 * simple conversions and the ratio given by the application, it can
582 * be converted to a height in pixels.
583 *
584 * Standard ratio is 72 / 2540, or 18 / 635 in lowest terms.
585 * Ratio is applied here relative to the standard.
586 */
587
588 fontHeight = MulDiv( This->description.cySize.Lo, This->cyLogical*635, This->cyHimetric*18 );
589
590 logFont.lfHeight = ((fontHeight%10000L)>5000L) ? (-fontHeight/10000L) - 1 :
591 (-fontHeight/10000L);
592 logFont.lfItalic = This->description.fItalic;
593 logFont.lfUnderline = This->description.fUnderline;
594 logFont.lfStrikeOut = This->description.fStrikethrough;
595 logFont.lfWeight = This->description.sWeight;
598 logFont.lfQuality = DEFAULT_QUALITY;
600
601 This->gdiFont = CreateFontIndirectW(&logFont);
602 This->dirty = FALSE;
603
604 add_hfontitem(This->gdiFont);
605
606 /* Fixup the name and charset properties so that they match the
607 selected font */
608 old_font = SelectObject(get_dc(), This->gdiFont);
609 GetTextFaceW(hdc, ARRAY_SIZE(text_face), text_face);
610 if(lstrcmpiW(text_face, This->description.lpstrName))
611 {
612 free(This->description.lpstrName);
613 This->description.lpstrName = wcsdup(text_face);
614 }
616 This->description.sCharset = tm.tmCharSet;
617 /* While we have it handy, stash the realized font height for use by get_Size() */
618 This->nRealHeight = tm.tmHeight - tm.tmInternalLeading; /* corresponds to LOGFONT lfHeight */
619 SelectObject(hdc, old_font);
620}
int fontHeight
Definition: appswitch.c:46
#define ARRAY_SIZE(A)
Definition: main.h:20
#define LF_FACESIZE
Definition: dimm.idl:39
#define lstrcpynW
Definition: compat.h:738
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4171
static int CALLBACK font_enum_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lp)
Definition: olefont.c:526
static HRESULT add_hfontitem(HFONT hfont)
Definition: olefont.c:134
LONG_PTR LPARAM
Definition: minwindef.h:175
#define memset(x, y, z)
Definition: compat.h:39
BYTE lfOutPrecision
Definition: dimm.idl:68
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfUnderline
Definition: dimm.idl:65
BYTE lfClipPrecision
Definition: dimm.idl:69
BYTE lfQuality
Definition: dimm.idl:70
BYTE lfPitchAndFamily
Definition: dimm.idl:71
#define DEFAULT_PITCH
Definition: wingdi.h:443
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)
#define DEFAULT_QUALITY
Definition: wingdi.h:436
#define DEFAULT_CHARSET
Definition: wingdi.h:384
int WINAPI GetTextFaceW(_In_ HDC hdc, _In_ int c, _Out_writes_to_opt_(c, return) LPWSTR lpName)
#define OUT_CHARACTER_PRECIS
Definition: wingdi.h:417
#define CLIP_DEFAULT_PRECIS
Definition: wingdi.h:426
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)

Referenced by OLEFontImpl_get_Bold(), OLEFontImpl_get_Charset(), OLEFontImpl_get_hFont(), OLEFontImpl_get_Italic(), OLEFontImpl_get_Name(), OLEFontImpl_get_Size(), OLEFontImpl_get_Strikethrough(), OLEFontImpl_get_Underline(), and OLEFontImpl_get_Weight().

◆ SFCF_AddRef()

static ULONG WINAPI SFCF_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 2105 of file olefont.c.

2105 {
2107 return InterlockedIncrement(&This->ref);
2108}
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: olefont.c:2081

◆ SFCF_CreateInstance()

static HRESULT WINAPI SFCF_CreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pOuter,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 2116 of file olefont.c.

2118 {
2119 return OleCreateFontIndirect(NULL,riid,ppobj);
2120
2121}
HRESULT WINAPI OleCreateFontIndirect(LPFONTDESC lpFontDesc, REFIID riid, LPVOID *ppvObj)
Definition: olefont.c:311

◆ SFCF_LockServer()

static HRESULT WINAPI SFCF_LockServer ( LPCLASSFACTORY  iface,
BOOL  dolock 
)
static

Definition at line 2123 of file olefont.c.

2123 {
2125 FIXME("(%p)->(%d),stub!\n",This,dolock);
2126 return S_OK;
2127}

◆ SFCF_QueryInterface()

static HRESULT WINAPI SFCF_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2086 of file olefont.c.

2087{
2089
2090 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
2091
2092 *obj = NULL;
2093
2095 {
2096 *obj = iface;
2097 IClassFactory_AddRef(iface);
2098 return S_OK;
2099 }
2100
2101 return E_NOINTERFACE;
2102}
const GUID IID_IClassFactory

◆ SFCF_Release()

static ULONG WINAPI SFCF_Release ( LPCLASSFACTORY  iface)
static

Definition at line 2110 of file olefont.c.

2110 {
2112 /* static class, won't be freed */
2113 return InterlockedDecrement(&This->ref);
2114}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ ifont_cnt

LONG ifont_cnt = 0
static

Definition at line 76 of file olefont.c.

Referenced by OLEFontImpl_Clone(), OLEFontImpl_Construct(), and OLEFontImpl_Release().

◆ olefont_hdc

HDC olefont_hdc
static

Definition at line 52 of file olefont.c.

Referenced by delete_dc(), and get_dc().

◆ OLEFontImpl_csHFONTLIST

static CRITICAL_SECTION OLEFontImpl_csHFONTLIST = { &OLEFontImpl_csHFONTLIST_debug, -1, 0, 0, 0, 0 }
static

◆ OLEFontImpl_csHFONTLIST_debug

CRITICAL_SECTION_DEBUG OLEFontImpl_csHFONTLIST_debug
static
Initial value:
=
{
0, 0, { (DWORD_PTR)(__FILE__ ": OLEFontImpl_csHFONTLIST") }
}
static CRITICAL_SECTION_DEBUG OLEFontImpl_csHFONTLIST_debug
Definition: olefont.c:82
#define DWORD_PTR
Definition: treelist.c:76

Definition at line 82 of file olefont.c.

◆ OLEFontImpl_hFontList

struct list OLEFontImpl_hFontList = LIST_INIT(OLEFontImpl_hFontList)
static

Definition at line 73 of file olefont.c.

Referenced by add_hfontitem(), find_hfontitem(), and OLEFontImpl_Release().

◆ OLEFontImpl_IConnectionPointContainer_VTable

const IConnectionPointContainerVtbl OLEFontImpl_IConnectionPointContainer_VTable
static
Initial value:
=
{
}
static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_Release(IConnectionPointContainer *iface)
Definition: olefont.c:1751
static ULONG WINAPI OLEFontImpl_IConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
Definition: olefont.c:1762
static HRESULT WINAPI OLEFontImpl_FindConnectionPoint(IConnectionPointContainer *iface, REFIID riid, IConnectionPoint **ppCp)
Definition: olefont.c:1786
static HRESULT WINAPI OLEFontImpl_IConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID riid, VOID **ppvoid)
Definition: olefont.c:1738
static HRESULT WINAPI OLEFontImpl_EnumConnectionPoints(IConnectionPointContainer *iface, IEnumConnectionPoints **ppEnum)
Definition: olefont.c:1773

Definition at line 1807 of file olefont.c.

Referenced by OLEFontImpl_Construct().

◆ OLEFontImpl_IDispatch_VTable

const IDispatchVtbl OLEFontImpl_IDispatch_VTable
static
Initial value:
=
{
}
static HRESULT WINAPI OLEFontImpl_IDispatch_QueryInterface(IDispatch *iface, REFIID riid, VOID **ppvoid)
Definition: olefont.c:1144
static HRESULT WINAPI OLEFontImpl_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: olefont.c:1219
static ULONG WINAPI OLEFontImpl_IDispatch_AddRef(IDispatch *iface)
Definition: olefont.c:1166
static HRESULT WINAPI OLEFontImpl_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
Definition: olefont.c:1255
static HRESULT WINAPI OLEFontImpl_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: olefont.c:1190
static ULONG WINAPI OLEFontImpl_IDispatch_Release(IDispatch *iface)
Definition: olefont.c:1156
static HRESULT WINAPI OLEFontImpl_GetTypeInfoCount(IDispatch *iface, unsigned int *pctinfo)
Definition: olefont.c:1176

Definition at line 1471 of file olefont.c.

Referenced by OLEFontImpl_Construct().

◆ OLEFontImpl_IPersistPropertyBag_VTable

const IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable
static
Initial value:
=
{
}
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_GetClassID(IPersistPropertyBag *iface, CLSID *classid)
Definition: olefont.c:1840
static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_Release(IPersistPropertyBag *iface)
Definition: olefont.c:1833
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_QueryInterface(IPersistPropertyBag *iface, REFIID riid, LPVOID *ppvObj)
Definition: olefont.c:1819
static ULONG WINAPI OLEFontImpl_IPersistPropertyBag_AddRef(IPersistPropertyBag *iface)
Definition: olefont.c:1826
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_InitNew(IPersistPropertyBag *iface)
Definition: olefont.c:1847
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(IPersistPropertyBag *iface, IPropertyBag *pPropBag, IErrorLog *pErrorLog)
Definition: olefont.c:1854
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Save(IPersistPropertyBag *iface, IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
Definition: olefont.c:1973

Definition at line 1981 of file olefont.c.

Referenced by OLEFontImpl_Construct().

◆ OLEFontImpl_IPersistStream_VTable

const IPersistStreamVtbl OLEFontImpl_IPersistStream_VTable
static
Initial value:
=
{
}
static HRESULT WINAPI OLEFontImpl_Save(IPersistStream *iface, IStream *pOutStream, BOOL fClearDirty)
Definition: olefont.c:1627
static HRESULT WINAPI OLEFontImpl_Load(IPersistStream *iface, IStream *pLoadStream)
Definition: olefont.c:1566
static HRESULT WINAPI OLEFontImpl_IsDirty(IPersistStream *iface)
Definition: olefont.c:1538
static HRESULT WINAPI OLEFontImpl_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, VOID **ppvoid)
Definition: olefont.c:1485
static HRESULT WINAPI OLEFontImpl_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *pcbSize)
Definition: olefont.c:1697
static ULONG WINAPI OLEFontImpl_IPersistStream_AddRef(IPersistStream *iface)
Definition: olefont.c:1509
static HRESULT WINAPI OLEFontImpl_GetClassID(IPersistStream *iface, CLSID *pClassID)
Definition: olefont.c:1520
static ULONG WINAPI OLEFontImpl_IPersistStream_Release(IPersistStream *iface)
Definition: olefont.c:1498

Definition at line 1723 of file olefont.c.

Referenced by OLEFontImpl_Construct().

◆ OLEFontImpl_VTable

const IFontVtbl OLEFontImpl_VTable
static
Initial value:
=
{
}
static HRESULT WINAPI OLEFontImpl_put_Italic(IFont *iface, BOOL italic)
Definition: olefont.c:753
static HRESULT WINAPI OLEFontImpl_put_Charset(IFont *iface, short charset)
Definition: olefont.c:897
static HRESULT WINAPI OLEFontImpl_AddRefHfont(IFont *iface, HFONT hfont)
Definition: olefont.c:1069
static HRESULT WINAPI OLEFontImpl_get_Weight(IFont *iface, short *pweight)
Definition: olefont.c:841
static HRESULT WINAPI OLEFontImpl_QueryTextMetrics(IFont *iface, TEXTMETRICOLE *ptm)
Definition: olefont.c:1050
static HRESULT WINAPI OLEFontImpl_ReleaseHfont(IFont *iface, HFONT hfont)
Definition: olefont.c:1085
static HRESULT WINAPI OLEFontImpl_SetRatio(IFont *iface, LONG cyLogical, LONG cyHimetric)
Definition: olefont.c:1023
static HRESULT WINAPI OLEFontImpl_get_Size(IFont *iface, CY *psize)
Definition: olefont.c:669
static HRESULT WINAPI OLEFontImpl_IsEqual(IFont *iface, IFont *pFontOther)
Definition: olefont.c:983
static HRESULT WINAPI OLEFontImpl_put_Weight(IFont *iface, short weight)
Definition: olefont.c:861
static HRESULT WINAPI OLEFontImpl_get_Italic(IFont *iface, BOOL *pitalic)
Definition: olefont.c:733
static HRESULT WINAPI OLEFontImpl_QueryInterface(IFont *iface, REFIID riid, void **ppvObject)
Definition: olefont.c:434
static ULONG WINAPI OLEFontImpl_AddRef(IFont *iface)
Definition: olefont.c:480
static HRESULT WINAPI OLEFontImpl_put_Strikethrough(IFont *iface, BOOL strikethrough)
Definition: olefont.c:825
static HRESULT WINAPI OLEFontImpl_SetHdc(IFont *iface, HDC hdc)
Definition: olefont.c:1101
static HRESULT WINAPI OLEFontImpl_put_Underline(IFont *iface, BOOL underline)
Definition: olefont.c:789
static HRESULT WINAPI OLEFontImpl_put_Size(IFont *iface, CY size)
Definition: olefont.c:690
static HRESULT WINAPI OLEFontImpl_get_hFont(IFont *iface, HFONT *phfont)
Definition: olefont.c:913
static HRESULT WINAPI OLEFontImpl_put_Name(IFont *iface, BSTR name)
Definition: olefont.c:647
static HRESULT WINAPI OLEFontImpl_get_Name(IFont *iface, BSTR *pname)
Definition: olefont.c:627
static HRESULT WINAPI OLEFontImpl_Clone(IFont *iface, IFont **ppfont)
Definition: olefont.c:932
static HRESULT WINAPI OLEFontImpl_get_Underline(IFont *iface, BOOL *punderline)
Definition: olefont.c:769
static HRESULT WINAPI OLEFontImpl_get_Strikethrough(IFont *iface, BOOL *pstrikethrough)
Definition: olefont.c:805
static ULONG WINAPI OLEFontImpl_Release(IFont *iface)
Definition: olefont.c:488
static HRESULT WINAPI OLEFontImpl_get_Bold(IFont *iface, BOOL *pbold)
Definition: olefont.c:701
static HRESULT WINAPI OLEFontImpl_put_Bold(IFont *iface, BOOL bold)
Definition: olefont.c:718

Definition at line 1110 of file olefont.c.

Referenced by OLEFontImpl_Construct().

◆ SFCF_Vtbl

const IClassFactoryVtbl SFCF_Vtbl
static
Initial value:
= {
}
static ULONG WINAPI SFCF_AddRef(LPCLASSFACTORY iface)
Definition: olefont.c:2105
static ULONG WINAPI SFCF_Release(LPCLASSFACTORY iface)
Definition: olefont.c:2110
static HRESULT WINAPI SFCF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
Definition: olefont.c:2086
static HRESULT WINAPI SFCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: olefont.c:2116
static HRESULT WINAPI SFCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
Definition: olefont.c:2123

Definition at line 2129 of file olefont.c.

◆ STDFONT_CF

IClassFactoryImpl STDFONT_CF = {{&SFCF_Vtbl}, 1 }
static

Definition at line 2136 of file olefont.c.

Referenced by _get_STDFONT_CF().