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
9269895c
Commit
9269895c
authored
Sep 11, 2009
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skins2: Remove need for enum, and remove switch-o-literals.
parent
4043a1ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
148 deletions
+55
-148
modules/gui/skins2/commands/cmd_dialogs.hpp
modules/gui/skins2/commands/cmd_dialogs.hpp
+55
-148
No files found.
modules/gui/skins2/commands/cmd_dialogs.hpp
View file @
9269895c
...
@@ -17,9 +17,9 @@
...
@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
along
*
along with this program; if not, write to the Free Software
*
with this program; if not, write to the Free Software Foundation, Inc.,
*
Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
*****************************************************************************/
#ifndef CMD_DIALOGS_HPP
#ifndef CMD_DIALOGS_HPP
...
@@ -31,155 +31,62 @@
...
@@ -31,155 +31,62 @@
#include <vlc_interface.h>
#include <vlc_interface.h>
template
<
int
TYPE
=
0
>
class
CmdDialogs
;
#define DEFINE_DIALOGS \
DEF( ChangeSkin, showChangeSkin() ) \
// XXX use an enum instead
DEF( FileSimple, showFileSimple( true ) ) \
typedef
CmdDialogs
<
1
>
CmdDlgChangeSkin
;
DEF( File, showFile( true ) ) \
typedef
CmdDialogs
<
2
>
CmdDlgFileSimple
;
DEF( Disc, showDisc( true ) ) \
typedef
CmdDialogs
<
3
>
CmdDlgFile
;
DEF( Net, showNet( true ) ) \
typedef
CmdDialogs
<
4
>
CmdDlgDisc
;
DEF( Messages, showMessages() ) \
typedef
CmdDialogs
<
5
>
CmdDlgNet
;
DEF( Prefs, showPrefs() ) \
typedef
CmdDialogs
<
6
>
CmdDlgMessages
;
DEF( FileInfo, showFileInfo() ) \
typedef
CmdDialogs
<
7
>
CmdDlgPrefs
;
\
typedef
CmdDialogs
<
8
>
CmdDlgFileInfo
;
DEF( Add, showFile( false ) ) \
DEF( PlaylistLoad, showPlaylistLoad() ) \
typedef
CmdDialogs
<
11
>
CmdDlgAdd
;
DEF( PlaylistSave, showPlaylistSave() ) \
typedef
CmdDialogs
<
12
>
CmdDlgPlaylistLoad
;
DEF( Directory, showDirectory( true ) ) \
typedef
CmdDialogs
<
13
>
CmdDlgPlaylistSave
;
DEF( StreamingWizard, showStreamingWizard() ) \
typedef
CmdDialogs
<
14
>
CmdDlgDirectory
;
DEF( Playlist, showPlaylist() ) \
typedef
CmdDialogs
<
15
>
CmdDlgStreamingWizard
;
\
typedef
CmdDialogs
<
16
>
CmdDlgPlaytreeLoad
;
DEF( ShowPopupMenu, showPopupMenu(true,INTF_DIALOG_POPUPMENU) ) \
typedef
CmdDialogs
<
17
>
CmdDlgPlaytreeSave
;
DEF( HidePopupMenu, showPopupMenu(false,INTF_DIALOG_POPUPMENU) ) \
typedef
CmdDialogs
<
18
>
CmdDlgPlaylist
;
DEF( ShowAudioPopupMenu, showPopupMenu(true,INTF_DIALOG_AUDIOPOPUPMENU) ) \
DEF( HideAudioPopupMenu, showPopupMenu(false,INTF_DIALOG_AUDIOPOPUPMENU) ) \
typedef
CmdDialogs
<
30
>
CmdDlgShowPopupMenu
;
DEF( ShowVideoPopupMenu, showPopupMenu(true,INTF_DIALOG_VIDEOPOPUPMENU) ) \
typedef
CmdDialogs
<
31
>
CmdDlgHidePopupMenu
;
DEF( HideVideoPopupMenu, showPopupMenu(false,INTF_DIALOG_VIDEOPOPUPMENU) ) \
typedef
CmdDialogs
<
32
>
CmdDlgShowAudioPopupMenu
;
DEF( ShowMiscPopupMenu, showPopupMenu(true,INTF_DIALOG_MISCPOPUPMENU) ) \
typedef
CmdDialogs
<
33
>
CmdDlgHideAudioPopupMenu
;
DEF( HideMiscPopupMenu, showPopupMenu(false,INTF_DIALOG_MISCPOPUPMENU) )
typedef
CmdDialogs
<
34
>
CmdDlgShowVideoPopupMenu
;
typedef
CmdDialogs
<
35
>
CmdDlgHideVideoPopupMenu
;
#define DEF( a, c ) \
typedef
CmdDialogs
<
36
>
CmdDlgShowMiscPopupMenu
;
class CmdDlg##a: public CmdGeneric \
typedef
CmdDialogs
<
37
>
CmdDlgHideMiscPopupMenu
;
{ public: \
CmdDlg##a( intf_thread_t *pIntf ): CmdGeneric( pIntf ) { } \
virtual ~CmdDlg##a() { } \
/// Generic "Open dialog" command
virtual void execute() \
template
<
int
TYPE
>
{ \
class
CmdDialogs
:
public
CmdGeneric
Dialogs *dlg = Dialogs::instance( getIntf() ); \
{
if( dlg ) dlg->c; \
public:
} \
CmdDialogs
(
intf_thread_t
*
pIntf
)
:
CmdGeneric
(
pIntf
)
{}
virtual string getType() const { return #a" dialog"; } \
virtual
~
CmdDialogs
()
{}
/// This method does the real job of the command
virtual
void
execute
()
{
/// Get the dialogs provider
Dialogs
*
pDialogs
=
Dialogs
::
instance
(
getIntf
()
);
if
(
pDialogs
==
NULL
)
{
return
;
}
switch
(
TYPE
)
{
case
1
:
pDialogs
->
showChangeSkin
();
break
;
case
2
:
pDialogs
->
showFileSimple
(
true
);
break
;
case
3
:
pDialogs
->
showFile
(
true
);
break
;
case
4
:
pDialogs
->
showDisc
(
true
);
break
;
case
5
:
pDialogs
->
showNet
(
true
);
break
;
case
6
:
pDialogs
->
showMessages
();
break
;
case
7
:
pDialogs
->
showPrefs
();
break
;
case
8
:
pDialogs
->
showFileInfo
();
break
;
case
11
:
pDialogs
->
showFile
(
false
);
break
;
case
12
:
pDialogs
->
showPlaylistLoad
();
break
;
case
13
:
pDialogs
->
showPlaylistSave
();
break
;
case
14
:
pDialogs
->
showDirectory
(
true
);
break
;
case
15
:
pDialogs
->
showStreamingWizard
();
break
;
case
18
:
pDialogs
->
showPlaylist
();
break
;
case
30
:
pDialogs
->
showPopupMenu
(
true
,
INTF_DIALOG_POPUPMENU
);
break
;
case
31
:
pDialogs
->
showPopupMenu
(
false
,
INTF_DIALOG_POPUPMENU
);
break
;
case
32
:
pDialogs
->
showPopupMenu
(
true
,
INTF_DIALOG_AUDIOPOPUPMENU
);
break
;
case
33
:
pDialogs
->
showPopupMenu
(
false
,
INTF_DIALOG_AUDIOPOPUPMENU
);
break
;
case
34
:
pDialogs
->
showPopupMenu
(
true
,
INTF_DIALOG_VIDEOPOPUPMENU
);
break
;
case
35
:
pDialogs
->
showPopupMenu
(
false
,
INTF_DIALOG_VIDEOPOPUPMENU
);
break
;
case
36
:
pDialogs
->
showPopupMenu
(
true
,
INTF_DIALOG_MISCPOPUPMENU
);
break
;
case
37
:
pDialogs
->
showPopupMenu
(
false
,
INTF_DIALOG_MISCPOPUPMENU
);
break
;
default:
msg_Warn
(
getIntf
(),
"unknown dialog type"
);
break
;
}
}
/// Return the type of the command
virtual
string
getType
()
const
{
return
"dialog"
;
}
};
};
DEFINE_DIALOGS
class
CmdInteraction
:
public
CmdGeneric
class
CmdInteraction
:
public
CmdGeneric
{
{
public:
public:
CmdInteraction
(
intf_thread_t
*
pIntf
,
interaction_dialog_t
*
CmdInteraction
(
intf_thread_t
*
pIntf
,
interaction_dialog_t
*
p_dialog
)
p_dialog
)
:
CmdGeneric
(
pIntf
),
m_pDialog
(
p_dialog
)
:
CmdGeneric
(
pIntf
),
m_pDialog
(
p_dialog
)
{
}
{}
virtual
~
CmdInteraction
()
{
}
virtual
~
CmdInteraction
()
{}
/// This method does the real job of the command
virtual
void
execute
()
virtual
void
execute
()
{
{
/// Get the dialogs provider
Dialogs
*
pDialogs
=
Dialogs
::
instance
(
getIntf
()
);
Dialogs
*
pDialogs
=
Dialogs
::
instance
(
getIntf
()
);
if
(
pDialogs
==
NULL
)
if
(
pDialogs
!=
NULL
)
{
return
;
}
pDialogs
->
showInteraction
(
m_pDialog
);
pDialogs
->
showInteraction
(
m_pDialog
);
}
}
virtual
string
getType
()
const
{
return
"interaction"
;
}
virtual
string
getType
()
const
{
return
"interaction"
;
}
private:
private:
interaction_dialog_t
*
m_pDialog
;
interaction_dialog_t
*
m_pDialog
;
};
};
...
...
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