pax_global_header00006660000000000000000000000064123010057660014512gustar00rootroot0000000000000052 comment=4404a85b0af7be76d5ccae6d189a37b2f904a45b fcitx-qimpanel-fcitx-qimpanel-0.1.5/000077500000000000000000000000001230100576600173555ustar00rootroot00000000000000fcitx-qimpanel-fcitx-qimpanel-0.1.5/.gitignore000066400000000000000000000001341230100576600213430ustar00rootroot00000000000000*~ build*/ .* !.git* .git/ *.tar.* *.kdev4 *.kate-swp *.orig tags astyle.sh cscope.* *.part fcitx-qimpanel-fcitx-qimpanel-0.1.5/CMakeLists.txt000066400000000000000000000026301230100576600221160ustar00rootroot00000000000000project(fcitx-qimpanel) cmake_minimum_required(VERSION 2.8.6) find_package(Fcitx 4.2.7 REQUIRED) find_package(Qt4 REQUIRED) include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) SET(fcitx-qimpanel_TRANS po/zh_CN.ts) SET(fcitx-qimpanel_RCCS qml.qrc) set(fcitx-qimpanel_SRCS main.cpp main_controller.cpp toplevel.cpp main_model.cpp kimpanelagent.cpp candidate_word.cpp system_tray_menu.cpp my_action.cpp skin/skinmenu.cpp skin/skinbase.cpp skin/skinfcitx.cpp skin/skinsogou.cpp) QT4_ADD_DBUS_ADAPTOR(fcitx-qimpanel_SRCS org.kde.impanel.xml kimpanelagent.h PanelAgent) QT4_ADD_TRANSLATION(fcitx-qimpanel_TRAN_SRCS ${fcitx-qimpanel_TRANS}) QT4_ADD_RESOURCES(fcitx-qimpanel_RCC_SRCS ${fcitx-qimpanel_RCCS}) configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h) add_executable(fcitx-qimpanel ${fcitx-qimpanel_SRCS} ${fcitx-qimpanel_TRAN_SRCS} ${fcitx-qimpanel_RCC_SRCS}) set_target_properties(fcitx-qimpanel PROPERTIES AUTOMOC TRUE) target_link_libraries(fcitx-qimpanel fcitx-config fcitx-utils ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY}) set(pkgbindir /usr/bin/) set(pkgdatadir /usr/share/fcitx-qimpanel) install(TARGETS fcitx-qimpanel RUNTIME DESTINATION ${pkgbindir}) install(FILES ${fcitx-qimpanel_TRAN_SRCS} DESTINATION ${pkgdatadir}) add_subdirectory(uk-default-skin) fcitx-qimpanel-fcitx-qimpanel-0.1.5/README000066400000000000000000000011041230100576600202310ustar00rootroot00000000000000How to Install fcitx-qimpanel in ubuntu: mkdir build; cd build sudo apt-get install cmake sudo apt-get install build-essential sudo apt-get install fcitx-libs-dev sudo apt-get install libqt4-declarative libqt4-dev libqt4-dev-bin qt4-default qt4-dev-tools qt4-qmake cmake ../ make sudo make install How to Install sogou skin: You can find sogou skin here: http://pinyin.sogou.com/skins/ Once you have download skin file named like demo.ssf, you can install like this: mv demo.ssf demo.zip unzip -d demo demo.zip sudo cp -r demo /usr/share/fcitx/skin/ fcitx-qimpanel-fcitx-qimpanel-0.1.5/TODO000066400000000000000000000001571230100576600200500ustar00rootroot00000000000000TODO List: sogou skin: * add support of multi pictures * FIXME: candidate word color fcitx-qimpanel-fcitx-qimpanel-0.1.5/candidate_word.cpp000066400000000000000000000021471230100576600230340ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #include "candidate_word.h" void CandidateWord::setCddLabel(const QString label) { mCddLabel = label; emit cddLabelChanged(); } void CandidateWord::setCddText(const QString text) { mCddText = text; emit cddTextChanged(); } QString CandidateWord::cddLabel() const { return mCddLabel; } QString CandidateWord::cddText() const { return mCddText; } fcitx-qimpanel-fcitx-qimpanel-0.1.5/candidate_word.h000066400000000000000000000031201230100576600224710ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __CANDIDATE_WORD_H__ #define __CANDIDATE_WORD_H__ #include #include #include class CandidateWord : public QObject { Q_OBJECT Q_PROPERTY(QString cddLabel READ cddLabel WRITE setCddLabel NOTIFY cddLabelChanged) Q_PROPERTY(QString cddText READ cddText WRITE setCddText NOTIFY cddTextChanged) public: void setCddLabel(const QString label); QString cddLabel() const; void setCddText(const QString text); QString cddText() const; signals: void cddLabelChanged(); void cddTextChanged(); private: QString mCddLabel; //存放标号字符串,比如“1.”,“2.”,“3.”,“4.”,“5.” QString mCddText; //存放候选词字符串,比如“啊”,“阿”,“吖”,“呵”,“腌” }; #endif // __CANDIDATE_WORD_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/config.h.in000066400000000000000000000001241230100576600213750ustar00rootroot00000000000000#ifndef ___CONFIG_H___ #define ___CONFIG_H___ #cmakedefine DISABLE_UK_SYNC #endif fcitx-qimpanel-fcitx-qimpanel-0.1.5/kimpanelagent.cpp000066400000000000000000000250741230100576600227100ustar00rootroot00000000000000/*************************************************************************** * 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 "kimpanelagent.h" #include "impaneladaptor.h" // Qt #include #include #include #include #include #include #include #include "kimpanelagent.h" PanelAgent::PanelAgent(QObject *parent) : QObject(parent) ,adaptor(new ImpanelAdaptor(this)) ,adaptor2(new Impanel2Adaptor(this)) ,watcher(new QDBusServiceWatcher(this)) { watcher->setConnection(QDBusConnection::sessionBus()); watcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration); QDBusConnection::connectToBus(QDBusConnection::SessionBus, "kimpanel_bus").registerObject("/org/kde/impanel", this); QDBusConnection::connectToBus(QDBusConnection::SessionBus, "kimpanel_bus").registerService("org.kde.impanel"); // directly connect to corresponding signal QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "Enable", this, SIGNAL(enable(bool))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "ShowPreedit", this, SIGNAL(showPreedit(bool))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "ShowAux", this, SIGNAL(showAux(bool))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "ShowLookupTable", this, SIGNAL(showLookupTable(bool))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "UpdateLookupTableCursor", this, SIGNAL(updateLookupTableCursor(int))); // do some serialization QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "UpdateLookupTable", this, SLOT(UpdateLookupTable(QStringList, QStringList, QStringList, bool, bool))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "UpdatePreeditCaret", this, SIGNAL(updatePreeditCaret(int))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "UpdatePreeditText", this, SLOT(UpdatePreeditText(QString, QString))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "UpdateAux", this, SLOT(UpdateAux(QString, QString))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "UpdateSpotLocation", this, SIGNAL(updateSpotLocation(int, int))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "UpdateScreen", this, SLOT(UpdateScreen(int))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "UpdateProperty", this, SLOT(UpdateProperty(QString))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "RegisterProperties", this, SLOT(RegisterProperties(QStringList))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "ExecDialog", this, SLOT(ExecDialog(QString))); QDBusConnection("kimpanel_bus").connect("", "", "org.kde.kimpanel.inputmethod", "ExecMenu", this, SLOT(ExecMenu(QStringList))); connect(watcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(serviceUnregistered(QString))); } PanelAgent::~PanelAgent() { // destructor QDBusConnection::disconnectFromBus("kimpanel_bus"); } void PanelAgent::serviceUnregistered(const QString& service) { if (service == m_currentService) { watcher->setWatchedServices(QStringList()); cached_props.clear(); m_currentService = QString(); emit showAux(false); emit showPreedit(false); emit showLookupTable(false); emit registerProperties(QList()); } } void PanelAgent::configure() { emit Configure(); } void PanelAgent::lookupTablePageDown() { emit LookupTablePageDown(); } void PanelAgent::lookupTablePageUp() { emit LookupTablePageUp(); } void PanelAgent::movePreeditCaret(int pos) { emit MovePreeditCaret(pos); } void PanelAgent::triggerProperty(const QString& key) { emit TriggerProperty(key); } void PanelAgent::selectCandidate(int idx) { emit SelectCandidate(idx); } static QList String2AttrList(const QString &str) { QList result; if (str.isEmpty()) { return result; } foreach(const QString & s, str.split(';')) { TextAttribute attr; QStringList list = s.split(':'); if (list.size() < 4) continue; switch (list.at(0).toInt()) { case 0: attr.type = TextAttribute::None; break; case 1: attr.type = TextAttribute::Decorate; break; case 2: attr.type = TextAttribute::Foreground; break; case 3: attr.type = TextAttribute::Background; break; default: attr.type = TextAttribute::None; } attr.start = list.at(1).toInt(); attr.length = list.at(2).toInt(); attr.value = list.at(3).toInt(); result << attr; } return result; } static KimpanelProperty String2Property(const QString &str) { KimpanelProperty result; QStringList list = str.split(':'); if (list.size() < 4) return result; result.key = list.at(0); result.label = list.at(1); result.icon = list.at(2); result.tip = list.at(3); if (list.size() >= 5) result.menu = list.at(4); //X { //X result.state = KimpanelProperty::None; //X int n = list.at(4).toInt(); //X if (n & KimpanelProperty::Active) //X result.state &= KimpanelProperty::Active; //X if (n & KimpanelProperty::Visible) //X result.state &= KimpanelProperty::Visible; //X } return result; } static KimpanelLookupTable Args2LookupTable(const QStringList &labels, const QStringList &candis, const QStringList &attrs, bool has_prev, bool has_next) { Q_ASSERT(labels.size() == candis.size()); Q_ASSERT(labels.size() == attrs.size()); KimpanelLookupTable result; for (int i = 0; i < labels.size(); i++) { KimpanelLookupTable::Entry entry; entry.label = labels.at(i); entry.text = candis.at(i); entry.attr = String2AttrList(attrs.at(i)); result.entries << entry; } result.has_prev = has_prev; result.has_next = has_next; return result; } void PanelAgent::created() { emit PanelCreated(); emit PanelCreated2(); } void PanelAgent::exit() { emit Exit(); } void PanelAgent::restart() { emit Restart(); } void PanelAgent::reloadConfig() { emit ReloadConfig(); } void PanelAgent::UpdateLookupTable(const QStringList &labels, const QStringList &candis, const QStringList &attrlists, bool has_prev, bool has_next) { emit updateLookupTable(Args2LookupTable(labels, candis, attrlists, has_prev, has_next)); } void PanelAgent::UpdatePreeditText(const QString &text, const QString &attr) { emit updatePreeditText(text, String2AttrList(attr)); } void PanelAgent::UpdateAux(const QString &text, const QString &attr) { emit updateAux(text, String2AttrList(attr)); } void PanelAgent::UpdateScreen(int screen_id) { Q_UNUSED(screen_id); } void PanelAgent::UpdateProperty(const QString &prop) { emit updateProperty(String2Property(prop)); } void PanelAgent::RegisterProperties(const QStringList &props) { const QDBusMessage& msg = message(); if (msg.service() != m_currentService) { watcher->removeWatchedService(m_currentService); m_currentService = msg.service(); watcher->addWatchedService(m_currentService); } if (cached_props != props) { cached_props = props; QList list; foreach(const QString & prop, props) { list << String2Property(prop); } emit registerProperties(list); } } void PanelAgent::ExecDialog(const QString &prop) { emit execDialog(String2Property(prop)); } void PanelAgent::ExecMenu(const QStringList &entries) { QList list; foreach(const QString & entry, entries) { list << String2Property(entry); } emit execMenu(list); } void PanelAgent::SetSpotRect(int x, int y, int w, int h) { emit updateSpotRect(x, y, w, h); } void PanelAgent::SetLookupTable(const QStringList& labels, const QStringList& candis, const QStringList& attrlists, bool hasPrev, bool hasNext, int cursor, int layout) { emit updateLookupTableFull(Args2LookupTable(labels, candis, attrlists, hasPrev, hasNext), cursor, layout); } fcitx-qimpanel-fcitx-qimpanel-0.1.5/kimpanelagent.h000066400000000000000000000112151230100576600223450ustar00rootroot00000000000000/*************************************************************************** * 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_AGENT_H #define KIMPANEL_AGENT_H #include "kimpanelagenttype.h" // Qt #include #include #include class QDBusServiceWatcher; class Impanel2Adaptor; class ImpanelAdaptor; class PanelAgent: public QObject, protected QDBusContext { Q_OBJECT public: PanelAgent(QObject *parent); virtual ~PanelAgent(); void configure(); void created(); void exit(); void restart(); void reloadConfig(); void selectCandidate(int idx); void lookupTablePageUp(); void lookupTablePageDown(); void movePreeditCaret(int pos); void triggerProperty(const QString& key); public: // PROPERTIES public Q_SLOTS: // METHODS void UpdateLookupTable(const QStringList &labels, const QStringList &candis, const QStringList &attrlists, bool has_prev, bool has_next); void UpdatePreeditText(const QString &text, const QString &attr); void UpdateAux(const QString &text, const QString &attr); void UpdateScreen(int screen_id); void UpdateProperty(const QString &prop); void RegisterProperties(const QStringList &props); void ExecDialog(const QString &prop); void ExecMenu(const QStringList &entries); void SetSpotRect(int x, int y, int w, int h); void SetLookupTable(const QStringList &labels, const QStringList &candis, const QStringList &attrlists, //layout参数:用来覆盖是否要强制竖排/横排 bool hasPrev, bool hasNext, int cursor, int layout); void serviceUnregistered(const QString& service); Q_SIGNALS: // signals that from kimpanel void Configure(); void MovePreeditCaret(int position); void SelectCandidate(int index); void LookupTablePageUp(); void LookupTablePageDown(); void TriggerProperty(const QString &key); void PanelCreated(); void PanelCreated2(); void Exit(); void Restart(); void ReloadConfig(); // signals to inform kimpanel void enable(bool to_enable); void updatePreeditCaret(int pos); void updatePreeditText(const QString &text, const QList &attr); void updateAux(const QString &text, const QList &attr); void updateProperty(const KimpanelProperty &prop); void updateLookupTable(const KimpanelLookupTable &lookup_table); void updateLookupTableFull(const KimpanelLookupTable& lookup_table, int cursor, int layout); void updateSpotLocation(int x, int y); void updateSpotRect(int x, int y, int w, int h); void registerProperties(const QList &props); void execDialog(const KimpanelProperty &prop); void execMenu(const QList &prop_list); void showPreedit(bool to_show); void showAux(bool to_show); void showLookupTable(bool to_show); void updateLookupTableCursor(int pos); private: bool m_show_aux; bool m_show_preedit; bool m_show_lookup_table; int m_spot_x; int m_spot_y; QString m_currentService; QStringList cached_props; ImpanelAdaptor* adaptor; Impanel2Adaptor* adaptor2; QDBusServiceWatcher* watcher; }; #endif // KIMPANEL_AGENT_H fcitx-qimpanel-fcitx-qimpanel-0.1.5/kimpanelagenttype.h000066400000000000000000000057751230100576600232650ustar00rootroot00000000000000/*************************************************************************** * 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_AGENTTYPE_H #define KIMPANEL_AGENTTYPE_H // Qt #include #include #include struct TextAttribute { enum Type { None, Decorate, Foreground, Background }; Type type; int start; int length; int value; }; struct KimpanelProperty { enum State { None = 0, Active = 1, Visible = (1 << 1) }; Q_DECLARE_FLAGS(States, State) KimpanelProperty() { } KimpanelProperty(QString key, QString label, QString icon, QString tip, int state, QString menu) { this->key = key; this->label = label; this->tip = tip; this->icon = icon; this->state = (State) state; this->menu = menu; } QString key; QString label; QString icon; QString tip; States state; QString menu; QVariantMap toMap() const { QVariantMap map; map["key"] = key; map["label"] = label; map["icon"] = icon; map["tip"] = tip; map["state"] = (int) state; map["menu"] = menu; return map; } }; Q_DECLARE_OPERATORS_FOR_FLAGS(KimpanelProperty::States) struct KimpanelLookupTable { struct Entry { QString label; //存放标号字符串,比如“1.”,“2.”,“3.”,“4.”,“5.” QString text; //存放候选词字符串,比如“啊”,“阿”,“吖”,“呵”,“腌” QList attr; }; QList entries; bool has_prev; bool has_next; }; #endif // KIMPANEL_AGENTTYPE_H fcitx-qimpanel-fcitx-qimpanel-0.1.5/main.cpp000066400000000000000000000106331230100576600210100ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "main.h" #include "main_controller.h" #define BUFF_SIZE (512) char filePath[BUFF_SIZE] = {0}; #define LOCKFILE "/tmp/fcitx-qimpanel:%d.pid" #define LOCKMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) int isRunning() { char buf[16]; struct flock fl; snprintf(filePath, BUFF_SIZE, LOCKFILE, fcitx_utils_get_display_number()); int fd = open(filePath, O_RDWR|O_CREAT, LOCKMODE); if (fd < 0) { printf("Can not open %s: %s.\n", filePath, strerror(errno)); return -1; } fl.l_type = F_WRLCK; fl.l_start = 0; fl.l_whence = SEEK_SET; fl.l_len = 0; if (fcntl(fd, F_SETLK, &fl) < 0) { printf("Can not lock %s: %s.\n", filePath, strerror(errno)); return -1; } ftruncate(fd, 0); sprintf(buf, "%d\n", getpid()); write(fd, buf, strlen(buf)); return 0; } char* getQimpanelSharePath(const char * const fileName) { strcpy(filePath, "/usr/share/fcitx-qimpanel/"); strcpy(filePath + strlen("/usr/share/fcitx-qimpanel/"), fileName); printf("%s\n", filePath); return filePath; } char* getQimpanelBinPath(const char * const fileName) { strcpy(filePath, "/usr/bin/"); strcpy(filePath + strlen("/usr/bin/"), fileName); printf("%s\n", filePath); return filePath; } //void sigRoutine(int sigNum) { // switch (sigNum) { // case 1: // char a = '1'; // write(MainController::self()->mSigFd[0], &a, sizeof(a)); // qDebug()<<"write(MainController::self()->mSigFd[0], &a, sizeof(a))"; // break; // } // qDebug() << "Get a signal" << sigNum; // return; //} #define FCITX_DBUS_SERVICE "org.fcitx.Fcitx" int fcitxIsNotRunning() { char* servicename = NULL; asprintf(&servicename, "%s-%d", FCITX_DBUS_SERVICE, fcitx_utils_get_display_number()); QDBusConnection conn = QDBusConnection::sessionBus(); if (!conn.isConnected()) return -1; // ?? Always return false... //QDBusReply reply = conn.interface()->call("NameHasOwner", servicename); QDBusReply reply = conn.interface()->call("GetNameOwner", servicename); qDebug() << "reply.value():" << reply.value(); return reply.value() == ""; } int main(int argc, char** argv) { // signal(SIGHUP, SIG_IGN); fcitx_utils_init_as_daemon();//? if (isRunning()) { exit(1); } QTextCodec::setCodecForTr(QTextCodec::codecForLocale()); QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale()); QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); QTranslator translator; if (translator.load(QString(getQimpanelSharePath("zh_CN.qm"))) == false) qDebug() << "load qm error."; QApplication *app = new QApplication(argc, argv); app->installTranslator(&translator); app->setApplicationName("fcitx-qimpanel"); int waittTick = 0; int waitTime = 10; while (waittTick ++ < waitTime && fcitxIsNotRunning()) { qDebug() << "Fcitx not running."; sleep(1); } qDebug() << "fcitxIsNotRunning():" << fcitxIsNotRunning(); if (waittTick >= waitTime) return -1; MainController *ctrl = MainController::self(); // signal(SIGHUP, sigRoutine); app->setQuitOnLastWindowClosed(false); app->exec(); delete ctrl; delete app; return 0; } fcitx-qimpanel-fcitx-qimpanel-0.1.5/main.h000066400000000000000000000016371230100576600204610ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __MAIN_H__ #define __MAIN_H__ char* getQimpanelSharePath(const char * const fileName); char* getQimpanelBinPath(const char * const fileName); #endif // __MAIN_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/main_controller.cpp000066400000000000000000000230001230100576600232430ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #include #include #include #include #include #include #include #include #include #include "main_model.h" #include "candidate_word.h" #include "main_controller.h" #include "kimpanelagent.h" #include "toplevel.h" MainController* MainController::mSelf = 0; MainController* MainController::self() { if (!mSelf) { mSelf = new MainController; mSelf->init(); } return mSelf; } MainController::MainController() { } void MainController::loadCfg() { QSettings *settings = new QSettings("fcitx-qimpanel", "main"); settings->setIniCodec("UTF-8"); settings->beginGroup("base"); mIsHorizontal = !settings->value("VerticalList", false).toBool(); qDebug() << "mIsHorizontal:" << mIsHorizontal; mSkinName = settings->value("CurtSkinType", "ubuntukylin-dark1").toString(); qDebug() << "mSkinName:" << mSkinName; settings->endGroup(); delete settings; } void MainController::init() { loadCfg(); qDebug()<<"MainController::init()"; qmlRegisterType(); mTopLevel = new TopLevel; mView = new QDeclarativeView; mModel = MainModel::self(); mModel->setIsHorizontal(mIsHorizontal); mSkinBase = new SkinBase; mTopLevel->setCenterWidget(mView); mView->setContentsMargins(0, 0, 0, 0); mView->setResizeMode(QDeclarativeView::SizeViewToRootObject); mView->setResizeAnchor(QGraphicsView::AnchorViewCenter); mView->viewport()->setAutoFillBackground(false); mView->rootContext()->setContextProperty("mainCtrl", this); mView->rootContext()->setContextProperty("mainModel", mModel); mView->rootContext()->setContextProperty("mainSkin", mSkinBase); mView->rootContext()->setContextProperty("mainWidget", mTopLevel); mView->setSource(QUrl("qrc:/qml/main.qml")); mAgent = new PanelAgent(this); mSystemTray = new QSystemTrayIcon(QIcon::fromTheme("fcitx"), this); mTrayMenu = new SystemTrayMenu(mAgent); mAgent->created(); mTrayMenu->init(); mSystemTray->setContextMenu(mTrayMenu); mSystemTray->setToolTip("fcitx-qimpanel"); mSystemTray->show(); QObject::connect(mAgent, SIGNAL(updateProperty(KimpanelProperty)), this, SLOT(updateProperty(KimpanelProperty))); QObject::connect(mAgent, SIGNAL(updatePreeditText(QString, QList)), this, SLOT(updatePreeditText(QString, QList))); QObject::connect(mAgent, SIGNAL(updateLookupTable(KimpanelLookupTable)), this, SLOT(updateLookupTable(KimpanelLookupTable))); QObject::connect(mAgent, SIGNAL(updateLookupTableFull(KimpanelLookupTable, int, int)), this, SLOT(updateLookupTableFull(KimpanelLookupTable, int, int))); QObject::connect(mAgent, SIGNAL(updateSpotLocation(int, int)), this, SLOT(updateSpotLocation(int, int))); QObject::connect(mAgent, SIGNAL(updateSpotRect(int, int, int, int)), this, SLOT(updateSpotRect(int, int, int, int))); QObject::connect(mAgent, SIGNAL(showPreedit(bool)), this, SLOT(showPreedit(bool))); QObject::connect(mAgent, SIGNAL(showAux(bool)), this, SLOT(showAux(bool))); QObject::connect(mAgent, SIGNAL(updateAux(QString, QList)), this, SLOT(updateAux(QString, QList))); QObject::connect(mAgent, SIGNAL(showLookupTable(bool)), this, SLOT(showLookupTable(bool))); QObject::connect(mAgent, SIGNAL(updateLookupTableCursor(int)), this, SLOT(updateLookupTableCursor(int))); QObject::connect(mAgent, SIGNAL(updatePreeditCaret(int)), this, SLOT(updatePreeditCaret(int))); // socketpair(AF_UNIX, SOCK_STREAM, 0, mSigFd); // mSocketNotifier = new QSocketNotifier(mSigFd[1], QSocketNotifier::Read, this); // connect(mSocketNotifier, SIGNAL(activated(int)), this, SLOT(handleSig())); creatDBusService();//创建DBus服务 } MainController::~MainController() { if (mModel) delete mModel; if (mAgent) delete mAgent; if (mView) delete mView; if (mTopLevel) delete mTopLevel; if (mSystemTray) delete mSystemTray; if (mTrayMenu) delete mTrayMenu; } //void MainController::handleSig() //{ // mSocketNotifier->setEnabled(false); // char tmp; // read(mSigFd[1], &tmp, sizeof(tmp)); // qDebug() << "handleSig"; // mSocketNotifier->setEnabled(true); // mTrayMenu->restart(); //} SystemTrayMenu* MainController::getTrayMenu() { return mTrayMenu; } void MainController::setSkinBase(SkinBase *skinBase, int skinType) { if (mSkinBase != skinBase) delete mSkinBase; mSkinBase = skinBase; mView->rootContext()->setContextProperty("mainSkin", mSkinBase); switch (skinType) { case SOGOU: qDebug() << "SkinType is sogou"; mView->setSource(QUrl("qrc:/qml/sogou.qml")); break; case FCITX: default: qDebug() << "SkinType is default"; mView->setSource(QUrl("qrc:/qml/main.qml")); } } QString MainController::getSkinName() { return mSkinName; } void MainController::setSkinName(QString skinName) { mSkinName = skinName; QSettings *settings = new QSettings("fcitx-qimpanel", "main"); settings->setIniCodec("UTF-8"); settings->beginGroup("base"); settings->setValue("CurtSkinType", skinName); settings->endGroup(); delete settings; } void MainController::updateProperty(const KimpanelProperty &prop) { if (tr("No input window") == prop.label) { QIcon icon = QIcon::fromTheme("fcitx"); mSystemTray->setIcon(icon); return; } QIcon icon = QIcon::fromTheme(prop.icon, QIcon::fromTheme("fcitx-kbd")); mSystemTray->setIcon(icon); mModel->resetData(); } void MainController::updatePreeditText(const QString inputString, QList attributes) { mModel->setInputString(inputString); } void MainController::updateLookupTable(const KimpanelLookupTable &lookup_table) { mModel->setCandidateWords(lookup_table); } void MainController::updateLookupTableFull(const KimpanelLookupTable &lookup_table, int cursor, int layout) { bool isHorizontal; switch (layout) { case CLH_Vertical: isHorizontal = false; break; case CLH_Horizontal: isHorizontal = true; break; default: isHorizontal = mIsHorizontal; break; } if (isHorizontal != mModel->isHorizontal()) { mModel->setIsHorizontal(isHorizontal); mSkinBase->reloadSkin(); } mModel->setHighLight(cursor); updateLookupTable(lookup_table); } void MainController::updateSpotLocation(int x, int y) { } void MainController::updateSpotRect(int x, int y, int w, int h) { mTopLevel->setSpotRect(QRect(QPoint(x, y), QSize(w, h))); } void MainController::showPreedit(bool to_show) { mModel->setShowPreedit(to_show); mTopLevel->setTopLevelVisible(mModel->showTips(), mModel->showPreedit(), mModel->showLookupTable()); } void MainController::showAux(bool to_show) { mModel->setShowTips(to_show); mTopLevel->setTopLevelVisible(mModel->showTips(), mModel->showPreedit(), mModel->showLookupTable()); } void MainController::updateAux(const QString &text, const QList &attr) { mModel->setTipsString(text); } void MainController::showLookupTable(bool to_show) { mModel->setShowLookupTable(to_show); mTopLevel->setTopLevelVisible(mModel->showTips(), mModel->showPreedit(), mModel->showLookupTable()); } void MainController::updateLookupTableCursor(int pos) { // qDebug() << QString("updateLookupTableCursor: %1").arg(pos); } void MainController::getPrevPage() { mAgent->lookupTablePageUp(); } void MainController::getNextPage() { mAgent->lookupTablePageDown(); } void MainController::selectCandidate(int index) { mAgent->selectCandidate(index); } void MainController::updatePreeditCaret(int pos) { mModel->setInputStringCursorPos(pos); } void MainController::creatDBusService() { // 用于建立到session bus的连接 QDBusConnection bus = QDBusConnection::sessionBus(); // 在session bus上注册名为"com.fcitx_qimpanel.hotel"的service if (!bus.registerService("com.fcitx_qimpanel.hotel")) { //注意命名规则-和_ qDebug() << bus.lastError().message(); exit(1); } // "QDBusConnection::ExportAllSlots"表示把类Hotel的所有Slot都导出为这个Object的method bus.registerObject("/", mSelf ,QDBusConnection::ExportAllSlots);//可以优化只导出需要的 } void MainController::qtDbusSot_restartQimpanel() { mTrayMenu->restart(); qDebug()<< "MainController::qtDbusSot_restartQimpanel()"; } fcitx-qimpanel-fcitx-qimpanel-0.1.5/main_controller.h000066400000000000000000000060421230100576600227170ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __MAIN_CONTROLLER_H__ #define __MAIN_CONTROLLER_H__ #include #include #include #include #include #include #include #include "main_model.h" #include "system_tray_menu.h" #include "kimpanelagent.h" #include "toplevel.h" #include "skin/skinbase.h" #include "skin/skinmenu.h" //必须与FcitxCandidateLayoutHint的定义一致 enum CandidateLayout { CLH_NotSet, CLH_Vertical, CLH_Horizontal }; class MainController : public QObject { Q_OBJECT // 定义Interface名称为"com.test.hotel" Q_CLASSINFO("D-Bus Interface", "com.fcitx_qimpanel.hotel") public: static MainController* self(); virtual ~MainController(); void init(); void loadCfg(); private: explicit MainController(); static MainController *mSelf; private: TopLevel *mTopLevel; MainModel *mModel; PanelAgent *mAgent; SkinBase *mSkinBase; QDeclarativeView *mView; QUrl mUrl; QTimer *mTimer; QSystemTrayIcon *mSystemTray; SystemTrayMenu *mTrayMenu; bool mIsHorizontal; QString mSkinName; private: QSocketNotifier *mSocketNotifier; private slots: // void handleSig(); public: int mSigFd[2]; public: void setSkinBase(SkinBase *skinBase, int skinType); QString getSkinName(); void setSkinName(QString skinName); SystemTrayMenu* getTrayMenu(); void creatDBusService(); public slots: void updateProperty(const KimpanelProperty &prop); void updatePreeditText(const QString inputString, QList attributes); void updateLookupTable(const KimpanelLookupTable &lookup_table); void updateLookupTableFull(const KimpanelLookupTable &lookup_table, int cursor, int layout); void updateSpotLocation(int x, int y); void updateSpotRect(int x, int y, int w, int h); void showPreedit(bool to_show); void showAux(bool to_show); void updateAux(const QString &text, const QList &attr); void showLookupTable(bool to_show); void updateLookupTableCursor(int pos); void updatePreeditCaret(int pos); void qtDbusSot_restartQimpanel(); public: Q_INVOKABLE void getPrevPage(); Q_INVOKABLE void getNextPage(); Q_INVOKABLE void selectCandidate(int index); }; #endif // __MAIN_CONTROLLER_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/main_model.cpp000066400000000000000000000112701230100576600221660ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #include #include "main_model.h" #include "candidate_word.h" MainModel* MainModel::mSelf = 0; MainModel* MainModel::self() { if (!mSelf) { mSelf = new MainModel; } return mSelf; } MainModel::MainModel() { } MainModel::~MainModel() { } void MainModel::resetData() { KimpanelLookupTable lookup_table; setCandidateWords(lookup_table); setInputString(""); setHasPrev(false); setHasNext(false); setInputStringCursorPos(-1); setHighLight(-1); //这个不属于焦点切换时需要重置的值 //setIsHorizontal(true); setShowTips(false); setShowPreedit(false); setShowLookupTable(false); } void MainModel::setInputString(const QString inputString) { mInputString = inputString; emit inputStringChanged(); } QString MainModel::inputString() const { return mInputString; } void MainModel::setTipsString(const QString tipsString) { mTipsString = tipsString; emit tipsStringChanged(); emit mainWindowSizeChanged(); } QString MainModel::tipsString() const { return mTipsString; } void MainModel::setInputStringCursorPos(int pos) { setInputString(mInputString.insert(pos, QString("|"))); } void candidateWordsPropAppend(QDeclarativeListProperty* prop, CandidateWord* value) { Q_UNUSED(prop); Q_UNUSED(value); return; //Append not supported } int candidateWordsPropCount(QDeclarativeListProperty* prop) { return static_cast*>(prop->data)->count(); } CandidateWord* candidateWordsPropAt(QDeclarativeListProperty* prop, int index) { return static_cast*>(prop->data)->at(index); } void MainModel::setCandidateWords(const KimpanelLookupTable &lookup_table) { CandidateWord *candidate; QList::iterator iter; QList entries = lookup_table.entries; qDeleteAll(mCandidateWords); mCandidateWords.clear(); for (iter = entries.begin(); iter != entries.end(); ++ iter) { if ((candidate = new (std::nothrow)CandidateWord) == NULL) break; candidate->setCddLabel(iter->label); candidate->setCddText(iter->text); mCandidateWords.append(candidate); } setHasPrev(lookup_table.has_prev); setHasNext(lookup_table.has_next); emit candidateWordsChanged(); emit mainWindowSizeChanged(); } QDeclarativeListProperty MainModel::candidateWords() { return QDeclarativeListProperty(this, &mCandidateWords, &candidateWordsPropAppend, &candidateWordsPropCount, &candidateWordsPropAt, 0); } void MainModel::setHasPrev(const bool hasPrev) { mHasPrev = hasPrev; emit hasPrevChanged(); } bool MainModel::hasPrev() const { return mHasPrev; } void MainModel::setHasNext(const bool hasNext) { mHasNext = hasNext; emit hasNextChanged(); } bool MainModel::hasNext() const { return mHasNext; } void MainModel::setHighLight(const int highLight) { mHighLight = highLight; emit highLightChanged(); } int MainModel::highLight() const { return mHighLight; } void MainModel::setIsHorizontal(const bool isHorizontal) { mIsHorizontal = isHorizontal; emit isHorizontalChanged(); } bool MainModel::isHorizontal() const { return mIsHorizontal; } void MainModel::setShowTips(const bool showTips) { mShowTips = showTips; emit showTipsChanged(); emit mainWindowSizeChanged(); } bool MainModel::showTips() const { return mShowTips; } void MainModel::setShowPreedit(const bool showPreedit) { mShowPreedit = showPreedit; emit showPreeditChanged(); emit mainWindowSizeChanged(); } bool MainModel::showPreedit() const { return mShowPreedit; } void MainModel::setShowLookupTable(const bool showLookupTable) { mShowLookupTable = showLookupTable; emit showLookupTableChanged(); emit mainWindowSizeChanged(); } bool MainModel::showLookupTable() const { return mShowLookupTable; } fcitx-qimpanel-fcitx-qimpanel-0.1.5/main_model.h000066400000000000000000000072141230100576600216360ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __MAIN_MODEL_H__ #define __MAIN_MODEL_H__ #include #include #include #include "candidate_word.h" #include "kimpanelagenttype.h" class MainModel : public QObject { Q_OBJECT Q_PROPERTY(QString inputString READ inputString WRITE setInputString NOTIFY inputStringChanged) Q_PROPERTY(QString tipsString READ tipsString WRITE setTipsString NOTIFY tipsStringChanged) Q_PROPERTY(QDeclarativeListProperty candidateWords READ candidateWords NOTIFY candidateWordsChanged) Q_PROPERTY(bool hasPrev READ hasPrev WRITE setHasPrev NOTIFY hasPrevChanged) Q_PROPERTY(bool hasNext READ hasNext WRITE setHasNext NOTIFY hasNextChanged) Q_PROPERTY(int highLight READ highLight WRITE setHighLight NOTIFY highLightChanged) Q_PROPERTY(bool isHorizontal READ isHorizontal WRITE setIsHorizontal NOTIFY isHorizontalChanged) Q_PROPERTY(bool showTips READ showTips WRITE setShowTips NOTIFY showTipsChanged) Q_PROPERTY(bool showPreedit READ showPreedit WRITE setShowPreedit NOTIFY showPreeditChanged) Q_PROPERTY(bool showLookupTable READ showLookupTable WRITE setShowLookupTable NOTIFY showLookupTableChanged) public: static MainModel* self(); virtual ~MainModel(); void init(); private: explicit MainModel(); static MainModel *mSelf; public: void resetData(); void setInputStringCursorPos(int pos); public: void setInputString(const QString inputString); QString inputString() const; void setTipsString(const QString tipsString); QString tipsString() const; void setCandidateWords(const KimpanelLookupTable &lookup_table); QDeclarativeListProperty candidateWords(); void setHasPrev(const bool hasPrev); bool hasPrev() const; void setHasNext(const bool hasNext); bool hasNext() const; void setHighLight(const int highLight); int highLight() const; void setIsHorizontal(const bool isHorizontal); bool isHorizontal() const; void setShowTips(const bool showTips); bool showTips() const; void setShowPreedit(const bool showPreedit); bool showPreedit() const; void setShowLookupTable(const bool showLookupTable); bool showLookupTable() const; signals: void inputStringChanged(); void tipsStringChanged(); void candidateWordsChanged(); void hasPrevChanged(); void hasNextChanged(); void highLightChanged(); void isHorizontalChanged(); void showTipsChanged(); void showPreeditChanged(); void showLookupTableChanged(); void mainWindowSizeChanged(); private: QString mInputString; QString mTipsString; QList mCandidateWords; bool mHasPrev; bool mHasNext; int mHighLight; bool mIsHorizontal; bool mShowTips; bool mShowPreedit; bool mShowLookupTable; }; #endif // __MAIN_MODEL_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/my_action.cpp000066400000000000000000000027251230100576600220510ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #include "my_action.h" MyAction::MyAction(const QString &text, QObject *parent) : QAction(text, parent) { } MyAction::MyAction(const QIcon &icon, const QString &text, QObject *parent) : QAction(icon, text, parent) { } MyAction::~MyAction() { } void MyAction::setProp(const KimpanelProperty &prop) { this->mProp = prop; } const KimpanelProperty& MyAction::getProp() { return this->mProp; } void MyAction::setSkinPath(const QString skinPath) { this->mSkinPath = skinPath; } const QString MyAction::getSkinPath() { return this->mSkinPath; } void MyAction::setSkinClass(const SkinClass skinClass) { this->mSkinClass = skinClass; } const SkinClass MyAction::getSkinClass() { return this->mSkinClass; } fcitx-qimpanel-fcitx-qimpanel-0.1.5/my_action.h000066400000000000000000000027251230100576600215160ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __MY_ACTION_H__ #define __MY_ACTION_H__ #include #include "kimpanelagent.h" typedef enum SkinClass { FCITX, SOGOU } SkinClass; class MyAction : public QAction { Q_OBJECT public: MyAction(const QString &text, QObject *parent); MyAction(const QIcon &icon, const QString &text, QObject *parent); virtual ~MyAction(); public: void setProp(const KimpanelProperty &prop); const KimpanelProperty& getProp(); void setSkinPath(const QString skinPath); const QString getSkinPath(); void setSkinClass(const SkinClass skinClass); const SkinClass getSkinClass(); private: KimpanelProperty mProp; QString mSkinPath; SkinClass mSkinClass; }; #endif // __MY_ACTION_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/org.kde.impanel.xml000066400000000000000000000036001230100576600230530ustar00rootroot00000000000000 fcitx-qimpanel-fcitx-qimpanel-0.1.5/po/000077500000000000000000000000001230100576600177735ustar00rootroot00000000000000fcitx-qimpanel-fcitx-qimpanel-0.1.5/po/ReadMe.txt000066400000000000000000000004771230100576600217010ustar00rootroot00000000000000ts文件按如下方式生成: lenky@robert-T430S:~/lenky/work/fcitx/fcitx-qimpanel$ lupdate . -ts po/zh_CN.ts Scanning directory '.'... Updating 'po/zh_CN.ts'... Found 6 source text(s) (0 new and 6 already existing) 用gedit打开对应ts文件做翻译,再执行make,编译工程fcitx-qimpanel,OK。 fcitx-qimpanel-fcitx-qimpanel-0.1.5/po/zh_CN.ts000066400000000000000000000113741230100576600213520ustar00rootroot00000000000000 MainController No input window 无输入窗口 SystemTrayMenu Virtual Keyboard 虚拟键盘 Input Method 输入法 Skin 皮肤 ConfigureSync 配置同步 No input window 无输入窗口 Online &Help! 在线帮助 ConfigureIM 配置当前输入法 ConfigureUp 同步上传 ConfigureDwon 同步下载 Warning 警告! [Ubuntu Kylin Sync] Synchronize directories have been deleted?! [Ubuntu Kylin Sync]该同步目录已经被删除?请自行创建。 Please log in kuaipan! 请登录金山快盘! No configure can be synchronized! 云端没有存储配置文件,无法同步到本地! Please install fcitx-qimpanel-configtool! 请安装配置工具:fcitx-qimpanel-configtool Configure 配置 ConfigureIMPanel 配置面板和皮肤 Restart 重新启动 Exit 退出 fcitx-qimpanel-fcitx-qimpanel-0.1.5/qml.qrc000066400000000000000000000001761230100576600206610ustar00rootroot00000000000000 qml/main.qml qml/sogou.qml fcitx-qimpanel-fcitx-qimpanel-0.1.5/qml/000077500000000000000000000000001230100576600201465ustar00rootroot00000000000000fcitx-qimpanel-fcitx-qimpanel-0.1.5/qml/main.qml000066400000000000000000000262531230100576600216150ustar00rootroot00000000000000import QtQuick 1.1 Rectangle { id: mainWindow objectName: "mainWindowQml" visible : mainModel.showTips || mainModel.showPreedit || mainModel.showLookupTable border.color: "#0080FF" border.width: mainSkin.inputBackImg ? 0 : 1 color: "transparent" BorderImage { visible : mainModel.showPreedit || mainModel.showLookupTable anchors.fill: parent border { left: mainSkin.marginLeft; top: mainSkin.marginTop; right: mainSkin.marginRight; bottom: mainSkin.marginBottom; } horizontalTileMode: mainSkin.horizontalTileMode verticalTileMode: mainSkin.verticalTileMode source: mainSkin.inputBackImg } BorderImage { visible : mainModel.showTips && !mainModel.showPreedit && !mainModel.showLookupTable anchors.fill: parent border { left: 10; top: 10; right: 10; bottom: 10; } horizontalTileMode: BorderImage.Stretch verticalTileMode: BorderImage.Stretch source: mainSkin.tipsImg } Text { x: 5 y: 3 id: "tipsString" visible : mainModel.showTips text: mainModel.tipsString font.pointSize : mainSkin.fontSize color: mainSkin.inputColor } Text { id: "inputString" visible : mainModel.showPreedit text: mainModel.inputString font.pointSize : mainSkin.fontSize color: mainSkin.inputColor } MouseArea { anchors.fill: parent property variant previousPosition onPressed: { previousPosition = Qt.point(mouseX, mouseY) } onPositionChanged: { if (pressedButtons == Qt.LeftButton) { var dx = mouseX - previousPosition.x var dy = mouseY - previousPosition.y mainWidget.pos = Qt.point(mainWidget.pos.x + dx, mainWidget.pos.y + dy) } } } Row { id: "horizontal" visible : mainModel.showLookupTable && mainModel.isHorizontal Repeater { model: mainModel.candidateWords Text { id: "candidateWord" text: "" + cddLabel + "" + "" + cddText + "" + " " font.pointSize : mainSkin.candFontSize != 0 ? mainSkin.candFontSize : mainSkin.fontSize MouseArea { anchors.fill: parent hoverEnabled: true onEntered: { parent.opacity = 0.6 } onExited: { parent.opacity = 1 } onClicked: { mainCtrl.selectCandidate(index) } } } } } Column { id: "vertical" visible : mainModel.showLookupTable && !mainModel.isHorizontal Repeater { model: mainModel.candidateWords Text { id: "candidateWord" text: "" + cddLabel + "" + "" + cddText + "" + " " font.pointSize : mainSkin.candFontSize != 0 ? mainSkin.candFontSize : mainSkin.fontSize MouseArea { anchors.fill: parent hoverEnabled: true onEntered: { parent.opacity = 0.6 } onExited: { parent.opacity = 1 } onClicked: { mainCtrl.selectCandidate(index) } } } } } Image { id: "prev_page" visible : mainModel.hasPrev || mainModel.hasNext source: mainSkin.backArrowImg opacity: mainModel.hasPrev ? 1 : 0.5 MouseArea { anchors.fill: parent onClicked: { if (mainModel.hasPrev) mainCtrl.getPrevPage() } } } Image { id: "next_page" visible : mainModel.hasPrev || mainModel.hasNext source: mainSkin.forwardArrowImg opacity: mainModel.hasNext ? 1 : 0.5 MouseArea { anchors.fill: parent onClicked: { if (mainModel.hasNext) mainCtrl.getNextPage() } } } function clearAllAnchors(obj) { obj.anchors.left = undefined; obj.anchors.leftMargin = 0; obj.anchors.top = undefined; obj.anchors.topMargin = 0; obj.anchors.right = undefined; obj.anchors.rightMargin = 0; obj.anchors.bottom = undefined; obj.anchors.bottomMargin = 0; } function setObjAbsolutePosition(bindObj, x, y) { if (x > 0) { bindObj.anchors.left = mainWindow.left; bindObj.anchors.leftMargin = x; } else if (x < 0) { bindObj.anchors.right = mainWindow.right; bindObj.anchors.rightMargin = -x; } if (y > 0) { bindObj.anchors.top = mainWindow.top; bindObj.anchors.topMargin = y; } else if (y < 0) { bindObj.anchors.bottom = mainWindow.bottom; bindObj.anchors.bottomMargin = -y; } } Component.onCompleted: { if (mainSkin.inputStringPosX == 0) mainSkin.inputStringPosX = mainSkin.marginLeft; if (mainSkin.inputStringPosY == 0) mainSkin.inputStringPosY = mainSkin.marginTop; clearAllAnchors(inputString); setObjAbsolutePosition(inputString, mainSkin.inputStringPosX, mainSkin.inputStringPosY); if (mainSkin.outputCandPosX == 0) mainSkin.outputCandPosX = mainSkin.marginLeft; if (mainSkin.outputCandPosY == 0) mainSkin.outputCandPosY = inputString.height + mainSkin.marginTop; clearAllAnchors(horizontal); setObjAbsolutePosition(horizontal, mainSkin.outputCandPosX, mainSkin.outputCandPosY); clearAllAnchors(vertical); setObjAbsolutePosition(vertical, mainSkin.outputCandPosX, mainSkin.outputCandPosY); if (mainSkin.backArrowPosX == 0) mainSkin.backArrowPosX = - prev_page.width - next_page.width - 5 - 10; if (mainSkin.backArrowPosY == 0) mainSkin.backArrowPosY = mainSkin.inputStringPosY; clearAllAnchors(prev_page); setObjAbsolutePosition(prev_page, mainSkin.backArrowPosX, mainSkin.backArrowPosY); if (mainSkin.forwardArrowPosX == 0) mainSkin.forwardArrowPosX = - next_page.width - 10; if (mainSkin.forwardArrowPosY == 0) mainSkin.forwardArrowPosY = mainSkin.inputStringPosY; clearAllAnchors(next_page); setObjAbsolutePosition(next_page, mainSkin.forwardArrowPosX, mainSkin.forwardArrowPosY); } function max(x, y) { return x > y ? x : y; } Connections { target: mainModel onMainWindowSizeChanged: { var tmp; var width, width1; var height, height1; if (mainModel.showTips && !mainModel.showPreedit && !mainModel.showLookupTable) { mainWindow.width = tipsString.width + 10; mainWindow.height = tipsString.height + 10; return; } width = mainSkin.marginLeft; width1 = 0; height = mainSkin.marginTop; height1 = 0; if (mainModel.showTips) { tmp = tipsString.x + tipsString.width; width = max(width, tmp); tmp = tipsString.y + tipsString.height; height = max(height, tmp); } if (mainModel.showPreedit) { if (mainSkin.inputStringPosX > 0) { tmp = inputString.x + inputString.width; width = max(width, tmp); } else { width1 = max(width1, -mainSkin.inputStringPosX); } if (mainSkin.inputStringPosY > 0) { tmp = inputString.y + inputString.height; height = max(height, tmp); } else { height1 = max(height1, -mainSkin.inputStringPosY); } } if (mainModel.showLookupTable) { if (mainSkin.outputCandPosX > 0) { if (mainModel.isHorizontal) tmp = horizontal.x + horizontal.width; else tmp = vertical.x + vertical.width; width = max(width, tmp); } else { width1 = max(width1, -mainSkin.outputCandPosX); } if (mainSkin.outputCandPosY > 0) { if (mainModel.isHorizontal) tmp = horizontal.y + horizontal.height; else tmp = vertical.y + vertical.height; height = max(height, tmp); } else { height1 = max(height1, -mainSkin.outputCandPosY); } } if (mainModel.hasPrev || mainModel.hasNext) { if (mainSkin.backArrowPosX > 0) { tmp = prev_page.x + prev_page.width; width = max(width, tmp); } else { width1 = max(width1, -mainSkin.backArrowPosX); } if (mainSkin.forwardArrowPosX > 0) { tmp = next_page.x + next_page.width; width = max(width, tmp); } else { width1 = max(width1, -mainSkin.forwardArrowPosX); } if (mainSkin.backArrowPosY > 0) { tmp = prev_page.y + prev_page.height; height = max(height, tmp); } else { height1 = max(height1, -mainSkin.backArrowPosY); } if (mainSkin.forwardArrowPosY > 0) { tmp = next_page.y + next_page.height; height = max(height, tmp); } else { height1 = max(height1, -mainSkin.forwardArrowPosY); } } mainWindow.width = width + width1 + mainSkin.marginRight + mainSkin.adjustWidth; mainWindow.height = height + height1 + mainSkin.marginBottom + mainSkin.adjustHeight; } } } fcitx-qimpanel-fcitx-qimpanel-0.1.5/qml/sogou.qml000066400000000000000000000213321230100576600220160ustar00rootroot00000000000000import QtQuick 1.1 Rectangle { id: mainWindow objectName: "mainWindowQml" visible : mainModel.showTips || mainModel.showPreedit || mainModel.showLookupTable border.color: "#0080FF" border.width: mainSkin.inputBackImg ? 0 : 1 color: "transparent" BorderImage { id: inputBackImg visible : mainModel.showPreedit || mainModel.showLookupTable anchors.fill: parent anchors.left:parent.left border { left: mainSkin.marginLeft; top: mainSkin.marginTop; right: mainSkin.marginRight; bottom: mainSkin.marginBottom; } horizontalTileMode: mainSkin.horizontalTileMode verticalTileMode: mainSkin.verticalTileMode source: mainSkin.inputBackImg } //custom0 Image { id:custom0 source: mainSkin.customImg0 visible : mainModel.isHorizontal && (mainModel.showPreedit || mainModel.showLookupTable) width: sourceSize.width; height: sourceSize.height fillMode: Image.PreserveAspectFit anchors.left: inputBackImg.left } //custom1 Image { id:custom1 source: mainSkin.customImg1 visible : mainModel.isHorizontal && (mainModel.showPreedit || mainModel.showLookupTable) width: sourceSize.width; height: sourceSize.height fillMode: Image.PreserveAspectFit anchors.right: parent.right } BorderImage { visible : mainModel.showTips && !mainModel.showPreedit && !mainModel.showLookupTable anchors.fill: parent border { left: 10; top: 10; right: 10; bottom: 10; } horizontalTileMode: BorderImage.Stretch verticalTileMode: BorderImage.Stretch source: mainSkin.tipsImg } Text { x: 5 y: 3 id: "tipsString" visible : mainModel.showTips text: mainModel.tipsString font.pointSize : mainSkin.fontSize color: mainSkin.inputColor } Text { id: "inputString" visible : mainModel.showPreedit text: mainModel.inputString font.pointSize : mainSkin.fontSize color: mainSkin.inputColor } MouseArea { anchors.fill: parent property variant previousPosition onPressed: { previousPosition = Qt.point(mouseX, mouseY) } onPositionChanged: { if (pressedButtons == Qt.LeftButton) { var dx = mouseX - previousPosition.x var dy = mouseY - previousPosition.y mainWidget.pos = Qt.point(mainWidget.pos.x + dx, mainWidget.pos.y + dy) } } } Row { id: "horizontal" visible : mainModel.showLookupTable && mainModel.isHorizontal Repeater { model: mainModel.candidateWords Text { id: "candidateWord" text: "" + cddLabel + "" + "" + cddText + "" + " " font.pointSize : mainSkin.candFontSize != 0 ? mainSkin.candFontSize : mainSkin.fontSize MouseArea { anchors.fill: parent onClicked: { mainCtrl.selectCandidate(index) } } } } } Column { id: "vertical" visible : mainModel.showLookupTable && !mainModel.isHorizontal Repeater { model: mainModel.candidateWords Text { id: "candidateWord" text: "" + cddLabel + "" + "" + cddText + "" + " " font.pointSize : mainSkin.candFontSize != 0 ? mainSkin.candFontSize : mainSkin.fontSize MouseArea { anchors.fill: parent onClicked: { mainCtrl.selectCandidate(index) } } } } } function clearAllAnchors(obj) { obj.anchors.left = undefined; obj.anchors.leftMargin = 0; obj.anchors.top = undefined; obj.anchors.topMargin = 0; obj.anchors.right = undefined; obj.anchors.rightMargin = 0; obj.anchors.bottom = undefined; obj.anchors.bottomMargin = 0; } function setObjAbsolutePosition(bindObj, x, y) { if (x > 0) { bindObj.anchors.left = mainWindow.left; bindObj.anchors.leftMargin = x; } else if (x < 0) { bindObj.anchors.right = mainWindow.right; bindObj.anchors.rightMargin = -x; } if (y > 0) { bindObj.anchors.top = mainWindow.top; bindObj.anchors.topMargin = y; } else if (y < 0) { bindObj.anchors.bottom = mainWindow.bottom; bindObj.anchors.bottomMargin = -y; } } Component.onCompleted: { if (mainSkin.inputStringPosX == 0) mainSkin.inputStringPosX = mainSkin.marginLeft; if (mainSkin.inputStringPosY == 0) mainSkin.inputStringPosY = mainSkin.marginTop; clearAllAnchors(inputString); setObjAbsolutePosition(inputString, mainSkin.inputStringPosX, mainSkin.inputStringPosY); if (mainSkin.outputCandPosX == 0) mainSkin.outputCandPosX = mainSkin.marginLeft; if (mainSkin.outputCandPosY == 0) mainSkin.outputCandPosY = inputString.height + mainSkin.marginTop; clearAllAnchors(horizontal); setObjAbsolutePosition(horizontal, mainSkin.outputCandPosX, mainSkin.outputCandPosY); clearAllAnchors(vertical); setObjAbsolutePosition(vertical, mainSkin.outputCandPosX, mainSkin.outputCandPosY); } function max(x, y) { return x > y ? x : y; } Connections { target: mainModel onMainWindowSizeChanged: { var tmp; var width, width1; var height, height1; if (mainModel.showTips && !mainModel.showPreedit && !mainModel.showLookupTable) { mainWindow.width = tipsString.width + 10; mainWindow.height = tipsString.height + 10; return; } width = mainSkin.marginLeft; width1 = 0; height = mainSkin.marginTop; height1 = 0; if (mainModel.showTips) { tmp = tipsString.x + tipsString.width; width = max(width, tmp); tmp = tipsString.y + tipsString.height; height = max(height, tmp); } if (mainModel.showPreedit) { if (mainSkin.inputStringPosX > 0) { tmp = inputString.x + inputString.width; width = max(width, tmp); } else { width1 = max(width1, -mainSkin.inputStringPosX); } if (mainSkin.inputStringPosY > 0) { tmp = inputString.y + inputString.height; height = max(height, tmp); } else { height1 = max(height1, -mainSkin.inputStringPosY); } } if (mainModel.showLookupTable) { if (mainSkin.outputCandPosX > 0) { if (mainModel.isHorizontal) tmp = horizontal.x + horizontal.width; else tmp = vertical.x + vertical.width; width = max(width, tmp); } else { width1 = max(width1, -mainSkin.outputCandPosX); } if (mainSkin.outputCandPosY > 0) { if (mainModel.isHorizontal) tmp = horizontal.y + horizontal.height; else tmp = vertical.y + vertical.height; height = max(height, tmp); } else { height1 = max(height1, -mainSkin.outputCandPosY); } } mainWindow.width = width + width1 + mainSkin.marginRight + mainSkin.adjustWidth; mainWindow.height = height + height1 + mainSkin.marginBottom + mainSkin.adjustHeight; } } } fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/000077500000000000000000000000001230100576600203215ustar00rootroot00000000000000fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/skinbase.cpp000066400000000000000000000271761230100576600226410ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #include #include "skinbase.h" #include "../main_model.h" SkinBase::SkinBase() { init(); } SkinBase::~SkinBase() { } void SkinBase::init() { //横排配置填默认值 mTipsImg = ""; mInputBackImg = ""; mCustomImg0 = ""; mCustomImg1 = ""; mMarginLeft = 0; mMarginRight = 0; mMarginTop = 0; mMarginBottom = 0; mBackArrowImg = ""; mForwardArrowImg = ""; //如果为0,那么会提示:QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0 //所以设置为13好了 mFontSize = 13; mCandFontSize = 0; mInputColor = Qt::color0; mIndexColor = Qt::color0; mFirstCandColor = Qt::color0; mOtherColor = Qt::color0; mInputStringPosX = 0; mInputStringPosY = 0; mOutputCandPosX = 0; mOutputCandPosY = 0; mBackArrowPosX = 0; mBackArrowPosY = 0; mForwardArrowPosX = 0; mForwardArrowPosY = 0; mAdjustWidth = 0; mAdjustHeight = 0; mHorizontalTileMode = "Stretch"; mVerticalTileMode = "Stretch"; //竖排配置填写零值,而不是默认值,因为在实际使用时,如果判断其为零值,那么会自动返回对应的横排值 mTipsImgVertical = ""; mInputBackImgVertical = ""; mCustomImgVertical0 = ""; mCustomImgVertical1 = ""; mMarginLeftVertical = 0; mMarginRightVertical = 0; mMarginTopVertical = 0; mMarginBottomVertical = 0; mBackArrowImgVertical = ""; mForwardArrowImgVertical = ""; mFontSizeVertical = 0; mCandFontSizeVertical = 0; mInputColorVertical = Qt::color0; mIndexColorVertical = Qt::color0; mFirstCandColorVertical = Qt::color0; mOtherColorVertical = Qt::color0; mInputStringPosXVertical = 0; mInputStringPosYVertical = 0; mOutputCandPosXVertical = 0; mOutputCandPosYVertical = 0; mBackArrowPosXVertical = 0; mBackArrowPosYVertical = 0; mForwardArrowPosXVertical = 0; mForwardArrowPosYVertical = 0; mAdjustWidthVertical = 0; mAdjustHeightVertical = 0; mHorizontalTileModeVertical = ""; mVerticalTileModeVertical = ""; } bool SkinBase::loadSkin(const QString skinPath) { } QColor SkinBase::value2color(const QString& value) { QStringList list = value.split(' '); if(list.size() < 3) { return Qt::color0; } int r = list.at(0).toInt(); int g = list.at(1).toInt(); int b = list.at(2).toInt(); return QColor(r, g, b); } void SkinBase::reloadSkin() { emit inputBackImgChanged(); emit customImg0Changed(); emit customImg1Changed(); emit tipsImgChanged(); emit marginLeftChanged(); emit marginRightChanged(); emit marginTopChanged(); emit marginBottomChanged(); emit backArrowImgChanged(); emit forwardArrowImgChanged(); emit fontSizeChanged(); emit candFontSizeChanged(); emit inputColorChanged(); emit indexColorChanged(); emit fontSizeChanged(); emit otherColorChanged(); emit inputStringPosXChanged(); emit inputStringPosYChanged(); emit outputCandPosXChanged(); emit outputCandPosYChanged(); emit backArrowPosXChanged(); emit backArrowPosYChanged(); emit forwardArrowPosXChanged(); emit forwardArrowPosYChanged(); emit adjustWidthChanged(); emit adjustHeightChanged(); emit horizontalTileModeChanged(); emit verticalTileModeChanged(); } void SkinBase::setInputBackImg(const QString inputBackImg) { mInputBackImg = inputBackImg; } QString SkinBase::inputBackImg() const { if (MainModel::self()->isHorizontal() || mInputBackImgVertical == "") return mInputBackImg; else return mInputBackImgVertical; } void SkinBase::setCustomImg0(const QString customImg) { mCustomImg0 = customImg; } QString SkinBase::customImg0() const { if (MainModel::self()->isHorizontal() || mCustomImgVertical0 == "") return mCustomImg0; else return mCustomImgVertical0; } void SkinBase::setCustomImg1(const QString customImg) { mCustomImg1 = customImg; } QString SkinBase::customImg1() const { if (MainModel::self()->isHorizontal() || mCustomImgVertical1 == "") return mCustomImg1; else return mCustomImgVertical1; } void SkinBase::setTipsImg(const QString tipsImg) { mTipsImg = tipsImg; } QString SkinBase::tipsImg() const { if (MainModel::self()->isHorizontal() || mTipsImgVertical == "") return mTipsImg; else return mTipsImgVertical; } void SkinBase::setMarginLeft(const int marginLeft) { mMarginLeft = marginLeft; } int SkinBase::marginLeft() const { if (MainModel::self()->isHorizontal() || mMarginLeftVertical == 0) return mMarginLeft; else return mMarginLeftVertical; } void SkinBase::setMarginRight(const int marginRight) { mMarginRight = marginRight; } int SkinBase::marginRight() const { if (MainModel::self()->isHorizontal() || mMarginRightVertical == 0) return mMarginRight; else return mMarginRightVertical; } void SkinBase::setMarginTop(const int marginTop) { mMarginTop = marginTop; } int SkinBase::marginTop() const { if (MainModel::self()->isHorizontal() || mMarginTopVertical == 0) return mMarginTop; else return mMarginTopVertical; } void SkinBase::setMarginBottom(const int marginBottom) { mMarginBottom = marginBottom; } int SkinBase::marginBottom() const { if (MainModel::self()->isHorizontal() || mMarginBottomVertical == 0) return mMarginBottom; else return mMarginBottomVertical; } void SkinBase::setBackArrowImg(const QString backArrowImg) { mBackArrowImg = backArrowImg; } QString SkinBase::backArrowImg() const { if (MainModel::self()->isHorizontal() || mBackArrowImgVertical == "") return mBackArrowImg; else return mBackArrowImgVertical; } void SkinBase::setForwardArrowImg(const QString forwardArrowImg) { mForwardArrowImg = forwardArrowImg; } QString SkinBase::forwardArrowImg() const { if (MainModel::self()->isHorizontal() || mForwardArrowImgVertical == "") return mForwardArrowImg; else return mForwardArrowImgVertical; } void SkinBase::setFontSize(const int fontSize) { mFontSize = fontSize; } int SkinBase::fontSize() const { if (MainModel::self()->isHorizontal() || mFontSizeVertical == 0) return mFontSize; else return mFontSizeVertical; } void SkinBase::setCandFontSize(const int candFontSize) { mCandFontSize = candFontSize; } int SkinBase::candFontSize() const { if (MainModel::self()->isHorizontal() || mCandFontSizeVertical == 0) return mCandFontSize; else return mCandFontSizeVertical; } void SkinBase::setInputColor(const QColor inputColor) { mInputColor = inputColor; } QColor SkinBase::inputColor() const { if (MainModel::self()->isHorizontal() || mInputColorVertical == Qt::color0) return mInputColor; else return mInputColorVertical; } void SkinBase::setIndexColor(const QColor indexColor) { mIndexColor = indexColor; } QColor SkinBase::indexColor() const { if (MainModel::self()->isHorizontal() || mIndexColorVertical == Qt::color0) return mIndexColor; else return mIndexColorVertical; } void SkinBase::setFirstCandColor(const QColor firstCandColor) { mFirstCandColor = firstCandColor; } QColor SkinBase::firstCandColor() const { if (MainModel::self()->isHorizontal() || mFirstCandColorVertical == Qt::color0) return mFirstCandColor; else return mFirstCandColorVertical; } void SkinBase::setOtherColor(const QColor otherColor) { mOtherColor = otherColor; } QColor SkinBase::otherColor() const { if (MainModel::self()->isHorizontal() || mOtherColorVertical == Qt::color0) return mOtherColor; else return mOtherColorVertical; } #define DEFINE_PROPERTY(read, type, property, zero) \ void SkinBase::set##property(const type read) { \ m##property = read; \ } \ type SkinBase::read() const { \ if (MainModel::self()->isHorizontal() || m##property##Vertical == zero) \ return m##property; \ else \ return m##property##Vertical; \ } DEFINE_PROPERTY(inputStringPosX, int, InputStringPosX, 0) DEFINE_PROPERTY(inputStringPosY, int, InputStringPosY, 0) DEFINE_PROPERTY(outputCandPosX, int, OutputCandPosX, 0) DEFINE_PROPERTY(outputCandPosY, int, OutputCandPosY, 0) DEFINE_PROPERTY(backArrowPosX, int, BackArrowPosX, 0) DEFINE_PROPERTY(backArrowPosY, int, BackArrowPosY, 0) DEFINE_PROPERTY(forwardArrowPosX, int, ForwardArrowPosX, 0) DEFINE_PROPERTY(forwardArrowPosY, int, ForwardArrowPosY, 0) DEFINE_PROPERTY(adjustWidth, int, AdjustWidth, 0) DEFINE_PROPERTY(adjustHeight, int, AdjustHeight, 0) DEFINE_PROPERTY(horizontalTileMode, QString, HorizontalTileMode, "") DEFINE_PROPERTY(verticalTileMode, QString, VerticalTileMode, "") #undef DEFINE_PROPERTY #define DEFINE_SET_PROPERTY(read, type, property) \ void SkinBase::set##property(const type read) { \ m##property = read; \ } DEFINE_SET_PROPERTY(inputBackImgVertical, QString, InputBackImgVertical) DEFINE_SET_PROPERTY(tipsImgVertical, QString, TipsImgVertical) DEFINE_SET_PROPERTY(marginLeftVertical, int, MarginLeftVertical) DEFINE_SET_PROPERTY(marginRightVertical, int, MarginRightVertical) DEFINE_SET_PROPERTY(marginTopVertical, int, MarginTopVertical) DEFINE_SET_PROPERTY(marginBottomVertical, int, MarginBottomVertical) DEFINE_SET_PROPERTY(backArrowImgVertical, QString, BackArrowImgVertical) DEFINE_SET_PROPERTY(forwardArrowImgVertical, QString, ForwardArrowImgVertical) DEFINE_SET_PROPERTY(fontSizeVertical, int, FontSizeVertical) DEFINE_SET_PROPERTY(candFontSizeVertical, int, CandFontSizeVertical) DEFINE_SET_PROPERTY(inputColorVertical, QColor, InputColorVertical) DEFINE_SET_PROPERTY(indexColorVertical, QColor, IndexColorVertical) DEFINE_SET_PROPERTY(firstCandColorVertical, QColor, FirstCandColorVertical) DEFINE_SET_PROPERTY(otherColorVertical, QColor, OtherColorVertical) DEFINE_SET_PROPERTY(inputStringPosXVertical, int, InputStringPosXVertical) DEFINE_SET_PROPERTY(inputStringPosYVertical, int, InputStringPosYVertical) DEFINE_SET_PROPERTY(outputCandPosXVertical, int, OutputCandPosXVertical) DEFINE_SET_PROPERTY(outputCandPosYVertical, int, OutputCandPosYVertical) DEFINE_SET_PROPERTY(backArrowPosXVertical, int, BackArrowPosXVertical) DEFINE_SET_PROPERTY(backArrowPosYVertical, int, BackArrowPosYVertical) DEFINE_SET_PROPERTY(forwardArrowPosXVertical, int, ForwardArrowPosXVertical) DEFINE_SET_PROPERTY(forwardArrowPosYVertical, int, ForwardArrowPosYVertical) DEFINE_SET_PROPERTY(adjustWidthVertical, int, AdjustWidthVertical) DEFINE_SET_PROPERTY(adjustHeightVertical, int, AdjustHeightVertical) DEFINE_SET_PROPERTY(horizontalTileModeVertical, QString, HorizontalTileModeVertical) DEFINE_SET_PROPERTY(verticalTileModeVertical, QString, VerticalTileModeVertical) #undef DEFINE_SET_PROPERTY fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/skinbase.h000066400000000000000000000273541230100576600223040ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __SKIN_BASE_H__ #define __SKIN_BASE_H__ #include #include #include #include #include #include #include class SkinBase : public QObject { Q_OBJECT Q_PROPERTY(QString inputBackImg READ inputBackImg WRITE setInputBackImg NOTIFY inputBackImgChanged) Q_PROPERTY(QString customImg0 READ customImg0 WRITE setCustomImg0 NOTIFY customImg0Changed) Q_PROPERTY(QString customImg1 READ customImg1 WRITE setCustomImg1 NOTIFY customImg1Changed) Q_PROPERTY(QString tipsImg READ tipsImg WRITE setTipsImg NOTIFY tipsImgChanged) Q_PROPERTY(int marginLeft READ marginLeft WRITE setMarginLeft NOTIFY marginLeftChanged) Q_PROPERTY(int marginRight READ marginRight WRITE setMarginRight NOTIFY marginRightChanged) Q_PROPERTY(int marginTop READ marginTop WRITE setMarginTop NOTIFY marginTopChanged) Q_PROPERTY(int marginBottom READ marginBottom WRITE setMarginBottom NOTIFY marginBottomChanged) Q_PROPERTY(QString backArrowImg READ backArrowImg WRITE setBackArrowImg NOTIFY backArrowImgChanged) Q_PROPERTY(QString forwardArrowImg READ forwardArrowImg WRITE setForwardArrowImg NOTIFY forwardArrowImgChanged) Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged) Q_PROPERTY(int candFontSize READ candFontSize WRITE setCandFontSize NOTIFY candFontSizeChanged) Q_PROPERTY(QColor inputColor READ inputColor WRITE setInputColor NOTIFY inputColorChanged) Q_PROPERTY(QColor indexColor READ indexColor WRITE setIndexColor NOTIFY indexColorChanged) Q_PROPERTY(QColor firstCandColor READ firstCandColor WRITE setFirstCandColor NOTIFY firstCandColorChanged) Q_PROPERTY(QColor otherColor READ otherColor WRITE setOtherColor NOTIFY otherColorChanged) public: void setInputBackImg(const QString inputBackImg); QString inputBackImg() const; void setCustomImg0(const QString customImg); QString customImg0() const; void setCustomImg1(const QString customImg); QString customImg1() const; void setTipsImg(const QString tipsImg); QString tipsImg() const; void setMarginLeft(const int marginLeft); int marginLeft() const; void setMarginRight(const int marginRight); int marginRight() const; void setMarginTop(const int marginTop); int marginTop() const; void setMarginBottom(const int marginBottom); int marginBottom() const; void setBackArrowImg(const QString backArrowImg); QString backArrowImg() const; void setForwardArrowImg(const QString forwardArrowImg); QString forwardArrowImg() const; void setFontSize(const int fontSize); int fontSize() const; void setCandFontSize(const int candFontSize); int candFontSize() const; void setInputColor(const QColor inputColor); QColor inputColor() const; void setIndexColor(const QColor indexColor); QColor indexColor() const; void setFirstCandColor(const QColor firstCandColor); QColor firstCandColor() const; void setOtherColor(const QColor otherColor); QColor otherColor() const; signals: void inputBackImgChanged(); void customImg0Changed(); void customImg1Changed(); void tipsImgChanged(); void marginLeftChanged(); void marginRightChanged(); void marginTopChanged(); void marginBottomChanged(); void backArrowImgChanged(); void forwardArrowImgChanged(); void fontSizeChanged(); void candFontSizeChanged(); void inputColorChanged(); void indexColorChanged(); void firstCandColorChanged(); void otherColorChanged(); private: //Fcitx SkinInputBar QString mInputBackImg; QString mCustomImg0; QString mCustomImg1; QString mTipsImg; int mMarginLeft; int mMarginRight; int mMarginTop; int mMarginBottom; QString mBackArrowImg; QString mForwardArrowImg; //Fcitx SkinFont int mFontSize; int mCandFontSize; QColor mInputColor; QColor mIndexColor; QColor mFirstCandColor; QColor mOtherColor; public: Q_PROPERTY(int inputStringPosX READ inputStringPosX WRITE setInputStringPosX NOTIFY inputStringPosXChanged) void setInputStringPosX(const int inputStringPosX); int inputStringPosX() const; signals: void inputStringPosXChanged(); private: int mInputStringPosX; public: Q_PROPERTY(int inputStringPosY READ inputStringPosY WRITE setInputStringPosY NOTIFY inputStringPosYChanged) void setInputStringPosY(const int inputStringPosY); int inputStringPosY() const; signals: void inputStringPosYChanged(); private: int mInputStringPosY; public: Q_PROPERTY(int outputCandPosX READ outputCandPosX WRITE setOutputCandPosX NOTIFY outputCandPosXChanged) void setOutputCandPosX(const int outputCandPosX); int outputCandPosX() const; signals: void outputCandPosXChanged(); private: int mOutputCandPosX; public: Q_PROPERTY(int outputCandPosY READ outputCandPosY WRITE setOutputCandPosY NOTIFY outputCandPosYChanged) void setOutputCandPosY(const int outputCandPosY); int outputCandPosY() const; signals: void outputCandPosYChanged(); private: int mOutputCandPosY; public: Q_PROPERTY(int backArrowPosX READ backArrowPosX WRITE setBackArrowPosX NOTIFY backArrowPosXChanged) void setBackArrowPosX(const int backArrowPosX); int backArrowPosX() const; signals: void backArrowPosXChanged(); private: int mBackArrowPosX; public: Q_PROPERTY(int backArrowPosY READ backArrowPosY WRITE setBackArrowPosY NOTIFY backArrowPosYChanged) void setBackArrowPosY(const int backArrowPosY); int backArrowPosY() const; signals: void backArrowPosYChanged(); private: int mBackArrowPosY; public: Q_PROPERTY(int forwardArrowPosX READ forwardArrowPosX WRITE setForwardArrowPosX NOTIFY forwardArrowPosXChanged) void setForwardArrowPosX(const int forwardArrowPosX); int forwardArrowPosX() const; signals: void forwardArrowPosXChanged(); private: int mForwardArrowPosX; public: Q_PROPERTY(int forwardArrowPosY READ forwardArrowPosY WRITE setForwardArrowPosY NOTIFY forwardArrowPosYChanged) void setForwardArrowPosY(const int forwardArrowPosY); int forwardArrowPosY() const; signals: void forwardArrowPosYChanged(); private: int mForwardArrowPosY; public: Q_PROPERTY(int adjustWidth READ adjustWidth WRITE setAdjustWidth NOTIFY adjustWidthChanged) void setAdjustWidth(const int adjustWidth); int adjustWidth() const; signals: void adjustWidthChanged(); private: int mAdjustWidth; public: Q_PROPERTY(int adjustHeight READ adjustHeight WRITE setAdjustHeight NOTIFY adjustHeightChanged) void setAdjustHeight(const int adjustHeight); int adjustHeight() const; signals: void adjustHeightChanged(); private: int mAdjustHeight; public: Q_PROPERTY(QString horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY horizontalTileModeChanged) void setHorizontalTileMode(const QString horizontalTileMode); QString horizontalTileMode() const; signals: void horizontalTileModeChanged(); private: QString mHorizontalTileMode; public: Q_PROPERTY(QString verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY verticalTileModeChanged) void setVerticalTileMode(const QString verticalTileMode); QString verticalTileMode() const; signals: void verticalTileModeChanged(); private: QString mVerticalTileMode; //=================================================================================================== private: //Fcitx SkinInputBar QString mInputBackImgVertical; QString mCustomImgVertical0; QString mCustomImgVertical1; QString mTipsImgVertical; int mMarginLeftVertical; int mMarginRightVertical; int mMarginTopVertical; int mMarginBottomVertical; QString mBackArrowImgVertical; QString mForwardArrowImgVertical; //Fcitx SkinFont int mFontSizeVertical; int mCandFontSizeVertical; QColor mInputColorVertical; QColor mIndexColorVertical; QColor mFirstCandColorVertical; QColor mOtherColorVertical; int mInputStringPosXVertical; int mInputStringPosYVertical; int mOutputCandPosXVertical; int mOutputCandPosYVertical; int mBackArrowPosXVertical; int mBackArrowPosYVertical; int mForwardArrowPosXVertical; int mForwardArrowPosYVertical; int mAdjustWidthVertical; int mAdjustHeightVertical; QString mHorizontalTileModeVertical; QString mVerticalTileModeVertical; public: #define DEFINE_SET_PROPERTY(read, type, property) \ void set##property(const type read); DEFINE_SET_PROPERTY(inputBackImgVertical, QString, InputBackImgVertical) DEFINE_SET_PROPERTY(tipsImgVertical, QString, TipsImgVertical) DEFINE_SET_PROPERTY(marginLeftVertical, int, MarginLeftVertical) DEFINE_SET_PROPERTY(marginRightVertical, int, MarginRightVertical) DEFINE_SET_PROPERTY(marginTopVertical, int, MarginTopVertical) DEFINE_SET_PROPERTY(marginBottomVertical, int, MarginBottomVertical) DEFINE_SET_PROPERTY(backArrowImgVertical, QString, BackArrowImgVertical) DEFINE_SET_PROPERTY(forwardArrowImgVertical, QString, ForwardArrowImgVertical) DEFINE_SET_PROPERTY(fontSizeVertical, int, FontSizeVertical) DEFINE_SET_PROPERTY(candFontSizeVertical, int, CandFontSizeVertical) DEFINE_SET_PROPERTY(inputColorVertical, QColor, InputColorVertical) DEFINE_SET_PROPERTY(indexColorVertical, QColor, IndexColorVertical) DEFINE_SET_PROPERTY(firstCandColorVertical, QColor, FirstCandColorVertical) DEFINE_SET_PROPERTY(otherColorVertical, QColor, OtherColorVertical) DEFINE_SET_PROPERTY(inputStringPosXVertical, int, InputStringPosXVertical) DEFINE_SET_PROPERTY(inputStringPosYVertical, int, InputStringPosYVertical) DEFINE_SET_PROPERTY(outputCandPosXVertical, int, OutputCandPosXVertical) DEFINE_SET_PROPERTY(outputCandPosYVertical, int, OutputCandPosYVertical) DEFINE_SET_PROPERTY(backArrowPosXVertical, int, BackArrowPosXVertical) DEFINE_SET_PROPERTY(backArrowPosYVertical, int, BackArrowPosYVertical) DEFINE_SET_PROPERTY(forwardArrowPosXVertical, int, ForwardArrowPosXVertical) DEFINE_SET_PROPERTY(forwardArrowPosYVertical, int, ForwardArrowPosYVertical) DEFINE_SET_PROPERTY(adjustWidthVertical, int, AdjustWidthVertical) DEFINE_SET_PROPERTY(adjustHeightVertical, int, AdjustHeightVertical) DEFINE_SET_PROPERTY(horizontalTileModeVertical, QString, HorizontalTileModeVertical) DEFINE_SET_PROPERTY(verticalTileModeVertical, QString, VerticalTileModeVertical) #undef DEFINE_SET_PROPERTY //=================================================================================================== public: SkinBase(); virtual ~SkinBase(); virtual bool loadSkin(const QString skinPath); void reloadSkin(); void init(); protected: QColor value2color(const QString& value); }; #endif //__SKIN_BASE_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/skinfcitx.cpp000066400000000000000000000171541230100576600230370ustar00rootroot00000000000000/* * Copyright (C) 2013 Canonical Ltd All rights reserved. * * Authors: * FJKong kroodywar3@gmail.com/fanjun.kong@canonical.com * * 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; version 3. * * 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, see . */ #include #include #include #include #include #include #include #include #include #include #include "skinfcitx.h" SkinFcitx::SkinFcitx() : SkinBase() { } SkinFcitx::~SkinFcitx() { } bool SkinFcitx::loadSkin(const QString skinPath) { init(); QFile fcitxSkinConfFile(skinPath + "fcitx_skin.conf"); if (!fcitxSkinConfFile.exists()) return false; if (!fcitxSkinConfFile.open(QIODevice::ReadOnly)) return false; QString line; QString key, value; bool skinFont = false; bool skinInputBar = false; bool skinFontVertical = false; bool skinInputBarVertical = false; QTextStream textStream(fcitxSkinConfFile.readAll()); do { line = textStream.readLine(); if (line.isEmpty() || line.at(0) == '#') continue; if (line.at(0) == '[') { skinFont = (line == "[SkinFont]"); skinInputBar = (line == "[SkinInputBar]"); skinFontVertical = (line == "[SkinFontVertical]"); skinInputBarVertical = (line == "[SkinInputBarVertical]"); continue; } if (!line.contains('=')) continue; key = line.split('=').at(0); value = line.split('=').at(1); if (value.isEmpty()) continue; if (skinFont) { if (key == "FontSize") { setFontSize(value.toInt()); } else if (key == "CandFontSize") { setCandFontSize(value.toInt()); } else if (key == "InputColor") { setInputColor(value2color(value)); } else if (key == "IndexColor") { setIndexColor(value2color(value)); } else if (key == "FirstCandColor") { setFirstCandColor(value2color(value)); } else if (key == "OtherColor") { setOtherColor(value2color(value)); } } else if (skinInputBar) { if (key == "BackImg") { setInputBackImg("file:/" + skinPath + value); } else if (key == "TipsImg") { setTipsImg("file:/" + skinPath + value); } else if (key == "AdjustWidth") { setAdjustWidth(value.toInt()); } else if (key == "AdjustHeight") { setAdjustHeight(value.toInt()); } else if (key == "MarginLeft") { setMarginLeft(value.toInt()); } else if (key == "MarginTop") { setMarginTop(value.toInt()); } else if (key == "MarginRight") { setMarginRight(value.toInt()); } else if (key == "MarginBottom") { setMarginBottom(value.toInt()); } else if (key == "horizontalTileMode") { setHorizontalTileMode(value); } else if (key == "verticalTileMode") { setVerticalTileMode(value); } else if (key == "InputStringPosX") { setInputStringPosX(value.toInt()); } else if (key == "InputStringPosY") { setInputStringPosY(value.toInt()); } else if (key == "OutputCandPosX") { setOutputCandPosX(value.toInt()); } else if (key == "OutputCandPosY") { setOutputCandPosY(value.toInt()); } else if (key == "BackArrowPosX") { setBackArrowPosX(value.toInt()); } else if (key == "BackArrowPosY") { setBackArrowPosY(value.toInt()); } else if (key == "ForwardArrowPosX") { setForwardArrowPosX(value.toInt()); } else if (key == "ForwardArrowPosY") { setForwardArrowPosY(value.toInt()); } else if (key == "BackArrow") { setBackArrowImg("file:/" + skinPath + value); } else if (key == "ForwardArrow") { setForwardArrowImg("file:/" + skinPath + value); } } else if (skinFontVertical) { if (key == "FontSize") { setFontSizeVertical(value.toInt()); } else if (key == "CandFontSize") { setCandFontSizeVertical(value.toInt()); } else if (key == "InputColor") { setInputColorVertical(value2color(value)); } else if (key == "IndexColor") { setIndexColorVertical(value2color(value)); } else if (key == "FirstCandColor") { setFirstCandColorVertical(value2color(value)); } else if (key == "OtherColor") { setOtherColorVertical(value2color(value)); } } else if (skinInputBarVertical) { if (key == "BackImg") { setInputBackImgVertical("file:/" + skinPath + value); } else if (key == "TipsImg") { setTipsImgVertical("file:/" + skinPath + value); } else if (key == "AdjustWidth") { setAdjustWidthVertical(value.toInt()); } else if (key == "AdjustHeight") { setAdjustHeightVertical(value.toInt()); } else if (key == "MarginLeft") { setMarginLeftVertical(value.toInt()); } else if (key == "MarginTop") { setMarginTopVertical(value.toInt()); } else if (key == "MarginRight") { setMarginRightVertical(value.toInt()); } else if (key == "MarginBottom") { setMarginBottomVertical(value.toInt()); } else if (key == "horizontalTileMode") { setHorizontalTileModeVertical(value); } else if (key == "verticalTileMode") { setVerticalTileModeVertical(value); } else if (key == "InputStringPosX") { setInputStringPosXVertical(value.toInt()); } else if (key == "InputStringPosY") { setInputStringPosYVertical(value.toInt()); } else if (key == "OutputCandPosX") { setOutputCandPosXVertical(value.toInt()); } else if (key == "OutputCandPosY") { setOutputCandPosYVertical(value.toInt()); } else if (key == "BackArrowPosX") { setBackArrowPosXVertical(value.toInt()); } else if (key == "BackArrowPosY") { setBackArrowPosYVertical(value.toInt()); } else if (key == "ForwardArrowPosX") { setForwardArrowPosXVertical(value.toInt()); } else if (key == "ForwardArrowPosY") { setForwardArrowPosYVertical(value.toInt()); } else if (key == "BackArrow") { setBackArrowImgVertical("file:/" + skinPath + value); } else if (key == "ForwardArrow") { setForwardArrowImgVertical("file:/" + skinPath + value); } } } while (!line.isNull()); fcitxSkinConfFile.close(); return true; } fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/skinfcitx.h000066400000000000000000000017461230100576600225040ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __SKIN_FCITX_H__ #define __SKIN_FCITX_H__ #include "skinbase.h" class SkinFcitx : public SkinBase { public: SkinFcitx(); virtual ~SkinFcitx(); virtual bool loadSkin(const QString skinPath); }; #endif // __SKIN_FCITX_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/skinmenu.cpp000066400000000000000000000132341230100576600226610ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #include #include #include #include "skinmenu.h" #include "../main_controller.h" #include "../my_action.h" #include "skinfcitx.h" #include "skinsogou.h" #include "../main.h" SkinMenu::SkinMenu(const QString &title, QWidget *parent) : QMenu(title, parent) { mSkinNameMenu = NULL; triggerUpdateSkinListMenu(); if (mSkinNameMenu) menuItemOnClick(mSkinNameMenu); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateSkinListMenu())); QObject::connect(this, SIGNAL(triggered(QAction*)), this, SLOT(menuItemOnClick(QAction *))); } SkinMenu::~SkinMenu() { } void SkinMenu::triggerUpdateSkinListMenu() { int i; size_t len; QDir skinDir; bool checked = false; MyAction *firstMenu = NULL, *menu; QFileInfoList list; QFileInfoList::Iterator iter; QString skinName = MainController::self()->getSkinName(); SkinClass skinClass; bool localExist; this->clear(); QString localSkinPath = qgetenv("HOME") + "/.config/fcitx-qimpanel/skin/"; for (i = 0; i < 1; i ++) { skinDir = QDir(localSkinPath); if (!skinDir.exists()) continue; skinDir.setFilter(QDir::Dirs); list = skinDir.entryInfoList(); for (iter = list.begin(); iter != list.end(); ++ iter) { if (iter->isDir() && "." != iter->fileName() && ".." != iter->fileName()) { QFile fcitxSkinConfFile(iter->absoluteFilePath() + "/fcitx_skin.conf"); QFile sogouSkinConfFile(iter->absoluteFilePath() + "/skin.ini"); if (fcitxSkinConfFile.exists()){ skinClass = FCITX; }else if (sogouSkinConfFile.exists()){ skinClass = SOGOU; }else continue; menu = new MyAction(iter->fileName(), this); menu->setSkinPath(iter->absoluteFilePath() + "/"); menu->setSkinClass(skinClass); this->addAction(menu); if (firstMenu == NULL) firstMenu = menu; menu->setCheckable(true); if (iter->fileName() == skinName) { checked = true; menu->setChecked(true); mSkinNameMenu = menu; } } } } char* ukSkinPath = getQimpanelSharePath("skin"); for (i = 0; i < 1; i ++) { skinDir = QDir(ukSkinPath); if (!skinDir.exists()) continue; skinDir.setFilter(QDir::Dirs); list = skinDir.entryInfoList(); for (iter = list.begin(); iter != list.end(); ++ iter) { if (iter->isDir() && "." != iter->fileName() && ".." != iter->fileName()) { QFile fcitxSkinConfFile(iter->absoluteFilePath() + "/fcitx_skin.conf"); QFile sogouSkinConfFile(iter->absoluteFilePath() + "/skin.ini"); if (fcitxSkinConfFile.exists()){ skinClass = FCITX; }else if (sogouSkinConfFile.exists()){ skinClass = SOGOU; }else continue; //check if exist in local localExist = false; QList localExistList = this->actions(); QList::iterator localExistIter; for (localExistIter = localExistList.begin(); localExistIter != localExistList.end(); ++ localExistIter) { if (((MyAction *)(*localExistIter))->text() == iter->fileName()) { localExist = true; break; } } if (localExist) continue; menu = new MyAction(iter->fileName(), this); //qDebug() << iter->absoluteFilePath(); menu->setSkinPath(iter->absoluteFilePath() + "/"); menu->setSkinClass(skinClass); this->addAction(menu); if (firstMenu == NULL) firstMenu = menu; menu->setCheckable(true); if (iter->fileName() == skinName) { checked = true; menu->setChecked(true); mSkinNameMenu = menu; } } } } if (!checked) firstMenu->setChecked(true); if (mSkinNameMenu == NULL) mSkinNameMenu = firstMenu; } void SkinMenu::menuItemOnClick(QAction *action) { SkinBase *skin; MyAction *myAction = (MyAction *)action; MainController::self()->setSkinName(myAction->text()); if (FCITX == myAction->getSkinClass()) skin = new SkinFcitx; else if (SOGOU == myAction->getSkinClass()) skin = new SkinSogou; else qDebug() << "Load skin failed!"; skin->loadSkin(myAction->getSkinPath()); MainController::self()->setSkinBase(skin, myAction->getSkinClass()); } fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/skinmenu.h000066400000000000000000000022121230100576600223200ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __SKIN_MENU_H__ #define __SKIN_MENU_H__ #include #include #include "../my_action.h" class SkinMenu : public QMenu { Q_OBJECT public: SkinMenu(const QString &title, QWidget *parent); virtual ~SkinMenu(); private slots: void triggerUpdateSkinListMenu(); void menuItemOnClick(QAction* action); private: MyAction *mSkinNameMenu; }; #endif // __SKIN_MENU_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/skinsogou.cpp000066400000000000000000000127131230100576600230520ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include #include #include "skinsogou.h" #include "../main_model.h" SkinSogou::SkinSogou() : SkinBase() { } SkinSogou::~SkinSogou() { } bool SkinSogou::loadSkin(const QString skinPath) { init(); QFile sogouSkinConfFile(skinPath + "skin.ini"); if (!sogouSkinConfFile.exists()) return false; if (!sogouSkinConfFile.open(QIODevice::ReadOnly)) return false; QString line; QString key, value; /// parse ini file content bool general = false; bool display = false; bool scheme_h1 = false; bool scheme_v1 = false; bool statusbar = false; int h_pt, h_pb, h_pl, h_pr; int v_pt, v_pb, v_pl, v_pr; unsigned int pinyin_color, zhongwen_color, zhongwen_first_color, comphint_color; int fontPixelSize = 12; setAdjustWidth(10); setAdjustHeight(30); setHorizontalTileMode("Stretch"); setVerticalTileMode("Stretch"); setInputStringPosX(0); setInputStringPosY(0); setOutputCandPosX(0); setOutputCandPosY(0); QTextStream textStream(sogouSkinConfFile.readAll()); do { line = textStream.readLine(); if (line.isEmpty() || line.at(0) == '#') continue; if (line.at(0) == '[') { general = (line == "[General]"); display = (line == "[Display]"); scheme_h1 = (line == "[Scheme_H1]"); scheme_v1 = (line == "[Scheme_V1]"); statusbar = (line == "[StatusBar]"); continue; } if (!line.contains('=')) continue; key = line.split('=').at(0); value = line.split('=').at(1); if (value.isEmpty()) continue; if (display) { if (key == "font_size") setFontSize(value.toInt()); else if (key == "pinyin_color"){ pinyin_color = value.toUInt(0, 0); setInputColor(QColor(qBlue(pinyin_color), qGreen(pinyin_color), qRed(pinyin_color))); } else if (key == "zhongwen_color"){ zhongwen_color = value.toUInt(0, 0); setOtherColor(QColor(qBlue(zhongwen_color), qGreen(zhongwen_color), qRed(zhongwen_color))); } else if (key == "zhongwen_first_color"){ zhongwen_first_color = value.toUInt(0, 0); setFirstCandColor(QColor(qBlue(zhongwen_first_color), qGreen(zhongwen_first_color), qRed(zhongwen_first_color))); } else if (key == "comphint_color"){ //FIXME //comphint_color = value.toUInt(0, 0); } }else if (scheme_h1) { if (key == "pic" && MainModel::self()->isHorizontal()) { setInputBackImg("file:/" + skinPath + value); } else if (key == "pinyin_marge") { QStringList list = value.split(','); h_pt = list.at(0).trimmed().toInt(); h_pb = list.at(1).trimmed().toInt(); h_pl = list.at(2).trimmed().toInt(); h_pr = list.at(3).trimmed().toInt(); if (MainModel::self()->isHorizontal()){ setMarginTop(h_pt); setMarginBottom(h_pb); setMarginLeft(h_pl); setMarginRight(h_pr); } } else if (key == "custom0_align") { //todo } else if (key == "custom0") { mCustomImgH1[0] = value; setCustomImg0 ("file:/" + skinPath + value); } else if (key == "custom1") { mCustomImgH1[1] = value; setCustomImg1 ("file:/" + skinPath + value); } else if (key == "custom_cnt") { mCustomCntH1 = value.toInt(); } }else if (scheme_v1) { if (key == "pic" && !MainModel::self()->isHorizontal()) { setInputBackImg("file:/" + skinPath + value); } else if (key == "pinyin_marge") { QStringList list = value.split(','); v_pt = list.at(0).trimmed().toInt(); v_pb = list.at(1).trimmed().toInt(); v_pl = list.at(2).trimmed().toInt(); v_pr = list.at(3).trimmed().toInt(); if (!MainModel::self()->isHorizontal()){ setMarginTop(v_pt); setMarginBottom(v_pb); setMarginLeft(v_pl); setMarginRight(v_pr); } } else if (key == "custom0") { mCustomImgV1[0] = value; //qDebug() << "cuystom0 " << value; //setCustomImg0(value); } else if (key == "custom1") { mCustomImgV1[1] = value; qDebug() << "cuystom1 " << value; //setCustomImg1(value); } else if (key == "custom_cnt") { mCustomCntV1 = value.toInt(); //qDebug() << "cuystom_cnt " << mCustomCntV1; } } else if (statusbar) { if (key == "pic") { //FIXME //setTipsImg("file:/" + skinPath + value); } } } while (!line.isNull()); sogouSkinConfFile.close(); return true; } fcitx-qimpanel-fcitx-qimpanel-0.1.5/skin/skinsogou.h000066400000000000000000000021461230100576600225160ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __SKIN_SOGOU_H__ #define __SKIN_SOGOU_H__ #include #include "skinbase.h" class SkinSogou : public SkinBase { public: SkinSogou(); virtual ~SkinSogou(); virtual bool loadSkin(const QString skinPath); private: QString mCustomImgH1[8]; int mCustomCntH1; QString mCustomImgV1[8]; int mCustomCntV1; }; #endif // __SKIN_SOGOU_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/system_tray_menu.cpp000066400000000000000000000323741230100576600235010ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #include #include #include #include #include #include #include #include "main.h" #include "my_action.h" #include "system_tray_menu.h" #include "config.h" #ifndef DISABLE_UK_SYNC #define UBUNTU_KYLIN_SYNC "/[Ubuntu\\ Kylin\\ Sync]/" #define UBUNTU_KYLIN_SYNC_M "/[Ubuntu Kylin Sync]/" #endif SystemTrayMenu::SystemTrayMenu(PanelAgent *agent) : QMenu() { mAgent = agent; } SystemTrayMenu::~SystemTrayMenu() { delete mVKListMenu; delete mIMListMenu; delete mSkinMenu; #ifndef DISABLE_UK_SYNC delete mSyncMenu; #endif } void SystemTrayMenu::init() { mVKListMenu = new QMenu(tr("Virtual Keyboard"), this); mIMListMenu = new QMenu(tr("Input Method"), this); #ifndef DISABLE_UK_SYNC mSyncMenu = new QMenu(tr("ConfigureSync"),this); #endif mSkinMenu = new SkinMenu(tr("Skin"), this); QObject::connect(mVKListMenu, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateVKListMenu())); QObject::connect(mIMListMenu, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateIMListMenu())); #ifndef DISABLE_UK_SYNC QObject::connect(mSyncMenu, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateSyncMenu())); #endif QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateMainMenu())); QObject::connect(this, SIGNAL(triggered(QAction*)), this, SLOT(menuItemOnClick(QAction *))); QObject::connect(mAgent, SIGNAL(execMenu(const QList)), this, SLOT(execMenu(const QList))); QObject::connect(mAgent, SIGNAL(registerProperties(const QList)), this, SLOT(registerProperties(const QList))); QObject::connect(mAgent, SIGNAL(updateProperty(KimpanelProperty)), this, SLOT(updateProperty(KimpanelProperty))); } void SystemTrayMenu::registerProperties(const QList &props) { int count = 0; mStatusMenuList.clear(); foreach(const KimpanelProperty &prop, props) { //qDebug() << QString("triggerUpdateMainMenu(1:%1 2:%2 3:%3 4:%4 5:%5 6:%6)").arg(prop.key) // .arg(prop.label).arg(prop.icon).arg(prop.tip).arg(prop.state).arg(prop.menu); if (count ++ < StatusMenuSkip) continue; if (prop.key == "/Fcitx/vk") continue; this->mStatusMenuList << prop; } } void SystemTrayMenu::updateProperty(const KimpanelProperty &prop) { if (tr("No input window") == prop.label) return; this->mCurtIMLabel = prop.label; } void SystemTrayMenu::triggerUpdateMainMenu() { MyAction *menu; this->clear(); this->addAction(QIcon::fromTheme("help-contents"), tr("Online &Help!")); this->addSeparator(); foreach(const KimpanelProperty &prop, this->mStatusMenuList) { menu = new MyAction(QIcon::fromTheme(prop.icon), prop.label, this); menu->setProp(prop); this->addAction(menu); } this->addSeparator(); this->addMenu(mVKListMenu); this->addMenu(mIMListMenu); this->addMenu(mSkinMenu); this->addSeparator(); this->addAction(QIcon::fromTheme("preferences-desktop"), tr("Configure")); this->addAction(QIcon::fromTheme("preferences-desktop"), tr("ConfigureIMPanel")); this->addAction(QIcon::fromTheme("preferences-desktop"), tr("ConfigureIM")); #ifndef DISABLE_UK_SYNC this->addMenu(mSyncMenu); #endif this->addSeparator(); this->addAction(QIcon::fromTheme("view-refresh"), tr("Restart")); this->addAction(QIcon::fromTheme("application-exit"), tr("Exit")); } void SystemTrayMenu::triggerUpdateVKListMenu() { mExecMenuType = updateVKListMenu; mAgent->triggerProperty(QString("/Fcitx/vk")); } void SystemTrayMenu::triggerUpdateIMListMenu() { mExecMenuType = updateIMListMenu; mAgent->triggerProperty(QString("/Fcitx/im")); } #ifndef DISABLE_UK_SYNC void SystemTrayMenu::triggerUpdateSyncMenu() { mSyncMenu->clear(); mSyncMenu->addAction(QIcon::fromTheme(""), tr("ConfigureUp")); mSyncMenu->addAction(QIcon::fromTheme(""), tr("ConfigureDwon")); } #endif void SystemTrayMenu::doUpdateVKListMenu(const QList &prop_list) { MyAction *menu; QList::const_iterator iter; mVKListMenu->clear(); for (iter = prop_list.begin(); iter != prop_list.end(); ++ iter) { menu = new MyAction(QIcon::fromTheme(iter->icon), iter->label, this); menu->setProp(*iter); mVKListMenu->addAction(menu); } } void SystemTrayMenu::doUpdateIMListMenu(const QList &prop_list) { bool checked = false; MyAction *firstMenu = NULL, *menu; QList::const_iterator iter; mIMListMenu->clear(); for (iter = prop_list.begin(); iter != prop_list.end(); ++ iter) { menu = new MyAction(QIcon::fromTheme(iter->icon), iter->label, this); menu->setProp(*iter); mIMListMenu->addAction(menu); if (firstMenu == NULL) firstMenu = menu; menu->setCheckable(true); if (iter->label == this->mCurtIMLabel) { checked = true; menu->setChecked(true); } } if (!checked) firstMenu->setChecked(true); } void SystemTrayMenu::execMenu(const QList &prop_list) { QList::const_iterator iter; switch (mExecMenuType) { case updateVKListMenu: doUpdateVKListMenu(prop_list); break; case updateIMListMenu: doUpdateIMListMenu(prop_list); break; //case updateThemerMenu: // tmpMenu = mSkinMenu; // break; default: for (iter = prop_list.begin(); iter != prop_list.end(); ++ iter) { qDebug() << QString("execMenuCallback(1:%1 2:%2 3:%3 4:%4 5:%5 6:%6)").arg(iter->key) .arg(iter->label).arg(iter->icon).arg(iter->tip).arg(iter->state).arg(iter->menu); } break; } mExecMenuType = nullExecMenuType; } void SystemTrayMenu::restart() { /* exec command */ pid_t child_pid; child_pid = fork(); if (child_pid < 0) { perror("fork"); } else if (child_pid == 0) { /* child process */ pid_t grandchild_pid; grandchild_pid = fork(); if (grandchild_pid < 0) { perror("fork"); _exit(1); } else if (grandchild_pid == 0) { /* grandchild process */ execvp("fcitx-qimpanel", NULL); perror("execvp"); _exit(1); } else { _exit(0); } } else { /* parent process */ int status; waitpid(child_pid, &status, 0); _exit(0); } } void SystemTrayMenu::startChildApp(const char *app_exe) { /* exec command */ pid_t child_pid; child_pid = fork(); if (child_pid < 0) { perror("fork"); } else if (child_pid == 0) { /* child process */ pid_t grandchild_pid; grandchild_pid = fork(); if (grandchild_pid < 0) { perror("fork"); _exit(1); } else if (grandchild_pid == 0) { /* grandchild process */ execvp(app_exe, NULL); perror("execvp"); _exit(1); } else { _exit(0); } } } #ifndef DISABLE_UK_SYNC void SystemTrayMenu::syncConfigUp() { qDebug()<<"SystemTrayMenu::syncConfigUp"; QString kuaipanConfPath = qgetenv("HOME") + "/.config/ubuntukylin/"; QString kuaipanSyncPath; QString fcitxQimpanelConfPath = qgetenv("HOME") +"/.config/fcitx-qimpanel/main.conf "; QString fcitxConfPath = qgetenv("HOME") +"/.config/fcitx/config "; QDir *temp = new QDir; QDir *temp1 = new QDir; if(true == temp->exists(kuaipanConfPath)) { QSettings* mSettings = new QSettings(kuaipanConfPath + "kuaipan4uk.conf",QSettings::IniFormat); mSettings->setIniCodec("UTF-8"); mSettings->beginGroup("client-info"); kuaipanSyncPath = mSettings->value("Root").toString(); mSettings->endGroup(); if(true == temp1->exists(kuaipanSyncPath + UBUNTU_KYLIN_SYNC_M)) { if(false == temp1->exists(kuaipanSyncPath + UBUNTU_KYLIN_SYNC_M"fcitx")) { QString cmd = "mkdir " + kuaipanSyncPath +UBUNTU_KYLIN_SYNC +"fcitx"; qDebug()<exists(kuaipanConfPath)) { QSettings* mSettings = new QSettings(kuaipanConfPath + "kuaipan4uk.conf",QSettings::IniFormat); mSettings->setIniCodec("UTF-8"); mSettings->beginGroup("client-info"); kuaipanSyncPath = mSettings->value("Root").toString(); mSettings->endGroup(); if(true == temp1->exists(kuaipanSyncPath + UBUNTU_KYLIN_SYNC_M)) { if(false == temp1->exists(kuaipanSyncPath + UBUNTU_KYLIN_SYNC_M"fcitx")) { QMessageBox::warning(this,tr("Warning"),tr("No configure can be synchronized!")); return; } //fcitx-qimpanel QString cmd1 = "cp " + kuaipanSyncPath +UBUNTU_KYLIN_SYNC"fcitx/main.conf " + fcitxQimpanelConfPath; QByteArray ba1 = cmd1.toLatin1(); const char *transpd1 = ba1.data(); if(0!= system(transpd1)) { return; } //fcitx QString cmd2 = "cp " + kuaipanSyncPath +UBUNTU_KYLIN_SYNC"fcitx/config " + fcitxConfPath; QByteArray ba2 = cmd2.toLatin1(); const char *transpd2 = ba2.data(); if(0!= system(transpd2)) { return; } } else{ QMessageBox::warning(this,tr("Warning"),tr("[Ubuntu Kylin Sync] Synchronize directories have been deleted?!")); } } else{ QMessageBox::warning(this,tr("Warning"),tr("Please log in kuaipan!")); } } #endif void SystemTrayMenu::menuItemOnClick(QAction *action) { if (tr("Online &Help!") == action->text()) { QDesktopServices::openUrl(QUrl("http://fcitx-im.org/")); } else if (tr("ConfigureIM") == action->text()) { mAgent->triggerProperty(QString("/Fcitx/logo/configureim")); } else if (tr("ConfigureIMPanel") == action->text()) { QFile toolFile(getQimpanelBinPath("fcitx-qimpanel-configtool")); if (!toolFile.exists()) { QMessageBox::warning(this,tr("Warning"),tr("Please install fcitx-qimpanel-configtool!")); } startChildApp("fcitx-qimpanel-configtool"); } else if (tr("Configure") == action->text()) { mAgent->configure(); } else if (tr("Restart") == action->text()) { mAgent->restart(); this->restart(); } else if (tr("Exit") == action->text()) { mAgent->exit(); exit(0); #ifndef DISABLE_UK_SYNC } else if (tr("ConfigureUp") == action->text()) { qDebug()<<"SystemTrayMenu::ConfigureUp"; syncConfigUp(); } else if (tr("ConfigureDwon") == action->text()){ qDebug()<<"SystemTrayMenu::ConfigureDown"; syncConfigDown(); #endif } else { MyAction *myAction = (MyAction *)action; if (myAction->getProp().key != "") { mAgent->triggerProperty(myAction->getProp().key); } } } fcitx-qimpanel-fcitx-qimpanel-0.1.5/system_tray_menu.h000066400000000000000000000045351230100576600231440ustar00rootroot00000000000000/* * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd. * * Authors: * lenky gao lenky0401@gmail.com/gaoqunkai@ubuntukylin.com * * 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; version 3. * * 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, see . */ #ifndef __SYSTEM_TRAY_MENU_H__ #define __SYSTEM_TRAY_MENU_H__ #include #include #include "kimpanelagent.h" #include #include #include #include "config.h" #include "skin/skinmenu.h" enum ExecMenuType { nullExecMenuType, updateVKListMenu, updateIMListMenu, //updateThemerMenu, }; class SystemTrayMenu : public QMenu { Q_OBJECT public: SystemTrayMenu(PanelAgent *agent); virtual ~SystemTrayMenu(); void init(); private slots: void triggerUpdateMainMenu(); void triggerUpdateVKListMenu(); void triggerUpdateIMListMenu(); #ifndef DISABLE_UK_SYNC void triggerUpdateSyncMenu(); #endif void menuItemOnClick(QAction* action); private: PanelAgent *mAgent; public slots: void execMenu(const QList &prop_list); void registerProperties(const QList &props); void updateProperty(const KimpanelProperty &prop); private: void doUpdateVKListMenu(const QList &prop_list); void doUpdateIMListMenu(const QList &prop_list); void startChildApp(const char *app_exe); #ifndef DISABLE_UK_SYNC void syncConfigUp(); void syncConfigDown(); #endif public: void restart(); private: QString mCurtIMLabel; //前两个用不到,见后端KimpanelRegisterAllStatus()函数 #define StatusMenuSkip (2) QList mStatusMenuList; SkinMenu *mSkinMenu; QMenu *mVKListMenu; QMenu *mIMListMenu; #ifndef DISABLE_UK_SYNC QMenu *mSyncMenu; #endif ExecMenuType mExecMenuType; }; #endif // __SYSTEM_TRAY_MENU_H__ fcitx-qimpanel-fcitx-qimpanel-0.1.5/toplevel.cpp000066400000000000000000000075431230100576600217240ustar00rootroot00000000000000/*************************************************************************** * Copyright (C) 2013 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 #include #include #include #include #include #include "toplevel.h" TopLevel::TopLevel(QWidget* parent) : QWidget(parent, Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint) { setAttribute(Qt::WA_TranslucentBackground, true); QVBoxLayout *lay = new QVBoxLayout(this); lay->setMargin(0); lay->setSpacing(0); setLayout(lay); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); } void TopLevel::setCenterWidget(QWidget* widget) { if (m_widget) { m_widget->removeEventFilter(this); layout()->removeWidget(m_widget); } m_widget = widget; widget->installEventFilter(this); widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); layout()->addWidget(widget); layout()->activate();//? } void TopLevel::showEvent(QShowEvent* event) { QWidget::showEvent(event); setMask(rect()); updateLocation(); } bool TopLevel::eventFilter(QObject* object, QEvent* event) { if (object == m_widget.data() && event->type() == QEvent::Resize) { setMinimumSize(m_widget->sizeHint()); setMaximumSize(m_widget->sizeHint()); } return QObject::eventFilter(object, event); } void TopLevel::resizeEvent(QResizeEvent* resize) { QWidget::resizeEvent(resize); setMask(rect()); updateLocation(); } void TopLevel::setSpotRect(const QRect& rect) { m_spotRect = rect; updateLocation(); } void TopLevel::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))); } QPoint p(x, y); if (p != pos()) move(p); } void TopLevel::setTopLevelVisible(bool aux, bool preedit, bool lookupTable) { this->setVisible(aux || preedit || lookupTable); } fcitx-qimpanel-fcitx-qimpanel-0.1.5/toplevel.h000066400000000000000000000037061230100576600213660ustar00rootroot00000000000000/*************************************************************************** * Copyright (C) 2013 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 _TOPLEVEL_H_ #define _TOPLEVEL_H_ #include #include class TopLevel : public QWidget { Q_OBJECT public: explicit TopLevel(QWidget* parent = 0); void setCenterWidget(QWidget* widget); virtual void showEvent(QShowEvent* event); virtual void resizeEvent(QResizeEvent* resize); virtual bool eventFilter(QObject* object, QEvent* event); void setSpotRect(const QRect& rect); void setTopLevelVisible(bool aux, bool preedit, bool lookupTable); private: void updateLocation(); QPointer m_widget; QRect m_spotRect; }; #endif fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/000077500000000000000000000000001230100576600223605ustar00rootroot00000000000000fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/CMakeLists.txt000066400000000000000000000004041230100576600251160ustar00rootroot00000000000000 set(pkgbindir /usr/bin/) set(pkgdatadir /usr/share/fcitx-qimpanel) foreach(skin ubuntukylin-dark1 ubuntukylin-dark2 ubuntukylin-light1 ubuntukylin-light2) install(DIRECTORY ${skin} DESTINATION ${pkgdatadir}/skin) endforeach(skin default classic dark) fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark1/000077500000000000000000000000001230100576600257515ustar00rootroot00000000000000fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark1/fcitx_skin.conf000066400000000000000000000161421230100576600307650ustar00rootroot00000000000000#备注:此皮肤conf文件作为范本,包含有各个字段的详细说明。 # --- By Lenky 2013-9-12 [SkinInfo] #名词 Name=ubuntukylin-dark1 #版本 Version=0.1 #作者 Author=Ou Yangyu #描述 Desc=ubuntukylin-dark1 [SkinFont] #输入字符串的字体大小,以points为单位计算 FontSize=13 #候选词前的数字标号和候选词的字体大小,以points为单位计算 CandFontSize=13 #输入字符串的字体颜色,按RGB的十进制计算,比如#1a9bff则为:十六进制1a为十进制25,十六进制9b为十进制155,十六进制ff为十进制255 InputColor=26 155 255 #候选词前的数字标号的字体颜色 IndexColor=255 255 255 #首选候选词的字体颜色 FirstCandColor=26 155 255 #其他候选词的字体颜色 OtherColor=255 255 255 #================================================== #以下字段在qim-panel暂时没用到,仅为了兼容fcitx #因为默认启动fcitx时,会检查皮肤文件是否正确,如果没有下面这些字段, #那么检查结果为错误,导致把皮肤退回为default,导致再启动qim-panel就 #使用的也是default了。 TipColor=162 181 255 UserPhraseColor=255 255 143 CodeColor=26 155 255 ActiveMenuColor=255 255 255 InactiveMenuColor=178 178 178 [SkinMainBar] BackImg=bar.png Logo=logo.png Eng=en.png Active=cn.png MarginLeft=8 MarginRight=8 MarginTop=8 MarginBottom=8 [SkinTrayIcon] Active=active.png Inactive=inactive.png [SkinMenu] BackImg=menu.png MarginLeft=8 MarginRight=8 MarginTop=8 MarginBottom=8 ActiveColor=50 87 244 LineColor=204 204 204 [SkinKeyboard] # Virtual Keyboard Image BackImg=keyboard.png # Key Color On Virutal Keyboard KeyColor=101 153 209 #以上字段在qim-panel暂时没用,仅为了兼容fcitx #================================================== #说明1:以下几个坐标以均以整个面板的左上角为原点(0, 0) # (0, 0) # -----------------------------------> # | # | (x, y) # | # | # | # | # V #说明2:输入面板主要有四个元素,分别为输入字符串(InputString),候选词(OutputCand),左翻页(BackArrow),右翻页(ForwardArrow) #默认的横向布局为(以5个候选词为例): # --------------------------------------------------------------------------- # | [InputString] [BackArrow] [ForwardArrow] | # | [OutputCand1] [OutputCand2] [OutputCand3] [OutputCand4] [OutputCand5] | # --------------------------------------------------------------------------- #默认的纵向布局为: # ------------------------------------------------- # | [InputString] [BackArrow] [ForwardArrow] | # | [OutputCand1] | # | [OutputCand2] | # | [OutputCand3] | # | [OutputCand4] | # | [OutputCand5] | # ------------------------------------------------- #说明3:所有文本或图片的配置坐标均以其左上角为准,所以,如果填写负数的话,需要考虑把文本或图片的宽和高预计在内 #说明4:因为整个输入面板的宽和高是动态变化的,其计算方法是: #高:四个元素InputString OutputCand BackArrow ForwardArrow中靠最下方的那个元素的bottom值 再 加上 MarginBottom + AdjustHeight 为整个面板的高度 #宽:四个元素InputString OutputCand BackArrow ForwardArrow中靠最右方的那个元素的right值 再 加上 MarginRight + AdjustWidth 为整个面板的宽度 #横向布局 [SkinInputBar] #面板宽度调节,可正可负,默认为0 AdjustWidth=0 #面板高度调节,可正可负,默认为0 AdjustHeight=0 #输入面板时的背景图片 BackImg=input.png #切换时提示信息的背景图片 TipsImg=tips.png #关于皮肤九宫格的特性可以参考:http://qt-project.org/doc/qt-4.8/qml-borderimage.html #简单点说就是:左上、左下、右上、右下,这四个角落不会被拉伸,而上下会水平拉伸,左右会垂直拉伸,而中间既会水平拉伸,也会垂直拉伸 #因此要把一些不让变形的logo等图片放置在左上、左下、右上、右下,这四个区域 #下面这个值用于标记整个九宫格布局 #九宫格的左边距 MarginLeft=17 #九宫格的右边距,必须为正数,表示离右边的距离 MarginRight=39 #九宫格的上边距 MarginTop=25 #九宫格的下边距,必须为正数,表示离下边的距离 MarginBottom=10 #水平拉伸时填充方式,可选值:Stretch,伸缩填充;Repeat,重复填充;Round,重复填充,但可以保证最后一个重复也是完整的,因此会进行适当伸缩 #默认为Stretch horizontalTileMode=Stretch #垂直拉伸时填充方式,可选值:Stretch,伸缩填充;Repeat,重复填充;Round,重复填充,但可以保证最后一个重复也是完整的,因此会进行适当伸缩 #默认为Stretch verticalTileMode=Stretch #输入字符串位置X坐标,为0则默认为MarginLeft,为负数则从最右边往左推进的距离 InputStringPosX=0 #输入字符串位置Y坐标,为0则默认为MarginTop,为负数则从最底边往上推进的距离 InputStringPosY=6 #输出候选词位置X坐标,为0则默认为MarginLeft,为负数则从最右边往左推进的距离 OutputCandPosX=0 #输出候选词位置Y坐标,为0则默认为(MarginTop + 输入字符串的高度),为负数则从最底边往上推进的距离 OutputCandPosY=30 #左翻页图片 BackArrow=prev.png #左翻页图片位置X坐标,为0则默认为从最右边往左推进的(左翻页图片宽度 + 右翻页图片宽度 + 15)的距离,为负数则从最右边往左推进的距离 BackArrowX=0 #左翻页图片位置Y坐标,为0则默认为InputStringPosY,为负数则从最底边往上推进的距离 BackArrowY=0 #右翻页图片 ForwardArrow=next.png #右翻页图片位置X坐标,为0则默认为从最右边往左推进的(右翻页图片宽度 + 10)的距离,为负数则从最右边往左推进的距离 ForwardArrowX=0 #右翻页图片位置Y坐标,为0则默认为InputStringPosY,为负数则从最底边往上推进的距离 ForwardArrowY=0 #================================================== #以下字段在qim-panel暂时没用到,仅为了兼容fcitx #因为默认启动fcitx时,会检查皮肤文件是否正确,如果没有下面这些字段, #那么检查结果为错误,导致把皮肤退回为default,导致再启动qim-panel就 #使用的也是default了。 InputPos=0 OutputPos=26 BackArrowX=20 BackArrowY=6 ForwardArrowX=10 ForwardArrowY=6 CursorColor=255 255 255 #================================================== #纵向布局 #说明:如果和横向布局的配置一致,纵向布局里可以不用重复设置 #比如横向布局里的FontSize为16,如果纵向布局里的FontSize也是16,那么可以不配置该字段或配置该字段为0 [SkinFontVertical] [SkinInputBarVertical] #面板宽度调节,可正可负 AdjustWidth=10 #面板高度调节,可正可负 AdjustHeight=-30 BackImg=input_v.png MarginTop=33 MarginBottom=48 fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark1/input.png000066400000000000000000000206051230100576600276210ustar00rootroot00000000000000PNG  IHDR>tEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp IDATxbdk; Tgc2_6߿d" #ÓWP!@I)*?a.$ݾ1gX-ǥP/~2~PpXi (FP8j&˻tn0`;% wjCYxS1JP3 |BIu_f+2)I00dp=3$˟EdX?uM9`Ar1` E|!.}&&fE˰][|xZ Pfu0{8AY@RxX6gz?~  ?%`oND'G_gc00;$/ }a\mv}PY\A _Γ >1hb;p:03 Ő|WֵҌP@,u`J#@%0߻<%Zpp(# -.M .A4DX Zdڝ] m //wӇ}}~.mEpai ngO.-m **dG"CQ*ASGzk˲f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cK`{>:uRxIVngkL2ѩP'Ӏ * SF{X[u8czx Ե7b׿߇teBXǬ7|1,'S(;I2Z r 1I.9+c1x ;ð1M ZaXz ;Î0x g sCǰ1R)APGk ^!F+,|. 8:szou){\ZAE!+$,- W,$7Q ':KKi0}qDA 89PCe v}=8^,^aC|buÁZ&$2* &\CpbF8~q  ID}V{k6jUtylVU\뗯cZH^Vxןڊ6𚑽+,I5"f)K5K!e !?}KQ¨vZH*HɃ0 ѸQQvARڠCgԆ<~jK]DdSaկc)r9°֐nޱբozsH޳Axi#Z$|im;Wy" 䢉JMC5:P d ZҸM1eMF9%mݔH&LBlWtlHK Eȝ~8[+'#gvc^gJ.D5Z2l03d%\b{,<'<Lo*.JdkZ=iNqOxKLv@^!zW;XuF%d #F rO t_mb}0@$]\5M^_AQ c9:I+A"߁uv{eh(>$p,x,u7qƃaek2L!?97*5AsH$H<<}K4 Qmhc$J QLhK$;?ݏHN8!:հN|߄9aPpd;0xq$|% [HPZLMm1P%|mRp\*Ԉ.!{lmnΆsyÈQB!`Emo;y!}C7T /R=-5]xMW`y'KfaMVR8ېjCN{s->DFLhYz SH z2gh+0^\:>3'p[T'x$~aADy%'յOdp肊OB<<ŚƁ NXDL(5۶` 礊apìwTk>>Uǝ,U󞛜}er?ϠU8UCǽS21rċ8)Kۭi &bio~>xB('Z/\(J+t5&_a=j_{%4y_*y8}ŏگKtc<,Od0+L*N2Tr H%JROS|J(T3Q*wJAe/[Z9񞌙o~fk wK[ZUOIENDB`fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark1/next.png000066400000000000000000000071271230100576600274440ustar00rootroot00000000000000PNG  IHDR 6PtEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp IDATxbL @@ ~e` Ab b b 0 ǀP,  ?Z)ܬQL `A"_v|r n?AFBmdDu0.?FS`.y/KB. v H& IlIENDB`fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark1/prev.png000066400000000000000000000071341230100576600274400ustar00rootroot00000000000000PNG  IHDR 6PtEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp IDATxb/b d1@ b#  ܬ€"0(? @1?#b01 o2"01|,`@) ,`d8Y#b %#0e ?C)pyژlsIENDB`fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark1/tips.png000066400000000000000000000110151230100576600274340ustar00rootroot00000000000000PNG  IHDR>tEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp cIDATxڬ B1p';q=?3>`@Ҫ7[f~B6!0HAwCd'#uL8Sðv3b:dwA>ffG 5 ?2Ѕ߿311+Rɼ$l]L*cpr53hH&v^!wAF( HGb )A_## M{a`782hȑ!inPA YkIIU`s؋g}@ @s Jj2_FգRr_s@@4+A TG(`n My#;fє7@ehMy7*Ѧ nv p2@G++A P}ZD`*(:iqZYU k5CQ1xf'$mZBfixp3{rVdVǜhmj9?q+P p(QUՇPGWV>3h]|I/I:"N/⤸:ZTTDPjbr48}hn%óz\>՗ 2Y&;GI)W꽧ǻq?_!53N,W|.9`Y;dyPxZ( (@<x@d#* ?dE # | # | (x, y) # | # | # | # | # V #说明2:输入面板主要有四个元素,分别为输入字符串(InputString),候选词(OutputCand),左翻页(BackArrow),右翻页(ForwardArrow) #默认的横向布局为(以5个候选词为例): # --------------------------------------------------------------------------- # | [InputString] [BackArrow] [ForwardArrow] | # | [OutputCand1] [OutputCand2] [OutputCand3] [OutputCand4] [OutputCand5] | # --------------------------------------------------------------------------- #默认的纵向布局为: # ------------------------------------------------- # | [InputString] [BackArrow] [ForwardArrow] | # | [OutputCand1] | # | [OutputCand2] | # | [OutputCand3] | # | [OutputCand4] | # | [OutputCand5] | # ------------------------------------------------- #说明3:所有文本或图片的配置坐标均以其左上角为准,所以,如果填写负数的话,需要考虑把文本或图片的宽和高预计在内 #说明4:因为整个输入面板的宽和高是动态变化的,其计算方法是: #高:四个元素InputString OutputCand BackArrow ForwardArrow中靠最下方的那个元素的bottom值 再 加上 MarginBottom 为整个面板的高度 #宽:四个元素InputString OutputCand BackArrow ForwardArrow中靠最右方的那个元素的right值 再 加上 MarginRight 为整个面板的宽度 #横向布局 [SkinInputBar] #输入面板时的背景图片 BackImg=input.png #切换时提示信息的背景图片 TipsImg=tips.png #九宫格的左边距 MarginLeft=17 #九宫格的右边距,必须为正数,表示离右边的距离 MarginRight=39 #九宫格的上边距 MarginTop=25 #九宫格的下边距,必须为正数,表示离下边的距离 MarginBottom=10 #输入字符串位置X坐标,为0则默认为MarginLeft,为负数则从最右边往左推进的距离 InputStringPosX=0 #输入字符串位置Y坐标,为0则默认为MarginTop,为负数则从最底边往上推进的距离 InputStringPosY=6 #输出候选词位置X坐标,为0则默认为MarginLeft,为负数则从最右边往左推进的距离 OutputCandPosX=0 #输出候选词位置Y坐标,为0则默认为(MarginTop + 输入字符串的高度),为负数则从最底边往上推进的距离 OutputCandPosY=30 #左翻页图片 BackArrow=prev.png #左翻页图片位置X坐标,为0则默认为从最右边往左推进的(左翻页图片宽度 + 右翻页图片宽度 + 15)的距离,为负数则从最右边往左推进的距离 BackArrowX=0 #左翻页图片位置Y坐标,为0则默认为InputStringPosY,为负数则从最底边往上推进的距离 BackArrowY=0 #右翻页图片 ForwardArrow=next.png #右翻页图片位置X坐标,为0则默认为从最右边往左推进的(右翻页图片宽度 + 10)的距离,为负数则从最右边往左推进的距离 ForwardArrowX=0 #右翻页图片位置Y坐标,为0则默认为InputStringPosY,为负数则从最底边往上推进的距离 ForwardArrowY=0 #================================================== #以下字段在qim-panel暂时没用到,仅为了兼容fcitx #因为默认启动fcitx时,会检查皮肤文件是否正确,如果没有下面这些字段, #那么检查结果为错误,导致把皮肤退回为default,导致再启动qim-panel就 #使用的也是default了。 InputPos=0 OutputPos=26 BackArrowX=20 BackArrowY=6 ForwardArrowX=10 ForwardArrowY=6 CursorColor=255 255 255 #================================================== #纵向布局 #说明:如果和横向布局的配置一致,纵向布局里可以不用重复设置 #比如横向布局里的FontSize为16,如果纵向布局里的FontSize也是16,那么可以不配置该字段或配置该字段为0 [SkinFontVertical] [SkinInputBarVertical] #面板宽度调节,可正可负 AdjustWidth=10 #面板高度调节,可正可负 AdjustHeight=-30 BackImg=input_v.png MarginTop=33 MarginBottom=48 fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark2/input.png000066400000000000000000000163161230100576600276260ustar00rootroot00000000000000PNG  IHDR>tEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp $IDATxڬA !_ i1]E6AtX!%nO{97/Os< R\Q)?j 2k-RBp1@ լ|rjbx_ y([9)%1CkJҶ ]o?Ĩg/ 1|nF^>TL,L PA۷4OؔW^13psi`"7 0#02;82x B opvz*܅,@LL̊[@6| Ph2Yٺe=FtMm )^ rF$Q#}iym ,x R-PN8p ccɒ\n~!ysk;_hT~h^_]iϽ_oz  sebIh=_wb"!} FP 죔vEIO:ֺ1`%GLQyK # U& zNJ,wT R5c]8]h?Ƥ/M b'u[Φ3DVjFRH}9P)DE" ;ߠ| *nʡ^I 6*!(fwƐ6!H+?]Z<3 >0q?|ߞϟ\a^/.֏ڃ29b9m篽qƭ_dWHLŀ?0gYJd6 dK)g,XrszdOlO9. y&/xfjM^ƳaròlۋJB!DWr7 ,QaxLӟSwOVyIetz',+ښO4x~?{A 7G K ȚO}m4tl^-fc:"NsHWlll6"[Y^΅[jV*rL2b e\NGHJqbCNM&]Ǖc.0rS(}혜TxߒT5nݶT7#um&~~pM77 mJ3)miʹ睊,Gx&rմ? PCxqM shFJ&o F‘4Ss!NJkdh!2" :h8}Ѧe︄Itړx EiNZpALT6::*e\C4vwsvNZ{Iy[=($f.xĬtY,8RшAȈ&uR βU,r,@Tzj6f,Cpq M6;;+ZlmmMoT*9;_ ו/8tft+,Zu?Ү0' ܺO h,vȠ^.W^}grD1 ߳זQG05աqq:ٹ`lGx gΜ^njF5#>a~?lQ&O"h`~'i* MlfbV>?b@ YʐIENDB`fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark2/input_v.png000066400000000000000000000170461230100576600301540ustar00rootroot00000000000000PNG  IHDRwɧtEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp |IDATx̓1 E?% ,9C*uyz̽d(L/![  5dz@ WW ~d) HB҆BG7$:y(~U\=?b Ii c1fMR5.#PИеVIG6!(!]p8ԯFKPH,4M!s(rZJ)KUB[Q$I@'?EhJ^ sd)-_CHMfY(D6?g qA9rޏ|$3k %J94[˜=8l\uw,FwU4`rj *ahn>OEɪyyymUtD*jjyTq\Ӡ"hЏK.SBw}tJZnٙWͦ0êRդ%Q怵g5@cM[iZD+rq6&C7/ /j&DRygU6.[y8g>0=ǁ٧v<٥3S#U҉5w`Ι-<IL h(;$$C#bQ_scXdFo;T*cx /3 D-:f3'04twmssdLL< Ω3rvuwrJ199)f eKWsd1=tP@ R.Wdk4>f EC1UCvGr}p$!ή vb v Ȉ755% 䅅ozzZύ >5|aDhLrgZmooy7??/ %3'Q4-byZ[ofF#^|6Sz% 1oL-y kCև *M Da+Ƴ(r..%hA/Oz}LY$ 1KAv-VFI~"p;;u.6@ mrxV)3bH\3(CE#vU T--A0T<`G0C-+^Nxળo*57z~uZkzSjcYMu풸-mXp_xƵu䚁q9^sER  p 18#(GP*AP񈈀C-PKJb(GTjo  `muFv X4 1"h Q'A]f8` Mb)Z@ :t^oQ'U9ynxWXɤn'bprBZe??WeCr"p>]VpĈP(Hp(1M`  :) Օ6  ꥅZ;^nzpσ7"SFt NgÈ^Qc0U/h=(a>@@ž$/L:6FSv{DN¤JLv*+ljxTʕ6yP2 )8qD-̋8[ wfoxDX9''jZΣīBC.KS&қR[aj# u5n>f VX鐇i.\a$^__hT꤬EQT0 کCV̽)Ň*{ ӧ_/f=ݼzچ#}r=j/;2=P8 -"k"0> Zp.Jid{kkKMGy鳶&JŰPKɋFnIPojvB*xܟ>{ CQO(_tc.//lF/..ޞyĜ-066P; Hmz2i_7,e[7LT@ l'z .X@BҒݵĻ4 377gszzXw̯vleb2XZmjաw ¤ {=991XZj`ggGɂaGȞwnx 7=lXg%VAa8DXЉ:mod-ž*i14. #硒E V ~@qb v͢M IDATxbL @@ ~e` Ab b b 0 ǀP,  ?Z)ܬQL `A"_v|r n?AFBmdDu0.?FS`.y/KB. v H& IlIENDB`fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark2/prev.png000066400000000000000000000071341230100576600274410ustar00rootroot00000000000000PNG  IHDR 6PtEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp IDATxb/b d1@ b#  ܬ€"0(? @1?#b01 o2"01|,`@) ,`d8Y#b %#0e ?C)pyژlsIENDB`fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-dark2/tips.png000066400000000000000000000110151230100576600274350ustar00rootroot00000000000000PNG  IHDR>tEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp cIDATxڬ B1p';q=?3>`@Ҫ7[f~B6!0HAwCd'#uL8Sðv3b:dwA>ffG 5 ?2Ѕ߿311+Rɼ$l]L*cpr53hH&v^!wAF( HGb )A_## M{a`782hȑ!inPA YkIIU`s؋g}@ @s Jj2_FգRr_s@@4+A TG(`n My#;fє7@ehMy7*Ѧ nv p2@G++A P}ZD`*(:iqZYU k5CQ1xf'$mZBfixp3{rVdVǜhmj9?q+P p(QUՇPGWV>3h]|I/I:"N/⤸:ZTTDPjbr48}hn%óz\>՗ 2Y&;GI)W꽧ǻq?_!53N,W|.9`Y;dyPxZ( (@<x@d#* ?dE # | # | (x, y) # | # | # | # | # V #说明2:输入面板主要有四个元素,分别为输入字符串(InputString),候选词(OutputCand),左翻页(BackArrow),右翻页(ForwardArrow) #默认的横向布局为(以5个候选词为例): # --------------------------------------------------------------------------- # | [InputString] [BackArrow] [ForwardArrow] | # | [OutputCand1] [OutputCand2] [OutputCand3] [OutputCand4] [OutputCand5] | # --------------------------------------------------------------------------- #默认的纵向布局为: # ------------------------------------------------- # | [InputString] [BackArrow] [ForwardArrow] | # | [OutputCand1] | # | [OutputCand2] | # | [OutputCand3] | # | [OutputCand4] | # | [OutputCand5] | # ------------------------------------------------- #说明3:所有文本或图片的配置坐标均以其左上角为准,所以,如果填写负数的话,需要考虑把文本或图片的宽和高预计在内 #说明4:因为整个输入面板的宽和高是动态变化的,其计算方法是: #高:四个元素InputString OutputCand BackArrow ForwardArrow中靠最下方的那个元素的bottom值 再 加上 MarginBottom 为整个面板的高度 #宽:四个元素InputString OutputCand BackArrow ForwardArrow中靠最右方的那个元素的right值 再 加上 MarginRight 为整个面板的宽度 #横向布局 [SkinInputBar] #输入时的背景图片 BackImg=input.png #切换时提示信息的背景图片 TipsImg=tips.png #九宫格的左边距 MarginLeft=18 #九宫格的右边距,必须为正数,表示离右边的距离 MarginRight=40 #九宫格的上边距 MarginTop=25 #九宫格的下边距,必须为正数,表示离下边的距离 MarginBottom=8 #输入字符串位置X坐标,为0则默认为MarginLeft,为负数则从最右边往左推进的距离 InputStringPosX=0 #输入字符串位置Y坐标,为0则默认为MarginTop,为负数则从最底边往上推进的距离 InputStringPosY=10 #输出候选词位置X坐标,为0则默认为MarginLeft,为负数则从最右边往左推进的距离 OutputCandPosX=0 #输出候选词位置Y坐标,为0则默认为(MarginTop + 输入字符串的高度),为负数则从最底边往上推进的距离 OutputCandPosY=34 #左翻页图片 BackArrow=prev.png #左翻页图片位置X坐标,为0则默认为从最右边往左推进的(左翻页图片宽度 + 右翻页图片宽度 + 15)的距离,为负数则从最右边往左推进的距离 BackArrowX=0 #左翻页图片位置Y坐标,为0则默认为InputStringPosY,为负数则从最底边往上推进的距离 BackArrowY=0 #右翻页图片 ForwardArrow=next.png #右翻页图片位置X坐标,为0则默认为从最右边往左推进的(右翻页图片宽度 + 10)的距离,为负数则从最右边往左推进的距离 ForwardArrowX=0 #右翻页图片位置Y坐标,为0则默认为InputStringPosY,为负数则从最底边往上推进的距离 ForwardArrowY=0 #================================================== #以下字段在qim-panel暂时没用到,仅为了兼容fcitx #因为默认启动fcitx时,会检查皮肤文件是否正确,如果没有下面这些字段, #那么检查结果为错误,导致把皮肤退回为default,导致再启动qim-panel就 #使用的也是default了。 InputPos=0 OutputPos=30 BackArrowX=20 BackArrowY=6 ForwardArrowX=10 ForwardArrowY=6 CursorColor=255 255 255 #================================================== #纵向布局 #说明:如果和横向布局的配置一致,纵向布局里可以不用重复设置 #比如横向布局里的FontSize为16,如果纵向布局里的FontSize也是16,那么可以不配置该字段或配置该字段为0 [SkinFontVertical] [SkinInputBarVertical] #面板宽度调节,可正可负 AdjustWidth=10 #面板高度调节,可正可负 AdjustHeight=-30 BackImg=input_v.png MarginTop=36 MarginBottom=48 fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-light1/input.png000066400000000000000000000221241230100576600300050ustar00rootroot00000000000000PNG  IHDR@L9tEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp IDATxbd fba T, 2"Cw200=?o?~2RnC C T33$# җ0< ] ˱vʼ̷ \g0u``zlr)[Xe`P7c IH @@Ӏ.Bl8YX~ N2d' ܼ ݇~`Z@() $ XU$X~ [Fo`CI`";bb`]VX5sv66>~2H'!{2?}{@%nS߿Rڦ&pY_`%0.&poiq (k@ l .#$;`9tw@pW\͙ ?>d%1AZ^p=|8ޙ œ B3.La tW˂h_ /Bxӯ|\gPQf߶,cm A1 /2p48"0Wߣw?kMdx GAoիk60vӸ$jLL$E=hxQBZz+h)ЃBђC *DꡂP ƃTAifvf6 UM=<{o6Ӱچ0v>BϪ+3&P/?mU-F7f;prtH?(FU3! :S\!j! u nN=.A`:As&`.!5?\b`Ӥ4}%ޫe$v?&zO В]E> nRa Ajхa|eal߮>TXSO3 .H̉Rx/%[dbO$# 4Gq{wtJ򭇨(aEP " B,|Q/J=D Pa6s}]fAAs{_>~|9?-J9憹4KU \sq14:N|wp# W U>k :P@״O1@5 q]V\+eL`A}C'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Zcwv9N $,9D5A$4\YMjV{Gh@gCj.F^9#B \7zeai5jp6H:WT CB#A @덂Q@q >zpAW2А(nHX֣$4hI~>O*jv̄ 3n] &?HiB Xo: $Ԅ4s(%^IT ;:!ҹ4 `۵A8GÞ(I8d 1^ uG#ZapCU(J&{wpΜ$rрʩb.~2 Ĭ #n"i] q^-nc1u؀e"*Rg8rN)6YEL0 HQN#f8-<0|v2{$XNv!Cf"`soGp1e"*,5ks2ƈEESTQ^6J|@t7!ưt>'5wXt:D%xr뚪\ V)_IHBydž܍=D'O#sF@oGjvۖV'dfd|,$FN"0`f}0Bb CЯBHuZB|pif= ߓIyp:2b~RH l.'`7RoLYLA2ypzt4|mVZ"pʇaga/!cAMNyu D YM0l+m$f=qߋ=hxh)L?=FBK-++ #Ȝ &GQ#_n$9޿  `3A,R#9eVf,A S$  Ct1©LX0/1λC,(!7.;ԉcq <-Aa脦h, PBoCi=G^dʓmґpJY֝P&TA-u1 >/[*qVL11s/ݕ )l27?2; !@2 .`ÃoiY*XLA`GcUpM<6 g _E)80R($'s!e>gF-*`%͑ [oDa,׹\h03ψoejp]=qU`f8Z\*\+qא9GyX#wZZ%G4_QAy]> ObQ{1 3~cҏ<]yzSȆGˡ-qh1Xۚy1ԓ,,D J !#5nm<̢<b iݻ]lP v(b){7u)7;w}>>>>< vi_ ]H3 ҕƆfc yץ΍[e @LEe]s .WOaUPh,s$I~R3?PPP-]@zi|!y;/ldp q %tDؿWzzz ~W*i%Qbp#s"Z\wof5/_>C/_4gH0dX꫰$d$u@X0h@dsS-Wz(IENDB`fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-light1/next.png000066400000000000000000000073351230100576600276330ustar00rootroot00000000000000PNG  IHDR 6PtEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp 3IDATxb`׍..@ /f`@1@1 2IDATxbx?bxd1Ϲ?@1X/@/?e`~Ͽ' ?mV`ufdPv& WIDATxڬQ vv /EҾaw~*[ttqs^y^wqI`q(3:]kFb0`tF5}]=UI7`@6մXJY`5fhK̖Gm6"Yc ~`myG)b@__|N!-zX(?5ca:m'P +0^\;q68bb$i(dKVOmDŽMg´kػK4@8eo[\GsL[d(&?o!*V$`#` 0 -Ã"B2^@\J!OmGK wWU=`mWc{BT <-@tn!ц m1,əQn-B2 eYJ圊t!`Np!%gna}%;g@Ὁ1heMM|_wq>U" Bvٽ=/d/C Ǖ373&$ ^|=P^@H{Mx*qY.uM wl6NW2+`vLੌq=zA ysEτO_$}0]Q_A6nofa5:o SISk60RغBNHaL"X+1%D">iEAR`F Dkxc`zcY`j{m R86-"0khV&rRDP3') թL"BN:8u?=05:VzL蜜o݉b`n_)HxZ~M&[_ Ao'+4&Gz|sZ-k7klMxάC7W?ƻYE6DaZb\nŐ.} ,Ǖ" > >@-$ hd9s{vnsf~9̹sQ+x`M>Ț$ 6# ,7. {^n?o6y>ShYd22?G)SHgPH>k >>(IyaAje6{TPe\lmDj^o̤w} '?(o <$x=t%]Xk[#O 1*zo @H8@~֮M !(ߗP ldB1k@r>YI@]YF*nf T T@Wq/ۤ`!ą\Ϻmҁ}@~P( ^!X C" p4٠+bH IΪ#P MaH 6&bQrF1KIHPNBs)B1R0I 6$mc3`@ʧ`6u` Ձ`lfis#Z첐)YmNpFK$_TRm4̘]O')$m" BÑ;qX̨`2nl3=::zWå19-ZɛP ժנws0s o8&D vo*9?χZ]skV~hb#(?;?."ܱPOSnBuE$@KEY7U.ZZ{&IENDB`fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-light2/000077500000000000000000000000001230100576600261405ustar00rootroot00000000000000fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-light2/fcitx_skin.conf000066400000000000000000000140271230100576600311540ustar00rootroot00000000000000#备注:此皮肤conf文件作为范本,包含有各个字段的详细说明。 # --- By Lenky 2013-9-12 [SkinInfo] #名词 Name=ubuntukylin-light2 #版本 Version=0.1 #作者 Author=Ou Yangyu #描述 Desc=ubuntukylin-light2 [SkinFont] #输入字符串的字体大小,以points为单位计算 FontSize=13 #候选词前的数字标号和候选词的字体大小,以points为单位计算 CandFontSize=13 #输入字符串的字体颜色,按RGB的十进制计算,比如#1a9bff则为:十六进制1a为十进制25,十六进制9b为十进制155,十六进制ff为十进制255 InputColor=17 80 131 #候选词前的数字标号的字体颜色 IndexColor=3 0 0 #首选候选词的字体颜色 FirstCandColor=17 80 131 #其他候选词的字体颜色 OtherColor=3 0 0 #================================================== #以下字段在qim-panel暂时没用到,仅为了兼容fcitx #因为默认启动fcitx时,会检查皮肤文件是否正确,如果没有下面这些字段, #那么检查结果为错误,导致把皮肤退回为default,导致再启动qim-panel就 #使用的也是default了。 TipColor=162 181 255 UserPhraseColor=255 255 143 CodeColor=17 80 131 ActiveMenuColor=255 255 255 InactiveMenuColor=178 178 178 [SkinMainBar] BackImg=bar.png Logo=logo.png Eng=en.png Active=cn.png MarginLeft=8 MarginRight=8 MarginTop=8 MarginBottom=8 [SkinTrayIcon] Active=active.png Inactive=inactive.png [SkinMenu] BackImg=menu.png MarginLeft=8 MarginRight=8 MarginTop=8 MarginBottom=8 ActiveColor=50 87 244 LineColor=204 204 204 [SkinKeyboard] # Virtual Keyboard Image BackImg=keyboard.png # Key Color On Virutal Keyboard KeyColor=101 153 209 #以上字段在qim-panel暂时没用,仅为了兼容fcitx #================================================== #说明1:以下几个坐标以均以整个面板的左上角为原点(0, 0) # (0, 0) # -----------------------------------> # | # | (x, y) # | # | # | # | # V #说明2:输入面板主要有四个元素,分别为输入字符串(InputString),候选词(OutputCand),左翻页(BackArrow),右翻页(ForwardArrow) #默认的横向布局为(以5个候选词为例): # --------------------------------------------------------------------------- # | [InputString] [BackArrow] [ForwardArrow] | # | [OutputCand1] [OutputCand2] [OutputCand3] [OutputCand4] [OutputCand5] | # --------------------------------------------------------------------------- #默认的纵向布局为: # ------------------------------------------------- # | [InputString] [BackArrow] [ForwardArrow] | # | [OutputCand1] | # | [OutputCand2] | # | [OutputCand3] | # | [OutputCand4] | # | [OutputCand5] | # ------------------------------------------------- #说明3:所有文本或图片的配置坐标均以其左上角为准,所以,如果填写负数的话,需要考虑把文本或图片的宽和高预计在内 #说明4:因为整个输入面板的宽和高是动态变化的,其计算方法是: #高:四个元素InputString OutputCand BackArrow ForwardArrow中靠最下方的那个元素的bottom值 再 加上 MarginBottom 为整个面板的高度 #宽:四个元素InputString OutputCand BackArrow ForwardArrow中靠最右方的那个元素的right值 再 加上 MarginRight 为整个面板的宽度 #横向布局 [SkinInputBar] #输入时的背景图片 BackImg=input.png #切换时提示信息的背景图片 TipsImg=tips.png #九宫格的左边距 MarginLeft=18 #九宫格的右边距,必须为正数,表示离右边的距离 MarginRight=40 #九宫格的上边距 MarginTop=25 #九宫格的下边距,必须为正数,表示离下边的距离 MarginBottom=8 #输入字符串位置X坐标,为0则默认为MarginLeft,为负数则从最右边往左推进的距离 InputStringPosX=0 #输入字符串位置Y坐标,为0则默认为MarginTop,为负数则从最底边往上推进的距离 InputStringPosY=10 #输出候选词位置X坐标,为0则默认为MarginLeft,为负数则从最右边往左推进的距离 OutputCandPosX=0 #输出候选词位置Y坐标,为0则默认为(MarginTop + 输入字符串的高度),为负数则从最底边往上推进的距离 OutputCandPosY=34 #左翻页图片 BackArrow=prev.png #左翻页图片位置X坐标,为0则默认为从最右边往左推进的(左翻页图片宽度 + 右翻页图片宽度 + 15)的距离,为负数则从最右边往左推进的距离 BackArrowX=0 #左翻页图片位置Y坐标,为0则默认为InputStringPosY,为负数则从最底边往上推进的距离 BackArrowY=0 #右翻页图片 ForwardArrow=next.png #右翻页图片位置X坐标,为0则默认为从最右边往左推进的(右翻页图片宽度 + 10)的距离,为负数则从最右边往左推进的距离 ForwardArrowX=0 #右翻页图片位置Y坐标,为0则默认为InputStringPosY,为负数则从最底边往上推进的距离 ForwardArrowY=0 #================================================== #以下字段在qim-panel暂时没用到,仅为了兼容fcitx #因为默认启动fcitx时,会检查皮肤文件是否正确,如果没有下面这些字段, #那么检查结果为错误,导致把皮肤退回为default,导致再启动qim-panel就 #使用的也是default了。 InputPos=0 OutputPos=30 BackArrowX=20 BackArrowY=6 ForwardArrowX=10 ForwardArrowY=6 CursorColor=255 255 255 #================================================== #纵向布局 #说明:如果和横向布局的配置一致,纵向布局里可以不用重复设置 #比如横向布局里的FontSize为16,如果纵向布局里的FontSize也是16,那么可以不配置该字段或配置该字段为0 [SkinFontVertical] [SkinInputBarVertical] #面板宽度调节,可正可负 AdjustWidth=10 #面板高度调节,可正可负 AdjustHeight=-30 BackImg=input_v.png MarginTop=36 MarginBottom=48 fcitx-qimpanel-fcitx-qimpanel-0.1.5/uk-default-skin/ubuntukylin-light2/input.png000066400000000000000000000205551230100576600300140ustar00rootroot00000000000000PNG  IHDR@L9tEXtSoftwareAdobe ImageReadyqe< @iTXtXML:com.adobe.xmp IDATxڬ @Eo6"AQ!ؤQolR D"3}DX)&w:^XҚ%:6m !IvQ),A*Ԏ ژ"1PUb6'] ( .z[WY~EvX\$ovr|HYGL`[nÈ_U|x IH i@a!6F\,,~'rx!!Jw~`I[Th ?+ /8@A1 n[";'@3(Ɉsov66>eho>z| hPl6Ec~65(}˚_Aax$L7( 8}) efp qxcfSg/_>VS^Q ?2pq2vX;AANAIVg }a@P{bP(~d fzꚸ-@f'a O[BMЪD ADr{$h0"*R `uf'i6_7UMH?q՜Cf0zo~cAѸ3M3M[^E"Ut9H~j Hq :σ}4FCfsy ' &}_QT0L|i f Oo?dT`SLꓺsp$Rݽ02b >%4Mb+ |z:n]ށh0BAH'PkkQ=7JQ 8w&XPTL7Tjkǂ4"|5`uw~U 'kE`ƚٽS.ȺՆو$v7(l? } j&, ޅJ|E]{xIT~:=bz`Er 4D/l6'&`gr#TZ$]bO5ߤ XeTc '3 ['fjMغuJ\ec-G[ćt%PO{w_'vĴaT:zsCR(Q4Q\.?(^S-I1kd'z: /,c5p 'n]IzpCQgwG2#E8ita@.6?[FCXn$)c}31T4 "<G{C\[Qصl* a}$jC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