summaryrefslogtreecommitdiff
path: root/core/launcher/inputmethods.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/inputmethods.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/inputmethods.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp
index 19e799a..cef16bf 100644
--- a/core/launcher/inputmethods.cpp
+++ b/core/launcher/inputmethods.cpp
@@ -12,49 +12,45 @@
** 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.
**
**********************************************************************/
#define QTOPIA_INTERNAL_LANGLIST
#include "inputmethods.h"
+/* OPIE */
+#include <opie2/odebug.h>
#include <qtopia/config.h>
#include <qtopia/qpeapplication.h>
+using namespace Opie::Core;
+/* QT */
#include <qpopupmenu.h>
#include <qtoolbutton.h>
#include <qwidgetstack.h>
#include <qlayout.h>
#include <qdir.h>
-#include <stdlib.h>
#include <qtl.h>
-
#ifdef Q_WS_QWS
#include <qwindowsystem_qws.h>
#include <qwsevent_qws.h>
#include <qcopchannel_qws.h>
#endif
-/* ### SingleFloppy if someone is interested? */
-#if 0
-#ifdef QT_NO_COMPONENT
-#include "../plugins/inputmethods/handwriting/handwritingimpl.h"
-#include "../plugins/inputmethods/keyboard/keyboardimpl.h"
-#include "../3rdparty/plugins/inputmethods/pickboard/pickboardimpl.h"
-#endif
-#endif
+/* STD */
+#include <stdlib.h>
/* XPM */
static const char * tri_xpm[]={
"9 9 2 1",
"a c #000000",
". c None",
".........",
".........",
".........",
"....a....",
"...aaa...",
"..aaaaa..",
@@ -253,25 +249,25 @@ void InputMethods::setPreferedHandlers() {
QValueList<InputMethod>::Iterator it;
if (!inputModifierList.isEmpty() && !im.isEmpty() ) {
for (it = inputModifierList.begin(); it != inputModifierList.end(); ++it )
if ( (*it).name() == im ) {
imethod = &(*it); break;
}
}
if (!inputMethodList.isEmpty() && !current.isEmpty() ) {
for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it )
if ( (*it).name() == current ) {
- qWarning("preferred keyboard is %s", current.latin1() );
+ owarn << "preferred keyboard is " << current << "" << oendl;
mkeyboard = &(*it);
kbdButton->setPixmap( *mkeyboard->icon() );
break;
}
}
}
void InputMethods::loadInputMethods()
{
#ifndef QT_NO_COMPONENT
hideInputMethod();
@@ -296,31 +292,31 @@ void InputMethods::loadInputMethods()
input.widget = input.interface->inputMethod( 0, inputWidgetStyle );
input.interface->onKeyPress( this, SLOT(sendKey(ushort,ushort,ushort,bool,bool)) );
inputMethodList.append( input );
} else if ( lib->queryInterface( IID_ExtInputMethod, (QUnknownInterface**)&eface ) == QS_OK ) {
InputMethod input;
input.newIM = TRUE;
input.library = lib;
input.libName = *it;
input.extInterface = eface;
input.widget = input.extInterface->keyboardWidget( 0, inputWidgetStyle );
// may be either a simple, or advanced.
if (input.widget) {
- //qDebug("its a keyboard");
+ //odebug << "its a keyboard" << oendl;
inputMethodList.append( input );
} else {
- //qDebug("its a real im");
+ //odebug << "its a real im" << oendl;
input.widget = input.extInterface->statusWidget( 0, 0 );
if (input.widget) {
- //qDebug("blah");
+ //odebug << "blah" << oendl;
inputModifierList.append( input );
imButton->addWidget(input.widget, inputModifierList.count());
}
}
}else{
delete lib;
lib = 0l;
}
installTranslator( (*it).left( (*it).find(".") ) );
}
qHeapSort( inputMethodList );
#endif /* killed BUILT in cause they would not compile */
@@ -532,61 +528,61 @@ void InputMethods::showKbd( bool on )
if ( on )
{
mkeyboard->resetState();
int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 );
int width = qApp->desktop()->width() * (inputWidgetWidth*0.01);
int left = 0;
int top = mapToGlobal( QPoint() ).y() - height;
if ( inputWidgetStyle & QWidget::WStyle_DialogBorder )
{
- qDebug( "InputMethods: reading geometry." );
+ odebug << "InputMethods: reading geometry." << oendl;
Config cfg( "Launcher" );
cfg.setGroup( "InputMethods" );
int l = cfg.readNumEntry( "absX", -1 );
int t = cfg.readNumEntry( "absY", -1 );
int w = cfg.readNumEntry( "absWidth", -1 );
int h = cfg.readNumEntry( "absHeight", -1 );
if ( l > -1 && t > -1 && w > -1 && h > -1 )
{
- qDebug( "InputMethods: config values ( %d, %d, %d, %d ) are ok.", l, t, w, h );
+ odebug << "InputMethods: config values ( " << l << ", " << t << ", " << w << ", " << h << " ) are ok." << oendl;
left = l;
top = t;
width = w;
height = h;
}
else
{
- qDebug( "InputMethods: config values are new or not ok." );
+ odebug << "InputMethods: config values are new or not ok." << oendl;
}
}
else
{
- qDebug( "InputMethods: no floating selected." );
+ odebug << "InputMethods: no floating selected." << oendl;
}
mkeyboard->widget->resize( width, height );
mkeyboard->widget->move( left, top );
mkeyboard->widget->show();
mkeyboard->widget->installEventFilter( this );
}
else
{
if ( inputWidgetStyle & QWidget::WStyle_DialogBorder )
{
QPoint pos = mkeyboard->widget->pos();
QSize siz = mkeyboard->widget->size();
- qDebug( "InputMethods: saving geometry." );
+ odebug << "InputMethods: saving geometry." << oendl;
Config cfg( "Launcher" );
cfg.setGroup( "InputMethods" );
cfg.writeEntry( "absX", pos.x() );
cfg.writeEntry( "absY", pos.y() );
cfg.writeEntry( "absWidth", siz.width() );
cfg.writeEntry( "absHeight", siz.height() );
cfg.write();
mkeyboard->widget->removeEventFilter( this );
}
mkeyboard->widget->hide();
}