Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
b26f433d
Commit
b26f433d
authored
Nov 13, 2005
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* skins2: prevent a window from using the layout of another window
parent
d3bbcab8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
25 deletions
+32
-25
modules/gui/skins2/commands/cmd_layout.cpp
modules/gui/skins2/commands/cmd_layout.cpp
+5
-19
modules/gui/skins2/commands/cmd_layout.hpp
modules/gui/skins2/commands/cmd_layout.hpp
+6
-5
modules/gui/skins2/parser/interpreter.cpp
modules/gui/skins2/parser/interpreter.cpp
+21
-1
No files found.
modules/gui/skins2/commands/cmd_layout.cpp
View file @
b26f433d
...
@@ -28,33 +28,19 @@
...
@@ -28,33 +28,19 @@
#include "../src/theme.hpp"
#include "../src/theme.hpp"
CmdLayout
::
CmdLayout
(
intf_thread_t
*
pIntf
,
const
string
&
windowId
,
CmdLayout
::
CmdLayout
(
intf_thread_t
*
pIntf
,
TopWindow
&
rWindow
,
const
string
&
layoutId
)
:
GenericLayout
&
rLayout
)
:
CmdGeneric
(
pIntf
),
m_
windowId
(
windowId
),
m_layoutId
(
layoutId
)
CmdGeneric
(
pIntf
),
m_
rWindow
(
rWindow
),
m_rLayout
(
rLayout
)
{
{
}
}
void
CmdLayout
::
execute
()
void
CmdLayout
::
execute
()
{
{
// Get the window and the layout
if
(
!
getIntf
()
->
p_sys
->
p_theme
)
if
(
!
getIntf
()
->
p_sys
->
p_theme
)
{
{
return
;
return
;
}
}
TopWindow
*
pWindow
=
getIntf
()
->
p_sys
->
p_theme
->
getWindowManager
().
setActiveLayout
(
m_rWindow
,
getIntf
()
->
p_sys
->
p_theme
->
getWindowById
(
m_windowId
);
m_rLayout
);
GenericLayout
*
pLayout
=
getIntf
()
->
p_sys
->
p_theme
->
getLayoutById
(
m_layoutId
);
if
(
!
pWindow
||
!
pLayout
)
{
msg_Err
(
getIntf
(),
"Cannot change layout (%s, %s)"
,
m_windowId
.
c_str
(),
m_layoutId
.
c_str
()
);
return
;
}
// XXX TODO: check that the layout isn't a layout of another window
getIntf
()
->
p_sys
->
p_theme
->
getWindowManager
().
setActiveLayout
(
*
pWindow
,
*
pLayout
);
}
}
modules/gui/skins2/commands/cmd_layout.hpp
View file @
b26f433d
...
@@ -26,15 +26,16 @@
...
@@ -26,15 +26,16 @@
#define CMD_LAYOUT_HPP
#define CMD_LAYOUT_HPP
#include "cmd_generic.hpp"
#include "cmd_generic.hpp"
#include <string>
class
TopWindow
;
class
GenericLayout
;
/// "Change layout" command
/// "Change layout" command
class
CmdLayout
:
public
CmdGeneric
class
CmdLayout
:
public
CmdGeneric
{
{
public:
public:
CmdLayout
(
intf_thread_t
*
pIntf
,
const
string
&
windowId
,
CmdLayout
(
intf_thread_t
*
pIntf
,
TopWindow
&
rWindow
,
const
string
&
layoutId
);
GenericLayout
&
rLayout
);
virtual
~
CmdLayout
()
{}
virtual
~
CmdLayout
()
{}
/// This method does the real job of the command
/// This method does the real job of the command
...
@@ -44,8 +45,8 @@ class CmdLayout: public CmdGeneric
...
@@ -44,8 +45,8 @@ class CmdLayout: public CmdGeneric
virtual
string
getType
()
const
{
return
"change layout"
;
}
virtual
string
getType
()
const
{
return
"change layout"
;
}
private:
private:
string
m_windowId
;
TopWindow
&
m_rWindow
;
string
m_layoutId
;
GenericLayout
&
m_rLayout
;
};
};
#endif
#endif
modules/gui/skins2/parser/interpreter.cpp
View file @
b26f433d
...
@@ -199,7 +199,27 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
...
@@ -199,7 +199,27 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
int
rightPos
=
rAction
.
find
(
")"
,
windowId
.
size
()
+
11
);
int
rightPos
=
rAction
.
find
(
")"
,
windowId
.
size
()
+
11
);
string
layoutId
=
rAction
.
substr
(
windowId
.
size
()
+
11
,
string
layoutId
=
rAction
.
substr
(
windowId
.
size
()
+
11
,
rightPos
-
(
windowId
.
size
()
+
11
)
);
rightPos
-
(
windowId
.
size
()
+
11
)
);
pCommand
=
new
CmdLayout
(
getIntf
(),
windowId
,
layoutId
);
TopWindow
*
pWin
=
pTheme
->
getWindowById
(
windowId
);
GenericLayout
*
pLayout
=
pTheme
->
getLayoutById
(
layoutId
);
if
(
!
pWin
)
{
msg_Err
(
getIntf
(),
"Unknown window (%s)"
,
windowId
.
c_str
()
);
}
else
if
(
!
pLayout
)
{
msg_Err
(
getIntf
(),
"Unknown layout (%s)"
,
layoutId
.
c_str
()
);
}
// Check that the layout doesn't correspond to another window
else
if
(
pWin
!=
pLayout
->
getWindow
()
)
{
msg_Err
(
getIntf
(),
"Layout %s is not associated to window %s"
,
layoutId
.
c_str
(),
windowId
.
c_str
()
);
}
else
{
pCommand
=
new
CmdLayout
(
getIntf
(),
*
pWin
,
*
pLayout
);
}
}
}
else
if
(
rAction
.
find
(
".show()"
)
!=
string
::
npos
)
else
if
(
rAction
.
find
(
".show()"
)
!=
string
::
npos
)
{
{
...
...
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