Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2c8bd7d8
Commit
2c8bd7d8
authored
Mar 11, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt: support for Qt5 windows build
parent
f00c837f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
11 deletions
+66
-11
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+16
-2
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+1
-0
modules/gui/qt4/main_interface_win32.cpp
modules/gui/qt4/main_interface_win32.cpp
+41
-7
modules/gui/qt4/qt4.cpp
modules/gui/qt4/qt4.cpp
+8
-2
No files found.
modules/gui/qt4/main_interface.cpp
View file @
2c8bd7d8
...
...
@@ -63,6 +63,12 @@
#include <vlc_keys.h>
/* Wheel event */
#include <vlc_vout_display.h>
/* vout_thread_t and VOUT_ events */
#if QT_VERSION >= 0x050000
#include <QWindow>
#include <qpa/qplatformnativeinterface.h>
#endif
// #define DEBUG_INTF
/* Callback prototypes */
...
...
@@ -1102,10 +1108,18 @@ void MainInterface::toggleUpdateSystrayMenu()
/* check if any visible window is above vlc in the z-order,
* but ignore the ones always on top
* and the ones which can't be activated */
HWND
winId
;
#if QT_VERSION >= 0x050000
QWindow
*
window
=
windowHandle
();
winId
=
static_cast
<
HWND
>
(
QGuiApplication
::
platformNativeInterface
()
->
nativeResourceForWindow
(
"handle"
,
window
));
#else
winId
=
internalWinId
();
#endif
WINDOWINFO
wi
;
HWND
hwnd
;
wi
.
cbSize
=
sizeof
(
WINDOWINFO
);
for
(
hwnd
=
GetNextWindow
(
internalWinId
()
,
GW_HWNDPREV
);
for
(
hwnd
=
GetNextWindow
(
winId
,
GW_HWNDPREV
);
hwnd
&&
(
!
IsWindowVisible
(
hwnd
)
||
(
GetWindowInfo
(
hwnd
,
&
wi
)
&&
(
wi
.
dwExStyle
&
WS_EX_NOACTIVATE
)
)
);
...
...
@@ -1121,7 +1135,7 @@ void MainInterface::toggleUpdateSystrayMenu()
}
#else
hide
();
#endif
#endif
// _WIN32
}
if
(
sysTray
)
VLCMenuBar
::
updateSystrayMenu
(
this
,
p_intf
);
...
...
modules/gui/qt4/main_interface.hpp
View file @
2c8bd7d8
...
...
@@ -175,6 +175,7 @@ private:
bool
b_statusbarVisible
;
#ifdef _WIN32
HWND
WinId
();
HIMAGELIST
himl
;
ITaskbarList3
*
p_taskbl
;
UINT
taskbar_wmsg
;
...
...
modules/gui/qt4/main_interface_win32.cpp
View file @
2c8bd7d8
...
...
@@ -31,6 +31,12 @@
#include <QBitmap>
#include <vlc_windows_interfaces.h>
#if defined(_WIN32) && QT_VERSION >= 0x050000
#include <QWindow>
#include <qpa/qplatformnativeinterface.h>
#endif
#define WM_APPCOMMAND 0x0319
#define APPCOMMAND_VOLUME_MUTE 8
...
...
@@ -72,6 +78,34 @@
#define GET_FLAGS_LPARAM(lParam) (LOWORD(lParam))
#define GET_KEYSTATE_LPARAM(lParam) GET_FLAGS_LPARAM(lParam)
HWND
MainInterface
::
WinId
()
{
#if QT_VERSION >= 0x050000
QWindow
*
window
=
windowHandle
();
HWND
id
=
static_cast
<
HWND
>
(
QGuiApplication
::
platformNativeInterface
()
->
nativeResourceForWindow
(
"handle"
,
window
));
return
id
;
#else
return
winId
();
#endif
}
#if defined(_WIN32) && QT_VERSION < 0x050000
static
const
int
PremultipliedAlpha
=
QPixmap
::
PremultipliedAlpha
;
static
HBITMAP
qt_pixmapToWinHBITMAP
(
const
QPixmap
&
p
,
int
hbitmapFormat
=
0
)
{
return
p
.
toWinHBITMAP
((
enum
QBitmap
::
HBitmapFormat
)
hbitmapFormat
);
}
#else
Q_GUI_EXPORT
HBITMAP
qt_pixmapToWinHBITMAP
(
const
QPixmap
&
p
,
int
hbitmapFormat
=
0
);
enum
HBitmapFormat
{
NoAlpha
,
PremultipliedAlpha
,
Alpha
};
#endif
void
MainInterface
::
createTaskBarButtons
()
{
/*Here is the code for the taskbar thumb buttons
...
...
@@ -104,13 +138,13 @@ void MainInterface::createTaskBarButtons()
QBitmap
mask3
=
img3
.
createMaskFromColor
(
Qt
::
transparent
);
QBitmap
mask4
=
img4
.
createMaskFromColor
(
Qt
::
transparent
);
if
(
-
1
==
ImageList_Add
(
himl
,
img
.
toWinHBITMAP
(
QPixmap
::
PremultipliedAlpha
),
mask
.
toWinHBITMAP
(
)))
if
(
-
1
==
ImageList_Add
(
himl
,
qt_pixmapToWinHBITMAP
(
img
,
PremultipliedAlpha
),
qt_pixmapToWinHBITMAP
(
mask
)))
msg_Err
(
p_intf
,
"First ImageList_Add failed"
);
if
(
-
1
==
ImageList_Add
(
himl
,
img2
.
toWinHBITMAP
(
QPixmap
::
PremultipliedAlpha
),
mask2
.
toWinHBITMAP
(
)))
if
(
-
1
==
ImageList_Add
(
himl
,
qt_pixmapToWinHBITMAP
(
img2
,
PremultipliedAlpha
),
qt_pixmapToWinHBITMAP
(
mask2
)))
msg_Err
(
p_intf
,
"Second ImageList_Add failed"
);
if
(
-
1
==
ImageList_Add
(
himl
,
img3
.
toWinHBITMAP
(
QPixmap
::
PremultipliedAlpha
),
mask3
.
toWinHBITMAP
(
)))
if
(
-
1
==
ImageList_Add
(
himl
,
qt_pixmapToWinHBITMAP
(
img3
,
PremultipliedAlpha
),
qt_pixmapToWinHBITMAP
(
mask3
)))
msg_Err
(
p_intf
,
"Third ImageList_Add failed"
);
if
(
-
1
==
ImageList_Add
(
himl
,
img4
.
toWinHBITMAP
(
QPixmap
::
PremultipliedAlpha
),
mask4
.
toWinHBITMAP
(
)))
if
(
-
1
==
ImageList_Add
(
himl
,
qt_pixmapToWinHBITMAP
(
img4
,
PremultipliedAlpha
),
qt_pixmapToWinHBITMAP
(
mask4
)))
msg_Err
(
p_intf
,
"Fourth ImageList_Add failed"
);
}
...
...
@@ -134,12 +168,12 @@ void MainInterface::createTaskBarButtons()
thbButtons
[
2
].
iBitmap
=
3
;
thbButtons
[
2
].
dwFlags
=
THBF_HIDDEN
;
HRESULT
hr
=
p_taskbl
->
ThumbBarSetImageList
(
w
inId
(),
himl
);
HRESULT
hr
=
p_taskbl
->
ThumbBarSetImageList
(
W
inId
(),
himl
);
if
(
S_OK
!=
hr
)
msg_Err
(
p_intf
,
"ThumbBarSetImageList failed with error %08lx"
,
hr
);
else
{
hr
=
p_taskbl
->
ThumbBarAddButtons
(
w
inId
(),
3
,
thbButtons
);
hr
=
p_taskbl
->
ThumbBarAddButtons
(
W
inId
(),
3
,
thbButtons
);
if
(
S_OK
!=
hr
)
msg_Err
(
p_intf
,
"ThumbBarAddButtons failed with error %08lx"
,
hr
);
}
...
...
@@ -299,7 +333,7 @@ void MainInterface::changeThumbbarButtons( int i_status )
default:
return
;
}
HRESULT
hr
=
p_taskbl
->
ThumbBarUpdateButtons
(
this
->
w
inId
(),
3
,
thbButtons
);
HRESULT
hr
=
p_taskbl
->
ThumbBarUpdateButtons
(
W
inId
(),
3
,
thbButtons
);
if
(
S_OK
!=
hr
)
msg_Err
(
p_intf
,
"ThumbBarUpdateButtons failed with error %08lx"
,
hr
);
}
modules/gui/qt4/qt4.cpp
View file @
2c8bd7d8
...
...
@@ -51,8 +51,14 @@
#ifdef _WIN32
/* For static builds */
#include <QtPlugin>
#if QT_VERSION >= 0x050000
Q_IMPORT_PLUGIN
(
QWindowsIntegrationPlugin
)
Q_IMPORT_PLUGIN
(
QJpegPlugin
)
Q_IMPORT_PLUGIN
(
AccessibleFactory
)
#else
Q_IMPORT_PLUGIN
(
qjpeg
)
Q_IMPORT_PLUGIN
(
qtaccessiblewidgets
)
#endif
#endif
/*****************************************************************************
...
...
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