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
a05b23aa
Commit
a05b23aa
authored
May 13, 2006
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* skins2: The skins2-systray option can now be changed on the fly
parent
660cc33f
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
163 additions
and
11 deletions
+163
-11
modules/gui/skins2/commands/cmd_minimize.cpp
modules/gui/skins2/commands/cmd_minimize.cpp
+25
-0
modules/gui/skins2/commands/cmd_minimize.hpp
modules/gui/skins2/commands/cmd_minimize.hpp
+3
-0
modules/gui/skins2/macosx/macosx_factory.cpp
modules/gui/skins2/macosx/macosx_factory.cpp
+16
-1
modules/gui/skins2/macosx/macosx_factory.hpp
modules/gui/skins2/macosx/macosx_factory.hpp
+10
-1
modules/gui/skins2/src/os_factory.hpp
modules/gui/skins2/src/os_factory.hpp
+10
-1
modules/gui/skins2/src/skin_main.cpp
modules/gui/skins2/src/skin_main.cpp
+43
-2
modules/gui/skins2/win32/win32_factory.cpp
modules/gui/skins2/win32/win32_factory.cpp
+21
-4
modules/gui/skins2/win32/win32_factory.hpp
modules/gui/skins2/win32/win32_factory.hpp
+10
-1
modules/gui/skins2/x11/x11_factory.cpp
modules/gui/skins2/x11/x11_factory.cpp
+15
-0
modules/gui/skins2/x11/x11_factory.hpp
modules/gui/skins2/x11/x11_factory.hpp
+10
-1
No files found.
modules/gui/skins2/commands/cmd_minimize.cpp
View file @
a05b23aa
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "cmd_minimize.hpp"
#include "cmd_minimize.hpp"
#include "../src/os_factory.hpp"
#include "../src/os_factory.hpp"
void
CmdMinimize
::
execute
()
void
CmdMinimize
::
execute
()
{
{
// Get the instance of OSFactory
// Get the instance of OSFactory
...
@@ -31,3 +32,27 @@ void CmdMinimize::execute()
...
@@ -31,3 +32,27 @@ void CmdMinimize::execute()
pOsFactory
->
minimize
();
pOsFactory
->
minimize
();
}
}
void
CmdRestore
::
execute
()
{
// Get the instance of OSFactory
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
getIntf
()
);
pOsFactory
->
restore
();
}
void
CmdAddInTray
::
execute
()
{
// Get the instance of OSFactory
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
getIntf
()
);
pOsFactory
->
addInTray
();
}
void
CmdRemoveFromTray
::
execute
()
{
// Get the instance of OSFactory
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
getIntf
()
);
pOsFactory
->
removeFromTray
();
}
modules/gui/skins2/commands/cmd_minimize.hpp
View file @
a05b23aa
...
@@ -29,5 +29,8 @@
...
@@ -29,5 +29,8 @@
/// Command to minimize VLC
/// Command to minimize VLC
DEFINE_COMMAND
(
Minimize
,
"minimize"
)
DEFINE_COMMAND
(
Minimize
,
"minimize"
)
DEFINE_COMMAND
(
Restore
,
"restore"
)
DEFINE_COMMAND
(
AddInTray
,
"add in tray"
)
DEFINE_COMMAND
(
RemoveFromTray
,
"remove from tray"
)
#endif
#endif
modules/gui/skins2/macosx/macosx_factory.cpp
View file @
a05b23aa
...
@@ -74,6 +74,21 @@ void MacOSXFactory::minimize()
...
@@ -74,6 +74,21 @@ void MacOSXFactory::minimize()
// TODO
// TODO
}
}
void
MacOSXFactory
::
restore
()
{
// TODO
}
void
MacOSXFactory
::
addInTray
()
{
// TODO
}
void
MacOSXFactory
::
removeFromTray
()
{
// TODO
}
OSTimer
*
MacOSXFactory
::
createOSTimer
(
const
Callback
&
rCallback
)
OSTimer
*
MacOSXFactory
::
createOSTimer
(
const
Callback
&
rCallback
)
{
{
return
new
MacOSXTimer
(
getIntf
(),
rCallback
);
return
new
MacOSXTimer
(
getIntf
(),
rCallback
);
...
...
modules/gui/skins2/macosx/macosx_factory.hpp
View file @
a05b23aa
...
@@ -49,9 +49,18 @@ class MacOSXFactory: public OSFactory
...
@@ -49,9 +49,18 @@ class MacOSXFactory: public OSFactory
/// Instantiate an OSTimer with the given callback
/// Instantiate an OSTimer with the given callback
virtual
OSTimer
*
createOSTimer
(
const
Callback
&
rCallback
);
virtual
OSTimer
*
createOSTimer
(
const
Callback
&
rCallback
);
///
///
Minimize all the windows
virtual
void
minimize
();
virtual
void
minimize
();
/// Restore the minimized windows
virtual
void
restore
();
/// Add an icon in the system tray
virtual
void
addInTray
();
/// Remove the icon from the system tray
virtual
void
removeFromTray
();
/// Instantiate an OSWindow object
/// Instantiate an OSWindow object
virtual
OSWindow
*
createOSWindow
(
GenericWindow
&
rWindow
,
virtual
OSWindow
*
createOSWindow
(
GenericWindow
&
rWindow
,
bool
dragDrop
,
bool
playOnDrop
,
bool
dragDrop
,
bool
playOnDrop
,
...
...
modules/gui/skins2/src/os_factory.hpp
View file @
a05b23aa
...
@@ -78,9 +78,18 @@ class OSFactory: public SkinObject
...
@@ -78,9 +78,18 @@ class OSFactory: public SkinObject
/// Destroy the instance of OSLoop
/// Destroy the instance of OSLoop
virtual
void
destroyOSLoop
()
=
0
;
virtual
void
destroyOSLoop
()
=
0
;
///
///
Minimize all the windows
virtual
void
minimize
()
=
0
;
virtual
void
minimize
()
=
0
;
/// Restore the minimized windows
virtual
void
restore
()
=
0
;
/// Add an icon in the system tray
virtual
void
addInTray
()
=
0
;
/// Remove the icon from the system tray
virtual
void
removeFromTray
()
=
0
;
/// Instantiate an OSTimer with the given command
/// Instantiate an OSTimer with the given command
virtual
OSTimer
*
createOSTimer
(
CmdGeneric
&
rCmd
)
=
0
;
virtual
OSTimer
*
createOSTimer
(
CmdGeneric
&
rCmd
)
=
0
;
...
...
modules/gui/skins2/src/skin_main.cpp
View file @
a05b23aa
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include "../commands/async_queue.hpp"
#include "../commands/async_queue.hpp"
#include "../commands/cmd_quit.hpp"
#include "../commands/cmd_quit.hpp"
#include "../commands/cmd_dialogs.hpp"
#include "../commands/cmd_dialogs.hpp"
#include "../commands/cmd_minimize.hpp"
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
...
@@ -48,7 +49,7 @@ extern "C" __declspec( dllexport )
...
@@ -48,7 +49,7 @@ extern "C" __declspec( dllexport )
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Local prototypes
.
// Local prototypes
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
...
@@ -58,6 +59,13 @@ static int DemuxOpen( vlc_object_t * );
...
@@ -58,6 +59,13 @@ static int DemuxOpen( vlc_object_t * );
static
int
Demux
(
demux_t
*
);
static
int
Demux
(
demux_t
*
);
static
int
DemuxControl
(
demux_t
*
,
int
,
va_list
);
static
int
DemuxControl
(
demux_t
*
,
int
,
va_list
);
//---------------------------------------------------------------------------
// Prototypes for configuration callbacks
//---------------------------------------------------------------------------
static
int
onSystrayChange
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
);
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Open: initialize interface
// Open: initialize interface
...
@@ -337,6 +345,39 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
...
@@ -337,6 +345,39 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
}
}
//---------------------------------------------------------------------------
// Callbacks
//---------------------------------------------------------------------------
/// Callback for the systray configuration option
static
int
onSystrayChange
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
)
{
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
vlc_object_find
(
pObj
,
VLC_OBJECT_INTF
,
FIND_ANYWHERE
);
if
(
pIntf
==
NULL
)
{
return
VLC_EGENERIC
;
}
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pIntf
);
if
(
newVal
.
b_bool
)
{
CmdAddInTray
*
pCmd
=
new
CmdAddInTray
(
pIntf
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
}
else
{
CmdRemoveFromTray
*
pCmd
=
new
CmdRemoveFromTray
(
pIntf
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
}
vlc_object_release
(
pIntf
);
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Module descriptor
// Module descriptor
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
...
@@ -362,7 +403,7 @@ vlc_module_begin();
...
@@ -362,7 +403,7 @@ vlc_module_begin();
VLC_TRUE
);
VLC_TRUE
);
change_autosave
();
change_autosave
();
#ifdef WIN32
#ifdef WIN32
add_bool
(
"skins2-systray"
,
VLC_FALSE
,
NULL
,
SKINS2_SYSTRAY
,
add_bool
(
"skins2-systray"
,
VLC_FALSE
,
onSystrayChange
,
SKINS2_SYSTRAY
,
SKINS2_SYSTRAY_LONG
,
VLC_FALSE
);
SKINS2_SYSTRAY_LONG
,
VLC_FALSE
);
add_bool
(
"skins2-transparency"
,
VLC_FALSE
,
NULL
,
SKINS2_TRANSPARENCY
,
add_bool
(
"skins2-transparency"
,
VLC_FALSE
,
NULL
,
SKINS2_TRANSPARENCY
,
SKINS2_TRANSPARENCY_LONG
,
VLC_FALSE
);
SKINS2_TRANSPARENCY_LONG
,
VLC_FALSE
);
...
...
modules/gui/skins2/win32/win32_factory.cpp
View file @
a05b23aa
...
@@ -33,7 +33,8 @@
...
@@ -33,7 +33,8 @@
#include "win32_loop.hpp"
#include "win32_loop.hpp"
#include "../src/theme.hpp"
#include "../src/theme.hpp"
#include "../src/window_manager.hpp"
#include "../src/window_manager.hpp"
#include "commands/cmd_dialogs.hpp"
#include "../commands/cmd_dialogs.hpp"
#include "../commands/cmd_minimize.hpp"
// Custom message for the notifications of the system tray
// Custom message for the notifications of the system tray
#define MY_WSTRAYACTION (WM_APP + 1)
#define MY_WSTRAYACTION (WM_APP + 1)
...
@@ -92,7 +93,8 @@ LRESULT CALLBACK Win32Proc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
...
@@ -92,7 +93,8 @@ LRESULT CALLBACK Win32Proc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
}
}
else
if
(
(
UINT
)
lParam
==
WM_LBUTTONDBLCLK
)
else
if
(
(
UINT
)
lParam
==
WM_LBUTTONDBLCLK
)
{
{
ShowWindow
(
hwnd
,
SW_RESTORE
);
CmdRestore
aCmdRestore
(
p_intf
);
aCmdRestore
.
execute
();
}
}
}
}
}
}
...
@@ -172,7 +174,7 @@ bool Win32Factory::init()
...
@@ -172,7 +174,7 @@ bool Win32Factory::init()
// Show the systray icon if needed
// Show the systray icon if needed
if
(
config_GetInt
(
getIntf
(),
"skins2-systray"
)
)
if
(
config_GetInt
(
getIntf
(),
"skins2-systray"
)
)
{
{
Shell_NotifyIcon
(
NIM_ADD
,
&
m_trayIcon
);
addInTray
(
);
}
}
// We do it this way otherwise CreateWindowEx will fail
// We do it this way otherwise CreateWindowEx will fail
...
@@ -242,7 +244,7 @@ Win32Factory::~Win32Factory()
...
@@ -242,7 +244,7 @@ Win32Factory::~Win32Factory()
OleUninitialize
();
OleUninitialize
();
// Remove the systray icon
// Remove the systray icon
Shell_NotifyIcon
(
NIM_DELETE
,
&
m_trayIcon
);
removeFromTray
(
);
if
(
m_hParentWindow
)
DestroyWindow
(
m_hParentWindow
);
if
(
m_hParentWindow
)
DestroyWindow
(
m_hParentWindow
);
...
@@ -279,6 +281,21 @@ void Win32Factory::minimize()
...
@@ -279,6 +281,21 @@ void Win32Factory::minimize()
ShowWindow
(
m_hParentWindow
,
SW_MINIMIZE
);
ShowWindow
(
m_hParentWindow
,
SW_MINIMIZE
);
}
}
void
Win32Factory
::
restore
()
{
ShowWindow
(
m_hParentWindow
,
SW_RESTORE
);
}
void
Win32Factory
::
addInTray
()
{
Shell_NotifyIcon
(
NIM_ADD
,
&
m_trayIcon
);
}
void
Win32Factory
::
removeFromTray
()
{
Shell_NotifyIcon
(
NIM_DELETE
,
&
m_trayIcon
);
}
OSTimer
*
Win32Factory
::
createOSTimer
(
CmdGeneric
&
rCmd
)
OSTimer
*
Win32Factory
::
createOSTimer
(
CmdGeneric
&
rCmd
)
{
{
return
new
Win32Timer
(
getIntf
(),
rCmd
,
m_hParentWindow
);
return
new
Win32Timer
(
getIntf
(),
rCmd
,
m_hParentWindow
);
...
...
modules/gui/skins2/win32/win32_factory.hpp
View file @
a05b23aa
...
@@ -54,9 +54,18 @@ class Win32Factory: public OSFactory
...
@@ -54,9 +54,18 @@ class Win32Factory: public OSFactory
/// Destroy the instance of OSLoop
/// Destroy the instance of OSLoop
virtual
void
destroyOSLoop
();
virtual
void
destroyOSLoop
();
///
///
Minimize all the windows
virtual
void
minimize
();
virtual
void
minimize
();
/// Restore the minimized windows
virtual
void
restore
();
/// Add an icon in the system tray
virtual
void
addInTray
();
/// Remove the icon from the system tray
virtual
void
removeFromTray
();
/// Instantiate an OSTimer with the given command
/// Instantiate an OSTimer with the given command
virtual
OSTimer
*
createOSTimer
(
CmdGeneric
&
rCmd
);
virtual
OSTimer
*
createOSTimer
(
CmdGeneric
&
rCmd
);
...
...
modules/gui/skins2/x11/x11_factory.cpp
View file @
a05b23aa
...
@@ -103,6 +103,21 @@ void X11Factory::minimize()
...
@@ -103,6 +103,21 @@ void X11Factory::minimize()
DefaultScreen
(
m_pDisplay
->
getDisplay
()
)
);
DefaultScreen
(
m_pDisplay
->
getDisplay
()
)
);
}
}
void
X11Factory
::
restore
()
{
// TODO
}
void
X11Factory
::
addInTray
()
{
// TODO
}
void
X11Factory
::
removeFromTray
()
{
// TODO
}
OSTimer
*
X11Factory
::
createOSTimer
(
CmdGeneric
&
rCmd
)
OSTimer
*
X11Factory
::
createOSTimer
(
CmdGeneric
&
rCmd
)
{
{
return
new
X11Timer
(
getIntf
(),
rCmd
);
return
new
X11Timer
(
getIntf
(),
rCmd
);
...
...
modules/gui/skins2/x11/x11_factory.hpp
View file @
a05b23aa
...
@@ -62,9 +62,18 @@ class X11Factory: public OSFactory
...
@@ -62,9 +62,18 @@ class X11Factory: public OSFactory
/// Instantiate an OSTimer with the given command
/// Instantiate an OSTimer with the given command
virtual
OSTimer
*
createOSTimer
(
CmdGeneric
&
rCmd
);
virtual
OSTimer
*
createOSTimer
(
CmdGeneric
&
rCmd
);
///
///
Minimize all the windows
virtual
void
minimize
();
virtual
void
minimize
();
/// Restore the minimized windows
virtual
void
restore
();
/// Add an icon in the system tray
virtual
void
addInTray
();
/// Remove the icon from the system tray
virtual
void
removeFromTray
();
/// Instantiate an OSWindow object
/// Instantiate an OSWindow object
virtual
OSWindow
*
createOSWindow
(
GenericWindow
&
rWindow
,
virtual
OSWindow
*
createOSWindow
(
GenericWindow
&
rWindow
,
bool
dragDrop
,
bool
playOnDrop
,
bool
dragDrop
,
bool
playOnDrop
,
...
...
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