Commit 07391315 authored by Cyril Deguet's avatar Cyril Deguet

* all: support of animated bitmaps in skins: there are new attributes

  "nbFrames" and "fps" in the (Sub)Bitmap elements to set the number
  of frames and the frame rate in a bitmap. As in the radialslider,
  the different frames are just laid vertically in the bitamp (and
  all the frames must have the same size)
  At the moment animated bitmaps are only supported in Button controls.
parent eba35637
...@@ -91,6 +91,8 @@ SOURCES_skins2 = \ ...@@ -91,6 +91,8 @@ SOURCES_skins2 = \
\ \
src/anchor.cpp \ src/anchor.cpp \
src/anchor.hpp \ src/anchor.hpp \
src/anim_bitmap.cpp \
src/anim_bitmap.hpp \
src/bitmap_font.cpp \ src/bitmap_font.cpp \
src/bitmap_font.hpp \ src/bitmap_font.hpp \
src/dialogs.cpp \ src/dialogs.cpp \
......
...@@ -37,24 +37,12 @@ CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp, ...@@ -37,24 +37,12 @@ CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
VarBool *pVisible ): VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_rCommand( rCommand ), m_tooltip( rTooltip ), m_rCommand( rCommand ), m_tooltip( rTooltip ),
m_cmdUpOverDownOver( this ), m_cmdDownOverUpOver( this ), m_imgUp( pIntf, rBmpUp ), m_imgOver( pIntf, rBmpOver ),
m_cmdDownOverDown( this ), m_cmdDownDownOver( this ), m_imgDown( pIntf, rBmpDown ), m_pImg( NULL ), m_cmdUpOverDownOver( this ),
m_cmdUpOverUp( this ), m_cmdUpUpOver( this ), m_cmdDownOverUpOver( this ), m_cmdDownOverDown( this ),
m_cmdDownUp( this ), m_cmdUpHidden( this ), m_cmdDownDownOver( this ), m_cmdUpOverUp( this ), m_cmdUpUpOver( this ),
m_cmdHiddenUp( this ) m_cmdDownUp( this ), m_cmdUpHidden( this ), m_cmdHiddenUp( this )
{ {
// Build the images of the button
OSFactory *pOsFactory = OSFactory::instance( pIntf );
m_pImgUp = pOsFactory->createOSGraphics( rBmpUp.getWidth(),
rBmpUp.getHeight() );
m_pImgUp->drawBitmap( rBmpUp, 0, 0 );
m_pImgDown = pOsFactory->createOSGraphics( rBmpDown.getWidth(),
rBmpDown.getHeight() );
m_pImgDown->drawBitmap( rBmpDown, 0, 0 );
m_pImgOver = pOsFactory->createOSGraphics( rBmpOver.getWidth(),
rBmpOver.getHeight() );
m_pImgOver->drawBitmap( rBmpOver, 0, 0 );
// States // States
m_fsm.addState( "up" ); m_fsm.addState( "up" );
m_fsm.addState( "down" ); m_fsm.addState( "down" );
...@@ -84,15 +72,12 @@ CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp, ...@@ -84,15 +72,12 @@ CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
// Initial state // Initial state
m_fsm.setState( "up" ); m_fsm.setState( "up" );
m_pImg = m_pImgUp; setImage( &m_imgUp );
} }
CtrlButton::~CtrlButton() CtrlButton::~CtrlButton()
{ {
SKINS_DELETE( m_pImgUp );
SKINS_DELETE( m_pImgDown );
SKINS_DELETE( m_pImgOver );
} }
...@@ -120,26 +105,49 @@ void CtrlButton::draw( OSGraphics &rImage, int xDest, int yDest ) ...@@ -120,26 +105,49 @@ void CtrlButton::draw( OSGraphics &rImage, int xDest, int yDest )
if( m_pImg ) if( m_pImg )
{ {
// Draw the current image // Draw the current image
rImage.drawGraphics( *m_pImg, 0, 0, xDest, yDest ); m_pImg->draw( rImage, xDest, yDest );
}
}
void CtrlButton::setImage( AnimBitmap *pImg )
{
AnimBitmap *pOldImg = m_pImg;
m_pImg = pImg;
if( pOldImg )
{
pOldImg->stopAnim();
pOldImg->delObserver( this );
} }
if( pImg )
{
pImg->startAnim();
pImg->addObserver( this );
}
notifyLayoutMaxSize( pOldImg, pImg );
}
void CtrlButton::onUpdate( Subject<AnimBitmap> &rBitmap )
{
notifyLayout();
} }
void CtrlButton::CmdUpOverDownOver::execute() void CtrlButton::CmdUpOverDownOver::execute()
{ {
m_pParent->captureMouse(); m_pParent->captureMouse();
const OSGraphics *pOldImg = m_pParent->m_pImg; m_pParent->setImage( &m_pParent->m_imgDown );
m_pParent->m_pImg = m_pParent->m_pImgDown;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
} }
void CtrlButton::CmdDownOverUpOver::execute() void CtrlButton::CmdDownOverUpOver::execute()
{ {
m_pParent->releaseMouse(); m_pParent->releaseMouse();
const OSGraphics *pOldImg = m_pParent->m_pImg; m_pParent->setImage( &m_pParent->m_imgUp );
m_pParent->m_pImg = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
// Execute the command associated to this button // Execute the command associated to this button
m_pParent->m_rCommand.execute(); m_pParent->m_rCommand.execute();
} }
...@@ -147,33 +155,25 @@ void CtrlButton::CmdDownOverUpOver::execute() ...@@ -147,33 +155,25 @@ void CtrlButton::CmdDownOverUpOver::execute()
void CtrlButton::CmdDownOverDown::execute() void CtrlButton::CmdDownOverDown::execute()
{ {
const OSGraphics *pOldImg = m_pParent->m_pImg; m_pParent->setImage( &m_pParent->m_imgUp );
m_pParent->m_pImg = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
} }
void CtrlButton::CmdDownDownOver::execute() void CtrlButton::CmdDownDownOver::execute()
{ {
const OSGraphics *pOldImg = m_pParent->m_pImg; m_pParent->setImage( &m_pParent->m_imgDown );
m_pParent->m_pImg = m_pParent->m_pImgDown;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
} }
void CtrlButton::CmdUpUpOver::execute() void CtrlButton::CmdUpUpOver::execute()
{ {
const OSGraphics *pOldImg = m_pParent->m_pImg; m_pParent->setImage( &m_pParent->m_imgOver );
m_pParent->m_pImg = m_pParent->m_pImgOver;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
} }
void CtrlButton::CmdUpOverUp::execute() void CtrlButton::CmdUpOverUp::execute()
{ {
const OSGraphics *pOldImg = m_pParent->m_pImg; m_pParent->setImage( &m_pParent->m_imgUp );
m_pParent->m_pImg = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
} }
...@@ -185,16 +185,12 @@ void CtrlButton::CmdDownUp::execute() ...@@ -185,16 +185,12 @@ void CtrlButton::CmdDownUp::execute()
void CtrlButton::CmdUpHidden::execute() void CtrlButton::CmdUpHidden::execute()
{ {
const OSGraphics *pOldImg = m_pParent->m_pImg; m_pParent->setImage( NULL );
m_pParent->m_pImg = NULL;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
} }
void CtrlButton::CmdHiddenUp::execute() void CtrlButton::CmdHiddenUp::execute()
{ {
const OSGraphics *pOldImg = m_pParent->m_pImg; m_pParent->setImage( &m_pParent->m_imgUp );
m_pParent->m_pImg = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
} }
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
#include "ctrl_generic.hpp" #include "ctrl_generic.hpp"
#include "../utils/fsm.hpp" #include "../utils/fsm.hpp"
#include "../src/anim_bitmap.hpp"
class GenericBitmap; class GenericBitmap;
class OSGraphics;
class CmdGeneric; class CmdGeneric;
/// Base class for button controls /// Base class for button controls
class CtrlButton: public CtrlGeneric class CtrlButton: public CtrlGeneric, public Observer<AnimBitmap>
{ {
public: public:
/// Create a button with 3 images /// Create a button with 3 images
...@@ -69,9 +69,9 @@ class CtrlButton: public CtrlGeneric ...@@ -69,9 +69,9 @@ class CtrlButton: public CtrlGeneric
/// Tooltip text /// Tooltip text
const UString m_tooltip; const UString m_tooltip;
/// Images of the button in the different states /// Images of the button in the different states
OSGraphics *m_pImgUp, *m_pImgOver, *m_pImgDown; AnimBitmap m_imgUp, m_imgOver, m_imgDown;
/// Current image /// Current image
OSGraphics *m_pImg; AnimBitmap *m_pImg;
/// Callback objects /// Callback objects
DEFINE_CALLBACK( CtrlButton, UpOverDownOver ) DEFINE_CALLBACK( CtrlButton, UpOverDownOver )
...@@ -83,6 +83,12 @@ class CtrlButton: public CtrlGeneric ...@@ -83,6 +83,12 @@ class CtrlButton: public CtrlGeneric
DEFINE_CALLBACK( CtrlButton, DownUp ) DEFINE_CALLBACK( CtrlButton, DownUp )
DEFINE_CALLBACK( CtrlButton, UpHidden ) DEFINE_CALLBACK( CtrlButton, UpHidden )
DEFINE_CALLBACK( CtrlButton, HiddenUp ) DEFINE_CALLBACK( CtrlButton, HiddenUp )
/// Change the current image
void setImage( AnimBitmap *pImg );
/// Method called when an animated bitmap changes
virtual void onUpdate( Subject<AnimBitmap> &rBitmap );
}; };
......
...@@ -80,8 +80,7 @@ void CtrlGeneric::notifyLayout( int width, int height, ...@@ -80,8 +80,7 @@ void CtrlGeneric::notifyLayout( int width, int height,
} }
void CtrlGeneric::notifyLayoutMaxSize( const OSGraphics *pImg1, void CtrlGeneric::notifyLayoutMaxSize( const Box *pImg1, const Box *pImg2 )
const OSGraphics *pImg2 )
{ {
if( pImg1 == NULL ) if( pImg1 == NULL )
{ {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "../utils/observer.hpp" #include "../utils/observer.hpp"
#include "../commands/cmd_generic.hpp" #include "../commands/cmd_generic.hpp"
class Box;
class EvtGeneric; class EvtGeneric;
class OSGraphics; class OSGraphics;
class GenericLayout; class GenericLayout;
...@@ -94,8 +95,8 @@ class CtrlGeneric: public SkinObject, public Observer<VarBool> ...@@ -94,8 +95,8 @@ class CtrlGeneric: public SkinObject, public Observer<VarBool>
/// Same as notifyLayout(), but takes optional images as parameters. /// Same as notifyLayout(), but takes optional images as parameters.
/// The maximum size(s) of the images will be used for repainting. /// The maximum size(s) of the images will be used for repainting.
void notifyLayoutMaxSize( const OSGraphics *pImg1 = NULL, void notifyLayoutMaxSize( const Box *pImg1 = NULL,
const OSGraphics *pImg2 = NULL ); const Box *pImg2 = NULL );
/// Ask the layout to capture the mouse /// Ask the layout to capture the mouse
virtual void captureMouse() const; virtual void captureMouse() const;
......
...@@ -146,7 +146,8 @@ void Builder::addBitmap( const BuilderData::Bitmap &rData ) ...@@ -146,7 +146,8 @@ void Builder::addBitmap( const BuilderData::Bitmap &rData )
{ {
GenericBitmap *pBmp = GenericBitmap *pBmp =
new FileBitmap( getIntf(), m_pImageHandler, new FileBitmap( getIntf(), m_pImageHandler,
getFilePath( rData.m_fileName ), rData.m_alphaColor ); getFilePath( rData.m_fileName ), rData.m_alphaColor,
rData.m_nbFrames, rData.m_fps );
if( !pBmp->getData() ) if( !pBmp->getData() )
{ {
// Invalid bitmap // Invalid bitmap
...@@ -171,7 +172,8 @@ void Builder::addSubBitmap( const BuilderData::SubBitmap &rData ) ...@@ -171,7 +172,8 @@ void Builder::addSubBitmap( const BuilderData::SubBitmap &rData )
// Copy a region of the parent bitmap to the new one // Copy a region of the parent bitmap to the new one
BitmapImpl *pBmp = BitmapImpl *pBmp =
new BitmapImpl( getIntf(), rData.m_width, rData.m_height ); new BitmapImpl( getIntf(), rData.m_width, rData.m_height,
rData.m_nbFrames, rData.m_fps );
bool res = pBmp->drawBitmap( *pParentBmp, rData.m_x, rData.m_y, 0, 0, bool res = pBmp->drawBitmap( *pParentBmp, rData.m_x, rData.m_y, 0, 0,
rData.m_width, rData.m_height ); rData.m_width, rData.m_height );
if( !res ) if( !res )
......
Theme tooltipfont:string magnet:int alpha:uint32_t moveAlpha:uint32_t Theme tooltipfont:string magnet:int alpha:uint32_t moveAlpha:uint32_t
Bitmap id:string fileName:string alphaColor:uint32_t Bitmap id:string fileName:string alphaColor:uint32_t nbFrames:int fps:int
SubBitmap id:string parent:string x:int y:int width:int height:int SubBitmap id:string parent:string x:int y:int width:int height:int nbFrames:int fps:int
BitmapFont id:string file:string type:string BitmapFont id:string file:string type:string
Font id:string fontFile:string size:int Font id:string fontFile:string size:int
Window id:string xPos:int yPos:int visible:bool dragDrop:bool playOnDrop:bool Window id:string xPos:int yPos:int visible:bool dragDrop:bool playOnDrop:bool
......
...@@ -56,12 +56,14 @@ m_tooltipfont( tooltipfont ), m_magnet( magnet ), m_alpha( alpha ), m_moveAlpha( ...@@ -56,12 +56,14 @@ m_tooltipfont( tooltipfont ), m_magnet( magnet ), m_alpha( alpha ), m_moveAlpha(
/// Type definition /// Type definition
struct Bitmap struct Bitmap
{ {
Bitmap( const string & id, const string & fileName, uint32_t alphaColor ): Bitmap( const string & id, const string & fileName, uint32_t alphaColor, int nbFrames, int fps ):
m_id( id ), m_fileName( fileName ), m_alphaColor( alphaColor ) {} m_id( id ), m_fileName( fileName ), m_alphaColor( alphaColor ), m_nbFrames( nbFrames ), m_fps( fps ) {}
string m_id; string m_id;
string m_fileName; string m_fileName;
uint32_t m_alphaColor; uint32_t m_alphaColor;
int m_nbFrames;
int m_fps;
}; };
/// List /// List
list<Bitmap> m_listBitmap; list<Bitmap> m_listBitmap;
...@@ -69,8 +71,8 @@ m_id( id ), m_fileName( fileName ), m_alphaColor( alphaColor ) {} ...@@ -69,8 +71,8 @@ m_id( id ), m_fileName( fileName ), m_alphaColor( alphaColor ) {}
/// Type definition /// Type definition
struct SubBitmap struct SubBitmap
{ {
SubBitmap( const string & id, const string & parent, int x, int y, int width, int height ): SubBitmap( const string & id, const string & parent, int x, int y, int width, int height, int nbFrames, int fps ):
m_id( id ), m_parent( parent ), m_x( x ), m_y( y ), m_width( width ), m_height( height ) {} m_id( id ), m_parent( parent ), m_x( x ), m_y( y ), m_width( width ), m_height( height ), m_nbFrames( nbFrames ), m_fps( fps ) {}
string m_id; string m_id;
string m_parent; string m_parent;
...@@ -78,6 +80,8 @@ m_id( id ), m_parent( parent ), m_x( x ), m_y( y ), m_width( width ), m_height( ...@@ -78,6 +80,8 @@ m_id( id ), m_parent( parent ), m_x( x ), m_y( y ), m_width( width ), m_height(
int m_y; int m_y;
int m_width; int m_width;
int m_height; int m_height;
int m_nbFrames;
int m_fps;
}; };
/// List /// List
list<SubBitmap> m_listSubBitmap; list<SubBitmap> m_listSubBitmap;
......
...@@ -91,10 +91,13 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr ) ...@@ -91,10 +91,13 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
RequireDefault( "id" ); RequireDefault( "id" );
RequireDefault( "file" ); RequireDefault( "file" );
RequireDefault( "alphacolor" ); RequireDefault( "alphacolor" );
CheckDefault( "nbFrames", "1" );
CheckDefault( "fps", "4" );
m_curBitmapId = uniqueId( attr["id"] ); m_curBitmapId = uniqueId( attr["id"] );
const BuilderData::Bitmap bitmap( m_curBitmapId, const BuilderData::Bitmap bitmap( m_curBitmapId,
attr["file"], convertColor( attr["alphacolor"] ) ); attr["file"], convertColor( attr["alphacolor"] ),
atoi( attr["nbFrames"] ), atoi( attr["fps"] ) );
m_pData->m_listBitmap.push_back( bitmap ); m_pData->m_listBitmap.push_back( bitmap );
} }
...@@ -105,10 +108,13 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr ) ...@@ -105,10 +108,13 @@ void SkinParser::handleBeginElement( const string &rName, AttrList_t &attr )
RequireDefault( "y" ); RequireDefault( "y" );
RequireDefault( "width" ); RequireDefault( "width" );
RequireDefault( "height" ); RequireDefault( "height" );
CheckDefault( "nbFrames", "1" );
CheckDefault( "fps", "4" );
const BuilderData::SubBitmap bitmap( attr["id"], const BuilderData::SubBitmap bitmap( attr["id"],
m_curBitmapId, atoi( attr["x"] ), atoi( attr["y"] ), m_curBitmapId, atoi( attr["x"] ), atoi( attr["y"] ),
atoi( attr["width"] ), atoi( attr["height"] ) ); atoi( attr["width"] ), atoi( attr["height"] ),
atoi( attr["nbFrames"] ), atoi( attr["fps"] ) );
m_pData->m_listSubBitmap.push_back( bitmap ); m_pData->m_listSubBitmap.push_back( bitmap );
} }
......
...@@ -27,8 +27,10 @@ ...@@ -27,8 +27,10 @@
#include "file_bitmap.hpp" #include "file_bitmap.hpp"
FileBitmap::FileBitmap( 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, int nbFrames,
GenericBitmap( pIntf ), m_width( 0 ), m_height( 0 ), m_pData( NULL ) int fps ):
GenericBitmap( pIntf, nbFrames, fps ), m_width( 0 ), m_height( 0 ),
m_pData( NULL )
{ {
video_format_t fmt_in = {0}, fmt_out = {0}; video_format_t fmt_in = {0}, fmt_out = {0};
picture_t *pPic; picture_t *pPic;
......
...@@ -36,7 +36,8 @@ class FileBitmap: public GenericBitmap ...@@ -36,7 +36,8 @@ class FileBitmap: public GenericBitmap
/// Load a 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
FileBitmap( 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, int nbFrames = 1,
int fps = 0 );
virtual ~FileBitmap(); virtual ~FileBitmap();
......
...@@ -24,9 +24,16 @@ ...@@ -24,9 +24,16 @@
#include "generic_bitmap.hpp" #include "generic_bitmap.hpp"
BitmapImpl::BitmapImpl( intf_thread_t *pIntf, int width, int height ): GenericBitmap::GenericBitmap( intf_thread_t *pIntf, int nbFrames, int fps ):
GenericBitmap( pIntf ), m_width( width ), m_height( height ), SkinObject( pIntf ), m_nbFrames( nbFrames ), m_frameRate( fps )
m_pData( NULL ) {
}
BitmapImpl::BitmapImpl( intf_thread_t *pIntf, int width, int height,
int nbFrames, int fps ):
GenericBitmap( pIntf, nbFrames, fps ), m_width( width ),
m_height( height ), m_pData( NULL )
{ {
m_pData = new uint8_t[width * height * 4]; m_pData = new uint8_t[width * height * 4];
memset( m_pData, 0, width * height * 4 ); memset( m_pData, 0, width * height * 4 );
......
...@@ -27,26 +27,33 @@ ...@@ -27,26 +27,33 @@
#include "skin_common.hpp" #include "skin_common.hpp"
#include "../utils/pointer.hpp" #include "../utils/pointer.hpp"
#include "../utils/position.hpp"
/// Generic interface for bitmaps /// Generic interface for bitmaps
class GenericBitmap: public SkinObject class GenericBitmap: public SkinObject, public Box
{ {
public: public:
virtual ~GenericBitmap() {} virtual ~GenericBitmap() {}
/// Get the width of the bitmap
virtual int getWidth() const = 0;
/// Get the heighth of the bitmap
virtual int getHeight() const = 0;
/// Get a linear buffer containing the image data. /// Get a linear buffer containing the image data.
/// Each pixel is stored in 4 bytes in the order B,G,R,A /// Each pixel is stored in 4 bytes in the order B,G,R,A
virtual uint8_t *getData() const = 0; virtual uint8_t *getData() const = 0;
/// Get the number of frames in the bitmap
int getNbFrames() const { return m_nbFrames; }
/// Get the number of frames per second (for animated bitmaps)
int getFrameRate() const { return m_frameRate; }
protected: protected:
GenericBitmap( intf_thread_t *pIntf ): SkinObject( pIntf ) {} GenericBitmap( intf_thread_t *pIntf, int nbFrames = 1, int fps = 0);
private:
/// Number of frames
int m_nbFrames;
/// Frame rate
int m_frameRate;
}; };
...@@ -55,7 +62,8 @@ class BitmapImpl: public GenericBitmap ...@@ -55,7 +62,8 @@ class BitmapImpl: public GenericBitmap
{ {
public: public:
/// Create an empty bitmap of the given size /// Create an empty bitmap of the given size
BitmapImpl( intf_thread_t *pIntf, int width, int height ); BitmapImpl( intf_thread_t *pIntf, int width, int height,
int nbFrames = 1, int fps = 0 );
~BitmapImpl(); ~BitmapImpl();
/// Get the width of the bitmap /// Get the width of the bitmap
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define OS_GRAPHICS_HPP #define OS_GRAPHICS_HPP
#include "skin_common.hpp" #include "skin_common.hpp"
#include "../utils/position.hpp"
#include "../utils/pointer.hpp" #include "../utils/pointer.hpp"
class GenericBitmap; class GenericBitmap;
...@@ -33,7 +34,7 @@ class OSWindow; ...@@ -33,7 +34,7 @@ class OSWindow;
/// OS specific graphics class /// OS specific graphics class
class OSGraphics: public SkinObject class OSGraphics: public SkinObject, public Box
{ {
public: public:
virtual ~OSGraphics() {} virtual ~OSGraphics() {}
...@@ -72,10 +73,6 @@ class OSGraphics: public SkinObject ...@@ -72,10 +73,6 @@ class OSGraphics: public SkinObject
/// Tell whether the pixel at the given position is visible /// Tell whether the pixel at the given position is visible
virtual bool hit( int x, int y ) const = 0; virtual bool hit( int x, int y ) const = 0;
/// Getters
virtual int getWidth() const = 0;
virtual int getHeight() const = 0;
protected: protected:
OSGraphics( intf_thread_t *pIntf ): SkinObject( pIntf ) {} OSGraphics( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
}; };
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
id CDATA #REQUIRED id CDATA #REQUIRED
file CDATA #REQUIRED file CDATA #REQUIRED
alphacolor CDATA #REQUIRED alphacolor CDATA #REQUIRED
nbFrames CDATA "1"
fps CDATA "0"
> >
<!ELEMENT SubBitmap EMPTY> <!ELEMENT SubBitmap EMPTY>
<!ATTLIST SubBitmap <!ATTLIST SubBitmap
...@@ -29,6 +31,8 @@ ...@@ -29,6 +31,8 @@
y CDATA #REQUIRED y CDATA #REQUIRED
width CDATA #REQUIRED width CDATA #REQUIRED
height CDATA #REQUIRED height CDATA #REQUIRED
nbFrames CDATA "1"
fps CDATA "0"
> >
<!ELEMENT Font EMPTY> <!ELEMENT Font EMPTY>
<!ATTLIST Font <!ATTLIST Font
......
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