diff --git a/applets/kimpanel/src/CMakeLists.txt b/applets/kimpanel/src/CMakeLists.txt
deleted file mode 100644
index e3a76446b..000000000
--- a/applets/kimpanel/src/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-project(plasma-applet-kimpanel)
-
-include_directories(${X11_X11_INCLUDE_PATH})
-
-set(plasma_applet_kimpanel_SRCS
- kimpanel.cpp
- kimpanelinputpanel.cpp
- kimpanelinputpanelgraphics.cpp
- kimpanelsettings.cpp
- kimpanellabelgraphics.cpp
- kimpanelstatusbargraphics.cpp
- icongridlayout.cpp
- paintutils.cpp
- dummywidget.cpp
-)
-
-kde4_add_ui_files(plasma_applet_kimpanel_SRCS config.ui)
-kde4_add_kcfg_files(plasma_applet_kimpanel_SRCS kimpanelconfig.kcfgc)
-kde4_add_plugin(plasma_applet_kimpanel ${plasma_applet_kimpanel_SRCS})
-target_link_libraries(plasma_applet_kimpanel
- ${KDE4_KDECORE_LIBS}
- ${KDE4_PLASMA_LIBS}
- ${KDE4_KIO_LIBS}
- ${X11_X11_LIB}
- )
-
-install(TARGETS plasma_applet_kimpanel
- DESTINATION ${PLUGIN_INSTALL_DIR})
-
-install(FILES plasma-applet-kimpanel.desktop
- DESTINATION ${SERVICES_INSTALL_DIR})
-
-install(FILES kimpanelconfig.kcfg
- DESTINATION ${KCFG_INSTALL_DIR})
diff --git a/applets/kimpanel/src/Messages.sh b/applets/kimpanel/src/Messages.sh
deleted file mode 100755
index cc91d3ddf..000000000
--- a/applets/kimpanel/src/Messages.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#! /usr/bin/env bash
-$EXTRACTRC *.ui *.kcfg >> rc.cpp
-$XGETTEXT *.cpp *.h -o $podir/plasma_applet_kimpanel.pot
-rm -f rc.cpp
diff --git a/applets/kimpanel/src/config.ui b/applets/kimpanel/src/config.ui
deleted file mode 100644
index ca14d2fe7..000000000
--- a/applets/kimpanel/src/config.ui
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
- GeneralConfig
-
-
-
- 0
- 0
- 569
- 382
-
-
-
-
- QFormLayout::ExpandingFieldsGrow
-
- -
-
-
- Vertical List
-
-
-
- -
-
-
-
-
-
-
- -
-
-
- Reverse display order when at screen border
-
-
-
- -
-
-
-
-
-
-
- -
-
-
- Font
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Sunken
-
-
- TextLabel
-
-
-
- -
-
-
- Select Font
-
-
-
-
-
- -
-
-
- Input Method
-
-
-
- -
-
-
- Select Application
-
-
-
-
-
-
-
-
diff --git a/applets/kimpanel/src/dummywidget.cpp b/applets/kimpanel/src/dummywidget.cpp
deleted file mode 100644
index ae8e2f2ea..000000000
--- a/applets/kimpanel/src/dummywidget.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "dummywidget.h"
-#include
-#include
-
-DummyWidget::DummyWidget(QGraphicsWidget* parent) : QGraphicsWidget(parent)
-{
- setMinimumSize(0, 0);
- setMaximumSize(INT_MAX, 1);
- setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-}
-
-void DummyWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- Q_UNUSED(widget);
- painter->fillRect(option->rect, QBrush(Qt::transparent));
- // painter->fillRect(option->rect, QBrush(Qt::blue));
-}
diff --git a/applets/kimpanel/src/dummywidget.h b/applets/kimpanel/src/dummywidget.h
deleted file mode 100644
index 5318f1b2e..000000000
--- a/applets/kimpanel/src/dummywidget.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2012 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef KIMPANEL_DUMMYWIDGET_H
-#define KIMPANEL_DUMMYWIDGET_H
-
-// Qt
-#include
-
-class DummyWidget: public QGraphicsWidget
-{
- Q_OBJECT
-public:
-
- DummyWidget(QGraphicsWidget* parent = 0);
-
-protected:
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
-};
-
-#endif // KIMPANEL_LABELGRAPHICS_H
diff --git a/applets/kimpanel/src/icongridlayout.cpp b/applets/kimpanel/src/icongridlayout.cpp
deleted file mode 100644
index ad56ab750..000000000
--- a/applets/kimpanel/src/icongridlayout.cpp
+++ /dev/null
@@ -1,408 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2010 - 2011 by Ingomar Wesp *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#include "icongridlayout.h"
-
-// KDE
-#include
-
-// stdlib
-#include
-
-const int IconGridLayout::DEFAULT_CELL_SPACING = 4;
-
-IconGridLayout::IconGridLayout(QGraphicsLayoutItem *parent)
- : QGraphicsLayout(parent),
- m_items(),
- m_mode(PreferRows),
- m_cellSpacing(DEFAULT_CELL_SPACING),
- m_maxSectionCount(0),
- m_maxSectionCountForced(false),
- m_rowCount(0),
- m_columnCount(0),
- m_rowHeights(),
- m_columnWidths()
-{
- setContentsMargins(0, 0, 0, 0);
-
- QSizePolicy sizePolicy(
- QSizePolicy::Expanding, QSizePolicy::Expanding);
- sizePolicy.setHeightForWidth(true);
- sizePolicy.setHorizontalStretch(1);
- sizePolicy.setVerticalStretch(1);
- setSizePolicy(sizePolicy);
- setMaximumSize(INT_MAX, INT_MAX);
-}
-
-IconGridLayout::~IconGridLayout()
-{
- Q_FOREACH(QGraphicsLayoutItem * item, m_items) {
- if (item->ownedByLayout()) {
- delete item;
- }
- }
- m_items.clear();
-}
-
-IconGridLayout::Mode IconGridLayout::mode() const
-{
- return m_mode;
-}
-
-void IconGridLayout::setMode(Mode mode)
-{
- if (mode == m_mode) {
- return;
- }
-
- m_mode = mode;
- updateGridParameters();
- invalidate();
-}
-
-int IconGridLayout::cellSpacing() const
-{
- return m_cellSpacing;
-}
-
-void IconGridLayout::setCellSpacing(int cellSpacing)
-{
- cellSpacing = qMax(0, cellSpacing);
-
- if (cellSpacing == m_cellSpacing) {
- return;
- }
-
- m_cellSpacing = cellSpacing;
- updateGridParameters();
- invalidate();
-}
-
-int IconGridLayout::maxSectionCount() const
-{
- return m_maxSectionCount;
-}
-
-void IconGridLayout::setMaxSectionCount(int maxSectionCount)
-{
- if (m_maxSectionCount == maxSectionCount) {
- return;
- }
-
- m_maxSectionCount = maxSectionCount;
- updateGridParameters();
- invalidate();
-}
-
-bool IconGridLayout::maxSectionCountForced() const
-{
- return m_maxSectionCountForced;
-}
-
-void IconGridLayout::setMaxSectionCountForced(bool enable)
-{
- if (m_maxSectionCountForced == enable) {
- return;
- }
-
- m_maxSectionCountForced = enable;
- updateGridParameters();
- invalidate();
-}
-
-void IconGridLayout::addItem(QGraphicsLayoutItem *item)
-{
- m_items.append(item);
- addChildLayoutItem(item);
- item->setParentLayoutItem(this);
- updateGridParameters();
- invalidate();
-}
-
-void IconGridLayout::insertItem(int index, QGraphicsLayoutItem *item)
-{
- m_items.insert(index, item);
- addChildLayoutItem(item);
- item->setParentLayoutItem(this);
- updateGridParameters();
- invalidate();
-}
-
-void IconGridLayout::moveItem(int from, int to)
-{
- m_items.move(from, to);
- invalidate();
-}
-
-int IconGridLayout::rowCount() const
-{
- return m_rowCount;
-}
-
-int IconGridLayout::columnCount() const
-{
- return m_columnCount;
-}
-
-int IconGridLayout::count() const
-{
- return m_items.size();
-}
-
-QGraphicsLayoutItem *IconGridLayout::itemAt(int index) const
-{
- return m_items[index];
-}
-
-QGraphicsLayoutItem *IconGridLayout::itemAt(int row, int column) const
-{
- return m_items[row * m_columnCount + column];
-}
-
-void IconGridLayout::removeAt(int index)
-{
- QGraphicsLayoutItem *item = m_items.takeAt(index);
- item->setParentLayoutItem(0);
-
- if (item->ownedByLayout()) {
- delete item;
- }
-
- updateGridParameters();
- invalidate();
-}
-
-void IconGridLayout::setGeometry(const QRectF &rect)
-{
- QGraphicsLayout::setGeometry(rect);
- updateGridParameters();
-
- qreal offsetLeft =
- qMax(
- contentsRect().left(),
- (contentsRect().width() - preferredWidth()) / 2);
-
- qreal offsetTop =
- qMax(
- contentsRect().top(),
- (contentsRect().height() - preferredHeight()) / 2);
-
- QPointF pos(offsetLeft, offsetTop);
- QSizeF size;
-
- int itemCount = m_items.size();
- for (int i = 0; i < itemCount; i++) {
- int row = i / m_columnCount;
- int column = i % m_columnCount;
-
- if (column == 0) {
- size.setHeight(m_rowHeights.at(row));
- if (row > 0) {
- pos.rx() = offsetLeft;
- pos.ry() += m_rowHeights.at(row - 1) + m_cellSpacing;
- }
- } else {
- pos.rx() += m_columnWidths.at(column - 1) + m_cellSpacing;
- }
-
- size.setWidth(m_columnWidths.at(column));
- m_items[i]->setGeometry(QRectF(pos, size));
- }
-}
-
-QSizeF IconGridLayout::sizeHint(
- Qt::SizeHint which, const QSizeF &constraint) const
-{
- Q_UNUSED(constraint);
-
- switch (which) {
- case Qt::PreferredSize: return m_preferredSizeHint;
- case Qt::MinimumSize:
- if (m_mode == PreferRows) {
- return QSizeF(m_preferredSizeHint.width(), IconSize(KIconLoader::Small));
- } else {
- return QSizeF(IconSize(KIconLoader::Small), m_preferredSizeHint.height());
- }
-
- default:
- return QSizeF();
- }
-}
-
-void IconGridLayout::computeGridParameters(
- QList &rowHeights, QList &columnWidths,
- QSizeF &preferredSize) const
-{
- columnWidths.clear();
- rowHeights.clear();
-
- const int itemCount = m_items.size();
- if (itemCount == 0) {
- preferredSize.setWidth(.0);
- preferredSize.setHeight(.0);
- return;
- }
-
- int rowCount;
- int columnCount;
-
- if (m_mode == PreferRows) {
- const int height = int(contentsRect().height());
- int minRowHeight = 0;
- Q_FOREACH(QGraphicsLayoutItem * item, m_items) {
- minRowHeight = qMax(minRowHeight, (int)item->minimumHeight());
- }
-
- if (m_maxSectionCount > 0 && m_maxSectionCountForced) {
- rowCount = qMin(itemCount, m_maxSectionCount);
- } else {
- rowCount = height / (minRowHeight + m_cellSpacing);
- rowCount = qBound(1, rowCount, itemCount);
-
- if (m_maxSectionCount > 0) {
- rowCount = qMin(rowCount, m_maxSectionCount);
- }
- }
- columnCount = ceil(double(itemCount) / rowCount);
-
- // Determine row heights.
- int maxRowHeight =
- qMax(minRowHeight,
- (height - (rowCount - 1) * m_cellSpacing) / rowCount);
-
- for (int row = 0; row < rowCount; row++) {
- int desiredRowHeight = 0;
- for (int column = 0; column < columnCount; column++) {
- int itemIndex = row * columnCount + column;
-
- if (itemIndex >= itemCount) {
- break;
- }
- desiredRowHeight =
- qMax(desiredRowHeight, int(m_items.at(itemIndex)->preferredHeight()));
- }
- rowHeights.append(desiredRowHeight < maxRowHeight ? desiredRowHeight : maxRowHeight);
- }
-
- // Determine column widths.
- for (int column = 0; column < columnCount; column++) {
- int columnWidth = 0;
- for (int row = 0; row < rowCount; row++) {
- int itemIndex = row * columnCount + column;
-
- if (itemIndex >= itemCount) {
- break;
- }
-
- int preferredItemWidth =
- int(m_items.at(itemIndex)->effectiveSizeHint(Qt::PreferredSize, QSizeF(-1, rowHeights.at(row))).width());
-
- columnWidth = qMax(columnWidth, preferredItemWidth);
-
- }
- columnWidths.append(columnWidth);
- }
- } else { // m_mode == PreferColumns
- const int width = int(contentsRect().width());
- int minColumnWidth = 0;
- Q_FOREACH(QGraphicsLayoutItem * item, m_items) {
- minColumnWidth = qMax(minColumnWidth, (int)item->minimumWidth());
- }
-
- if (m_maxSectionCount > 0 && m_maxSectionCountForced) {
- columnCount = qMin(itemCount, m_maxSectionCount);
- } else {
- columnCount = width / (minColumnWidth + m_cellSpacing);
- columnCount = qBound(1, columnCount, itemCount);
-
- if (m_maxSectionCount > 0) {
- columnCount = qMin(columnCount, m_maxSectionCount);
- }
- }
- rowCount = ceil(double(itemCount) / columnCount);
-
- // Determine column widths.
- int maxColumnWidth =
- qMax(minColumnWidth,
- (width - (columnCount - 1) * m_cellSpacing) / columnCount);
-
- for (int column = 0; column < columnCount; column++) {
-
- int desiredColumnWidth = 0;
- for (int row = 0; row < rowCount; row++) {
- int itemIndex = row * columnCount + column;
-
- if (itemIndex >= itemCount) {
- break;
- }
- desiredColumnWidth =
- qMax(desiredColumnWidth, int(m_items.at(itemIndex)->preferredWidth()));
- }
- columnWidths.append(desiredColumnWidth < maxColumnWidth ? desiredColumnWidth : maxColumnWidth);
- }
-
- // Determine row heights.
- for (int row = 0; row < rowCount; row++) {
- int rowHeight = 0;
- for (int column = 0; column < columnCount; column++) {
- int itemIndex = row * columnCount + column;
- if (itemIndex >= itemCount) {
- break;
- }
-
- int preferredItemHeight =
- int(m_items.at(itemIndex)->effectiveSizeHint(Qt::PreferredSize, QSizeF(columnWidths.at(column), -1)).height());
-
- rowHeight = qMax(rowHeight, preferredItemHeight);
- }
- rowHeights.append(rowHeight);
- }
- }
-
- Q_ASSERT(rowCount > 0 && columnCount > 0);
- Q_ASSERT(rowHeights.length() == rowCount && columnWidths.length() == columnCount);
-
- preferredSize.setWidth((columnCount - 1) * m_cellSpacing);
- preferredSize.setHeight((rowCount - 1) * m_cellSpacing);
-
- for (int i = 0; i < columnCount; i++) {
- preferredSize.rwidth() += columnWidths.at(i);
- }
- for (int i = 0; i < rowCount; i++) {
- preferredSize.rheight() += rowHeights.at(i);
- }
-}
-
-void IconGridLayout::updateGridParameters()
-{
- QSizeF newPreferredSize;
-
- computeGridParameters(
- m_rowHeights, m_columnWidths,
- newPreferredSize);
-
- m_rowCount = m_rowHeights.size();
- m_columnCount = m_columnWidths.size();
-
- if (newPreferredSize != m_preferredSizeHint) {
- m_preferredSizeHint = newPreferredSize;
- updateGeometry();
- }
-}
-// vim: sw=4 sts=4 et tw=100
diff --git a/applets/kimpanel/src/icongridlayout.h b/applets/kimpanel/src/icongridlayout.h
deleted file mode 100644
index c0e581f7d..000000000
--- a/applets/kimpanel/src/icongridlayout.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2010 - 2011 by Ingomar Wesp *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-/*
- * borrow from quicklaunch plasmoid
- */
-
-#ifndef ICONGRIDLAYOUT_H
-#define ICONGRIDLAYOUT_H
-
-// Qt
-#include
-#include
-#include
-#include
-
-// Plasma
-#include
-#include
-
-class IconGridLayout : public QGraphicsLayout
-{
-public:
- enum Mode {
- PreferColumns, /**< Prefer columns over rows. */
- PreferRows /**< Prefer rows over columns. */
- };
-
- IconGridLayout(QGraphicsLayoutItem *parent = 0);
- ~IconGridLayout();
-
- Mode mode() const;
- void setMode(Mode mode);
-
- int cellSpacing() const;
- void setCellSpacing(int cellSpacing);
- int maxSectionCount() const;
-
- /**
- * Depending on the mode, @c setMaxSectionCount limits either the
- * number of rows or the number of columns that are displayed. In
- * @c PreferColumns mode, @a maxSectionCount limites the maximum
- * number of columns while in @c PreferRows mode, it applies to
- * the maximum number of rows.
- *
- * Setting @a maxSectionCount to @c 0 disables the limitation.
- *
- * @param maxSectionCount the maximum number of rows or columns
- * (depending on the mode) that should be displayed.
- */
- void setMaxSectionCount(int maxSectionCount);
-
- bool maxSectionCountForced() const;
-
- void setMaxSectionCountForced(bool enable);
-
- void addItem(QGraphicsLayoutItem *item);
- void insertItem(int index, QGraphicsLayoutItem *item);
-
- int count() const;
- int columnCount() const;
- int rowCount() const;
- QGraphicsLayoutItem *itemAt(int index) const;
- QGraphicsLayoutItem *itemAt(int row, int column) const;
- void moveItem(int from, int to);
- void removeAt(int index);
-
- void setGeometry(const QRectF &rect);
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
-
- static const int DEFAULT_CELL_SPACING;
-
-private:
- void computeGridParameters(
- QList &rowHeights, QList &columnWidths,
- QSizeF &preferredSize) const;
-
- void updateGridParameters();
-
- QList m_items;
- Mode m_mode;
- int m_cellSpacing;
- int m_maxSectionCount;
- bool m_maxSectionCountForced;
-
- int m_rowCount;
- int m_columnCount;
- QList m_rowHeights;
- QList m_columnWidths;
- QSizeF m_preferredSizeHint;
-
-};
-
-#endif // ICONGRIDLAYOUT_H
-
diff --git a/applets/kimpanel/src/kimpanel.cpp b/applets/kimpanel/src/kimpanel.cpp
deleted file mode 100644
index b4ffc54a8..000000000
--- a/applets/kimpanel/src/kimpanel.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#include "kimpanel.h"
-#include "kimpanelinputpanel.h"
-#include "kimpanelsettings.h"
-#include "kimpanelstatusbargraphics.h"
-
-// Qt
-#include
-
-// KDE
-#include
-#include
-#include
-#include
-#include
-#include
-
-// Plasma
-#include
-#include
-#include
-#include
-
-Kimpanel::Kimpanel(QObject* parent, const QVariantList& args):
- Applet(parent, args),
- m_engine(0),
- m_inputpanel(new KimpanelInputPanel()),
- m_statusbar(new KimpanelStatusBarGraphics),
- m_layout(new QGraphicsLinearLayout()),
- m_inputpanelService(0),
- m_statusbarService(0),
- m_menuTimeStamp(QDateTime::currentMSecsSinceEpoch())
-{
- m_layout->setSpacing(0);
- m_layout->setContentsMargins(0, 0, 0, 0);
- m_layout->addItem(m_statusbar);
- m_statusbar->show();
- setLayout(m_layout);
-
- m_inputPanelTimer.setInterval(1);
- m_inputPanelTimer.setSingleShot(true);
-
- m_statusBarTimer.setInterval(16);
- m_statusBarTimer.setSingleShot(true);
-
- connect(m_inputpanel, SIGNAL(selectCandidate(int)), this, SLOT(selectCandidate(int)));
- connect(m_inputpanel, SIGNAL(lookupTablePageUp()), this, SLOT(lookupTablePageUp()));
- connect(m_inputpanel, SIGNAL(lookupTablePageDown()), this, SLOT(lookupTablePageDown()));
- connect(m_statusbar, SIGNAL(triggerProperty(QString)), this, SLOT(triggerProperty(QString)));
- connect(m_statusbar, SIGNAL(reloadConfig()), this, SLOT(reloadConfig()));
- connect(m_statusbar, SIGNAL(configure()), this, SLOT(configure()));
- connect(m_statusbar, SIGNAL(exitIM()), this, SLOT(exitIM()));
- connect(m_statusbar, SIGNAL(startIM()), this, SLOT(startIM()));
-
- connect(&m_inputPanelTimer, SIGNAL(timeout()), this, SLOT(updateInputPanel()));
- connect(&m_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar()));
-}
-
-Kimpanel::~Kimpanel()
-{
- delete m_inputpanel;
-}
-
-void Kimpanel::init()
-{
- m_engine = dataEngine("kimpanel");
- m_engine->connectSource("inputpanel", this);
- m_engine->connectSource("statusbar", this);
- m_inputpanelService = m_engine->serviceForSource("inputpanel");
- m_statusbarService = m_engine->serviceForSource("statusbar");
-}
-
-void Kimpanel::configChanged()
-{
-}
-
-void Kimpanel::constraintsEvent(Plasma::Constraints constraints)
-{
- if (constraints & Plasma::FormFactorConstraint) {
- Plasma::FormFactor ff = formFactor();
-
- m_statusbar->setLayoutMode(
- ff == Plasma::Horizontal
- ? IconGridLayout::PreferRows
- : IconGridLayout::PreferColumns);
-
- // Apply icon size
- iconSizeChanged();
-
- m_layout->setOrientation(
- ff == Plasma::Vertical ? Qt::Vertical : Qt::Horizontal);
- }
-}
-
-void Kimpanel::iconSizeChanged()
-{
- Plasma::FormFactor ff = formFactor();
-
- if (ff == Plasma::Planar || ff == Plasma::MediaCenter) {
- m_statusbar->setPreferredIconSize(IconSize(KIconLoader::Desktop));
- } else {
- m_statusbar->setPreferredIconSize(IconSize(KIconLoader::Panel));
- }
-}
-
-void Kimpanel::createConfigurationInterface(KConfigDialog* parent)
-{
- QWidget *widget = new QWidget();
- m_generalUi.setupUi(widget);
- parent->addPage(widget, i18nc("General configuration page", "General"), icon());
- m_generalUi.verticalListCheckBox->setChecked(KimpanelSettings::self()->verticalPreeditBar());
- m_generalUi.reverseCheckBox->setChecked(KimpanelSettings::self()->useReverse());
-
- m_font = KimpanelSettings::self()->font();
- m_generalUi.fontPreviewLabel->setText(QString("%1 %2").arg(m_font.family()).arg(m_font.pointSize()));
- m_generalUi.fontPreviewLabel->setFont(m_font);
-
- connect(m_generalUi.fontButton, SIGNAL(clicked(bool)), this, SLOT(configFont()));
- connect(parent, SIGNAL(applyClicked()), this, SLOT(configAccepted()));
- connect(parent, SIGNAL(okClicked()), this, SLOT(configAccepted()));
-
- connect(this, SIGNAL(configFontChanged()), parent, SLOT(settingsModified()));
- connect(m_generalUi.verticalListCheckBox, SIGNAL(stateChanged(int)), parent, SLOT(settingsModified()));
- connect(m_generalUi.reverseCheckBox, SIGNAL(stateChanged(int)), parent, SLOT(settingsModified()));
- connect(m_generalUi.selectIMButton, SIGNAL(clicked(bool)), parent, SLOT(settingsModified()));
- connect(m_generalUi.selectIMButton, SIGNAL(clicked(bool)), this, SLOT(selectIM()));
-}
-
-void Kimpanel::configFont()
-{
- int result = KFontDialog::getFont(m_font);
- if (result == KFontDialog::Accepted) {
- m_generalUi.fontPreviewLabel->setText(QString("%1 %2").arg(m_font.family()).arg(m_font.pointSize()));
- m_generalUi.fontPreviewLabel->setFont(m_font);
- emit configFontChanged();
- }
-}
-
-
-void Kimpanel::configAccepted()
-{
- KimpanelSettings::self()->setVerticalPreeditBar(m_generalUi.verticalListCheckBox->isChecked());
- KimpanelSettings::self()->setUseReverse(m_generalUi.reverseCheckBox->isChecked());
- KimpanelSettings::self()->setFont(m_font);
- KimpanelSettings::self()->writeConfig();
-}
-
-void Kimpanel::updateStatusBar()
-{
- const Plasma::DataEngine::Data& data = m_engine->query("statusbar");
- m_statusbar->updateProperties(data["Properties"]);
-}
-
-void Kimpanel::updateInputPanel()
-{
- const Plasma::DataEngine::Data& data = m_engine->query("inputpanel");
- m_inputpanel->setShowAux(data["AuxVisible"].toBool());
- m_inputpanel->setShowPreedit(data["PreeditVisible"].toBool());
- m_inputpanel->setLookupTableCursor(data["LookupTableCursor"].toInt());
- m_inputpanel->setLookupTableLayout(data["LookupTableLayout"].toInt());
- m_inputpanel->setShowLookupTable(data["LookupTableVisible"].toBool());
- m_inputpanel->setAuxText(data["AuxText"].toString());
- m_inputpanel->setPreeditText(data["PreeditText"].toString());
- m_inputpanel->setPreeditCaret(data["CaretPos"].toInt());
- QStringList label;
- QStringList text;
- QList lookupTable = data["LookupTable"].toList();
- Q_FOREACH(const QVariant & item, lookupTable) {
- label << item.toMap()["label"].toString();
- text << item.toMap()["text"].toString();
- }
- m_inputpanel->setLookupTable(
- label,
- text,
- data["HasPrev"].toBool(),
- data["HasNext"].toBool());
- m_inputpanel->setSpotLocation(data["Position"].toRect());
- m_inputpanel->updateSizeVisibility();
-}
-
-void Kimpanel::dataUpdated(const QString& source, const Plasma::DataEngine::Data& data)
-{
- if (source == "inputpanel") {
- if (!m_inputPanelTimer.isActive())
- m_inputPanelTimer.start();
- } else if (source == "statusbar") {
- if (!m_statusBarTimer.isActive()) {
- m_statusBarTimer.start();
- }
- updateStatusBar();
- if (data["Menu"].isValid()) {
- QMap< QString, QVariant > map = data["Menu"].toMap();
- quint64 timestamp = map["timestamp"].toULongLong();
- if (timestamp > m_menuTimeStamp) {
- m_menuTimeStamp = timestamp;
- m_statusbar->execMenu(map["props"]);
- }
- }
- }
-}
-
-void Kimpanel::lookupTablePageUp()
-{
- if (m_inputpanelService) {
- KConfigGroup arg = m_inputpanelService->operationDescription("LookupTablePageUp");
- m_inputpanelService->startOperationCall(arg);
- }
-}
-
-void Kimpanel::lookupTablePageDown()
-{
- if (m_inputpanelService) {
- KConfigGroup arg = m_inputpanelService->operationDescription("LookupTablePageDown");
- m_inputpanelService->startOperationCall(arg);
- }
-}
-
-void Kimpanel::selectCandidate(int index)
-{
- if (m_inputpanelService) {
- KConfigGroup arg = m_inputpanelService->operationDescription("SelectCandidate");
- arg.writeEntry("candidate", index);
- m_inputpanelService->startOperationCall(arg);
- }
-}
-
-void Kimpanel::triggerProperty(const QString& property)
-{
- if (m_statusbarService) {
- KConfigGroup arg = m_inputpanelService->operationDescription("TriggerProperty");
- arg.writeEntry("key", property);
- m_statusbarService->startOperationCall(arg);
- }
-}
-
-QList Kimpanel::contextualActions()
-{
- return m_statusbar->contextualActions();
-}
-
-void Kimpanel::configure()
-{
- if (m_statusbarService) {
- KConfigGroup arg = m_inputpanelService->operationDescription("Configure");
- m_statusbarService->startOperationCall(arg);
- }
-}
-
-void Kimpanel::reloadConfig()
-{
- if (m_statusbarService) {
- KConfigGroup arg = m_inputpanelService->operationDescription("ReloadConfig");
- m_statusbarService->startOperationCall(arg);
- }
-}
-
-void Kimpanel::exitIM()
-{
- if (m_statusbarService) {
- KConfigGroup arg = m_inputpanelService->operationDescription("Exit");
- m_statusbarService->startOperationCall(arg);
- }
-}
-
-void Kimpanel::startIM()
-{
- KUrl url = KimpanelSettings::self()->inputMethodLauncher();
- if (url.isLocalFile() && KDesktopFile::isDesktopFile(url.toLocalFile())) {
- new KRun(url, 0);
- } else {
- KService::Ptr service;
- KOpenWithDialog owdlg;
- if (owdlg.exec() != QDialog::Accepted)
- return;
- service = owdlg.service();
- if (service && service->isApplication()) {
- KUrl url(service->entryPath());
- if (url.isLocalFile() && KDesktopFile::isDesktopFile(url.toLocalFile())) {
- KimpanelSettings::self()->setInputMethodLauncher(url);
- KimpanelSettings::self()->writeConfig();
- new KRun(url, 0);
- }
- }
- }
-}
-
-void Kimpanel::selectIM()
-{
- KService::Ptr service;
- KOpenWithDialog owdlg;
- if (owdlg.exec() != QDialog::Accepted)
- return;
- service = owdlg.service();
- if (service && service->isApplication()) {
- KUrl url(service->entryPath());
- if (url.isLocalFile() && KDesktopFile::isDesktopFile(url.toLocalFile())) {
- KimpanelSettings::self()->setInputMethodLauncher(url);
- }
- }
-}
-
-#include "moc_kimpanel.cpp"
diff --git a/applets/kimpanel/src/kimpanel.h b/applets/kimpanel/src/kimpanel.h
deleted file mode 100644
index dea70956c..000000000
--- a/applets/kimpanel/src/kimpanel.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef KIMPANEL_H
-#define KIMPANEL_H
-
-#include "ui_config.h"
-
-// Plasma
-#include
-#include
-#include
-
-namespace Plasma
-{
-class IconWidget;
-}
-
-class QGraphicsLinearLayout;
-class KimpanelInputPanel;
-class KimpanelStatusBarGraphics;
-class Kimpanel : public Plasma::Applet
-{
- Q_OBJECT
-public:
- Kimpanel(QObject* parent, const QVariantList& args);
- virtual ~Kimpanel();
-
- virtual void init();
- virtual void configChanged();
- virtual void constraintsEvent(Plasma::Constraints constraints);
-
- virtual void createConfigurationInterface(KConfigDialog *parent);
- virtual QList< QAction* > contextualActions();
-signals:
- void configFontChanged();
-public slots:
- void dataUpdated(const QString& source, const Plasma::DataEngine::Data &data);
-protected slots:
- void lookupTablePageUp();
- void lookupTablePageDown();
- void selectCandidate(int index);
- void triggerProperty(const QString& property);
- void configAccepted();
- void configFont();
- void configure();
- void reloadConfig();
- void exitIM();
- void startIM();
- void selectIM();
- void iconSizeChanged();
- void updateInputPanel();
- void updateStatusBar();
-protected:
- Plasma::DataEngine* m_engine;
- KimpanelInputPanel* m_inputpanel;
- KimpanelStatusBarGraphics* m_statusbar;
- QGraphicsLinearLayout* m_layout;
- Plasma::Service* m_inputpanelService;
- Plasma::Service* m_statusbarService;
-
- Ui::GeneralConfig m_generalUi;
- QFont m_font;
- quint64 m_menuTimeStamp;
- QTimer m_inputPanelTimer;
- QTimer m_statusBarTimer;
-};
-
-K_EXPORT_PLASMA_APPLET(kimpanel, Kimpanel)
-
-#endif // KIMPANEL_H
diff --git a/applets/kimpanel/src/kimpanelconfig.kcfg b/applets/kimpanel/src/kimpanelconfig.kcfg
deleted file mode 100644
index 3651d1f80..000000000
--- a/applets/kimpanel/src/kimpanelconfig.kcfg
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
- QDesktopWidget
- QPoint
- QFont
-
-
-
- false
-
-
- false
-
-
- KGlobalSettings::generalFont()
-
-
-
-
-
-
-
diff --git a/applets/kimpanel/src/kimpanelconfig.kcfgc b/applets/kimpanel/src/kimpanelconfig.kcfgc
deleted file mode 100644
index 5b8a80a47..000000000
--- a/applets/kimpanel/src/kimpanelconfig.kcfgc
+++ /dev/null
@@ -1,7 +0,0 @@
-File=kimpanelconfig.kcfg
-ClassName=BaseSettings
-Visibility=
-Singleton=true
-Mutators=true
-GlobalEnums=true
-IncludeFiles=KGlobalSettings
diff --git a/applets/kimpanel/src/kimpanelinputpanel.cpp b/applets/kimpanel/src/kimpanelinputpanel.cpp
deleted file mode 100644
index 30b3d2653..000000000
--- a/applets/kimpanel/src/kimpanelinputpanel.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#include "kimpanelinputpanel.h"
-#include "kimpanelsettings.h"
-#include "kimpanelinputpanelgraphics.h"
-
-// Qt
-#include
-
-// KDE
-#include
-
-KimpanelInputPanel::KimpanelInputPanel(QWidget* parent)
- : Plasma::Dialog(parent, Qt::ToolTip),
- m_widget(new KimpanelInputPanelGraphics)
-{
- KWindowSystem::setState(winId(), NET::KeepAbove);
- KWindowSystem::setType(winId(), NET::Tooltip);
- setAttribute(Qt::WA_X11NetWmWindowTypeToolTip, true);
- QGraphicsScene* scene = new QGraphicsScene(this);
- scene->addItem(m_widget);
-
- setGraphicsWidget(m_widget);
- m_widget->show();
- connect(m_widget, SIGNAL(sizeChanged()), this, SLOT(syncToGraphicsWidget()));
-
- connect(m_widget, SIGNAL(selectCandidate(int)), this, SIGNAL(selectCandidate(int)));
- connect(m_widget, SIGNAL(lookupTablePageUp()), this, SIGNAL(lookupTablePageUp()));
- connect(m_widget, SIGNAL(lookupTablePageDown()), this, SIGNAL(lookupTablePageDown()));
-}
-
-KimpanelInputPanel::~KimpanelInputPanel()
-{
-}
-
-void KimpanelInputPanel::showEvent(QShowEvent *e)
-{
- Plasma::Dialog::showEvent(e);
- updateLocation();
-}
-
-void KimpanelInputPanel::resizeEvent(QResizeEvent* event)
-{
- Plasma::Dialog::resizeEvent(event);
- updateLocation();
-}
-
-void KimpanelInputPanel::setSpotLocation(const QRect& rect)
-{
- m_spotRect = rect;
- updateLocation();
-}
-
-void KimpanelInputPanel::updateLocation()
-{
- QRect screenRect = QApplication::desktop()->screenGeometry(QPoint(m_spotRect.x(), m_spotRect.y()));
- int x;
- x = qMin(m_spotRect.x(), screenRect.x() + screenRect.width() - width());
- x = qMax(x, screenRect.x());
- int oy = m_spotRect.y() + m_spotRect.height();
- int y = oy + 10;
- if (y < screenRect.y()) {
- y = screenRect.y();
- }
-
- if (y > screenRect.y() + screenRect.height()) {
- y = screenRect.height();
- }
-
- if (y + height() > screenRect.y() + screenRect.height()) {
- /// minus 20 to make preedit bar never overlap the input context
- y = oy - (height() + ((m_spotRect.height() == 0)?20:(m_spotRect.height() + 10)));
- m_widget->setReverse(true);
- }
- else
- m_widget->setReverse(false);
-
- QPoint p(x, y);
- if (p != pos())
- move(p);
-}
-
-void KimpanelInputPanel::setShowPreedit(bool show)
-{
- m_widget->setShowPreedit(show);
-}
-
-void KimpanelInputPanel::setShowAux(bool show)
-{
- m_widget->setShowAux(show);
-}
-
-void KimpanelInputPanel::setShowLookupTable(bool show)
-{
- m_widget->setShowLookupTable(show);
-}
-
-void KimpanelInputPanel::setLookupTableCursor(int cursor)
-{
- m_widget->setLookupTableCursor(cursor);
-}
-
-void KimpanelInputPanel::setLookupTableLayout(int layout)
-{
- m_widget->setLookupTableLayout(layout);
-}
-
-void KimpanelInputPanel::setPreeditCaret(int pos)
-{
- m_widget->setPreeditCaret(pos);
-}
-
-void KimpanelInputPanel::setPreeditText(const QString& text,
- const QString& attrs)
-{
- m_widget->setPreeditText(text, attrs);
-}
-
-void KimpanelInputPanel::setAuxText(const QString& text,
- const QString& attrs)
-{
- m_widget->setAuxText(text, attrs);
-}
-
-void KimpanelInputPanel::setLookupTable(const QStringList& labels,
- const QStringList& candidates,
- bool hasPrev,
- bool hasNext,
- const QStringList& attrs
- )
-{
- m_widget->setLookupTable(labels, candidates, hasPrev, hasNext, attrs);
-}
-
-void KimpanelInputPanel::updateVisible(bool visible)
-{
- setVisible(visible);
-}
-
-void KimpanelInputPanel::updateSizeVisibility()
-{
- m_widget->updateVisible();
- bool newVisible = m_widget->markedVisible();
- if (newVisible) {
- m_widget->updateSize();
- }
- updateVisible(newVisible);
-}
-
-
diff --git a/applets/kimpanel/src/kimpanelinputpanel.h b/applets/kimpanel/src/kimpanelinputpanel.h
deleted file mode 100644
index c4c50ba16..000000000
--- a/applets/kimpanel/src/kimpanelinputpanel.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef KIMPANEL_INPUTPANEL_H
-#define KIMPANEL_INPUTPANEL_H
-
-#include
-
-class KimpanelInputPanelGraphics;
-class KimpanelInputPanel : public Plasma::Dialog
-{
- Q_OBJECT
-public:
- KimpanelInputPanel(QWidget* parent = 0);
- virtual ~KimpanelInputPanel();
-
- void setSpotLocation(const QRect& rect);
- void updateLocation();
- void setShowPreedit(bool show);
- void setShowAux(bool show);
- void setShowLookupTable(bool show);
- void setLookupTableCursor(int cursor);
- void setLookupTableLayout(int layout);
- void setPreeditCaret(int pos);
- void setPreeditText(const QString& text,
- const QString& attrs = QString());
- void setAuxText(const QString& text,
- const QString& attrs = QString());
- void setLookupTable(const QStringList& labels,
- const QStringList& candidates,
- bool hasPrev,
- bool hasNext,
- const QStringList& attrs = QStringList()
- );
- void updateSizeVisibility();
-
-Q_SIGNALS:
- void lookupTablePageUp();
- void lookupTablePageDown();
- void selectCandidate(int index);
-protected:
- virtual void showEvent(QShowEvent* event);
- virtual void resizeEvent(QResizeEvent* event);
-private Q_SLOTS:
- void updateVisible(bool);
-private:
- KimpanelInputPanelGraphics* m_widget;
- QPoint m_pointPos;
- bool m_moving;
- QRect m_spotRect;
-};
-
-#endif // KIMPANEL_INPUTPANEL_H
-
diff --git a/applets/kimpanel/src/kimpanelinputpanelgraphics.cpp b/applets/kimpanel/src/kimpanelinputpanelgraphics.cpp
deleted file mode 100644
index 02878df5b..000000000
--- a/applets/kimpanel/src/kimpanelinputpanelgraphics.cpp
+++ /dev/null
@@ -1,394 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#include "kimpanelinputpanelgraphics.h"
-#include "kimpanellabelgraphics.h"
-#include "kimpanelsettings.h"
-#include "dummywidget.h"
-
-// KDE
-#include
-#include
-
-// Plasma
-#include
-
-enum KimpanelOrientation {
- KimpanelNotSet = 0,
- KimpanelVertical = 1,
- KimpanelHorizontal = 2
-};
-
-KimpanelInputPanelGraphics::KimpanelInputPanelGraphics(QGraphicsItem* parent, Qt::WindowFlags wFlags):
- QGraphicsWidget(parent, wFlags),
- m_layout(new QGraphicsLinearLayout(Qt::Vertical)),
- m_upperLayout(new QGraphicsLinearLayout(Qt::Horizontal)),
- m_lookupTableLayout(new QGraphicsLinearLayout(Qt::Horizontal)),
- m_pageButtonLayout(new QGraphicsLinearLayout(Qt::Horizontal)),
- m_lowerLayout(new QGraphicsLinearLayout(Qt::Horizontal)),
- m_auxLabel(new KimpanelLabelGraphics(Auxiliary, this)),
- m_preeditLabel(new KimpanelLabelGraphics(Preedit, this)),
- m_pageUpIcon(new Plasma::IconWidget(this)),
- m_pageDownIcon(new Plasma::IconWidget(this)),
- m_dummyWidget(new DummyWidget(this)),
- m_tableEntryMapper(new QSignalMapper(this)),
- m_lastVisible(false),
- m_reverse(false),
- m_lookupTableCursor(-1),
- m_fontHeight(0),
- m_useVertical(false),
- m_useReverse(false),
- m_orientaion(Qt::Horizontal)
-{
- setContentsMargins(0, 0, 0, 0);
-
- // Content inside this panel will rapidly changed
- setCacheMode(QGraphicsItem::NoCache);
-
- m_layout->setSpacing(0);
- m_layout->setContentsMargins(0, 0, 0, 0);
- m_layout->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
-
- m_upperLayout->setSpacing(0);
- m_upperLayout->setContentsMargins(0, 0, 0, 0);
- m_upperLayout->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
- m_upperLayout->addItem(m_auxLabel);
- m_upperLayout->addItem(m_preeditLabel);
- m_upperLayout->addItem(m_dummyWidget);
-
- m_lowerLayout->setSpacing(0);
- m_lowerLayout->setContentsMargins(0, 0, 0, 0);
- m_lowerLayout->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
-
- m_pageUpIcon->setIcon("arrow-left");
- m_pageUpIcon->setMinimumSize(0, 0);
- m_pageUpIcon->setMaximumSize(0, 0);
- m_pageUpIcon->hide();
-
- m_pageDownIcon->setIcon("arrow-right");
- m_pageDownIcon->setMinimumSize(0, 0);
- m_pageDownIcon->setMaximumSize(0, 0);
- m_pageDownIcon->hide();
-
- m_lowerLayout->addItem(m_lookupTableLayout);
- m_lowerLayout->addItem(m_pageButtonLayout);
- m_lowerLayout->setAlignment(m_pageButtonLayout, Qt::AlignVCenter);
-
- m_lookupTableLayout->setSpacing(0);
- m_lookupTableLayout->setContentsMargins(0, 0, 0, 0);
- m_lookupTableLayout->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
-
- m_pageButtonLayout->setSpacing(0);
- m_pageButtonLayout->setContentsMargins(0, 0, 0, 0);
- m_pageButtonLayout->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
- m_pageButtonLayout->addItem(m_pageUpIcon);
- m_pageButtonLayout->addItem(m_pageDownIcon);
-
- m_auxLabel->show();
- m_preeditLabel->show();
- m_preeditLabel->setDrawCursor(true);
-
- m_layout->addItem(m_upperLayout);
- m_layout->addItem(m_lowerLayout);
-
- setLayout(m_layout);
-
- loadSettings();
-
- connect(m_tableEntryMapper, SIGNAL(mapped(int)), this, SIGNAL(selectCandidate(int)));
- connect(m_pageUpIcon, SIGNAL(clicked()), this, SIGNAL(lookupTablePageUp()));
- connect(m_pageDownIcon, SIGNAL(clicked()), this, SIGNAL(lookupTablePageDown()));
- connect(KimpanelSettings::self(), SIGNAL(configChanged()), this, SLOT(loadSettings()));
- connect(m_preeditLabel, SIGNAL(sizeChanged()), this, SLOT(updateDummyWidget()));
- connect(m_auxLabel, SIGNAL(sizeChanged()), this, SLOT(updateDummyWidget()));
-}
-
-KimpanelInputPanelGraphics::~KimpanelInputPanelGraphics()
-{
-}
-
-void KimpanelInputPanelGraphics::updateOrientation()
-{
- Qt::Orientation newOrientation = m_useVertical ? Qt::Vertical : Qt::Horizontal;
-
- if (m_lookupTableOrientation == KimpanelVertical)
- newOrientation = Qt::Vertical;
- else if (m_lookupTableOrientation == KimpanelHorizontal)
- newOrientation = Qt::Horizontal;
-
- if (m_orientaion != newOrientation) {
- m_orientaion = newOrientation;
-
- m_lookupTableLayout->setOrientation(m_orientaion);
- m_lowerLayout->setOrientation(m_orientaion);
- }
-}
-
-void KimpanelInputPanelGraphics::loadSettings()
-{
- QFontMetrics fm(KimpanelSettings::self()->font());
- m_fontHeight = fm.height();
- m_useVertical = KimpanelSettings::self()->verticalPreeditBar();
-
- updateOrientation();
-
- m_useReverse = KimpanelSettings::self()->useReverse();
- setReverse(m_reverse, true);
-}
-
-
-QSize KimpanelInputPanelGraphics::roundSize()
-{
- QSize size = minimumSize().toSize();
-
- int roundSize = m_fontHeight * 4;
- int width = ((size.width() / roundSize) * roundSize)
- + ((size.width() % roundSize) ? roundSize : 0);
- return QSize(width, size.height());
-}
-
-void KimpanelInputPanelGraphics::resizeEvent(QGraphicsSceneResizeEvent* event)
-{
- QGraphicsWidget::resizeEvent(event);
- emit sizeChanged();
-}
-
-void KimpanelInputPanelGraphics::setShowPreedit(bool show)
-{
- preeditVisible = show;
- m_preeditLabel->setVisible(show);
-}
-
-void KimpanelInputPanelGraphics::setShowAux(bool show)
-{
- auxVisible = show;
- m_auxLabel->setVisible(show);
-}
-
-void KimpanelInputPanelGraphics::setShowLookupTable(bool show)
-{
- lookuptableVisible = show;
- if (!show)
- clearLookupTable();
- else
- updateLookupTable();
-}
-
-void KimpanelInputPanelGraphics::setLookupTableCursor(int cursor)
-{
- m_lookupTableCursor = cursor;
-}
-
-void KimpanelInputPanelGraphics::setLookupTableLayout(int layout)
-{
- m_lookupTableOrientation = layout;
-
- updateOrientation();
-}
-
-void KimpanelInputPanelGraphics::setPreeditCaret(int pos)
-{
- if (m_cursorPos != pos) {
- m_cursorPos = pos;
- m_preeditLabel->setCursorPos(pos);
- }
-}
-
-void KimpanelInputPanelGraphics::setPreeditText(const QString& text,
- const QString& attrs)
-{
- Q_UNUSED(attrs);
- if (m_text == text)
- return;
- m_text = text;
- m_preeditLabel->setText(QString(), text);
-}
-
-void KimpanelInputPanelGraphics::setAuxText(const QString& text,
- const QString& attrs)
-{
- Q_UNUSED(attrs);
- if (m_auxText == text)
- return;
- m_auxText = text;
- m_auxLabel->setText(QString(), text);
-}
-
-void KimpanelInputPanelGraphics::clearLookupTable()
-{
- while (m_lookupTableLayout->count() > 0) {
- m_lookupTableLayout->removeAt(0);
- }
- foreach(KimpanelLabelGraphics * item, m_tableEntryLabels) {
- m_tableEntryMapper->removeMappings(item);
- }
-}
-
-void KimpanelInputPanelGraphics::setLookupTable(const QStringList& labels,
- const QStringList& candidates,
- bool hasPrev,
- bool hasNext,
- const QStringList& attrs
-)
-{
- Q_UNUSED(attrs);
- if (m_labels == labels && m_candidates == candidates
- && m_hasNext == hasPrev && m_hasPrev == hasPrev)
- return;
- m_labels = labels;
- m_candidates = candidates;
- m_hasPrev = hasPrev;
- m_hasNext = hasNext;
-
- updateLookupTable();
-}
-
-void KimpanelInputPanelGraphics::updateLookupTable()
-{
- clearLookupTable();
-
- int length = qMin(m_labels.size(), m_candidates.size());
- for (int i = 0; i < length; i ++) {
- KimpanelLabelGraphics* item = NULL;
- if (m_tableEntryLabels.length() < i + 1) {
- item = new KimpanelLabelGraphics(TableEntry, this);
- item->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- connect(item, SIGNAL(clicked()), m_tableEntryMapper, SLOT(map()));
- m_tableEntryLabels << item;
- }
- item = m_tableEntryLabels[i];
- item->show();
- item->setText(m_labels[i], m_candidates[i]);
- if (i == m_lookupTableCursor)
- item->setHighLight(true);
- else
- item->setHighLight(false);
- m_tableEntryMapper->setMapping(item, i);
- }
- if (m_reverse && m_useVertical) {
- for (int i = length - 1; i >= 0; i--)
- m_lookupTableLayout->addItem(m_tableEntryLabels[i]);
- }
- else {
- for (int i = 0; i < length; i ++)
- m_lookupTableLayout->addItem(m_tableEntryLabels[i]);
- }
- for (int i = length; i < m_tableEntryLabels.length(); i ++) {
- KimpanelLabelGraphics* item = m_tableEntryLabels[i];
- item->hide();
- }
-
- m_pageUpIcon->setEnabled(m_hasPrev);
- m_pageDownIcon->setEnabled(m_hasNext);
- bool iconVisible = (m_hasPrev || m_hasNext);
- m_pageUpIcon->setVisible(iconVisible);
- m_pageDownIcon->setVisible(iconVisible);
- if (iconVisible) {
- m_pageUpIcon->setMinimumSize(IconSize(KIconLoader::Small), IconSize(KIconLoader::Small));
- m_pageUpIcon->setMaximumSize(IconSize(KIconLoader::Small), IconSize(KIconLoader::Small));
- m_pageDownIcon->setMinimumSize(IconSize(KIconLoader::Small), IconSize(KIconLoader::Small));
- m_pageDownIcon->setMaximumSize(IconSize(KIconLoader::Small), IconSize(KIconLoader::Small));
- }
- else {
- m_pageUpIcon->setMinimumSize(0, 0);
- m_pageUpIcon->setMaximumSize(0, 0);
- m_pageDownIcon->setMinimumSize(0, 0);
- m_pageDownIcon->setMaximumSize(0, 0);
- }
-}
-
-void KimpanelInputPanelGraphics::updateVisible()
-{
- if (m_lastVisible != (preeditVisible || auxVisible || lookuptableVisible)) {
- m_lastVisible = (preeditVisible || auxVisible || lookuptableVisible);
- }
-}
-
-void KimpanelInputPanelGraphics::updateDummyWidget()
-{
- m_dummyWidget->setMinimumHeight(qMax(m_preeditLabel->minimumHeight(), m_auxLabel->minimumHeight()));
- m_dummyWidget->setMaximumHeight(qMax(m_preeditLabel->minimumHeight(), m_auxLabel->minimumHeight()));
-}
-
-bool KimpanelInputPanelGraphics::markedVisible()
-{
- return m_lastVisible;
-}
-
-void KimpanelInputPanelGraphics::updateSize()
-{
- m_pageButtonLayout->invalidate();
- m_lookupTableLayout->invalidate();
- m_lowerLayout->invalidate();
- m_upperLayout->invalidate();
- m_layout->invalidate();
- resize(roundSize());
- update();
- // qDebug() << roundSize();
-}
-
-void KimpanelInputPanelGraphics::setReverse(bool reverse, bool force)
-{
- reverse = reverse && m_useReverse;
- if (m_reverse != reverse || force) {
- m_reverse = reverse;
- while(m_layout->count() > 0)
- m_layout->removeAt(0);
-
- if (m_reverse && m_useReverse) {
- m_layout->addItem(m_lowerLayout);
- m_layout->addItem(m_upperLayout);
- }
- else {
- m_layout->addItem(m_upperLayout);
- m_layout->addItem(m_lowerLayout);
- }
-
- if (m_useVertical) {
- while(m_lowerLayout->count() > 0)
- m_lowerLayout->removeAt(0);
-
- if (m_reverse && m_useReverse) {
- m_lowerLayout->addItem(m_pageButtonLayout);
- m_lowerLayout->setAlignment(m_pageButtonLayout, Qt::AlignVCenter | Qt::AlignLeft);
- m_lowerLayout->addItem(m_lookupTableLayout);
- m_lowerLayout->setAlignment(m_lookupTableLayout, Qt::AlignLeft);
- }
- else {
- m_lowerLayout->addItem(m_lookupTableLayout);
- m_lowerLayout->setAlignment(m_lookupTableLayout, Qt::AlignLeft);
- m_lowerLayout->addItem(m_pageButtonLayout);
- m_lowerLayout->setAlignment(m_pageButtonLayout, Qt::AlignVCenter | Qt::AlignLeft);
- }
- }
- else {
- while(m_lowerLayout->count() > 0)
- m_lowerLayout->removeAt(0);
- m_lowerLayout->addItem(m_lookupTableLayout);
- m_lowerLayout->setAlignment(m_lookupTableLayout, Qt::AlignLeft);
- m_lowerLayout->addItem(m_pageButtonLayout);
- m_lowerLayout->setAlignment(m_pageButtonLayout, Qt::AlignVCenter | Qt::AlignLeft);
- }
-
- if (lookuptableVisible)
- updateLookupTable();
- }
-}
-
diff --git a/applets/kimpanel/src/kimpanelinputpanelgraphics.h b/applets/kimpanel/src/kimpanelinputpanelgraphics.h
deleted file mode 100644
index b511ee80d..000000000
--- a/applets/kimpanel/src/kimpanelinputpanelgraphics.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef KIMPANEL_INPUTPANEL_GRAPHICS_H
-#define KIMPANEL_INPUTPANEL_GRAPHICS_H
-
-// Qt
-#include
-#include
-#include
-
-class DummyWidget;
-class KimpanelLabelGraphics;
-namespace Plasma
-{
-class IconWidget;
-}
-
-class QBitmap;
-class KimpanelInputPanelGraphics : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- explicit KimpanelInputPanelGraphics(QGraphicsItem* parent = 0, Qt::WindowFlags wFlags = 0);
- virtual ~KimpanelInputPanelGraphics();
-
- // virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
-
- void setShowPreedit(bool show);
- void setShowAux(bool show);
- void setShowLookupTable(bool show);
- void setLookupTableCursor(int cursor);
- void setLookupTableLayout(int layout);
- void setPreeditCaret(int pos);
- void setPreeditText(const QString& text,
- const QString& attrs = QString());
- void setAuxText(const QString& text,
- const QString& attrs = QString());
- void setLookupTable(const QStringList& labels,
- const QStringList& candidates,
- bool hasPrev,
- bool hasNext,
- const QStringList& attrs = QStringList()
- );
- QSize roundSize();
- void setReverse(bool reverse, bool force = false);
-
-public:
- void updateSize();
- void updateVisible();
- bool markedVisible();
-
-Q_SIGNALS:
- void selectCandidate(int idx);
- void lookupTablePageUp();
- void lookupTablePageDown();
-
- void sizeChanged();
-protected:
- virtual void resizeEvent(QGraphicsSceneResizeEvent* event);
-
-private slots:
- void loadSettings();
- void updateDummyWidget();
-
-private:
- void clearLookupTable();
- void updateLookupTable();
- void updateOrientation();
- QGraphicsLinearLayout *m_layout;
- QGraphicsLinearLayout *m_upperLayout;
- QGraphicsLinearLayout *m_lookupTableLayout;
- QGraphicsLinearLayout *m_pageButtonLayout;
- QGraphicsLinearLayout *m_lowerLayout;
-
- QSignalMapper mapper;
-
- QPoint m_pointPos;
- bool m_moving;
-
- bool preeditVisible;
- bool auxVisible;
- bool lookuptableVisible;
-
- QString m_text;
- int m_cursorPos;
- QString m_auxText;
- QStringList m_labels;
- QStringList m_candidates;
- bool m_hasPrev;
- bool m_hasNext;
- QColor m_candidateColor;
- QColor m_preEditColor;
- QColor m_labelColor;
-
- KimpanelLabelGraphics *m_auxLabel;
- KimpanelLabelGraphics *m_preeditLabel;
- Plasma::IconWidget *m_pageUpIcon;
- Plasma::IconWidget *m_pageDownIcon;
- DummyWidget* m_dummyWidget;
- QList m_tableEntryLabels;
-
- QSignalMapper *m_tableEntryMapper;
- bool m_lastVisible;
- bool m_reverse;
- int m_lookupTableCursor;
- int m_fontHeight;
- bool m_useVertical;
- bool m_useReverse;
- Qt::Orientation m_orientaion;
- int m_lookupTableOrientation;
-};
-
-#endif // KIMPANEL_INPUTPANEL_GRAHICS_H
-
diff --git a/applets/kimpanel/src/kimpanellabelgraphics.cpp b/applets/kimpanel/src/kimpanellabelgraphics.cpp
deleted file mode 100644
index ea7859e8a..000000000
--- a/applets/kimpanel/src/kimpanellabelgraphics.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#include "kimpanellabelgraphics.h"
-
-// Qt
-#include
-
-// KDE
-#include
-
-// Plasma
-#include
-#include
-#include
-#include
-
-KimpanelLabelGraphics::KimpanelLabelGraphics(RenderType type, QGraphicsItem *parent)
- : QGraphicsWidget(parent),
- m_drawCursor(false),
- m_cursorPos(0),
- m_renderType(type),
- m_highlight(false)
-{
- // Text inside this label will rapidly changed
- setCacheMode(QGraphicsItem::NoCache);
- setAcceptHoverEvents(true);
- connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()),
- this, SLOT(generatePixmap()));
- connect(this, SIGNAL(visibleChanged()), this, SLOT(updateSize()));
-
- setMinimumSize(0, 0);
- setMaximumSize(0, 0);
-}
-
-KimpanelLabelGraphics::~KimpanelLabelGraphics()
-{
-
-}
-
-
-void KimpanelLabelGraphics::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- if (event->button() != Qt::LeftButton) {
- QGraphicsWidget::mousePressEvent(event);
- return;
- }
-
- m_states |= PressedState;
- m_clickStartPos = scenePos();
-
- if (boundingRect().contains(event->pos())) {
- emit pressed(true);
- }
-}
-
-void KimpanelLabelGraphics::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
- if (~m_states & PressedState) {
- QGraphicsWidget::mouseMoveEvent(event);
- return;
- }
-
- if (boundingRect().contains(event->pos())) {
- if (~m_states & HoverState) {
- m_states |= HoverState;
- update();
- }
- } else {
- if (m_states & HoverState) {
- m_states &= ~HoverState;
- update();
- }
- }
-}
-
-void KimpanelLabelGraphics::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- if (~m_states & PressedState) {
- QGraphicsWidget::mouseMoveEvent(event);
- return;
- }
-
- m_states &= ~PressedState;
-
- //don't pass click when the mouse was moved
- bool handled = m_clickStartPos != scenePos();
- if (!handled) {
- if (boundingRect().contains(event->pos())) {
- emit clicked();
- }
- emit pressed(false);
- }
-
- update();
-}
-
-void KimpanelLabelGraphics::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
-{
- hoverEffect(true);
- QGraphicsWidget::hoverEnterEvent(event);
-}
-
-void KimpanelLabelGraphics::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
-{
- hoverEffect(false);
- QGraphicsWidget::hoverLeaveEvent(event);
-}
-
-void KimpanelLabelGraphics::hoverEffect(bool show)
-{
- LabelStates oldstate = m_states;
- if (show)
- m_states |= HoverState;
- else
- m_states &= ~HoverState; // Will be set once progress is zero again ...
-
- if (oldstate != m_states)
- update();
-}
-
-void KimpanelLabelGraphics::setDrawCursor(bool to_draw)
-{
- m_drawCursor = to_draw;
-}
-
-void KimpanelLabelGraphics::setCursorPos(int pos)
-{
- m_cursorPos = pos;
- generatePixmap();
-}
-
-void KimpanelLabelGraphics::setText(const QString& label, const QString& text)
-{
- if (label != m_label || m_text != text) {
- m_label = label;
- m_text = text;
- generatePixmap();
- }
-}
-
-void KimpanelLabelGraphics::updateSize()
-{
- QSizeF sz = minimumSize();
- if (isVisible()) {
- setMinimumSize(m_pixmap.size());
- setMaximumSize(m_pixmap.size());
- }
- else {
- setMinimumSize(0, 0);
- setMaximumSize(0, 0);
- }
- if (sz != minimumSize())
- emit sizeChanged();
-}
-
-void KimpanelLabelGraphics::setHighLight(bool highlight)
-{
- if (highlight != m_highlight) {
- m_highlight = highlight;
- update();
- }
-}
-
-void KimpanelLabelGraphics::setTextRenderType(RenderType type)
-{
- m_renderType = type;
-}
-
-
-void KimpanelLabelGraphics::generatePixmap()
-{
- QPixmap text_pixmap;
- QPixmap textReversed_pixmap;
- QPixmap label_pixmap;
- QPixmap labelReversed_pixmap;
-
- QSize size(0, 0);
- if (m_text.isEmpty() && m_label.isEmpty()) {
- m_pixmap = QPixmap();
- m_reversedPixmap = QPixmap();
- } else {
- if (!m_text.isEmpty()) {
- text_pixmap = renderText(m_text, m_renderType, m_drawCursor, m_cursorPos);
- textReversed_pixmap = renderText(m_text, TableLabel, m_drawCursor, m_cursorPos);
- size.setWidth(size.width() + text_pixmap.width());
- size.setHeight(text_pixmap.height());
- }
- if (!m_label.isEmpty()) {
- labelReversed_pixmap = renderText(m_label, TableEntry);
- label_pixmap = renderText(m_label, TableLabel);
- size.setWidth(size.width() + label_pixmap.width());
- size.setHeight(label_pixmap.height());
- }
- m_pixmap = QPixmap(size);
- m_reversedPixmap = QPixmap(size);
- m_pixmap.fill(Qt::transparent);
- m_reversedPixmap.fill(Qt::transparent);
- QPainter p(&m_pixmap);
- QPainter p1(&m_reversedPixmap);
- if (!label_pixmap.isNull()) {
- p.drawPixmap(0, 0, label_pixmap);
- p1.drawPixmap(0, 0, labelReversed_pixmap);
- if (!text_pixmap.isNull()) {
- p.drawPixmap(label_pixmap.width(), 0, text_pixmap);
- p1.drawPixmap(label_pixmap.width(), 0, textReversed_pixmap);
- }
- } else {
- p.drawPixmap(0, 0, text_pixmap);
- p1.drawPixmap(0, 0, textReversed_pixmap);
- }
- }
-
- updateSize();
-}
-
-void KimpanelLabelGraphics::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- Q_UNUSED(option)
- Q_UNUSED(widget)
- int h_spacing = (boundingRect().height() - m_pixmap.height()) / 2;
-
- if (Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor).value() < 128
- && KWindowSystem::compositingActive()
- ) {
- QRectF haloRect = m_pixmap.rect().translated(9, 3).translated(0, h_spacing);
- if (haloRect.width() > 18 && haloRect.height() > 6) {
- haloRect.setWidth(haloRect.width() - 18);
- haloRect.setHeight(haloRect.height() - 6);
- Plasma::PaintUtils::drawHalo(painter, haloRect);
- }
- }
- if (m_renderType == TableEntry
- && !m_label.isEmpty()
- && (m_highlight || (m_states & HoverState))
- ) {
- painter->drawPixmap(0, h_spacing,
- m_reversedPixmap);
- } else {
- painter->drawPixmap(0, h_spacing,
- m_pixmap);
- }
-}
-
diff --git a/applets/kimpanel/src/kimpanellabelgraphics.h b/applets/kimpanel/src/kimpanellabelgraphics.h
deleted file mode 100644
index 7fe49c143..000000000
--- a/applets/kimpanel/src/kimpanellabelgraphics.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef KIMPANEL_LABELGRAPHICS_H
-#define KIMPANEL_LABELGRAPHICS_H
-
-#include "paintutils.h"
-
-// Qt
-#include
-
-class KimpanelLabelGraphics: public QGraphicsWidget
-{
- Q_OBJECT
-public:
- enum LabelState {
- NoState = 0,
- HoverState = 1,
- PressedState = 2,
- ManualPressedState = 4
- };
- Q_DECLARE_FLAGS(LabelStates, LabelState)
-
- explicit KimpanelLabelGraphics(RenderType type = Auxiliary, QGraphicsItem *parent = 0);
- ~KimpanelLabelGraphics();
-
- void setDrawCursor(bool to_draw);
- void setCursorPos(int pos);
- void setTextRenderType(RenderType type);
- void setText(const QString &label, const QString &text);
- void setHighLight(bool highlight);
-
-Q_SIGNALS:
- void pressed(bool);
- void clicked();
- void lookupTablePageUp();
- void lookupTablePageDown();
- void selectCandidate();
- void sizeChanged();
-
-protected:
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
-
- virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
- virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
- virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-
- virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
- virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
-private Q_SLOTS:
- void generatePixmap();
- void updateSize();
-
-private:
- void hoverEffect(bool show);
- bool m_drawCursor;
- int m_cursorPos;
- RenderType m_renderType;
- QString m_text;
- QString m_label;
- QPixmap m_pixmap;
- QPixmap m_reversedPixmap;
- QPointF m_clickStartPos;
- LabelStates m_states;
- bool m_highlight;
-};
-
-#endif // KIMPANEL_LABELGRAPHICS_H
diff --git a/applets/kimpanel/src/kimpanelsettings.cpp b/applets/kimpanel/src/kimpanelsettings.cpp
deleted file mode 100644
index a44c876d2..000000000
--- a/applets/kimpanel/src/kimpanelsettings.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#include "kimpanelsettings.h"
-
-// KDE
-#include
-#include
-#include
-
-class SettingsHelper
-{
-public:
- SettingsHelper() : q(0) {}
- // q is also static, no need to delete it here
- ~SettingsHelper() {}
- KimpanelSettings *q;
-};
-
-K_GLOBAL_STATIC(SettingsHelper, s_globalSettings)
-
-KimpanelSettings *KimpanelSettings::self()
-{
- if (!s_globalSettings->q) {
- s_globalSettings->q = new KimpanelSettings;
- s_globalSettings->q->readConfig();
- }
-
- return s_globalSettings->q;
-}
-
-KimpanelSettings::KimpanelSettings()
-{
- //FIXME: if/when kconfig gets change notification, this will be unnecessary
- KDirWatch::self()->addFile(KStandardDirs::locateLocal("config", "kimpanelrc"));
- connect(KDirWatch::self(), SIGNAL(created(QString)), this, SLOT(settingsFileChanged()));
- connect(KDirWatch::self(), SIGNAL(dirty(QString)), this, SLOT(settingsFileChanged()));
-}
-
-KimpanelSettings::~KimpanelSettings()
-{
-}
-
-void KimpanelSettings::settingsFileChanged()
-{
- readConfig();
- emit configChanged();
-}
-
diff --git a/applets/kimpanel/src/kimpanelsettings.h b/applets/kimpanel/src/kimpanelsettings.h
deleted file mode 100644
index a37893d8e..000000000
--- a/applets/kimpanel/src/kimpanelsettings.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef KIMPANEL_SETTINGS_H
-#define KIMPANEL_SETTINGS_H
-
-#include "kimpanelconfig.h"
-
-class KimpanelSettings: public BaseSettings
-{
- Q_OBJECT
-public:
- KimpanelSettings();
- ~KimpanelSettings();
-
- static KimpanelSettings *self();
-
-public Q_SLOTS:
- void settingsFileChanged();
-};
-
-#endif // KIMPANEL_SETTINGS_H
-
diff --git a/applets/kimpanel/src/kimpanelstatusbargraphics.cpp b/applets/kimpanel/src/kimpanelstatusbargraphics.cpp
deleted file mode 100644
index 277b70b68..000000000
--- a/applets/kimpanel/src/kimpanelstatusbargraphics.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#include "kimpanelstatusbargraphics.h"
-#include "kimpanelsettings.h"
-#include "paintutils.h"
-#include "icongridlayout.h"
-
-// Qt
-#include
-#include
-#include
-#include
-#include
-
-// KDE
-#include
-#include
-#include
-#include
-#include
-
-KimpanelStatusBarGraphics::KimpanelStatusBarGraphics(QGraphicsItem *parent)
- : QGraphicsWidget(parent),
- m_layout(new IconGridLayout(this)),
- m_startIMIcon(new Plasma::IconWidget(this)),
- m_propertyMapper(new QSignalMapper(this)),
- m_svg(0)
-{
- m_startIMIcon->setIcon(KIcon("draw-freehand"));
- m_startIMIcon->hide();
- Plasma::ToolTipContent data(i18n("Start Input Method"), i18n("Start Input Method"), KIcon("draw-freehand"));
- Plasma::ToolTipManager::self()->setContent(m_startIMIcon, data);
- connect(m_startIMIcon, SIGNAL(clicked()), this, SIGNAL(startIM()));
-
- m_filterAction = new QAction(KIcon("view-filter"), i18n("Icon Filter"), this);
- m_filterMenu = new QMenu;
- m_filterAction->setMenu(m_filterMenu);
-
- m_configureAction = new QAction(KIcon("configure"), i18n("Configure Input Method"), this);
- connect(m_configureAction, SIGNAL(triggered()), this, SIGNAL(configure()));
-
- m_reloadConfigAction = new QAction(KIcon("view-refresh"), i18n("Reload Config"), this);
- connect(m_reloadConfigAction, SIGNAL(triggered()), this, SIGNAL(reloadConfig()));
-
- m_exitAction = new QAction(KIcon("application-exit"), i18n("Exit Input Method"), this);
- connect(m_exitAction, SIGNAL(triggered()), this, SIGNAL(exitIM()));
-
- setLayout(m_layout);
- connect(m_propertyMapper, SIGNAL(mapped(QString)), this, SIGNAL(triggerProperty(QString)));
-
- QStringList list = KimpanelSettings::self()->statusbarHiddenProperties();
- Q_FOREACH(const QString & str, list)
- m_hiddenProperties.insert(str);
-
- updateIcon();
-}
-
-KimpanelStatusBarGraphics::~KimpanelStatusBarGraphics()
-{
-}
-
-void KimpanelStatusBarGraphics::updateProperties(const QVariant& var)
-{
- QVariantList list = var.toList();
-
- m_props.clear();
- QSet keyset;
-
- Q_FOREACH(const QVariant & property, list) {
- QMap< QString, QVariant > map = property.toMap();
- QString key = map["key"].toString();
- if (key.isEmpty())
- continue;
-
- if (keyset.contains(key))
- continue;
-
- QString label = map["label"].toString();
- QString icon = map["icon"].toString();
- QString tip = map["tip"].toString();
- int state = map["states"].toInt();
-
- KimpanelProperty newProperty(key, label, icon, tip, state);
-
- m_props << newProperty;
- keyset.insert(key);
- }
-
- QMutableMapIterator i(m_iconMap);
- while (i.hasNext()) {
- i.next();
- if (!keyset.contains(i.key())) {
- delete i.value();
- i.remove();
- }
- }
-
- updateIcon();
-}
-
-void KimpanelStatusBarGraphics::updateIcon()
-{
- m_filterMenu->clear();
- while (m_layout->count() > 0) {
- m_layout->removeAt(0);
- }
- Q_FOREACH(const KimpanelProperty & property, m_props) {
- Plasma::IconWidget* iconWidget = NULL;
- if (m_iconMap.contains(property.key))
- iconWidget = m_iconMap[property.key];
- else {
- iconWidget = new Plasma::IconWidget;
- m_iconMap[property.key] = iconWidget;
- iconWidget->setMaximumIconSize(QSizeF(IconSize(KIconLoader::Toolbar), IconSize(KIconLoader::Toolbar)));
- iconWidget->setMinimumIconSize(QSizeF(IconSize(KIconLoader::Toolbar), IconSize(KIconLoader::Toolbar)));
- m_propertyMapper->setMapping(iconWidget, property.key);
- connect(iconWidget, SIGNAL(clicked()), m_propertyMapper, SLOT(map()));
- }
-
- KIcon icon;
- if (property.icon.isEmpty()) {
- if (!property.label.isEmpty()) {
- if (!m_svg) {
- m_svg = new Plasma::Svg(this);
- m_svg->setImagePath("widgets/labeltexture");
- m_svg->setContainsMultipleImages(true);
- }
-
- QFont font = KimpanelSettings::self()->font();
- font.setPixelSize(IconSize(KIconLoader::Toolbar));
- QString iconString;
- // FIXME: since qt doesn't provide wcswidth equivalent yet, we only check ascii for now
- if (property.label.length() >= 2 && property.label[0].unicode() < 128 && property.label[1].unicode() < 128)
- iconString = property.label.left(2);
- else
- iconString = property.label.left(1);
- QPixmap pixmap = Plasma::PaintUtils::texturedText(iconString, KimpanelSettings::self()->font(), m_svg);
-
- icon = KIcon(pixmap);
- }
- }
- else
- icon = KIcon(property.icon);
- iconWidget->setIcon(icon);
- Plasma::ToolTipContent data(property.label, property.tip, icon);
- Plasma::ToolTipManager::self()->setContent(iconWidget, data);
-
- if (m_hiddenProperties.contains(property.key))
- iconWidget->hide();
- else {
- iconWidget->show();
- m_layout->addItem(iconWidget);
- }
-
- QAction *hiddenAction = new KToggleAction(property.label, m_filterMenu);
- hiddenAction->setCheckable(true);
- hiddenAction->setChecked(! m_hiddenProperties.contains(property.key));
- hiddenAction->setData(property.key);
- connect(hiddenAction, SIGNAL(toggled(bool)), this, SLOT(hiddenActionToggled()));
- m_filterMenu->addAction(hiddenAction);
- }
-
- if (m_layout->count() == 0) {
- m_layout->addItem(m_startIMIcon);
- m_startIMIcon->show();
- } else
- m_startIMIcon->hide();
-}
-
-QList KimpanelStatusBarGraphics::contextualActions() const
-{
- QList result;
-
- result << m_filterAction;
- result << m_configureAction;
- result << m_reloadConfigAction;
- result << m_exitAction;
-
- return result;
-}
-
-void KimpanelStatusBarGraphics::hiddenActionToggled()
-{
- QAction *action = qobject_cast(sender());
-
- if (action) {
- QString key = action->data().toString();
-
- if (action->isChecked()) {
- m_hiddenProperties.remove(key);
- if (m_iconMap.value(key))
- m_iconMap.value(key)->show();
- } else {
- m_hiddenProperties.insert(key);
- if (m_iconMap.value(key))
- m_iconMap.value(key)->hide();
- }
-
- updateIcon();
-
- KimpanelSettings::self()->setStatusbarHiddenProperties(m_hiddenProperties.toList());
- KimpanelSettings::self()->writeConfig();
- } else {
- kWarning() << "qobject_cast failed";
- }
-}
-
-void KimpanelStatusBarGraphics::execMenu(const QVariant &var)
-{
- if (!var.isValid())
- return;
-
- QVariantList list = var.toList();
- QList propList;
-
- Q_FOREACH(const QVariant & property, list) {
- QMap< QString, QVariant > map = property.toMap();
- QString key = map["key"].toString();
- if (key.isEmpty())
- continue;
-
- QString label = map["label"].toString();
- QString icon = map["icon"].toString();
- QString tip = map["tip"].toString();
- int state = map["states"].toInt();
-
- KimpanelProperty newProperty(key, label, icon, tip, state);
-
- propList << newProperty;
- }
-
- if (propList.length() == 0)
- return;
-
- QMenu *menu = new QMenu();
- QAction *action;
- QSignalMapper *mapper = new QSignalMapper(menu);
- connect(mapper, SIGNAL(mapped(QString)), this, SLOT(delayedTriggerProperty(QString)));
- foreach(const KimpanelProperty & prop, propList) {
- action = new QAction(KIcon(prop.icon), prop.label, menu);
- mapper->setMapping(action, prop.key);
- connect(action, SIGNAL(triggered()), mapper, SLOT(map()));
- menu->addAction(action);
- }
- menu->exec(QCursor::pos());
- delete menu;
-}
-
-
-
-void KimpanelStatusBarGraphics::delayedTriggerProperty(const QString& key)
-{
- DelayedSignalContainer *delayObj = new DelayedSignalContainer(key, this);
- connect(delayObj, SIGNAL(notify(QString)), this, SIGNAL(triggerProperty(QString)));
- delayObj->launch(50);
-}
-
-
-void KimpanelStatusBarGraphics::setLayoutMode(IconGridLayout::Mode mode)
-{
- m_layout->setMode(mode);
-}
-
-void KimpanelStatusBarGraphics::setPreferredIconSize(int size)
-{
- QSizeF newSize(size, size);
- if (newSize == m_preferredIconSize) {
- return;
- }
- m_preferredIconSize = newSize;
- m_startIMIcon->setPreferredIconSize(newSize);
- Q_FOREACH(Plasma::IconWidget * icon, m_iconMap.values()) {
- icon->setPreferredIconSize(newSize);
- }
-}
-
diff --git a/applets/kimpanel/src/kimpanelstatusbargraphics.h b/applets/kimpanel/src/kimpanelstatusbargraphics.h
deleted file mode 100644
index 81caeaebc..000000000
--- a/applets/kimpanel/src/kimpanelstatusbargraphics.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-#ifndef KIMPANEL_STATUSBAR_GRAPHICS_H
-#define KIMPANEL_STATUSBAR_GRAPHICS_H
-
-#include "kimpanel/kimpanelagenttype.h"
-
-// Qt
-#include
-#include
-
-// Plasma
-#include
-#include "icongridlayout.h"
-
-class QSignalMapper;
-class IconGridLayout;
-
-class DelayedSignalContainer : public QObject
-{
- Q_OBJECT
-public:
- DelayedSignalContainer(const QString& key, QObject* parent = 0) : QObject(parent) {
- this->key = key;
- }
-
- void launch(int time) {
- QTimer::singleShot(time, this, SLOT(delay()));
- }
-
-signals:
- void notify(QString key);
-
-private slots:
- void delay() {
- emit notify(key);
- this->deleteLater();
- }
-
-private:
- QString key;
-};
-
-class KimpanelStatusBarGraphics : public QGraphicsWidget
-{
- Q_OBJECT
-public:
- explicit KimpanelStatusBarGraphics(QGraphicsItem *parent = 0);
- ~KimpanelStatusBarGraphics();
- void updateProperties(const QVariant& var);
- void execMenu(const QVariant &var);
- QList contextualActions() const;
- void setLayoutMode(IconGridLayout::Mode mode);
- void setPreferredIconSize(int size);
-Q_SIGNALS:
- void triggerProperty(QString property);
- void configure();
- void reloadConfig();
- void exitIM();
- void startIM();
-protected Q_SLOTS:
- void hiddenActionToggled();
- void delayedTriggerProperty(const QString& key);
-private:
- void updateIcon();
- IconGridLayout* m_layout;
- QList< KimpanelProperty > m_props;
- QMap m_iconMap;
- Plasma::IconWidget* m_startIMIcon;
-
- QSignalMapper *m_propertyMapper;
-
- QMenu* m_filterMenu;
- QAction *m_filterAction;
- QAction* m_configureAction;
- QAction *m_reloadConfigAction;
- QAction *m_exitAction;
- QSet m_hiddenProperties;
- QSizeF m_preferredIconSize;
- Plasma::Svg* m_svg;
-};
-
-#endif // KIMPANEL_STATUSBAR_GRAPHICS_H
-
diff --git a/applets/kimpanel/src/paintutils.cpp b/applets/kimpanel/src/paintutils.cpp
deleted file mode 100644
index 16a2b4ae6..000000000
--- a/applets/kimpanel/src/paintutils.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#include "paintutils.h"
-
-// Plasma
-#include
-
-QPixmap renderText(QString text, RenderType type, bool drawCursor, int cursorPos, const QFont& font)
-{
- Plasma::Theme *theme = Plasma::Theme::defaultTheme();
- switch (type) {
- case Statusbar:
- return renderText(text, theme->color(Plasma::Theme::TextColor),
- Qt::transparent, drawCursor, cursorPos, font);
- case Auxiliary:
- return renderText(text, theme->color(Plasma::Theme::TextColor),
- Qt::transparent, drawCursor, cursorPos, font);
- case Preedit:
- return renderText(text, theme->color(Plasma::Theme::TextColor),
- Qt::transparent, drawCursor, cursorPos, font);
- case TableLabel:
- return renderText(text, theme->color(Plasma::Theme::LinkColor),
- Qt::transparent, drawCursor, cursorPos, font);
- case TableEntry:
- return renderText(text, theme->color(Plasma::Theme::TextColor),
- Qt::transparent, drawCursor, cursorPos, font);
- default:
- return renderText(text, theme->color(Plasma::Theme::TextColor),
- Qt::transparent, drawCursor, cursorPos, font);
- }
-}
-
-QPixmap renderText(QString text,
- QColor textColor,
- QColor bgColor,
- bool drawCursor,
- int cursorPos,
- const QFont &ft)
-{
- //don't try to paint stuff on a future null pixmap because the text is empty
- if (text.isEmpty()) {
- return QPixmap();
- }
-
- const qreal leftmargin = 3;
- const qreal rightmargin = 3;
- const qreal topmargin = 3;
- const qreal bottonmargin = 3;
-
- QFont font = ft;
- // Draw text
- QFontMetrics fm(font);
- QSize textSize = fm.size(Qt::TextSingleLine, text) + QSize(1, 0) + QSize(leftmargin + rightmargin, topmargin + bottonmargin);
- QPixmap textPixmap(textSize.width(), textSize.height());
- textPixmap.fill(bgColor);
- QPainter p(&textPixmap);
- p.setPen(textColor);
- p.setFont(font);
- p.drawText(leftmargin, topmargin + fm.ascent(), text);
-
- if (drawCursor) {
- int pixelsWide = fm.size(Qt::TextSingleLine, text.left(cursorPos)).width();
- p.drawLine(leftmargin + pixelsWide, topmargin, leftmargin + pixelsWide, topmargin + fm.height());
- }
-
- p.end();
- return textPixmap;
-}
diff --git a/applets/kimpanel/src/paintutils.h b/applets/kimpanel/src/paintutils.h
deleted file mode 100644
index d306393ff..000000000
--- a/applets/kimpanel/src/paintutils.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Wang Hoi *
- * Copyright (C) 2011 by CSSlayer *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * 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 General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef PAINTUTILS_H
-#define PAINTUTILS_H
-
-#include "kimpanelsettings.h"
-
-// Qt
-#include
-#include
-#include
-#include
-
-enum RenderType {
- Statusbar,
- Auxiliary,
- Preedit,
- TableLabel,
- TableEntry
-};
-
-QPixmap renderText(QString text, RenderType type = Statusbar, bool drawCursor = false, int cursorPos = 0, const QFont& font = KimpanelSettings::self()->font());
-QPixmap renderText(QString text, QColor textColor, QColor bgColor, bool drawCursor, int cursorPos, const QFont &ft);
-
-#endif // PAINTUTILS_H
-
diff --git a/applets/kimpanel/src/plasma-applet-kimpanel.desktop b/applets/kimpanel/src/plasma-applet-kimpanel.desktop
deleted file mode 100644
index 772801577..000000000
--- a/applets/kimpanel/src/plasma-applet-kimpanel.desktop
+++ /dev/null
@@ -1,108 +0,0 @@
-[Desktop Entry]
-Name=Input Method Panel
-Name[bs]=panel metoda unosa
-Name[ca]=Plafó de mètode d'entrada
-Name[ca@valencia]=Plafó de mètode d'entrada
-Name[cs]=Panel vstupních metod
-Name[da]=Panel til input-metoder
-Name[de]=Eingabemethoden
-Name[el]=Πλαίσιο μεθόδου εισαγωγής
-Name[en_GB]=Input Method Panel
-Name[es]=Panel del método de introducción de datos
-Name[et]=Sisestusviisi paneel
-Name[fi]=Syötemenetelmäpaneeli
-Name[fr]=Panneau de méthode de saisie
-Name[gl]=Panel de métodos de entrada
-Name[hr]=Panel za metode unosa
-Name[hu]=Beviteli-mód panel
-Name[it]=Pannello dei metodi di inserimento
-Name[ja]=入力方法パネル
-Name[kk]=Теру әдістер панелі
-Name[km]=បន្ទះវិធីសាស្ត្របញ្ចូល
-Name[ko]=입력기 패널
-Name[lt]=Įvesties metodo skydelis
-Name[lv]=Ievades metodes panelis
-Name[mr]=इनपुट पध्दत पटल
-Name[nb]=Skrivemetode-rute
-Name[nds]=Ingaavmetood-Paneel
-Name[nl]=Invoermethodepaneel
-Name[nn]=Skrivesystem-panel
-Name[pa]=ਇੰਪੁੱਟ ਢੰਗ ਪੈਨਲ
-Name[pl]=Panel metody wejściowej
-Name[pt]=Painel de Introdução de Dados
-Name[pt_BR]=Painel do método de introdução de caracteres
-Name[ro]=Panou pentru Metode de Intrare
-Name[ru]=Панель метода ввода
-Name[sk]=Panel vstupnej metódy
-Name[sl]=Pult vnosnega načina
-Name[sr]=панел метода уноса
-Name[sr@ijekavian]=панел метода уноса
-Name[sr@ijekavianlatin]=panel metoda unosa
-Name[sr@latin]=panel metoda unosa
-Name[sv]=Inmatningsmetodruta
-Name[tr]=Giriş Yöntemi Paneli
-Name[ug]=كىرگۈزگۈچ تاختىسى
-Name[uk]=Панель методів введення
-Name[wa]=Scriftôr del façon d' intrer
-Name[x-test]=xxInput Method Panelxx
-Name[zh_CN]=输入法面板
-Name[zh_TW]=輸入法面板
-Comment=A generic input method panel for Oriental languages
-Comment[bs]=Generički panel metoda unosa za orijentalne jezike
-Comment[ca]=Un plafó de mètode d'entrada genèric per idiomes orientals
-Comment[ca@valencia]=Un plafó de mètode d'entrada genèric per idiomes orientals
-Comment[cs]=Obecný panel vstupních metod pro orientální jazyky
-Comment[da]=Generisk panel til input-metoder til orientalske sprog
-Comment[de]=Ein allgemeines Eingabemethoden-Miniprogramm für orientalische Sprachen
-Comment[el]=Ένα πλαίσιο εισαγωγής με γενικευμένη μέθοδο για Ανατολίτικες γλώσσες
-Comment[en_GB]=A generic input method panel for Oriental languages
-Comment[es]=Un panel genérico del método de introducción de datos para idiomas orientales
-Comment[et]=Idamaiste kirjade üldine sisestusviisi paneel
-Comment[fi]=Yleinen syötemenetelmäpaneeli itämaisille kielille
-Comment[fr]=Un panneau générique pour les méthodes de saisie pour les langues orientales
-Comment[gl]=Un panel de métodos de entrada xenérico para idiomas orientais.
-Comment[hr]=Generički panel za metode unosa za orijentalne jezike
-Comment[hu]=Általános beviteli-mód panel keleti nyelvekhez
-Comment[it]=Un pannello generico dei metodi di inserimento per le lingue orientali
-Comment[ja]=東洋言語のための汎用入力方法パネル
-Comment[kk]=Шығыс тілдердегі негізгі теру әдістер панелі
-Comment[km]=បន្ទះវិធីសាស្ត្របញ្ចូលទូទៅសម្រាប់ភាសាបច្ចឹមបូពា
-Comment[ko]=동아시아 언어를 위한 일반적인 입력기 패널
-Comment[lv]=Vienkāršs ievades metodes panelis austrumu valodām
-Comment[mr]=प्राच्य भाषांकरिता सामान्य इनपुट पध्दत पटल
-Comment[nb]=En generisk rute for å skrive inn med orientalske språk
-Comment[nds]=En allmeen Ingaavmetood för Orient-Spraken
-Comment[nl]=Een paneel met een algemene invoermethode voor oosterse talen
-Comment[nn]=Generelt skrivesystem-panel for orientalske språk
-Comment[pl]=Panel metody wejściowej dla języków orientalnych
-Comment[pt]=Um painel de introdução de dados genérico para línguas orientais
-Comment[pt_BR]=Painel de introdução de caracteres genérico para idiomas orientais
-Comment[ru]=Панель метода ввода для восточных языков
-Comment[sk]=Všeobecný panel vstupnej metódy pre orientálne jazyky
-Comment[sl]=Pult splošnega vnosnega načina za vzhodne jezike
-Comment[sr]=Генерички панел метода уноса за оријенталне језике
-Comment[sr@ijekavian]=Генерички панел метода уноса за оријенталне језике
-Comment[sr@ijekavianlatin]=Generički panel metoda unosa za orijentalne jezike
-Comment[sr@latin]=Generički panel metoda unosa za orijentalne jezike
-Comment[sv]=En generell inmatningsmetodruta för orientaliska språk
-Comment[tr]=Doğu dilleri için ortak giriş yöntemi paneli
-Comment[uk]=Загальна панель методів введення для східних мов
-Comment[x-test]=xxA generic input method panel for Oriental languagesxx
-Comment[zh_CN]=东方语言的通用输入法面板
-Comment[zh_TW]=東方語言使用的一般輸入法面板
-Type=Service
-Icon=draw-freehand
-X-KDE-ServiceTypes=Plasma/Applet
-
-X-KDE-Library=plasma_applet_kimpanel
-X-KDE-PluginInfo-Author=CSSlayer
-X-KDE-PluginInfo-Email=wengxt@gmail.com
-X-KDE-PluginInfo-Name=kimpanel
-X-KDE-PluginInfo-Version=1.0
-X-KDE-PluginInfo-Website=http://plasma.kde.org/
-X-KDE-PluginInfo-Depends=
-X-KDE-PluginInfo-License=GPL
-X-KDE-PluginInfo-EnabledByDefault=false
-X-KDE-PluginInfo-Category=Language
-X-Plasma-Requires-FileDialog=Unused
-X-Plasma-Requires-LaunchApp=Unused