Commit 296fdee9 authored by Rafaël Carré's avatar Rafaël Carré

Update workarounds for incomplete mingw headers

The so-called "Vista/7 helpers" only define interfaces missing from mingw*

Remove duplicate declarations already in all mingw headers, include the
correct headers instead.

Link video outputs against libuuid to get the existing UUID instead of
defining our own.

Define the C interfaces as Microsoft does it by using lpVtbl for the
virtual table pointer.
See http://blogs.msdn.com/b/oldnewthing/archive/2004/02/05/68017.aspx

Define a C++ interface to TaskbarList3 for qt4, keep the C for video outputs.
Define only a C++ interface to IApplicationAssociationRegistrationUI

Define TaskbarList3->SetTabActive() correctly.
See http://msdn.microsoft.com/en-us/library/windows/desktop/dd391699(v=vs.85).aspx

ifdef the TaskbarList3 interface because mingw-w64 defines it already.
(cherry picked from commit 9394c716)
Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent f33b24f4
......@@ -3267,7 +3267,7 @@ if test "${enable_directx}" != "no"; then
[ VLC_ADD_PLUGIN([direct3d])
VLC_ADD_LIBS([direct3d],[-lgdi32])
])
VLC_ADD_LIBS([direct3d directx glwin32],[-lole32])
VLC_ADD_LIBS([direct3d directx glwin32],[-lole32 -luuid])
fi
fi
......@@ -3297,7 +3297,7 @@ AC_ARG_ENABLE(wingdi,
if test "${enable_wingdi}" != "no"; then
if test "${SYS}" = "mingw32"; then
VLC_ADD_PLUGIN([wingdi])
VLC_ADD_LIBS([wingdi],[-lgdi32 -lole32])
VLC_ADD_LIBS([wingdi],[-lgdi32 -lole32 -luuid])
fi
if test "${SYS}" = "mingwce"; then
VLC_ADD_PLUGIN([wingdi wingapi])
......
This diff is collapsed.
......@@ -925,15 +925,15 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current,
void SPrefsPanel::assoDialog()
{
LPAPPASSOCREGUI p_appassoc;
IApplicationAssociationRegistrationUI *p_appassoc;
CoInitialize( 0 );
if( S_OK == CoCreateInstance( &clsid_IApplication2,
if( S_OK == CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
NULL, CLSCTX_INPROC_SERVER,
IID_IApplicationAssociationRegistrationUI,
(void **)&p_appassoc) )
{
if(S_OK == p_appassoc->vt->LaunchAdvancedAssociationUI(p_appassoc, L"VLC" ) )
if(S_OK == p_appassoc->LaunchAdvancedAssociationUI(L"VLC" ) )
{
CoUninitialize();
return;
......
......@@ -267,7 +267,7 @@ MainInterface::~MainInterface()
if( himl )
ImageList_Destroy( himl );
if(p_taskbl)
p_taskbl->vt->Release(p_taskbl);
p_taskbl->Release();
CoUninitialize();
#endif
......
......@@ -172,7 +172,7 @@ private:
#ifdef WIN32
HIMAGELIST himl;
LPTASKBARLIST3 p_taskbl;
ITaskbarList3 *p_taskbl;
UINT taskbar_wmsg;
void createTaskBarButtons();
#endif
......
......@@ -79,12 +79,12 @@ void MainInterface::createTaskBarButtons()
CoInitialize( 0 );
if( S_OK == CoCreateInstance( &clsid_ITaskbarList,
if( S_OK == CoCreateInstance( CLSID_TaskbarList,
NULL, CLSCTX_INPROC_SERVER,
IID_ITaskbarList3,
(void **)&p_taskbl) )
{
p_taskbl->vt->HrInit(p_taskbl);
p_taskbl->HrInit();
if( (himl = ImageList_Create( 20, //cx
20, //cy
......@@ -114,7 +114,7 @@ void MainInterface::createTaskBarButtons()
// Define an array of two buttons. These buttons provide images through an
// image list and also provide tooltips.
DWORD dwMask = THB_BITMAP | THB_FLAGS;
THUMBBUTTONMASK dwMask = THUMBBUTTONMASK(THB_BITMAP | THB_FLAGS);
THUMBBUTTON thbButtons[3];
thbButtons[0].dwMask = dwMask;
......@@ -132,12 +132,12 @@ void MainInterface::createTaskBarButtons()
thbButtons[2].iBitmap = 3;
thbButtons[2].dwFlags = THBF_HIDDEN;
HRESULT hr = p_taskbl->vt->ThumbBarSetImageList(p_taskbl, winId(), himl );
HRESULT hr = p_taskbl->ThumbBarSetImageList(winId(), himl );
if(S_OK != hr)
msg_Err( p_intf, "ThumbBarSetImageList failed with error %08lx", hr );
else
{
hr = p_taskbl->vt->ThumbBarAddButtons(p_taskbl, winId(), 3, thbButtons);
hr = p_taskbl->ThumbBarAddButtons(winId(), 3, thbButtons);
if(S_OK != hr)
msg_Err( p_intf, "ThumbBarAddButtons failed with error %08lx", hr );
}
......@@ -244,7 +244,7 @@ void MainInterface::changeThumbbarButtons( int i_status )
// Define an array of three buttons. These buttons provide images through an
// image list and also provide tooltips.
DWORD dwMask = THB_BITMAP | THB_FLAGS;
THUMBBUTTONMASK dwMask = THUMBBUTTONMASK(THB_BITMAP | THB_FLAGS);
THUMBBUTTON thbButtons[3];
//prev
......@@ -285,7 +285,7 @@ void MainInterface::changeThumbbarButtons( int i_status )
default:
return;
}
HRESULT hr = p_taskbl->vt->ThumbBarUpdateButtons(p_taskbl, this->winId(), 3, thbButtons);
HRESULT hr = p_taskbl->ThumbBarUpdateButtons(this->winId(), 3, thbButtons);
if(S_OK != hr)
msg_Err( p_intf, "ThumbBarUpdateButtons failed with error %08lx", hr );
}
......@@ -291,12 +291,12 @@ static void CommonChangeThumbnailClip(vout_display_t *vd, bool show)
CoInitialize(0);
void *ptr;
if (S_OK == CoCreateInstance(&clsid_ITaskbarList,
if (S_OK == CoCreateInstance(&CLSID_TaskbarList,
NULL, CLSCTX_INPROC_SERVER,
&IID_ITaskbarList3,
&ptr)) {
LPTASKBARLIST3 taskbl = ptr;
taskbl->vt->HrInit(taskbl);
ITaskbarList3 *taskbl = ptr;
taskbl->lpVtbl->HrInit(taskbl);
HWND hroot = GetAncestor(sys->hwnd,GA_ROOT);
RECT relative;
......@@ -310,11 +310,11 @@ static void CommonChangeThumbnailClip(vout_display_t *vd, bool show)
relative.right = video.right - video.left + relative.left;
relative.bottom = video.bottom - video.top + relative.top - 25;
}
if (S_OK != taskbl->vt->SetThumbnailClip(taskbl, hroot,
if (S_OK != taskbl->lpVtbl->SetThumbnailClip(taskbl, hroot,
show ? &relative : NULL))
msg_Err(vd, "SetThumbNailClip failed");
taskbl->vt->Release(taskbl);
taskbl->lpVtbl->Release(taskbl);
}
CoUninitialize();
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment