1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2010 the VideoLAN team
7 * Author: Erwan Tulou <erwan10@vidoelan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef ART_MANAGER_HPP
25 #define ART_MANAGER_HPP
27 #include "file_bitmap.hpp"
32 /// Class for art bitmaps
33 class ArtBitmap: public FileBitmap
37 string getUriName() { return m_uriName; }
39 /// Constructor/destructor
40 ArtBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
42 FileBitmap( pIntf, pImageHandler, uriName, -1 ),
43 m_uriName( uriName ) {}
44 virtual ~ArtBitmap() {}
52 /// Singleton object for handling art
53 class ArtManager: public SkinObject
56 /// Get the instance of ArtManager
57 /// Returns NULL if the initialization of the object failed
58 static ArtManager *instance( intf_thread_t *pIntf );
60 /// Delete the instance of ArtManager
61 static void destroy( intf_thread_t *pIntf );
63 /// Retrieve for the art file from uri name
64 ArtBitmap* getArtBitmap( string uriName );
67 // Protected because it is a singleton
68 ArtManager( intf_thread_t *pIntf );
69 virtual ~ArtManager();
72 /// Image handler (used to load art files)
73 image_handler_t *m_pImageHandler;
75 // keep a cache of art already open
76 list<ArtBitmap*> m_listBitmap;