Mercurial > hg > svgui
diff view/Pane.cpp @ 684:917039d333bb tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 14:38:48 +0000 |
parents | 1a0fdad4af4d 692a8b9804fe |
children | 084fd76deb89 |
line wrap: on
line diff
--- a/view/Pane.cpp Fri Nov 22 10:40:51 2013 +0000 +++ b/view/Pane.cpp Tue Nov 26 14:38:48 2013 +0000 @@ -58,8 +58,8 @@ //#define DEBUG_PANE -using std::cerr; -using std::endl; + + QCursor *Pane::m_measureCursor1 = 0; QCursor *Pane::m_measureCursor2 = 0; @@ -115,7 +115,7 @@ ++count; } - std::cerr << "Have " << count+1 << " zoom levels" << std::endl; + cerr << "Have " << count+1 << " zoom levels" << endl; */ Layer *layer = 0; @@ -228,25 +228,25 @@ step *= 2; --pwr; } -// std::cerr << level << std::endl; +// cerr << level << endl; level += step; if (++count == 100 || level > 262144) break; } } -// std::cerr << "Have " << count << " zoom levels" << std::endl; +// cerr << "Have " << count << " zoom levels" << endl; m_hthumb->setMinimumValue(0); m_hthumb->setMaximumValue(count); m_hthumb->setValue(count - current); -// std::cerr << "set value to " << count-current << std::endl; - -// std::cerr << "default value is " << m_hthumb->getDefaultValue() << std::endl; +// cerr << "set value to " << count-current << endl; + +// cerr << "default value is " << m_hthumb->getDefaultValue() << endl; if (count != 50 && m_hthumb->getDefaultValue() == 0) { m_hthumb->setDefaultValue(count - current); -// std::cerr << "set default value to " << m_hthumb->getDefaultValue() << std::endl; +// cerr << "set default value to " << m_hthumb->getDefaultValue() << endl; } bool haveVThumb = false; @@ -266,9 +266,9 @@ m_vthumb->setValue(layer->getCurrentVerticalZoomStep()); m_vthumb->blockSignals(false); -// std::cerr << "Vertical thumbwheel: min 0, max " << max +// cerr << "Vertical thumbwheel: min 0, max " << max // << ", default " << defaultStep << ", value " -// << m_vthumb->getValue() << std::endl; +// << m_vthumb->getValue() << endl; } } @@ -779,11 +779,11 @@ const Model *reference = model->getAlignmentReference(); /* if (!reference) { - std::cerr << "Pane[" << this << "]::drawAlignmentStatus: No reference" << std::endl; + cerr << "Pane[" << this << "]::drawAlignmentStatus: No reference" << endl; } else if (reference == model) { - std::cerr << "Pane[" << this << "]::drawAlignmentStatus: This is the reference model" << std::endl; + cerr << "Pane[" << this << "]::drawAlignmentStatus: This is the reference model" << endl; } else { - std::cerr << "Pane[" << this << "]::drawAlignmentStatus: This is not the reference" << std::endl; + cerr << "Pane[" << this << "]::drawAlignmentStatus: This is not the reference" << endl; } */ QString text; @@ -883,8 +883,8 @@ std::vector<QPixmap> pixmaps; for (LayerList::iterator i = m_layers.begin(); i != m_layers.end(); ++i) { texts.push_back((*i)->getLayerPresentationName()); -// std::cerr << "Pane " << this << ": Layer presentation name for " << *i << ": " -// << texts[texts.size()-1] << std::endl; +// cerr << "Pane " << this << ": Layer presentation name for " << *i << ": " +// << texts[texts.size()-1] << endl; pixmaps.push_back((*i)->getLayerPresentationPixmap (QSize(fontAscent, fontAscent))); } @@ -901,7 +901,7 @@ for (size_t i = 0; i < texts.size(); ++i) { -// std::cerr << "Pane "<< this << ": text " << i << ": " << texts[i] << std::endl; +// cerr << "Pane "<< this << ": text " << i << ": " << texts[i] << endl; if (i + 1 == texts.size()) { paint.setPen(getForeground()); @@ -1283,7 +1283,7 @@ return; } - // std::cerr << "mousePressEvent" << std::endl; +// cerr << "mousePressEvent" << endl; m_clickPos = e->pos(); m_mousePos = m_clickPos; @@ -1412,7 +1412,7 @@ return; } -// std::cerr << "mouseReleaseEvent" << std::endl; +// cerr << "mouseReleaseEvent" << endl; ViewManager::ToolMode mode = ViewManager::NavigateMode; if (m_manager) mode = m_manager->getToolMode(); @@ -1538,7 +1538,7 @@ return; } -// std::cerr << "mouseMoveEvent" << std::endl; +// cerr << "mouseMoveEvent" << endl; QPoint pos = e->pos(); updateContextHelp(&pos); @@ -1808,11 +1808,11 @@ } float ratio = float(w) / float(width()); -// std::cerr << "ratio: " << ratio << std::endl; +// cerr << "ratio: " << ratio << endl; size_t newZoomLevel = (size_t)nearbyint(m_zoomLevel * ratio); if (newZoomLevel < 1) newZoomLevel = 1; -// std::cerr << "start: " << m_startFrame << ", level " << m_zoomLevel << std::endl; +// cerr << "start: " << m_startFrame << ", level " << m_zoomLevel << endl; setZoomLevel(getZoomConstraintBlockSize(newZoomLevel)); setStartFrame(newStartFrame); @@ -1836,12 +1836,12 @@ } float rmin = min + ((max - min) * (height() - y1)) / height(); float rmax = min + ((max - min) * (height() - y0)) / height(); - std::cerr << "min: " << min << ", max: " << max << ", y0: " << y0 << ", y1: " << y1 << ", h: " << height() << ", rmin: " << rmin << ", rmax: " << rmax << std::endl; + cerr << "min: " << min << ", max: " << max << ", y0: " << y0 << ", y1: " << y1 << ", h: " << height() << ", rmin: " << rmin << ", rmax: " << rmax << endl; if (log) { rmin = powf(10, rmin); rmax = powf(10, rmax); } - std::cerr << "finally: rmin: " << rmin << ", rmax: " << rmax << " " << unit << std::endl; + cerr << "finally: rmin: " << rmin << ", rmax: " << rmax << " " << unit << endl; layer->setDisplayExtents(rmin, rmax); updateVerticalPanner(); @@ -1923,12 +1923,12 @@ if (getTopLayerDisplayExtents(vmin, vmax, dmin, dmax)) { -// std::cerr << "ydiff = " << ydiff << std::endl; +// cerr << "ydiff = " << ydiff << endl; int ydiff = e->y() - m_clickPos.y(); float perpix = (dmax - dmin) / height(); float valdiff = ydiff * perpix; -// std::cerr << "valdiff = " << valdiff << std::endl; +// cerr << "valdiff = " << valdiff << endl; if (m_dragMode == UnresolvedDrag && ydiff != 0) { m_dragMode = VerticalDrag; @@ -1944,8 +1944,8 @@ newmin -= newmax - vmax; newmax -= newmax - vmax; } -// std::cerr << "(" << dmin << ", " << dmax << ") -> (" -// << newmin << ", " << newmax << ") (drag start " << m_dragStartMinValue << ")" << std::endl; +// cerr << "(" << dmin << ", " << dmax << ") -> (" +// << newmin << ", " << newmax << ") (drag start " << m_dragStartMinValue << ")" << endl; setTopLayerDisplayExtents(newmin, newmax); updateVerticalPanner(); @@ -2027,8 +2027,8 @@ layer->snapToFeatureFrame(this, snapFrameRight, resolution, Layer::SnapRight); } - -// std::cerr << "snap: frame = " << mouseFrame << ", start frame = " << m_selectionStartFrame << ", left = " << snapFrameLeft << ", right = " << snapFrameRight << std::endl; + +// cerr << "snap: frame = " << mouseFrame << ", start frame = " << m_selectionStartFrame << ", left = " << snapFrameLeft << ", right = " << snapFrameRight << endl; if (snapFrameLeft < 0) snapFrameLeft = 0; if (snapFrameRight < 0) snapFrameRight = 0; @@ -2091,7 +2091,7 @@ return; } -// std::cerr << "mouseDoubleClickEvent" << std::endl; +// cerr << "mouseDoubleClickEvent" << endl; m_clickPos = e->pos(); m_clickedInRange = true; @@ -2172,7 +2172,7 @@ void Pane::wheelEvent(QWheelEvent *e) { - //std::cerr << "wheelEvent, delta " << e->delta() << std::endl; + //cerr << "wheelEvent, delta " << e->delta() << endl; int count = e->delta(); @@ -2291,13 +2291,13 @@ step *= 2; --pwr; } -// std::cerr << level << std::endl; +// cerr << level << endl; level += step; if (++count == 100 || level > 262144) break; } } -// std::cerr << "new level is " << level << std::endl; +// cerr << "new level is " << level << endl; setZoomLevel(level); } @@ -2329,8 +2329,8 @@ float y1 = y0 + h; float newmax = vmin + ((1.0 - y0) * (vmax - vmin)); float newmin = vmin + ((1.0 - y1) * (vmax - vmin)); -// std::cerr << "verticalPannerMoved: (" << x0 << "," << y0 << "," << w -// << "," << h << ") -> (" << newmin << "," << newmax << ")" << std::endl; +// cerr << "verticalPannerMoved: (" << x0 << "," << y0 << "," << w +// << "," << h << ") -> (" << newmin << "," << newmax << ")" << endl; setTopLayerDisplayExtents(newmin, newmax); } @@ -2370,10 +2370,10 @@ Pane::dragEnterEvent(QDragEnterEvent *e) { QStringList formats(e->mimeData()->formats()); - std::cerr << "dragEnterEvent: format: " - << formats.join(",").toStdString() + cerr << "dragEnterEvent: format: " + << formats.join(",") << ", possibleActions: " << e->possibleActions() - << ", proposedAction: " << e->proposedAction() << std::endl; + << ", proposedAction: " << e->proposedAction() << endl; if (e->mimeData()->hasFormat("text/uri-list") || e->mimeData()->hasFormat("text/plain")) { @@ -2390,8 +2390,8 @@ void Pane::dropEvent(QDropEvent *e) { - std::cerr << "dropEvent: text: \"" << e->mimeData()->text().toStdString() - << "\"" << std::endl; + cerr << "dropEvent: text: \"" << e->mimeData()->text() + << "\"" << endl; if (e->mimeData()->hasFormat("text/uri-list") || e->mimeData()->hasFormat("text/plain")) { @@ -2560,8 +2560,8 @@ void Pane::viewZoomLevelChanged(View *v, unsigned long z, bool locked) { -// std::cerr << "Pane[" << this << "]::zoomLevelChanged (global now " -// << (m_manager ? m_manager->getGlobalZoom() : 0) << ")" << std::endl; +// cerr << "Pane[" << this << "]::zoomLevelChanged (global now " +// << (m_manager ? m_manager->getGlobalZoom() : 0) << ")" << endl; View::viewZoomLevelChanged(v, z, locked);