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
af178856
Commit
af178856
authored
Mar 07, 2004
by
Cyril Deguet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all: the tooltip window is now managed by the window manager, not
by the generic windows
parent
bf0685f8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
38 deletions
+75
-38
modules/gui/skins2/parser/builder.cpp
modules/gui/skins2/parser/builder.cpp
+9
-7
modules/gui/skins2/src/generic_window.cpp
modules/gui/skins2/src/generic_window.cpp
+5
-15
modules/gui/skins2/src/generic_window.hpp
modules/gui/skins2/src/generic_window.hpp
+0
-7
modules/gui/skins2/src/window_manager.cpp
modules/gui/skins2/src/window_manager.cpp
+43
-0
modules/gui/skins2/src/window_manager.hpp
modules/gui/skins2/src/window_manager.hpp
+18
-9
No files found.
modules/gui/skins2/parser/builder.cpp
View file @
af178856
...
...
@@ -110,9 +110,14 @@ Theme *Builder::build()
void
Builder
::
addTheme
(
const
BuilderData
::
Theme
&
rData
)
{
m_pTheme
->
getWindowManager
().
setMagnetValue
(
rData
.
m_magnet
);
m_pTheme
->
getWindowManager
().
setAlphaValue
(
rData
.
m_alpha
);
m_pTheme
->
getWindowManager
().
setMoveAlphaValue
(
rData
.
m_moveAlpha
);
WindowManager
&
rManager
=
m_pTheme
->
getWindowManager
();
rManager
.
setMagnetValue
(
rData
.
m_magnet
);
rManager
.
setAlphaValue
(
rData
.
m_alpha
);
rManager
.
setMoveAlphaValue
(
rData
.
m_moveAlpha
);
// XXX: font to fix
GenericFont
*
pFont
=
new
FT2Font
(
getIntf
(),
"FreeSans.ttf"
,
12
);
pFont
->
init
();
rManager
.
createTooltip
(
*
pFont
);
}
...
...
@@ -135,12 +140,9 @@ void Builder::addFont( const BuilderData::Font &rData )
void
Builder
::
addWindow
(
const
BuilderData
::
Window
&
rData
)
{
// XXX: font to fix
GenericFont
*
pFont
=
new
FT2Font
(
getIntf
(),
"FreeSans.ttf"
,
12
);
pFont
->
init
();
GenericWindow
*
pWin
=
new
GenericWindow
(
getIntf
(),
rData
.
m_xPos
,
rData
.
m_yPos
,
m_pTheme
->
getWindowManager
(),
*
pFont
,
m_pTheme
->
getWindowManager
(),
rData
.
m_dragDrop
,
rData
.
m_playOnDrop
);
m_pTheme
->
m_windows
[
rData
.
m_id
]
=
GenericWindowPtr
(
pWin
);
...
...
modules/gui/skins2/src/generic_window.cpp
View file @
af178856
...
...
@@ -28,8 +28,6 @@
#include "os_window.hpp"
#include "os_factory.hpp"
#include "theme.hpp"
#include "ft2_font.hpp"
#include "tooltip.hpp"
#include "dialogs.hpp"
#include "var_manager.hpp"
#include "../commands/cmd_on_top.hpp"
...
...
@@ -51,7 +49,6 @@
GenericWindow
::
GenericWindow
(
intf_thread_t
*
pIntf
,
int
left
,
int
top
,
WindowManager
&
rWindowManager
,
const
GenericFont
&
rTipFont
,
bool
dragDrop
,
bool
playOnDrop
)
:
SkinObject
(
pIntf
),
m_rWindowManager
(
rWindowManager
),
m_left
(
left
),
m_top
(
top
),
m_width
(
0
),
m_height
(
0
),
...
...
@@ -67,9 +64,6 @@ GenericWindow::GenericWindow( intf_thread_t *pIntf, int left, int top,
// Create an OSWindow to handle OS specific processing
m_pOsWindow
=
pOsFactory
->
createOSWindow
(
*
this
,
dragDrop
,
playOnDrop
);
// Create the tooltip window
m_pTooltip
=
new
Tooltip
(
getIntf
(),
rTipFont
,
500
);
// Observe the visibility variable
m_varVisible
.
addObserver
(
this
);
}
...
...
@@ -81,10 +75,6 @@ GenericWindow::~GenericWindow()
// Unregister from the window manager
m_rWindowManager
.
unregisterWindow
(
*
this
);
if
(
m_pTooltip
)
{
delete
m_pTooltip
;
}
if
(
m_pOsWindow
)
{
delete
m_pOsWindow
;
...
...
@@ -140,7 +130,7 @@ void GenericWindow::processEvent( EvtLeave &rEvtLeave )
if
(
!
m_pCapturingControl
)
{
m_
pTooltip
->
hide
();
m_
rWindowManager
.
hideTooltip
();
}
}
...
...
@@ -419,14 +409,14 @@ void GenericWindow::onControlRelease( const CtrlGeneric &rCtrl )
m_pLastHitControl
->
handleEvent
(
evt
);
// Show the tooltip
m_
pTooltip
->
hide
();
m_
rWindowManager
.
hideTooltip
();
UString
tipText
=
m_pLastHitControl
->
getTooltipText
();
if
(
tipText
.
length
()
>
0
)
{
// Set the tooltip text variable
VarManager
*
pVarManager
=
VarManager
::
instance
(
getIntf
()
);
pVarManager
->
getTooltipText
().
set
(
tipText
);
m_
pTooltip
->
show
();
m_
rWindowManager
.
showTooltip
();
}
}
}
...
...
@@ -533,14 +523,14 @@ CtrlGeneric *GenericWindow::findHitControl( int xPos, int yPos )
if
(
!
m_pCapturingControl
)
{
// Show the tooltip
m_
pTooltip
->
hide
();
m_
rWindowManager
.
hideTooltip
();
UString
tipText
=
pNewHitControl
->
getTooltipText
();
if
(
tipText
.
length
()
>
0
)
{
// Set the tooltip text variable
VarManager
*
pVarManager
=
VarManager
::
instance
(
getIntf
()
);
pVarManager
->
getTooltipText
().
set
(
tipText
);
m_
pTooltip
->
show
();
m_
rWindowManager
.
showTooltip
();
}
}
}
...
...
modules/gui/skins2/src/generic_window.hpp
View file @
af178856
...
...
@@ -34,7 +34,6 @@ class Anchor;
class
OSWindow
;
class
OSGraphics
;
class
GenericLayout
;
class
Tooltip
;
class
CtrlGeneric
;
class
EvtGeneric
;
class
EvtFocus
;
...
...
@@ -44,7 +43,6 @@ class EvtMouse;
class
EvtKey
;
class
EvtRefresh
;
class
EvtScroll
;
class
GenericFont
;
class
WindowManager
;
...
...
@@ -54,7 +52,6 @@ class GenericWindow: public SkinObject, public Observer<VarBool>
public:
GenericWindow
(
intf_thread_t
*
pIntf
,
int
xPos
,
int
yPos
,
WindowManager
&
rWindowManager
,
const
GenericFont
&
rTipFont
,
bool
dragDrop
,
bool
playOnDrop
);
virtual
~
GenericWindow
();
...
...
@@ -141,10 +138,6 @@ class GenericWindow: public SkinObject, public Observer<VarBool>
CtrlGeneric
*
m_pFocusControl
;
/// List of the anchors of this window
list
<
Anchor
*>
m_anchorList
;
/// Font for the tooltip
GenericFont
*
m_pFont
;
/// Tooltip
Tooltip
*
m_pTooltip
;
/// Variable for the visibility of the window
VarBoolImpl
m_varVisible
;
...
...
modules/gui/skins2/src/window_manager.cpp
View file @
af178856
...
...
@@ -26,9 +26,22 @@
#include "generic_window.hpp"
#include "os_factory.hpp"
#include "anchor.hpp"
#include "tooltip.hpp"
#include "../utils/position.hpp"
WindowManager
::
WindowManager
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
),
m_isOnTop
(
false
),
m_magnet
(
0
),
m_pTooltip
(
NULL
)
{
}
WindowManager
::~
WindowManager
()
{
delete
m_pTooltip
;
}
void
WindowManager
::
registerWindow
(
GenericWindow
&
rWindow
)
{
// Add the window to the set
...
...
@@ -307,3 +320,33 @@ void WindowManager::checkAnchors( GenericWindow *pWindow,
}
void
WindowManager
::
createTooltip
(
const
GenericFont
&
rTipFont
)
{
// Create the tooltip window
if
(
!
m_pTooltip
)
{
m_pTooltip
=
new
Tooltip
(
getIntf
(),
rTipFont
,
500
);
}
else
{
msg_Warn
(
getIntf
(),
"Tooltip already created!"
);
}
}
void
WindowManager
::
showTooltip
()
{
if
(
m_pTooltip
)
{
m_pTooltip
->
show
();
}
}
void
WindowManager
::
hideTooltip
()
{
if
(
m_pTooltip
)
{
m_pTooltip
->
hide
();
}
}
modules/gui/skins2/src/window_manager.hpp
View file @
af178856
...
...
@@ -33,16 +33,20 @@
#include <utility>
class
GenericFont
;
class
Anchor
;
class
Tooltip
;
/// Window manager for skin windows
class
WindowManager
:
public
SkinObject
{
public:
WindowManager
(
intf_thread_t
*
pIntf
)
:
SkinObject
(
pIntf
),
m_isOnTop
(
false
),
m_magnet
(
0
)
{}
virtual
~
WindowManager
()
{}
/// Constructor
WindowManager
(
intf_thread_t
*
pIntf
);
/// Destructor
virtual
~
WindowManager
();
/// Add a window to the list of known windows. Necessary if you want
/// your window to be movable...
...
...
@@ -89,6 +93,15 @@ class WindowManager: public SkinObject
/// Set the alpha value of the moving windows
void
setMoveAlphaValue
(
int
moveAlpha
)
{
m_moveAlpha
=
moveAlpha
;
}
/// Create the tooltip window
void
createTooltip
(
const
GenericFont
&
rTipFont
);
/// Show the tooltip window
void
showTooltip
();
/// Hide the tooltip window
void
hideTooltip
();
private:
/// Some useful typedefs for lazy people like me
typedef
set
<
GenericWindow
*>
WinSet_t
;
...
...
@@ -100,25 +113,21 @@ class WindowManager: public SkinObject
/// m_dep[c], it doesn't mean that a is in m_dep[c] (in fact, it
/// would be extremely rare...)
map
<
GenericWindow
*
,
WinSet_t
>
m_dependencies
;
/// Store all the windows
WinSet_t
m_allWindows
;
/// Store the moving windows; this set is updated at every start of
/// move.
WinSet_t
m_movingWindows
;
/// Indicate whether the windows are currently on top
bool
m_isOnTop
;
/// Magnetism of the screen edges (= scope of action)
int
m_magnet
;
/// Alpha value of the static windows
int
m_alpha
;
/// Alpha value of the moving windows
int
m_moveAlpha
;
/// Tooltip
Tooltip
*
m_pTooltip
;
/// Recursively build a set of windows anchored to the one given.
void
buildDependSet
(
WinSet_t
&
rWinSet
,
GenericWindow
*
pWindow
);
...
...
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