Mercurial > hg > svgui
comparison layer/ImageLayer.cpp @ 376:e1a9e478b7f2
* juggle some files around in order to free audioio, base, and system libraries
from dependency on QtGui
author | Chris Cannam |
---|---|
date | Wed, 12 Mar 2008 17:42:56 +0000 |
parents | d58701996fae |
children | 22b72f0f6a4e |
comparison
equal
deleted
inserted
replaced
375:daaf1c435d98 | 376:e1a9e478b7f2 |
---|---|
569 frame = frame / m_model->getResolution() * m_model->getResolution(); | 569 frame = frame / m_model->getResolution() * m_model->getResolution(); |
570 | 570 |
571 m_editingPoint = ImageModel::Point(frame, "", ""); | 571 m_editingPoint = ImageModel::Point(frame, "", ""); |
572 m_originalPoint = m_editingPoint; | 572 m_originalPoint = m_editingPoint; |
573 | 573 |
574 if (m_editingCommand) m_editingCommand->finish(); | 574 if (m_editingCommand) finish(m_editingCommand); |
575 m_editingCommand = new ImageModel::EditCommand(m_model, "Add Image"); | 575 m_editingCommand = new ImageModel::EditCommand(m_model, "Add Image"); |
576 m_editingCommand->addPoint(m_editingPoint); | 576 m_editingCommand->addPoint(m_editingPoint); |
577 | 577 |
578 m_editing = true; | 578 m_editing = true; |
579 } | 579 } |
614 m_editingCommand->addCommand(command); | 614 m_editingCommand->addCommand(command); |
615 } else { | 615 } else { |
616 m_editingCommand->deletePoint(m_editingPoint); | 616 m_editingCommand->deletePoint(m_editingPoint); |
617 } | 617 } |
618 | 618 |
619 m_editingCommand->finish(); | 619 finish(m_editingCommand); |
620 m_editingCommand = 0; | 620 m_editingCommand = 0; |
621 m_editing = false; | 621 m_editing = false; |
622 } | 622 } |
623 | 623 |
624 bool | 624 bool |
633 | 633 |
634 ImageModel::Point point(frame, url, ""); | 634 ImageModel::Point point(frame, url, ""); |
635 ImageModel::EditCommand *command = | 635 ImageModel::EditCommand *command = |
636 new ImageModel::EditCommand(m_model, "Add Image"); | 636 new ImageModel::EditCommand(m_model, "Add Image"); |
637 command->addPoint(point); | 637 command->addPoint(point); |
638 command->finish(); | 638 finish(command); |
639 return true; | 639 return true; |
640 } | 640 } |
641 | 641 |
642 void | 642 void |
643 ImageLayer::editStart(View *v, QMouseEvent *e) | 643 ImageLayer::editStart(View *v, QMouseEvent *e) |
652 m_editOrigin = e->pos(); | 652 m_editOrigin = e->pos(); |
653 m_editingPoint = *points.begin(); | 653 m_editingPoint = *points.begin(); |
654 m_originalPoint = m_editingPoint; | 654 m_originalPoint = m_editingPoint; |
655 | 655 |
656 if (m_editingCommand) { | 656 if (m_editingCommand) { |
657 m_editingCommand->finish(); | 657 finish(m_editingCommand); |
658 m_editingCommand = 0; | 658 m_editingCommand = 0; |
659 } | 659 } |
660 | 660 |
661 m_editing = true; | 661 m_editing = true; |
662 } | 662 } |
686 { | 686 { |
687 // std::cerr << "ImageLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; | 687 // std::cerr << "ImageLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; |
688 if (!m_model || !m_editing) return; | 688 if (!m_model || !m_editing) return; |
689 | 689 |
690 if (m_editingCommand) { | 690 if (m_editingCommand) { |
691 m_editingCommand->finish(); | 691 finish(m_editingCommand); |
692 } | 692 } |
693 | 693 |
694 m_editingCommand = 0; | 694 m_editingCommand = 0; |
695 m_editing = false; | 695 m_editing = false; |
696 } | 696 } |
744 command->deletePoint(*i); | 744 command->deletePoint(*i); |
745 command->addPoint(newPoint); | 745 command->addPoint(newPoint); |
746 } | 746 } |
747 } | 747 } |
748 | 748 |
749 command->finish(); | 749 finish(command); |
750 } | 750 } |
751 | 751 |
752 void | 752 void |
753 ImageLayer::resizeSelection(Selection s, Selection newSize) | 753 ImageLayer::resizeSelection(Selection s, Selection newSize) |
754 { | 754 { |
778 command->deletePoint(*i); | 778 command->deletePoint(*i); |
779 command->addPoint(newPoint); | 779 command->addPoint(newPoint); |
780 } | 780 } |
781 } | 781 } |
782 | 782 |
783 command->finish(); | 783 finish(command); |
784 } | 784 } |
785 | 785 |
786 void | 786 void |
787 ImageLayer::deleteSelection(Selection s) | 787 ImageLayer::deleteSelection(Selection s) |
788 { | 788 { |
797 for (ImageModel::PointList::iterator i = points.begin(); | 797 for (ImageModel::PointList::iterator i = points.begin(); |
798 i != points.end(); ++i) { | 798 i != points.end(); ++i) { |
799 if (s.contains(i->frame)) command->deletePoint(*i); | 799 if (s.contains(i->frame)) command->deletePoint(*i); |
800 } | 800 } |
801 | 801 |
802 command->finish(); | 802 finish(command); |
803 } | 803 } |
804 | 804 |
805 void | 805 void |
806 ImageLayer::copy(View *v, Selection s, Clipboard &to) | 806 ImageLayer::copy(View *v, Selection s, Clipboard &to) |
807 { | 807 { |
883 } | 883 } |
884 | 884 |
885 command->addPoint(newPoint); | 885 command->addPoint(newPoint); |
886 } | 886 } |
887 | 887 |
888 command->finish(); | 888 finish(command); |
889 return true; | 889 return true; |
890 } | 890 } |
891 | 891 |
892 QString | 892 QString |
893 ImageLayer::getLocalFilename(QString img) const | 893 ImageLayer::getLocalFilename(QString img) const |