From e40fc849149dd97c248866a4a1d026dda5e57b62 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Mon, 7 Mar 2011 19:01:11 +0000 Subject: clean3 --- attic/muse2-oom/muse2/muse/widgets/citem.h | 90 ++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 attic/muse2-oom/muse2/muse/widgets/citem.h (limited to 'attic/muse2-oom/muse2/muse/widgets/citem.h') diff --git a/attic/muse2-oom/muse2/muse/widgets/citem.h b/attic/muse2-oom/muse2/muse/widgets/citem.h new file mode 100644 index 00000000..cd77f51d --- /dev/null +++ b/attic/muse2-oom/muse2/muse/widgets/citem.h @@ -0,0 +1,90 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: citem.h,v 1.2.2.1 2006/10/04 18:45:35 spamatica Exp $ +// (C) Copyright 1999 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __CITEM_H__ +#define __CITEM_H__ + +#include +#include +#include + +#include "event.h" + +class Event; +class Part; + +//--------------------------------------------------------- +// CItem +// virtuelle Basisklasse fr alle Canvas Item's +//--------------------------------------------------------- + +class CItem { + private: + Event _event; + Part* _part; + + protected: + bool _isMoving; + QPoint moving; + QRect _bbox; + QPoint _pos; + + public: + CItem(const QPoint& p, const QRect& r); + CItem(); + // Changed by Tim. p3.3.20 + //CItem(Event e, Part* p); + CItem(const Event& e, Part* p); + + bool isMoving() const { return _isMoving; } + void setMoving(bool f) { _isMoving = f; } + bool isSelected() const; + void setSelected(bool f); + + int width() const { return _bbox.width(); } + void setWidth(int l) { _bbox.setWidth(l); } + void setHeight(int l) { _bbox.setHeight(l); } + void setMp(const QPoint&p) { moving = p; } + const QPoint mp() const { return moving; } + int x() const { return _pos.x(); } + int y() const { return _pos.y(); } + void setY(int y) { _bbox.setY(y); } + QPoint pos() const { return _pos; } + void setPos(const QPoint& p) { _pos = p; } + int height() const { return _bbox.height(); } + const QRect& bbox() const { return _bbox; } + void setBBox(const QRect& r) { _bbox = r; } + void move(const QPoint& tl) { + _bbox.moveTopLeft(tl); + _pos = tl; + } + bool contains(const QPoint& p) const { return _bbox.contains(p); } + bool intersects(const QRect& r) const { return r.intersects(_bbox); } + + Event event() const { return _event; } + void setEvent(Event& e) { _event = e; } + Part* part() const { return _part; } + void setPart(Part* p) { _part = p; } + }; + +typedef std::multimap >::iterator iCItem; +//typedef std::multimap >::const_iterator ciCItem; +typedef std::multimap >::const_reverse_iterator rciCItem; + +//--------------------------------------------------------- +// CItemList +// Canvas Item List +//--------------------------------------------------------- + +class CItemList: public std::multimap > { + public: + void add(CItem*); + CItem* find(const QPoint& pos) const; + }; + +#endif + -- cgit v1.2.3