mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 02:42:52 +00:00
generic: remove code for features that Katie does not support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3c648adff3
commit
ba65b80e46
8 changed files with 0 additions and 125 deletions
|
@ -298,9 +298,6 @@ void FreeRegionGrabber::grabRect()
|
||||||
pt.begin(&pixmap2);
|
pt.begin(&pixmap2);
|
||||||
if (pt.paintEngine()->hasFeature(QPaintEngine::PorterDuff)) {
|
if (pt.paintEngine()->hasFeature(QPaintEngine::PorterDuff)) {
|
||||||
pt.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, true);
|
pt.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, true);
|
||||||
#ifndef QT_NO_OPENGL
|
|
||||||
pt.setRenderHints(QPainter::HighQualityAntialiasing, true);
|
|
||||||
#endif
|
|
||||||
pt.setBrush(Qt::black);
|
pt.setBrush(Qt::black);
|
||||||
pt.setPen(QPen(QBrush(Qt::black), 0.5));
|
pt.setPen(QPen(QBrush(Qt::black), 0.5));
|
||||||
pt.drawPolygon(translatedPol);
|
pt.drawPolygon(translatedPol);
|
||||||
|
|
|
@ -175,13 +175,6 @@ bool KSnapshotObject::saveImage( QIODevice *device, const QByteArray &format )
|
||||||
imgWriter.setQuality( 85 );
|
imgWriter.setQuality( 85 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_IMAGE_TEXT
|
|
||||||
if ( !title.isEmpty() )
|
|
||||||
imgWriter.setText( i18n("Title"), title );
|
|
||||||
if ( !windowClass.isEmpty() )
|
|
||||||
imgWriter.setText( i18n("Window Class"), windowClass );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QImage snap = snapshot.toImage();
|
QImage snap = snapshot.toImage();
|
||||||
return imgWriter.write( snap );
|
return imgWriter.write( snap );
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,34 +47,6 @@ void AnnotatorEngine::decodeEvent( const QMouseEvent * mouseEvent, EventType * e
|
||||||
*button = AnnotatorEngine::Right;
|
*button = AnnotatorEngine::Right;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_TABLET
|
|
||||||
void AnnotatorEngine::decodeEvent( const QTabletEvent * tabletEvent, EventType * eventType, Button * button )
|
|
||||||
{
|
|
||||||
switch ( tabletEvent->type() )
|
|
||||||
{
|
|
||||||
case QEvent::TabletPress:
|
|
||||||
// Tablet press event is equivalent to pressing the left mouse button
|
|
||||||
*button = AnnotatorEngine::Left;
|
|
||||||
*eventType = AnnotatorEngine::Press;
|
|
||||||
break;
|
|
||||||
case QEvent::TabletRelease:
|
|
||||||
// Tablet release event is equivalent to releasing the left mouse button
|
|
||||||
*button = AnnotatorEngine::Left;
|
|
||||||
*eventType = AnnotatorEngine::Release;
|
|
||||||
break;
|
|
||||||
case QEvent::TabletMove:
|
|
||||||
// Tablet events are only routed if the pen is down so
|
|
||||||
// this is equivalent to the left mouse button being pressed
|
|
||||||
*button = AnnotatorEngine::Left;
|
|
||||||
*eventType = AnnotatorEngine::Move;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Q_ASSERT(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // QT_NO_TABLET
|
|
||||||
|
|
||||||
AnnotatorEngine::~AnnotatorEngine()
|
AnnotatorEngine::~AnnotatorEngine()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,6 @@
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#ifndef QT_NO_TABLET
|
|
||||||
#include <QTabletEvent>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class PageViewItem;
|
class PageViewItem;
|
||||||
namespace Okular {
|
namespace Okular {
|
||||||
|
@ -54,9 +51,6 @@ class AnnotatorEngine
|
||||||
void setItem( PageViewItem * item ) { m_item = item; }
|
void setItem( PageViewItem * item ) { m_item = item; }
|
||||||
|
|
||||||
static void decodeEvent( const QMouseEvent * mouseEvent, EventType * eventType, Button * button );
|
static void decodeEvent( const QMouseEvent * mouseEvent, EventType * eventType, Button * button );
|
||||||
#ifndef QT_NO_TABLET
|
|
||||||
static void decodeEvent( const QTabletEvent * tabletEvent, EventType * eventType, Button * button );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
virtual QCursor cursor() const;
|
virtual QCursor cursor() const;
|
||||||
|
|
||||||
|
|
|
@ -1786,46 +1786,6 @@ static QPoint rotateInRect( const QPoint &rotated, Okular::Rotation rotation )
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_TABLET
|
|
||||||
void PageView::tabletEvent( QTabletEvent * e )
|
|
||||||
{
|
|
||||||
// Ignore tablet events that we don't care about
|
|
||||||
if ( !( e->type() == QEvent::TabletPress ||
|
|
||||||
e->type() == QEvent::TabletRelease ||
|
|
||||||
e->type() == QEvent::TabletMove ) )
|
|
||||||
{
|
|
||||||
e->ignore();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine pen state
|
|
||||||
bool penReleased = false;
|
|
||||||
if ( e->type() == QEvent::TabletPress )
|
|
||||||
{
|
|
||||||
d->penDown = true;
|
|
||||||
}
|
|
||||||
if ( e->type() == QEvent::TabletRelease )
|
|
||||||
{
|
|
||||||
d->penDown = false;
|
|
||||||
penReleased = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we're editing an annotation and the tablet pen is either down or just released
|
|
||||||
// then dispatch event to annotator
|
|
||||||
if ( d->annotator && d->annotator->active() && ( d->penDown || penReleased ) )
|
|
||||||
{
|
|
||||||
const QPoint eventPos = contentAreaPoint( e->pos() );
|
|
||||||
PageViewItem * pageItem = pickItemOnPoint( eventPos.x(), eventPos.y() );
|
|
||||||
const QPoint localOriginInGlobal = mapToGlobal( QPoint(0,0) );
|
|
||||||
|
|
||||||
// routeTabletEvent will accept or ignore event as appropriate
|
|
||||||
d->annotator->routeTabletEvent( e, pageItem, localOriginInGlobal );
|
|
||||||
} else {
|
|
||||||
e->ignore();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // QT_NO_TABLET
|
|
||||||
|
|
||||||
void PageView::mouseMoveEvent( QMouseEvent * e )
|
void PageView::mouseMoveEvent( QMouseEvent * e )
|
||||||
{
|
{
|
||||||
// don't perform any mouse action when no document is shown
|
// don't perform any mouse action when no document is shown
|
||||||
|
|
|
@ -131,9 +131,6 @@ Q_OBJECT
|
||||||
void wheelEvent( QWheelEvent* );
|
void wheelEvent( QWheelEvent* );
|
||||||
|
|
||||||
void paintEvent( QPaintEvent *e );
|
void paintEvent( QPaintEvent *e );
|
||||||
#ifndef QT_NO_TABLET
|
|
||||||
void tabletEvent (QTabletEvent *e );
|
|
||||||
#endif
|
|
||||||
void mouseMoveEvent( QMouseEvent *e );
|
void mouseMoveEvent( QMouseEvent *e );
|
||||||
void mousePressEvent( QMouseEvent *e );
|
void mousePressEvent( QMouseEvent *e );
|
||||||
void mouseReleaseEvent( QMouseEvent *e );
|
void mouseReleaseEvent( QMouseEvent *e );
|
||||||
|
|
|
@ -876,41 +876,6 @@ QRect PageViewAnnotator::routeMouseEvent( QMouseEvent * e, PageViewItem * item )
|
||||||
return performRouteMouseOrTabletEvent( eventType, button, e->posF(), item );
|
return performRouteMouseOrTabletEvent( eventType, button, e->posF(), item );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_TABLET
|
|
||||||
QRect PageViewAnnotator::routeTabletEvent( QTabletEvent * e, PageViewItem * item, const QPoint & localOriginInGlobal )
|
|
||||||
{
|
|
||||||
// Unlike routeMouseEvent, routeTabletEvent must explicitly ignore events it doesn't care about so that
|
|
||||||
// the corresponding mouse event will later be delivered.
|
|
||||||
if ( !item )
|
|
||||||
{
|
|
||||||
e->ignore();
|
|
||||||
return QRect();
|
|
||||||
}
|
|
||||||
|
|
||||||
// We set all tablet events that take place over the annotations toolbar to ignore so that corresponding mouse
|
|
||||||
// events will be delivered to the toolbar. However, we still allow the annotations code to handle
|
|
||||||
// TabletMove and TabletRelease events in case the user is drawing an annotation onto the toolbar.
|
|
||||||
const QPoint toolBarPos = m_toolBar->mapFromGlobal( e->globalPos() );
|
|
||||||
const QRect toolBarRect = m_toolBar->rect();
|
|
||||||
if ( toolBarRect.contains( toolBarPos ) )
|
|
||||||
{
|
|
||||||
e->ignore();
|
|
||||||
if (e->type() == QEvent::TabletPress)
|
|
||||||
return QRect();
|
|
||||||
}
|
|
||||||
|
|
||||||
AnnotatorEngine::EventType eventType;
|
|
||||||
AnnotatorEngine::Button button;
|
|
||||||
|
|
||||||
// figure out the event type and button
|
|
||||||
AnnotatorEngine::decodeEvent( e, &eventType, &button );
|
|
||||||
|
|
||||||
const QPointF globalPosF = e->hiResGlobalPos();
|
|
||||||
const QPointF localPosF = globalPosF - localOriginInGlobal;
|
|
||||||
return performRouteMouseOrTabletEvent( eventType, button, localPosF, item );
|
|
||||||
}
|
|
||||||
#endif // QT_NO_TABLET
|
|
||||||
|
|
||||||
bool PageViewAnnotator::routeKeyEvent( QKeyEvent * event )
|
bool PageViewAnnotator::routeKeyEvent( QKeyEvent * event )
|
||||||
{
|
{
|
||||||
if ( event->key() == Qt::Key_Escape )
|
if ( event->key() == Qt::Key_Escape )
|
||||||
|
|
|
@ -76,9 +76,6 @@ class PageViewAnnotator : public QObject
|
||||||
QCursor cursor() const;
|
QCursor cursor() const;
|
||||||
|
|
||||||
QRect routeMouseEvent( QMouseEvent * event, PageViewItem * item );
|
QRect routeMouseEvent( QMouseEvent * event, PageViewItem * item );
|
||||||
#ifndef QT_NO_TABLET
|
|
||||||
QRect routeTabletEvent( QTabletEvent * event, PageViewItem * item, const QPoint & localOriginInGlobal );
|
|
||||||
#endif
|
|
||||||
QRect performRouteMouseOrTabletEvent( const AnnotatorEngine::EventType & eventType, const AnnotatorEngine::Button & button,
|
QRect performRouteMouseOrTabletEvent( const AnnotatorEngine::EventType & eventType, const AnnotatorEngine::Button & button,
|
||||||
const QPointF & pos, PageViewItem * item );
|
const QPointF & pos, PageViewItem * item );
|
||||||
bool routeKeyEvent( QKeyEvent * event );
|
bool routeKeyEvent( QKeyEvent * event );
|
||||||
|
|
Loading…
Add table
Reference in a new issue