]> git.sesse.net Git - vlc/blob - modules/gui/skins2/commands/cmd_dialogs.hpp
skins2: fix a redefinition of a macro.
[vlc] / modules / gui / skins2 / commands / cmd_dialogs.hpp
1 /*****************************************************************************
2  * cmd_dialogs.hpp
3  *****************************************************************************
4  * Copyright (C) 2003 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8  *          Olivier Teulière <ipkiss@via.ecp.fr>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef CMD_DIALOGS_HPP
26 #define CMD_DIALOGS_HPP
27
28 #include "cmd_generic.hpp"
29 #include "../src/dialogs.hpp"
30 #include "cmd_change_skin.hpp"
31
32 #include <vlc_interface.h>
33
34
35 #define DEFC( a, c ) \
36 class CmdDlg##a: public CmdGeneric                              \
37 {   public:                                                     \
38     CmdDlg##a( intf_thread_t *pIntf ): CmdGeneric( pIntf ) { }  \
39     virtual ~CmdDlg##a() { }                                    \
40     virtual void execute()                                      \
41     {                                                           \
42         Dialogs *dlg = Dialogs::instance( getIntf() );          \
43         if( dlg ) dlg->c;                                       \
44     }                                                           \
45     virtual string getType() const { return #a" dialog"; }      \
46 };
47
48 DEFC( ChangeSkin,         showChangeSkin() )
49 DEFC( FileSimple,         showFileSimple( true ) )
50 DEFC( File,               showFile( true ) )
51 DEFC( Disc,               showDisc( true ) )
52 DEFC( Net,                showNet( true ) )
53 DEFC( Messages,           showMessages() )
54 DEFC( Prefs,              showPrefs() )
55 DEFC( FileInfo,           showFileInfo() )
56
57 DEFC( Add,                showFile( false ) )
58 DEFC( PlaylistLoad,       showPlaylistLoad() )
59 DEFC( PlaylistSave,       showPlaylistSave() )
60 DEFC( Directory,          showDirectory( true ) )
61 DEFC( StreamingWizard,    showStreamingWizard() )
62 DEFC( Playlist,           showPlaylist() )
63
64 DEFC( ShowPopupMenu,      showPopupMenu(true,INTF_DIALOG_POPUPMENU) )
65 DEFC( HidePopupMenu,      showPopupMenu(false,INTF_DIALOG_POPUPMENU) )
66 DEFC( ShowAudioPopupMenu, showPopupMenu(true,INTF_DIALOG_AUDIOPOPUPMENU) )
67 DEFC( HideAudioPopupMenu, showPopupMenu(false,INTF_DIALOG_AUDIOPOPUPMENU) )
68 DEFC( ShowVideoPopupMenu, showPopupMenu(true,INTF_DIALOG_VIDEOPOPUPMENU) )
69 DEFC( HideVideoPopupMenu, showPopupMenu(false,INTF_DIALOG_VIDEOPOPUPMENU) )
70 DEFC( ShowMiscPopupMenu,  showPopupMenu(true,INTF_DIALOG_MISCPOPUPMENU) )
71 DEFC( HideMiscPopupMenu,  showPopupMenu(false,INTF_DIALOG_MISCPOPUPMENU) )
72
73 #undef DEFC
74
75 class CmdInteraction: public CmdGeneric
76 {
77 public:
78     CmdInteraction( intf_thread_t *pIntf, interaction_dialog_t * p_dialog )
79                   : CmdGeneric( pIntf ), m_pDialog( p_dialog ) { }
80     virtual ~CmdInteraction() { }
81
82     virtual void execute()
83     {
84         Dialogs *pDialogs = Dialogs::instance( getIntf() );
85         if( pDialogs != NULL )
86             pDialogs->showInteraction( m_pDialog );
87     }
88     virtual string getType() const { return "interaction"; }
89 private:
90     interaction_dialog_t *m_pDialog;
91 };
92
93 #endif