summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/README19
-rw-r--r--libopie2/libopie2.pro7
-rw-r--r--libopie2/opiecore/oapplication.cpp12
-rw-r--r--libopie2/opiecore/oapplication.h8
-rw-r--r--libopie2/opiecore/opiecore.pro9
-rw-r--r--libopie2/opiedb/opiedb.pro6
-rw-r--r--libopie2/opiedb/osqlmanager.h2
-rw-r--r--libopie2/opiemm/opiemm.pro6
-rw-r--r--libopie2/opiemm/osoundsystem.cpp1
-rw-r--r--libopie2/opienet/opienet.pro6
-rw-r--r--libopie2/opiepim/opiepim.pro7
-rw-r--r--libopie2/opieui/opieui.pro18
-rw-r--r--libopie2/opieui/oversatileview.h2
13 files changed, 97 insertions, 6 deletions
diff --git a/libopie2/README b/libopie2/README
index 57172a7..daf6b27 100644
--- a/libopie2/README
+++ b/libopie2/README
@@ -1,169 +1,188 @@
/********************************************************************
/* This is an overview of the opielibs2 project
/********************************************************************/
Origin: opielibs is about creating classes to
* optimize Qt classes for the embedded environment
* provide sophisticated abstractions for developers
* provide complete documentation and working examples
* provide end users with a common look and feel
* reduce memory footprint through sharing code
* reduce possible bugs through reusing tested code
--------------------------------------------------------
+0. Building
+--------------------------------------------------------
+
+* for QPE run:
+ qmake libopie2.pro
+ make
+
+OR (even better)
+ cd $OPIEDIR
+ make menuconfig
+ make -k
+
+* for QT/X11 run:
+ qmake "platform=x11" libopie2.pro
+ make
+
+Make sure you have set $PLATFORM=x86-linux
+
+--------------------------------------------------------
1. General Overview
--------------------------------------------------------
libopie is functionally seperated into the following libraries:
- libopiecore
- libopieui
- libopiepim
- libopiedb
- libopienet
- libopiemm
1.1 Contents of libopiecore [ opiecore ]
--------------------------------------------------------
- odbgstream
- ondbgstream
- oprocctrl
- oprocess
- odevice
- odevicebutton
- oconfig
- oconfiggroupsaver
- ocompletionbase
- ocompletion
- ocomptreenodelist
- ocomptreenode
- ocompletionwrapper
- oglobal
- oglobalsettings
- osortableitem
- osortablevaluelist
1.2 Contents of libopieui [ opieui ]
--------------------------------------------------------
- oapplication
- ofiledialog
- colordialog
- oclickablelabel
- ocolorbutton
- colorpopupmenu
- otabinfo
- otabbar
- otabwidget
- ofontmenu
- ofontselector
- ofileview
- oticker
- olistview
- olistviewitem
- oversatileview
- oversatileviewitem
- ocompletionbox
- olineedit
- ocombobox
- ohistorycombo
- omessagebox
- odialogbase
- todayconfigwidget (rather into opiepim?)
- orecurrancewidget (rather into opiepim?)
- otimepicker (rather into opiepim?)
1.3 Contents of libopiepim [ opiepim ]
--------------------------------------------------------
- ocheckitem
- todayplugininterface
THIS STUFF IS OUTDATED/DEPRICATED AND SCHOULD NOT
BE MOVED IN THE NEW LIBRARY !!
USE THE CLASSES IN libopie/pim INSTEAD !(eilers)
- todoresource
- todoevent
- todovcalresource
1.4 Contents of libopiedb [ opiedb ]
--------------------------------------------------------
- xmltree
THIS STUFF IS OUTDATED/DEPRICATED AND SCHOULD NOT
BE MOVED IN THE NEW LIBRARY !!
USE THE CLASSES IN libopie/pim INSTEAD !(eilers)
- tododb
1.5 Contents of libopienet [ opienet ]
--------------------------------------------------------
- onetwork
- onetworkinterface
- owirelessnetworkinterface
- ochannelhopper
- omonitoring
- ociscomonitoring
- owlanngmonitoring
- ohostapmonitoring
- oorinocomonitoring
- opacketcapturer
- opacket
- oethernetpacket
- owavelanpacket
- ollcpacket
- oippacket
- oudppacket
- otcppacket
<libmail stuff>
<libbend stuff>
<libftp stuff>
1.6 Contents of libopiemm [ opiemm ]
--------------------------------------------------------
- osoundsystem
- oaudiointerface
- osoundserver
--------------------------------------------------------
2.0 Feature Description
--------------------------------------------------------
2.1 libopiecore
...
2.2 libopieui
...
2.3 libopiepim
...
2.4 libopiedb
...
2.5 libopienet
...
2.6 libopiemm
...
diff --git a/libopie2/libopie2.pro b/libopie2/libopie2.pro
index 0bd1d06..e734654 100644
--- a/libopie2/libopie2.pro
+++ b/libopie2/libopie2.pro
@@ -1,4 +1,11 @@
TEMPLATE = subdirs
unix:SUBDIRS = opiecore opiedb opiepim opieui opienet opiemm examples
+!contains( platform, x11 ) {
+ message( Configuring libopie2 for build on Opie )
include ( $(OPIEDIR)/include.pro )
+}
+
+contains( platform, x11 ) {
+ message( Configuring libopie2 for build on Qt/X11 )
+}
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp
index 06d8ba2..84cab48 100644
--- a/libopie2/opiecore/oapplication.cpp
+++ b/libopie2/opiecore/oapplication.cpp
@@ -1,125 +1,137 @@
/*
                This file is part of the Opie Project
              Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de>
=.
.=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.
*/
#include <opie2/oapplication.h>
#include <opie2/oconfig.h>
+#include <opie2/odebug.h>
#include <signal.h>
#include <stdio.h>
OApplication* OApplication::_instance = 0;
/**************************************************************************************************/
/* OApplicationPrivate
/**************************************************************************************************/
class OApplicationPrivate
{
public:
OApplicationPrivate() {};
~OApplicationPrivate() {};
};
/**************************************************************************************************/
/* OApplication
/**************************************************************************************************/
OApplication::OApplication( int& argc, char** argv, const QCString& rAppName )
+#ifdef QWS
:QPEApplication( argc, argv ),
+#else
+ :QApplication( argc, argv ),
+#endif
_appname( rAppName ),
_config( 0 )
{
init();
}
OApplication::~OApplication()
{
delete d;
if ( _config )
delete _config;
OApplication::_instance = 0;
// after deconstruction of the one-and-only application object,
// the construction of another object is allowed
}
OConfig* OApplication::config()
{
if ( !_config )
{
_config = new OConfig( _appname );
}
return _config;
}
void OApplication::init()
{
d = new OApplicationPrivate();
if ( !OApplication::_instance )
{
OApplication::_instance = this;
/* register SIGSEGV handler to give programs an option
* to exit gracefully, e.g. save or close devices or files.
struct sigaction sa;
sa.sa_handler = ( void (*)(int) ) &segv_handler;
sa.sa_flags = SA_SIGINFO | SA_RESTART;
sigemptyset(&sa.sa_mask);
sigaction(SIGSEGV, &sa, NULL);
*/
}
else
{
qFatal( "OApplication: Can't create more than one OApplication object. Aborting." );
}
}
void OApplication::showMainWidget( QWidget* widget, bool nomax )
{
+#ifdef QWS
QPEApplication::showMainWidget( widget, nomax );
+#else
+// tille: I am quit sure if this is the right way to do..
+ odDebug(nomax,7) << "ignoring nomax";
+ setMainWidget( widget );
+ widget->show();
+#endif
widget->setCaption( _appname );
}
void OApplication::setTitle( const QString& title ) const
{
if ( mainWidget() )
{
if ( !title.isNull() )
mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title );
else
mainWidget()->setCaption( _appname );
}
}
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h
index 6bc2b1c..3043910 100644
--- a/libopie2/opiecore/oapplication.h
+++ b/libopie2/opiecore/oapplication.h
@@ -1,102 +1,110 @@
/*
                This file is part of the Opie Project
              Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de>
=.
.=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 OAPPLICATION_H
#define OAPPLICATION_H
#define oApp OApplication::oApplication()
+#ifdef QWS
#include <qpe/qpeapplication.h>
+#else
+#include <qapplication.h>
+#endif
class OApplicationPrivate;
class OConfig;
+#ifdef QWS
class OApplication: public QPEApplication
+#else
+class OApplication : public QApplication
+#endif
{
Q_OBJECT
public:
/**
* Constructor. Parses command-line arguments and sets the window caption.
*
* @param rAppName application name. Will be used for finding the
* associated message, icon and configuration files
*
*/
OApplication( int& argc, char** argv, const QCString& rAppName );
/**
* Destructor. Destroys the application object and its children.
*/
virtual ~OApplication();
/**
* @returns the process-wide application object
*
* This is similar to the global @ref QApplication pointer qApp. It
* allows access to the single global OApplication object, since
* more than one cannot be created in the same application. It
* saves you the trouble of having to pass the pointer explicitly
* to every function that may require it.
*/
static OApplication* oApplication() { return _instance; };
/**
* Returns the application name as given during creation.
*
* @returns a reference to the application name
*/
const QCString& appName() const { return _appname; };
/**
* @returns the application session config object.
*
* @see OConfig
*/
OConfig* config();
/**
* Shows the main @a widget and sets the name of the application as window caption.
*/
virtual void showMainWidget( QWidget* widget, bool nomax = false );
/**
* Set the application title. The application title will be concatenated
* to the application name given in the constructor.
*
* @param title the title. If not given, resets caption to appname
*/
virtual void setTitle( const QString& title = QString::null ) const;
protected:
void init();
private:
const QCString _appname;
static OApplication* _instance;
OConfig* _config;
OApplicationPrivate* d;
};
#endif // OAPPLICATION_H
diff --git a/libopie2/opiecore/opiecore.pro b/libopie2/opiecore/opiecore.pro
index ed7d6d7..c8a291a 100644
--- a/libopie2/opiecore/opiecore.pro
+++ b/libopie2/opiecore/opiecore.pro
@@ -1,31 +1,38 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
HEADERS = oapplication.h \
oconfig.h \
ocompletionbase.h \
ocompletion.h \
odebug.h \
oglobal.h \
oglobalsettings.h \
osortablevaluelist.h
SOURCES = oapplication.cpp \
oconfig.cpp \
ocompletionbase.cpp \
ocompletion.cpp \
odebug.cpp \
oglobal.cpp \
oglobalsettings.cpp
INTERFACES =
TARGET = opiecore2
VERSION = 1.8.1
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS = -lqpe
MOC_DIR = moc
OBJECTS_DIR = obj
+
+!contains( platform, x11 ) {
+ LIBS = -lqpe
include ( $(OPIEDIR)/include.pro )
+}
+
+contains( platform, x11 ) {
+ LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
+}
diff --git a/libopie2/opiedb/opiedb.pro b/libopie2/opiedb/opiedb.pro
index 401646a..3612f0e 100644
--- a/libopie2/opiedb/opiedb.pro
+++ b/libopie2/opiedb/opiedb.pro
@@ -1,32 +1,38 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
HEADERS = osqlbackend.h \
osqldriver.h \
osqlerror.h \
osqlmanager.h \
osqlquery.h \
osqlresult.h \
osqltable.h \
osqlbackendmanager.h \
osqlitedriver.h
SOURCES = osqlbackend.cpp \
osqldriver.cpp \
osqlerror.cpp \
osqlmanager.cpp \
osqlquery.cpp \
osqlresult.cpp \
osqltable.cpp \
osqlbackendmanager.cpp \
osqlitedriver.cpp
INTERFACES =
TARGET = opiedb2
VERSION = 1.8.1
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
MOC_DIR = moc
OBJECTS_DIR = obj
+!contains( platform, x11 ) {
include ( $(OPIEDIR)/include.pro )
+}
+
+contains( platform, x11 ) {
+ LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
+}
diff --git a/libopie2/opiedb/osqlmanager.h b/libopie2/opiedb/osqlmanager.h
index b3d8d69..5323b14 100644
--- a/libopie2/opiedb/osqlmanager.h
+++ b/libopie2/opiedb/osqlmanager.h
@@ -1,62 +1,64 @@
#ifndef OSQL_MANAGER_H
#define OSQL_MANAGER_H
#include <qobject.h>
+#include <qstringlist.h>
#include "osqlbackend.h"
+
/**
* OSQLManager is responsible for loading
* and unloading, querying different OSQL
* services
* Load a OSQLDriver and delete it yourself
*
*/
class OSQLDriver;
class OSQLManager : public QObject {
Q_OBJECT
public:
/**
* Empty c'tor
*/
OSQLManager();
/**
* Query the Manager for different backends
*/
OSQLBackEnd::ValueList queryBackEnd();
/**
* Load a backend with it's name from param name
*/
OSQLDriver* load( const QString& name );
/**
* Load a OSQLDevice from const reference of OSQLBackEnd
*/
OSQLDriver* load( const OSQLBackEnd& );
/**
* loads the Opie standard backend
*/
OSQLDriver *standard();
/**
* register path to the search path list
* When querying for services we scan all the
* registered path for backends
*/
void registerPath( const QString& path );
/**
* unregisterPath from the search path list
*/
bool unregisterPath( const QString& path );
private:
OSQLBackEnd::ValueList builtIn()const;
OSQLBackEnd::ValueList m_list;
QStringList m_path;
};
#endif
diff --git a/libopie2/opiemm/opiemm.pro b/libopie2/opiemm/opiemm.pro
index 8e5eeb4..d3ce8f7 100644
--- a/libopie2/opiemm/opiemm.pro
+++ b/libopie2/opiemm/opiemm.pro
@@ -1,16 +1,22 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
HEADERS = osoundsystem.h
SOURCES = osoundsystem.cpp
INTERFACES =
TARGET = opiemm2
VERSION = 1.8.1
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS +=
MOC_DIR = moc
OBJECTS_DIR = obj
+
+!contains( platform, x11 ) {
include ( $(OPIEDIR)/include.pro )
+}
+contains( platform, x11 ) {
+ LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
+}
diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp
index fd23bea..d857659 100644
--- a/libopie2/opiemm/osoundsystem.cpp
+++ b/libopie2/opiemm/osoundsystem.cpp
@@ -1,315 +1,316 @@
/*
                This file is part of the Opie Project
              (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
=.
.=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.
*/
#include <opie2/osoundsystem.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/soundcard.h>
#include <sys/stat.h>
+#include <qstringlist.h>
/*======================================================================================
* OSoundSystem
*======================================================================================*/
OSoundSystem* OSoundSystem::_instance = 0;
OSoundSystem::OSoundSystem()
{
qDebug( "OSoundSystem::OSoundSystem()" );
synchronize();
}
void OSoundSystem::synchronize()
{
// gather available interfaces by inspecting /dev
//FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices
//FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices
_interfaces.clear();
_interfaces.insert( "soundcard", new OSoundCard( this, "soundcard" ) );
/*
QString str;
QFile f( "/dev/sound" );
bool hasFile = f.open( IO_ReadOnly );
if ( !hasFile )
{
qDebug( "OSoundSystem: /dev/sound not existing. No sound devices available" );
return;
}
QTextStream s( &f );
s.readLine();
s.readLine();
while ( !s.atEnd() )
{
s >> str;
str.truncate( str.find( ':' ) );
qDebug( "OSoundSystem: found interface '%s'", (const char*) str );
OAudioInterface* iface;
iface = new OAudioInterface( this, (const char*) str );
_interfaces.insert( str, iface );
s.readLine();
}
*/
}
int OSoundSystem::count() const
{
return _interfaces.count();
}
OSoundCard* OSoundSystem::card( const QString& iface ) const
{
return _interfaces[iface];
}
OSoundSystem* OSoundSystem::instance()
{
if ( !_instance ) _instance = new OSoundSystem();
return _instance;
}
OSoundSystem::CardIterator OSoundSystem::iterator() const
{
return OSoundSystem::CardIterator( _interfaces );
}
/*======================================================================================
* OSoundCard
*======================================================================================*/
OSoundCard::OSoundCard( QObject* parent, const char* name )
:QObject( parent, name ), _audio( 0 ), _mixer( 0 )
{
qDebug( "OSoundCard::OSoundCard()" );
init();
}
OSoundCard::~OSoundCard()
{
}
void OSoundCard::init()
{
_audio = new OAudioInterface( this, "/dev/dsp" );
_mixer = new OMixerInterface( this, "/dev/mixer" );
}
/*======================================================================================
* OAudioInterface
*======================================================================================*/
OAudioInterface::OAudioInterface( QObject* parent, const char* name )
:QObject( parent, name )
{
qDebug( "OAudioInterface::OAudioInterface()" );
init();
}
OAudioInterface::~OAudioInterface()
{
}
void OAudioInterface::init()
{
}
/*======================================================================================
* OMixerInterface
*======================================================================================*/
OMixerInterface::OMixerInterface( QObject* parent, const char* name )
:QObject( parent, name )
{
qDebug( "OMixerInterface::OMixerInterface()" );
init();
}
OMixerInterface::~OMixerInterface()
{
}
void OMixerInterface::init()
{
// open the device
_fd = ::open( name(), O_RDWR );
if ( _fd == -1 )
{
qWarning( "can't open mixer." );
return;
}
// construct the device capabilities
int devmask = 0;
if ( ioctl( _fd, SOUND_MIXER_READ_DEVMASK, &devmask ) != -1 )
{
if ( devmask & ( 1 << SOUND_MIXER_VOLUME ) ) _channels.insert( "PlayVolume", SOUND_MIXER_VOLUME );
if ( devmask & ( 1 << SOUND_MIXER_BASS ) ) _channels.insert( "PlayBass", SOUND_MIXER_BASS );
if ( devmask & ( 1 << SOUND_MIXER_TREBLE ) ) _channels.insert( "PlayTreble", SOUND_MIXER_TREBLE );
if ( devmask & ( 1 << SOUND_MIXER_SYNTH ) ) _channels.insert( "PlaySynth", SOUND_MIXER_SYNTH );
if ( devmask & ( 1 << SOUND_MIXER_PCM ) ) _channels.insert( "PlayPCM", SOUND_MIXER_PCM );
if ( devmask & ( 1 << SOUND_MIXER_SPEAKER ) ) _channels.insert( "PlaySpeaker", SOUND_MIXER_SPEAKER );
if ( devmask & ( 1 << SOUND_MIXER_LINE ) ) _channels.insert( "PlayLine", SOUND_MIXER_LINE );
if ( devmask & ( 1 << SOUND_MIXER_MIC ) ) _channels.insert( "PlayMic", SOUND_MIXER_MIC );
if ( devmask & ( 1 << SOUND_MIXER_CD ) ) _channels.insert( "PlayCD", SOUND_MIXER_CD );
if ( devmask & ( 1 << SOUND_MIXER_IMIX ) ) _channels.insert( "PlayInputMix", SOUND_MIXER_IMIX );
if ( devmask & ( 1 << SOUND_MIXER_ALTPCM ) ) _channels.insert( "PlayAltPCM", SOUND_MIXER_ALTPCM );
if ( devmask & ( 1 << SOUND_MIXER_RECLEV ) ) _channels.insert( "PlayRecord", SOUND_MIXER_RECLEV );
if ( devmask & ( 1 << SOUND_MIXER_IGAIN ) ) _channels.insert( "PlayInputGain", SOUND_MIXER_IGAIN );
if ( devmask & ( 1 << SOUND_MIXER_OGAIN ) ) _channels.insert( "PlayOutputGain", SOUND_MIXER_OGAIN );
//qDebug( "devmask available and constructed." );
}
devmask = 0;
if ( ioctl( _fd, SOUND_MIXER_READ_RECMASK, &devmask ) != -1 )
{
if ( devmask & ( 1 << SOUND_MIXER_VOLUME ) ) _channels.insert( "RecVolume", SOUND_MIXER_VOLUME );
if ( devmask & ( 1 << SOUND_MIXER_BASS ) ) _channels.insert( "RecBass", SOUND_MIXER_BASS );
if ( devmask & ( 1 << SOUND_MIXER_TREBLE ) ) _channels.insert( "RecTreble", SOUND_MIXER_TREBLE );
if ( devmask & ( 1 << SOUND_MIXER_SYNTH ) ) _channels.insert( "RecSynth", SOUND_MIXER_SYNTH );
if ( devmask & ( 1 << SOUND_MIXER_PCM ) ) _channels.insert( "RecPCM", SOUND_MIXER_PCM );
if ( devmask & ( 1 << SOUND_MIXER_SPEAKER ) ) _channels.insert( "RecSpeaker", SOUND_MIXER_SPEAKER );
if ( devmask & ( 1 << SOUND_MIXER_LINE ) ) _channels.insert( "RecLine", SOUND_MIXER_LINE );
if ( devmask & ( 1 << SOUND_MIXER_MIC ) ) _channels.insert( "RecMic", SOUND_MIXER_MIC );
if ( devmask & ( 1 << SOUND_MIXER_CD ) ) _channels.insert( "RecCD", SOUND_MIXER_CD );
if ( devmask & ( 1 << SOUND_MIXER_IMIX ) ) _channels.insert( "RecInputMix", SOUND_MIXER_IMIX );
if ( devmask & ( 1 << SOUND_MIXER_ALTPCM ) ) _channels.insert( "RecAltPCM", SOUND_MIXER_ALTPCM );
if ( devmask & ( 1 << SOUND_MIXER_RECLEV ) ) _channels.insert( "RecRecord", SOUND_MIXER_RECLEV );
if ( devmask & ( 1 << SOUND_MIXER_IGAIN ) ) _channels.insert( "RecInputGain", SOUND_MIXER_IGAIN );
if ( devmask & ( 1 << SOUND_MIXER_OGAIN ) ) _channels.insert( "RecOutputGain", SOUND_MIXER_OGAIN );
//qDebug( "recmask available and constructed." );
}
/* ChannelIterator it;
for ( it = _channels.begin(); it != _channels.end(); ++it )
{
qDebug( "Channel %s available (bit %d)", (const char*) it.key(), it.data() );
qDebug( " +--- Volume: %02d | %02d", volume( it.key() ) & 0xff, volume( it.key() ) >> 8 );
}
*/
}
QStringList OMixerInterface::allChannels() const
{
ChannelIterator it = _channels.begin();
QStringList channels;
while ( it != _channels.end() )
{
channels += it.key();
it++;
}
return channels;
}
QStringList OMixerInterface::recChannels() const
{
qWarning( "NYI" );
}
QStringList OMixerInterface::playChannels() const
{
qWarning( "NYI" );
}
bool OMixerInterface::hasChannel( const QString& channel )
{
return _channels.contains( channel );
}
void OMixerInterface::setVolume( const QString& channel, int left, int right )
{
int volume = left;
volume |= ( right == -1 ) ? left << 8 : right << 8;
if ( _channels.contains( channel ) )
{
int result = ioctl( _fd, MIXER_WRITE( _channels[channel] ), &volume );
if ( result == -1 )
{
qWarning( "Can't set volume: %s", strerror( errno ) );
}
else
{
if ( result & 0xff != left )
{
qWarning( "Device adjusted volume from %d to %d", left, result & 0xff );
}
}
}
}
int OMixerInterface::volume( const QString& channel ) const
{
int volume;
if ( _channels.contains( channel ) )
{
if ( ioctl( _fd, MIXER_READ( _channels[channel] ), &volume ) == -1 )
{
qWarning( "Can't get volume: %s", strerror( errno ) );
}
else return volume;
}
return -1;
}
diff --git a/libopie2/opienet/opienet.pro b/libopie2/opienet/opienet.pro
index 3f9166a..93389db 100644
--- a/libopie2/opienet/opienet.pro
+++ b/libopie2/opienet/opienet.pro
@@ -1,22 +1,28 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
HEADERS = omanufacturerdb.cpp \
onetutils.cpp \
onetwork.h \
opcap.h
SOURCES = omanufacturerdb.cpp \
onetutils.cpp \
onetwork.cpp \
opcap.cpp
INTERFACES =
TARGET = opienet2
VERSION = 1.8.1
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lpcap
MOC_DIR = moc
OBJECTS_DIR = obj
+
+!contains( platform, x11 ) {
include ( $(OPIEDIR)/include.pro )
+}
+contains( platform, x11 ) {
+ LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
+}
diff --git a/libopie2/opiepim/opiepim.pro b/libopie2/opiepim/opiepim.pro
index 7fc7bb7..cc6ee90 100644
--- a/libopie2/opiepim/opiepim.pro
+++ b/libopie2/opiepim/opiepim.pro
@@ -1,17 +1,24 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
HEADERS =
SOURCES =
INTERFACES =
TARGET = opiepim2
VERSION = 1.8.1
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
MOC_DIR = moc
OBJECTS_DIR = obj
+
+!contains( platform, x11 ) {
include ( $(OPIEDIR)/include.pro )
+}
+
+contains( platform, x11 ) {
+ LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
+}
diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro
index aa85955..1b6ecdf 100644
--- a/libopie2/opieui/opieui.pro
+++ b/libopie2/opieui/opieui.pro
@@ -1,48 +1,58 @@
TEMPLATE = lib
CONFIG += qt warn_on debug
DESTDIR = $(OPIEDIR)/lib
HEADERS = ocompletionbox.h \
ocombobox.h \
oeditlistbox.h \
olineedit.h \
olistview.h \
oimageeffect.h \
opixmapeffect.h \
opopupmenu.h \
opixmapprovider.h \
oselector.h \
oversatileview.h \
oversatileviewitem.h \
#ojanuswidget.h \
odialog.h \
- oseparator.h \
- otaskbarapplet.h
+ oseparator.h
+# otaskbarapplet.h
SOURCES = ocompletionbox.cpp \
ocombobox.cpp \
oeditlistbox.cpp \
olineedit.cpp \
olistview.cpp \
oimageeffect.cpp \
opixmapeffect.cpp \
opopupmenu.cpp \
opixmapprovider.cpp \
oselector.cpp \
oversatileview.cpp \
oversatileviewitem.cpp \
#ojanuswidget.cpp \
odialog.cpp \
- oseparator.cpp \
- otaskbarapplet.cpp
+ oseparator.cpp #\
+# otaskbarapplet.cpp
INTERFACES =
TARGET = opieui2
VERSION = 1.8.1
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lopiecore2
MOC_DIR = moc
OBJECTS_DIR = obj
+
+!contains( platform, x11 ) {
include ( $(OPIEDIR)/include.pro )
+ HEADERS += otaskbarapplet.h
+ SOURCES += otaskbarapplet.cpp
+}
+
+contains( platform, x11 ) {
+ LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
+ message( Warning: NO otaskbarapplet ATM )
+}
diff --git a/libopie2/opieui/oversatileview.h b/libopie2/opieui/oversatileview.h
index 1df8154..8af21dc 100644
--- a/libopie2/opieui/oversatileview.h
+++ b/libopie2/opieui/oversatileview.h
@@ -1,394 +1,394 @@
/*
                This file is part of the Opie Project
=. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
.=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 OVERSATILEVIEW_H
#define OVERSATILEVIEW_H
/* QT */
#include <qwidgetstack.h>
#include <qiconview.h>
/* OPIE */
-#include <qpe/qpeapplication.h>
+#include <opie2/oapplication.h>
/* FORWARDS */
class QHeader;
class QIconSet;
class QIconViewItem;
class OListView;
class QListViewItem;
class QPopupMenu;
class QString;
#ifndef QT_NO_DRAGANDDROP
class QIconDragItem;
#endif
class OVersatileView : public QWidgetStack
{
Q_OBJECT
friend class OVersatileViewItem;
//==============================================================================================//
// OVersatileView High Level API
//==============================================================================================//
public:
OVersatileView( QWidget* parent = 0, const char* name = 0, int mode = 0 );
~OVersatileView();
QPopupMenu* contextMenu() const;
void setSynchronization( bool sync );
bool synchronization();
enum ViewMode { Tree = 0, Icons };
int viewMode();
QIconView* iconView() const;
OListView* listView() const;
enum WarningPolicy { None = 0, Warn, WarnReturn };
void setWarningPolicy( int ) const; // warn, if calling a method which doesn't apply to the current viewmode
bool warningPolicy() const;
void setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed );
public slots:
void setViewMode( int mode );
void setIconViewMode();
void setTreeViewMode();
protected:
virtual bool isValidViewMode( int mode ) const;
virtual void popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col = 0 );
private:
int _viewmode;
bool _synchronization;
mutable int _warningpolicy;
OListView* _listview;
QIconView* _iconview;
QPixmap _treeleaf;
QPixmap _treeopened;
QPixmap _treeclosed;
QPixmap _iconleaf;
QPixmap _iconopened;
QPixmap _iconclosed;
QPopupMenu* _contextmenu;
int _iconstyle;
int _treestyle;
private slots:
void contextMenuRequested( QListViewItem*, const QPoint&, int );
void contextMenuRequested( QIconViewItem*, const QPoint& );
// type converting signal forwarders
void selectionChanged( QListViewItem * );
void currentChanged( QListViewItem * );
void clicked( QListViewItem * );
void pressed( QListViewItem * );
void doubleClicked( QListViewItem * );
void returnPressed( QListViewItem * );
void onItem( QListViewItem * );
void selectionChanged( QIconViewItem * );
void currentChanged( QIconViewItem * );
void clicked( QIconViewItem * );
void pressed( QIconViewItem * );
void doubleClicked( QIconViewItem * );
void returnPressed( QIconViewItem * );
void onItem( QIconViewItem * );
void expanded( QListViewItem * item ); // QListView
void collapsed( QListViewItem * item ); // QListView
signals:
void contextMenuRequested( OVersatileViewItem * item, const QPoint& pos, int col );
/*#ifndef QT_NO_DRAGANDDROP
void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView
#endif
void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView
void itemRenamed( OVersatileViewItem *item ); // QIconView
*/
//==============================================================================================//
// "Derived" API - Case 1: Methods existing either only in QListView or only in QIconView
//==============================================================================================//
public:
/*
enum Arrangement { // QIconView
LeftToRight = 0,
TopToBottom
};
enum ResizeMode { // QIconView
Fixed = 0,
Adjust
};
enum ItemTextPos { // QIconView
Bottom = 0,
Right
};
*/
//
// only in QListView
//
int treeStepSize() const; // QListView
virtual void setTreeStepSize( int ); // QListView
QHeader * header() const; // QListView
virtual int addColumn( const QString &label, int size = -1); // QListView
virtual int addColumn( const QIconSet& iconset, const QString &label, int size = -1); // QListView
void removeColumn( int index ); // #### make virtual in next major release! // QListView
virtual void setColumnText( int column, const QString &label ); // QListView
virtual void setColumnText( int column, const QIconSet& iconset, const QString &label ); // QListView
QString columnText( int column ) const; // QListView
virtual void setColumnWidth( int column, int width ); // QListView
int columnWidth( int column ) const; // QListView
enum WidthMode { Manual, Maximum }; // QListView
virtual void setColumnWidthMode( int column, WidthMode ); // QListView
WidthMode columnWidthMode( int column ) const; // QListView
int columns() const; // QListView
virtual void setColumnAlignment( int, int ); // QListView
int columnAlignment( int ) const; // QListView
OVersatileViewItem * itemAt( const QPoint & screenPos ) const; // QListView
QRect itemRect( const OVersatileViewItem * ) const; // QListView
int itemPos( const OVersatileViewItem * ); // QListView
bool isSelected( const OVersatileViewItem * ) const; // QListView // also in QIconViewItem but not in QIconView *shrug*
virtual void setMultiSelection( bool enable ); // QListView
bool isMultiSelection() const; // QListView
OVersatileViewItem * selectedItem() const; // QListView
virtual void setOpen( OVersatileViewItem *, bool ); // QListView
bool isOpen( const OVersatileViewItem * ) const; // QListView
OVersatileViewItem * firstChild() const; // QListView
int childCount() const; // QListView
virtual void setAllColumnsShowFocus( bool ); // QListView
bool allColumnsShowFocus() const; // QListView
virtual void setItemMargin( int ); // QListView
int itemMargin() const; // QListView
virtual void setRootIsDecorated( bool ); // QListView
bool rootIsDecorated() const; // QListView
void setShowSortIndicator( bool show ); // QListView
bool showSortIndicator() const; // QListView
int index( const OVersatileViewItem *item ) const; // QIconView
public slots:
void triggerUpdate(); // QListView
signals:
void expanded( OVersatileViewItem *item ); // QListView
void collapsed( OVersatileViewItem *item ); // QListView
//
// only in QIconView
//
public:
uint count() const; // QIconView
OVersatileViewItem *firstItem() const; // QIconView
OVersatileViewItem *lastItem() const; // QIconView
OVersatileViewItem *findItem( const QPoint &pos ) const; // QIconView
OVersatileViewItem *findItem( const QString &text ) const; // QIconView
OVersatileViewItem* findFirstVisibleItem( const QRect &r ) const; // QIconView
OVersatileViewItem* findLastVisibleItem( const QRect &r ) const; // QIconView
virtual void setGridX( int rx ); // QIconView
virtual void setGridY( int ry ); // QIconView
int gridX() const; // QIconView
int gridY() const; // QIconView
virtual void setSpacing( int sp ); // QIconView
int spacing() const; // QIconView
virtual void setItemTextPos( QIconView::ItemTextPos pos ); // QIconView
QIconView::ItemTextPos itemTextPos() const; // QIconView
virtual void setItemTextBackground( const QBrush &b ); // QIconView
QBrush itemTextBackground() const; // QIconView
virtual void setArrangement( QIconView::Arrangement am ); // QIconView
QIconView::Arrangement arrangement() const; // QIconView
virtual void setResizeMode( QIconView::ResizeMode am ); // QIconView
QIconView::ResizeMode resizeMode() const; // QIconView
virtual void setMaxItemWidth( int w ); // QIconView
int maxItemWidth() const; // QIconView
virtual void setMaxItemTextLength( int w ); // QIconView
int maxItemTextLength() const; // QIconView
virtual void setAutoArrange( bool b ); // QIconView
bool autoArrange() const; // QIconView
virtual void setShowToolTips( bool b ); // QIconView
bool showToolTips() const; // QIconView
bool sorting() const; // QIconView
bool sortDirection() const; // QIconView
virtual void setItemsMovable( bool b ); // QIconView
bool itemsMovable() const; // QIconView
virtual void setWordWrapIconText( bool b ); // QIconView
bool wordWrapIconText() const; // QIconView
public slots:
virtual void arrangeItemsInGrid( const QSize &grid, bool update = TRUE ); // QIconView
virtual void arrangeItemsInGrid( bool update = TRUE ); // QIconView
virtual void updateContents(); // QIconView
signals:
/*#ifndef QT_NO_DRAGANDDROP
void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst ); // QIconView
#endif
*/
void moved(); // QIconView
void itemRenamed( OVersatileViewItem *item, const QString & ); // QIconView
void itemRenamed( OVersatileViewItem *item ); // QIconView
//==============================================================================================//
// "Derived" API - Case 2: Methods existing in QListView and QIconView with the same signatures
//==============================================================================================//
public:
enum SelectionMode {
Single = 0,
Multi,
Extended,
NoSelection
};
virtual void clear();
virtual void setFont( const QFont & );
virtual void setPalette( const QPalette & );
virtual void takeItem( OVersatileViewItem * );
void setSelectionMode( SelectionMode mode );
SelectionMode selectionMode() const;
virtual void selectAll( bool select );
virtual void clearSelection();
virtual void invertSelection();
void ensureItemVisible( const OVersatileViewItem * );
virtual void repaintItem( const OVersatileViewItem * ) const;
virtual void setCurrentItem( OVersatileViewItem * );
OVersatileViewItem * currentItem() const;
// bool eventFilter( QObject * o, QEvent * ); // use QWidgetStack implementation
// QSize minimumSizeHint() const; // use QWidgetStack implementation
// QSizePolicy sizePolicy() const; // use QWidgetStack implementation
// QSize sizeHint() const; // use QWidgetStack implementation
signals:
void selectionChanged();
void selectionChanged( OVersatileViewItem * );
void currentChanged( OVersatileViewItem * );
void clicked( OVersatileViewItem * );
void pressed( OVersatileViewItem * );
void doubleClicked( OVersatileViewItem * );
void returnPressed( OVersatileViewItem * );
void onItem( OVersatileViewItem * );
void onViewport();
//==============================================================================================//
// "Derived" API - Case 2: Methods existing in QListView and QIconView with differing signatures
//==============================================================================================//
/*
public:
virtual void insertItem( OVersatileViewItem * ); // QListView
virtual void insertItem( OVersatileViewItem *item, OVersatileViewItem *after = 0L ); // QIconView
virtual void setSelected( OVersatileViewItem *, bool ); // QListView
virtual void setSelected( OVersatileViewItem *item, bool s, bool cb = FALSE ); // QIconView
virtual void setSorting( int column, bool increasing = TRUE ); // QListView
void setSorting( bool sort, bool ascending = TRUE ); // QIconView
void sort(); // #### make virtual in next major release // QListView
virtual void sort( bool ascending = TRUE ); // QIconView
*/
signals:
void clicked( OVersatileViewItem *, const QPoint &, int ); // QListView
void clicked( OVersatileViewItem *, const QPoint & ); // QIconView
void pressed( OVersatileViewItem *, const QPoint &, int ); // QListView
void pressed( OVersatileViewItem *, const QPoint & ); // QIconView
void rightButtonClicked( OVersatileViewItem* item, const QPoint& pos ); // QIconView
void rightButtonClicked( OVersatileViewItem *, const QPoint&, int ); // QListView
void rightButtonPressed( OVersatileViewItem* item, const QPoint& pos ); // QIconView
void rightButtonPressed( OVersatileViewItem *, const QPoint&, int ); // QListView
void mouseButtonPressed( int, OVersatileViewItem *, const QPoint& , int ); // QListView
void mouseButtonPressed( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView
void mouseButtonClicked( int, OVersatileViewItem *, const QPoint&, int ); // QListView
void mouseButtonClicked( int button, OVersatileViewItem* item, const QPoint& pos ); // QIconView
};
#endif