summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-11 17:38:55 (UTC)
committer simon <simon>2002-12-11 17:38:55 (UTC)
commit719acab56c57f283168b955582ab5b30b9809b02 (patch) (unidiff)
tree370c9f8bae6741b0ee2303b6c04f9329757a8a3e
parentaaac5c934e7053fa4323b03f7ea31c32c6388883 (diff)
downloadopie-719acab56c57f283168b955582ab5b30b9809b02.zip
opie-719acab56c57f283168b955582ab5b30b9809b02.tar.gz
opie-719acab56c57f283168b955582ab5b30b9809b02.tar.bz2
- copyright notice fixlet
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp15
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h14
-rw-r--r--noncore/multimedia/opieplayer2/singleton.h19
-rw-r--r--noncore/multimedia/opieplayer2/skin.cpp21
-rw-r--r--noncore/multimedia/opieplayer2/skin.h22
5 files changed, 76 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp
index c0106d4..702e6d7 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.cpp
+++ b/noncore/multimedia/opieplayer2/mediawidget.cpp
@@ -1,55 +1,54 @@
1/* 1/*
2 Copyright (C) 2002 Simon Hausmann <hausmann@kde.org> 2 Copyright (C) 2002 Simon Hausmann <simon@lst.de>
3 (C) 2002 Max Reiss <harlekin@handhelds.org> 3 (C) 2002 Max Reiss <harlekin@handhelds.org>
4 (C) 2002 L. Potter <ljp@llornkcor.com> 4 (C) 2002 L. Potter <ljp@llornkcor.com>
5 (C) 2002 Holger Freyther <zecke@handhelds.org> 5 (C) 2002 Holger Freyther <zecke@handhelds.org>
6 6
7 This library is free software; you can redistribute it and/or 7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
11 11
12 This library is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23
24#include "mediawidget.h" 23#include "mediawidget.h"
25#include "playlistwidget.h" 24#include "playlistwidget.h"
26#include "skin.h" 25#include "skin.h"
27 26
28MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) 27MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name )
29 : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) 28 : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList )
30{ 29{
31 connect( &mediaPlayerState, SIGNAL( displayTypeChanged( MediaPlayerState::DisplayType ) ), 30 connect( &mediaPlayerState, SIGNAL( displayTypeChanged( MediaPlayerState::DisplayType ) ),
32 this, SLOT( setDisplayType( MediaPlayerState::DisplayType ) ) ); 31 this, SLOT( setDisplayType( MediaPlayerState::DisplayType ) ) );
33 connect( &mediaPlayerState, SIGNAL( lengthChanged( long ) ), 32 connect( &mediaPlayerState, SIGNAL( lengthChanged( long ) ),
34 this, SLOT( setLength( long ) ) ); 33 this, SLOT( setLength( long ) ) );
35 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), 34 connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ),
36 this, SLOT( setPlaying( bool ) ) ); 35 this, SLOT( setPlaying( bool ) ) );
37} 36}
38 37
39MediaWidget::~MediaWidget() 38MediaWidget::~MediaWidget()
40{ 39{
41} 40}
42 41
43void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, 42void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount,
44 const Skin &skin ) 43 const Skin &skin )
45{ 44{
46 buttonMask = skin.buttonMask( skinInfo, buttonCount ); 45 buttonMask = skin.buttonMask( skinInfo, buttonCount );
47 46
48 buttons.clear(); 47 buttons.clear();
49 buttons.reserve( buttonCount ); 48 buttons.reserve( buttonCount );
50 49
51 for ( uint i = 0; i < buttonCount; ++i ) { 50 for ( uint i = 0; i < buttonCount; ++i ) {
52 Button button = setupButton( skinInfo[ i ], skin ); 51 Button button = setupButton( skinInfo[ i ], skin );
53 buttons.push_back( button ); 52 buttons.push_back( button );
54 } 53 }
55} 54}
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 64483d8..40eb0af 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -1,50 +1,50 @@
1/* 1/*
2 Copyright (C) 2002 Simon Hausmann <hausmann@kde.org> 2 Copyright (C) 2002 Simon Hausmann <simon@lst.de>
3 (C) 2002 Max Reiss <harlekin@handhelds.org> 3 (C) 2002 Max Reiss <harlekin@handhelds.org>
4 (C) 2002 L. Potter <ljp@llornkcor.com> 4 (C) 2002 L. Potter <ljp@llornkcor.com>
5 (C) 2002 Holger Freyther <zecke@handhelds.org> 5 (C) 2002 Holger Freyther <zecke@handhelds.org>
6 6
7 This library is free software; you can redistribute it and/or 7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
11 11
12 This library is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. 20 Boston, MA 02111-1307, USA.
21*/ 21*/
22 22
23#ifndef MEDIAWIDGET_H 23#ifndef MEDIAWIDGET_H
24#define MEDIAWIDGET_H 24#define MEDIAWIDGET_H
25 25
26#include <qwidget.h> 26#include <qwidget.h>
27#include <qmap.h> 27#include <qmap.h>
28 28
29#include "mediaplayerstate.h" 29#include "mediaplayerstate.h"
30#include "playlistwidget.h" 30#include "playlistwidget.h"
31 31
32#include <vector> 32#include <vector>
33#include <memory> 33#include <memory>
34 34
35namespace 35namespace
36{ 36{
37 struct simpleAndStupidAllocator 37 struct simpleAndStupidAllocator
38 { 38 {
39 static void *allocate( size_t amount ) 39 static void *allocate( size_t amount )
40 { return ::operator new( amount ); } 40 { return ::operator new( amount ); }
41 static void deallocate( void *p, size_t ) 41 static void deallocate( void *p, size_t )
42 { ::operator delete( p ); } 42 { ::operator delete( p ); }
43 }; 43 };
44} 44}
45 45
46class Skin; 46class Skin;
47 47
48class MediaWidget : public QWidget 48class MediaWidget : public QWidget
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
diff --git a/noncore/multimedia/opieplayer2/singleton.h b/noncore/multimedia/opieplayer2/singleton.h
index 35b3dff..83e228f 100644
--- a/noncore/multimedia/opieplayer2/singleton.h
+++ b/noncore/multimedia/opieplayer2/singleton.h
@@ -1,32 +1,51 @@
1/*
2 Copyright (C) 2002 Simon Hausmann <simon@lst.de>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18*/
19
1#ifndef SINGLETON_H 20#ifndef SINGLETON_H
2#define SINGLETON_H 21#define SINGLETON_H
3 22
4template <class Product> 23template <class Product>
5struct DefaultSingletonCreator 24struct DefaultSingletonCreator
6{ 25{
7 static Product *create() { return new Product; } 26 static Product *create() { return new Product; }
8}; 27};
9 28
10template <class Product> 29template <class Product>
11struct NullSingletonCreator 30struct NullSingletonCreator
12{ 31{
13 static Product *create() { return 0; } 32 static Product *create() { return 0; }
14}; 33};
15 34
16template 35template
17< 36<
18 class T, 37 class T,
19 template <class> class Creator = DefaultSingletonCreator 38 template <class> class Creator = DefaultSingletonCreator
20> 39>
21class Singleton 40class Singleton
22{ 41{
23public: 42public:
24 static T &self() 43 static T &self()
25 { 44 {
26 if ( !s_self ) 45 if ( !s_self )
27 s_self = Creator<T>::create(); 46 s_self = Creator<T>::create();
28 return *s_self; 47 return *s_self;
29 } 48 }
30 49
31protected: 50protected:
32 Singleton() 51 Singleton()
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp
index 0de3023..cef3259 100644
--- a/noncore/multimedia/opieplayer2/skin.cpp
+++ b/noncore/multimedia/opieplayer2/skin.cpp
@@ -1,32 +1,53 @@
1/*
2 Copyright (C) 2002 Simon Hausmann <simon@lst.de>
3 (C) 2002 Max Reiss <harlekin@handhelds.org>
4 (C) 2002 L. Potter <ljp@llornkcor.com>
5 (C) 2002 Holger Freyther <zecke@handhelds.org>
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
21*/
1 22
2#include "skin.h" 23#include "skin.h"
3 24
4#include <qpe/resource.h> 25#include <qpe/resource.h>
5#include <qpe/config.h> 26#include <qpe/config.h>
6 27
7#include <assert.h> 28#include <assert.h>
8 29
9Skin::Skin( const QString &name, const QString &fileNameInfix ) 30Skin::Skin( const QString &name, const QString &fileNameInfix )
10 : m_fileNameInfix( fileNameInfix ) 31 : m_fileNameInfix( fileNameInfix )
11{ 32{
12 init( name ); 33 init( name );
13} 34}
14 35
15Skin::Skin( const QString &fileNameInfix ) 36Skin::Skin( const QString &fileNameInfix )
16 : m_fileNameInfix( fileNameInfix ) 37 : m_fileNameInfix( fileNameInfix )
17{ 38{
18 init( defaultSkinName() ); 39 init( defaultSkinName() );
19} 40}
20 41
21void Skin::init( const QString &name ) 42void Skin::init( const QString &name )
22{ 43{
23 m_skinPath = "opieplayer2/skins/" + name; 44 m_skinPath = "opieplayer2/skins/" + name;
24} 45}
25 46
26void Skin::preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) 47void Skin::preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount )
27{ 48{
28 backgroundImage(); 49 backgroundImage();
29 buttonUpImage(); 50 buttonUpImage();
30 buttonDownImage(); 51 buttonDownImage();
31 ( void )buttonMask( skinButtonInfo, buttonCount ); 52 ( void )buttonMask( skinButtonInfo, buttonCount );
32} 53}
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h
index c15d9dc..9f7326e 100644
--- a/noncore/multimedia/opieplayer2/skin.h
+++ b/noncore/multimedia/opieplayer2/skin.h
@@ -1,32 +1,54 @@
1/*
2 Copyright (C) 2002 Simon Hausmann <simon@lst.de>
3 (C) 2002 Max Reiss <harlekin@handhelds.org>
4 (C) 2002 L. Potter <ljp@llornkcor.com>
5 (C) 2002 Holger Freyther <zecke@handhelds.org>
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
21*/
22
1#ifndef SKIN_H 23#ifndef SKIN_H
2#define SKIN_H 24#define SKIN_H
3 25
4#include <qstring.h> 26#include <qstring.h>
5#include <qimage.h> 27#include <qimage.h>
6#include <qmap.h> 28#include <qmap.h>
7#include <qdict.h> 29#include <qdict.h>
8 30
9#include "mediawidget.h" 31#include "mediawidget.h"
10#include "threadutil.h" 32#include "threadutil.h"
11#include "singleton.h" 33#include "singleton.h"
12 34
13class Skin 35class Skin
14{ 36{
15public: 37public:
16 Skin( const QString &name, const QString &fileNameInfix ); 38 Skin( const QString &name, const QString &fileNameInfix );
17 Skin( const QString &fileNameInfix ); 39 Skin( const QString &fileNameInfix );
18 40
19 void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ); 41 void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount );
20 42
21 QImage backgroundImage() const; 43 QImage backgroundImage() const;
22 QImage buttonUpImage() const; 44 QImage buttonUpImage() const;
23 QImage buttonDownImage() const; 45 QImage buttonDownImage() const;
24 46
25 QImage buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) const; 47 QImage buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) const;
26 48
27 QImage buttonMaskImage( const QString &fileName ) const; 49 QImage buttonMaskImage( const QString &fileName ) const;
28 50
29 static QString defaultSkinName(); 51 static QString defaultSkinName();
30 52
31private: 53private:
32 void init( const QString &name ); 54 void init( const QString &name );