Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
4de9a2e2
Commit
4de9a2e2
authored
Jun 12, 2009
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: improve resizing when multiple layers are used and solve zoom misfunctioning in this case
parent
811af572
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
20 deletions
+52
-20
modules/gui/skins2/commands/cmd_resize.cpp
modules/gui/skins2/commands/cmd_resize.cpp
+14
-5
modules/gui/skins2/commands/cmd_resize.hpp
modules/gui/skins2/commands/cmd_resize.hpp
+3
-3
modules/gui/skins2/controls/ctrl_video.cpp
modules/gui/skins2/controls/ctrl_video.cpp
+3
-3
modules/gui/skins2/controls/ctrl_video.hpp
modules/gui/skins2/controls/ctrl_video.hpp
+2
-1
modules/gui/skins2/src/vout_manager.cpp
modules/gui/skins2/src/vout_manager.cpp
+24
-7
modules/gui/skins2/src/vout_window.hpp
modules/gui/skins2/src/vout_window.hpp
+6
-1
No files found.
modules/gui/skins2/commands/cmd_resize.cpp
View file @
4de9a2e2
...
@@ -46,9 +46,9 @@ void CmdResize::execute()
...
@@ -46,9 +46,9 @@ void CmdResize::execute()
}
}
CmdResizeVout
::
CmdResizeVout
(
intf_thread_t
*
pIntf
,
void
*
pWindow
,
int
width
,
CmdResizeVout
::
CmdResizeVout
(
intf_thread_t
*
pIntf
,
VoutWindow
*
pVoutWindow
,
int
height
)
:
int
width
,
int
height
)
:
CmdGeneric
(
pIntf
),
m_p
Window
(
p
Window
),
m_width
(
width
),
CmdGeneric
(
pIntf
),
m_p
VoutWindow
(
pVout
Window
),
m_width
(
width
),
m_height
(
height
)
m_height
(
height
)
{
{
}
}
...
@@ -56,8 +56,17 @@ CmdResizeVout::CmdResizeVout( intf_thread_t *pIntf, void *pWindow, int width,
...
@@ -56,8 +56,17 @@ CmdResizeVout::CmdResizeVout( intf_thread_t *pIntf, void *pWindow, int width,
void
CmdResizeVout
::
execute
()
void
CmdResizeVout
::
execute
()
{
{
VarBox
&
rVoutSize
=
VlcProc
::
instance
(
getIntf
()
)
->
getVoutSizeVar
();
if
(
m_pVoutWindow
)
rVoutSize
.
setSize
(
m_width
,
m_height
);
{
m_pVoutWindow
->
setOriginalWidth
(
m_width
);
m_pVoutWindow
->
setOriginalHeight
(
m_height
);
CtrlVideo
*
pCtrlVideo
=
m_pVoutWindow
->
getCtrlVideo
();
if
(
pCtrlVideo
)
{
pCtrlVideo
->
resizeControl
(
m_width
,
m_height
);
}
}
}
}
...
...
modules/gui/skins2/commands/cmd_resize.hpp
View file @
4de9a2e2
...
@@ -61,8 +61,8 @@ class CmdResizeVout: public CmdGeneric
...
@@ -61,8 +61,8 @@ class CmdResizeVout: public CmdGeneric
{
{
public:
public:
/// Resize the given layout
/// Resize the given layout
CmdResizeVout
(
intf_thread_t
*
pIntf
,
void
*
pWindow
,
int
width
,
CmdResizeVout
(
intf_thread_t
*
pIntf
,
VoutWindow
*
pVoutWindow
,
int
height
);
int
width
,
int
height
);
virtual
~
CmdResizeVout
()
{}
virtual
~
CmdResizeVout
()
{}
/// This method does the real job of the command
/// This method does the real job of the command
...
@@ -72,7 +72,7 @@ class CmdResizeVout: public CmdGeneric
...
@@ -72,7 +72,7 @@ class CmdResizeVout: public CmdGeneric
virtual
string
getType
()
const
{
return
"resize vout"
;
}
virtual
string
getType
()
const
{
return
"resize vout"
;
}
private:
private:
void
*
m_p
Window
;
VoutWindow
*
m_pVout
Window
;
int
m_width
,
m_height
;
int
m_width
,
m_height
;
};
};
...
...
modules/gui/skins2/controls/ctrl_video.cpp
View file @
4de9a2e2
...
@@ -187,10 +187,10 @@ void CtrlVideo::onUpdate( Subject<VarBool> &rVariable, void *arg )
...
@@ -187,10 +187,10 @@ void CtrlVideo::onUpdate( Subject<VarBool> &rVariable, void *arg )
}
}
}
}
void
CtrlVideo
::
attachVoutWindow
(
VoutWindow
*
pVoutWindow
)
void
CtrlVideo
::
attachVoutWindow
(
VoutWindow
*
pVoutWindow
,
int
width
,
int
height
)
{
{
int
width
=
pVoutWindow
->
getOriginalWidth
()
;
width
=
(
width
<
0
)
?
pVoutWindow
->
getOriginalWidth
()
:
width
;
int
height
=
pVoutWindow
->
getOriginalHeight
()
;
height
=
(
height
<
0
)
?
pVoutWindow
->
getOriginalHeight
()
:
height
;
WindowManager
&
rWindowManager
=
WindowManager
&
rWindowManager
=
getIntf
()
->
p_sys
->
p_theme
->
getWindowManager
();
getIntf
()
->
p_sys
->
p_theme
->
getWindowManager
();
...
...
modules/gui/skins2/controls/ctrl_video.hpp
View file @
4de9a2e2
...
@@ -63,7 +63,8 @@ class CtrlVideo: public CtrlGeneric, public Observer<VarBox>
...
@@ -63,7 +63,8 @@ class CtrlVideo: public CtrlGeneric, public Observer<VarBox>
virtual
void
onUpdate
(
Subject
<
VarBool
>
&
rVariable
,
void
*
);
virtual
void
onUpdate
(
Subject
<
VarBool
>
&
rVariable
,
void
*
);
// Attach a voutWindow to a Video Control
// Attach a voutWindow to a Video Control
void
attachVoutWindow
(
VoutWindow
*
pVoutWindow
);
void
attachVoutWindow
(
VoutWindow
*
pVoutWindow
,
int
width
=
-
1
,
int
height
=
-
1
);
// Detach a voutWindow from a Video Control
// Detach a voutWindow from a Video Control
void
detachVoutWindow
(
);
void
detachVoutWindow
(
);
...
...
modules/gui/skins2/src/vout_manager.cpp
View file @
4de9a2e2
...
@@ -154,7 +154,8 @@ void VoutManager::requestVout( CtrlVideo* pCtrlVideo )
...
@@ -154,7 +154,8 @@ void VoutManager::requestVout( CtrlVideo* pCtrlVideo )
{
{
if
(
(
*
it
).
pCtrlVideo
==
NULL
)
if
(
(
*
it
).
pCtrlVideo
==
NULL
)
{
{
pCtrlVideo
->
attachVoutWindow
(
(
*
it
).
pVoutWindow
);
pCtrlVideo
->
attachVoutWindow
(
(
*
it
).
pVoutWindow
,
(
*
it
).
width
,
(
*
it
).
height
);
(
*
it
).
pCtrlVideo
=
pCtrlVideo
;
(
*
it
).
pCtrlVideo
=
pCtrlVideo
;
break
;
break
;
}
}
...
@@ -274,6 +275,7 @@ int VoutManager::controlWindow( struct vout_window_t *pWnd,
...
@@ -274,6 +275,7 @@ int VoutManager::controlWindow( struct vout_window_t *pWnd,
{
{
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
pWnd
->
p_private
;
intf_thread_t
*
pIntf
=
(
intf_thread_t
*
)
pWnd
->
p_private
;
VoutManager
*
pThis
=
pIntf
->
p_sys
->
p_voutManager
;
VoutManager
*
pThis
=
pIntf
->
p_sys
->
p_voutManager
;
vout_thread_t
*
pVout
=
pWnd
->
vout
;
switch
(
query
)
switch
(
query
)
{
{
...
@@ -284,12 +286,27 @@ int VoutManager::controlWindow( struct vout_window_t *pWnd,
...
@@ -284,12 +286,27 @@ int VoutManager::controlWindow( struct vout_window_t *pWnd,
if
(
i_width
&&
i_height
)
if
(
i_width
&&
i_height
)
{
{
// Post a resize vout command
pThis
->
lockVout
();
vector
<
SavedVout
>::
iterator
it
;
for
(
it
=
pThis
->
m_SavedVoutVec
.
begin
();
it
!=
pThis
->
m_SavedVoutVec
.
end
();
it
++
)
{
if
(
(
*
it
).
pVout
==
pVout
)
{
// Post a vout resize command
CmdResizeVout
*
pCmd
=
CmdResizeVout
*
pCmd
=
new
CmdResizeVout
(
pThis
->
getIntf
(),
pWnd
->
handle
.
hwnd
,
new
CmdResizeVout
(
pThis
->
getIntf
(),
i_width
,
i_height
);
(
*
it
).
pVoutWindow
,
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pThis
->
getIntf
()
);
(
int
)
i_width
,
(
int
)
i_height
);
AsyncQueue
*
pQueue
=
AsyncQueue
::
instance
(
pThis
->
getIntf
()
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
pQueue
->
push
(
CmdGenericPtr
(
pCmd
)
);
break
;
}
}
pThis
->
unlockVout
();
}
}
}
}
...
...
modules/gui/skins2/src/vout_window.hpp
View file @
4de9a2e2
...
@@ -59,13 +59,18 @@ class VoutWindow: private GenericWindow
...
@@ -59,13 +59,18 @@ class VoutWindow: private GenericWindow
/// Refresh an area of the window
/// Refresh an area of the window
virtual
void
refresh
(
int
left
,
int
top
,
int
width
,
int
height
);
virtual
void
refresh
(
int
left
,
int
top
,
int
width
,
int
height
);
/// set Video Control for VoutWindow
/// set
and get
Video Control for VoutWindow
virtual
void
setCtrlVideo
(
CtrlVideo
*
pCtrlVideo
);
virtual
void
setCtrlVideo
(
CtrlVideo
*
pCtrlVideo
);
virtual
CtrlVideo
*
getCtrlVideo
(
)
{
return
m_pCtrlVideo
;
}
/// get original size of vout
/// get original size of vout
virtual
int
getOriginalWidth
(
)
{
return
original_width
;
}
virtual
int
getOriginalWidth
(
)
{
return
original_width
;
}
virtual
int
getOriginalHeight
(
)
{
return
original_height
;
}
virtual
int
getOriginalHeight
(
)
{
return
original_height
;
}
/// set original size of vout
virtual
void
setOriginalWidth
(
int
width
)
{
original_width
=
width
;
}
virtual
void
setOriginalHeight
(
int
height
)
{
original_height
=
height
;
}
virtual
string
getType
()
const
{
return
"Vout"
;
}
virtual
string
getType
()
const
{
return
"Vout"
;
}
private:
private:
...
...
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