diff options
Diffstat (limited to 'dw')
-rw-r--r-- | dw/fltkimgbuf.cc | 22 | ||||
-rw-r--r-- | dw/imgrenderer.hh | 6 | ||||
-rw-r--r-- | dw/layout.cc | 24 | ||||
-rw-r--r-- | dw/style.cc | 32 | ||||
-rw-r--r-- | dw/style.hh | 4 | ||||
-rw-r--r-- | dw/table.cc | 2 |
6 files changed, 45 insertions, 45 deletions
diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc index e537c761..26b46969 100644 --- a/dw/fltkimgbuf.cc +++ b/dw/fltkimgbuf.cc @@ -52,10 +52,10 @@ uchar *FltkImgbuf::findGammaCorrectionTable (double gamma) } _MSG("Creating new table for gamma = %g\n", gamma); - + GammaCorrectionTable *gct = new GammaCorrectionTable(); gct->gamma = gamma; - + for (int i = 0; i < 256; i++) gct->map[i] = 255 * pow((double)i / 255, gamma); @@ -107,7 +107,7 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma, } else if (width > MAX_WIDTH) { // Too large dimensions cause dangerous overflow errors, so we // limit dimensions to harmless values. - // + // // Example: 65535 * 65536 / 65536 (see scaling below) results in // the negative value -1. @@ -140,11 +140,11 @@ void FltkImgbuf::init (Type type, int width, int height, double gamma, rawdata = new uchar[bpp * width * height]; // Set light-gray as interim background color. memset(rawdata, 222, width*height*bpp); - + refCount = 1; deleteOnUnref = true; copiedRows = new lout::misc::BitSet (height); - + // The list is only used for root buffers. if (isRoot()) scaledBuffers = new lout::container::typed::List <FltkImgbuf> (true); @@ -308,15 +308,15 @@ inline void FltkImgbuf::scaleBuffer (const core::byte *src, int srcWidth, int v[bpp]; for(int i = 0; i < bpp; i++) v[i] = 0; - + for(int xo = xo1; xo < xo2; xo++) for(int yo = yo1; yo < yo2; yo++) { const core::byte *ps = src + bpp * (yo * srcWidth + xo); for(int i = 0; i < bpp; i++) - v[i] += + v[i] += (scaleMode == BEAUTIFUL_GAMMA ? gammaMap2[ps[i]] : ps[i]); } - + core::byte *pd = dest + bpp * (y * destWidth + x); for(int i = 0; i < bpp; i++) pd[i] = @@ -332,7 +332,7 @@ void FltkImgbuf::copyRow (int row, const core::byte *data) // Flag the row done and copy its data. copiedRows->set (row, true); memcpy(rawdata + row * width * bpp, data, width * bpp); - + // Update all the scaled buffers of this root image. for (Iterator <FltkImgbuf> it = scaledBuffers->iterator(); it.hasNext(); ) { @@ -417,7 +417,7 @@ void FltkImgbuf::getRowArea (int row, dw::core::Rectangle *area) // scaled buffer int sr1 = scaledY (row); int sr2 = scaledY (row + 1); - + area->x = 0; area->y = sr1; area->width = width; @@ -533,7 +533,7 @@ int FltkImgbuf::scaledY(int ySrc) int FltkImgbuf::backscaledY(int yScaled) { assert (root != NULL); - + // Notice that rounding errors because of integers do not play a // role. This method cannot be the exact inverse of scaledY, since // scaleY is not bijective, and so not invertible. Instead, both diff --git a/dw/imgrenderer.hh b/dw/imgrenderer.hh index 325a1998..e3b5e95e 100644 --- a/dw/imgrenderer.hh +++ b/dw/imgrenderer.hh @@ -18,14 +18,14 @@ class ImgRenderer public: virtual ~ImgRenderer () { } - /** + /** * \brief Called, when an image buffer is attached. * * This is typically the case when all meta data (size, depth) has been read. */ virtual void setBuffer (core::Imgbuf *buffer, bool resize = false) = 0; - /** + /** * \brief Called, when data from a row is available and has been copied into * the image buffer. * @@ -40,7 +40,7 @@ public: * limit the number of draws. */ virtual void finish () = 0; - + /** * \brief Called, when there are problems with the retrieval of image data. * diff --git a/dw/layout.cc b/dw/layout.cc index d83b2e8a..6f2e8d8b 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -88,7 +88,7 @@ void Layout::LayoutImgRenderer::draw (int x, int y, int width, int height) { layout->queueDraw (x, y, width, height); } - + // ---------------------------------------------------------------------- void Layout::Receiver::canvasSizeChanged (int width, int ascent, int descent) @@ -753,10 +753,10 @@ void Layout::setBgImage (style::StyleImage *bgImage, if (bgImage) bgImage->ref (); - + if (this->bgImage) this->bgImage->unref (); - + this->bgImage = bgImage; this->bgRepeat = bgRepeat; this->bgAttachment = bgAttachment; @@ -784,33 +784,33 @@ void Layout::resizeIdle () // Reset already here, since in this function, queueResize() may be // called again. resizeIdleId = -1; - + if (topLevel) { Requisition requisition; Allocation allocation; - + topLevel->sizeRequest (&requisition); - + allocation.x = allocation.y = 0; allocation.width = requisition.width; allocation.ascent = requisition.ascent; allocation.descent = requisition.descent; topLevel->sizeAllocate (&allocation); - + canvasWidth = requisition.width; canvasAscent = requisition.ascent; canvasDescent = requisition.descent; - + emitter.emitCanvasSizeChanged (canvasWidth, canvasAscent, canvasDescent); - + // Tell the view about the new world size. view->setCanvasSize (canvasWidth, canvasAscent, canvasDescent); // view->queueDrawTotal (false); - + if (usesViewport) { int currHThickness = currHScrollbarThickness(); int currVThickness = currVScrollbarThickness(); - + if (!canvasHeightGreater && canvasAscent + canvasDescent > viewportHeight - currHThickness) { @@ -818,7 +818,7 @@ void Layout::resizeIdle () setSizeHints (); /* May queue a new resize. */ } - + // Set viewport sizes. view->setViewportSize (viewportWidth, viewportHeight, currHThickness, currVThickness); diff --git a/dw/style.cc b/dw/style.cc index 3a01d903..8ec230a1 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -546,7 +546,7 @@ void StyleImage::StyleImgRenderer::drawRow (int row) int w = image->imgbufSrc->getRootWidth (); int h = image->imgbufSrc->getRootHeight (); - + for (int x = 0; x < image->tilesX; x++) for (int y = 0; y < image->tilesX; y++) image->imgbufSrc->copyTo (image->imgbufTiled, x * w, y * h, @@ -602,20 +602,20 @@ void StyleImage::ExternalImgRenderer::drawRow (int row) StyleImage *backgroundImage; if (readyToDraw () && (backgroundImage = getBackgroundImage ())) { // All single rows are drawn. - + Imgbuf *imgbuf = backgroundImage->getImgbufSrc(); int imgWidth = imgbuf->getRootWidth (); int imgHeight = imgbuf->getRootHeight (); - + int x, y, width, height; getBgArea (&x, &y, &width, &height); - + int xRef, yRef, widthRef, heightRef; getRefArea (&xRef, &yRef, &widthRef, &heightRef); - + bool repeatX, repeatY, doDraw; int origX, origY, tileX1, tileX2, tileY1, tileY2; - + calcBackgroundRelatedValues (backgroundImage, getBackgroundRepeat (), getBackgroundAttachment (), @@ -635,7 +635,7 @@ void StyleImage::ExternalImgRenderer::drawRow (int row) for (int tileY = tileY1; tileY <= tileY2; tileY++) { int x1 = misc::max (origX + tileX1 * imgWidth, x); int x2 = misc::min (origX + (tileX2 + 1) * imgWidth, x + width); - + int yt = origY + tileY * imgHeight + row; if (yt >= y && yt < y + height) draw (x1, yt, x2 - x1, 1); @@ -1196,7 +1196,7 @@ void drawBackground (View *view, Layout *layout, Rectangle *area, Color::SHADING_INVERSE : Color::SHADING_NORMAL, true, intersection.x, intersection.y, intersection.width, intersection.height); - + if (bgImage) drawBackgroundImage (view, style->backgroundImage, style->backgroundRepeat, @@ -1206,7 +1206,7 @@ void drawBackground (View *view, Layout *layout, Rectangle *area, intersection.x, intersection.y, intersection.width, intersection.height, xRef, yRef, widthRef, heightRef); - + } } } @@ -1225,7 +1225,7 @@ void drawBackgroundImage (View *view, StyleImage *backgroundImage, bool repeatX, repeatY, doDraw; int origX, origY, tileX1, tileX2, tileY1, tileY2; - + calcBackgroundRelatedValues (backgroundImage, backgroundRepeat, backgroundAttachment, backgroundPositionX, backgroundPositionY, x, y, width, height, @@ -1258,8 +1258,8 @@ void drawBackgroundImage (View *view, StyleImage *backgroundImage, int yt = origY + tileY * imgHeightS; int y1 = misc::max (yt, y); int y2 = misc::min (yt + imgHeightT, y + height); - - view->drawImage (imgbufT, xt, yt, x1 - xt, y1 - yt, + + view->drawImage (imgbufT, xt, yt, x1 - xt, y1 - yt, x2 - x1, y2 - y1); } } @@ -1285,7 +1285,7 @@ void calcBackgroundRelatedValues (StyleImage *backgroundImage, backgroundRepeat == BACKGROUND_REPEAT_X; *repeatY = backgroundRepeat == BACKGROUND_REPEAT || backgroundRepeat == BACKGROUND_REPEAT_Y; - + *origX = xRef + (isPerLength (backgroundPositionX) ? multiplyWithPerLength (widthRef - imgWidth, backgroundPositionX) : @@ -1294,7 +1294,7 @@ void calcBackgroundRelatedValues (StyleImage *backgroundImage, (isPerLength (backgroundPositionY) ? multiplyWithPerLength (heightRef - imgHeight, backgroundPositionY) : absLengthVal (backgroundPositionY)); - + *tileX1 = xDraw < *origX ? - (*origX - xDraw + imgWidth - 1) / imgWidth : (xDraw - *origX) / imgWidth; @@ -1307,7 +1307,7 @@ void calcBackgroundRelatedValues (StyleImage *backgroundImage, *tileY2 = *origY < yDraw + heightDraw ? (yDraw + heightDraw - *origY - 1) / imgHeight : - (*origY - (yDraw + heightDraw) + imgHeight - 1) / imgHeight; - + *doDraw = true; if (!*repeatX) { // Only center tile (tileX = 0) is drawn, ... @@ -1318,7 +1318,7 @@ void calcBackgroundRelatedValues (StyleImage *backgroundImage, // ... but is not visible. *doDraw = false; } - + if (!*repeatY) { // Analogue. if (*tileY1 <= 0 && *tileY2 >= 0) diff --git a/dw/style.hh b/dw/style.hh index 7127b6db..e0ce9d89 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -448,7 +448,7 @@ inline int multiplyWithRelLength(int x, Length l) { return x * relLengthVal(l); } - + enum { /** \brief Represents "auto" lengths. */ LENGTH_AUTO = 0 @@ -813,7 +813,7 @@ public: { public: void getPaddingArea (int *x, int *y, int *width, int *height); - + StyleImage *getBackgroundImage (); BackgroundRepeat getBackgroundRepeat (); BackgroundAttachment getBackgroundAttachment (); diff --git a/dw/table.cc b/dw/table.cc index 6fe0da8b..b6f7209b 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -1072,7 +1072,7 @@ void Table::apportion_percentages2(int totalWidth, int forceTotalWidth) for (int col = 0; col < numCols; col++) { if (core::style::isPerLength (colPercents->get(col))) { // This could cause rounding errors: - // + // // int d = // core::dw::multiplyWithPerLength (extraWidth, // colPercents->get(col)) |