Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
d9cdd294
Commit
d9cdd294
authored
Jan 16, 2011
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: use enum type for better clarity
parent
fd930cde
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
16 deletions
+28
-16
modules/gui/skins2/controls/ctrl_tree.cpp
modules/gui/skins2/controls/ctrl_tree.cpp
+9
-6
modules/gui/skins2/utils/var_tree.hpp
modules/gui/skins2/utils/var_tree.hpp
+12
-3
modules/gui/skins2/vars/playtree.cpp
modules/gui/skins2/vars/playtree.cpp
+7
-7
No files found.
modules/gui/skins2/controls/ctrl_tree.cpp
View file @
d9cdd294
...
...
@@ -140,21 +140,24 @@ int CtrlTree::maxItems()
void
CtrlTree
::
onUpdate
(
Subject
<
VarTree
,
tree_update
>
&
rTree
,
tree_update
*
arg
)
{
if
(
arg
->
i_type
==
0
)
// Item update
if
(
arg
->
type
==
arg
->
UpdateItem
)
// Item update
{
if
(
arg
->
b_active_item
)
autoScroll
();
makeImage
();
notifyLayout
();
if
(
isItemVisible
(
arg
->
i_id
)
)
{
makeImage
();
notifyLayout
();
}
}
else
if
(
arg
->
i_type
==
1
)
// Global change or deletion
else
if
(
arg
->
type
==
arg
->
ResetAll
)
// Global change or deletion
{
m_firstPos
=
m_flat
?
m_rTree
.
firstLeaf
()
:
m_rTree
.
begin
();
makeImage
();
notifyLayout
();
}
else
if
(
arg
->
i_type
==
2
)
// Item-append
else
if
(
arg
->
type
==
arg
->
AppendItem
)
// Item-append
{
if
(
m_flat
&&
m_firstPos
->
size
()
)
{
...
...
@@ -169,7 +172,7 @@ void CtrlTree::onUpdate( Subject<VarTree, tree_update> &rTree,
notifyLayout
();
}
}
else
if
(
arg
->
i_type
==
3
)
// item-del
else
if
(
arg
->
type
==
arg
->
DeleteItem
)
// item-del
{
/* Make sure firstPos is valid */
VarTree
::
Iterator
it_old
=
m_firstPos
;
...
...
modules/gui/skins2/utils/var_tree.hpp
View file @
d9cdd294
...
...
@@ -35,9 +35,18 @@
/// Description of an update to the tree
typedef
struct
tree_update
{
int
i_type
;
int
i_id
;
bool
b_active_item
;
enum
type_t
{
UpdateItem
,
AppendItem
,
DeleteItem
,
ResetAll
,
};
enum
type_t
type
;
int
i_id
;
bool
b_active_item
;
}
tree_update
;
/// Tree variable
...
...
modules/gui/skins2/vars/playtree.cpp
View file @
d9cdd294
...
...
@@ -57,7 +57,7 @@ void Playtree::delSelected()
}
/// \todo Do this better (handle item-deleted)
tree_update
descr
;
descr
.
i_type
=
3
;
descr
.
type
=
tree_update
::
DeleteItem
;
notify
(
&
descr
);
it
=
begin
();
while
(
it
!=
end
()
)
...
...
@@ -114,7 +114,7 @@ void Playtree::onChange()
{
buildTree
();
tree_update
descr
;
descr
.
i_type
=
1
;
descr
.
type
=
tree_update
::
ResetAll
;
notify
(
&
descr
);
}
...
...
@@ -129,7 +129,7 @@ void Playtree::onUpdateItem( int id )
it
->
setString
(
UStringPtr
(
pName
)
);
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
type
=
tree_update
::
UpdateItem
;
descr
.
i_id
=
id
;
descr
.
b_active_item
=
false
;
notify
(
&
descr
);
...
...
@@ -149,7 +149,7 @@ void Playtree::onUpdateCurrent( bool b_active )
it
->
setPlaying
(
false
);
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
type
=
tree_update
::
UpdateItem
;
descr
.
i_id
=
it
->
getId
();
descr
.
b_active_item
=
false
;
notify
(
&
descr
);
...
...
@@ -175,7 +175,7 @@ void Playtree::onUpdateCurrent( bool b_active )
playlist_Unlock
(
m_pPlaylist
);
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
type
=
tree_update
::
UpdateItem
;
descr
.
i_id
=
current
->
i_id
;
descr
.
b_active_item
=
true
;
notify
(
&
descr
);
...
...
@@ -192,7 +192,7 @@ void Playtree::onDelete( int i_id )
item
->
setDeleted
(
true
);
tree_update
descr
;
descr
.
i_type
=
3
;
descr
.
type
=
tree_update
::
DeleteItem
;
descr
.
i_id
=
i_id
;
notify
(
&
descr
);
...
...
@@ -223,7 +223,7 @@ void Playtree::onAppend( playlist_add_t *p_add )
playlist_Unlock
(
m_pPlaylist
);
tree_update
descr
;
descr
.
i_type
=
2
;
descr
.
type
=
tree_update
::
AppendItem
;
descr
.
i_id
=
p_add
->
i_item
;
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