2 * embed.h - misc. stuff for using embedded data (resources linked into binary)
4 * Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
28 #include <QtGui/QPixmap>
29 #include <QtCore/QString>
32 #include "lmms_basics.h"
41 const unsigned char * data
;
46 QPixmap EXPORT
getIconPixmap( const char * _name
, int _w
= -1, int _h
= -1 );
47 QString EXPORT
getText( const char * _name
);
56 QPixmap
getIconPixmap( const char * _name
, int _w
= -1, int _h
= -1 );
57 //QString getText( const char * _name );
67 PixmapLoader( const PixmapLoader
* _ref
) :
68 m_name( _ref
!= NULL
? _ref
->m_name
: QString::null
)
72 PixmapLoader( const QString
& _name
= QString::null
) :
77 virtual QPixmap
pixmap() const
79 if( !m_name
.isEmpty() )
81 return( embed::getIconPixmap(
82 m_name
.toAscii().constData() ) );
87 virtual ~PixmapLoader()
91 virtual QString
pixmapName() const
102 class PluginPixmapLoader
: public PixmapLoader
105 PluginPixmapLoader( const QString
& _name
= QString::null
) :
106 PixmapLoader( _name
)
110 virtual QPixmap
pixmap() const
112 if( !m_name
.isEmpty() )
114 return( PLUGIN_NAME::getIconPixmap(
115 m_name
.toAscii().constData() ) );
120 virtual QString
pixmapName() const
122 return QString( STRINGIFY(PLUGIN_NAME
) ) + "::" + m_name
;