diff options
Diffstat (limited to 'kde2/klipsi')
-rw-r--r-- | kde2/klipsi/.cvsignore | 11 | ||||
-rw-r--r-- | kde2/klipsi/Makefile.am | 44 | ||||
-rw-r--r-- | kde2/klipsi/eventsrc | 20 | ||||
-rw-r--r-- | kde2/klipsi/hi16-app-klipsi.png | bin | 650 -> 0 bytes | |||
-rw-r--r-- | kde2/klipsi/hi22-action-klipsi.png | bin | 1072 -> 0 bytes | |||
-rw-r--r-- | kde2/klipsi/hi22-action-klipsi_c.png | bin | 1042 -> 0 bytes | |||
-rw-r--r-- | kde2/klipsi/hi22-action-klipsi_cd.png | bin | 1051 -> 0 bytes | |||
-rw-r--r-- | kde2/klipsi/hi22-action-klipsi_d.png | bin | 1072 -> 0 bytes | |||
-rw-r--r-- | kde2/klipsi/hi22-app-klipsi.png | bin | 1072 -> 0 bytes | |||
-rw-r--r-- | kde2/klipsi/hi32-app-klipsi.png | bin | 1645 -> 0 bytes | |||
-rw-r--r-- | kde2/klipsi/klipsi.desktop | 8 | ||||
-rw-r--r-- | kde2/klipsi/main.cpp | 73 | ||||
-rw-r--r-- | kde2/klipsi/toplevel.cpp | 622 | ||||
-rw-r--r-- | kde2/klipsi/toplevel.h | 114 |
14 files changed, 0 insertions, 892 deletions
diff --git a/kde2/klipsi/.cvsignore b/kde2/klipsi/.cvsignore deleted file mode 100644 index 7bc9705..0000000 --- a/kde2/klipsi/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -Makefile.in -Makefile -.xvpics -.libs -.deps -*.lo -*.la -*.moc.cpp -klipsi_la_meta_unload.cpp -dummy.cpp -klipsi diff --git a/kde2/klipsi/Makefile.am b/kde2/klipsi/Makefile.am deleted file mode 100644 index 0dbb470..0000000 --- a/kde2/klipsi/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -libdir=$(kde_libraries) - -bindir=$(kde_bindir) - -maintainer-clean-local: - rm -f Makefile.in - -METASOURCES = AUTO - -KDE_ICON = AUTO - -INCLUDES = $(all_includes) -I$(top_srcdir)/lib - -DISTCLEANFILES = $(klipsi_METASOURCES) ./.deps/* ./.deps/.P - -bin_PROGRAMS = klipsi -lib_LTLIBRARIES = klipsi.la - -CLEANFILES = dummy.cpp - -klipsi_la_LIBADD = $(LIB_PLP) $(LIB_KDEUI) -klipsi_la_SOURCES = main.cpp toplevel.cpp -klipsi_la_LDFLAGS = $(PLP_LDFLAGS) $(KDE_LDFLAGS) $(LIBDEBUG) -module - -klipsi_LDADD = klipsi.la -klipsi_SOURCES = dummy.cpp -klipsi_LDFLAGS = $(KDE_RPATH) - - -applnkdir = $(kde_appsdir)/Utilities -applnk_DATA = klipsi.desktop -EXTRA_DIST = $(applnk_DATA) - -appsdir = $(kde_datadir)/klipsi -apps_DATA = eventsrc -EXTRA_DIST += $(apps_DATA) - -noinst_HEADERS = toplevel.h - -messages: - $(XGETTEXT) -C -ki18n -kI18N_NOOP -ktranslate -kaliasLocale *.cpp *.h && mv messages.po ../po/klipsi.pot - -dummy.cpp: - : > dummy.cpp diff --git a/kde2/klipsi/eventsrc b/kde2/klipsi/eventsrc deleted file mode 100644 index 8d0cc4c..0000000 --- a/kde2/klipsi/eventsrc +++ /dev/null @@ -1,20 +0,0 @@ -[!Global!] -IconName=klipsi -Comment=Klipsi - Psion clipboard -Comment[de]=Klipsi - Psion Zwischenablage - -[data received] -Name=New data -Name[de]=Neue Daten -Comment=The Psion has sent new data to the clipboard. -Comment[de]=Neue Daten wurden vom Psion in die Zwischenablage abgelegt. -default_presentation=1 -default_sound=KDE_Beep_ShortBeep.wav - -[connected] -Name=Connected -Name[de]=Verbunden -Comment=Klipsi has connected to the Psion -Comment[de]=Klipsi hat eine Verbindung zum Psion hergestellt. -default_presentation=1 -default_sound=KDE_Beep_Connect.wav diff --git a/kde2/klipsi/hi16-app-klipsi.png b/kde2/klipsi/hi16-app-klipsi.png Binary files differdeleted file mode 100644 index d9dda38..0000000 --- a/kde2/klipsi/hi16-app-klipsi.png +++ /dev/null diff --git a/kde2/klipsi/hi22-action-klipsi.png b/kde2/klipsi/hi22-action-klipsi.png Binary files differdeleted file mode 100644 index 3dc95c9..0000000 --- a/kde2/klipsi/hi22-action-klipsi.png +++ /dev/null diff --git a/kde2/klipsi/hi22-action-klipsi_c.png b/kde2/klipsi/hi22-action-klipsi_c.png Binary files differdeleted file mode 100644 index 5b4dca5..0000000 --- a/kde2/klipsi/hi22-action-klipsi_c.png +++ /dev/null diff --git a/kde2/klipsi/hi22-action-klipsi_cd.png b/kde2/klipsi/hi22-action-klipsi_cd.png Binary files differdeleted file mode 100644 index 8acac44..0000000 --- a/kde2/klipsi/hi22-action-klipsi_cd.png +++ /dev/null diff --git a/kde2/klipsi/hi22-action-klipsi_d.png b/kde2/klipsi/hi22-action-klipsi_d.png Binary files differdeleted file mode 100644 index b0d68ab..0000000 --- a/kde2/klipsi/hi22-action-klipsi_d.png +++ /dev/null diff --git a/kde2/klipsi/hi22-app-klipsi.png b/kde2/klipsi/hi22-app-klipsi.png Binary files differdeleted file mode 100644 index 3dc95c9..0000000 --- a/kde2/klipsi/hi22-app-klipsi.png +++ /dev/null diff --git a/kde2/klipsi/hi32-app-klipsi.png b/kde2/klipsi/hi32-app-klipsi.png Binary files differdeleted file mode 100644 index 464ad6b..0000000 --- a/kde2/klipsi/hi32-app-klipsi.png +++ /dev/null diff --git a/kde2/klipsi/klipsi.desktop b/kde2/klipsi/klipsi.desktop deleted file mode 100644 index 38a1153..0000000 --- a/kde2/klipsi/klipsi.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Psion Clipboard Utility -Name[de]=Auschneiden/Einfügen: Psion -Exec=klipsi -Icon=klipsi -Type=Application -DocPath=klipsi/index.html -Terminal=0 diff --git a/kde2/klipsi/main.cpp b/kde2/klipsi/main.cpp deleted file mode 100644 index f252759..0000000 --- a/kde2/klipsi/main.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/*-*-c++-*- - * $Id$ - * - * This file is part of plptools. - * - * Copyright (C) 1999-2001 Fritz Elfert <felfert@to.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; 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "toplevel.h" - -#include <stdio.h> -#include <stdlib.h> - -#include <klocale.h> -#include <kcmdlineargs.h> -#include <kwin.h> -#include <kaboutdata.h> -#include <kuniqueapplication.h> - -int main(int argc, char *argv[]) -{ - KAboutData about("klipsi", I18N_NOOP("Klipsi"), VERSION, - I18N_NOOP("Psion remote clipboard utility"), - KAboutData::License_GPL, - "(C) 2001 Fritz Elfert", - "Klipsi is part of plptools", - "http://plptools.sourceforge.net", - "plptools-developers@sourceforge.net"); - - about.addAuthor("Fritz Elfert", I18N_NOOP("Original Developer/Maintainer"), - "felfert@users.sourceforge.net"); - - KCmdLineArgs::init(argc, argv, &about); - KUniqueApplication::addCmdLineOptions(); - - if (!KUniqueApplication::start()) { - fprintf(stderr, "%s is already running!\n", about.appName()); - exit(0); - } - KUniqueApplication app; - - TopLevel *toplevel = new TopLevel(); - - if (toplevel->isNotSupported()) - app.quit(); - else { - KWin::setSystemTrayWindowFor(toplevel->winId(), 0); - toplevel->setGeometry(-100, -100, 42, 42 ); - toplevel->show(); - - return app.exec(); - } - return 0; -} -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/kde2/klipsi/toplevel.cpp b/kde2/klipsi/toplevel.cpp deleted file mode 100644 index ebbd8ce..0000000 --- a/kde2/klipsi/toplevel.cpp +++ /dev/null @@ -1,622 +0,0 @@ -/*-*-c++-*- - * $Id$ - * - * This file is part of plptools. - * - * Copyright (C) 1999-2001 Fritz Elfert <felfert@to.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; 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "toplevel.h" - -#include <qclipboard.h> -#include <qmenudata.h> -#include <qpainter.h> -#include <qtimer.h> -#include <qimage.h> -#include <qcursor.h> - -#include <kaction.h> -#include <kapplication.h> -#include <klocale.h> -#include <kwin.h> -#include <kiconloader.h> -#include <knotifyclient.h> -#include <kdebug.h> -#include <kmessagebox.h> - -#include <psibitmap.h> - -#include <cstdlib> -#include <iostream> - -#define QUIT_ITEM 50 -#define ABOUT_ITEM 51 -#define CLIPFILE "C:/System/Data/Clpboard.cbd" - -using namespace std; - -TopLevel::TopLevel() - : KMainWindow(0) -{ - KNotifyClient::startDaemon(); - - clip = kapp->clipboard(); -#if QT_VERSION > 300 - clip->setSelectionMode(true); -#endif - menu = new KPopupMenu(0, "main_menu"); - timer = new QTimer(); - - rfsvSocket = 0; - rclipSocket = 0; - rf = 0; - rc = 0; - rff = 0; - inSend = false; - inSetting = false; - mustListen = true; - lastClipData = ""; - state = ENABLED; - constate = DISCONNECTED; - sockNum = DPORT; - - struct servent *se = getservbyname("psion", "tcp"); - endservent(); - if (se != 0L) - sockNum = ntohs(se->s_port); - - menu->insertTitle(kapp->miniIcon(), i18n("Klipsi - Psion Clipboard")); - menu->insertSeparator(); - menu->insertItem(SmallIcon("help"), i18n("&About Klipsi"), ABOUT_ITEM); - menu->insertItem(SmallIcon("exit"), i18n("&Quit"), QUIT_ITEM); - - about = new KAboutApplication(0L, 0L, false); - connect(menu, SIGNAL(activated(int)), this, SLOT(slotMenuSelected(int))); - connect(clip, SIGNAL(dataChanged()), this, SLOT(slotClipboardChanged())); - connect(timer, SIGNAL(timeout()), this, SLOT(slotTimer())); - - icons[ENABLED][DISCONNECTED] = - KGlobal::iconLoader()->loadIcon("klipsi", KIcon::Toolbar); - icons[ENABLED][CONNECTED] = - KGlobal::iconLoader()->loadIcon("klipsi_c", KIcon::Toolbar); - icons[DISABLED][DISCONNECTED] = - KGlobal::iconLoader()->loadIcon("klipsi_d", KIcon::Toolbar); - icons[DISABLED][CONNECTED] = - KGlobal::iconLoader()->loadIcon("klipsi_cd", KIcon::Toolbar); - - icon = &icons[state][constate]; - resize(icon->size()); - - setBackgroundMode(X11ParentRelative); - - int interval = checkConnection() ? 500 : 5000; - if (timer) - timer->start(interval, true); -} - -TopLevel::~TopLevel() -{ - closeConnection(); - if (timer) - delete timer; - delete menu; -} - -bool TopLevel:: -isNotSupported() { - return (timer == NULL); -} - -void TopLevel:: -closeConnection() { - if (rf) - delete(rf); - if (rc) - delete(rc); - if (rff) - delete rff; - rfsvSocket = 0; - rclipSocket = 0; - rf = 0; - rc = 0; - rff = 0; - mustListen = true; - constate = DISCONNECTED; - repaint(); -} - -void TopLevel:: -mousePressEvent(QMouseEvent *e) -{ - if (e->button() == RightButton) - showPopupMenu(menu); - if (e->button() == LeftButton) { - state = (state == ENABLED) ? DISABLED : ENABLED; - repaint(); - } -} - -void TopLevel:: -paintEvent(QPaintEvent *) -{ - QPainter p(this); - icon = &icons[state][constate]; - - int x = (width() - icon->width()) / 2; - int y = (height() - icon->height()) / 2; - if ( x < 0 ) x = 0; - if ( y < 0 ) y = 0; - p.drawPixmap(x , y, *icon); - p.end(); -} - -void TopLevel:: -slotTimer() -{ - Enum<rfsv::errs> res; - - if (inSend) { - timer->start(500, true); - return; - } - - if (!checkConnection()) { - if (timer) - timer->start(5000, true); - else - kapp->quit(); - return; - } - - if (state == DISABLED) { - timer->start(500, true); - return; - } - - if (mustListen) { - res = rc->sendListen(); - if (res != rfsv::E_PSI_GEN_NONE) { - closeConnection(); - timer->start(5000, true); - return; - } else - mustListen = false; - } - - if ((res = rc->checkNotify()) != rfsv::E_PSI_GEN_NONE) { - if (res != rfsv::E_PSI_FILE_EOF) { - closeConnection(); - timer->start(5000, true); - return; - } - } else { - getClipData(); - mustListen = true; - } - timer->start(500, true); -} - -void TopLevel:: -slotClipboardChanged() -{ - if (mustListen || inSetting || (state == DISABLED)) - return; - - Enum<rfsv::errs> res; - - if (!checkConnection()) - return; - - QImage clipImage = 0L; - QString clipText = clip->text(); - - if (clipText.isEmpty()) { - clipImage = clip->image(); - if (clipImage.isNull()) - return; - inSend = true; - mustListen = true; - putClipImage(clipImage); - } else { - if (clipText == lastClipData) - return; - lastClipData = clipText; - inSend = true; - mustListen = true; - char *p = strdup(clipText.latin1()); - ascii2PsiText(p, clipText.length()); - putClipText(p); - free(p); - } - - res = rc->notify(); - inSend = false; - - if (res != rfsv::E_PSI_GEN_NONE) - closeConnection(); -} - -void TopLevel:: -slotMenuSelected(int id) -{ - switch (id) { - case ABOUT_ITEM: - about->show(); - break; - case QUIT_ITEM: - kapp->quit(); - break; - } -} - - -void TopLevel:: -showPopupMenu(QPopupMenu *menu) -{ - ASSERT( menu != 0L ); - - // Update menu geometry - menu->move(-1000,-1000); - menu->show(); - menu->hide(); - - QPoint g = QCursor::pos(); - if ( menu->height() < g.y() ) - menu->popup(QPoint( g.x(), g.y() - menu->height())); - else - menu->popup(QPoint(g.x(), g.y())); -} - -void TopLevel:: -psiText2ascii(char *buf, int len) { - char *p; - - for (p = buf; len; len--, p++) - switch (*p) { - case 6: - case 7: - *p = '\n'; - break; - case 8: - *p = '\f'; - break; - case 10: - *p = '\t'; - break; - case 11: - case 12: - *p = '-'; - break; - case 15: - case 16: - *p = ' '; - break; - } -} - -void TopLevel:: -ascii2PsiText(char *buf, int len) { - char *p; - - for (p = buf; len; len--, p++) - switch (*p) { - case '\n': - *p = 6; - break; - case '\f': - *p = 8; - break; - case '-': - *p = 11; - break; - } -} - -void TopLevel:: -putClipText(char *data) { - Enum<rfsv::errs> res; - u_int32_t fh; - u_int32_t l; - const unsigned char *p; - bufferStore b; - - res = rf->freplacefile(0x200, CLIPFILE, fh); - if (res == rfsv::E_PSI_GEN_NONE) { - while ((res = rc->checkNotify()) != rfsv::E_PSI_GEN_NONE) { - if (res != rfsv::E_PSI_FILE_EOF) { - rf->fclose(fh); - closeConnection(); - return; - } - } - - // Base Header - b.addDWord(0x10000037); // @00 UID 0 - b.addDWord(0x1000003b); // @04 UID 1 - b.addDWord(0); // @08 UID 3 - b.addDWord(0x4739d53b); // @0c Checksum the above - - // Section Table - b.addDWord(0x00000014); // @10 Offset of Section Table - b.addByte(2); // @14 Section Table, length in DWords - b.addDWord(0x10000033); // @15 Section Type (ASCII) - b.addDWord(0x0000001d); // @19 Section Offset - - // Data - b.addDWord(strlen(data)); // @1e Section (String) length - b.addStringT(data); // @22 Data (Psion Word seems to need a - // terminating 0. - - p = (const unsigned char *)b.getString(0); - rf->fwrite(fh, p, b.getLen(), l); - rf->fclose(fh); - rf->fsetattr(CLIPFILE, 0x20, 0x07); - } else - closeConnection(); -} - -static QImage *putImage; - -static int -getGrayPixel(int x, int y) -{ - return qGray(putImage->pixel(x, y)); -} - -void TopLevel:: -putClipImage(QImage &img) { - Enum<rfsv::errs> res; - u_int32_t fh; - u_int32_t l; - const unsigned char *p; - bufferStore b; - - res = rf->freplacefile(0x200, CLIPFILE, fh); - if (res == rfsv::E_PSI_GEN_NONE) { - while ((res = rc->checkNotify()) != rfsv::E_PSI_GEN_NONE) { - if (res != rfsv::E_PSI_FILE_EOF) { - rf->fclose(fh); - closeConnection(); - return; - } - } - - // Base Header - b.addDWord(0x10000037); // @00 UID 0 - b.addDWord(0x1000003b); // @04 UID 1 - b.addDWord(0); // @08 UID 3 - b.addDWord(0x4739d53b); // @0c Checksum the above - - // Section Table - b.addDWord(0x00000014); // @10 Offset of Section Table - b.addByte(2); // @14 Section Table, length in DWords - b.addDWord(0x1000003d); // @15 Section Type (Image) - b.addDWord(0x0000001d); // @19 Section Offset - - // Data - bufferStore ib; - putImage = &img; - encodeBitmap(img.width(), img.height(), getGrayPixel, false, ib); - b.addBuff(ib); - - p = (const unsigned char *)b.getString(0); - rf->fwrite(fh, p, b.getLen(), l); - rf->fclose(fh); - rf->fsetattr(CLIPFILE, 0x20, 0x07); - } else - closeConnection(); -} - -QImage *TopLevel:: -decode_image(const unsigned char *p) -{ - bufferStore out; - bufferStore hout; - QImage *img = 0L; - int xPixels; - int yPixels; - - if (!decodeBitmap(p, xPixels, yPixels, out)) - return img; - - QString hdr = QString("P5\n%1 %2\n255\n").arg(xPixels).arg(yPixels); - hout.addString(hdr.latin1()); - hout.addBuff(out); - - img = new QImage(xPixels, yPixels, 8); - if (!img->loadFromData((const uchar *)hout.getString(0), hout.getLen())) { - delete img; - img = 0L; - } - return img; -} - -void TopLevel:: -getClipData() { - Enum<rfsv::errs> res; - PlpDirent de; - u_int32_t fh; - QString clipText; - QImage *clipImg = 0L; - - res = rf->fgeteattr(CLIPFILE, de); - if (res == rfsv::E_PSI_GEN_NONE) { - if (de.getAttr() & rfsv::PSI_A_ARCHIVE) { - u_int32_t len = de.getSize(); - char *buf = (char *)malloc(len); - - if (!buf) { - cerr << "Out of memory in getClipData" << endl; - return; - } - res = rf->fopen(rf->opMode(rfsv::PSI_O_RDONLY | rfsv::PSI_O_SHARE), - CLIPFILE, fh); - if (res == rfsv::E_PSI_GEN_NONE) { - u_int32_t tmp; - res = rf->fread(fh, (unsigned char *)buf, len, tmp); - rf->fclose(fh); - - if ((res == rfsv::E_PSI_GEN_NONE) && (tmp == len)) { - char *p = buf; - int lcount; - u_int32_t *ti = (u_int32_t*)buf; - - // Check base header - if (*ti++ != 0x10000037) { - free(buf); - return; - } - if (*ti++ != 0x1000003b) { - free(buf); - return; - } - if (*ti++ != 0) { - free(buf); - return; - } - if (*ti++ != 0x4739d53b) { - free(buf); - return; - } - - // Start of section table - p = buf + *ti; - // Length of section table (in DWords) - lcount = *p++; - - u_int32_t *td = (u_int32_t*)p; - while (lcount > 0) { - u_int32_t sType = *td++; - if (sType == 0x10000033) { - // An ASCII section - p = buf + *td; - len = *((u_int32_t*)p); - p += 4; - psiText2ascii(p, len); - clipText += (char *)p; - } - if (sType == 0x1000003d) { - // A paint data section - p = buf + *td; - if (clipImg) - delete clipImg; - clipImg = decode_image((const unsigned char *)p); - } - td++; - lcount -= 2; - } - } - - } else - closeConnection(); - free(buf); - } - } else - closeConnection(); - - if (!clipText.isEmpty()) { - inSetting = true; - clip->setText(clipText); - inSetting = false; - KNotifyClient::event("data received"); - } else if (clipImg) { - inSetting = true; - clip->setImage(*clipImg); - inSetting = false; - KNotifyClient::event("data received"); - } -} - -bool TopLevel:: -checkConnection() { - if (rf && rc) - return true; - - if (!rfsvSocket) { - rfsvSocket = new ppsocket(); - if (!rfsvSocket->connect(NULL, sockNum)) { - delete rfsvSocket; - rfsvSocket = 0; - return false; - } - } - - if (!rclipSocket) { - rclipSocket = new ppsocket(); - if (!rclipSocket->connect(NULL, sockNum)) { - delete rclipSocket; - rclipSocket = 0; - return false; - } - } - - if (!rff) - rff = new rfsvfactory(rfsvSocket); - - if (!rf) - rf = rff->create(true); - - if (rf) { - if (rf->getProtocolVersion() == 3) { - closeConnection(); - delete timer; - timer = NULL; - KMessageBox::error(NULL, i18n( - "<QT>Your Psion is reported to be a <B>Series 3</B> " - "machine. This type of machine does <B>not support</B> the " - "remote clipboard protocol; Sorry.<BR/>" - "<B>Klipsi</B> will now terminate.</QT>"), - i18n("Protocol not supported")); - return false; - } - if (!rc) { - rc = new rclip(rclipSocket); - Enum<rfsv::errs> ret; - - if ((ret = rc->initClipbd()) == rfsv::E_PSI_GEN_NONE) { - KNotifyClient::event("connected"); - constate = CONNECTED; - repaint(); - return true; - } else { - closeConnection(); - if (ret == rfsv::E_PSI_GEN_NSUP) { - KMessageBox::error(NULL, i18n( - "<QT>Your Psion does not support the remote clipboard " - "protocol.<BR/>The reason for that is usually a missing " - "server library on your Psion.<BR/>Make sure that " - "<B>C:\\System\\Libs\\clipsvr.rsy</B> exists.<BR/>" - "This file is part of PsiWin and usually gets copied " - "to your Psion when you enable CopyAnywhere in PsiWin. " - "You also get it from a PsiWin installation directory " - "and copy it to your Psion manually.<BR/>" - "<B>Klipsi</B> will now terminate.</QT>"), - i18n("Protocol not supported")); - delete timer; - timer = NULL; - } - } - } - } - return false; -} - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/kde2/klipsi/toplevel.h b/kde2/klipsi/toplevel.h deleted file mode 100644 index 3d013fd..0000000 --- a/kde2/klipsi/toplevel.h +++ /dev/null @@ -1,114 +0,0 @@ -/*-*-c++-*- - * $Id$ - * - * This file is part of plptools. - * - * Copyright (C) 1999 Philip Proudman <philip.proudman@btinternet.com> - * Copyright (C) 1999-2001 Fritz Elfert <felfert@to.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; 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef _TOPLEVEL_H_ -#define _TOPLEVEL_H_ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <kapplication.h> -#include <kmainwindow.h> -#include <kpopupmenu.h> -#include <kaboutapplication.h> -#include <qpixmap.h> -#include <qtimer.h> - -#include <rfsv.h> -#include <rfsvfactory.h> -#include <rclip.h> -#include <ppsocket.h> - -class QClipboard; - -class TopLevel : public KMainWindow -{ - Q_OBJECT - -public: - TopLevel(); - ~TopLevel(); - bool isNotSupported(); - -protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - -protected slots: - void showPopupMenu( QPopupMenu * ); - -private slots: - void slotClipboardChanged(); - void slotTimer(); - void slotMenuSelected(int); - -private: - enum { - ENABLED = 0, - DISABLED = 1, - } states; - - enum { - DISCONNECTED = 0, - CONNECTED = 1, - } constates; - - void psiText2ascii(char *, int); - void ascii2PsiText(char *, int); - void putClipText(char *); - void putClipImage(QImage &); - void getClipData(); - void closeConnection(); - bool checkConnection(); - QImage *decode_image(const unsigned char *); - - QClipboard *clip; - KPopupMenu *menu; - KAboutApplication *about; - QTimer *timer; - - ppsocket *rfsvSocket; - ppsocket *rclipSocket; - rfsv *rf; - rclip *rc; - rfsvfactory *rff; - - QString lastClipData; - QPixmap *icon; - QPixmap icons[2][2]; - bool inSend; - bool inSetting; - bool mustListen; - int state; - int constate; - int sockNum; -}; - -#endif - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ |