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
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()
...
@@ -140,21 +140,24 @@ int CtrlTree::maxItems()
void
CtrlTree
::
onUpdate
(
Subject
<
VarTree
,
tree_update
>
&
rTree
,
void
CtrlTree
::
onUpdate
(
Subject
<
VarTree
,
tree_update
>
&
rTree
,
tree_update
*
arg
)
tree_update
*
arg
)
{
{
if
(
arg
->
i_type
==
0
)
// Item update
if
(
arg
->
type
==
arg
->
UpdateItem
)
// Item update
{
{
if
(
arg
->
b_active_item
)
if
(
arg
->
b_active_item
)
autoScroll
();
autoScroll
();
makeImage
();
if
(
isItemVisible
(
arg
->
i_id
)
)
notifyLayout
();
{
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
();
m_firstPos
=
m_flat
?
m_rTree
.
firstLeaf
()
:
m_rTree
.
begin
();
makeImage
();
makeImage
();
notifyLayout
();
notifyLayout
();
}
}
else
if
(
arg
->
i_type
==
2
)
// Item-append
else
if
(
arg
->
type
==
arg
->
AppendItem
)
// Item-append
{
{
if
(
m_flat
&&
m_firstPos
->
size
()
)
if
(
m_flat
&&
m_firstPos
->
size
()
)
{
{
...
@@ -169,7 +172,7 @@ void CtrlTree::onUpdate( Subject<VarTree, tree_update> &rTree,
...
@@ -169,7 +172,7 @@ void CtrlTree::onUpdate( Subject<VarTree, tree_update> &rTree,
notifyLayout
();
notifyLayout
();
}
}
}
}
else
if
(
arg
->
i_type
==
3
)
// item-del
else
if
(
arg
->
type
==
arg
->
DeleteItem
)
// item-del
{
{
/* Make sure firstPos is valid */
/* Make sure firstPos is valid */
VarTree
::
Iterator
it_old
=
m_firstPos
;
VarTree
::
Iterator
it_old
=
m_firstPos
;
...
...
modules/gui/skins2/utils/var_tree.hpp
View file @
d9cdd294
...
@@ -35,9 +35,18 @@
...
@@ -35,9 +35,18 @@
/// Description of an update to the tree
/// Description of an update to the tree
typedef
struct
tree_update
typedef
struct
tree_update
{
{
int
i_type
;
enum
type_t
int
i_id
;
{
bool
b_active_item
;
UpdateItem
,
AppendItem
,
DeleteItem
,
ResetAll
,
};
enum
type_t
type
;
int
i_id
;
bool
b_active_item
;
}
tree_update
;
}
tree_update
;
/// Tree variable
/// Tree variable
...
...
modules/gui/skins2/vars/playtree.cpp
View file @
d9cdd294
...
@@ -57,7 +57,7 @@ void Playtree::delSelected()
...
@@ -57,7 +57,7 @@ void Playtree::delSelected()
}
}
/// \todo Do this better (handle item-deleted)
/// \todo Do this better (handle item-deleted)
tree_update
descr
;
tree_update
descr
;
descr
.
i_type
=
3
;
descr
.
type
=
tree_update
::
DeleteItem
;
notify
(
&
descr
);
notify
(
&
descr
);
it
=
begin
();
it
=
begin
();
while
(
it
!=
end
()
)
while
(
it
!=
end
()
)
...
@@ -114,7 +114,7 @@ void Playtree::onChange()
...
@@ -114,7 +114,7 @@ void Playtree::onChange()
{
{
buildTree
();
buildTree
();
tree_update
descr
;
tree_update
descr
;
descr
.
i_type
=
1
;
descr
.
type
=
tree_update
::
ResetAll
;
notify
(
&
descr
);
notify
(
&
descr
);
}
}
...
@@ -129,7 +129,7 @@ void Playtree::onUpdateItem( int id )
...
@@ -129,7 +129,7 @@ void Playtree::onUpdateItem( int id )
it
->
setString
(
UStringPtr
(
pName
)
);
it
->
setString
(
UStringPtr
(
pName
)
);
tree_update
descr
;
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
type
=
tree_update
::
UpdateItem
;
descr
.
i_id
=
id
;
descr
.
i_id
=
id
;
descr
.
b_active_item
=
false
;
descr
.
b_active_item
=
false
;
notify
(
&
descr
);
notify
(
&
descr
);
...
@@ -149,7 +149,7 @@ void Playtree::onUpdateCurrent( bool b_active )
...
@@ -149,7 +149,7 @@ void Playtree::onUpdateCurrent( bool b_active )
it
->
setPlaying
(
false
);
it
->
setPlaying
(
false
);
tree_update
descr
;
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
type
=
tree_update
::
UpdateItem
;
descr
.
i_id
=
it
->
getId
();
descr
.
i_id
=
it
->
getId
();
descr
.
b_active_item
=
false
;
descr
.
b_active_item
=
false
;
notify
(
&
descr
);
notify
(
&
descr
);
...
@@ -175,7 +175,7 @@ void Playtree::onUpdateCurrent( bool b_active )
...
@@ -175,7 +175,7 @@ void Playtree::onUpdateCurrent( bool b_active )
playlist_Unlock
(
m_pPlaylist
);
playlist_Unlock
(
m_pPlaylist
);
tree_update
descr
;
tree_update
descr
;
descr
.
i_type
=
0
;
descr
.
type
=
tree_update
::
UpdateItem
;
descr
.
i_id
=
current
->
i_id
;
descr
.
i_id
=
current
->
i_id
;
descr
.
b_active_item
=
true
;
descr
.
b_active_item
=
true
;
notify
(
&
descr
);
notify
(
&
descr
);
...
@@ -192,7 +192,7 @@ void Playtree::onDelete( int i_id )
...
@@ -192,7 +192,7 @@ void Playtree::onDelete( int i_id )
item
->
setDeleted
(
true
);
item
->
setDeleted
(
true
);
tree_update
descr
;
tree_update
descr
;
descr
.
i_type
=
3
;
descr
.
type
=
tree_update
::
DeleteItem
;
descr
.
i_id
=
i_id
;
descr
.
i_id
=
i_id
;
notify
(
&
descr
);
notify
(
&
descr
);
...
@@ -223,7 +223,7 @@ void Playtree::onAppend( playlist_add_t *p_add )
...
@@ -223,7 +223,7 @@ void Playtree::onAppend( playlist_add_t *p_add )
playlist_Unlock
(
m_pPlaylist
);
playlist_Unlock
(
m_pPlaylist
);
tree_update
descr
;
tree_update
descr
;
descr
.
i_type
=
2
;
descr
.
type
=
tree_update
::
AppendItem
;
descr
.
i_id
=
p_add
->
i_item
;
descr
.
i_id
=
p_add
->
i_item
;
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