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
316c9f43
Commit
316c9f43
authored
Nov 21, 2009
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skins2: Add ptrmap<> to possibly prevent some more empty nodes.
parent
fe5af2a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
modules/gui/skins2/x11/x11_factory.hpp
modules/gui/skins2/x11/x11_factory.hpp
+26
-4
No files found.
modules/gui/skins2/x11/x11_factory.hpp
View file @
316c9f43
...
...
@@ -38,11 +38,33 @@ class X11TimerLoop;
/// Class used to instanciate X11 specific objects
class
X11Factory
:
public
OSFactory
{
private:
/** ptrmap is an associative container (like std::map, in fact it builds
* on std::map) that provides only operator[] in non-const and const
* variants, and has the property that a (const) lookup of a non-existent
* key does not cause an empty node to be inserted. Instead it returns
* NULL if there was no entry; so it only stores pointers. */
template
<
class
K
,
class
V
>
class
ptrmap
{
private:
typedef
V
*
value_type
;
typedef
std
::
map
<
K
,
value_type
>
map_t
;
map_t
m_map
;
ptrmap
&
operator
=
(
const
ptrmap
&
);
ptrmap
(
const
ptrmap
&
);
public:
ptrmap
()
{
}
value_type
&
operator
[](
K
k
)
{
return
m_map
.
operator
[](
k
);
}
value_type
operator
[](
K
k
)
const
{
typename
map_t
::
const_iterator
i
=
m_map
.
find
(
k
);
return
i
!=
m_map
.
end
()
?
i
->
second
:
NULL
;
}
};
public:
/// Map to find the GenericWindow associated to a X11Window
map
<
Window
,
GenericWindow
*
>
m_windowMap
;
/// Map to find the Dnd object associated to a X11Window
map
<
Window
,
X11DragDrop
*
>
m_dndMap
;
/// Map to find the GenericWindow
*
associated to a X11Window
ptrmap
<
Window
,
GenericWindow
>
m_windowMap
;
/// Map to find the Dnd object
(X11DragDrop*)
associated to a X11Window
ptrmap
<
Window
,
X11DragDrop
>
m_dndMap
;
X11Factory
(
intf_thread_t
*
pIntf
);
virtual
~
X11Factory
();
...
...
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