Beispiel #1
0
 void WallConfig::print() const
 {
   std::cout << "WallConfig:" << std::endl;
   std::cout << " - num displays : " 
             << numDisplays.x << "x" << numDisplays.y
             << " (" << displayCount() << " displays)" << std::endl;
   std::cout << " - pixels/diplay: " 
             << pixelsPerDisplay.x << "x" << pixelsPerDisplay.y << std::endl;
   std::cout << " - bezel width "
             << "x:" << int(100.f*relativeBezelWidth.x) << "%, "
             << "y:" << int(100.f*relativeBezelWidth.y) << "%";
   std::cout << " ("
             << "x:" << int(pixelsPerDisplay.x*relativeBezelWidth.x) << "pix, "
             << "y:" << int(pixelsPerDisplay.y*relativeBezelWidth.y) << "pix)" 
             << std::endl;
   std::cout << " - total pixels : " 
             << totalPixels().x << "x" << totalPixels().y
             << " (" << prettyNumber(totalPixelCount()) << "pix)" << std::endl;
 }
Beispiel #2
0
void ByteViewText::updateScrollbars()
{
    const gint length = tvb_ ? tvb_captured_length(tvb_) : 0;
    if (tvb_) {
    }

    qint64 maxval = length / row_width_ + ((length % row_width_) ? 1 : 0) - viewport()->height() / line_spacing_;

    verticalScrollBar()->setRange(0, qMax((qint64)0, maxval));
    horizontalScrollBar()->setRange(0, qMax(0, static_cast<int>((totalPixels() - viewport()->width()) / font_width_)));
}
Beispiel #3
0
 /*! returns range of displays that are affected by the given
   region of pixels (ie, that together are guaranteed to cover
   that pixel region */
 box2i  WallConfig::affectedDisplays(const box2i &pixelRegion) const
 {
   vec2i lo
     = (pixelRegion.lower+bezelPixelsPerDisplay())
     / (pixelsPerDisplay+bezelPixelsPerDisplay());
   vec2i hi
     = (pixelRegion.upper + pixelsPerDisplay - vec2i(1)) 
     / (pixelsPerDisplay+bezelPixelsPerDisplay());
   // vec2i hi
   // = divRoundUp(pixelRegion.upper,pixelsPerDisplay+bezelPixelsPerDisplay());
   if (hi.x > numDisplays.x || hi.y > numDisplays.y) {
     PING; 
     PRINT(pixelRegion);
     PRINT(totalPixels());
     throw std::runtime_error("invalid region in 'affectedDispalys()')");
   }
   return box2i(lo,hi);
 }