summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/dasher/QtDasherPlugin.cc2
-rw-r--r--inputmethods/dasher/QtDasherScreen.cc13
-rw-r--r--inputmethods/dasher/QtDasherScreen.h9
3 files changed, 15 insertions, 9 deletions
diff --git a/inputmethods/dasher/QtDasherPlugin.cc b/inputmethods/dasher/QtDasherPlugin.cc
index fe1712e..cf4fc2c 100644
--- a/inputmethods/dasher/QtDasherPlugin.cc
+++ b/inputmethods/dasher/QtDasherPlugin.cc
@@ -16,13 +16,13 @@
#include <qwindowsystem_qws.h>
QtDasherPlugin::QtDasherPlugin(QWidget* parent, const char* name, WFlags f) : QFrame(parent,name,f)
{
(new QHBoxLayout(this))->setAutoAdd(TRUE);
interface = new CDasherInterface;
- interface->SetSystemLocation("/opt/QtPalmtop/share/dasher");
+ interface->SetSystemLocation("/opt/QtPalmtop/share/dasher/");
interface->Unpause(0);
interface->Start();
d = new QtDasherScreen(240,100,interface,this,this);
interface->ChangeMaxBitRate(2.5);
d->show();
utf8_codec = new QUtf8Codec;
diff --git a/inputmethods/dasher/QtDasherScreen.cc b/inputmethods/dasher/QtDasherScreen.cc
index d05ef49..7d77511 100644
--- a/inputmethods/dasher/QtDasherScreen.cc
+++ b/inputmethods/dasher/QtDasherScreen.cc
@@ -13,39 +13,42 @@
#include "DasherScreen.h"
#include "SettingsStore.h"
#define MAXFONTSIZE 25
#define MINFONTSIZE 8
+#include <iconv.h>
+#include <iostream>
+
QtDasherScreen::QtDasherScreen (int _width, int _height,
CDasherInterface *_interface,
QWidget * _parent, Dasher::CDashEditbox *edit):
QWidget(_parent), interface( _interface ),
- fontname( "fixed" ), // fontsize(12),
+ fontname( "fixed" ), fontsize(12),
Dasher::CDasherScreen(_width, _height)
{
- // font = new QFont (fontname, fontsize);
+ font = QFont (fontname.c_str(), fontsize);
painter = new QPainter ();
pixmap = new QPixmap (_width, _height);
pixmap->setOptimization(QPixmap::BestOptim);
interface->SetSettingsStore(new CSettingsStore);
interface->ChangeLanguageModel(0);
interface->ChangeView(0);
interface->ChangeEdit(edit);
- interface->GetFontSizes(&FontSizes);
+/* interface->GetFontSizes(&FontSizes);
for (int i=0; i<FontSizes.size(); i++) {
if (FontSizes[i]>Fonts.size())
Fonts.resize((FontSizes[i])+1);
Fonts[FontSizes[i]]= QFont (fontname.c_str(), FontSizes[i]);
- Fonts[FontSizes[i]].setPixelSize(FontSizes[i]);
+// Fonts[FontSizes[i]].setPixelSize(FontSizes[i]);
}
-
+*/
interface->ChangeScreen(this);
paused=true;
QTimer *tmr = new QTimer(this);
connect (tmr, SIGNAL(timeout()), SLOT(timer()));
diff --git a/inputmethods/dasher/QtDasherScreen.h b/inputmethods/dasher/QtDasherScreen.h
index c4d3b59..c029a60 100644
--- a/inputmethods/dasher/QtDasherScreen.h
+++ b/inputmethods/dasher/QtDasherScreen.h
@@ -18,12 +18,14 @@
#include <qcursor.h>
#include "DasherScreen.h"
#include "DashEdit.h"
#include "DasherInterface.h"
+#include <iconv.h>
+
using namespace Dasher;
class QtDasherScreen : public QWidget, public Dasher::CDasherScreen
{
Q_OBJECT
@@ -46,35 +48,36 @@ class QtDasherScreen : public QWidget, public Dasher::CDasherScreen
return (Dasher::Opts::Normal);
}
void TextSize(symbol Character, int* Width, int* Height, int Size) const
{
// should probably use QPainter::boundingRect()
- *Width = *Height = Fonts[Size].pixelSize();
+ *Width = *Height = font.pixelSize();
}
void DrawText(symbol Character, int x1, int y1, int Size) const
{
// QFont font = QFont (fontname.c_str(), Size);
// font.setPixelSize(Size);
QPoint point = QPoint(x1, y1+Size/2);
- painter->setFont (Fonts[Size]);
+ painter->setFont (font);
painter->drawText (point,
QString(interface->GetDisplayText(Character).c_str()));
}
void DrawRectangle(int x1, int y1, int x2, int y2,
int Color, Opts::ColorSchemes ColorScheme) const;
void Polyline(point* Points, int Number) const;
void DrawPolygon(point* Points, int Number, int Color,
Opts::ColorSchemes ColorScheme) const;
std::vector<int> FontSizes;
std::vector<QFont> Fonts;
-
+ QFont font;
+ int fontsize;
void Blank() const {
painter->begin(pixmap);
painter->setPen (NoPen);
painter->fillRect(0, 0, m_iWidth, m_iHeight,
QColor(255,255,255));
}