summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-09 22:42:29 (UTC)
committer simon <simon>2002-12-09 22:42:29 (UTC)
commit8641065755bbb1e2ff96e7fb964d4b0cd91c65b6 (patch) (side-by-side diff)
treeecd14e4692538748ee59cba633c71024ebb7808d
parent421f5d6b87f509430836fb2c60b57f9266371121 (diff)
downloadopie-8641065755bbb1e2ff96e7fb964d4b0cd91c65b6.zip
opie-8641065755bbb1e2ff96e7fb964d4b0cd91c65b6.tar.gz
opie-8641065755bbb1e2ff96e7fb964d4b0cd91c65b6.tar.bz2
- ok, next try for that allocator. stupid gcc2 :(
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index df03b22..a9dddf8 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -19,56 +19,67 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef MEDIAWIDGET_H
#define MEDIAWIDGET_H
#include <qwidget.h>
#include <qmap.h>
#include "mediaplayerstate.h"
#include "playlistwidget.h"
#include <vector>
#include <memory>
+namespace
+{
+ struct simpleAndStupidAllocator
+ {
+ static void *allocate( size_t amount )
+ { return ::operator new( amount ); }
+ static void deallocate( void *p, size_t )
+ { ::operator delete( p ); }
+ };
+}
+
class MediaWidget : public QWidget
{
Q_OBJECT
public:
enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back, FullScreen, Undefined };
enum ButtonType { NormalButton, ToggleButton };
struct Button
{
Button() : command( Undefined ), type( NormalButton ), isDown( false ) {}
Command command;
ButtonType type; // this should be part of the bitfield but gcc2 is too buggy to support this :-(
bool isDown : 1;
QBitmap mask;
QPixmap pixUp;
QPixmap pixDown;
};
#if defined( _CC_GNU_ )
// use that allocator to avoid the default allocator that on gcc2 requires libstdc++ because
// in the BAD_ALLOC macro it uses std::cerr and friends :-(
- typedef std::vector<Button, std::__allocator<Button, std::__new_alloc> > ButtonVector;
+ typedef std::vector<Button, std::__allocator<Button, simpleAndStupidAllocator> > ButtonVector;
#else
typedef std::vector<Button> ButtonVector;
#endif
struct SkinButtonInfo
{
Command command;
const char *fileName;
ButtonType type;
};
MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 );
virtual ~MediaWidget();
public slots:
virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0;