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
1c41fce0
Commit
1c41fce0
authored
Jan 13, 2011
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: add accessors to VarTree
parent
3b3251c4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
53 deletions
+70
-53
modules/gui/skins2/controls/ctrl_tree.cpp
modules/gui/skins2/controls/ctrl_tree.cpp
+33
-33
modules/gui/skins2/utils/var_tree.hpp
modules/gui/skins2/utils/var_tree.hpp
+25
-8
modules/gui/skins2/vars/playtree.cpp
modules/gui/skins2/vars/playtree.cpp
+12
-12
No files found.
modules/gui/skins2/controls/ctrl_tree.cpp
View file @
1c41fce0
This diff is collapsed.
Click to expand it.
modules/gui/skins2/utils/var_tree.hpp
View file @
1c41fce0
...
...
@@ -68,16 +68,24 @@ public:
/// Remove all elements from the children's list
virtual
void
clear
();
/// \todo Use accessors for these fields ?
int
m_id
;
UStringPtr
m_cString
;
bool
m_selected
;
bool
m_playing
;
bool
m_expanded
;
bool
m_deleted
;
void
*
m_pData
;
inline
int
getId
()
{
return
m_id
;
}
inline
void
*
getData
()
{
return
m_pData
;
}
inline
UString
*
getString
()
{
return
(
UString
*
)
m_cString
.
get
();
}
inline
void
setString
(
UStringPtr
val
)
{
m_cString
=
val
;
}
inline
bool
isReadonly
()
{
return
m_readonly
;
};
inline
bool
isSelected
()
{
return
m_selected
;
};
inline
bool
isPlaying
()
{
return
m_playing
;
};
inline
bool
isExpanded
()
{
return
m_expanded
;
};
inline
bool
isDeleted
()
{
return
m_deleted
;
};
inline
void
setSelected
(
bool
val
)
{
m_selected
=
val
;
}
inline
void
setPlaying
(
bool
val
)
{
m_playing
=
val
;
}
inline
void
setExpanded
(
bool
val
)
{
m_expanded
=
val
;
}
inline
void
setDeleted
(
bool
val
)
{
m_deleted
=
val
;
}
inline
void
toggleSelected
()
{
m_selected
=
!
m_selected
;
}
inline
void
toggleExpanded
()
{
m_expanded
=
!
m_expanded
;
}
/// Get the number of children
int
size
()
const
{
return
m_children
.
size
();
}
...
...
@@ -196,7 +204,16 @@ private:
/// Pointer to parent node
VarTree
*
m_pParent
;
int
m_id
;
void
*
m_pData
;
UStringPtr
m_cString
;
/// indicators
bool
m_readonly
;
bool
m_selected
;
bool
m_playing
;
bool
m_expanded
;
bool
m_deleted
;
/// Variable type
static
const
string
m_type
;
...
...
modules/gui/skins2/vars/playtree.cpp
View file @
1c41fce0
...
...
@@ -53,7 +53,7 @@ void Playtree::delSelected()
playlist_Lock
(
getIntf
()
->
p_sys
->
p_playlist
);
for
(
it
=
begin
();
it
!=
end
();
it
=
getNextItem
(
it
)
)
{
if
(
it
->
m_selected
&&
!
it
->
isReadonly
()
)
if
(
it
->
isSelected
()
&&
!
it
->
isReadonly
()
)
{
it
->
cascadeDelete
();
}
...
...
@@ -65,10 +65,10 @@ void Playtree::delSelected()
it
=
begin
();
while
(
it
!=
end
()
)
{
if
(
it
->
m_deleted
)
if
(
it
->
isDeleted
()
)
{
VarTree
::
Iterator
it2
;
playlist_item_t
*
p_item
=
(
playlist_item_t
*
)(
it
->
m_pData
);
playlist_item_t
*
p_item
=
(
playlist_item_t
*
)(
it
->
getData
()
);
if
(
p_item
->
i_children
==
-
1
)
{
playlist_DeleteFromInput
(
getIntf
()
->
p_sys
->
p_playlist
,
...
...
@@ -97,7 +97,7 @@ void Playtree::action( VarTree *pItem )
playlist_Lock
(
m_pPlaylist
);
VarTree
::
Iterator
it
;
playlist_item_t
*
p_item
=
(
playlist_item_t
*
)
pItem
->
m_pData
;
playlist_item_t
*
p_item
=
(
playlist_item_t
*
)
pItem
->
getData
()
;
playlist_item_t
*
p_parent
=
p_item
;
while
(
p_parent
)
{
...
...
@@ -129,9 +129,9 @@ void Playtree::onUpdateItem( int id )
if
(
it
!=
end
()
)
{
// Update the item
playlist_item_t
*
pNode
=
(
playlist_item_t
*
)(
it
->
m_pData
);
playlist_item_t
*
pNode
=
(
playlist_item_t
*
)(
it
->
getData
()
);
UString
*
pName
=
new
UString
(
getIntf
(),
pNode
->
p_input
->
psz_name
);
it
->
m_cString
=
UStringPtr
(
pName
);
it
->
setString
(
UStringPtr
(
pName
)
);
}
else
{
...
...
@@ -151,7 +151,7 @@ void Playtree::onUpdateCurrent( bool b_active )
Iterator
it
=
findById
(
m_currentItem
->
i_id
);
if
(
it
!=
end
()
)
it
->
m_playing
=
false
;
it
->
setPlaying
(
false
)
;
m_currentItem
=
NULL
;
}
else
...
...
@@ -167,7 +167,7 @@ void Playtree::onUpdateCurrent( bool b_active )
Iterator
it
=
findById
(
current
->
i_id
);
if
(
it
!=
end
()
)
it
->
m_playing
=
true
;
it
->
setPlaying
(
true
)
;
m_currentItem
=
current
;
playlist_Unlock
(
m_pPlaylist
);
...
...
@@ -189,12 +189,12 @@ void Playtree::onDelete( int i_id )
{
VarTree
*
parent
=
item
->
parent
();
item
->
m_deleted
=
true
;
item
->
setDeleted
(
true
)
;
tree_update
descr
;
descr
.
i_id
=
i_id
;
descr
.
i_type
=
3
;
descr
.
b_visible
=
parent
?
parent
->
m_expanded
:
true
;
descr
.
b_visible
=
parent
?
parent
->
isExpanded
()
:
true
;
notify
(
&
descr
);
if
(
parent
)
...
...
@@ -232,7 +232,7 @@ void Playtree::onAppend( playlist_add_t *p_add )
tree_update
descr
;
descr
.
i_id
=
p_add
->
i_item
;
descr
.
i_parent
=
p_add
->
i_node
;
descr
.
b_visible
=
node
->
m_expanded
;
descr
.
b_visible
=
node
->
isExpanded
()
;
descr
.
i_type
=
2
;
notify
(
&
descr
);
}
...
...
@@ -269,7 +269,7 @@ void Playtree::buildTree()
/* Set the root's name */
UString
*
pName
=
new
UString
(
getIntf
(),
m_pPlaylist
->
p_root_category
->
p_input
->
psz_name
);
m_cString
=
UStringPtr
(
pName
);
setString
(
UStringPtr
(
pName
)
);
buildNode
(
m_pPlaylist
->
p_root_category
,
*
this
);
...
...
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