summaryrefslogtreecommitdiff
path: root/core/launcher/serverapp.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/serverapp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/serverapp.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index d38dd97..e4e16f2 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -34,48 +34,49 @@
#ifdef Q_WS_QWS
#include <qgfx_qws.h>
#endif
#ifdef Q_OS_WIN32
#include <io.h>
#include <process.h>
#else
#include <unistd.h>
#endif
#include <qmessagebox.h>
#include <qtimer.h>
#include <qpainter.h>
#include <qfile.h>
#include <qpixmapcache.h>
#include <stdlib.h>
#include "screensaver.h"
static ServerApplication *serverApp = 0;
static int loggedin=0;
using namespace Opie;
+using namespace Opie::Core;
QCopKeyRegister::QCopKeyRegister()
: m_keyCode( 0 ) {
}
QCopKeyRegister::QCopKeyRegister( int k, const QCString& c, const QCString& m )
:m_keyCode( k ), m_channel( c ), m_message( m ) {
}
int QCopKeyRegister::keyCode()const {
return m_keyCode;
}
QCString QCopKeyRegister::channel()const {
return m_channel;
}
QCString QCopKeyRegister::message()const {
return m_message;
}
bool QCopKeyRegister::send() {
if (m_channel.isNull() )
return false;
@@ -176,49 +177,49 @@ bool KeyFilter::keyRegistered( int key ) {
bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepeat)
{
if ( !loggedin
// Permitted keys
&& keycode != Key_F34 // power
&& keycode != Key_F30 // select
&& keycode != Key_Enter
&& keycode != Key_Return
&& keycode != Key_Space
&& keycode != Key_Left
&& keycode != Key_Right
&& keycode != Key_Up
&& keycode != Key_Down )
return TRUE;
/* check if it was registered */
if (!db ) {
if (keycode != 0 &&press && !autoRepeat && keyRegistered(keycode) )
return true;
}else {
// First check to see if DeviceButtonManager knows something about this button:
- const Opie::ODeviceButton* button = Opie::ODevice::inst()->buttonForKeycode(keycode);
+ const ODeviceButton* button = ODevice::inst()->buttonForKeycode(keycode);
if (button && !autoRepeat) {
if ( held_tid ) {
killTimer(held_tid);
held_tid = 0;
}
if ( button->heldAction().isNull() ) {
if ( press )
emit activate(button, FALSE);
} else if ( press ) {
heldButton = button;
held_tid = startTimer( ODevice::inst ()->buttonHoldTime () );
} else if ( heldButton ) {
heldButton = 0;
emit activate(button, FALSE);
}
QWSServer::screenSaverActivate(FALSE);
return TRUE;
}
return false;
}
if ( keycode == HardKey_Suspend ) {
if ( press ) emit power();
return TRUE;
}
@@ -310,66 +311,66 @@ ServerApplication::ServerApplication( int& argc, char **argv, Type t )
m_screensaver = new OpieScreenSaver();
m_screensaver->setInterval( -1 );
QWSServer::setScreenSaver( m_screensaver );
connect( qApp, SIGNAL( volumeChanged(bool) ),
this, SLOT( rereadVolumes() ) );
/* ### PluginLoader libqtopia SafeMode */
#if 0
if ( PluginLoader::inSafeMode() )
QTimer::singleShot(500, this, SLOT(showSafeMode()) );
QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) );
#endif
kf = new KeyFilter(this);
connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) );
connect( kf, SIGNAL(power()), this, SIGNAL(power()) );
connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) );
connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol()));
connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle()));
connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle()));
- connect( kf, SIGNAL(activate(const Opie::ODeviceButton*,bool)),
- this,SIGNAL(activate(const Opie::ODeviceButton*,bool)));
+ connect( kf, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)),
+ this,SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)));
connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) );
connect( this, SIGNAL(power() ),
SLOT(togglePower() ) );
rereadVolumes();
serverApp = this;
apmTimeout();
grabKeyboard();
/* make sure the event filter is installed */
- const Opie::ODeviceButton* but = Opie::ODevice::inst()->buttonForKeycode( -1 );
+ const ODeviceButton* but = ODevice::inst()->buttonForKeycode( -1 );
}
ServerApplication::~ServerApplication()
{
ungrabKeyboard();
delete pa;
delete m_ps;
delete m_ps_last;
}
void ServerApplication::apmTimeout() {
serverApp-> checkMemory( ); // in case no events are generated
*m_ps_last = *m_ps;
*m_ps = PowerStatusManager::readStatus();
if ( m_ps->acStatus() != m_ps_last-> acStatus() )
m_screensaver-> powerStatusChanged( *m_ps );
if ( m_ps->acStatus() == PowerStatus::Online ) {
return;
}