summaryrefslogtreecommitdiffstats
path: root/kruler
diff options
context:
space:
mode:
Diffstat (limited to 'kruler')
-rw-r--r--kruler/Makefile.am25
-rw-r--r--kruler/eventsrc192
-rw-r--r--kruler/klineal.cpp746
-rw-r--r--kruler/klineal.h106
-rw-r--r--kruler/kruler.desktop90
-rw-r--r--kruler/main.cpp48
-rw-r--r--kruler/move.wavbin0 -> 2656 bytes
-rw-r--r--kruler/pics/Makefile.am5
-rw-r--r--kruler/pics/hi16-app-kruler.pngbin0 -> 391 bytes
-rw-r--r--kruler/pics/hi22-app-kruler.pngbin0 -> 310 bytes
-rw-r--r--kruler/pics/hi32-app-kruler.pngbin0 -> 730 bytes
-rw-r--r--kruler/pics/hi48-app-kruler.pngbin0 -> 932 bytes
-rw-r--r--kruler/pics/kruler-east.pngbin0 -> 446 bytes
-rw-r--r--kruler/pics/kruler-north.pngbin0 -> 310 bytes
-rw-r--r--kruler/pics/kruler-south.pngbin0 -> 300 bytes
-rw-r--r--kruler/pics/kruler-west.pngbin0 -> 439 bytes
-rw-r--r--kruler/uninstall.desktop2
17 files changed, 1214 insertions, 0 deletions
diff --git a/kruler/Makefile.am b/kruler/Makefile.am
new file mode 100644
index 00000000..d2b8f278
--- /dev/null
+++ b/kruler/Makefile.am
@@ -0,0 +1,25 @@
+SUBDIRS = pics
+
+INCLUDES= $(all_includes)
+
+bin_PROGRAMS = kruler
+kruler_METASOURCES = AUTO
+kruler_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kruler_LDADD = $(LIB_KDEUI)
+kruler_SOURCES = klineal.cpp main.cpp
+
+xdg_apps_DATA = kruler.desktop
+
+install-data-local: uninstall.desktop
+ $(mkinstalldirs) $(DESTDIR)$(kde_appsdir)/Graphics
+ $(INSTALL_DATA) $(srcdir)/uninstall.desktop $(DESTDIR)$(kde_appsdir)/Graphics/kruler.desktop
+
+appdir = $(kde_datadir)/kruler
+app_DATA = eventsrc
+
+sounddir = $(kde_datadir)/kruler/sounds
+sound_DATA = move.wav
+
+messages:
+ $(XGETTEXT) $(kruler_SOURCES) -o $(podir)/kruler.pot
+
diff --git a/kruler/eventsrc b/kruler/eventsrc
new file mode 100644
index 00000000..5f178815
--- /dev/null
+++ b/kruler/eventsrc
@@ -0,0 +1,192 @@
+[!Global!]
+IconName=kruler
+Comment=KDE Screen Ruler
+Comment[af]=Kde Skerm Liniaal
+Comment[ar]=مسطرة شاشة KDE
+Comment[az]=KDE Ekran Xətkeşi
+Comment[bg]=Линийка за екрана
+Comment[bs]=KDE ekranski linijar
+Comment[ca]=Regla de pantalla KDE
+Comment[cs]=Obrazovkové pravítko
+Comment[cy]=Mesurydd Sgrîn KDE
+Comment[da]=KDE Skærmlineal
+Comment[de]=Bildschirmlineal
+Comment[el]=Χάρακας οθόνης του KDE
+Comment[eo]=Ekranliniilo
+Comment[es]=Regla para la pantalla de KDE
+Comment[et]=KDE ekraani joonlaud
+Comment[eu]=KDE pantaila erregela
+Comment[fa]=خط‌کش پردۀ KDE
+Comment[fi]=Näytön mittaaja
+Comment[fr]=Règle d'écran pour KDE
+Comment[ga]=Rialóir Scáileáin KDE
+Comment[gl]=Regra de pantalla de KDE
+Comment[he]=סרגל המסך של KDE
+Comment[hi]=केडीई स्क्रीन रूलर
+Comment[hr]=KDE ravnalo za ekran
+Comment[hu]=Képernyővonalzó
+Comment[is]=KDE Reglustikan
+Comment[it]=Righello dello schermo
+Comment[ja]=KDE スクリーン定規
+Comment[kk]=KDE экран өлшегіші
+Comment[km]=បន្ទាត់​អេក្រង់ KDE
+Comment[ko]=KDE용 화면 자
+Comment[lt]=KDE ekrano liniuotė
+Comment[lv]=KDE Ekrāna Mērjosla
+Comment[ms]=Pembaris Skrin KDE
+Comment[mt]=Riga tal-Iskrin KDE
+Comment[nb]=KDE skjermlinjal
+Comment[nds]=KDE-Schirmlineaal
+Comment[ne]=केडीई पर्दा रूलर
+Comment[nl]=KDE Schermliniaal
+Comment[nn]=KDE Skjermlinjal
+Comment[nso]=Molaodi wa Pontsho ya KDE
+Comment[pl]=Linijka ekranowa
+Comment[pt]=Régua do ecrã do KDE
+Comment[pt_BR]=Régua da Tela do KDE
+Comment[ro]=Riglă de ecran pentru KDE
+Comment[ru]=Экранная линейка KDE
+Comment[se]=KDE-šearbmalinjála
+Comment[sk]=KDE pravítko obrazovky
+Comment[sl]=Zaslonsko ravnilo KDE
+Comment[sr]=KDE-ов екрански лењир
+Comment[sr@Latn]=KDE-ov ekranski lenjir
+Comment[sv]=KDE:s skärmlinjal
+Comment[ta]=கேடிஇ திரைக்கான அளவுக்கோல்
+Comment[tg]=Ҷадвали экрании KDE
+Comment[th]=ไม้บรรทัดบนหน้าจอของ KDE
+Comment[tr]=KDE Ekran Cetveli
+Comment[uk]=Лінійка екрана KDE
+Comment[uz]=KDE ekran lineykasi
+Comment[uz@cyrillic]=KDE экран линейкаси
+Comment[ven]=Muvhusi wa tshikirini tsha KDE
+Comment[xh]=Umlawuli wekhusi le KDE
+Comment[zh_CN]=KDE 屏幕标尺
+Comment[zh_HK]=KDE 螢幕尺規
+Comment[zh_TW]=KDE 螢幕尺規
+Comment[zu]=Umlawuli Wesikrini se KDE
+
+[cursormove]
+Name=Moved by Cursor Keys
+Name[af]=Verskuif deur Plekaanduier Sleutels
+Name[ar]=تم تحريكها بمفاتيح الفأرة
+Name[az]=İstiqamət düymələri ilə hərəkət etdirildi
+Name[bg]=Преместване чрез клавиатурата
+Name[bs]=Pomjera se kursorskim tipkama
+Name[ca]=Mogut mitjançant les tecles de cursor
+Name[cs]=Přesunutý kurzorovými klávesami
+Name[cy]=Symudir gan y Bysellau Cyrchydd
+Name[da]=Flyttet med piletaster
+Name[de]=Durch Pfeiltasten verschoben
+Name[el]=Μετακινήθηκε από τα πλήκτρα κίνησης
+Name[eo]=Movata de la direktoklavoj
+Name[es]=Movido por las teclas del cursor
+Name[et]=Liigutati nooleklahve kasutades
+Name[eu]=Cursor Keys-ek mugitua
+Name[fa]=توسط کلیدهای مکان‌نما حرکت کرد
+Name[fi]=Siirrettiin kursorinäppäimillä
+Name[fr]=Déplacée par les touches fléchées
+Name[gl]=Mover coas teclas de cursor
+Name[he]=הזזה באמצעות מקשי החצים
+Name[hi]=संकेतक कुंजियों द्वारा खिसकता है
+Name[hr]=Pomaknuto tipkama za kretanje
+Name[hu]=A vonalzó elmozgatva a kurzorbillentyűkkel
+Name[is]=Fært með örvalyklum
+Name[it]=Spostato dai tasti cursore
+Name[ja]=カーソルキーで移動
+Name[kk]=Жебелі пернелерімен жылжыту
+Name[km]=បាន​ផ្លាស់ទី​ដោយ​គ្រាប់ចុច​ទស្សន៍​ទ្រនិច
+Name[ko]=방향 글쇠로 옮겼습니다
+Name[lt]=Judinama klaviatūros rodyklėmis
+Name[lv]=Pārvietots ar Kursora Taustiņiem
+Name[ms]=Dialih oleh Kekunci Kursor
+Name[mt]=Immexxi bil-buttuni tal-vleġeġ
+Name[nb]=Flyttet med piltaster
+Name[nds]=Mit Pieltasten verschaven
+Name[ne]=कर्सर कुञ्जीद्वारा सारिएको
+Name[nl]=Verplaatst met de cursortoetsen
+Name[nn]=Flytt med piltastane
+Name[nso]=Sutisa ke Ditobetswa tsa Cursor
+Name[pl]=Przesunięto klawiszami kursora
+Name[pt]=Movimentado com as Teclas de Cursor
+Name[pt_BR]=Movido pelas Teclas de Direção
+Name[ro]=Mutat cu tastele cursor
+Name[ru]=Передвижение стрелками
+Name[sk]=Presunutý kurzorovými klávesmi
+Name[sl]=Premaknjeno s smernimi tipkami
+Name[sr]=Померен курсорским тастерима
+Name[sr@Latn]=Pomeren kursorskim tasterima
+Name[sv]=Flyttade med piltangenteran
+Name[ta]=சுட்டி விசையால் நகர்த்தப்பட்டது
+Name[tg]=Ба ҳаракат даровардан бо аломати тира
+Name[th]=ย้ายด้วยปุ่มลูกศร
+Name[tr]=Yön tuşlarıyla hareket ettirildi
+Name[uk]=Пересунуто клавішами курсора
+Name[ven]=Tshimbidzhwa nga khii ya musevhe
+Name[xh]=Ishukunyiswa zizitshixo zesalathisi
+Name[zh_CN]=用光标键移动
+Name[zh_HK]=用游標鍵移動
+Name[zh_TW]=用游標鍵移動
+Name[zu]=Inyakaziswe Izikhiye Ze Cursor
+Comment=The ruler has moved pixelwise using the cursor keys
+Comment[af]=Die liniaal het verskuif beeldelement-gewys te gebruik Die plekaanduier sleutels
+Comment[ar]=تم تحريك المسطرة بكسليا باستخدام مفاتيح الفأرة
+Comment[az]=Cədvəl piksel piksel istiqamət düymələri ilə hərəkət etdirildi
+Comment[bg]=Преместване чрез клавиатурата
+Comment[bs]=Linijar se pomjera u pixelima koristeći kursorske tipke
+Comment[ca]=La regla s'ha mogut píxel a píxel usant les tecles de cursor
+Comment[cs]=Pravítko bylo kurzorovými klávesami posunuto o několik bodů
+Comment[cy]=Mae'r mesurydd wedi symud o safbwynt picseli wrth ddefnyddio'r bysellau cyrchydd
+Comment[da]=Linealen er flyttet en pixel af gangen med piletasterne
+Comment[de]=Das Lineal wurde durch die Pfeiltasten um einige Pixel verschoben
+Comment[el]=Ο χάρακας μετακινήθηκε pixelwise με τη χρήση των πλήκτρων κίνησης
+Comment[eo]=La liniilo estas movita popunkte uzante la direktoklavojn
+Comment[es]=La regla se ha movido entre los pixels usando las teclas del cursor
+Comment[et]=Joonlauda liigutati pikselhaaval nooleklahve kasutades
+Comment[eu]=Erregela mugitu da kurtsore teklek eragina
+Comment[fa]=خط‌کش با استفاده از کلیدهای مکان‌نما در جهت تصویردانه حرکت کرده است.
+Comment[fi]=Mittanauha on liikkunut pikseleitä käyttämällä kursorinäppäimiä
+Comment[fr]=La règle s'est déplacée sous l'action des touches fléchées
+Comment[gl]=A regra moverá o «pixelwise» empregando as teclas de cursor
+Comment[he]=הסרגל הוזז באמצעות מקשי החצים
+Comment[hi]=संकेतक कुंजियों की मदद से रूसर पिक्सलवाइज़ खिसका
+Comment[hr]=Ravnalo je pomaknuto pomoću tipki za kretanje
+Comment[hu]=A vonalzó elmozgatva képpontonként a kurzorbillentyűkkel
+Comment[is]=Reglustikan hefur verið færð um e-a punkta með örvalyklunum
+Comment[it]=Il righello è stato spostato usando i tasti cursore
+Comment[ja]=定規がカーソルキーによってピクセル単位で移動しました
+Comment[kk]=Өлшегіш жебелі пернелер көмегімен пикселдеп жылжиды
+Comment[km]=បន្ទាត់​ត្រូវ​បាន​ផ្លាស់ទី​តាម​ភីកសែល ដោយ​ប្រើ​គ្រាប់ចុច​ទស្សន៍​ទ្រនិច
+Comment[ko]=방향 글쇠로 자대를 옮겼습니다
+Comment[lt]=Liniuote buvo paslinkta kelis taškus naudojant klaviatūros rodykles.
+Comment[lv]=Mērjosla pārvietota pikseļavirzienā izmantojot kursora taustiņus.
+Comment[ms]= Pembaris telah mengalih ikut piksel menggunakan kekunci kursor
+Comment[mt]=Ir-riga mxiet b'tikka waħda permezz tal-buttuni vleġeġ
+Comment[nb]=Linjalen ble flyttet punktvis ved bruk av piltastene
+Comment[nds]=Dat Lineaal warrt mit de Pieltasten pixelwies verschaven
+Comment[ne]=कर्सर कुञ्जी प्रयोग गरेर रूलर पिक्सेलअनुसार सारियो
+Comment[nl]=De liniaal is enkele pixels verplaatst via de cursortoetsen
+Comment[nn]=Linjalen vert flytta piksel for piksel med piltastane
+Comment[nso]=Molaodi o tsamaile ka mokgwa wa pixelwise a somisa ditobetswa tsa cursor
+Comment[pl]=Linijka przesunięta o zadaną ilość pikseli używając klawiszy kursora
+Comment[pt]=A régua foi movida com as teclas de cursor
+Comment[pt_BR]=A régua foi movida usando as teclas de direção
+Comment[ro]=Rigla a fost mutată cîţiva pixeli cu tastele cursor
+Comment[ru]=Линейка сдвигается попиксельно с помощью стрелок.
+Comment[sk]=Pravítko bolo kurzorovými klávesmi posunuté o niekoľko bodov
+Comment[sl]=Ravnilo se je premaknilo po točkah z uporabo smernih tipk
+Comment[sr]=Лењир се померио за пиксел помоћу курсорских тастера
+Comment[sr@Latn]=Lenjir se pomerio za piksel pomoću kursorskih tastera
+Comment[sv]=Linjalen har flyttats bildpunktsvis med piltangenterna
+Comment[ta]=சுட்டி விசைகளை பயன்படுத்தி படத்துணுக்கு மூலமாக வரை உருளை நகர்த்தப்பட்டது
+Comment[tg]=Ҷадвал бо ёрии аломати тира, пикселнокӣ ҳаракат мекунад.
+Comment[tr]=Cetvel piksel piksel yön tuşlarıyla hareket ettirildi
+Comment[uk]=Лінійка пересувається по пікселях за допомогою клавіш курсора
+Comment[ven]=Muvhusi o sudzulusa pixelwise a tshi khou shumisa khii ya Cursor
+Comment[xh]=Umlawuli ushukume jikelele kwipixel esebenzisa izitshixi zesalathisi
+Comment[zh_CN]=标尺已经用光标键按像素移动
+Comment[zh_HK]=使用游標鍵移動尺規單一個像素
+Comment[zh_TW]=使用游標鍵移動尺規單一個像素
+Comment[zu]=Umlawuli unyakazise jikelele kwipixel esebenzisa izikhiye ze cursor
+default_sound=move.wav
+default_presentation=1
diff --git a/kruler/klineal.cpp b/kruler/klineal.cpp
new file mode 100644
index 00000000..8f03c68b
--- /dev/null
+++ b/kruler/klineal.cpp
@@ -0,0 +1,746 @@
+/***************************************************************************
+ klineal.cpp - description
+ -------------------
+ begin : Fri Oct 13 2000
+ copyright : (C) 2000 by Till Krech
+ email : till@snafu.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include <iostream>
+
+#include <kconfig.h>
+#include <kcursor.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <kiconloader.h>
+#include <kimageeffect.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <knotifyclient.h>
+#include <kpopupmenu.h>
+#include <kstandarddirs.h>
+#include <kwin.h>
+#include <kstdguiitem.h>
+
+#include <qbitmap.h>
+#include <qcursor.h>
+#include <qdialog.h>
+#include <qiconset.h>
+#include <qimage.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qwhatsthis.h>
+
+#include "klineal.h"
+
+#define CFG_KEY_BGCOLOR "BgColor"
+#define CFG_KEY_SCALE_FONT "ScaleFont"
+#define CFG_KEY_LENGTH "Length"
+#define CFG_GROUP_SETTINGS "StoredSettings"
+#define DEFAULT_RULER_COLOR QColor(255, 200, 80)
+#define FULLSCREENID 23
+/**
+* this is our cursor bitmap:
+* a line 48 pixels long with an arrow pointing down
+* and a sqare with a one pixel hole at the top (end)
+*/
+static const uchar cursorBits[] = {
+ 0x38, 0x28, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x10,
+};
+
+/**
+* create the thingy with no borders and set up
+* its members
+*/
+KLineal::KLineal(QWidget*parent,const char* name):KMainWindow(parent,name){
+ if (!name) {
+ name = "klineal";
+ }
+ mLenMenu=0;
+ KWin::setType(winId(), NET::Override); // or NET::Normal
+ KWin::setState(winId(), NET::StaysOnTop);
+ setPaletteBackgroundColor(black);
+ QWhatsThis::add(this,
+ i18n(
+ "This is a tool to measure pixel distances and colors on the screen. "
+ "It is useful for working on layouts of dialogs, web pages etc."
+ ));
+ QBitmap bim = QBitmap(QSize(8, 48), cursorBits);
+ QWMatrix m;
+ m.rotate(90.0);
+ mNorthCursor = QCursor(bim, bim, 3, 47);
+ bim = bim.xForm(m);
+ mEastCursor = QCursor(bim, bim, 0, 3);
+ bim = bim.xForm(m);
+ mSouthCursor = QCursor(bim, bim, 4, 0);
+ bim = bim.xForm(m);
+ mWestCursor = QCursor(bim, bim, 47, 4);
+
+ mCurrentCursor = mNorthCursor;
+ setMinimumSize(60,60);
+ setMaximumSize(8000,8000);
+ KConfig *cfg = kapp->config();
+ QColor defaultColor = DEFAULT_RULER_COLOR;
+ QFont defaultFont(KGlobalSettings::generalFont().family(), 8);
+ defaultFont.setPixelSize(8);
+ if (cfg) {
+ cfg->setGroup(CFG_GROUP_SETTINGS);
+ mColor = cfg->readColorEntry(CFG_KEY_BGCOLOR, &defaultColor);
+ mScaleFont = cfg->readFontEntry(CFG_KEY_SCALE_FONT, &defaultFont);
+ mLongEdgeLen = cfg->readNumEntry(CFG_KEY_LENGTH, 600);
+ } else {
+ mColor = defaultColor;
+ mScaleFont = defaultFont;
+ mLongEdgeLen = 400;
+ }
+ kdDebug() << "mLongEdgeLen=" << mLongEdgeLen << endl;
+ mShortEdgeLen = 70;
+
+ mLabel = new QLabel(this);
+ mLabel->setGeometry(0,height()-12,32,12);
+ mLabel->setBackgroundOrigin(ParentOrigin);
+ QFont labelFont(KGlobalSettings::generalFont().family(), 10);
+ labelFont.setPixelSize(10);
+ mLabel->setFont(labelFont);
+ QWhatsThis::add(mLabel,
+ i18n(
+ "This is the current distance measured in pixels."
+ ));
+ mColorLabel = new QLabel(this);
+ mColorLabel->resize(45,12);
+ mColorLabel->setPaletteBackgroundColor(mColor);
+ mColorLabel->hide();
+ QFont colorFont(KGlobalSettings::fixedFont().family(), 10);
+ colorFont.setPixelSize(10);
+ mColorLabel->setFont(colorFont);
+ mColorLabel->move(mLabel->pos() + QPoint(0, 20));
+ QWhatsThis::add(mColorLabel,
+ i18n(
+ "This is the current color in hexadecimal rgb representation as you may use it in HTML or as a QColor name. "
+ "The rectangles background shows the color of the pixel inside the "
+ "little square at the end of the line cursor."
+ ));
+
+ resize(QSize(mLongEdgeLen, mShortEdgeLen));
+ setMouseTracking(TRUE);
+ mDragging = FALSE;
+ mOrientation = South;
+ _clicked = false;
+ setOrientation(South);
+ // setMediumLength();
+ mMenu = new KPopupMenu(this);
+ mMenu->insertTitle(i18n("KRuler"));
+ KPopupMenu *oriMenu = new KPopupMenu(this);
+ oriMenu->insertItem(UserIconSet("kruler-north"), i18n("&North"), this, SLOT(setNorth()), Key_N);
+ oriMenu->insertItem(UserIconSet("kruler-east"), i18n("&East"), this, SLOT(setEast()), Key_E);
+ oriMenu->insertItem(UserIconSet("kruler-south"), i18n("&South"), this, SLOT(setSouth()), Key_S);
+ oriMenu->insertItem(UserIconSet("kruler-west"), i18n("&West"), this, SLOT(setWest()), Key_W);
+ oriMenu->insertItem(i18n("&Turn Right"), this, SLOT(turnRight()), Key_R);
+ oriMenu->insertItem(i18n("Turn &Left"), this, SLOT(turnLeft()), Key_L);
+ mMenu->insertItem(i18n("&Orientation"), oriMenu);
+ mLenMenu = new KPopupMenu(this);
+ mLenMenu->insertItem(i18n("&Short"), this, SLOT(setShortLength()), CTRL+Key_S);
+ mLenMenu->insertItem(i18n("&Medium"), this, SLOT(setMediumLength()), CTRL+Key_M);
+ mLenMenu->insertItem(i18n("&Tall"), this, SLOT(setTallLength()), CTRL+Key_T);
+ mLenMenu->insertItem(i18n("&Full Screen Width"), this, SLOT(setFullLength()), CTRL+Key_F, FULLSCREENID);
+ mMenu->insertItem(i18n("&Length"), mLenMenu);
+ mMenu->insertItem(SmallIcon("colorscm"), i18n("&Choose Color..."), this, SLOT(choseColor()), CTRL+Key_C);
+ mMenu->insertItem(SmallIcon("font"), i18n("Choose &Font..."), this, SLOT(choseFont()), Key_F);
+ mMenu->insertSeparator();
+ mMenu->insertItem(SmallIcon( "help" ), KStdGuiItem::help().text(), helpMenu());
+ mMenu->insertSeparator();
+ mMenu->insertItem(SmallIcon( "exit" ), KStdGuiItem::quit().text(), kapp, SLOT(quit()), CTRL+Key_Q);
+ mLastClickPos = geometry().topLeft()+QPoint(width()/2, height()/2);
+}
+
+KLineal::~KLineal(){
+}
+
+void KLineal::move(int x, int y) {
+ move(QPoint(x, y));
+}
+
+void KLineal::move(const QPoint &p) {
+ setGeometry(QRect(p, size()));
+}
+
+QPoint KLineal::pos() {
+ QRect r = frameGeometry();
+ return r.topLeft();
+}
+int KLineal::x() {
+ return pos().x();
+}
+int KLineal::y() {
+ return pos().y();
+}
+
+static void rotateRect(QRect &r, QPoint center, int nineties) {
+ static int sintab[4] = {0,1,0,-1};
+ static int costab[4] = {1,0,-1,0};
+ int i=0;
+ int x1, y1, x2, y2;
+ if (nineties < 0) {
+ nineties = -nineties+4;
+ }
+ i = nineties % 4;
+ r.moveBy(-center.x(), -center.y());
+ r.coords(&x1, &y1, &x2, &y2);
+ r.setCoords(
+ x1 * costab[i] + y1 * sintab[i],
+ -x1 * sintab[i] + y1 * costab[i],
+ x2 * costab[i] + y2 * sintab[i],
+ -x2 * sintab[i] + y2 * costab[i]
+ );
+ r = r.normalize();
+ r.moveBy(center.x(), center.y());
+}
+
+void KLineal::setupBackground() {
+ QColor a, b, bg = mColor;
+ KImageEffect::GradientType gradType = KImageEffect::HorizontalGradient;
+ switch (mOrientation) {
+ case North:
+ a = bg.light(120);
+ b = bg.dark(130);
+ gradType = KImageEffect::VerticalGradient;
+ break;
+ case South:
+ b = bg.light(120);
+ a = bg.dark(130);
+ gradType = KImageEffect::VerticalGradient;
+ break;
+ case West:
+ a = bg.light(120);
+ b = bg.dark(130);
+ gradType = KImageEffect::HorizontalGradient;
+ break;
+ case East:
+ b = bg.light(120);
+ a = bg.dark(130);
+ gradType = KImageEffect::HorizontalGradient;
+ break;
+ }
+ QPixmap bgPixmap = QPixmap(KImageEffect::gradient(size(), a, b, gradType));
+ setErasePixmap(bgPixmap);
+ mLabel->setErasePixmap(bgPixmap);
+}
+
+void KLineal::setOrientation(int inOrientation) {
+ QRect r = frameGeometry();
+ int nineties = (int)inOrientation - (int)mOrientation;
+ QPoint center = mLastClickPos;
+
+ if (_clicked) {
+ center = mLastClickPos;
+ _clicked = false;
+ } else {
+ center = r.topLeft()+QPoint(width()/2, height()/2);
+ }
+
+ rotateRect(r, center, nineties);
+
+ QRect desktop = KGlobalSettings::desktopGeometry(this);
+ if (r.top() < desktop.top())
+ r.moveTop( desktop.top() );
+ if (r.bottom() > desktop.bottom())
+ r.moveBottom( desktop.bottom() );
+ if (r.left() < desktop.left())
+ r.moveLeft( desktop.left() );
+ if (r.right() > desktop.right())
+ r.moveRight( desktop.right() );
+
+ setGeometry(r);
+ mOrientation = (inOrientation + 4) % 4;
+ switch(mOrientation) {
+ case North:
+ mLabel->move(4, height()-mLabel->height()-4);
+ mColorLabel->move(mLabel->pos() + QPoint(0, -20));
+ mCurrentCursor = mNorthCursor;
+ break;
+ case South:
+ mLabel->move(4, 4);
+ mColorLabel->move(mLabel->pos() + QPoint(0, 20));
+ mCurrentCursor = mSouthCursor;
+ break;
+ case East:
+ mLabel->move(4, 4);
+ mColorLabel->move(mLabel->pos() + QPoint(0, 20));
+ mCurrentCursor = mEastCursor;
+ break;
+ case West:
+ mLabel->move(width()-mLabel->width()-4, 4);
+ mColorLabel->move(mLabel->pos() + QPoint(-5, 20));
+ mCurrentCursor = mWestCursor;
+ break;
+ }
+ if (mLenMenu)
+ mLenMenu->changeItem(FULLSCREENID, mOrientation % 2 ? i18n("&Full Screen Height") : i18n("&Full Screen Width"));
+ setCursor(mCurrentCursor);
+ setupBackground();
+ repaint();
+}
+void KLineal::setNorth() {
+ setOrientation(North);
+}
+void KLineal::setEast() {
+ setOrientation(East);
+}
+void KLineal::setSouth() {
+ setOrientation(South);
+}
+void KLineal::setWest() {
+ setOrientation(West);
+}
+void KLineal::turnRight() {
+ setOrientation(mOrientation - 1);
+}
+void KLineal::turnLeft() {
+ setOrientation(mOrientation + 1);
+}
+void KLineal::reLength(int percentOfScreen) {
+ if (percentOfScreen < 10) {
+ return;
+ }
+ QRect r = KGlobalSettings::desktopGeometry(this);
+
+ if (mOrientation == North || mOrientation == South) {
+ mLongEdgeLen = r.width() * percentOfScreen / 100;
+ resize(mLongEdgeLen, height());
+ } else {
+ mLongEdgeLen = r.height() * percentOfScreen / 100;
+ resize(width(), mLongEdgeLen);
+ }
+ if (x()+width() < 10) {
+ move (10, y());
+ }
+ if (y()+height() < 10) {
+ move (x(), 10);
+ }
+ saveSettings();
+}
+void KLineal::setShortLength() {
+ reLength(30);
+}
+void KLineal::setMediumLength() {
+ reLength(50);
+}
+void KLineal::setTallLength() {
+ reLength(75);
+}
+void KLineal::setFullLength() {
+ reLength(100);
+}
+void KLineal::choseColor() {
+ QRect r = KGlobalSettings::desktopGeometry(this);
+
+ QPoint pos = QCursor::pos();
+ if (pos.x() + mColorSelector.width() > r.width()) {
+ pos.setX(r.width() - mColorSelector.width());
+ }
+ if (pos.y() + mColorSelector.height() > r.height()) {
+ pos.setY(r.height() - mColorSelector.height());
+ }
+ mStoredColor = mColor;
+ mColorSelector.move(pos);
+ mColorSelector.setColor(mColor);
+ mColorSelector.setDefaultColor( DEFAULT_RULER_COLOR );
+ mColorSelector.show();
+
+ connect(&mColorSelector, SIGNAL(okClicked()), this, SLOT(setColor()));
+ connect(&mColorSelector, SIGNAL(yesClicked()), this, SLOT(setColor()));
+ connect(&mColorSelector, SIGNAL(closeClicked()), this, SLOT(setColor()));
+ connect(&mColorSelector, SIGNAL(defaultClicked()), this, SLOT(setColor()));
+ connect(&mColorSelector, SIGNAL(colorSelected(const QColor&)), this, SLOT(setColor(const QColor&)));
+ /*
+ connect(&mColorSelector, SIGNAL(cancelPressed()), this, SLOT(restoreColor()));
+ connect(&mColorSelector, SIGNAL(okPressed()), this, SLOT(saveColor()));
+ */
+}
+
+/**
+* slot to choose a font
+*/
+void KLineal::choseFont() {
+ QFont font = mScaleFont;
+ int result = KFontDialog::getFont(font, false, this);
+ if (result == KFontDialog::Accepted) {
+ setFont(font);
+ }
+}
+
+/**
+* set the ruler color to the previously selected color
+*/
+void KLineal::setFont(QFont &font) {
+ mScaleFont = font;
+ saveSettings();
+ repaint();
+}
+
+
+/**
+* set the ruler color to the previously selected color
+*/
+void KLineal::setColor() {
+ setColor(mColorSelector.color());
+ saveSettings();
+}
+
+/**
+* set the ruler color to some color
+*/
+void KLineal::setColor(const QColor &color) {
+ mColor = color;
+ if ( !mColor.isValid() )
+ mColor = DEFAULT_RULER_COLOR;
+ setupBackground();
+}
+
+/**
+* save the ruler color to the config file
+*/
+void KLineal::saveSettings() {
+ KConfig *cfg = kapp->config(); // new KConfig(locateLocal("config", kapp->name()+"rc"));
+ if (cfg) {
+ QColor color = mColor;
+ cfg->setGroup(CFG_GROUP_SETTINGS);
+ cfg->writeEntry(QString(CFG_KEY_BGCOLOR), color);
+ cfg->writeEntry(QString(CFG_KEY_SCALE_FONT), mScaleFont);
+ cfg->writeEntry(QString(CFG_KEY_LENGTH), mLongEdgeLen);
+ cfg->sync();
+ }
+}
+
+/**
+* restores the color
+*/
+void KLineal::restoreColor() {
+ setColor(mStoredColor);
+}
+/**
+* lets the context menu appear at current cursor position
+*/
+void KLineal::showMenu() {
+ QPoint pos = QCursor::pos();
+ mMenu->popup(pos);
+}
+
+/**
+* overwritten to switch the value label and line cursor on
+*/
+void KLineal::enterEvent(QEvent * /*inEvent*/) {
+ if (!mDragging) showLabel();
+}
+/**
+* overwritten to switch the value label and line cursor off
+*/
+void KLineal::leaveEvent(QEvent * /*inEvent*/) {
+ if (!geometry().contains(QCursor::pos())) {
+ hideLabel();
+ }
+}
+/**
+* shows the value lable
+*/
+void KLineal::showLabel() {
+ adjustLabel();
+ mLabel->show();
+ mColorLabel->show();
+}
+/**
+* hides the value label
+*/
+void KLineal::hideLabel() {
+ mLabel->hide();
+ mColorLabel->hide();
+}
+/**
+* updates the current value label
+*/
+void KLineal::adjustLabel() {
+ QString s;
+ QPoint cpos = QCursor::pos();
+ switch (mOrientation) {
+ case North:
+ s.sprintf("%d px", cpos.x()-x());
+ break;
+ case East:
+ s.sprintf("%d px", cpos.y()-y());
+ break;
+ case West:
+ s.sprintf("%d px", cpos.y()-y());
+ break;
+ case South:
+ s.sprintf("%d px", cpos.x()-x());
+ break;
+ }
+ mLabel->setText(s);
+}
+void KLineal::keyPressEvent(QKeyEvent *e) {
+ QPoint dist(0,0);
+ switch (e->key()) {
+ case Key_F1:
+ kapp->invokeHelp();
+ break;
+ case Key_Left:
+ dist.setX(-1);
+ break;
+ case Key_Right:
+ dist.setX(1);
+ break;
+ case Key_Up:
+ dist.setY(-1);
+ break;
+ case Key_Down:
+ dist.setY(1);
+ break;
+ default:
+ KMainWindow::keyPressEvent(e);
+ return;
+ }
+ if (e->state() & ShiftButton) {
+ dist *= 10;
+ }
+ move(pos()+dist);
+ KNotifyClient::event(0, "cursormove", QString::null);
+}
+/**
+* overwritten to handle the line cursor which is a seperate widget outside the main
+* window. Also used for dragging.
+*/
+void KLineal::mouseMoveEvent(QMouseEvent * /*inEvent*/) {
+ if (mDragging && this == mouseGrabber()) {
+ move(QCursor::pos() - mDragOffset);
+ } else {
+ QPoint p = QCursor::pos();
+ switch (mOrientation) {
+ case North:
+ p.setY(p.y()-46);
+ break;
+ case East:
+ p.setX(p.x()+46);
+ break;
+ case West:
+ p.setX(p.x()-46);
+ break;
+ case South:
+ p.setY(p.y()+46);
+ break;
+ }
+ // cerr << p.x()-x() << "," << p.y()-y() << ": " << KColorDialog::grabColor(p).name() << endl;
+ QColor color = KColorDialog::grabColor(p);
+ int h, s, v;
+ color.hsv(&h, &s, &v);
+ mColorLabel->setText(color.name().upper());
+ mColorLabel->setPaletteBackgroundColor(color);
+ if (v < 255/2) {
+ v = 255;
+ } else {
+ v = 0;
+ }
+ color.setHsv(h, s, v);
+ QPalette palette = mColorLabel->palette();
+ palette.setColor(QColorGroup::Foreground, color);
+ mColorLabel->setPalette(palette);
+ adjustLabel();
+ }
+}
+
+/**
+* overwritten for dragging and contect menu
+*/
+void KLineal::mousePressEvent(QMouseEvent *inEvent) {
+ mLastClickPos = QCursor::pos();
+ hideLabel();
+
+ QRect gr = geometry();
+ mDragOffset = mLastClickPos - QPoint(gr.left(), gr.top());
+ if (inEvent->button() == LeftButton) {
+ if (!mDragging) {
+ grabMouse(KCursor::sizeAllCursor());
+ mDragging = TRUE;
+ }
+ } else if (inEvent->button() == MidButton) {
+ _clicked = true;
+ turnLeft();
+ } else if (inEvent->button() == RightButton) {
+ showMenu();
+ }
+}
+/**
+* overwritten for dragging
+*/
+void KLineal::mouseReleaseEvent(QMouseEvent * /*inEvent*/) {
+ if (mDragging) {
+ mDragging = FALSE;
+ releaseMouse();
+ }
+ showLabel();
+}
+/**
+* draws the scale according to the orientation
+*/
+void KLineal::drawScale(QPainter &painter) {
+ painter.setPen(black);
+ QFont font = mScaleFont;
+ // font.setPixelSize(9);
+ painter.setFont(font);
+ QFontMetrics metrics = painter.fontMetrics();
+ int longCoo;
+ int longLen;
+ int shortStart;
+ int w = width();
+ int h = height();
+
+ // draw a frame around the whole thing
+ // (for some unknown reason, this doesn't show up anymore)
+ switch (mOrientation) {
+ case North:
+ default:
+ shortStart = 0;
+ longLen = w;
+ painter.drawLine(0, 0, 0, h-1);
+ painter.drawLine(0, h-1, w-1, h-1);
+ painter.drawLine(w-1, h-1, w-1, 0);
+ // painter.drawLine(width()-1, 0, 0, 0);
+ break;
+ case East:
+ shortStart = w;
+ longLen = h;
+ painter.drawLine(0, 0, 0, h-1);
+ painter.drawLine(0, h-1, w-1, h-1);
+ // painter.drawLine(width()-1, height()-1, width()-1, 0);
+ painter.drawLine(w-1, 0, 0, 0);
+ break;
+ case South:
+ shortStart = h;
+ longLen = w;
+ painter.drawLine(0, 0, 0, h-1);
+ // painter.drawLine(0, height()-1, width()-1, height()-1);
+ painter.drawLine(w-1, h-1, w-1, 0);
+ painter.drawLine(w-1, 0, 0, 0);
+ break;
+ case West:
+ shortStart = 0;
+ longLen = h;
+ // painter.drawLine(0, 0, 0, height()-1);
+ painter.drawLine(0, h-1, w-1, h-1);
+ painter.drawLine(w-1, h-1, w-1, 0);
+ painter.drawLine(w-1, 0, 0, 0);
+ break;
+ }
+ int ten = 10, twenty = 20, fourty = 40, hundred = 100;
+ for (longCoo = 0; longCoo < longLen; longCoo+=2) {
+ int len = 6;
+ if (ten == 10) {
+ if (twenty == 20) {
+ /**/
+ if (hundred == 100) {
+ font.setBold(true);
+ painter.setFont(font);
+ len = 18;
+ } else {
+ len = 15;
+ }
+ QString units;
+ int digits;
+ if (hundred == 100 || mOrientation == West || mOrientation == East) {
+ digits = longCoo;
+ } else {
+ digits = longCoo % 100;
+ }
+ units.sprintf("%d", digits);
+ QSize textSize = metrics.size(SingleLine, units);
+ int tw = textSize.width();
+ int th = textSize.height();
+ switch (mOrientation) {
+ case North:
+ if (digits < 1000 || fourty == 40 || hundred == 100) {
+ if (longCoo != 0) {
+ painter.drawText(longCoo - tw/2, shortStart + len + th, units);
+ } else {
+ painter.drawText(1, shortStart + len + th, units);
+ }
+ }
+ break;
+ case South:
+ if (digits < 1000 || fourty == 40 || hundred == 100) {
+ if (longCoo != 0) {
+ painter.drawText(longCoo - tw/2, shortStart - len - 2, units);
+ } else {
+ painter.drawText(1, shortStart - len - 2, units);
+ }
+ }
+ break;
+ case East:
+ if (longCoo != 0) {
+ painter.drawText(shortStart - len - tw - 2, longCoo + th/2 - 2, units);
+ } else {
+ painter.drawText(shortStart - len - tw - 2, th-2, units);
+ }
+ break;
+ case West:
+ if (longCoo != 0) {
+ painter.drawText(shortStart + len + 2, longCoo + th/2 - 2, units);
+ } else {
+ painter.drawText(shortStart + len + 2, th-2, units);
+ }
+ break;
+ }
+ } else {
+ len = 10;
+ }
+ }
+ switch(mOrientation) {
+ case North:
+ painter.drawLine(longCoo, shortStart, longCoo, shortStart+len);
+ break;
+ case South:
+ painter.drawLine(longCoo, shortStart, longCoo, shortStart-len);
+ break;
+ case East:
+ painter.drawLine(shortStart, longCoo, shortStart-len, longCoo);
+ break;
+ case West:
+ painter.drawLine(shortStart, longCoo, shortStart+len, longCoo);
+ break;
+ }
+ ten = (ten == 10) ? 2: ten + 2;
+ twenty = (twenty == 20) ? 2: twenty + 2;
+ fourty = (fourty == 40) ? 2: fourty + 2;
+ if (hundred == 100) {
+ hundred = 2;
+ font.setBold(false);
+ painter.setFont(font);
+ } else {
+ hundred += 2;
+ }
+ }
+}
+/**
+* actually draws the ruler
+*/
+void KLineal::paintEvent(QPaintEvent * /*inEvent*/) {
+ QPainter painter;
+ painter.begin(this);
+ drawScale(painter);
+ painter.end();
+}
+
+#include "klineal.moc"
diff --git a/kruler/klineal.h b/kruler/klineal.h
new file mode 100644
index 00000000..6fcf7015
--- /dev/null
+++ b/kruler/klineal.h
@@ -0,0 +1,106 @@
+/***************************************************************************
+ klineal.h - description
+ -------------------
+ begin : Fri Oct 13 2000
+ copyright : (C) 2000 by Till Krech
+ email : till@snafu.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KLINEAL_H
+#define KLINEAL_H
+
+#include <kapplication.h>
+#include <kpopupmenu.h>
+#include <kmainwindow.h>
+
+#include <kcolordialog.h>
+#include <kfontdialog.h>
+
+#include <qlabel.h>
+#include <qpainter.h>
+#include <qwidget.h>
+#include <qcursor.h>
+
+class KLineal : public KMainWindow {
+ Q_OBJECT
+public:
+ enum { North=0, West=1, South=2, East=3 };
+ /** constructor */
+ KLineal(QWidget*parent=0,const char* name=0);
+ /** destructor */
+ ~KLineal();
+ void move(int x, int y);
+ void move(const QPoint &p);
+ QPoint pos();
+ int x();
+ int y();
+protected:
+ void keyPressEvent(QKeyEvent *e);
+ void mousePressEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *e);
+ void mouseMoveEvent(QMouseEvent *e);
+ void paintEvent(QPaintEvent *e);
+ void enterEvent(QEvent *e);
+ void leaveEvent(QEvent *e);
+ void setupBackground();
+
+
+private:
+ void drawScale(QPainter &painter);
+ void reLength(int percentOfScreen);
+ bool mDragging;
+ QPoint mLastClickPos;
+ QPoint mDragOffset;
+ QLabel *mLabel;
+ QLabel *mColorLabel;
+ QFrame *mColorRect;
+ int mOrientation;
+ int mLongEdgeLen;
+ int mShortEdgeLen;
+ KPopupMenu *mMenu;
+ KPopupMenu *mLenMenu;
+ QColor mColor;
+ QColor mStoredColor;
+ QCursor mCurrentCursor;
+ QCursor mNorthCursor;
+ QCursor mEastCursor;
+ QCursor mWestCursor;
+ QCursor mSouthCursor;
+ QCursor mDragCursor;
+ KColorDialog mColorSelector;
+ QFont mScaleFont;
+ bool _clicked;
+public slots:
+ void setOrientation(int);
+ void setNorth();
+ void setEast();
+ void setSouth();
+ void setWest();
+ void turnLeft();
+ void turnRight();
+ void showMenu();
+ void hideLabel();
+ void showLabel();
+ void adjustLabel();
+ void setShortLength();
+ void setMediumLength();
+ void setTallLength();
+ void setFullLength();
+ void setColor();
+ void setFont(QFont &);
+ void setColor(const QColor &color);
+ void choseColor();
+ void choseFont();
+ void restoreColor();
+ void saveSettings();
+};
+#endif
diff --git a/kruler/kruler.desktop b/kruler/kruler.desktop
new file mode 100644
index 00000000..0d9e4cc6
--- /dev/null
+++ b/kruler/kruler.desktop
@@ -0,0 +1,90 @@
+[Desktop Entry]
+GenericName=Screen Ruler
+GenericName[af]=Skerm Liniaal
+GenericName[ar]=مسطرة الشاشة
+GenericName[bg]=Линийка за екрана
+GenericName[bs]=Ekranski linijar
+GenericName[ca]=Regla de pantalla
+GenericName[cs]=Obrazovkové pravítko
+GenericName[cy]=Mesurydd Sgrîn
+GenericName[da]=Skærmlineal
+GenericName[de]=Bildschirmlineal
+GenericName[el]=Χάρακας οθόνης
+GenericName[eo]=Ekranliniilo
+GenericName[es]=Regla para la pantalla
+GenericName[et]=Ekraani joonlaud
+GenericName[eu]=Pantaila erregela
+GenericName[fa]=خط‌کش پرده
+GenericName[fi]=Näytön mittaaja
+GenericName[fr]=Règle d'écran
+GenericName[gl]=Regra de pantalla
+GenericName[he]=סרגל מסך
+GenericName[hi]=स्क्रीन रूलर
+GenericName[hr]=Ravnalo
+GenericName[hu]=Képernyővonalzó
+GenericName[is]=Reglustika
+GenericName[it]=Righello per lo schermo
+GenericName[ja]=スクリーン定規
+GenericName[kk]=Экран өлшегіші
+GenericName[km]=បន្ទាត់​អេក្រង់
+GenericName[lt]=Ekrano liniuotė
+GenericName[lv]=Ekrāna Mērjosla
+GenericName[ms]=Pembaris Skrin
+GenericName[nb]=Skjermlinjal
+GenericName[nds]=Schirmlineaal
+GenericName[ne]=पर्दा रूलर
+GenericName[nl]=Schermliniaal
+GenericName[nn]=Skjermlinjal
+GenericName[pl]=Linijka ekranowa
+GenericName[pt]=Régua do Ecrã
+GenericName[pt_BR]=Régua da Tela
+GenericName[ro]=Riglă de ecran
+GenericName[ru]=Экранная линейка KDE
+GenericName[se]=Šearpmalinjála
+GenericName[sk]=Pravítko obrazovky
+GenericName[sl]=Zaslonsko ravnilo
+GenericName[sr]=Екрански лењир
+GenericName[sr@Latn]=Ekranski lenjir
+GenericName[sv]=Skärmlinjal
+GenericName[ta]=திரை உருளை
+GenericName[tg]=Ҷадвали экрании KDE
+GenericName[th]=ไม้บรรทัดสำหรับจอภาพ
+GenericName[tr]=Ekran Cetveli
+GenericName[uk]=Лінійка екрана
+GenericName[uz]=Ekran lineykasi
+GenericName[uz@cyrillic]=Экран линейкаси
+GenericName[ven]=Muvhusi wa Tshikirini
+GenericName[zh_CN]=屏幕标尺
+GenericName[zh_HK]=螢幕尺規
+GenericName[zh_TW]=螢幕尺規
+GenericName[zu]=Umlawuli Wesikrini
+Name=KRuler
+Name[af]=K-lineaal
+Name[ar]=المسطرة (KRuler)
+Name[cy]=KMesurydd
+Name[eo]=Liniilo
+Name[hi]=के-रूलर
+Name[hr]=Ravnalo
+Name[is]=KReglustika
+Name[lv]=KRulers
+Name[ms]=KPembaris
+Name[ne]=केडीई रूलर
+Name[pl]=Linijka
+Name[pt_BR]=KRégua
+Name[ro]=Riglă
+Name[sv]=Kruler
+Name[ta]=கேவரை உருளை
+Name[th]=ไม้บรรทัด - K
+Name[ven]=Muvhusi wa K
+Name[zh_TW]=KRuler 尺規
+Name[zu]=KUmlawuli
+DocPath=kruler/index.html
+MimeType=
+Exec=kruler %i %m
+Type=Application
+Path=
+Icon=kruler
+Terminal=false
+X-KDE-StartupNotify=true
+X-DCOP-ServiceType=Multi
+Categories=Qt;KDE;Graphics;X-KDE-More;
diff --git a/kruler/main.cpp b/kruler/main.cpp
new file mode 100644
index 00000000..484ca318
--- /dev/null
+++ b/kruler/main.cpp
@@ -0,0 +1,48 @@
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+
+#include "klineal.h"
+
+static const char homePageURL[] =
+ "http://www.snafu.de/~till/";
+static const char freeFormText[] =
+ "\"May the source be with you.\"";
+
+
+
+static KCmdLineOptions options[] =
+{
+ KCmdLineLastOption
+ // INSERT YOUR COMMANDLINE OPTIONS HERE
+};
+
+int main(int argc, char *argv[])
+{
+
+
+ KAboutData aboutData( "kruler", I18N_NOOP("KDE Screen Ruler"),
+ VERSION,
+ I18N_NOOP("A screen ruler for the K Desktop Environment"),
+ KAboutData::License_GPL,
+ "(c) 2000, Till Krech",
+ freeFormText,
+ homePageURL);
+ aboutData.addAuthor("Till Krech",I18N_NOOP("Programming"), "till@snafu.de");
+ aboutData.addCredit("Gunnstein Lye",I18N_NOOP("Initial port to KDE 2"), "gl@ez.no");
+ KCmdLineArgs::init( argc, argv, &aboutData );
+ KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
+
+ KApplication a;
+
+ KLineal *ruler = new KLineal();
+ a.setMainWidget(ruler);
+ ruler->show();
+
+ return a.exec();
+}
diff --git a/kruler/move.wav b/kruler/move.wav
new file mode 100644
index 00000000..4922ac4b
--- /dev/null
+++ b/kruler/move.wav
Binary files differ
diff --git a/kruler/pics/Makefile.am b/kruler/pics/Makefile.am
new file mode 100644
index 00000000..e29a8776
--- /dev/null
+++ b/kruler/pics/Makefile.am
@@ -0,0 +1,5 @@
+
+pixdir = $(kde_datadir)/kruler/pics
+pix_DATA = kruler-east.png kruler-north.png kruler-south.png kruler-west.png
+
+KDE_ICON = kruler
diff --git a/kruler/pics/hi16-app-kruler.png b/kruler/pics/hi16-app-kruler.png
new file mode 100644
index 00000000..dd1b953c
--- /dev/null
+++ b/kruler/pics/hi16-app-kruler.png
Binary files differ
diff --git a/kruler/pics/hi22-app-kruler.png b/kruler/pics/hi22-app-kruler.png
new file mode 100644
index 00000000..32d29686
--- /dev/null
+++ b/kruler/pics/hi22-app-kruler.png
Binary files differ
diff --git a/kruler/pics/hi32-app-kruler.png b/kruler/pics/hi32-app-kruler.png
new file mode 100644
index 00000000..bd4cc0f5
--- /dev/null
+++ b/kruler/pics/hi32-app-kruler.png
Binary files differ
diff --git a/kruler/pics/hi48-app-kruler.png b/kruler/pics/hi48-app-kruler.png
new file mode 100644
index 00000000..6e35b591
--- /dev/null
+++ b/kruler/pics/hi48-app-kruler.png
Binary files differ
diff --git a/kruler/pics/kruler-east.png b/kruler/pics/kruler-east.png
new file mode 100644
index 00000000..1a87ae7d
--- /dev/null
+++ b/kruler/pics/kruler-east.png
Binary files differ
diff --git a/kruler/pics/kruler-north.png b/kruler/pics/kruler-north.png
new file mode 100644
index 00000000..32d29686
--- /dev/null
+++ b/kruler/pics/kruler-north.png
Binary files differ
diff --git a/kruler/pics/kruler-south.png b/kruler/pics/kruler-south.png
new file mode 100644
index 00000000..d6c3eb5c
--- /dev/null
+++ b/kruler/pics/kruler-south.png
Binary files differ
diff --git a/kruler/pics/kruler-west.png b/kruler/pics/kruler-west.png
new file mode 100644
index 00000000..473ac39b
--- /dev/null
+++ b/kruler/pics/kruler-west.png
Binary files differ
diff --git a/kruler/uninstall.desktop b/kruler/uninstall.desktop
new file mode 100644
index 00000000..e1e3e173
--- /dev/null
+++ b/kruler/uninstall.desktop
@@ -0,0 +1,2 @@
+[Desktop Entry]
+Hidden=true