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
726312c5
Commit
726312c5
authored
Jan 03, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: COM cleanup for the IHTMLImageElementFactory iface.
parent
118379d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
20 deletions
+22
-20
htmlimg.c
dlls/mshtml/htmlimg.c
+19
-16
htmlwindow.c
dlls/mshtml/htmlwindow.c
+2
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-2
No files found.
dlls/mshtml/htmlimg.c
View file @
726312c5
...
...
@@ -693,21 +693,24 @@ HRESULT HTMLImgElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem,
return
S_OK
;
}
#define HTMLIMGFACTORY_THIS(iface) DEFINE_THIS(HTMLImageElementFactory, HTMLImageElementFactory, iface)
static
inline
HTMLImageElementFactory
*
impl_from_IHTMLImageElementFactory
(
IHTMLImageElementFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLImageElementFactory
,
IHTMLImageElementFactory_iface
);
}
static
HRESULT
WINAPI
HTMLImageElementFactory_QueryInterface
(
IHTMLImageElementFactory
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLImageElementFactory
*
This
=
HTMLIMGFACTORY_THIS
(
iface
);
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_Unknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTMLIMGFACTORY
(
This
)
;
*
ppv
=
&
This
->
IHTMLImageElementFactory_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IHTMLImageElementFactory
,
riid
))
{
TRACE
(
"(%p)->(IID_IHTMLImageElementFactory %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTMLIMGFACTORY
(
This
)
;
*
ppv
=
&
This
->
IHTMLImageElementFactory_iface
;
}
else
if
(
dispex_query_interface
(
&
This
->
dispex
,
riid
,
ppv
))
return
*
ppv
?
S_OK
:
E_NOINTERFACE
;
...
...
@@ -722,7 +725,7 @@ static HRESULT WINAPI HTMLImageElementFactory_QueryInterface(IHTMLImageElementFa
static
ULONG
WINAPI
HTMLImageElementFactory_AddRef
(
IHTMLImageElementFactory
*
iface
)
{
HTMLImageElementFactory
*
This
=
HTMLIMGFACTORY_THIS
(
iface
);
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -732,7 +735,7 @@ static ULONG WINAPI HTMLImageElementFactory_AddRef(IHTMLImageElementFactory *ifa
static
ULONG
WINAPI
HTMLImageElementFactory_Release
(
IHTMLImageElementFactory
*
iface
)
{
HTMLImageElementFactory
*
This
=
HTMLIMGFACTORY_THIS
(
iface
);
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -746,7 +749,7 @@ static ULONG WINAPI HTMLImageElementFactory_Release(IHTMLImageElementFactory *if
static
HRESULT
WINAPI
HTMLImageElementFactory_GetTypeInfoCount
(
IHTMLImageElementFactory
*
iface
,
UINT
*
pctinfo
)
{
HTMLImageElementFactory
*
This
=
HTMLIMGFACTORY_THIS
(
iface
);
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pctinfo
);
return
E_NOTIMPL
;
}
...
...
@@ -754,7 +757,7 @@ static HRESULT WINAPI HTMLImageElementFactory_GetTypeInfoCount(IHTMLImageElement
static
HRESULT
WINAPI
HTMLImageElementFactory_GetTypeInfo
(
IHTMLImageElementFactory
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
HTMLImageElementFactory
*
This
=
HTMLIMGFACTORY_THIS
(
iface
);
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
FIXME
(
"(%p)->(%u %u %p)
\n
"
,
This
,
iTInfo
,
lcid
,
ppTInfo
);
return
E_NOTIMPL
;
}
...
...
@@ -763,7 +766,7 @@ static HRESULT WINAPI HTMLImageElementFactory_GetIDsOfNames(IHTMLImageElementFac
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
HTMLImageElementFactory
*
This
=
HTMLIMGFACTORY_THIS
(
iface
);
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
FIXME
(
"(%p)->(%s %p %u %u %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
);
return
E_NOTIMPL
;
...
...
@@ -774,7 +777,7 @@ static HRESULT WINAPI HTMLImageElementFactory_Invoke(IHTMLImageElementFactory *i
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
HTMLImageElementFactory
*
This
=
HTMLIMGFACTORY_THIS
(
iface
);
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
FIXME
(
"(%p)->(%d %s %d %d %p %p %p %p)
\n
"
,
This
,
dispIdMember
,
debugstr_guid
(
riid
),
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
return
E_NOTIMPL
;
...
...
@@ -807,7 +810,7 @@ static LONG var_to_size(const VARIANT *v)
static
HRESULT
WINAPI
HTMLImageElementFactory_create
(
IHTMLImageElementFactory
*
iface
,
VARIANT
width
,
VARIANT
height
,
IHTMLImgElement
**
img_elem
)
{
HTMLImageElementFactory
*
This
=
HTMLIMGFACTORY_THIS
(
iface
);
HTMLImageElementFactory
*
This
=
impl_from_IHTMLImageElementFactory
(
iface
);
IHTMLImgElement
*
img
;
HTMLElement
*
elem
;
nsIDOMHTMLElement
*
nselem
;
...
...
@@ -855,8 +858,6 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i
return
S_OK
;
}
#undef HTMLIMGFACTORY_THIS
static
const
IHTMLImageElementFactoryVtbl
HTMLImageElementFactoryVtbl
=
{
HTMLImageElementFactory_QueryInterface
,
HTMLImageElementFactory_AddRef
,
...
...
@@ -890,7 +891,8 @@ static HRESULT HTMLImageElementFactory_value(DispatchEx *dispex, LCID lcid,
width
=
argc
>=
1
?
params
->
rgvarg
+
(
params
->
cArgs
-
1
)
:
&
empty
;
height
=
argc
>=
2
?
params
->
rgvarg
+
(
params
->
cArgs
-
2
)
:
&
empty
;
hres
=
IHTMLImageElementFactory_create
(
HTMLIMGFACTORY
(
This
),
*
width
,
*
height
,
&
img
);
hres
=
IHTMLImageElementFactory_create
(
&
This
->
IHTMLImageElementFactory_iface
,
*
width
,
*
height
,
&
img
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -924,11 +926,12 @@ HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow *window)
ret
=
heap_alloc
(
sizeof
(
HTMLImageElementFactory
));
ret
->
lpHTMLImageElementFactory
Vtbl
=
&
HTMLImageElementFactoryVtbl
;
ret
->
IHTMLImageElementFactory_iface
.
lp
Vtbl
=
&
HTMLImageElementFactoryVtbl
;
ret
->
ref
=
1
;
ret
->
window
=
window
;
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
HTMLIMGFACTORY
(
ret
),
&
HTMLImageElementFactory_dispex
);
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IHTMLImageElementFactory_iface
,
&
HTMLImageElementFactory_dispex
);
return
ret
;
}
dlls/mshtml/htmlwindow.c
View file @
726312c5
...
...
@@ -244,7 +244,7 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
if
(
This
->
image_factory
)
{
This
->
image_factory
->
window
=
NULL
;
IHTMLImageElementFactory_Release
(
HTMLIMGFACTORY
(
This
->
image_factory
)
);
IHTMLImageElementFactory_Release
(
&
This
->
image_factory
->
IHTMLImageElementFactory_iface
);
}
if
(
This
->
location
)
{
...
...
@@ -670,7 +670,7 @@ static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageEleme
if
(
!
This
->
image_factory
)
This
->
image_factory
=
HTMLImageElementFactory_Create
(
This
);
*
p
=
HTMLIMGFACTORY
(
This
->
image_factory
)
;
*
p
=
&
This
->
image_factory
->
IHTMLImageElementFactory_iface
;
IHTMLImageElementFactory_AddRef
(
*
p
);
return
S_OK
;
...
...
dlls/mshtml/mshtml_private.h
View file @
726312c5
...
...
@@ -237,7 +237,7 @@ typedef struct {
typedef
struct
{
DispatchEx
dispex
;
const
IHTMLImageElementFactoryVtbl
*
lpHTMLImageElementFactoryVtbl
;
IHTMLImageElementFactory
IHTMLImageElementFactory_iface
;
LONG
ref
;
...
...
@@ -634,7 +634,6 @@ struct HTMLDocumentNode {
#define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
#define HTMLIMGFACTORY(x) ((IHTMLImageElementFactory*) &(x)->lpHTMLImageElementFactoryVtbl)
#define HTMLLOCATION(x) ((IHTMLLocation*) &(x)->lpHTMLLocationVtbl)
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
...
...
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