This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
neofx-zoomedit/ToolRotate.h

66 lines
1.4 KiB
C
Raw Normal View History

#ifndef TOOLROTATE_H_
#define TOOLROTATE_H_
#include "Tool.h"
#include "SidebarView.h"
#include "Renderer.h"
class ToolRotate : public Tool, private EventHandler, private Renderer {
private:
GtkWidget *image;
EditManager *editManager;
SidebarView sidebar;
bool pressed, valid;
float angle;
2008-02-15 22:44:03 +00:00
Vertex vertexRot, vertex;
// prevent shallow copy
ToolRotate(const ToolRotate &t);
const ToolRotate& operator=(const ToolRotate &t);
public:
ToolRotate(EditManager *editManager);
virtual ~ToolRotate();
virtual void activate();
virtual const char *getType() const {
return "ToolRotate";
}
virtual const char *getName() const {
return "Rotate";
}
virtual GtkWidget *getImage() {
return image;
}
virtual bool hoverFilter(const LevelObject &object) const {
return object.canRotate();
}
virtual EventHandler* getEventHandler() {
return this;
}
2008-02-15 22:44:03 +00:00
virtual bool buttonPress(unsigned int button, const Vertex *v);
virtual bool buttonRelease(unsigned int button, const Vertex *v);
virtual bool motion(const Vertex *v, float scale);
virtual Renderer *getRenderer() {
return this;
}
virtual void render(const Level &level, const Rectangle &rect, float scale);
virtual Sidebar* getSidebar() {
return &sidebar;
}
};
#endif /*TOOLROTATE_H_*/