ksnapshot: add setPixmap DCOP call

Can be useful to integrate KSnapshot with applications that can take their own screenshots better (e.g. a media player can use a single frame from a video instead of a lower-quality real screen grab).

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/77/head
Mavridis Philippe 6 months ago
parent 60716f5af0
commit d7130aacf9
No known key found for this signature in database
GPG Key ID: 93F66F98F906147D

@ -589,6 +589,11 @@ void KSnapshot::setURL( const TQString &url )
updateCaption(); updateCaption();
} }
void KSnapshot::setPixmap(const TQPixmap &newImage) {
snapshot = newImage;
updatePreview();
}
void KSnapshot::setGrabMode( int m ) void KSnapshot::setGrabMode( int m )
{ {
mainWidget->setMode( m ); mainWidget->setMode( m );

@ -118,6 +118,7 @@ protected slots:
void setTime(int newTime); void setTime(int newTime);
void setURL(const TQString &newURL); void setURL(const TQString &newURL);
void setGrabMode( int m ); void setGrabMode( int m );
void setPixmap(const TQPixmap &newImage);
void exit(); void exit();
protected: protected:

@ -12,6 +12,7 @@
#define __KS_IFACE_H #define __KS_IFACE_H
#include <dcopobject.h> #include <dcopobject.h>
#include <tqpixmap.h>
class KSnapshotIface : virtual public DCOPObject class KSnapshotIface : virtual public DCOPObject
{ {
@ -60,6 +61,10 @@ class KSnapshotIface : virtual public DCOPObject
/** Exit KSnapshot **/ /** Exit KSnapshot **/
virtual void exit() = 0; virtual void exit() = 0;
/** Set image, for applications which want to make use of KSnapshot's UI
and interface with their own images */
virtual void setPixmap(const TQPixmap &newImage) = 0;
}; };
#endif #endif

Loading…
Cancel
Save