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
6adad42a
Commit
6adad42a
authored
Feb 11, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle Page up / Page down (Refs:#477)
parent
d02fbdb8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
6 deletions
+118
-6
modules/gui/skins2/controls/ctrl_tree.cpp
modules/gui/skins2/controls/ctrl_tree.cpp
+48
-1
modules/gui/skins2/utils/var_tree.cpp
modules/gui/skins2/utils/var_tree.cpp
+61
-3
modules/gui/skins2/utils/var_tree.hpp
modules/gui/skins2/utils/var_tree.hpp
+6
-1
modules/gui/skins2/vars/playtree.cpp
modules/gui/skins2/vars/playtree.cpp
+3
-1
No files found.
modules/gui/skins2/controls/ctrl_tree.cpp
View file @
6adad42a
...
@@ -135,6 +135,7 @@ void CtrlTree::onUpdate( Subject<VarTree, tree_update*> &rTree,
...
@@ -135,6 +135,7 @@ void CtrlTree::onUpdate( Subject<VarTree, tree_update*> &rTree,
{
{
if
(
arg
->
i_type
==
0
)
// Item update
if
(
arg
->
i_type
==
0
)
// Item update
{
{
if
(
arg
->
b_active_item
&&
arg
->
b_visible
)
autoScroll
();
autoScroll
();
makeImage
();
makeImage
();
}
}
...
@@ -222,6 +223,52 @@ void CtrlTree::handleEvent( EvtGeneric &rEvent )
...
@@ -222,6 +223,52 @@ void CtrlTree::handleEvent( EvtGeneric &rEvent )
{
{
m_rTree
.
delSelected
();
m_rTree
.
delSelected
();
}
}
else
if
(
key
==
KEY_PAGEDOWN
)
{
it
=
m_firstPos
;
int
i
=
maxItems
()
*
1.5
;
while
(
i
>=
0
)
{
VarTree
::
Iterator
it_old
=
it
;
it
=
m_rTree
.
getNextVisibleItem
(
it
);
/* End is already visible, dont' scroll */
if
(
it
==
m_rTree
.
end
()
)
{
it
=
it_old
;
break
;
}
needShow
=
true
;
i
--
;
}
if
(
needShow
)
{
ensureVisible
(
it
);
makeImage
();
notifyLayout
();
return
;
}
}
else
if
(
key
==
KEY_PAGEUP
)
{
it
=
m_firstPos
;
int
i
=
maxItems
();
while
(
i
>=
maxItems
()
/
2
)
{
it
=
m_rTree
.
getPrevVisibleItem
(
it
);
/* End is already visible, dont' scroll */
if
(
it
==
m_rTree
.
begin
()
)
{
break
;
}
i
--
;
}
ensureVisible
(
it
);
makeImage
();
notifyLayout
();
return
;
}
for
(
it
=
m_rTree
.
begin
();
it
!=
m_rTree
.
end
();
for
(
it
=
m_rTree
.
begin
();
it
!=
m_rTree
.
end
();
it
=
m_rTree
.
getNextVisibleItem
(
it
)
)
it
=
m_rTree
.
getNextVisibleItem
(
it
)
)
{
{
...
...
modules/gui/skins2/utils/var_tree.cpp
View file @
6adad42a
...
@@ -107,7 +107,7 @@ VarTree::ConstIterator VarTree::operator[]( int n ) const
...
@@ -107,7 +107,7 @@ VarTree::ConstIterator VarTree::operator[]( int n ) const
/* find iterator to next ancestor
/* find iterator to next ancestor
* ... which means parent++ or grandparent++ or grandgrandparent++ ... */
* ... which means parent++ or grandparent++ or grandgrandparent++ ... */
VarTree
::
Iterator
VarTree
::
uncle
()
VarTree
::
Iterator
VarTree
::
next_
uncle
()
{
{
VarTree
*
p_parent
=
parent
();
VarTree
*
p_parent
=
parent
();
if
(
p_parent
!=
NULL
)
if
(
p_parent
!=
NULL
)
...
@@ -139,6 +139,39 @@ VarTree::Iterator VarTree::uncle()
...
@@ -139,6 +139,39 @@ VarTree::Iterator VarTree::uncle()
return
root
()
->
end
();
return
root
()
->
end
();
}
}
VarTree
::
Iterator
VarTree
::
prev_uncle
()
{
VarTree
*
p_parent
=
parent
();
if
(
p_parent
!=
NULL
)
{
VarTree
*
p_grandparent
=
p_parent
->
parent
();
while
(
p_grandparent
!=
NULL
)
{
Iterator
it
=
p_grandparent
->
end
();
while
(
it
!=
p_grandparent
->
begin
()
&&
&
(
*
it
)
!=
p_parent
)
it
--
;
if
(
it
!=
p_grandparent
->
begin
()
)
{
it
--
;
if
(
it
!=
p_grandparent
->
begin
()
)
{
return
it
;
}
}
if
(
p_grandparent
->
parent
()
)
{
p_parent
=
p_grandparent
;
p_grandparent
=
p_parent
->
parent
();
}
else
p_grandparent
=
NULL
;
}
}
/* if we didn't return before, it means that we've reached the end */
return
root
()
->
begin
();
}
void
VarTree
::
checkParents
(
VarTree
*
pParent
)
void
VarTree
::
checkParents
(
VarTree
*
pParent
)
{
{
m_pParent
=
pParent
;
m_pParent
=
pParent
;
...
@@ -196,8 +229,33 @@ VarTree::Iterator VarTree::getNextVisibleItem( Iterator it )
...
@@ -196,8 +229,33 @@ VarTree::Iterator VarTree::getNextVisibleItem( Iterator it )
// Was 'it' the last brother? If so, look for uncles
// Was 'it' the last brother? If so, look for uncles
if
(
it_old
->
parent
()
&&
it_old
->
parent
()
->
end
()
==
it
)
if
(
it_old
->
parent
()
&&
it_old
->
parent
()
->
end
()
==
it
)
{
{
it
=
it_old
->
uncle
();
it
=
it_old
->
next_uncle
();
}
}
}
return
it
;
}
VarTree
::
Iterator
VarTree
::
getPrevVisibleItem
(
Iterator
it
)
{
VarTree
::
Iterator
it_old
=
it
;
if
(
it
==
root
()
->
begin
()
||
it
==
++
(
root
()
->
begin
())
)
return
it
;
if
(
it
->
parent
()
)
{
}
/* Was it the first child of its parent ? */
if
(
it
->
parent
()
&&
it
==
it
->
parent
()
->
begin
()
)
{
/* Yes, get previous uncle */
it
=
it_old
->
prev_uncle
();
}
else
it
--
;
/* We have found an expanded uncle, take its last child */
while
(
it
!=
root
()
->
begin
()
&&
it
->
size
()
&&
it
->
m_expanded
)
{
it
=
it
->
end
();
it
--
;
}
}
return
it
;
return
it
;
}
}
...
@@ -215,7 +273,7 @@ VarTree::Iterator VarTree::getNextItem( Iterator it )
...
@@ -215,7 +273,7 @@ VarTree::Iterator VarTree::getNextItem( Iterator it )
// Was 'it' the last brother? If so, look for uncles
// Was 'it' the last brother? If so, look for uncles
if
(
it_old
->
parent
()
&&
it_old
->
parent
()
->
end
()
==
it
)
if
(
it_old
->
parent
()
&&
it_old
->
parent
()
->
end
()
==
it
)
{
{
it
=
it_old
->
uncle
();
it
=
it_old
->
next_
uncle
();
}
}
}
}
return
it
;
return
it
;
...
...
modules/gui/skins2/utils/var_tree.hpp
View file @
6adad42a
...
@@ -37,6 +37,7 @@ typedef struct tree_update
...
@@ -37,6 +37,7 @@ typedef struct tree_update
int
i_type
;
int
i_type
;
int
i_parent
;
int
i_parent
;
int
i_id
;
int
i_id
;
bool
b_active_item
;
bool
b_visible
;
bool
b_visible
;
}
tree_update
;
}
tree_update
;
...
@@ -99,7 +100,8 @@ class VarTree: public Variable, public Subject<VarTree, tree_update*>
...
@@ -99,7 +100,8 @@ class VarTree: public Variable, public Subject<VarTree, tree_update*>
VarTree
*
parent
()
{
return
m_pParent
;
}
VarTree
*
parent
()
{
return
m_pParent
;
}
void
checkParents
(
VarTree
*
pParent
);
void
checkParents
(
VarTree
*
pParent
);
Iterator
uncle
();
Iterator
next_uncle
();
Iterator
prev_uncle
();
/// Get root node
/// Get root node
VarTree
*
root
()
VarTree
*
root
()
...
@@ -139,6 +141,9 @@ class VarTree: public Variable, public Subject<VarTree, tree_update*>
...
@@ -139,6 +141,9 @@ class VarTree: public Variable, public Subject<VarTree, tree_update*>
/// Given an iterator to a visible item, return the next visible item
/// Given an iterator to a visible item, return the next visible item
Iterator
getNextVisibleItem
(
Iterator
it
);
Iterator
getNextVisibleItem
(
Iterator
it
);
/// Given an it to a visible item, return the previous visible item
Iterator
getPrevVisibleItem
(
Iterator
it
);
/// Given an iterator to an item, return the next item
/// Given an iterator to an item, return the next item
Iterator
getNextItem
(
Iterator
it
);
Iterator
getNextItem
(
Iterator
it
);
...
...
modules/gui/skins2/vars/playtree.cpp
View file @
6adad42a
...
@@ -118,6 +118,8 @@ void Playtree::onChange()
...
@@ -118,6 +118,8 @@ void Playtree::onChange()
void
Playtree
::
onUpdateItem
(
int
id
)
void
Playtree
::
onUpdateItem
(
int
id
)
{
{
Iterator
it
=
findById
(
id
);
Iterator
it
=
findById
(
id
);
tree_update
descr
;
descr
.
b_active_item
=
false
;
if
(
it
!=
end
()
)
if
(
it
!=
end
()
)
{
{
// Update the item
// Update the item
...
@@ -125,12 +127,12 @@ void Playtree::onUpdateItem( int id )
...
@@ -125,12 +127,12 @@ void Playtree::onUpdateItem( int id )
UString
*
pName
=
new
UString
(
getIntf
(),
pNode
->
input
.
psz_name
);
UString
*
pName
=
new
UString
(
getIntf
(),
pNode
->
input
.
psz_name
);
it
->
m_cString
=
UStringPtr
(
pName
);
it
->
m_cString
=
UStringPtr
(
pName
);
it
->
m_playing
=
m_pPlaylist
->
status
.
p_item
==
pNode
;
it
->
m_playing
=
m_pPlaylist
->
status
.
p_item
==
pNode
;
if
(
it
->
m_playing
)
descr
.
b_active_item
=
true
;
}
}
else
else
{
{
msg_Warn
(
getIntf
(),
"Cannot find node with id %d"
,
id
);
msg_Warn
(
getIntf
(),
"Cannot find node with id %d"
,
id
);
}
}
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
i_type
=
0
;
notify
(
&
descr
);
notify
(
&
descr
);
}
}
...
...
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