Commit 4372b37f authored by Thomas Zander's avatar Thomas Zander

Rename KoGfxEvent to KoPointerEvent

svn path=/trunk/koffice/; revision=549154
parent a515543a
......@@ -92,6 +92,11 @@ public:
* @return the curently active tool, or 0 if non active.
*/
virtual KoTool* tool() = 0;
/**
* Set the new ative tool.
* @param tool the new tool to be used on the canvas.
*/
virtual void setTool(KoTool *tool) = 0;
/**
......
......@@ -20,7 +20,7 @@
#include "KoInteractionStrategy.h"
#include "KoSelection.h"
#include "KoShapeManager.h"
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include "KoShapeRubberSelectStrategy.h"
#include "KoShapeMoveStrategy.h"
#include "KoShapeRotateStrategy.h"
......@@ -50,7 +50,7 @@ KoInteractionStrategy::KoInteractionStrategy(KoTool *parent, KoCanvasBase *canva
}
// static
KoInteractionStrategy* KoInteractionStrategy::createStrategy(KoGfxEvent *event, KoInteractionTool *parent, KoCanvasBase *canvas) {
KoInteractionStrategy* KoInteractionStrategy::createStrategy(KoPointerEvent *event, KoInteractionTool *parent, KoCanvasBase *canvas) {
if((event->buttons() & Qt::LeftButton) == 0)
return 0; // Nothing to do for middle/right mouse button
......
......@@ -27,7 +27,7 @@
#include <KoSelection.h>
class QPainter;
class KoGfxEvent;
class KoPointerEvent;
class KCommand;
class KoCanvasBase;
class KoInteractionTool;
......@@ -82,7 +82,7 @@ public:
/**
* This instanciates a new strategy object and decides which one created based on the params.
*/
static KoInteractionStrategy* createStrategy(KoGfxEvent *event, KoInteractionTool *parentTool, KoCanvasBase *canvas);
static KoInteractionStrategy* createStrategy(KoPointerEvent *event, KoInteractionTool *parentTool, KoCanvasBase *canvas);
protected:
/// protected constructor. Use the createStrategy method()
......
......@@ -25,7 +25,7 @@
#include <QMouseEvent>
#include <QPainter>
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include "KoShape.h"
#include "KoSelection.h"
#include "KoShapeManager.h"
......@@ -118,12 +118,12 @@ void KoInteractionTool::paint( QPainter &painter, KoViewConverter &converter) {
}
}
void KoInteractionTool::mousePressEvent( KoGfxEvent *event ) {
void KoInteractionTool::mousePressEvent( KoPointerEvent *event ) {
Q_ASSERT(m_currentStrategy == 0);
m_currentStrategy = KoInteractionStrategy::createStrategy(event, this, m_canvas);
}
void KoInteractionTool::mouseMoveEvent( KoGfxEvent *event ) {
void KoInteractionTool::mouseMoveEvent( KoPointerEvent *event ) {
if(m_currentStrategy) {
m_lastPoint = event->point;
m_currentStrategy->handleMouseMove( m_lastPoint, event->modifiers() );
......@@ -158,7 +158,7 @@ QRectF KoInteractionTool::handlesSize() {
return bound;
}
void KoInteractionTool::mouseReleaseEvent( KoGfxEvent *event ) {
void KoInteractionTool::mouseReleaseEvent( KoPointerEvent *event ) {
Q_UNUSED(event);
if ( m_currentStrategy )
{
......
......@@ -88,9 +88,9 @@ public:
public: // Events
virtual void mousePressEvent( KoGfxEvent *event );
virtual void mouseMoveEvent( KoGfxEvent *event );
virtual void mouseReleaseEvent( KoGfxEvent *event );
virtual void mousePressEvent( KoPointerEvent *event );
virtual void mouseMoveEvent( KoPointerEvent *event );
virtual void mouseReleaseEvent( KoPointerEvent *event );
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event);
......
......@@ -24,7 +24,7 @@
#include <QtDebug>
#include <KoSelection.h>
#include <KoGfxEvent.h>
#include <KoPointerEvent.h>
KoPathShape::KoPathShape()
{
......
/* This file is part of the KDE project
Copyright (C) 2006 Thorsten Zachmann <zachmann@kde.org>
Copyright (C) 2006 Casper Boemann Rasmussen <cbr@boemann.dk>
Copyright (C) 2006 Thomas Zander <zander@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -29,7 +30,7 @@
* The event used in Flake to have both the original (canvas based) position as
* well as the normalized position.
*/
class FLAKE_EXPORT KoGfxEvent
class FLAKE_EXPORT KoPointerEvent
{
public:
/**
......@@ -37,7 +38,7 @@ public:
* @param ev the mouse event that is the base of this event.
* @param pnt the zoomed pointed in the normal coordiante system.
*/
KoGfxEvent( QMouseEvent *ev, const QPointF &pnt )
KoPointerEvent( QMouseEvent *ev, const QPointF &pnt )
: point( pnt )
, m_event( ev )
{}
......
......@@ -22,7 +22,7 @@
#include "KoSelection.h"
#include "KoShapeContainer.h"
#include "KoShapeGroup.h"
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include <QPainter>
#include <QDebug>
......
......@@ -23,7 +23,7 @@
#include "KoShapeContainer.h"
#include "KoRepaintManager.h"
#include "KoSelection.h"
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include "KoInsets.h"
#include "KoShapeBorderModel.h"
......
......@@ -34,7 +34,7 @@ class QRectF;
class QPainterPath;
class KoSelection;
class KoGfxEvent;
class KoPointerEvent;
class KoShapeContainer;
class KoRepaintManager;
class KoShapeBorderModel;
......
......@@ -28,7 +28,7 @@
#include "KoCanvasBase.h"
#include "KoShapeManager.h"
#include "KoSelection.h"
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include "KoCommand.h"
#include "kcommand.h"
......
......@@ -19,7 +19,7 @@
#include "KoShapeResizeStrategy.h"
#include "KoShapeManager.h"
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include "KoCanvasBase.h"
#include "KoCommand.h"
......
......@@ -20,7 +20,7 @@
#include "KoShapeRotateStrategy.h"
#include "KoInteractionTool.h"
#include "KoCanvasBase.h"
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include "KoShapeManager.h"
#include "KoCommand.h"
......
......@@ -25,7 +25,7 @@
#include <QDebug>
#include <QMouseEvent>
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include "KoShapeManager.h"
#include "KoSelection.h"
#include "KoCanvasBase.h"
......
......@@ -29,7 +29,7 @@
class QPainter;
class QPointF;
class KoGfxEvent;
class KoPointerEvent;
class KoCanvasBase;
class KoTool;
......
......@@ -22,7 +22,7 @@
#include "KoTool.h"
#include "KoCanvasBase.h"
#include "KoViewConverter.h"
#include "KoGfxEvent.h"
#include "KoPointerEvent.h"
#include "KoTool.moc"
KoTool::KoTool(KoCanvasBase *canvas )
......@@ -54,7 +54,7 @@ QCursor KoTool::cursor( const QPointF &position ) {
return Qt::ArrowCursor;
}
void KoTool::mouseDoubleClickEvent( KoGfxEvent *event ) {
void KoTool::mouseDoubleClickEvent( KoPointerEvent *event ) {
event->ignore();
}
......
......@@ -26,7 +26,7 @@
#include <koffice_export.h>
class KoCanvasBase;
class KoGfxEvent;
class KoPointerEvent;
class KoViewConverter;
class KActionCollection;
......@@ -127,7 +127,7 @@ public: // Events
* Implementors should call event->ignore() if they do not actually use the event.
* @param event state and reason of this mouse press
*/
virtual void mousePressEvent( KoGfxEvent *event ) = 0;
virtual void mousePressEvent( KoPointerEvent *event ) = 0;
/**
* Called when (one of) the mouse buttons is double clicked.
......@@ -135,21 +135,21 @@ public: // Events
* Default implementation ignores this event.
* @param event state and reason of this mouse press
*/
virtual void mouseDoubleClickEvent( KoGfxEvent *event );
virtual void mouseDoubleClickEvent( KoPointerEvent *event );
/**
* Called when the mouse moved over the canvas.
* Implementors should call event->ignore() if they do not actually use the event.
* @param event state and reason of this mouse move
*/
virtual void mouseMoveEvent( KoGfxEvent *event ) = 0;
virtual void mouseMoveEvent( KoPointerEvent *event ) = 0;
/**
* Called when (one of) the mouse buttons is released.
* Implementors should call event->ignore() if they do not actually use the event.
* @param event state and reason of this mouse release
*/
virtual void mouseReleaseEvent( KoGfxEvent *event ) = 0;
virtual void mouseReleaseEvent( KoPointerEvent *event ) = 0;
/**
* Called when a key is pressed.
......
......@@ -111,9 +111,9 @@ public:
~DummyTool() {}
void paint( QPainter &painter, KoViewConverter &converter ) {}
QCursor cursor( const QPointF &position ) { return Qt::ForbiddenCursor; }
void mousePressEvent( KoGfxEvent *event ) {}
void mouseMoveEvent( KoGfxEvent *event ) {}
void mouseReleaseEvent( KoGfxEvent *event ) {}
void mousePressEvent( KoPointerEvent *event ) {}
void mouseMoveEvent( KoPointerEvent *event ) {}
void mouseReleaseEvent( KoPointerEvent *event ) {}
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment