Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d49e808b
Commit
d49e808b
authored
Feb 10, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Feb 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut: Implement IFontEventsDisp connection point for the standard
font implementation.
parent
c548b7e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
16 deletions
+74
-16
olefont.c
dlls/oleaut32/olefont.c
+74
-16
No files found.
dlls/oleaut32/olefont.c
View file @
d49e808b
...
...
@@ -40,6 +40,7 @@
#include "olectl.h"
#include "wine/debug.h"
#include "connpt.h"
/* for CreateConnectionPoint */
#include "oaidl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
...
@@ -95,7 +96,8 @@ struct OLEFontImpl
long
cyLogical
;
long
cyHimetric
;
IConnectionPoint
*
pCP
;
IConnectionPoint
*
pPropertyNotifyCP
;
IConnectionPoint
*
pFontEventsCP
;
};
/*
...
...
@@ -378,24 +380,74 @@ HRESULT WINAPI OleCreateFontIndirect(
*/
static
void
OLEFont_SendNotify
(
OLEFontImpl
*
this
,
DISPID
dispID
)
{
static
const
WCHAR
wszName
[]
=
{
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
wszSize
[]
=
{
'S'
,
'i'
,
'z'
,
'e'
,
0
};
static
const
WCHAR
wszBold
[]
=
{
'B'
,
'o'
,
'l'
,
'd'
,
0
};
static
const
WCHAR
wszItalic
[]
=
{
'I'
,
't'
,
'a'
,
'l'
,
'i'
,
'c'
,
0
};
static
const
WCHAR
wszUnder
[]
=
{
'U'
,
'n'
,
'd'
,
'e'
,
'r'
,
'l'
,
'i'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
wszStrike
[]
=
{
'S'
,
't'
,
'r'
,
'i'
,
'k'
,
'e'
,
't'
,
'h'
,
'r'
,
'o'
,
'u'
,
'g'
,
'h'
,
0
};
static
const
WCHAR
wszWeight
[]
=
{
'W'
,
'e'
,
'i'
,
'g'
,
'h'
,
't'
,
0
};
static
const
WCHAR
wszCharset
[]
=
{
'C'
,
'h'
,
'a'
,
'r'
,
's'
,
's'
,
'e'
,
't'
,
0
};
static
const
LPCWSTR
dispid_mapping
[]
=
{
wszName
,
NULL
,
wszSize
,
wszBold
,
wszItalic
,
wszUnder
,
wszStrike
,
wszWeight
,
wszCharset
};
IEnumConnections
*
pEnum
;
CONNECTDATA
CD
;
HRESULT
hres
;
hres
=
IConnectionPoint_EnumConnections
(
this
->
pCP
,
&
pEnum
);
if
(
FAILED
(
hres
))
/* When we have 0 connections. */
return
;
hres
=
IConnectionPoint_EnumConnections
(
this
->
pPropertyNotifyCP
,
&
pEnum
);
if
(
SUCCEEDED
(
hres
))
{
while
(
IEnumConnections_Next
(
pEnum
,
1
,
&
CD
,
NULL
)
==
S_OK
)
{
IPropertyNotifySink
*
sink
;
IUnknown_QueryInterface
(
CD
.
pUnk
,
&
IID_IPropertyNotifySink
,
(
LPVOID
)
&
sink
);
IPropertyNotifySink_OnChanged
(
sink
,
dispID
);
IPropertyNotifySink_Release
(
sink
);
IUnknown_Release
(
CD
.
pUnk
);
}
IEnumConnections_Release
(
pEnum
);
}
hres
=
IConnectionPoint_EnumConnections
(
this
->
pFontEventsCP
,
&
pEnum
);
if
(
SUCCEEDED
(
hres
))
{
DISPPARAMS
dispparams
;
VARIANTARG
vararg
;
VariantInit
(
&
vararg
);
V_VT
(
&
vararg
)
=
VT_BSTR
;
V_BSTR
(
&
vararg
)
=
SysAllocString
(
dispid_mapping
[
dispID
]);
while
(
IEnumConnections_Next
(
pEnum
,
1
,
&
CD
,
NULL
)
==
S_OK
)
{
IPropertyNotifySink
*
sink
;
dispparams
.
cArgs
=
1
;
dispparams
.
cNamedArgs
=
0
;
dispparams
.
rgdispidNamedArgs
=
NULL
;
dispparams
.
rgvarg
=
&
vararg
;
IUnknown_QueryInterface
(
CD
.
pUnk
,
&
IID_IPropertyNotifySink
,
(
LPVOID
)
&
sink
);
IPropertyNotifySink_OnChanged
(
sink
,
dispID
);
IPropertyNotifySink_Release
(
sink
);
IUnknown_Release
(
CD
.
pUnk
);
while
(
IEnumConnections_Next
(
pEnum
,
1
,
&
CD
,
NULL
)
==
S_OK
)
{
IFontEventsDisp
*
disp
;
IUnknown_QueryInterface
(
CD
.
pUnk
,
&
IID_IFontEventsDisp
,
(
LPVOID
)
&
disp
);
IDispatch_Invoke
(
disp
,
DISPID_FONT_CHANGED
,
&
IID_NULL
,
LOCALE_NEUTRAL
,
INVOKE_FUNC
,
&
dispparams
,
NULL
,
NULL
,
NULL
);
IDispatch_Release
(
disp
);
IUnknown_Release
(
CD
.
pUnk
);
}
VariantClear
(
&
vararg
);
IEnumConnections_Release
(
pEnum
);
}
IEnumConnections_Release
(
pEnum
);
return
;
}
/************************************************************************
...
...
@@ -459,7 +511,8 @@ static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc)
newObject
->
fontLock
=
0
;
newObject
->
cyLogical
=
72L
;
newObject
->
cyHimetric
=
2540L
;
CreateConnectionPoint
((
IUnknown
*
)
newObject
,
&
IID_IPropertyNotifySink
,
&
newObject
->
pCP
);
CreateConnectionPoint
((
IUnknown
*
)
newObject
,
&
IID_IPropertyNotifySink
,
&
newObject
->
pPropertyNotifyCP
);
CreateConnectionPoint
((
IUnknown
*
)
newObject
,
&
IID_IFontEventsDisp
,
&
newObject
->
pFontEventsCP
);
TRACE
(
"returning %p
\n
"
,
newObject
);
return
newObject
;
}
...
...
@@ -1839,9 +1892,14 @@ static HRESULT WINAPI OLEFontImpl_FindConnectionPoint(
OLEFontImpl
*
this
=
impl_from_IConnectionPointContainer
(
iface
);
TRACE
(
"(%p)->(%s, %p): stub
\n
"
,
this
,
debugstr_guid
(
riid
),
ppCp
);
if
(
memcmp
(
riid
,
&
IID_IPropertyNotifySink
,
sizeof
(
IID_IPropertyNotifySink
))
==
0
)
{
return
IConnectionPoint_QueryInterface
(
this
->
pCP
,
&
IID_IConnectionPoint
,
(
LPVOID
)
ppCp
);
if
(
IsEqualIID
(
riid
,
&
IID_IPropertyNotifySink
))
{
return
IConnectionPoint_QueryInterface
(
this
->
pPropertyNotifyCP
,
&
IID_IConnectionPoint
,
(
LPVOID
)
ppCp
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IFontEventsDisp
))
{
return
IConnectionPoint_QueryInterface
(
this
->
pFontEventsCP
,
&
IID_IConnectionPoint
,
(
LPVOID
)
ppCp
);
}
else
{
FIXME
(
"Tried to find connection point on %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment