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
4c640001
Commit
4c640001
authored
Dec 12, 2005
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support interaction in skins2
parent
6d273994
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
2 deletions
+84
-2
modules/gui/skins2/commands/cmd_dialogs.hpp
modules/gui/skins2/commands/cmd_dialogs.hpp
+32
-0
modules/gui/skins2/src/dialogs.cpp
modules/gui/skins2/src/dialogs.cpp
+15
-0
modules/gui/skins2/src/dialogs.hpp
modules/gui/skins2/src/dialogs.hpp
+4
-0
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+19
-0
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/src/vlcproc.hpp
+5
-0
modules/gui/wxwidgets/interface.cpp
modules/gui/wxwidgets/interface.cpp
+9
-2
No files found.
modules/gui/skins2/commands/cmd_dialogs.hpp
View file @
4c640001
...
...
@@ -29,6 +29,7 @@
#include "../src/dialogs.hpp"
#include "cmd_change_skin.hpp"
#include <vlc_interaction.h>
template
<
int
TYPE
=
0
>
class
CmdDialogs
;
...
...
@@ -127,5 +128,36 @@ class CmdDialogs: public CmdGeneric
virtual
string
getType
()
const
{
return
"dialog"
;
}
};
class
CmdInteraction
:
public
CmdGeneric
{
public:
CmdInteraction
(
intf_thread_t
*
pIntf
,
interaction_dialog_t
*
p_dialog
)
:
CmdGeneric
(
pIntf
),
m_pDialog
(
p_dialog
)
{}
virtual
~
CmdInteraction
()
{}
/// This method does the real job of the command
virtual
void
execute
()
{
if
(
m_pDialog
->
i_type
==
INTERACT_PROGRESS
)
{
/// \todo Handle progress in the interface
}
else
{
/// Get the dialogs provider
Dialogs
*
pDialogs
=
Dialogs
::
instance
(
getIntf
()
);
if
(
pDialogs
==
NULL
)
{
return
;
}
pDialogs
->
showInteraction
(
m_pDialog
);
}
}
virtual
string
getType
()
const
{
return
"interaction"
;
}
private:
interaction_dialog_t
*
m_pDialog
;
};
#endif
modules/gui/skins2/src/dialogs.cpp
View file @
4c640001
...
...
@@ -336,3 +336,18 @@ void Dialogs::showPopupMenu( bool bShow )
}
}
void
Dialogs
::
showInteraction
(
interaction_dialog_t
*
p_dialog
)
{
intf_dialog_args_t
*
p_arg
=
(
intf_dialog_args_t
*
)
malloc
(
sizeof
(
intf_dialog_args_t
)
);
memset
(
p_arg
,
0
,
sizeof
(
intf_dialog_args_t
)
);
p_arg
->
p_dialog
=
p_dialog
;
p_arg
->
p_intf
=
getIntf
();
if
(
m_pProvider
&&
m_pProvider
->
pf_show_dialog
)
{
m_pProvider
->
pf_show_dialog
(
m_pProvider
,
INTF_DIALOG_INTERACTION
,
0
,
p_arg
);
}
}
modules/gui/skins2/src/dialogs.hpp
View file @
4c640001
...
...
@@ -28,6 +28,7 @@
#include "skin_common.hpp"
#include <string>
struct
interaction_dialog_t
;
// Dialogs provider
class
Dialogs
:
public
SkinObject
...
...
@@ -88,6 +89,9 @@ class Dialogs: public SkinObject
/// Show the popup menu
void
showPopupMenu
(
bool
bShow
);
/// Show an interaction dialog
void
showInteraction
(
interaction_dialog_t
*
);
private:
// Private because it's a singleton
Dialogs
(
intf_thread_t
*
pIntf
);
...
...
modules/gui/skins2/src/vlcproc.cpp
View file @
4c640001
...
...
@@ -38,6 +38,7 @@
#include "../commands/cmd_quit.hpp"
#include "../commands/cmd_resize.hpp"
#include "../commands/cmd_vars.hpp"
#include "../commands/cmd_dialogs.hpp"
#include "../utils/var_bool.hpp"
#include <sstream>
...
...
@@ -140,6 +141,11 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
// Called when our skins2 demux wants us to load a new skin
var_AddCallback
(
pIntf
,
"skin-to-load"
,
onSkinToLoad
,
this
);
// Called when we have an interaction dialog to display
var_Create
(
pIntf
,
"interaction"
,
VLC_VAR_ADDRESS
);
var_AddCallback
(
pIntf
,
"interaction"
,
onInteraction
,
this
);
pIntf
->
b_interaction
=
VLC_TRUE
;
// Callbacks for vout requests
getIntf
()
->
pf_request_window
=
&
getWindow
;
getIntf
()
->
pf_release_window
=
&
releaseWindow
;
...
...
@@ -483,6 +489,19 @@ int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
return
VLC_SUCCESS
;
}
int
VlcProc
::
onInteraction
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
)
{
VlcProc
*
pThis
=
(
VlcProc
*
)
pParam
;
interaction_dialog_t
*
p_dialog
=
(
interaction_dialog_t
*
)(
newVal
.
p_address
);
CmdInteraction
*
pCmd
=
new
CmdInteraction
(
pThis
->
getIntf
(),
p_dialog
);
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pThis
->
getIntf
()
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
return
VLC_SUCCESS
;
}
void
VlcProc
::
updateStreamName
(
playlist_t
*
p_playlist
)
{
...
...
modules/gui/skins2/src/vlcproc.hpp
View file @
4c640001
...
...
@@ -183,6 +183,11 @@ class VlcProc: public SkinObject
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
);
/// Callback for interaction variable
static
int
onInteraction
(
vlc_object_t
*
pObj
,
const
char
*
pVariable
,
vlc_value_t
oldVal
,
vlc_value_t
newVal
,
void
*
pParam
);
/// Callback to request a vout window
static
void
*
getWindow
(
intf_thread_t
*
pIntf
,
vout_thread_t
*
pVout
,
int
*
pXHint
,
int
*
pYHint
,
...
...
modules/gui/wxwidgets/interface.cpp
View file @
4c640001
...
...
@@ -1206,8 +1206,15 @@ void Interface::OnInteraction( wxCommandEvent& event )
p_arg
->
p_dialog
=
p_dialog
;
p_arg
->
p_intf
=
p_intf
;
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_INTERACTION
,
0
,
p_arg
);
if
(
p_dialog
->
i_type
==
INTERACT_PROGRESS
)
{
/// \todo Handle progress in the interface
}
else
{
p_intf
->
p_sys
->
pf_show_dialog
(
p_intf
,
INTF_DIALOG_INTERACTION
,
0
,
p_arg
);
}
}
static
int
InteractCallback
(
vlc_object_t
*
p_this
,
...
...
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