Commit 17025142 authored by Cyril Deguet's avatar Cyril Deguet

* all: renamed PngBitmap into FileBitmap, as any image format

 can be loaded
parent d607e4d1
...@@ -95,6 +95,8 @@ SOURCES_skins2 = \ ...@@ -95,6 +95,8 @@ SOURCES_skins2 = \
src/bitmap_font.hpp \ src/bitmap_font.hpp \
src/dialogs.cpp \ src/dialogs.cpp \
src/dialogs.hpp \ src/dialogs.hpp \
src/file_bitmap.cpp \
src/file_bitmap.hpp \
src/ft2_bitmap.cpp \ src/ft2_bitmap.cpp \
src/ft2_bitmap.hpp \ src/ft2_bitmap.hpp \
src/ft2_font.cpp \ src/ft2_font.cpp \
...@@ -115,8 +117,6 @@ SOURCES_skins2 = \ ...@@ -115,8 +117,6 @@ SOURCES_skins2 = \
src/os_timer.hpp \ src/os_timer.hpp \
src/os_window.hpp \ src/os_window.hpp \
src/os_tooltip.hpp \ src/os_tooltip.hpp \
src/png_bitmap.cpp \
src/png_bitmap.hpp \
src/scaled_bitmap.cpp \ src/scaled_bitmap.cpp \
src/scaled_bitmap.hpp \ src/scaled_bitmap.hpp \
src/skin_main.cpp \ src/skin_main.cpp \
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "builder.hpp" #include "builder.hpp"
#include "builder_data.hpp" #include "builder_data.hpp"
#include "interpreter.hpp" #include "interpreter.hpp"
#include "../src/png_bitmap.hpp" #include "../src/file_bitmap.hpp"
#include "../src/os_factory.hpp" #include "../src/os_factory.hpp"
#include "../src/generic_bitmap.hpp" #include "../src/generic_bitmap.hpp"
#include "../src/top_window.hpp" #include "../src/top_window.hpp"
...@@ -143,8 +143,8 @@ void Builder::addTheme( const BuilderData::Theme &rData ) ...@@ -143,8 +143,8 @@ void Builder::addTheme( const BuilderData::Theme &rData )
void Builder::addBitmap( const BuilderData::Bitmap &rData ) void Builder::addBitmap( const BuilderData::Bitmap &rData )
{ {
GenericBitmap *pBmp = GenericBitmap *pBmp =
new PngBitmap( getIntf(), m_pImageHandler, new FileBitmap( getIntf(), m_pImageHandler,
rData.m_fileName, rData.m_alphaColor ); rData.m_fileName, rData.m_alphaColor );
m_pTheme->m_bitmaps[rData.m_id] = GenericBitmapPtr( pBmp ); m_pTheme->m_bitmaps[rData.m_id] = GenericBitmapPtr( pBmp );
} }
...@@ -152,7 +152,7 @@ void Builder::addBitmap( const BuilderData::Bitmap &rData ) ...@@ -152,7 +152,7 @@ void Builder::addBitmap( const BuilderData::Bitmap &rData )
void Builder::addBitmapFont( const BuilderData::BitmapFont &rData ) void Builder::addBitmapFont( const BuilderData::BitmapFont &rData )
{ {
GenericBitmap *pBmp = GenericBitmap *pBmp =
new PngBitmap( getIntf(), m_pImageHandler, rData.m_file, 0 ); new FileBitmap( getIntf(), m_pImageHandler, rData.m_file, 0 );
m_pTheme->m_bitmaps[rData.m_id] = GenericBitmapPtr( pBmp ); m_pTheme->m_bitmaps[rData.m_id] = GenericBitmapPtr( pBmp );
GenericFont *pFont = new BitmapFont( getIntf(), *pBmp, rData.m_type ); GenericFont *pFont = new BitmapFont( getIntf(), *pBmp, rData.m_type );
......
/***************************************************************************** /*****************************************************************************
* png_bitmap.cpp * file_bitmap.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 the VideoLAN team * Copyright (C) 2003 the VideoLAN team
* $Id$ * $Id$
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include "vlc_image.h" #include "vlc_image.h"
#include "png_bitmap.hpp" #include "file_bitmap.hpp"
PngBitmap::PngBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler, FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
string fileName, uint32_t aColor ): string fileName, uint32_t aColor ):
GenericBitmap( pIntf ), m_width( 0 ), m_height( 0 ) GenericBitmap( pIntf ), m_width( 0 ), m_height( 0 )
{ {
video_format_t fmt_in = {0}, fmt_out = {0}; video_format_t fmt_in = {0}, fmt_out = {0};
...@@ -76,17 +76,17 @@ PngBitmap::PngBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler, ...@@ -76,17 +76,17 @@ PngBitmap::PngBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
} }
PngBitmap::~PngBitmap() FileBitmap::~FileBitmap()
{ {
if( m_pData ) delete[] m_pData; if( m_pData ) delete[] m_pData;
} }
uint8_t *PngBitmap::getData() const uint8_t *FileBitmap::getData() const
{ {
if( m_pData == NULL ) if( m_pData == NULL )
{ {
msg_Warn( getIntf(), "PngBitmap::getData() returns NULL" ); msg_Warn( getIntf(), "FileBitmap::getData() returns NULL" );
} }
return m_pData; return m_pData;
} }
/***************************************************************************** /*****************************************************************************
* png_bitmap.hpp * file_bitmap.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 the VideoLAN team * Copyright (C) 2003 the VideoLAN team
* $Id$ * $Id$
...@@ -22,23 +22,23 @@ ...@@ -22,23 +22,23 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef PNG_BITMAP_HPP #ifndef FILE_BITMAP_HPP
#define PNG_BITMAP_HPP #define FILE_BITMAP_HPP
#include "generic_bitmap.hpp" #include "generic_bitmap.hpp"
#include <string> #include <string>
/// Class for PNG bitmaps /// Class for file bitmaps
class PngBitmap: public GenericBitmap class FileBitmap: public GenericBitmap
{ {
public: public:
/// Load a PNG bitmap from a file. aColor is the transparency /// Load a bitmap from a file. aColor is the transparency
/// color, in the format 0xRRGGBB /// color, in the format 0xRRGGBB
PngBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler, FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
string fileName, uint32_t aColor ); string fileName, uint32_t aColor );
virtual ~PngBitmap(); virtual ~FileBitmap();
/// Get the width of the bitmap /// Get the width of the bitmap
virtual int getWidth() const { return m_width; } virtual int getWidth() const { return m_width; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment