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
a9b95148
Commit
a9b95148
authored
Mar 07, 2004
by
Olivier Teulière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* skins2/*: - show/hide do not bypass the window manager anymore
- transformed some pointers into references
parent
1fd23e2c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
44 deletions
+53
-44
modules/gui/skins2/commands/cmd_show_window.hpp
modules/gui/skins2/commands/cmd_show_window.hpp
+14
-7
modules/gui/skins2/controls/ctrl_move.cpp
modules/gui/skins2/controls/ctrl_move.cpp
+3
-3
modules/gui/skins2/parser/interpreter.cpp
modules/gui/skins2/parser/interpreter.cpp
+5
-3
modules/gui/skins2/src/generic_window.cpp
modules/gui/skins2/src/generic_window.cpp
+3
-3
modules/gui/skins2/src/window_manager.cpp
modules/gui/skins2/src/window_manager.cpp
+15
-21
modules/gui/skins2/src/window_manager.hpp
modules/gui/skins2/src/window_manager.hpp
+13
-7
No files found.
modules/gui/skins2/commands/cmd_show_window.hpp
View file @
a9b95148
...
...
@@ -2,7 +2,7 @@
* cmd_show_window.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: cmd_show_window.hpp,v 1.2 2004/01/18 19:54:45 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -27,23 +27,27 @@
#include "cmd_generic.hpp"
#include "../src/generic_window.hpp"
#include "../src/window_manager.hpp"
/// Command to show a window
class
CmdShowWindow
:
public
CmdGeneric
{
public:
CmdShowWindow
(
intf_thread_t
*
pIntf
,
GenericWindow
&
rWin
)
:
CmdGeneric
(
pIntf
),
m_rWin
(
rWin
)
{}
CmdShowWindow
(
intf_thread_t
*
pIntf
,
WindowManager
&
rWinManager
,
GenericWindow
&
rWin
)
:
CmdGeneric
(
pIntf
),
m_rWinManager
(
rWinManager
),
m_rWin
(
rWin
)
{}
virtual
~
CmdShowWindow
()
{}
/// This method does the real job of the command
virtual
void
execute
()
{
m_rWin
.
show
(
);
}
virtual
void
execute
()
{
m_rWin
Manager
.
show
(
m_rWin
);
}
/// Return the type of the command
virtual
string
getType
()
const
{
return
"show window"
;
}
private:
/// Reference to the window manager
WindowManager
&
m_rWinManager
;
/// Reference to the window
GenericWindow
&
m_rWin
;
};
...
...
@@ -53,17 +57,20 @@ class CmdShowWindow: public CmdGeneric
class
CmdHideWindow
:
public
CmdGeneric
{
public:
CmdHideWindow
(
intf_thread_t
*
pIntf
,
GenericWindow
&
rWin
)
:
CmdGeneric
(
pIntf
),
m_rWin
(
rWin
)
{}
CmdHideWindow
(
intf_thread_t
*
pIntf
,
WindowManager
&
rWinManager
,
GenericWindow
&
rWin
)
:
CmdGeneric
(
pIntf
),
m_rWinManager
(
rWinManager
),
m_rWin
(
rWin
)
{}
virtual
~
CmdHideWindow
()
{}
/// This method does the real job of the command
virtual
void
execute
()
{
m_rWin
.
hide
(
);
}
virtual
void
execute
()
{
m_rWin
Manager
.
hide
(
m_rWin
);
}
/// Return the type of the command
virtual
string
getType
()
const
{
return
"hide window"
;
}
private:
/// Reference to the window manager
WindowManager
&
m_rWinManager
;
/// Reference to the window
GenericWindow
&
m_rWin
;
};
...
...
modules/gui/skins2/controls/ctrl_move.cpp
View file @
a9b95148
...
...
@@ -2,7 +2,7 @@
* ctrl_move.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: ctrl_move.cpp,v 1.2 2004/02/29 16:49:55 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -106,7 +106,7 @@ void CtrlMove::transStillMoving( SkinObject *pCtrl )
pThis
->
captureMouse
();
pThis
->
m_rWindowManager
.
startMove
(
&
pThis
->
m_rWindow
);
pThis
->
m_rWindowManager
.
startMove
(
pThis
->
m_rWindow
);
}
...
...
@@ -120,7 +120,7 @@ void CtrlMove::transMovingMoving( SkinObject *pCtrl )
int
yNewTop
=
pEvtMotion
->
getYPos
()
-
pThis
->
m_yPos
+
pThis
->
m_rWindow
.
getTop
();
pThis
->
m_rWindowManager
.
move
(
&
pThis
->
m_rWindow
,
xNewLeft
,
yNewTop
);
pThis
->
m_rWindowManager
.
move
(
pThis
->
m_rWindow
,
xNewLeft
,
yNewTop
);
}
...
...
modules/gui/skins2/parser/interpreter.cpp
View file @
a9b95148
...
...
@@ -2,7 +2,7 @@
* interpreter.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id
: interpreter.cpp,v 1.5 2004/02/01 14:44:11 asmax Exp
$
* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -121,7 +121,8 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
GenericWindow
*
pWin
=
pTheme
->
getWindowById
(
windowId
);
if
(
pWin
)
{
pCommand
=
new
CmdShowWindow
(
getIntf
(),
*
pWin
);
pCommand
=
new
CmdShowWindow
(
getIntf
(),
pTheme
->
getWindowManager
(),
*
pWin
);
}
else
{
...
...
@@ -135,7 +136,8 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
GenericWindow
*
pWin
=
pTheme
->
getWindowById
(
windowId
);
if
(
pWin
)
{
pCommand
=
new
CmdHideWindow
(
getIntf
(),
*
pWin
);
pCommand
=
new
CmdHideWindow
(
getIntf
(),
pTheme
->
getWindowManager
(),
*
pWin
);
}
else
{
...
...
modules/gui/skins2/src/generic_window.cpp
View file @
a9b95148
...
...
@@ -59,7 +59,7 @@ GenericWindow::GenericWindow( intf_thread_t *pIntf, int left, int top,
m_pCapturingControl
(
NULL
),
m_pFocusControl
(
NULL
),
m_varVisible
(
pIntf
)
{
// Register as a moving window
m_rWindowManager
.
registerWindow
(
this
);
m_rWindowManager
.
registerWindow
(
*
this
);
// Get the OSFactory
OSFactory
*
pOsFactory
=
OSFactory
::
instance
(
getIntf
()
);
...
...
@@ -79,7 +79,7 @@ GenericWindow::~GenericWindow()
{
m_varVisible
.
delObserver
(
this
);
// Unregister from the window manager
m_rWindowManager
.
unregisterWindow
(
this
);
m_rWindowManager
.
unregisterWindow
(
*
this
);
if
(
m_pTooltip
)
{
...
...
@@ -156,7 +156,7 @@ void GenericWindow::processEvent( EvtMouse &rEvtMouse )
if
(
rEvtMouse
.
getAction
()
==
EvtMouse
::
kDown
)
{
// Raise all the windows
m_rWindowManager
.
raiseAll
(
this
);
m_rWindowManager
.
raiseAll
(
*
this
);
if
(
pNewHitControl
&&
pNewHitControl
->
isFocusable
()
)
{
...
...
modules/gui/skins2/src/window_manager.cpp
View file @
a9b95148
...
...
@@ -29,33 +29,27 @@
#include "../utils/position.hpp"
void
WindowManager
::
registerWindow
(
GenericWindow
*
p
Window
)
void
WindowManager
::
registerWindow
(
GenericWindow
&
r
Window
)
{
if
(
pWindow
==
NULL
)
{
msg_Dbg
(
getIntf
(),
"WM: registering a NULL window"
);
return
;
}
// Add the window to the set
m_allWindows
.
insert
(
p
Window
);
m_allWindows
.
insert
(
&
r
Window
);
}
void
WindowManager
::
unregisterWindow
(
GenericWindow
*
p
Window
)
void
WindowManager
::
unregisterWindow
(
GenericWindow
&
r
Window
)
{
// Erase every possible reference to the window
m_allWindows
.
erase
(
p
Window
);
m_movingWindows
.
erase
(
p
Window
);
m_dependencies
.
erase
(
p
Window
);
m_allWindows
.
erase
(
&
r
Window
);
m_movingWindows
.
erase
(
&
r
Window
);
m_dependencies
.
erase
(
&
r
Window
);
}
void
WindowManager
::
startMove
(
GenericWindow
*
p
Window
)
void
WindowManager
::
startMove
(
GenericWindow
&
r
Window
)
{
// Rebuild the set of moving windows
m_movingWindows
.
clear
();
buildDependSet
(
m_movingWindows
,
p
Window
);
buildDependSet
(
m_movingWindows
,
&
r
Window
);
// Change the opacity of the moving windows
WinSet_t
::
const_iterator
it
;
...
...
@@ -119,14 +113,14 @@ void WindowManager::stopMove()
}
void
WindowManager
::
move
(
GenericWindow
*
p
Window
,
int
left
,
int
top
)
const
void
WindowManager
::
move
(
GenericWindow
&
r
Window
,
int
left
,
int
top
)
const
{
// Compute the real move offset
int
xOffset
=
left
-
pWindow
->
getLeft
();
int
yOffset
=
top
-
pWindow
->
getTop
();
int
xOffset
=
left
-
rWindow
.
getLeft
();
int
yOffset
=
top
-
rWindow
.
getTop
();
// Check anchoring; this can change the values of xOffset and yOffset
checkAnchors
(
p
Window
,
xOffset
,
yOffset
);
checkAnchors
(
&
r
Window
,
xOffset
,
yOffset
);
// Move all the windows
WinSet_t
::
const_iterator
it
;
...
...
@@ -137,19 +131,19 @@ void WindowManager::move( GenericWindow *pWindow, int left, int top ) const
}
void
WindowManager
::
raiseAll
(
GenericWindow
*
p
Window
)
const
void
WindowManager
::
raiseAll
(
GenericWindow
&
r
Window
)
const
{
// Raise all the windows
WinSet_t
::
const_iterator
it
;
for
(
it
=
m_allWindows
.
begin
();
it
!=
m_allWindows
.
end
();
it
++
)
{
if
(
*
it
!=
p
Window
)
if
(
*
it
!=
&
r
Window
)
{
(
*
it
)
->
raise
();
}
}
// Make sure to raise the given window at the end, so that it is above
pWindow
->
raise
();
rWindow
.
raise
();
}
...
...
modules/gui/skins2/src/window_manager.hpp
View file @
a9b95148
...
...
@@ -26,13 +26,13 @@
#define WINDOW_MANAGER_HPP
#include "skin_common.hpp"
#include "generic_window.hpp"
#include <list>
#include <map>
#include <set>
#include <utility>
class
GenericWindow
;
class
Anchor
;
...
...
@@ -46,13 +46,13 @@ class WindowManager: public SkinObject
/// Add a window to the list of known windows. Necessary if you want
/// your window to be movable...
void
registerWindow
(
GenericWindow
*
p
Window
);
void
registerWindow
(
GenericWindow
&
r
Window
);
/// Remove a previously registered window
void
unregisterWindow
(
GenericWindow
*
p
Window
);
void
unregisterWindow
(
GenericWindow
&
r
Window
);
/// Tell the window manager that a move is initiated for pWindow.
void
startMove
(
GenericWindow
*
p
Window
);
void
startMove
(
GenericWindow
&
r
Window
);
/// Tell the window manager that the current move ended.
void
stopMove
();
...
...
@@ -60,10 +60,10 @@ class WindowManager: public SkinObject
/// Move the pWindow window to (left, top), and move all its
/// anchored windows.
/// If a new anchoring is detected, the windows will move accordingly.
void
move
(
GenericWindow
*
p
Window
,
int
left
,
int
top
)
const
;
void
move
(
GenericWindow
&
r
Window
,
int
left
,
int
top
)
const
;
/// Raise all the windows,
p
Window being above the others
void
raiseAll
(
GenericWindow
*
p
Window
)
const
;
/// Raise all the windows,
r
Window being above the others
void
raiseAll
(
GenericWindow
&
r
Window
)
const
;
/// Show all the registered windows
void
showAll
()
const
;
...
...
@@ -71,6 +71,12 @@ class WindowManager: public SkinObject
/// Hide all the registered windows
void
hideAll
()
const
;
/// Show the given window
void
show
(
GenericWindow
&
rWindow
)
{
rWindow
.
show
();
}
/// Hide the given window
void
hide
(
GenericWindow
&
rWindow
)
{
rWindow
.
hide
();
}
/// Toggle all the windows on top
void
toggleOnTop
();
...
...
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