author | chicken <chicken> | 2004-03-01 16:23:00 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-01 16:23:00 (UTC) |
commit | 032f2d909293fb29e6c7e3cf9cce1a12484c80f7 (patch) (side-by-side diff) | |
tree | 368c696aff4d167727aaa564176b6ab1eb0df5cd /core | |
parent | 9bc70bb8a0bdd3a7bc0013f2cacce7c039b88b38 (diff) | |
download | opie-032f2d909293fb29e6c7e3cf9cce1a12484c80f7.zip opie-032f2d909293fb29e6c7e3cf9cce1a12484c80f7.tar.gz opie-032f2d909293fb29e6c7e3cf9cce1a12484c80f7.tar.bz2 |
fix includes
-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 4 | ||||
-rw-r--r-- | core/applets/rotateapplet/rotate.h | 1 | ||||
-rw-r--r-- | core/applets/screenshotapplet/inputDialog.cpp | 3 | ||||
-rw-r--r-- | core/applets/screenshotapplet/screenshot.cpp | 1 | ||||
-rw-r--r-- | core/applets/suspendapplet/suspend.cpp | 2 | ||||
-rw-r--r-- | core/applets/volumeapplet/oledbox.cpp | 1 | ||||
-rw-r--r-- | core/applets/volumeapplet/volume.cpp | 4 | ||||
-rw-r--r-- | core/applets/volumeapplet/volumeappletimpl.cpp | 2 | ||||
-rw-r--r-- | core/applets/vtapplet/vt.cpp | 3 | ||||
-rw-r--r-- | core/apps/calibrate/main.cpp | 1 | ||||
-rw-r--r-- | core/obex/obex.cc | 4 | ||||
-rw-r--r-- | core/obex/obexhandler.cpp | 1 | ||||
-rw-r--r-- | core/obex/obexsend.cpp | 4 | ||||
-rw-r--r-- | core/obex/receiver.cpp | 4 |
14 files changed, 0 insertions, 35 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp index cf3f28b..dcbf809 100644 --- a/core/applets/rotateapplet/rotate.cpp +++ b/core/applets/rotateapplet/rotate.cpp @@ -1,141 +1,137 @@ /* This file is part of the OPIE Project Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org> Copyright (C) 2003 Greg Gilbert <ggilbert@treke.net> =. Copyright (C) 2004 Michael Lauer <mickey@Vanille.de> .=l. .>+-= _;:, .> :=|. This library 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 library 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. */ #include "rotate.h" /* OPIE */ #include <opie/odevice.h> -#include <qpe/applnk.h> #include <qpe/config.h> #include <qpe/power.h> -#include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/resource.h> using namespace Opie; /* QT */ -#include <qiconset.h> -#include <qpopupmenu.h> #include <time.h> RotateApplet::RotateApplet() :QObject( 0, "RotateApplet" ), m_flipped( false ) { #if !defined(QT_NO_COP) QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this ); connect ( rotateChannel, SIGNAL( received( const QCString &, const QByteArray &) ), this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); #endif } RotateApplet::~RotateApplet ( ) {} /** * Qcop receive method. */ void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) { qDebug( "RotateApplet::channelReceived( '%s' )", (const char*) msg ); if ( ODevice::inst()->hasHingeSensor() ) { struct timespec interval; struct timespec remain; interval.tv_sec = 0; interval.tv_nsec = 600000; ::nanosleep( &interval, &remain ); OHingeStatus status = ODevice::inst()->readHingeSensor(); qDebug( "RotateApplet::readHingeSensor = %d", (int) status ); Config cfg( "apm" ); cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" ); int action = cfg.readNumEntry( "CloseHingeAction", 0 ); if ( status == CASE_CLOSED ) { switch ( action ) { case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break; case 2: /* SUSPEND */ ODevice::inst()->suspend(); break; default: /* IGNORE */ break; } } else /* status != CASE_CLOSED */ { switch ( action ) { case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 127 ); break; case 2: /* SUSPEND */ /* How to wake up the device from kernel? */; break; default: /* IGNORE */ break; } } qDebug( "RotateApplet::switchAction %d performed.", cfg.readNumEntry( "CloseHingeAction", 0 ) ); } QDataStream stream( data, IO_ReadOnly ); if ( msg == "flip()" ) { activated ( ); } else if ( msg == "rotateDefault()") { rotateDefault(); } } int RotateApplet::position() const { return 3; } QString RotateApplet::name() const { return tr( "Rotate shortcut" ); } QString RotateApplet::text() const { return tr( "Rotate" ); } /*QString RotateApplet::tr( const char* s ) const { return qApp->translate( "RotateApplet", s, 0 ); } QString RotateApplet::tr( const char* s, const char* p ) const { return qApp->translate( "RotateApplet", s, p ); } */ diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h index 2396993..bdccea0 100644 --- a/core/applets/rotateapplet/rotate.h +++ b/core/applets/rotateapplet/rotate.h @@ -1,71 +1,70 @@ /* =. This file is part of the OPIE Project .=l. Copyright (c) 2003 Maximilian Reiss <harlekin@handhelds.org> .>+-= _;:, .> :=|. This library 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 library 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 __OPIE_ROTATE_APPLET_H__ #define __OPIE_ROTATE_APPLET_H__ #include <qpe/menuappletinterface.h> #include <qobject.h> -#include <qobject.h> class RotateApplet : public QObject, public MenuAppletInterface { Q_OBJECT public: RotateApplet ( ); virtual ~RotateApplet ( ); QRESULT queryInterface( const QUuid&, QUnknownInterface** ); Q_REFCOUNT virtual int position() const; virtual QString name ( ) const; virtual QIconSet icon ( ) const; virtual QString text ( ) const; /* virtual QString tr( const char* ) const; virtual QString tr( const char*, const char* ) const; */ virtual QPopupMenu *popup ( QWidget *parent ) const; virtual void activated ( ); virtual void rotateDefault ( ); private slots: void channelReceived( const QCString &msg, const QByteArray & data ); private: bool m_flipped : 1; }; #endif diff --git a/core/applets/screenshotapplet/inputDialog.cpp b/core/applets/screenshotapplet/inputDialog.cpp index f506dfd..73ec773 100644 --- a/core/applets/screenshotapplet/inputDialog.cpp +++ b/core/applets/screenshotapplet/inputDialog.cpp @@ -1,67 +1,64 @@ /**************************************************************************** ** Form implementation generated from reading ui file 'inputDialog.ui' ** ** Created: Sat Mar 2 07:55:03 2002 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "inputDialog.h" #include <qpe/resource.h> #include <opie2/ofiledialog.h> #include <qlineedit.h> -#include <qlayout.h> -#include <qvariant.h> #include <qpushbutton.h> -#include <qwhatsthis.h> InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "InputDialog" ); resize( 234, 115); setMaximumSize( QSize( 240, 40)); setCaption( tr(name ) ); QPushButton *browserButton; browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); browserButton->setGeometry( QRect( 205, 10, 22, 22)); connect( browserButton, SIGNAL(released()),this,SLOT(browse())); LineEdit1 = new QLineEdit( this, "LineEdit1" ); LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); } /* * Destroys the object and frees any allocated resources */ InputDialog::~InputDialog() { inputText= LineEdit1->text(); } void InputDialog::browse() { MimeTypes types; QStringList audio, video, all; audio << "audio/*"; audio << "playlist/plain"; audio << "audio/x-mpegurl"; video << "video/*"; video << "playlist/plain"; all += audio; all += video; types.insert("All Media Files", all ); types.insert("Audio", audio ); types.insert("Video", video ); QString str = Opie::OFileDialog::getOpenFileName( 1,"/","", types, 0 ); LineEdit1->setText(str); } diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp index 5f83539..56a031c 100644 --- a/core/applets/screenshotapplet/screenshot.cpp +++ b/core/applets/screenshotapplet/screenshot.cpp @@ -1,132 +1,131 @@ /********************************************************************** ** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com ** All rights reserved. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #include "screenshot.h" #include "inputDialog.h" #include <stdlib.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <unistd.h> #include <qpe/qpeapplication.h> #include <qpe/applnk.h> #include <qlineedit.h> #include <qdir.h> #include <qlabel.h> #include <qpushbutton.h> #include <qpainter.h> #include <qspinbox.h> #include <qlayout.h> #include <qcheckbox.h> #include <qmessagebox.h> -#include <qimage.h> /* XPM */ static char * snapshot_xpm[] = { "32 32 177 2", " c None", ". c #042045", "+ c #0D2B47", "@ c #0E325E", "# c #0D2E50", "$ c #0A1C32", "% c #0F3A69", "& c #164680", "* c #165EAE", "= c #134D89", "- c #0A3A6E", "; c #031024", "> c #031B36", ", c #1A5EA3", "' c #1862B1", ") c #1866B9", "! c #0F5AAC", "~ c #0F56A8", "{ c #0C4C96", "] c #030918", "^ c #060206", "/ c #20242C", "( c #3E3B3B", "_ c #186ABD", ": c #115EB3", "< c #082644", "[ c #222C38", "} c #5A5859", "| c #091921", "1 c #1E7EDE", "2 c #1A7ADA", "3 c #1970CD", "4 c #1758A1", "5 c #0E529A", "6 c #094388", "7 c #22364E", "8 c #384454", "9 c #04162C", "0 c #123451", "a c #3296B4", "b c #298AB1", "c c #2484AC", "d c #033D86", "e c #033677", "f c #072C58", "g c #525862", "h c #5E5E5E", "i c #23492A", "j c #4FBD3F", "k c #50B24C", "l c #51C72E", "m c #42C64A", "n c #2686CA", "o c #0B52A4", "p c #054A9A", "q c #053B7C", "r c #2B2325", "s c #6E7070", "t c #0D240E", "u c #1E423E", "v c #468ABE", "w c #6A8AC2", "x c #7EAA8E", "y c #84BE4E", "z c #65C639", "A c #064EA0", "B c #0A4DA0", "C c #4E5242", "D c #62362E", "E c #721A1A", "F c #6E0A0A", "G c #3E0E0E", "H c #6AB85E", "I c #7E8ECA", "J c #929CD4", "K c #9EAECA", "L c #9EBEAE", "M c #8EC26A", "N c #32A276", "O c #20518C", "P c #46566E", "Q c #614A51", "R c #AE2A26", "S c #C41C1A", "T c #CE0A0A", "U c #A60606", "V c #921616", "W c #863735", "X c #866A66", "Y c #9E9EA2", "Z c #1E5212", diff --git a/core/applets/suspendapplet/suspend.cpp b/core/applets/suspendapplet/suspend.cpp index e17142b..0eb94cb 100644 --- a/core/applets/suspendapplet/suspend.cpp +++ b/core/applets/suspendapplet/suspend.cpp @@ -1,87 +1,85 @@ #include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> #include <qapplication.h> -#include <qiconset.h> -#include <qpopupmenu.h> #include "suspend.h" SuspendApplet::SuspendApplet ( ) : QObject ( 0, "SuspendApplet" ) { } SuspendApplet::~SuspendApplet ( ) { } int SuspendApplet::position ( ) const { return 2; } QString SuspendApplet::name ( ) const { return tr( "Suspend shortcut" ); } QString SuspendApplet::text ( ) const { return tr( "Suspend" ); } QString SuspendApplet::tr( const char* s ) const { return qApp->translate( "SuspendApplet", s, 0 ); } QString SuspendApplet::tr( const char* s, const char* p ) const { return qApp->translate( "SuspendApplet", s, p ); } QIconSet SuspendApplet::icon ( ) const { QPixmap pix; QImage img = Resource::loadImage ( "suspend" ); if ( !img. isNull ( )) pix. convertFromImage ( img. smoothScale ( 14, 14 )); return pix; } QPopupMenu *SuspendApplet::popup ( QWidget * ) const { return 0; } void SuspendApplet::activated ( ) { // suspend QCopEnvelope ( "QPE/System", "suspend()" ); } QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( uuid == IID_QUnknown ) *iface = this; else if ( uuid == IID_MenuApplet ) *iface = this; else return QS_FALSE; if ( *iface ) (*iface)-> addRef ( ); return QS_OK; } Q_EXPORT_INTERFACE( ) { Q_CREATE_INSTANCE( SuspendApplet ) } diff --git a/core/applets/volumeapplet/oledbox.cpp b/core/applets/volumeapplet/oledbox.cpp index 7547287..bf275a9 100644 --- a/core/applets/volumeapplet/oledbox.cpp +++ b/core/applets/volumeapplet/oledbox.cpp @@ -1,98 +1,97 @@ -#include <qpixmap.h> #include <qbitmap.h> #include <qpainter.h> #include "oledbox.h" #ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC /* XPM */ static const char * ledborder_xpm[] = { "16 16 11 1", " c None", ". c #626562", "+ c #7B7D7B", "@ c #949594", "# c #ACAEAC", "$ c #CDCACD", "% c #CDCECD", "; c #E6E6E6", "> c #FFFFFF", ", c #E6E2E6", "' c #FFFAFF", " .++@@# ", " ...++@@##$ ", " .....+@##$$% ", " ..... #$%%% ", " ... %%; ", ".... ;;;;", "++. ;>>", "+++ >>>", "@@@ >>>", "@@# >>>", "#### >>>>", " #$$ >>> ", " $$,,' >>>>> ", " ,,,''>>>>>>> ", " ,''>>>>>>> ", " '>>>>> "}; QPixmap *OLedBox::s_border_pix = 0; #endif OLedBox::OLedBox ( const QColor &col, QWidget *parent, const char *name ) : QWidget ( parent, name ) { m_color = col; m_on = false; m_pix [ 0 ] = m_pix [ 1 ] = false; setBackgroundMode ( PaletteBackground ); #ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC if ( !s_border_pix ) s_border_pix = new QPixmap ( ledborder_xpm ); #endif } OLedBox::~OLedBox ( ) { delete m_pix [ 0 ]; delete m_pix [ 1 ]; } QSize OLedBox::sizeHint ( ) const { return QSize ( 16, 16 ); } bool OLedBox::isOn ( ) const { return m_on; } QColor OLedBox::color ( ) const { return m_color; } void OLedBox::setOn ( bool b ) { if ( m_on != b ) { m_on = b; update ( ); } } void OLedBox::toggle ( ) { setOn ( !isOn ( ) ); } void OLedBox::setColor ( const QColor &col ) { diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp index 38f827e..c736437 100644 --- a/core/applets/volumeapplet/volume.cpp +++ b/core/applets/volumeapplet/volume.cpp @@ -1,138 +1,134 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <stdio.h> #include "volume.h" #include <qpe/resource.h> -#include <qpe/qpeapplication.h> #include <qpe/applnk.h> #include <qpe/config.h> #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) #include <qpe/qcopenvelope_qws.h> #endif #include <qpainter.h> #include <qcheckbox.h> #include <qslider.h> #include <qlayout.h> -#include <qframe.h> -#include <qpixmap.h> #include <qvbox.h> #include <qlabel.h> -#include <qtoolbutton.h> #include <qpushbutton.h> #include <qtimer.h> #include <opie/odevice.h> #include "oledbox.h" using namespace Opie; #define RATE_TIMER_INTERVAL 100 // Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time // results in "hanging" buttons on the iPAQ due to quite high CPU consumption. /* XPM */ static const char * vol_xpm[] = { "20 20 3 1", " c None", ". c #0000FF", "+ c #000000", " ", " . ", " . . . . ", " . . . . . . ", " . . . . . . . ", " . . ..... . . ", " . ... ..... ... ", " ........... .... ", " ................. ", "++++++++++++++++++++", " .................. ", " . ............. . ", " . ..... ....... ", " . ... ..... . ", " . ... ..... . ", " . ... ..... ", " . . . . . ", " . . . ", " . . . ", " "}; /* XPM */ static const char * mic_xpm[] = { "20 20 21 1", " c None", ". c #000000", "+ c #EEEEEE", "@ c #B4B6B4", "# c #8B8D8B", "$ c #D5D6D5", "% c #E6E6E6", "& c #9C9D9C", "* c #6A696A", "= c #E6E2E6", "- c #F6F2F6", "; c #CDC6CD", "> c #737573", ", c #4A484A", "' c #DEDEDE", ") c #F6EEF6", "! c #414041", "~ c #202020", "{ c #ACAEAC", "] c #838583", "^ c #6A656A", " ", " .... ", " .+@+#. ", " ..$%&%*. ", " .=-.;=>=,. ", " .'+).&+!+. ", " .+;+;.~+~. ", " ..%{%,.... ", " ..&=>=~.. ", " .+..]^,.. ", " .+....... ", " .%... ", " .=... ", " .+... ", " .+... ", " .... ", " .... ", " .. ", " . ", ". "}; static const char * bass_xpm[] = { "20 20 3 1", " c None", ". c #000000", "+ c #0000FF", " ", " ", " ", "..... +++ ......", " +++++++ ", diff --git a/core/applets/volumeapplet/volumeappletimpl.cpp b/core/applets/volumeapplet/volumeappletimpl.cpp index 4cbab31..9c7dea3 100644 --- a/core/applets/volumeapplet/volumeappletimpl.cpp +++ b/core/applets/volumeapplet/volumeappletimpl.cpp @@ -1,67 +1,65 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "volume.h" #include "volumeappletimpl.h" -#include <qpe/qcopenvelope_qws.h> -#include <qpe/config.h> VolumeAppletImpl::VolumeAppletImpl() : volume(0) { } VolumeAppletImpl::~VolumeAppletImpl() { delete volume; } QWidget *VolumeAppletImpl::applet( QWidget *parent ) { if ( !volume ) volume = new VolumeApplet( parent ); return volume; } int VolumeAppletImpl::position() const { return 6; } QRESULT VolumeAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( uuid == IID_QUnknown ) *iface = this; else if ( uuid == IID_TaskbarApplet ) *iface = this; else return QS_FALSE; if ( *iface ) (*iface)->addRef(); return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( VolumeAppletImpl ) } diff --git a/core/applets/vtapplet/vt.cpp b/core/applets/vtapplet/vt.cpp index 881eb41..bd39093 100644 --- a/core/applets/vtapplet/vt.cpp +++ b/core/applets/vtapplet/vt.cpp @@ -1,116 +1,113 @@ /********************************************************************** ** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. ** ** Contact me @ mickeyl@handhelds.org ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #include <qpe/resource.h> -#include <qpe/qcopenvelope_qws.h> -#include <qapplication.h> -#include <qiconset.h> #include <qpopupmenu.h> #include <fcntl.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <linux/vt.h> #include "vt.h" VTApplet::VTApplet ( ) : QObject ( 0, "VTApplet" ) { } VTApplet::~VTApplet ( ) { } int VTApplet::position ( ) const { return 2; } QString VTApplet::name ( ) const { return tr( "VT shortcut" ); } QString VTApplet::text ( ) const { return tr( "Terminal" ); } /* QString VTApplet::tr( const char* s ) const { return qApp->translate( "VTApplet", s, 0 ); } QString VTApplet::tr( const char* s, const char* p ) const { return qApp->translate( "VTApplet", s, p ); } */ QIconSet VTApplet::icon ( ) const { QPixmap pix; QImage img = Resource::loadImage ( "terminal" ); if ( !img. isNull ( )) pix. convertFromImage ( img. smoothScale ( 14, 14 )); return pix; } QPopupMenu *VTApplet::popup ( QWidget* parent ) const { qDebug( "VTApplet::popup" ); struct vt_stat vtstat; int fd = ::open( "/dev/tty0", O_RDWR ); if ( fd == -1 ) return 0; if ( ioctl( fd, VT_GETSTATE, &vtstat ) == -1 ) return 0; m_subMenu = new QPopupMenu( parent ); m_subMenu->setCheckable( true ); for ( int i = 1; i < 10; ++i ) { int id = m_subMenu->insertItem( QString::number( i ), 500+i ); m_subMenu->setItemChecked( id, id-500 == vtstat.v_active ); } ::close( fd ); connect( m_subMenu, SIGNAL( activated(int) ), this, SLOT( changeVT(int) ) ); connect( m_subMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); return m_subMenu; } void VTApplet::changeVT( int index ) { //qDebug( "VTApplet::changeVT( %d )", index-500 ); int fd = ::open("/dev/tty0", O_RDWR); if ( fd == -1 ) return; ioctl( fd, VT_ACTIVATE, index-500 ); } void VTApplet::updateMenu() { //qDebug( "VTApplet::updateMenu()" ); diff --git a/core/apps/calibrate/main.cpp b/core/apps/calibrate/main.cpp index ec9b5ec..0da0fe0 100644 --- a/core/apps/calibrate/main.cpp +++ b/core/apps/calibrate/main.cpp @@ -1,47 +1,46 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "calibrate.h" -#include <qfile.h> #include <qpe/qpeapplication.h> #ifdef QWS #include <qwindowsystem_qws.h> #endif int main( int argc, char ** argv ) { QPEApplication a( argc, argv ); int retval = 0; #ifdef QWS if ( QWSServer::mouseHandler() && QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { #endif // Make sure calibration widget starts on top. Calibrate cal; a.setMainWidget(&cal); a.showMainWidget(&cal); return a.exec(); #ifdef QWS } #endif } diff --git a/core/obex/obex.cc b/core/obex/obex.cc index 2a306de..50e5201 100644 --- a/core/obex/obex.cc +++ b/core/obex/obex.cc @@ -1,103 +1,99 @@ -#include <qapplication.h> -#include <qfile.h> #include <qfileinfo.h> -#include <qtextcodec.h> -#include <qpe/qcopenvelope_qws.h> #include <opie/oprocess.h> #include "obex.h" using namespace OpieObex; /* TRANSLATOR OpieObex::Obex */ Obex::Obex( QObject *parent, const char* name ) : QObject(parent, name ) { m_rec = 0; m_send=0; m_count = 0; m_receive = false; connect( this, SIGNAL(error(int) ), // for recovering to receive SLOT(slotError() ) ); connect( this, SIGNAL(sent(bool) ), SLOT(slotError() ) ); }; Obex::~Obex() { delete m_rec; delete m_send; } void Obex::receive() { m_receive = true; m_outp = QString::null; qWarning("Receive" ); m_rec = new OProcess(); *m_rec << "irobex_palm3"; // connect to the necessary slots connect(m_rec, SIGNAL(processExited(OProcess*) ), this, SLOT(slotExited(OProcess*) ) ); connect(m_rec, SIGNAL(receivedStdout(OProcess*, char*, int ) ), this, SLOT(slotStdOut(OProcess*, char*, int) ) ); if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { qWarning("could not start :("); emit done( false ); delete m_rec; m_rec = 0; } // emit currentTry(m_count ); } void Obex::send( const QString& fileName) { // if currently receiving stop it send receive m_count = 0; m_file = fileName; qWarning("send %s", fileName.latin1() ); if (m_rec != 0 ) { qWarning("running"); if (m_rec->isRunning() ) { emit error(-1 ); qWarning("is running"); delete m_rec; m_rec = 0; }else{ qWarning("is not running"); emit error( -1 ); // we did not delete yet but it's not running slotExited is pending return; } } sendNow(); } void Obex::sendNow(){ qWarning("sendNow"); if ( m_count >= 25 ) { // could not send emit error(-1 ); emit sent(false); return; } // OProcess inititialisation m_send = new OProcess(); *m_send << "irobex_palm3"; *m_send << QFile::encodeName(m_file); // connect to slots Exited and and StdOut connect(m_send, SIGNAL(processExited(OProcess*) ), this, SLOT(slotExited(OProcess*)) ); connect(m_send, SIGNAL(receivedStdout(OProcess*, char*, int )), this, SLOT(slotStdOut(OProcess*, char*, int) ) ); // now start it if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { qWarning("could not send" ); m_count = 25; emit error(-1 ); delete m_send; m_send=0; } // end m_count++; emit currentTry( m_count ); } diff --git a/core/obex/obexhandler.cpp b/core/obex/obexhandler.cpp index c237555..4034560 100644 --- a/core/obex/obexhandler.cpp +++ b/core/obex/obexhandler.cpp @@ -1,68 +1,67 @@ -#include <qcopchannel_qws.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include "obexsend.h" #include "receiver.h" #include "obexhandler.h" using namespace OpieObex; /* TRANSLATOR OpieObex::ObexHandler */ ObexHandler::ObexHandler() { m_wasRec = false; m_sender = 0l; m_receiver = 0l; QCopChannel* chan = new QCopChannel("QPE/Obex"); connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), this, SLOT(irdaMessage(const QCString&, const QByteArray& ) ) ); } ObexHandler::~ObexHandler() { delete m_sender; delete m_receiver; } void ObexHandler::doSend(const QString& str, const QString& desc) { delete m_sender; m_sender = new SendWidget; m_sender->raise(); QPEApplication::showWidget( m_sender ); connect(m_sender, SIGNAL(done() ), this, SLOT(slotSent() ) ); m_sender->send( str, desc ); } void ObexHandler::doReceive(bool b) { if (m_receiver && b ) return; // we should enable receiver and it is on else if (!m_receiver && !b ) return; // we should disbale receiver and it is off else if (m_receiver && !b ) { delete m_receiver; m_receiver=0; }else if (!m_receiver && b ) { m_receiver= new Receiver; } } void ObexHandler::slotSent() { QString file = m_sender->file(); delete m_sender; m_sender = 0; QCopEnvelope e ("QPE/Obex", "done(QString)" ); e << file; doReceive(m_wasRec ); m_wasRec = false; } void ObexHandler::irdaMessage( const QCString& msg, const QByteArray& data) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "send(QString,QString,QString)" ) { QString name, desc; stream >> desc; stream >> name; m_wasRec = (m_receiver != 0 ); doReceive( false ); doSend(name, desc); }else if (msg == "receive(int)") { int rec; stream >> rec; doReceive(rec); } } diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index cf5d958..6b8d467 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp @@ -1,106 +1,102 @@ #include <qpushbutton.h> #include <qlabel.h> -#include <qhbox.h> #include <qlayout.h> #include <qtimer.h> -#include <qtl.h> -#include <qcopchannel_qws.h> -#include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> #include "obex.h" #include "obexsend.h" using namespace OpieObex; /* TRANSLATOR OpieObex::SendWidget */ SendWidget::SendWidget( QWidget* parent, const char* name ) : QWidget( parent, name ) { initUI(); } SendWidget::~SendWidget() { } void SendWidget::initUI() { m_obex = new Obex(this, "obex"); connect(m_obex, SIGNAL(error(int) ), this, SLOT(slotIrError(int) ) ); connect(m_obex, SIGNAL(sent(bool) ), this, SLOT(slotIrSent(bool) ) ); connect(m_obex, SIGNAL(currentTry(unsigned int ) ), this, SLOT(slotIrTry(unsigned int ) ) ); QCopChannel* chan = new QCopChannel("QPE/IrDaAppletBack", this ); connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), this, SLOT(dispatchIrda(const QCString&, const QByteArray& ) ) ); chan = new QCopChannel("QPE/BluetoothBack", this ); connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), this, SLOT(dispatchBt(const QCString&, const QByteArray& ) ) ); QVBoxLayout* lay = new QVBoxLayout(this); QHBox* nameBox = new QHBox(this); QLabel* name = new QLabel(nameBox); name->setText( tr("<qt><h1>Sending:</h1></qt>") ); name->setAlignment( AlignLeft | AlignTop ); m_lblFile = new QLabel(nameBox); lay->addWidget(nameBox, 0); QFrame* frame = new QFrame(this); frame->setFrameShape( QFrame::HLine ); frame->setFrameShadow( QFrame::Sunken ); lay->addWidget(frame, 10); QLabel* devices = new QLabel(this); devices->setText("<qt><b>Devices:</b></qt>"); devices->setAlignment( AlignLeft | AlignTop ); lay->addWidget( devices,10 ); m_devBox = new DeviceBox(this); lay->addWidget( m_devBox, 50 ); connect(m_devBox, SIGNAL(selectedDevice(int, int ) ), this, SLOT(slotSelectedDevice(int, int) ) ); QPushButton *but = new QPushButton(this); but->setText(tr("Done") ); connect(but, SIGNAL(clicked() ), this, SLOT(slotDone() ) ); lay->addWidget( but ); m_lay = lay; // QT does not like if you add items to an layout which already exits.... // and was layouted invalidate() does not help too // so we use RichText.... } /* * in send we'll first set everything up * and then wait for a list of devices. */ void SendWidget::send( const QString& file, const QString& desc ) { m_file = file; m_irDa.clear(); m_start = 0; m_lblFile->setText(desc.isEmpty() ? file : desc ); if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) { m_irDeSearch = m_devBox->addDevice( tr("IrDa is not enabled!"), DeviceBox::Error ); m_start++; }else m_irDeSearch = m_devBox->addDevice( tr("Searching for IrDa Devices."), DeviceBox::Search ); if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) { m_btDeSearch = m_devBox->addDevice( tr("Bluetooth is not available"), DeviceBox::Error ); m_start++; }else m_btDeSearch = m_devBox->addDevice( tr("Searching for bluetooth Devices."), DeviceBox::Search ); if (m_start != 2 ) { QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()"); QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp index bf9e30c..7d9f7ec 100644 --- a/core/obex/receiver.cpp +++ b/core/obex/receiver.cpp @@ -1,116 +1,112 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include <stdlib.h> // int system #include <unistd.h> #include <fcntl.h> -#include <qfile.h> #include <qfileinfo.h> #include <qlabel.h> -#include <qhbox.h> -#include <qregexp.h> #include <qtextview.h> #include <qpushbutton.h> #include <qpe/applnk.h> #include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> -#include <qpe/global.h> #include "obex.h" #include "receiver.h" using namespace OpieObex; /* TRANSLATOR OpieObex::Receiver */ Receiver::Receiver() { m_obex = new Obex(this, "Receiver"); connect(m_obex, SIGNAL(receivedFile(const QString& ) ), this, SLOT(slotReceived(const QString& ) ) ); m_obex->receive(); } Receiver::~Receiver() { m_obex->setReceiveEnabled( false ); delete m_obex; } void Receiver::slotReceived( const QString& _file ) { QString file = _file; int check = checkFile(file); if ( check == AddressBook ) handleAddr( file ); else if ( check == Datebook ) handleDateTodo( file ); else handleOther( file ); } void Receiver::handleAddr( const QString& str ) { QCopEnvelope e("QPE/Application/addressbook", "setDocument(QString)" ); e << str; } /* we can not say for sure if it's a VEevent ot VTodo */ void Receiver::handleDateTodo( const QString& str ) { QCopEnvelope e0("QPE/Application/todolist", "setDocument(QString)"); e0 << str; QCopEnvelope e1("QPE/Application/datebook", "setDocument(QString)" ); e1 << str; } /* * Handle other asks if it should accept the * beamed object and creates a DocLnk */ void Receiver::handleOther( const QString& other ) { OtherHandler* hand = new OtherHandler(); hand->handle( other ); } void Receiver::tidyUp( QString& _file, const QString& ending) { /* libversit fails on BASE64 encoding we try to sed it away */ QString file = _file; char foo[24]; // big enough (void)::strcpy(foo, "/tmp/opie-XXXXXX"); int fd = ::mkstemp(foo); if ( fd == -1 ) return; (void)::strncat( foo, ending.latin1(), 4 ); _file = QString::fromLatin1( foo ); QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) ); qWarning("Executing: %s", cmd.latin1() ); (void)::system( cmd.latin1() ); cmd = QString("rm %1").arg( Global::shellQuote(file) ); (void)::system( cmd.latin1() ); } int Receiver::checkFile( QString& file ) { qWarning("check file!! %s", file.latin1() ); int ret; QString ending; if (file.right(4) == ".vcs" ) { ret = Datebook; ending = QString::fromLatin1(".vcs"); }else if ( file.right(4) == ".vcf") { ret = AddressBook; ending = QString::fromLatin1(".vcf"); }else ret = Other; if (ending.isEmpty() ) return ret; /** * currently the parser is broken in regard of BASE64 encoding * and M$ likes to send that. So we will executed a small * tidy up system sed script * At this point we can also remove umlaute from the filename */ tidyUp( file, ending ); qWarning("check it now %d", ret ); return ret; } |