summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/oledbox.cpp58
-rw-r--r--libopie2/opieui/oledbox.h95
-rw-r--r--libopie2/opieui/opieui.pro6
3 files changed, 106 insertions, 53 deletions
diff --git a/libopie2/opieui/oledbox.cpp b/libopie2/opieui/oledbox.cpp
index 52826f1..d18d4b6 100644
--- a/libopie2/opieui/oledbox.cpp
+++ b/libopie2/opieui/oledbox.cpp
@@ -1,4 +1,29 @@
-
-#include <qbitmap.h>
-#include <qpainter.h>
+/*
+                 This file is part of the Opie Project
+ =. (C) 2002-2005 the Opie Team <opie-devel@handhelds.org>
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This program is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
@@ -6,4 +31,8 @@
+/* QT */
+#include <qbitmap.h>
+#include <qpainter.h>
-#ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC
+namespace Opie {
+namespace Ui {
@@ -43,5 +72,2 @@ QPixmap *OLedBox::s_border_pix = 0;
-#endif
-
-
OLedBox::OLedBox ( const QColor &col, QWidget *parent, const char *name ) : QWidget ( parent, name )
@@ -56,6 +82,4 @@ OLedBox::OLedBox ( const QColor &col, QWidget *parent, const char *name ) : QWid
-#ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC
if ( !s_border_pix )
- s_border_pix = new QPixmap ( ledborder_xpm );
-#endif
+ s_border_pix = new QPixmap( ledborder_xpm );
}
@@ -144,5 +168,3 @@ void OLedBox::paintEvent ( QPaintEvent *e )
-// From KDE libkdeui / led.cpp
-
-void OLedBox::drawLed ( QPixmap *pix, const QColor &col ) // paint a ROUND SUNKEN led lamp
+void OLedBox::drawLed ( QPixmap *pix, const QColor &col )
{
@@ -223,7 +245,7 @@ void OLedBox::drawLed ( QPixmap *pix, const QColor &col ) // paint a ROUND SUNK
-#ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC
- paint. drawPixmap ( 0, 0, *s_border_pix );
- paint. end ( );
+#ifndef QT_CAN_DRAW_ARCS
+ paint.drawPixmap ( 0, 0, *s_border_pix );
+ paint.end ( );
- pix-> setMask ( pix-> createHeuristicMask ( ));
+ pix->setMask ( pix-> createHeuristicMask ( ));
@@ -277 +299,3 @@ void OLedBox::drawLed ( QPixmap *pix, const QColor &col ) // paint a ROUND SUNK
+};
+};
diff --git a/libopie2/opieui/oledbox.h b/libopie2/opieui/oledbox.h
index dd930bd..c02cc77 100644
--- a/libopie2/opieui/oledbox.h
+++ b/libopie2/opieui/oledbox.h
@@ -1,4 +1,34 @@
-#ifndef __OPIE_OLED_H__
-#define __OPIE_OLED_H__
+/*
+                 This file is part of the Opie Project
+ =. (C) 2002-2005 the Opie Team <opie-devel@handhelds.org>
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This program is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef OLEDBOX_H
+#define OLEDBOX_H
+
+/* QT */
#include <qwidget.h>
@@ -8,38 +38,38 @@ class QPixmap;
-#define _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC
+namespace Opie {
+namespace Ui {
-class OLedBox : public QWidget {
- Q_OBJECT
-
-public:
- OLedBox ( const QColor &col = red, QWidget *parent = 0, const char *name = 0 );
- virtual ~OLedBox ( );
+class OLedBox : public QWidget
+{
+ Q_OBJECT
- QColor color ( ) const;
- bool isOn ( ) const;
- void setReadOnly( bool R )
- { m_readonly = R; }
- inline bool readOnly( void ) const
- { return m_readonly; }
-
- virtual QSize sizeHint ( ) const;
+ public:
+ OLedBox( const QColor& col = red, QWidget* parent = 0, const char* name = 0 );
+ virtual ~OLedBox();
-public slots:
- void toggle ( );
- void setOn ( bool on );
- void setColor ( const QColor &col );
+ QColor color() const;
+ bool isOn() const;
+ void setReadOnly( bool R ) { m_readonly = R; }
+ bool readOnly( void ) const { return m_readonly; }
+
+ virtual QSize sizeHint() const;
+
+ public slots:
+ void toggle();
+ void setOn( bool on );
+ void setColor( const QColor& col );
-signals:
- void toggled ( bool );
+ signals:
+ void toggled( bool );
-protected:
- virtual void paintEvent ( QPaintEvent *e );
- virtual void resizeEvent ( QResizeEvent *e );
+ protected:
+ virtual void paintEvent( QPaintEvent* e );
+ virtual void resizeEvent( QResizeEvent* e );
- virtual void mousePressEvent ( QMouseEvent *e );
+ virtual void mousePressEvent( QMouseEvent* e );
-private:
- void drawLed ( QPixmap *, const QColor &col );
+ private:
+ void drawLed( QPixmap *, const QColor& col );
-private:
+ private:
QPixmap *m_pix [2];
@@ -50,7 +80,6 @@ private:
-#ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC
static QPixmap *s_border_pix;
-#endif
};
-
+};
+};
#endif
diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro
index 24157a1..ffa8b83 100644
--- a/libopie2/opieui/opieui.pro
+++ b/libopie2/opieui/opieui.pro
@@ -8,2 +8,3 @@ HEADERS = oclickablelabel.h \
okeyconfigwidget.h \
+ oledbox.h \
olistview.h \
@@ -17,3 +18,2 @@ HEADERS = oclickablelabel.h \
otabwidget.h \
- oledbox.h \
otaskbarapplet.h \
@@ -29,2 +29,3 @@ SOURCES = oclickablelabel.cpp \
okeyconfigwidget.cpp \
+ oledbox.cpp \
olistview.cpp \
@@ -37,3 +38,2 @@ SOURCES = oclickablelabel.cpp \
otabwidget.cpp \
- oledbox.cpp \
otaskbarapplet.cpp \
@@ -50,3 +50,3 @@ INTERFACES = otimepickerbase.ui
TARGET = opieui2
-VERSION = 1.8.5
+VERSION = 1.9.0