PlaylistCommandsComponent.cpp
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 
31 #include "nsIGenericFactory.h"
34 
35 #define NS_GENERIC_FACTORY_SIMPLETON_CONSTRUCTOR( _Interface ) \
36  static _Interface * m_Simpleton = NULL; \
37  static _Interface * _Interface##SimpletonConstructor( void ) \
38  { \
39  NS_IF_ADDREF( m_Simpleton ? m_Simpleton : ( NS_IF_ADDREF( m_Simpleton = new _Interface() ), m_Simpleton ) ); \
40  return m_Simpleton; \
41  } \
42  NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR( _Interface, _Interface##SimpletonConstructor )
43 
45 
47 
48 static NS_IMETHODIMP CPlaylistCommandsManagerFactoryDestructor()
49 {
50  NS_IF_RELEASE(m_Simpleton);
51  return NS_OK;
52 }
53 
54 static nsModuleComponentInfo components[] =
55 {
56  {
60  CPlaylistCommandsManagerConstructor,
61  nsnull,
62  nsnull,
63  CPlaylistCommandsManagerFactoryDestructor
64  },
65  {
69  sbPlaylistCommandsHelperConstructor,
70  },
71 };
72 
73 NS_IMPL_NSGETMODULE(SongbirdPlaylistCommandsComponent, components)
74 
#define SONGBIRD_PlaylistCommandsManager_CONTRACTID
return NS_OK
#define SONGBIRD_PLAYLISTCOMMANDSHELPER_CONTRACTID
static CPlaylistCommandsManager * m_Simpleton
static nsModuleComponentInfo components[]
#define SONGBIRD_PlaylistCommandsManager_CID
Songbird PlaylistCommandsManager Component Definition.
#define SONGBIRD_PLAYLISTCOMMANDSHELPER_CLASSNAME
#define SONGBIRD_PLAYLISTCOMMANDSHELPER_CID
NS_IMPL_NSGETMODULE(SongbirdIdentityServiceComponent, sbIdentityServiceComponent)
Songbird PlaylistCommandsHelper Component Definition.
#define SONGBIRD_PlaylistCommandsManager_CLASSNAME
NS_GENERIC_FACTORY_CONSTRUCTOR(sbMediaSniffer)
#define NS_GENERIC_FACTORY_SIMPLETON_CONSTRUCTOR(_Interface)