summaryrefslogtreecommitdiffstats
path: root/krita/plugins/viewplugins/screenshot
diff options
context:
space:
mode:
Diffstat (limited to 'krita/plugins/viewplugins/screenshot')
-rw-r--r--krita/plugins/viewplugins/screenshot/Makefile.am27
-rw-r--r--krita/plugins/viewplugins/screenshot/kritascreenshot.desktop47
-rw-r--r--krita/plugins/viewplugins/screenshot/ksnapshot.cpp499
-rw-r--r--krita/plugins/viewplugins/screenshot/ksnapshot.h137
-rw-r--r--krita/plugins/viewplugins/screenshot/ksnapshotwidget.ui335
-rw-r--r--krita/plugins/viewplugins/screenshot/ksnapshotwidget.ui.h118
-rw-r--r--krita/plugins/viewplugins/screenshot/main.cpp38
-rw-r--r--krita/plugins/viewplugins/screenshot/regiongrabber.cpp170
-rw-r--r--krita/plugins/viewplugins/screenshot/regiongrabber.h72
-rw-r--r--krita/plugins/viewplugins/screenshot/screenshot-kpresenter.rc9
-rw-r--r--krita/plugins/viewplugins/screenshot/screenshot-krita.rc9
-rw-r--r--krita/plugins/viewplugins/screenshot/screenshot-kword.rc9
-rw-r--r--krita/plugins/viewplugins/screenshot/screenshot.cpp78
-rw-r--r--krita/plugins/viewplugins/screenshot/screenshot.h43
14 files changed, 0 insertions, 1591 deletions
diff --git a/krita/plugins/viewplugins/screenshot/Makefile.am b/krita/plugins/viewplugins/screenshot/Makefile.am
deleted file mode 100644
index f05e3154..00000000
--- a/krita/plugins/viewplugins/screenshot/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-kritarcdir = $(kde_datadir)/kritaplugins
-kritarc_DATA = screenshot-krita.rc
-
-EXTRA_DIST = $(kritarc_DATA)
-
-INCLUDES = -I$(srcdir)/../../../sdk \
- -I$(srcdir)/../../../core \
- -I$(srcdir)/../../../kritacolor/ \
- -I$(srcdir)/../../../ui \
- $(KOFFICE_INCLUDES) \
- $(all_includes)
-
-kde_module_LTLIBRARIES = kritascreenshot.la
-
-kritascreenshot_la_SOURCES = screenshot.cpp ksnapshot.cpp regiongrabber.cpp ksnapshotwidget.ui
-noinst_HEADERS = screenshot.h ksnapshot.h regiongrabber.h ksnapshotwidget.h ksnapshotwidget.ui.h
-
-kritascreenshot_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -lkdecore -lkdeui -lkjs -lkdefx -lkio -lkparts -L../../../../krita/kritacolor/.libs -lkritacolor -L../../../../krita/core/.libs -lkritaimage \
- -L../../../../krita/ui/.libs -lkritaui -L../../../../lib/kofficeui/.libs -lkofficeui -lkdeprint
-kritascreenshot_la_LIBADD = ../../../libkritacommon.la
-
-kde_services_DATA = kritascreenshot.desktop
-
-kritascreenshot_la_METASOURCES = AUTO
-
-messages: rc.cpp
- $(XGETTEXT) *.cpp -o $(podir)/kscreenshot_plugin.pot
diff --git a/krita/plugins/viewplugins/screenshot/kritascreenshot.desktop b/krita/plugins/viewplugins/screenshot/kritascreenshot.desktop
deleted file mode 100644
index 2420e527..00000000
--- a/krita/plugins/viewplugins/screenshot/kritascreenshot.desktop
+++ /dev/null
@@ -1,47 +0,0 @@
-[Desktop Entry]
-Name=Screenshot
-Name[bg]=Снимка на екрана
-Name[br]=Skrammpaker
-Name[ca]=Captura de pantalla
-Name[cy]=Sgrinlun
-Name[da]=Skærmaftryk
-Name[de]=Bildschirmphoto
-Name[el]=Στιγμιότυπο οθόνης
-Name[eo]=Ekrankopio
-Name[es]=Captura de pantalla
-Name[et]=Ekraanipilt
-Name[fa]=تصویر پرده
-Name[fr]=Capture d'écran
-Name[fy]=Skermôfbylding
-Name[ga]=Seat den Scáileán
-Name[gl]=Captura de Pantalla
-Name[he]=תמונת מסך
-Name[hu]=Képernyőfelvétel
-Name[is]=Skjámynd
-Name[it]=Schermata
-Name[ja]=スクリーンショット
-Name[km]=រូបថត​អេក្រង់
-Name[lv]=Ekrānattēls
-Name[nb]=Skjermbilde
-Name[nds]=Schirmbild
-Name[ne]=स्क्रिनसट
-Name[nl]=Schermafbeelding
-Name[pl]=Zrzut ekranu
-Name[pt]=Captura
-Name[pt_BR]=Captura de Tela
-Name[ru]=Снимок экрана
-Name[se]=Šearbmagovva
-Name[sk]=Snímač obrazovky
-Name[sl]=Posnetek zaslona
-Name[sr]=Снимак екрана
-Name[sr@Latn]=Snimak ekrana
-Name[sv]=Skärmdump
-Name[uk]=Знімок екрана
-Name[uz]=Skrinshot
-Name[uz@cyrillic]=Скриншот
-Name[zh_CN]=抓图
-Name[zh_TW]=螢幕快照
-ServiceTypes=Krita/ViewPlugin
-Type=Service
-X-KDE-Library=kritascreenshot
-X-Krita-Version=2
diff --git a/krita/plugins/viewplugins/screenshot/ksnapshot.cpp b/krita/plugins/viewplugins/screenshot/ksnapshot.cpp
deleted file mode 100644
index 09bdca48..00000000
--- a/krita/plugins/viewplugins/screenshot/ksnapshot.cpp
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * KSnapshot
- *
- * (c) Richard J. Moore 1997-2002
- * (c) Matthias Ettrich 2000
- * (c) Aaron J. Seigo 2002
- * (c) Nadeem Hasan 2003
- * This adaptation: (c) Boudewijn Rempt 2005
- *
- * Released under the GPL see file LICENSE for details.
- */
-
-#include <kapplication.h>
-#include <klocale.h>
-#include <kimageio.h>
-#include <kfiledialog.h>
-#include <kimagefilepreview.h>
-#include <kmessagebox.h>
-#include <kdebug.h>
-#include <kprinter.h>
-#include <kio/netaccess.h>
-#include <ksavefile.h>
-#include <ktempfile.h>
-
-#include <tqbitmap.h>
-#include <tqdragobject.h>
-#include <tqimage.h>
-#include <tqclipboard.h>
-#include <tqvbox.h>
-
-#include <kaccel.h>
-#include <knotifyclient.h>
-#include <khelpmenu.h>
-#include <kpopupmenu.h>
-#include <kpushbutton.h>
-#include <kstartupinfo.h>
-
-#include <tqcursor.h>
-#include <tqregexp.h>
-#include <tqpainter.h>
-#include <tqpaintdevicemetrics.h>
-#include <tqwhatsthis.h>
-
-#include <stdlib.h>
-
-#include "ksnapshot.h"
-#include "regiongrabber.h"
-#include "ksnapshotwidget.h"
-
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-#include <config.h>
-
-#ifdef HAVE_X11_EXTENSIONS_SHAPE_H
-#include <X11/extensions/shape.h>
-#endif
-
-#include <kglobal.h>
-
-KSnapshot::KSnapshot(TQWidget *tqparent, const char *name)
- : super(tqparent, name, false, TQString(), Ok|Cancel)
-{
- grabber = new TQWidget( 0, 0, WStyle_Customize | WX11BypassWM );
- Q_CHECK_PTR(grabber);
- grabber->move( -1000, -1000 );
- grabber->installEventFilter( this );
-
-#ifdef HAVE_X11_EXTENSIONS_SHAPE_H
- int tmp1, tmp2;
- //Check whether the extension is available
- haveXShape = XShapeQueryExtension( qt_xdisplay(), &tmp1, &tmp2 );
-#endif
-
- TQVBox *vbox = makeVBoxMainWidget();
- mainWidget = new KSnapshotWidget( vbox, "mainWidget" );
- Q_CHECK_PTR(mainWidget);
-
- mainWidget->btnSave->hide();
- mainWidget->btnPrint->hide();
- connect(mainWidget, TQT_SIGNAL(startImageDrag()), TQT_SLOT(slotDragSnapshot()));
-
- connect( mainWidget, TQT_SIGNAL( newClicked() ), TQT_SLOT( slotGrab() ) );
- connect( mainWidget, TQT_SIGNAL( printClicked() ), TQT_SLOT( slotPrint() ) );
-
- grabber->show();
- grabber->grabMouse( waitCursor );
-
- snapshot = TQPixmap::grabWindow( qt_xrootwin() );
- updatePreview();
- grabber->releaseMouse();
- grabber->hide();
-
- KConfig *conf=KGlobal::config();
- conf->setGroup("GENERAL");
- mainWidget->setDelay(conf->readNumEntry("delay",0));
- mainWidget->setMode( conf->readNumEntry( "mode", 0 ) );
- mainWidget->setIncludeDecorations(conf->readBoolEntry("includeDecorations",true));
-
- connect( &grabTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( grabTimerDone() ) );
-
- KAccel* accel = new KAccel(this);
- Q_CHECK_PTR(accel);
- accel->insert(KStdAccel::Print, this, TQT_SLOT(slotPrint()));
- accel->insert(KStdAccel::New, this, TQT_SLOT(slotGrab()));
-
- accel->insert( "Print2", TQt::Key_P, this, TQT_SLOT(slotPrint()));
- accel->insert( "New2", TQt::Key_N, this, TQT_SLOT(slotGrab()));
- accel->insert( "New3", TQt::Key_Space, this, TQT_SLOT(slotGrab()));
-
- mainWidget->btnNew->setFocus();
-
-}
-
-KSnapshot::~KSnapshot()
-{
-}
-
-bool KSnapshot::save( const TQString &filename )
-{
- return save( KURL::fromPathOrURL( filename ));
-}
-
-bool KSnapshot::save( const KURL& url )
-{
- TQString type( KImageIO::type(url.path()) );
- if ( type.isNull() )
- type = "PNG";
-
- bool ok = false;
-
- if ( url.isLocalFile() ) {
- KSaveFile saveFile( url.path() );
- if ( saveFile.status() == 0 ) {
- if ( snapshot.save( saveFile.file(), type.latin1() ) )
- ok = saveFile.close();
- }
- }
- else {
- KTempFile tmpFile;
- tmpFile.setAutoDelete( true );
- if ( tmpFile.status() == 0 ) {
- if ( snapshot.save( tmpFile.file(), type.latin1() ) ) {
- if ( tmpFile.close() )
- ok = KIO::NetAccess::upload( tmpFile.name(), url, this );
- }
- }
- }
-
- TQApplication::restoreOverrideCursor();
- if ( !ok ) {
- kdWarning() << "KSnapshot was unable to save the snapshot" << endl;
-
- TQString caption = i18n("Unable to Save Image");
- TQString text = i18n("KSnapshot was unable to save the image to\n%1.")
- .tqarg(url.prettyURL());
- KMessageBox::error(this, text, caption);
- }
-
- return ok;
-}
-
-void KSnapshot::slotCopy()
-{
- TQClipboard *cb = TQApplication::tqclipboard();
- cb->setPixmap( snapshot );
-}
-
-void KSnapshot::slotDragSnapshot()
-{
- TQDragObject *drobj = new TQImageDrag(snapshot.convertToImage(), this);
- Q_CHECK_PTR(drobj);
- drobj->setPixmap(mainWidget->preview());
- drobj->dragCopy();
-}
-
-void KSnapshot::slotGrab()
-{
- hide();
- if ( mainWidget->mode() == Region )
- {
- rgnGrab = new RegionGrabber();
- Q_CHECK_PTR(rgnGrab);
- connect( rgnGrab, TQT_SIGNAL( regionGrabbed( const TQPixmap & ) ),
- TQT_SLOT( slotRegionGrabbed( const TQPixmap & ) ) );
- }
- else
- {
- if ( mainWidget->delay() )
- grabTimer.start( mainWidget->delay() * 1000, true );
- else {
- grabber->show();
- grabber->grabMouse( crossCursor );
- }
- }
-}
-
-void KSnapshot::slotPrint()
-{
- KPrinter printer;
- if (snapshot.width() > snapshot.height())
- printer.setOrientation(KPrinter::Landscape);
- else
- printer.setOrientation(KPrinter::Portrait);
-
- tqApp->processEvents();
-
- if (printer.setup(this, i18n("Print Screenshot")))
- {
- tqApp->processEvents();
-
- TQPainter painter(&printer);
- TQPaintDeviceMetrics metrics(painter.device());
-
- float w = snapshot.width();
- float dw = w - metrics.width();
- float h = snapshot.height();
- float dh = h - metrics.height();
- bool scale = false;
-
- if ( (dw > 0.0) || (dh > 0.0) )
- scale = true;
-
- if ( scale ) {
-
- TQImage img = snapshot.convertToImage();
- tqApp->processEvents();
-
- float newh, neww;
- if ( dw > dh ) {
- neww = w-dw;
- newh = neww/w*h;
- }
- else {
- newh = h-dh;
- neww = newh/h*w;
- }
-
- img = img.smoothScale( int(neww), int(newh), TQ_ScaleMin );
- tqApp->processEvents();
-
- int x = (metrics.width()-img.width())/2;
- int y = (metrics.height()-img.height())/2;
-
- painter.drawImage( x, y, img);
- }
- else {
- int x = (metrics.width()-snapshot.width())/2;
- int y = (metrics.height()-snapshot.height())/2;
- painter.drawPixmap( x, y, snapshot );
- }
- }
-
- tqApp->processEvents();
-}
-
-void KSnapshot::slotRegionGrabbed( const TQPixmap &pix )
-{
- if ( !pix.isNull() )
- {
- snapshot = pix;
- updatePreview();
- modified = true;
- }
-
- delete rgnGrab;
- TQApplication::restoreOverrideCursor();
- show();
-}
-
-bool KSnapshot::eventFilter( TQObject* o, TQEvent* e)
-{
- if ( o == grabber && e->type() == TQEvent::MouseButtonPress ) {
- TQMouseEvent* me = (TQMouseEvent*) e;
- if ( TQWidget::mouseGrabber() != grabber )
- return false;
- if ( me->button() == LeftButton )
- performGrab();
- }
- return false;
-}
-
-void KSnapshot::updatePreview()
-{
- TQImage img = snapshot.convertToImage();
- double r1 = ((double) snapshot.height() ) / snapshot.width();
- if ( r1 * mainWidget->previewWidth() < mainWidget->previewHeight() )
- img = img.smoothScale( mainWidget->previewWidth(),
- int( mainWidget->previewWidth() * r1 ));
- else
- img = img.smoothScale( (int) (((double)mainWidget->previewHeight()) / r1),
- (mainWidget->previewHeight() ) );
-
- TQPixmap pm;
- pm.convertFromImage( img );
- mainWidget->setPreview( pm );
-}
-
-void KSnapshot::grabTimerDone()
-{
- performGrab();
- KNotifyClient::beep(i18n("The screen has been successfully grabbed."));
-}
-
-static
-Window findRealWindow( Window w, int depth = 0 )
-{
- if( depth > 5 )
- return None;
- static Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False );
- Atom type;
- int format;
- unsigned long nitems, after;
- unsigned char* prop;
- if( XGetWindowProperty( qt_xdisplay(), w, wm_state, 0, 0, False, AnyPropertyType,
- &type, &format, &nitems, &after, &prop ) == Success ) {
- if( prop != NULL )
- XFree( prop );
- if( type != None )
- return w;
- }
- Window root, tqparent;
- Window* tqchildren;
- unsigned int ntqchildren;
- Window ret = None;
- if( XQueryTree( qt_xdisplay(), w, &root, &tqparent, &tqchildren, &ntqchildren ) != 0 ) {
- for( unsigned int i = 0;
- i < ntqchildren && ret == None;
- ++i )
- ret = findRealWindow( tqchildren[ i ], depth + 1 );
- if( tqchildren != NULL )
- XFree( tqchildren );
- }
- return ret;
-}
-
-void KSnapshot::performGrab()
-{
- grabber->releaseMouse();
- grabber->hide();
- grabTimer.stop();
- XGrabServer( qt_xdisplay());
- if ( mainWidget->mode() == WindowUnderCursor ) {
- Window root;
- Window child;
- uint tqmask;
- int rootX, rootY, winX, winY;
- XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child,
- &rootX, &rootY, &winX, &winY,
- &tqmask);
- if( child == None )
- child = qt_xrootwin();
- if( !mainWidget->includeDecorations()) {
- Window real_child = findRealWindow( child );
- if( real_child != None ) // test just in case
- child = real_child;
- }
- int x, y;
- unsigned int w, h;
- unsigned int border;
- unsigned int depth;
- XGetGeometry( qt_xdisplay(), child, &root, &x, &y,
- &w, &h, &border, &depth );
- w += 2 * border;
- h += 2 * border;
-
- Window tqparent;
- Window* tqchildren;
- unsigned int ntqchildren;
- if( XQueryTree( qt_xdisplay(), child, &root, &tqparent,
- &tqchildren, &ntqchildren ) != 0 ) {
- if( tqchildren != NULL )
- XFree( tqchildren );
- int newx, newy;
- Window dummy;
- if( XTranslateCoordinates( qt_xdisplay(), tqparent, qt_xrootwin(),
- x, y, &newx, &newy, &dummy )) {
- x = newx;
- y = newy;
- }
- }
-
- snapshot = TQPixmap::grabWindow( qt_xrootwin(), x, y, w, h );
-
-#ifdef HAVE_X11_EXTENSIONS_SHAPE_H
- //No XShape - no work.
- if (haveXShape) {
- TQBitmap tqmask(w, h);
- //As the first step, get the tqmask from XShape.
- int count, order;
- XRectangle* rects = XShapeGetRectangles( qt_xdisplay(), child,
- ShapeBounding, &count, &order);
- //The ShapeBounding region is the outermost tqshape of the window;
- //ShapeBounding - ShapeClipping is defined to be the border.
- //Since the border area is part of the window, we use bounding
- // to limit our work region
- if (rects) {
- //Create a TQRegion from the rectangles describing the bounding tqmask.
- TQRegion contents;
- for (int pos = 0; pos < count; pos++)
- contents += TQRegion(rects[pos].x, rects[pos].y,
- rects[pos].width, rects[pos].height);
- XFree(rects);
-
- //Create the bounding box.
- TQRegion bbox(0, 0, snapshot.width(), snapshot.height());
-
- if( border > 0 ) {
- contents.translate( border, border );
- contents += TQRegion( 0, 0, border, h );
- contents += TQRegion( 0, 0, w, border );
- contents += TQRegion( 0, h - border, w, border );
- contents += TQRegion( w - border, 0, border, h );
- }
-
- //Get the tqmasked away area.
- TQRegion tqmaskedAway = bbox - contents;
- TQMemArray<TQRect> tqmaskedAwayRects = tqmaskedAway.rects();
-
- //Construct a bitmap tqmask from the rectangles
- TQPainter p(&tqmask);
- p.fillRect(0, 0, w, h, TQt::color1);
- for (uint pos = 0; pos < tqmaskedAwayRects.count(); pos++)
- p.fillRect(tqmaskedAwayRects[pos], TQt::color0);
- p.end();
-
- snapshot.setMask(tqmask);
- }
- }
-#endif
- }
- else {
- snapshot = TQPixmap::grabWindow( qt_xrootwin() );
- }
- XUngrabServer( qt_xdisplay());
- updatePreview();
- TQApplication::restoreOverrideCursor();
- modified = true;
-// show();
- slotOk();
-}
-
-void KSnapshot::setTime(int newTime)
-{
- mainWidget->setDelay(newTime);
-}
-
-void KSnapshot::setURL( const TQString &url )
-{
- KURL newURL = KURL::fromPathOrURL( url );
- if ( newURL == filename )
- return;
-
- filename = newURL;
-}
-
-void KSnapshot::setGrabMode( int m )
-{
- mainWidget->setMode( m );
-}
-
-void KSnapshot::slotMovePointer(int x, int y)
-{
- TQCursor::setPos( x, y );
-}
-
-void KSnapshot::exit()
-{
-
- KConfig *conf=KGlobal::config();
- conf->setGroup("GENERAL");
- conf->writeEntry("delay",mainWidget->delay());
- conf->writeEntry("mode",mainWidget->mode());
- conf->writeEntry("includeDecorations",mainWidget->includeDecorations());
- KURL url = filename;
- url.setPass( TQString() );
- conf->writePathEntry("filename",url.url());
-
- reject();
-}
-
-void KSnapshot::slotOk()
-{
-
- KConfig *conf=KGlobal::config();
- conf->setGroup("GENERAL");
- conf->writeEntry("delay",mainWidget->delay());
- conf->writeEntry("mode",mainWidget->mode());
- conf->writeEntry("includeDecorations",mainWidget->includeDecorations());
- KURL url = filename;
- url.setPass( TQString() );
- conf->writePathEntry("filename",url.url());
-
- emit screenGrabbed();
-
- accept();
-}
-
-#include "ksnapshot.moc"
diff --git a/krita/plugins/viewplugins/screenshot/ksnapshot.h b/krita/plugins/viewplugins/screenshot/ksnapshot.h
deleted file mode 100644
index 030cad12..00000000
--- a/krita/plugins/viewplugins/screenshot/ksnapshot.h
+++ /dev/null
@@ -1,137 +0,0 @@
-// -*- c++ -*-
-/*
- * (c) Richard J. Moore 1997-2002
- * (c) Matthias Ettrich 2000
- * (c) Aaron J. Seigo 2002
- * (c) Nadeem Hasan 2003
- *
- * 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 KSNAPSHOT_H
-#define KSNAPSHOT_H
-
-#include <tqlabel.h>
-#include <tqpixmap.h>
-#include <tqtimer.h>
-
-#include <dcopclient.h>
-#include <kglobalsettings.h>
-#include <kdialogbase.h>
-#include <kurl.h>
-
-class RegionGrabber;
-class KSnapshotWidget;
-
-class KSnapshotThumb : public TQLabel
-{
- Q_OBJECT
- TQ_OBJECT
-
-public:
- KSnapshotThumb(TQWidget *tqparent, const char *name = 0)
- : TQLabel(tqparent, name)
- {
- tqsetAlignment(AlignHCenter | AlignVCenter);
- }
- virtual ~KSnapshotThumb() {}
-
-signals:
- void startDrag();
-
-protected:
- void mousePressEvent(TQMouseEvent * e)
- {
- mClickPt = e->pos();
- }
-
- void mouseMoveEvent(TQMouseEvent * e)
- {
- if (mClickPt != TQPoint(0, 0) &&
- (e->pos() - mClickPt).manhattanLength() > KGlobalSettings::dndEventDelay())
- {
- mClickPt = TQPoint(0, 0);
- emit startDrag();
- }
- }
-
- void mouseReleaseEvent(TQMouseEvent * /*e*/)
- {
- mClickPt = TQPoint(0, 0);
- }
-
- TQPoint mClickPt;
-};
-
-class KSnapshot : public KDialogBase
-{
- typedef KDialogBase super;
- Q_OBJECT
- TQ_OBJECT
-
-public:
- KSnapshot(TQWidget *tqparent= 0, const char *name= 0);
- ~KSnapshot();
-
- enum CaptureMode { FullScreen=0, WindowUnderCursor=1, Region=2 };
-
- bool save( const TQString &filename );
- bool save( const KURL& url );
-
- TQString url() const { return filename.url(); }
-
-signals:
- void screenGrabbed();
-
-protected slots:
- void slotGrab();
- void slotCopy();
- void slotPrint();
- void slotMovePointer( int x, int y );
-
- void setTime(int newTime);
- void setURL(const TQString &newURL);
- void setGrabMode( int m );
- void exit();
-
- void slotOk();
-
-
-protected:
- void reject() { close(); }
- bool eventFilter( TQObject*, TQEvent* );
-
-private slots:
- void grabTimerDone();
- void slotDragSnapshot();
- void slotRegionGrabbed( const TQPixmap & );
-
-private:
- void updatePreview();
- void performGrab();
- void autoincFilename();
-
- TQPixmap snapshot;
- TQTimer grabTimer;
- TQWidget* grabber;
- KURL filename;
- KSnapshotWidget *mainWidget;
- RegionGrabber *rgnGrab;
- bool modified;
- bool haveXShape;
-};
-
-#endif // KSNAPSHOT_H
-
diff --git a/krita/plugins/viewplugins/screenshot/ksnapshotwidget.ui b/krita/plugins/viewplugins/screenshot/ksnapshotwidget.ui
deleted file mode 100644
index 33b64e81..00000000
--- a/krita/plugins/viewplugins/screenshot/ksnapshotwidget.ui
+++ /dev/null
@@ -1,335 +0,0 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>KSnapshotWidget</class>
-<widget class="TQWidget">
- <property name="name">
- <cstring>KSnapshotWidget</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>358</width>
- <height>241</height>
- </rect>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <widget class="KSnapshotThumb" row="0" column="0" rowspan="4" colspan="3">
- <property name="name">
- <cstring>lblImage</cstring>
- </property>
- <property name="tqminimumSize">
- <size>
- <width>200</width>
- <height>130</height>
- </size>
- </property>
- <property name="toolTip" stdset="0">
- <string>Thumbnail of the current snapshot</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>This is a thumbnail of the current snapshot.
-
-The image can be dragged to another application or document to copy the full screenshot there. Try it with the Konqueror file manager.</string>
- </property>
- </widget>
- <widget class="KPushButton" row="0" column="3">
- <property name="name">
- <cstring>btnNew</cstring>
- </property>
- <property name="text">
- <string>&amp;New Snapshot</string>
- </property>
- <property name="iconSet">
- <iconset>"tool_screenshot"</iconset>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Click this button to take a new snapshot.</string>
- </property>
- </widget>
- <widget class="KPushButton" row="2" column="3">
- <property name="name">
- <cstring>btnSave</cstring>
- </property>
- <property name="text">
- <string>&amp;Save As...</string>
- </property>
- <property name="iconSet">
- <iconset>"filesave"</iconset>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Click this button to save the current snapshot. To quickly save the snapshot without showing the file dialog, press Ctrl+Shift+S. The filename is automatically incremented after each save.</string>
- </property>
- </widget>
- <spacer row="1" column="3">
- <property name="name">
- <cstring>Spacer6</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="tqsizeHint">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- <widget class="KPushButton" row="3" column="3">
- <property name="name">
- <cstring>btnPrint</cstring>
- </property>
- <property name="text">
- <string>&amp;Print...</string>
- </property>
- <property name="iconSet">
- <iconset>"fileprint"</iconset>
- </property>
- <property name="whatsThis" stdset="0">
- <string>Click this button to print the current screenshot.</string>
- </property>
- </widget>
- <widget class="Line" row="4" column="0" rowspan="1" colspan="4">
- <property name="name">
- <cstring>line1</cstring>
- </property>
- <property name="frameShape">
- <enum>HLine</enum>
- </property>
- <property name="frameShadow">
- <enum>Sunken</enum>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- </widget>
- <widget class="TQSpinBox" row="6" column="1">
- <property name="name">
- <cstring>spinDelay</cstring>
- </property>
- <property name="suffix">
- <string> sec</string>
- </property>
- <property name="specialValueText">
- <string>No delay</string>
- </property>
- <property name="toolTip" stdset="0">
- <string>Snapshot delay in seconds</string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;
-This is the number of seconds to wait after clicking the &lt;i&gt;New Snapshot&lt;/i&gt; button before taking the snapshot.
-&lt;p&gt;
-This is very useful for getting windows, menus and other items on the screen set up just the way you want.
-&lt;p&gt;
-If &lt;i&gt;no delay&lt;/i&gt; is set, the program will wait for a mouse click before taking a snapshot.
-&lt;/p&gt;
-&lt;/qt&gt;</string>
- </property>
- </widget>
- <widget class="TQLabel" row="6" column="0">
- <property name="name">
- <cstring>lblDelay</cstring>
- </property>
- <property name="text">
- <string>Snapshot &amp;delay:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>spinDelay</cstring>
- </property>
- </widget>
- <widget class="TQLabel" row="5" column="0">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="text">
- <string>Cap&amp;ture mode:</string>
- </property>
- <property name="buddy" stdset="0">
- <cstring>comboMode</cstring>
- </property>
- </widget>
- <spacer row="6" column="2" rowspan="1" colspan="2">
- <property name="name">
- <cstring>Spacer1</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="tqsizeHint">
- <size>
- <width>156</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- <widget class="TQCheckBox" row="7" column="0" rowspan="1" colspan="4">
- <property name="name">
- <cstring>cbIncludeDecorations</cstring>
- </property>
- <property name="text">
- <string>Include &amp;window decorations</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0">
- <string>When enabled, snapshot of a window will also include the window decorations</string>
- </property>
- </widget>
- <widget class="TQComboBox" row="5" column="1" rowspan="1" colspan="3">
- <item>
- <property name="text">
- <string>Full Screen</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Window Under Cursor</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Region</string>
- </property>
- </item>
- <property name="name">
- <cstring>comboMode</cstring>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;qt&gt;Using this menu, you can select from the three following snapshot modes:
-&lt;p&gt;
-&lt;b&gt;Full Screen&lt;/b&gt; - captures the entire desktop.&lt;br&gt;
-&lt;b&gt;Window Under Cursor&lt;/b&gt; - captures only the window (or menu) that is under the mouse cursor when the snapshot is taken.&lt;br&gt;
-&lt;b&gt;Region&lt;/b&gt; - captures only the region of the desktop that you specify. When taking a new snapshot in this mode you will be able to select any area of the screen by clicking and dragging the mouse.&lt;/p&gt;&lt;/qt&gt;</string>
- </property>
- </widget>
- <spacer row="8" column="1">
- <property name="name">
- <cstring>spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="tqsizeHint">
- <size>
- <width>20</width>
- <height>31</height>
- </size>
- </property>
- </spacer>
- </grid>
-</widget>
-<customwidgets>
- <customwidget>
- <class>KSnapshotThumb</class>
- <header location="local">ksnapshot.h</header>
- <sizehint>
- <width>-1</width>
- <height>-1</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- <pixmap>image0</pixmap>
- <signal>startDrag()</signal>
- </customwidget>
-</customwidgets>
-<images>
- <image name="image0">
- <data format="XPM.GZ" length="5230">789c9597db4e1d4b0e86eff31428be8b46b5fb54dd551acd051020211c4320c0682eecaa5e9ccf90005bf3ee53cbbfe9d9c9c548a38ea27c2977b5cbfe6dd7fae3c3c2e1cee6c2873fde3d3cf2e3595a48a77cbff0213f5d5dbdfcf35ffff8f3ddfba65998fff161a179ffb777ef771f17d2c2d6cdf53807c705a889cdac6ee72c47736eebd637b5f2b672d70ecd30e744ca7d9b9a4ad7579587363433e527e5d072abefbb03636978ceb4a31c5bc13a91716ad41f89e0aec2fe74abcc6d6ad5f9e4945357375ef75f997357751dd61d19c71afb61bdef421b951f274ebaffb6716cb3f2b2f230f18d3183dd95b1b441d7d59f2e94757ccf1b27eceff69563618d0f5dcfd9d7beeb7a5dd7f3fac6fb4ee32b87c619f1168d976f7d6ff6df26d6ef4b301e1bac7f54f63e747a5e87f5c173276aff605c22a8fefc540e5e3af5972f956359577bf2c6d978cb78d6697edc9eb2f8b143fed7945359d778b0e6c3e7be81bf7465dce23cf4ac3c16567f19fecefaae53bd081b7baccbb131b7d05f679ca03f27c6b9d1f388c6bbaffab7f80dca4d1fed7bfafdbeedb9533d490f1e2ae8d5693ccacb83d77cd027e3d4416faa97beefa3d7f8f086f168f9d9020f43a3f5c5aa877e28eb88f74fe319becfaa873e0c15de775f95639f3dec37c143d361bf2be3cef4b76bdcb7d84ff5d2cbd0227facf1ecd360fa67d54b9f078ffcd10f636e11ff53e3847853ad3c1b668837e9fe43358c2df45a81430b3db2e6676842d368fd48abdc068b87e0fd2e788bf792b21f861e7afd0e0e5ce37dcdd7d0872218e5d789f57b3218a71ae7bb501eca3af67b510e21c05fd27a1b6218ac3ef17d0ed68fe8cb1be3fc6e5159863ca0bfed824340fe687d62c4838c23f677f0370de380fcdd2be7e03dfab1d6cf300bcd80fa80bfb358dbf9547fa18abe413d68fe421d63ade7737aded094cf63fdcc38f4d0bfee17dac2d08380a3a0dff24cb90bdc23ffaa87e0636c912fed87612e38d4df1e982bc4dbdd29872001f14aca319413eb793e83cbfbe8af27606e4c0f5f8d3bcb7763ec6b8da73b57e69083d61f9d82b9b5fada31f635fcaf8d7b7b5ffb41f16e34ff34fe214dfc0c8e1ef1a22330bfcdc345e31e4c33e3c1e6e181b1609e3ac43f8759803e8cd9f2e7e0ff18ab80ef5d8239e2fc0ef129f90ff0bf0773347fee8d13ce279bc6b34af5c61abf58157bf4b765b05435f4abfec726968c2b67e536fa80fe388279067f680d2c750dff75fe9766da07e44bc02521ba4e1d584c1fb261dcc23fd97f63f8c3af136bfc687362c4e76962ed8fac7a2ecdb7853f7c63ec6bf467bd3fc421c680780c60b6f9275fc045aea84fadaf18a2e0fc04ff0237bd9e8fefc0d236e8ef3f8d83c57fdd38daf94edeb886be74fec618b3ed7f3731e66b0fe67a403e76c0454ef8de9231dbfe9f8dc5fc47be38a6887ad2f950964d2fdc1a27d3c7b6710693f6ef9864b4fdb4ffc6cc5540fea0972c339c87afc1c9f4443a5fe2c84d40bd2f82cb3ae6c7b1716dbc37b1e68bf5be118b7e3dead78125d87d0bfa99bd7d8fb78c1bdb4fcfcfd51bcb9d716bebda3fb8966cf7cf57709103f2e327c6fe5a2fdc4ab4fb01deef5283fa65d50ffb54c13fd67ec37d61e845fb070f8571df7c341eec7e7a691c6ae453fb771937d1fa999ebfa43358bf573d3327c6fdd0a9de59b87414e59f60911ef3ff07380d16bf0b63b6fbb8ce0f4e523a80ee8ff8a5f21fe83f384f2e8cf9d419db7d4bb4bff32cb1dd871ae38c79417962dd9f8f2786bfaa3fa992ddbf68d5d8d6797d62dc27b4bf4a9bdeee5be7c619efbb169c2b9bb7aa67e972857a67d59bf8943cf4a6f5237dae3b9c3f4f8cef5713637e6a3c6548e546a7eb87e0b28e7cf7c68ddd2fb15f28acf166bd2f484c19f921f8cbc57de84ff52c397b8f7e178d7bbb7f7e9f18f743d593ccd210d12f9e8c05fd8417c1e5e704e2afefa7aa5cf850ff4fc6a1473debfc4d7561c4ebd3c48897f69fd4e4d8eb7e4efb736a0b23fe9adfd465bb3f388d6ff22933fa1df6f7597ad483c62371f6e6ff8671b6f89e198fb8cfb0ea3f49619c6f6562cc27d5474a7906e6b589d1df549f29e78479450fe0b1c2fc67d5731a0ba33ffc97a167fd7d92ebb1b1f9a87acdcdd8a23ff2e3c4a81fed0fb91bbb88f8e9f772f9b9c6b8bfac187bd41febbcc8c35831f4bb6edc227eeec8b847bc58ef0f398d91a1179d6f391746bdebfd60ac4716b0180bd8a97e473f8ea2dfdb7d9c3f8e1cff8f8760057b27e57f92cb6e743377e24efff29cb97377e12edd55b190c99eddb5bb71b7eeceddbb07f7e89edc0ff7d33dbb17f7ea16dd925b761fdd8a63d8174f52b15e756bee93fbecd6dd17b7e136dd96db763b6ed77d2dd67bee9bdb77078ed49e8b27b7c5fabb3b7447eed855ae768d6bcbd339ef7a37b8e022392a2734fbd1dd119350a24c23cde8844ee98ccee9c2f9c2977445d77443b793fd8ceee89e1ee8919ee807fdb4e7995ee8b5d82fd252b15ffe8bfd097da4155aa535fa34597fa6f5f2f717da28f69bb445dbb433d99fd22e7da53dfa3659efd3017da7c3f2af233aa68aeadfec1b6aa9236fd63d0d14ca15c0719913737b965fedcbf0c83cc29a677cc2a77cc6e77cc1977cc5d7c5fee637fbdbb2db9d5adff343b17ee427fec1737ee69762fffa9bfd222ff17259fdc82bbcca6bfc893ff33a7fe10ddee42ddee69ddfec77f92beff137dee703fece877cc4c7aee58a6b6ee8b8fc10ed7eb13f635f9a4bc5e54719477152ba671977a505c84845c57222a7bfd89fcb999ccb855cca955cbfc5546ee456ee68b14cf67b799047799aec2fdc92fc28999cef567224cff222afb2c85b32e36d599265f9282bb23ad95fba6559934f2593f3e798b74acc8fd5f6b3accb17d9904dd9926db3a7520d1fdd37d9915df95a72599e1291566df7e49beccb817c974339829eb55e56dc7e51ec0d2dcbb1545297a791563af1c5eff2d3beb4faf8562f568f0744745b9e9d5f1f7992d5e412a186ffef7afff7dfdffd077c99ae99</data>
- </image>
-</images>
-<connections>
- <connection>
- <sender>comboMode</sender>
- <signal>activated(int)</signal>
- <receiver>KSnapshotWidget</receiver>
- <slot>slotModeChanged(int)</slot>
- </connection>
- <connection>
- <sender>btnNew</sender>
- <signal>clicked()</signal>
- <receiver>KSnapshotWidget</receiver>
- <slot>slotNewClicked()</slot>
- </connection>
- <connection>
- <sender>btnPrint</sender>
- <signal>clicked()</signal>
- <receiver>KSnapshotWidget</receiver>
- <slot>slotPrintClicked()</slot>
- </connection>
- <connection>
- <sender>btnSave</sender>
- <signal>clicked()</signal>
- <receiver>KSnapshotWidget</receiver>
- <slot>slotSaveClicked()</slot>
- </connection>
- <connection>
- <sender>lblImage</sender>
- <signal>startDrag()</signal>
- <receiver>KSnapshotWidget</receiver>
- <slot>slotStartDrag()</slot>
- </connection>
-</connections>
-<tabstops>
- <tabstop>btnNew</tabstop>
- <tabstop>btnSave</tabstop>
- <tabstop>btnPrint</tabstop>
- <tabstop>comboMode</tabstop>
- <tabstop>spinDelay</tabstop>
- <tabstop>cbIncludeDecorations</tabstop>
-</tabstops>
-<includes>
- <include location="global" impldecl="in implementation">kdialog.h</include>
- <include location="global" impldecl="in implementation">kiconloader.h</include>
- <include location="global" impldecl="in implementation">kglobalsettings.h</include>
- <include location="local" impldecl="in implementation">ksnapshotwidget.ui.h</include>
-</includes>
-<Q_SIGNALS>
- <signal>newClicked()</signal>
- <signal>saveClicked()</signal>
- <signal>printClicked()</signal>
- <signal>startImageDrag()</signal>
-</Q_SIGNALS>
-<Q_SLOTS>
- <slot access="protected" specifier="non virtual">slotModeChanged( int mode )</slot>
- <slot access="protected" specifier="non virtual">slotNewClicked()</slot>
- <slot access="protected" specifier="non virtual">slotSaveClicked()</slot>
- <slot access="protected" specifier="non virtual">slotPrintClicked()</slot>
- <slot access="protected" specifier="non virtual">slotStartDrag()</slot>
- <slot specifier="non virtual" returnType="int">previewWidth()</slot>
- <slot specifier="non virtual" returnType="int">previewHeight()</slot>
-</Q_SLOTS>
-<functions>
- <function specifier="non virtual">setPreview( const QPixmap &amp; pm )</function>
- <function specifier="non virtual">setDelay( int i )</function>
- <function specifier="non virtual">setIncludeDecorations( bool b )</function>
- <function specifier="non virtual">setMode( int mode )</function>
- <function specifier="non virtual" returnType="int">delay()</function>
- <function specifier="non virtual" returnType="bool">includeDecorations()</function>
- <function specifier="non virtual" returnType="int">mode()</function>
- <function specifier="non virtual" returnType="TQPixmap">preview()</function>
-</functions>
-<pixmapfunction>SmallIconSet</pixmapfunction>
-<tqlayoutdefaults spacing="6" margin="11"/>
-<tqlayoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
-</UI>
diff --git a/krita/plugins/viewplugins/screenshot/ksnapshotwidget.ui.h b/krita/plugins/viewplugins/screenshot/ksnapshotwidget.ui.h
deleted file mode 100644
index 3c552868..00000000
--- a/krita/plugins/viewplugins/screenshot/ksnapshotwidget.ui.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-** ui.h extension file, included from the uic-generated form implementation.
-**
-** If you wish to add, delete or rename functions or slots use
-** TQt Designer which will update this file, preserving your code. Create an
-** init() function in place of a constructor, and a destroy() function in
-** place of a destructor.
-*****************************************************************************/
-
-
-void KSnapshotWidget::slotModeChanged( int mode )
-{
- switch ( mode )
- {
- case 0:
- lblDelay->setEnabled(true);
- spinDelay->setEnabled(true);
- cbIncludeDecorations->setEnabled(false);
- break;
- case 1:
- lblDelay->setEnabled(true);
- spinDelay->setEnabled(true);
- cbIncludeDecorations->setEnabled(true);
- break;
- case 2:
- lblDelay->setEnabled(false);
- spinDelay->setEnabled(false);
- cbIncludeDecorations->setEnabled(false);
- default:
- break;
- }
-}
-
-
-void KSnapshotWidget::setPreview( const TQPixmap &pm )
-{
- lblImage->setPixmap(pm);
-}
-
-
-void KSnapshotWidget::setDelay( int i )
-{
- spinDelay->setValue(i);
-}
-
-
-void KSnapshotWidget::setIncludeDecorations( bool b )
-{
- cbIncludeDecorations->setChecked(b);
-}
-
-
-void KSnapshotWidget::setMode( int mode )
-{
- comboMode->setCurrentItem(mode);
- slotModeChanged(mode);
-}
-
-
-int KSnapshotWidget::delay()
-{
- return spinDelay->value();
-}
-
-
-bool KSnapshotWidget::includeDecorations()
-{
- return cbIncludeDecorations->isChecked();
-}
-
-
-int KSnapshotWidget::mode()
-{
- return comboMode->currentItem();
-}
-
-
-void KSnapshotWidget::slotNewClicked()
-{
- emit newClicked();
-}
-
-
-void KSnapshotWidget::slotSaveClicked()
-{
- emit saveClicked();
-}
-
-
-void KSnapshotWidget::slotPrintClicked()
-{
- emit printClicked();
-}
-
-
-void KSnapshotWidget::slotStartDrag()
-{
- emit startImageDrag();
-}
-
-
-TQPixmap KSnapshotWidget::preview()
-{
- return *lblImage->pixmap();
-}
-
-
-int KSnapshotWidget::previewWidth()
-{
- return lblImage->width();
-}
-
-
-int KSnapshotWidget::previewHeight()
-{
- return lblImage->height();
-}
-
diff --git a/krita/plugins/viewplugins/screenshot/main.cpp b/krita/plugins/viewplugins/screenshot/main.cpp
deleted file mode 100644
index 70f61349..00000000
--- a/krita/plugins/viewplugins/screenshot/main.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <kapplication.h>
-#include "ksnapshot.h"
-#include <kimageio.h>
-#include <klocale.h>
-#include <kcmdlineargs.h>
-#include <kaboutdata.h>
-#include <kiconloader.h>
-
-static const char description[] =
- I18N_NOOP("KDE Screenshot Utility");
-
-int main(int argc, char **argv)
-{
- KAboutData aboutData( "ksnapshot", I18N_NOOP("KSnapshot"),
- KSNAPVERSION, description, KAboutData::License_GPL,
- "(c) 1997-2003, Richard J. Moore,\n(c) 2000, Matthias Ettrich,\n(c) 2002-2003 Aaron J. Seigo");
- aboutData.addAuthor("Richard J. Moore",0, "[email protected]");
- aboutData.addAuthor("Matthias Ettrich",0, "[email protected]");
- aboutData.addAuthor("Aaron J. Seigo", 0, "[email protected]");
- aboutData.addCredit( "Nadeem Hasan", "Region Grabbing\nReworked GUI",
- KCmdLineArgs::init( argc, argv, &aboutData );
-
- KApplication app;
-
- KImageIO::registerFormats();
-
- // Create top level window
- KSnapshot *toplevel= new KSnapshot();
- Q_CHECK_PTR(toplevel);
- app.dcopClient()->setDefaultObject( toplevel->objId() );
- toplevel->setCaption( app.makeStdCaption("") );
- toplevel->setIcon(SmallIcon("tool_screenshot"));
- app.setMainWidget(toplevel);
- toplevel->show();
- return app.exec();
-}
-
diff --git a/krita/plugins/viewplugins/screenshot/regiongrabber.cpp b/krita/plugins/viewplugins/screenshot/regiongrabber.cpp
deleted file mode 100644
index 570c9e3f..00000000
--- a/krita/plugins/viewplugins/screenshot/regiongrabber.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * This file was copied from ksnapshot
- *
- * Copyright (C) 2003 Nadeem Hasan <[email protected]>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library 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 "regiongrabber.h"
-
-#include <tqpainter.h>
-#include <tqpalette.h>
-#include <tqstyle.h>
-#include <tqtimer.h>
-#include <tqtooltip.h>
-
-#include <kglobalsettings.h>
-
-SizeTip::SizeTip( TQWidget *tqparent, const char *name )
- : TQLabel( tqparent, name, WStyle_Customize | WX11BypassWM |
- WStyle_StaysOnTop | WStyle_NoBorder | WStyle_Tool )
-{
- setMargin( 2 );
- setIndent( 0 );
- setFrameStyle( TQFrame::Plain | TQFrame::Box );
-
- setPalette( TQToolTip::palette() );
-}
-
-void SizeTip::setTip( const TQRect &rect )
-{
- TQString tip = TQString( "%1x%2" ).tqarg( rect.width() )
- .tqarg( rect.height() );
-
- setText( tip );
- adjustSize();
-
- positionTip( rect );
-}
-
-void SizeTip::positionTip( const TQRect &rect )
-{
- TQRect tipRect = tqgeometry();
- tipRect.moveTopLeft( TQPoint( 0, 0 ) );
-
- if ( rect.intersects( tipRect ) )
- {
- TQRect deskR = KGlobalSettings::desktopGeometry( TQPoint( 0, 0 ) );
-
- tipRect.moveCenter( TQPoint( deskR.width()/2, deskR.height()/2 ) );
- if ( !rect.tqcontains( tipRect, true ) && rect.intersects( tipRect ) )
- tipRect.moveBottomRight( tqgeometry().bottomRight() );
- }
-
- move( tipRect.topLeft() );
-}
-
-RegionGrabber::RegionGrabber()
- : TQWidget( 0, 0 ),
- mouseDown( false ), sizeTip( 0L )
-{
- sizeTip = new SizeTip( ( TQWidget * )0L );
-
- tipTimer = new TQTimer( this );
- Q_CHECK_PTR(tipTimer);
- connect( tipTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( updateSizeTip() ) );
-
- TQTimer::singleShot( 200, this, TQT_SLOT( initGrabber() ) );
-}
-
-RegionGrabber::~RegionGrabber()
-{
- delete sizeTip;
-}
-
-void RegionGrabber::initGrabber()
-{
- pixmap = TQPixmap::grabWindow( qt_xrootwin() );
- setPaletteBackgroundPixmap( pixmap );
-
- showFullScreen();
-
- grabMouse( crossCursor );
-}
-
-void RegionGrabber::mousePressEvent( TQMouseEvent *e )
-{
- if ( e->button() == LeftButton )
- {
- mouseDown = true;
- grabRect = TQRect( e->pos(), e->pos() );
- }
-}
-
-void RegionGrabber::mouseMoveEvent( TQMouseEvent *e )
-{
- if ( mouseDown )
- {
- sizeTip->hide();
- tipTimer->start( 250, true );
-
- drawRubber();
- grabRect.setBottomRight( e->pos() );
- drawRubber();
- }
-}
-
-void RegionGrabber::mouseReleaseEvent( TQMouseEvent *e )
-{
- mouseDown = false;
- drawRubber();
- sizeTip->hide();
-
- grabRect.setBottomRight( e->pos() );
- grabRect = grabRect.normalize();
-
- TQPixmap region = TQPixmap::grabWindow( winId(), grabRect.x(), grabRect.y(),
- grabRect.width(), grabRect.height() );
-
- releaseMouse();
-
- emit regionGrabbed( region );
-}
-
-void RegionGrabber::keyPressEvent( TQKeyEvent *e )
-{
- if ( e->key() == TQt::Key_Escape )
- {
- releaseMouse();
- emit regionGrabbed( TQPixmap() );
- }
- else
- e->ignore();
-}
-
-void RegionGrabber::updateSizeTip()
-{
- TQRect rect = grabRect.normalize();
-
- sizeTip->setTip( rect );
- sizeTip->show();
-}
-
-void RegionGrabber::drawRubber()
-{
- TQPainter p;
- p.begin( this );
- p.setRasterOp( NotROP );
- p.setPen( TQPen( color0, 1 ) );
- p.setBrush( NoBrush );
-
- style().drawPrimitive( TQStyle::PE_FocusRect, &p, grabRect, tqcolorGroup(),
- TQStyle::Style_Default, TQStyleOption( tqcolorGroup().base() ) );
-
- p.end();
-}
-
-#include "regiongrabber.moc"
diff --git a/krita/plugins/viewplugins/screenshot/regiongrabber.h b/krita/plugins/viewplugins/screenshot/regiongrabber.h
deleted file mode 100644
index b1da1049..00000000
--- a/krita/plugins/viewplugins/screenshot/regiongrabber.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * This file is copied from ksnapshot.
- *
- * Copyright (C) 2003 Nadeem Hasan <[email protected]>
- *
- * This library 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
- * Library 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 REGIONGRABBER_H
-#define REGIONGRABBER_H
-
-#include <tqlabel.h>
-#include <tqpixmap.h>
-
-class TQTimer;
-
-class SizeTip : public TQLabel
-{
-public:
- SizeTip( TQWidget *tqparent, const char *name=0 );
- ~SizeTip() {}
-
- void setTip( const TQRect &rect );
- void positionTip( const TQRect &rect );
-};
-
-class RegionGrabber : public TQWidget
-{
- Q_OBJECT
- TQ_OBJECT
-
-public:
- RegionGrabber();
- ~RegionGrabber();
-
-protected slots:
- void initGrabber();
- void updateSizeTip();
-
- signals:
- void regionGrabbed( const TQPixmap & );
-
-protected:
- void mousePressEvent( TQMouseEvent *e );
- void mouseReleaseEvent( TQMouseEvent *e );
- void mouseMoveEvent( TQMouseEvent *e );
- void keyPressEvent( TQKeyEvent *e );
-
- void drawRubber();
-
- bool mouseDown;
- TQRect grabRect;
- TQPixmap pixmap;
-
- SizeTip *sizeTip;
- TQTimer *tipTimer;
-};
-
-#endif // REGIONGRABBER_H
-
diff --git a/krita/plugins/viewplugins/screenshot/screenshot-kpresenter.rc b/krita/plugins/viewplugins/screenshot/screenshot-kpresenter.rc
deleted file mode 100644
index 14cd9d2e..00000000
--- a/krita/plugins/viewplugins/screenshot/screenshot-kpresenter.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui library="kritascreenshot" version="1">
-<MenuBar>
- <Menu name="Insert"><text>&amp;Insert</text>
- <Separator/>
- <Action name="screenshot"/>
- </Menu>
-</MenuBar>
-</kpartgui>
diff --git a/krita/plugins/viewplugins/screenshot/screenshot-krita.rc b/krita/plugins/viewplugins/screenshot/screenshot-krita.rc
deleted file mode 100644
index 07f14197..00000000
--- a/krita/plugins/viewplugins/screenshot/screenshot-krita.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui library="kritascreenshot" version="1">
-<MenuBar>
- <Menu name="Tools"><text>&amp;Tools</text>
- <Seperator/>
- <Action name="screenshot"/>
- </Menu>
-</MenuBar>
-</kpartgui>
diff --git a/krita/plugins/viewplugins/screenshot/screenshot-kword.rc b/krita/plugins/viewplugins/screenshot/screenshot-kword.rc
deleted file mode 100644
index f1f3fce1..00000000
--- a/krita/plugins/viewplugins/screenshot/screenshot-kword.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui library="kritascreenshot" version="1">
-<MenuBar>
- <Menu name="insert"><text>&amp;Insert</text>
- <Separator/>
- <Action name="screenshot"/>
- </Menu>
-</MenuBar>
-</kpartgui>
diff --git a/krita/plugins/viewplugins/screenshot/screenshot.cpp b/krita/plugins/viewplugins/screenshot/screenshot.cpp
deleted file mode 100644
index 9133b002..00000000
--- a/krita/plugins/viewplugins/screenshot/screenshot.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * This file is part of the KDE project
- *
- * This file was copied from ksnapshot
- *
- * Copyright (C) 2001 Nikolas Zimmermann <[email protected]>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library 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 <klocale.h>
-#include <kiconloader.h>
-#include <kinstance.h>
-#include <kmessagebox.h>
-#include <kstandarddirs.h>
-#include <ktempfile.h>
-#include <kdebug.h>
-#include <KoView.h>
-#include <KoDocument.h>
-#include <kgenericfactory.h>
-#include <klocale.h>
-
-#include "ksnapshot.h"
-#include <kimageio.h>
-#include <kis_view.h>
-#include <kis_image.h>
-#include "screenshot.moc"
-
-
-K_EXPORT_COMPONENT_FACTORY( kritascreenshot, KGenericFactory<Screenshot>( "krita" ) )
-
-Screenshot::Screenshot(TQObject *tqparent, const char *name, const TQStringList &)
- : KParts::Plugin(tqparent, name)
-{
- KGlobal::locale()->insertCatalogue("kscreenshot_plugin");
- setInstance(KGenericFactory<Screenshot>::instance());
- setXMLFile(locate("data","kritaplugins/screenshot-krita.rc"), true);
- KImageIO::registerFormats();
-
- snapshot = new KSnapshot();
- Q_CHECK_PTR(snapshot);
- connect( snapshot, TQT_SIGNAL( screenGrabbed() ), TQT_SLOT( slotScreenGrabbed() ) );
-
- (void) new KAction(i18n("&Screenshot..."), SmallIcon("tool_screenshot"), 0, this, TQT_SLOT(slotScreenshot()), actionCollection(), "screenshot");
-
-}
-
-Screenshot::~Screenshot()
-{
- delete snapshot;
-}
-
-void Screenshot::slotScreenshot()
-{
- snapshot->show();
-}
-
-void Screenshot::slotScreenGrabbed()
-{
- KTempFile temp(locateLocal("tmp", "screenshot"), ".png");
- snapshot->save(temp.name());
-
- KisView *view = dynamic_cast<KisView *>(tqparent());
- if(view)
- view->importImage(temp.name());
-}
diff --git a/krita/plugins/viewplugins/screenshot/screenshot.h b/krita/plugins/viewplugins/screenshot/screenshot.h
deleted file mode 100644
index d1100836..00000000
--- a/krita/plugins/viewplugins/screenshot/screenshot.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This file is part of the KDE project
- * Copyright (C) 2001 Nikolas Zimmermann <[email protected]>
- * Copyright (C) 2004 Boudewijn Rempt <[email protected]>
- *
- * 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 SCREENSHOT_H
-#define SCREENSHOT_H
-
-#include <kparts/plugin.h>
-
-class KSnapshot;
-
-class Screenshot : public KParts::Plugin
-{
- Q_OBJECT
- TQ_OBJECT
-public:
- Screenshot(TQObject *tqparent, const char *name, const TQStringList &);
- virtual ~Screenshot();
-
-private slots:
- void slotScreenshot();
- void slotScreenGrabbed();
-
-private:
- KSnapshot * snapshot;
-};
-
-#endif