Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
52d743a2
Commit
52d743a2
authored
Apr 22, 2005
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* skins2: Added support for multiple actions (separated by ";"),
wherever one action was allowed
parent
77cbc1da
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
120 additions
and
1 deletion
+120
-1
modules/gui/skins2/Modules.am
modules/gui/skins2/Modules.am
+2
-0
modules/gui/skins2/commands/cmd_muxer.cpp
modules/gui/skins2/commands/cmd_muxer.cpp
+34
-0
modules/gui/skins2/commands/cmd_muxer.hpp
modules/gui/skins2/commands/cmd_muxer.hpp
+50
-0
modules/gui/skins2/parser/interpreter.cpp
modules/gui/skins2/parser/interpreter.cpp
+34
-1
No files found.
modules/gui/skins2/Modules.am
View file @
52d743a2
...
...
@@ -14,6 +14,8 @@ SOURCES_skins2 = \
commands/cmd_input.hpp \
commands/cmd_layout.cpp \
commands/cmd_layout.hpp \
commands/cmd_muxer.cpp \
commands/cmd_muxer.hpp \
commands/cmd_on_top.cpp \
commands/cmd_on_top.hpp \
commands/cmd_playlist.cpp \
...
...
modules/gui/skins2/commands/cmd_muxer.cpp
0 → 100644
View file @
52d743a2
/*****************************************************************************
* cmd_muxer.cpp
*****************************************************************************
* Copyright (C) 2005 VideoLAN
* $Id$
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "cmd_muxer.hpp"
void
CmdMuxer
::
execute
()
{
list
<
CmdGeneric
*>::
const_iterator
it
;
for
(
it
=
m_list
.
begin
();
it
!=
m_list
.
end
();
it
++
)
{
(
*
it
)
->
execute
();
}
}
modules/gui/skins2/commands/cmd_muxer.hpp
0 → 100644
View file @
52d743a2
/*****************************************************************************
* cmd_muxer.hpp
*****************************************************************************
* Copyright (C) 2005 VideoLAN
* $Id$
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef CMD_MUXER_HPP
#define CMD_MUXER_HPP
#include "cmd_generic.hpp"
#include <list>
/// This command only contains other commands (composite pattern)
class
CmdMuxer
:
public
CmdGeneric
{
public:
CmdMuxer
(
intf_thread_t
*
pIntf
,
const
list
<
CmdGeneric
*>
&
rList
)
:
CmdGeneric
(
pIntf
),
m_list
(
rList
)
{}
virtual
~
CmdMuxer
()
{}
/// This method does the real job of the command
virtual
void
execute
();
/// Return the type of the command
virtual
string
getType
()
const
{
return
"muxer"
;
}
private:
/// List of commands we will execute sequentially
list
<
CmdGeneric
*>
m_list
;
};
#endif
modules/gui/skins2/parser/interpreter.cpp
View file @
52d743a2
...
...
@@ -24,6 +24,7 @@
#include "interpreter.hpp"
#include "expr_evaluator.hpp"
#include "../commands/cmd_muxer.hpp"
#include "../commands/cmd_playlist.hpp"
#include "../commands/cmd_dialogs.hpp"
#include "../commands/cmd_dummy.hpp"
...
...
@@ -133,7 +134,35 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
CmdGeneric
*
pCommand
=
NULL
;
if
(
rAction
.
find
(
".setLayout("
)
!=
string
::
npos
)
if
(
rAction
.
find
(
";"
)
!=
string
::
npos
)
{
// Several actions are defined...
list
<
CmdGeneric
*>
actionList
;
string
rightPart
=
rAction
;
string
::
size_type
pos
=
rightPart
.
find
(
";"
);
while
(
pos
!=
string
::
npos
)
{
string
leftPart
=
rightPart
.
substr
(
0
,
rightPart
.
find
(
";"
)
);
// Remove any whitespace at the end of the left part, and parse it
leftPart
=
leftPart
.
substr
(
0
,
leftPart
.
find_last_not_of
(
"
\t
"
)
+
1
);
actionList
.
push_back
(
parseAction
(
leftPart
,
pTheme
)
);
// Now remove any whitespace at the beginning of the right part,
// and go on checking for further actions in it...
rightPart
=
rightPart
.
substr
(
pos
,
rightPart
.
size
()
);
rightPart
=
rightPart
.
substr
(
rightPart
.
find_first_not_of
(
"
\t
;"
),
rightPart
.
size
()
);
pos
=
rightPart
.
find
(
";"
);
}
actionList
.
push_back
(
parseAction
(
rightPart
,
pTheme
)
);
// The list is filled, we remove NULL pointers from it, just in case...
actionList
.
remove
(
NULL
);
pCommand
=
new
CmdMuxer
(
getIntf
(),
actionList
);
}
else
if
(
rAction
.
find
(
".setLayout("
)
!=
string
::
npos
)
{
int
leftPos
=
rAction
.
find
(
".setLayout("
);
string
windowId
=
rAction
.
substr
(
0
,
leftPos
);
...
...
@@ -179,6 +208,10 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
// Add the command in the pool
pTheme
->
m_commands
.
push_back
(
CmdGenericPtr
(
pCommand
)
);
}
else
{
msg_Warn
(
getIntf
(),
"Unknown action: %s"
,
rAction
.
c_str
()
);
}
return
pCommand
;
}
...
...
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