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
a8d956b5
Commit
a8d956b5
authored
May 31, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
May 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmp: Added IOleObject::GetExtent and SetExtent implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
23e78c01
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
5 deletions
+79
-5
oleobj.c
dlls/wmp/oleobj.c
+26
-4
Makefile.in
dlls/wmp/tests/Makefile.in
+1
-1
oleobj.c
dlls/wmp/tests/oleobj.c
+51
-0
wmp_private.h
dlls/wmp/wmp_private.h
+1
-0
No files found.
dlls/wmp/oleobj.c
View file @
a8d956b5
...
...
@@ -457,15 +457,27 @@ static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfTyp
static
HRESULT
WINAPI
OleObject_SetExtent
(
IOleObject
*
iface
,
DWORD
dwDrawAspect
,
SIZEL
*
psizel
)
{
WindowsMediaPlayer
*
This
=
impl_from_IOleObject
(
iface
);
FIXME
(
"(%p)->(%d %p)
\n
"
,
This
,
dwDrawAspect
,
psizel
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%d %p)
\n
"
,
This
,
dwDrawAspect
,
psizel
);
if
(
dwDrawAspect
!=
DVASPECT_CONTENT
)
return
DV_E_DVASPECT
;
This
->
extent
=
*
psizel
;
return
S_OK
;
}
static
HRESULT
WINAPI
OleObject_GetExtent
(
IOleObject
*
iface
,
DWORD
dwDrawAspect
,
SIZEL
*
psizel
)
{
WindowsMediaPlayer
*
This
=
impl_from_IOleObject
(
iface
);
FIXME
(
"(%p)->(%d %p)
\n
"
,
This
,
dwDrawAspect
,
psizel
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%d %p)
\n
"
,
This
,
dwDrawAspect
,
psizel
);
if
(
dwDrawAspect
!=
DVASPECT_CONTENT
)
return
E_FAIL
;
*
psizel
=
This
->
extent
;
return
S_OK
;
}
static
HRESULT
WINAPI
OleObject_Advise
(
IOleObject
*
iface
,
IAdviseSink
*
pAdvSink
,
DWORD
*
pdwConnection
)
...
...
@@ -905,6 +917,8 @@ HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory *iface, IUnknown *outer,
REFIID
riid
,
void
**
ppv
)
{
WindowsMediaPlayer
*
wmp
;
DWORD
dpi_x
,
dpi_y
;
HDC
hdc
;
HRESULT
hres
;
TRACE
(
"(%p %s %p)
\n
"
,
outer
,
debugstr_guid
(
riid
),
ppv
);
...
...
@@ -924,6 +938,14 @@ HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory *iface, IUnknown *outer,
init_player_ifaces
(
wmp
);
hdc
=
GetDC
(
0
);
dpi_x
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
);
dpi_y
=
GetDeviceCaps
(
hdc
,
LOGPIXELSY
);
ReleaseDC
(
0
,
hdc
);
wmp
->
extent
.
cx
=
MulDiv
(
192
,
2540
,
dpi_x
);
wmp
->
extent
.
cy
=
MulDiv
(
192
,
2540
,
dpi_y
);
hres
=
IOleObject_QueryInterface
(
&
wmp
->
IOleObject_iface
,
riid
,
ppv
);
IOleObject_Release
(
&
wmp
->
IOleObject_iface
);
return
hres
;
...
...
dlls/wmp/tests/Makefile.in
View file @
a8d956b5
TESTDLL
=
wmp.dll
IMPORTS
=
ole32 oleaut32 user32
IMPORTS
=
ole32 oleaut32 user32
gdi32
C_SRCS
=
oleobj.c
dlls/wmp/tests/oleobj.c
View file @
a8d956b5
...
...
@@ -857,6 +857,56 @@ static void test_QI(IUnknown *unk)
IUnknown_Release
(
tmp
);
}
static
void
test_extent
(
IOleObject
*
oleobj
)
{
SIZE
expected
,
extent
;
DWORD
dpi_x
;
DWORD
dpi_y
;
HDC
hdc
;
HRESULT
hres
;
/* default aspect ratio is 96dpi / 96dpi */
hdc
=
GetDC
(
0
);
dpi_x
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
);
dpi_y
=
GetDeviceCaps
(
hdc
,
LOGPIXELSY
);
ReleaseDC
(
0
,
hdc
);
if
(
dpi_x
!=
96
||
dpi_y
!=
96
)
trace
(
"dpi: %d / %d
\n
"
,
dpi_y
,
dpi_y
);
extent
.
cx
=
extent
.
cy
=
0xdeadbeef
;
hres
=
IOleObject_GetExtent
(
oleobj
,
DVASPECT_CONTENT
,
&
extent
);
ok
(
hres
==
S_OK
,
"GetExtent failed: %08x
\n
"
,
hres
);
expected
.
cx
=
MulDiv
(
192
,
2540
,
dpi_x
);
expected
.
cy
=
MulDiv
(
192
,
2540
,
dpi_y
);
ok
(
extent
.
cx
==
expected
.
cx
&&
extent
.
cy
==
expected
.
cy
,
"size = {%d %d} (expected %d %d)
\n
"
,
extent
.
cx
,
extent
.
cy
,
expected
.
cx
,
expected
.
cy
);
extent
.
cx
=
800
;
extent
.
cy
=
700
;
hres
=
IOleObject_SetExtent
(
oleobj
,
DVASPECT_CONTENT
,
&
extent
);
ok
(
hres
==
S_OK
,
"SetExtent failed: %08x
\n
"
,
hres
);
extent
.
cx
=
extent
.
cy
=
0xdeadbeef
;
hres
=
IOleObject_GetExtent
(
oleobj
,
DVASPECT_CONTENT
,
&
extent
);
ok
(
hres
==
S_OK
,
"GetExtent failed: %08x
\n
"
,
hres
);
ok
(
extent
.
cx
==
800
&&
extent
.
cy
==
700
,
"size = {%d %d}
\n
"
,
extent
.
cx
,
extent
.
cy
);
hres
=
IOleObject_GetExtent
(
oleobj
,
0
,
&
extent
);
ok
(
hres
==
E_FAIL
,
"GetExtent failed: %08x
\n
"
,
hres
);
hres
=
IOleObject_GetExtent
(
oleobj
,
7
,
&
extent
);
ok
(
hres
==
E_FAIL
,
"GetExtent failed: %08x
\n
"
,
hres
);
extent
.
cx
=
900
;
extent
.
cy
=
800
;
hres
=
IOleObject_SetExtent
(
oleobj
,
DVASPECT_CONTENT
,
&
expected
);
ok
(
hres
==
S_OK
,
"SetExtent failed: %08x
\n
"
,
hres
);
hres
=
IOleObject_SetExtent
(
oleobj
,
0
,
&
expected
);
ok
(
hres
==
DV_E_DVASPECT
,
"SetExtent failed: %08x
\n
"
,
hres
);
hres
=
IOleObject_SetExtent
(
oleobj
,
7
,
&
expected
);
ok
(
hres
==
DV_E_DVASPECT
,
"SetExtent failed: %08x
\n
"
,
hres
);
}
static
void
test_wmp
(
void
)
{
IProvideClassInfo2
*
class_info
;
...
...
@@ -902,6 +952,7 @@ static void test_wmp(void)
IProvideClassInfo2_Release
(
class_info
);
test_QI
((
IUnknown
*
)
oleobj
);
test_extent
(
oleobj
);
hres
=
IOleObject_GetMiscStatus
(
oleobj
,
DVASPECT_CONTENT
,
&
misc_status
);
ok
(
hres
==
S_OK
,
"GetMiscStatus failed: %08x
\n
"
,
hres
);
...
...
dlls/wmp/wmp_private.h
View file @
a8d956b5
...
...
@@ -36,6 +36,7 @@ struct WindowsMediaPlayer {
IOleClientSite
*
client_site
;
HWND
hwnd
;
SIZEL
extent
;
};
void
init_player_ifaces
(
WindowsMediaPlayer
*
)
DECLSPEC_HIDDEN
;
...
...
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