From b41e4499d41fc92cc1ed4ed487e57d0a002c1a02 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Tue, 04 Jan 2005 23:02:52 +0000 Subject: - use proper file headers - use namespaces - sort alphabetically in .pro file --- 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,11 +1,40 @@ - -#include -#include +/* +                 This file is part of the Opie Project + =. (C) 2002-2005 the Opie Team + .=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_,=:_.      -`: 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. + +*/ #include "oledbox.h" +/* QT */ +#include +#include -#ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC +namespace Opie { +namespace Ui { /* XPM */ static const char * ledborder_xpm[] = { @@ -41,9 +70,6 @@ static const char * ledborder_xpm[] = { QPixmap *OLedBox::s_border_pix = 0; -#endif - - OLedBox::OLedBox ( const QColor &col, QWidget *parent, const char *name ) : QWidget ( parent, name ) { m_color = col; @@ -54,10 +80,8 @@ OLedBox::OLedBox ( const QColor &col, QWidget *parent, const char *name ) : QWid setBackgroundMode ( PaletteBackground ); -#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 ); } OLedBox::~OLedBox ( ) @@ -142,9 +166,7 @@ void OLedBox::paintEvent ( QPaintEvent *e ) p. drawPixmap ( 0, 0, *m_pix [ ind ] ); } -// 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 ) { QPainter paint; QColor color; @@ -221,11 +243,11 @@ void OLedBox::drawLed ( QPixmap *pix, const QColor &col ) // paint a ROUND SUNK // around the LED which resembles a shadow with light coming // from the upper left. -#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 ( )); #else pen.setWidth( 3 ); @@ -275,3 +297,5 @@ void OLedBox::drawLed ( QPixmap *pix, const QColor &col ) // paint a ROUND SUNK #endif } +}; +}; 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,56 +1,85 @@ -#ifndef __OPIE_OLED_H__ -#define __OPIE_OLED_H__ +/* +                 This file is part of the Opie Project + =. (C) 2002-2005 the Opie Team + .=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_,=:_.      -`: 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 #include 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]; QColor m_color; bool m_on; bool m_readonly; -#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 @@ -6,6 +6,7 @@ HEADERS = oclickablelabel.h \ ofontselector.h \ oimageeffect.h \ okeyconfigwidget.h \ + oledbox.h \ olistview.h \ opixmapeffect.h \ opopupmenu.h \ @@ -15,7 +16,6 @@ HEADERS = oclickablelabel.h \ otabinfo.h \ otabbar.h \ otabwidget.h \ - oledbox.h \ otaskbarapplet.h \ otimepicker.h \ oversatileview.h \ @@ -27,6 +27,7 @@ SOURCES = oclickablelabel.cpp \ ofontselector.cpp \ oimageeffect.cpp \ okeyconfigwidget.cpp \ + oledbox.cpp \ olistview.cpp \ opixmapeffect.cpp \ opopupmenu.cpp \ @@ -35,7 +36,6 @@ SOURCES = oclickablelabel.cpp \ oseparator.cpp \ otabbar.cpp \ otabwidget.cpp \ - oledbox.cpp \ otaskbarapplet.cpp \ otimepicker.cpp \ oversatileview.cpp \ @@ -48,7 +48,7 @@ include( fileselector/fileselector.pro ) INTERFACES = otimepickerbase.ui TARGET = opieui2 -VERSION = 1.8.5 +VERSION = 1.9.0 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -- cgit v0.9.0.2