diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2009-02-08 21:16:37 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2009-02-08 21:16:37 -0300 |
commit | 845493306279f446dbac9568a0a1e0f442e615dd (patch) | |
tree | dbf0a36e50a268b456760ce881a802d28979cc5f /dw | |
parent | 283a7960e615b14c21b7ce757b0fcbe5c945bb95 (diff) |
's/if(/if (/g' 's/for(/for (/g' 's/while(/while (/g', and indentation.
Diffstat (limited to 'dw')
-rw-r--r-- | dw/alignedtextblock.cc | 4 | ||||
-rw-r--r-- | dw/findtext.cc | 4 | ||||
-rw-r--r-- | dw/fltkimgbuf.cc | 6 | ||||
-rw-r--r-- | dw/fltkplatform.cc | 18 | ||||
-rw-r--r-- | dw/fltkpreview.cc | 2 | ||||
-rw-r--r-- | dw/fltkui.cc | 18 | ||||
-rw-r--r-- | dw/fltkviewbase.cc | 12 | ||||
-rw-r--r-- | dw/fltkviewport.cc | 12 | ||||
-rw-r--r-- | dw/image.cc | 6 | ||||
-rw-r--r-- | dw/iterator.cc | 12 | ||||
-rw-r--r-- | dw/layout.cc | 18 | ||||
-rw-r--r-- | dw/style.hh | 8 |
12 files changed, 60 insertions, 60 deletions
diff --git a/dw/alignedtextblock.cc b/dw/alignedtextblock.cc index bb24a3bc..a886aed2 100644 --- a/dw/alignedtextblock.cc +++ b/dw/alignedtextblock.cc @@ -54,7 +54,7 @@ void AlignedTextblock::List::unref(int pos) textblocks->set (pos, NULL); refCount--; - if(refCount == 0) + if (refCount == 0) delete this; } @@ -68,7 +68,7 @@ AlignedTextblock::AlignedTextblock (bool limitTextWidth): void AlignedTextblock::setRefTextblock (AlignedTextblock *ref) { - if(ref == NULL) + if (ref == NULL) list = new List(); else list = ref->list; diff --git a/dw/findtext.cc b/dw/findtext.cc index 93564692..eb7dd2c0 100644 --- a/dw/findtext.cc +++ b/dw/findtext.cc @@ -96,7 +96,7 @@ FindtextState::Result FindtextState::search (const char *key, bool caseSens, if (backwards) { /* Go to end */ - while(iterator->next () ) ; + while (iterator->next () ) ; iterator->prev (); //We don't want to be at CharIterator::END. } else { iterator->next (); @@ -127,7 +127,7 @@ FindtextState::Result FindtextState::search (const char *key, bool caseSens, iterator = new CharIterator (widget); if (backwards) { /* Go to end */ - while(iterator->next ()) ; + while (iterator->next ()) ; iterator->prev (); //We don't want to be at CharIterator::END. } else { iterator->next (); diff --git a/dw/fltkimgbuf.cc b/dw/fltkimgbuf.cc index 835f6e76..96164674 100644 --- a/dw/fltkimgbuf.cc +++ b/dw/fltkimgbuf.cc @@ -124,16 +124,16 @@ inline void FltkImgbuf::scaleRow (int row, const core::byte *data) int sr1 = scaledY (row); int sr2 = scaledY (row + 1); - for(int sr = sr1; sr < sr2; sr++) { + for (int sr = sr1; sr < sr2; sr++) { // Avoid multiple passes. if (copiedRows->get(sr)) continue; copiedRows->set (sr, true); if (sr == sr1) { - for(int px = 0; px < root->width; px++) { + for (int px = 0; px < root->width; px++) { int px1 = px * width / root->width; int px2 = (px+1) * width / root->width; - for(int sp = px1; sp < px2; sp++) { + for (int sp = px1; sp < px2; sp++) { memcpy(rawdata + (sr*width + sp)*bpp, data + px*bpp, bpp); } } diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc index 4338f0a8..64229155 100644 --- a/dw/fltkplatform.cc +++ b/dw/fltkplatform.cc @@ -48,13 +48,13 @@ FltkFont::FltkFont (core::style::FontAttrs *attrs) copyAttrs (attrs); int fa = 0; - if(weight >= 500) + if (weight >= 500) fa |= BOLD; - if(style != core::style::FONT_STYLE_NORMAL) + if (style != core::style::FONT_STYLE_NORMAL) fa |= ITALIC; font = ::fltk::font(name, fa); - if(font == NULL) { + if (font == NULL) { /* * If using xft, fltk::HELVETICA just means sans, fltk::COURIER * means mono, and fltk::TIMES means serif. @@ -242,7 +242,7 @@ FltkPlatform::FltkPlatform () FltkPlatform::~FltkPlatform () { - if(idleFuncRunning) + if (idleFuncRunning) remove_idle (generalStaticIdle, (void*)this); delete idleQueue; delete views; @@ -325,7 +325,7 @@ void FltkPlatform::generalIdle () idleQueue->removeRef(idleFunc); } - if(idleQueue->isEmpty()) { + if (idleQueue->isEmpty()) { idleFuncRunning = false; remove_idle (generalStaticIdle, (void*)this); } @@ -340,7 +340,7 @@ int FltkPlatform::addIdle (void (core::Layout::*func) ()) * Since ... (todo) we have to wrap around fltk_add_idle. There is only one * idle function, the passed idle function is put into a queue. */ - if(!idleFuncRunning) { + if (!idleFuncRunning) { add_idle (generalStaticIdle, (void*)this); idleFuncRunning = true; } @@ -361,15 +361,15 @@ void FltkPlatform::removeIdle (int idleId) container::typed::Iterator <IdleFunc> it; IdleFunc *idleFunc; - for(found = false, it = idleQueue->iterator(); !found && it.hasNext(); ) { + for (found = false, it = idleQueue->iterator(); !found && it.hasNext(); ) { idleFunc = it.getNext(); - if(idleFunc->id == idleId) { + if (idleFunc->id == idleId) { idleQueue->removeRef (idleFunc); found = true; } } - if(idleFuncRunning && idleQueue->isEmpty()) + if (idleFuncRunning && idleQueue->isEmpty()) remove_idle (generalStaticIdle, (void*)this); } diff --git a/dw/fltkpreview.cc b/dw/fltkpreview.cc index 6bed7adf..3c383638 100644 --- a/dw/fltkpreview.cc +++ b/dw/fltkpreview.cc @@ -191,7 +191,7 @@ void FltkPreviewWindow::reallocate () int mx, my, width, height; bool warp = false; - if(preview->canvasHeight * maxWidth > maxHeight * preview->canvasWidth) { + if (preview->canvasHeight * maxWidth > maxHeight * preview->canvasWidth) { // Expand to maximal height (most likely case). width = preview->canvasWidth * maxHeight / preview->canvasHeight; height = maxHeight; diff --git a/dw/fltkui.cc b/dw/fltkui.cc index 250ee981..d1a2c074 100644 --- a/dw/fltkui.cc +++ b/dw/fltkui.cc @@ -91,7 +91,7 @@ FltkResource::~FltkResource () } delete viewsAndWidgets; - if(style) + if (style) style->unref (); } @@ -152,7 +152,7 @@ void FltkResource::draw (core::View *view, core::Rectangle *area) void FltkResource::setStyle (core::style::Style *style) { - if(this->style) + if (this->style) this->style->unref (); this->style = style; @@ -324,12 +324,12 @@ static core::ButtonState getDwButtonState () int s1 = ::fltk::event_state (); int s2 = (core::ButtonState)0; - if(s1 & ::fltk::SHIFT) s2 |= core::SHIFT_MASK; - if(s1 & ::fltk::CTRL) s2 |= core::CONTROL_MASK; - if(s1 & ::fltk::ALT) s2 |= core::META_MASK; - if(s1 & ::fltk::BUTTON1) s2 |= core::BUTTON1_MASK; - if(s1 & ::fltk::BUTTON2) s2 |= core::BUTTON2_MASK; - if(s1 & ::fltk::BUTTON3) s2 |= core::BUTTON3_MASK; + if (s1 & ::fltk::SHIFT) s2 |= core::SHIFT_MASK; + if (s1 & ::fltk::CTRL) s2 |= core::CONTROL_MASK; + if (s1 & ::fltk::ALT) s2 |= core::META_MASK; + if (s1 & ::fltk::BUTTON1) s2 |= core::BUTTON1_MASK; + if (s1 & ::fltk::BUTTON2) s2 |= core::BUTTON2_MASK; + if (s1 & ::fltk::BUTTON3) s2 |= core::BUTTON3_MASK; return (core::ButtonState)s2; } @@ -1117,7 +1117,7 @@ template <class I> void FltkSelectionResource<I>::pushGroup (const char *name, ::fltk::ItemGroup *group = item->createNewGroupWidget (); widgetStack->stack->getTop()->getTypedValue()->add (group); widgetStack->stack->push (new TypedPointer < ::fltk::Menu> (group)); - if(!enabled) + if (!enabled) group->deactivate (); } } diff --git a/dw/fltkviewbase.cc b/dw/fltkviewbase.cc index ad1b3bc7..ae43b352 100644 --- a/dw/fltkviewbase.cc +++ b/dw/fltkviewbase.cc @@ -178,12 +178,12 @@ core::ButtonState getDwButtonState () int s1 = event_state (); int s2 = (core::ButtonState)0; - if(s1 & SHIFT) s2 |= core::SHIFT_MASK; - if(s1 & CTRL) s2 |= core::CONTROL_MASK; - if(s1 & ALT) s2 |= core::META_MASK; - if(s1 & BUTTON1) s2 |= core::BUTTON1_MASK; - if(s1 & BUTTON2) s2 |= core::BUTTON2_MASK; - if(s1 & BUTTON3) s2 |= core::BUTTON3_MASK; + if (s1 & SHIFT) s2 |= core::SHIFT_MASK; + if (s1 & CTRL) s2 |= core::CONTROL_MASK; + if (s1 & ALT) s2 |= core::META_MASK; + if (s1 & BUTTON1) s2 |= core::BUTTON1_MASK; + if (s1 & BUTTON2) s2 |= core::BUTTON2_MASK; + if (s1 & BUTTON3) s2 |= core::BUTTON3_MASK; return (core::ButtonState)s2; } diff --git a/dw/fltkviewport.cc b/dw/fltkviewport.cc index 411c9566..8e3eea71 100644 --- a/dw/fltkviewport.cc +++ b/dw/fltkviewport.cc @@ -105,8 +105,8 @@ void FltkViewport::adjustScrollbarsAndGadgetsAllocation () vscrollbar->w (SCROLLBAR_THICKNESS); int x = w () - SCROLLBAR_THICKNESS, y = h () - SCROLLBAR_THICKNESS; - for(Iterator <TypedPointer < ::fltk::Widget> > it = gadgets->iterator (); - it.hasNext (); ) { + for (Iterator <TypedPointer < ::fltk::Widget> > it = gadgets->iterator (); + it.hasNext (); ) { ::fltk::Widget *widget = it.getNext()->getTypedValue (); widget->x (0); widget->y (0); @@ -168,10 +168,10 @@ void FltkViewport::draw_area (void *data, const Rectangle& cr ) vp->FltkWidgetView::draw (); - for(Iterator <TypedPointer < ::fltk::Widget> > it = vp->gadgets->iterator (); - it.hasNext (); ) { - ::fltk::Widget *widget = it.getNext()->getTypedValue (); - vp->draw_child (*widget); + for (Iterator <TypedPointer < ::fltk::Widget> > it = vp->gadgets->iterator(); + it.hasNext (); ) { + ::fltk::Widget *widget = it.getNext()->getTypedValue (); + vp->draw_child (*widget); } pop_clip(); diff --git a/dw/image.cc b/dw/image.cc index bd8a1f4e..82fe7252 100644 --- a/dw/image.cc +++ b/dw/image.cc @@ -167,7 +167,7 @@ void Image::sizeRequestImpl (core::Requisition *requisition) } requisition->descent = 0; } else { - if(altText && altText[0]) { + if (altText && altText[0]) { if (altTextWidth == -1) altTextWidth = layout->textWidth (getStyle()->font, altText, strlen (altText)); @@ -310,7 +310,7 @@ void Image::draw (core::View *view, core::Rectangle *area) intersection.x - dx, intersection.y - dy, intersection.width, intersection.height); } else { - if(altText && altText[0]) { + if (altText && altText[0]) { if (altTextWidth == -1) altTextWidth = layout->textWidth (getStyle()->font, altText, strlen (altText)); @@ -335,7 +335,7 @@ void Image::draw (core::View *view, core::Rectangle *area) + getStyle()->font->ascent, altText, strlen(altText)); - if(clippingView) + if (clippingView) view->mergeClippingView (clippingView); } } diff --git a/dw/iterator.cc b/dw/iterator.cc index 39e09d41..41c2c444 100644 --- a/dw/iterator.cc +++ b/dw/iterator.cc @@ -210,7 +210,7 @@ int EmptyIterator::compareTo (misc::Comparable *other) if (content.type == otherIt->content.type) return 0; - else if(content.type == Content::START) + else if (content.type == Content::START) return -1; else return +1; @@ -487,7 +487,7 @@ DeepIterator::DeepIterator (Iterator *it) //DEBUG_MSG (1, " => %s\n", a_Dw_iterator_text (it)); - if(hasContents) { + if (hasContents) { // If this widget has parents, we must construct appropriate iterators. // // \todo There may be a faster way instead of iterating through the @@ -679,7 +679,7 @@ bool CharIterator::next () if (ch == START || it->getContent()->type == Content::BREAK || (it->getContent()->type == Content::TEXT && it->getContent()->text[pos] == 0)) { - if(it->next()) { + if (it->next()) { if (it->getContent()->type == Content::BREAK) ch = '\n'; else { // if (it->getContent()->type == Content::TEXT) @@ -695,7 +695,7 @@ bool CharIterator::next () ch = END; return false; } - } else if(ch == END) + } else if (ch == END) return false; else { // at this point, it->getContent()->type == Content::TEXT @@ -717,7 +717,7 @@ bool CharIterator::prev () { if (ch == END || it->getContent()->type == Content::BREAK || (it->getContent()->type == Content::TEXT && pos == 0)) { - if(it->prev()) { + if (it->prev()) { if (it->getContent()->type == Content::BREAK) ch = '\n'; else { // if (it->getContent()->type == Content::TEXT) @@ -739,7 +739,7 @@ bool CharIterator::prev () ch = START; return false; } - } else if(ch == START) + } else if (ch == START) return false; else { // at this point, it->getContent()->type == Content::TEXT diff --git a/dw/layout.cc b/dw/layout.cc index 2fc83c97..c0652d6c 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -706,7 +706,7 @@ void Layout::enterNotify (View *view, int x, int y, ButtonState state) lastWidget = widgetAtPoint; moveToWidgetAtPoint (x, y, state); - if(widgetAtPoint) { + if (widgetAtPoint) { event.state = state; event.lastWidget = lastWidget; event.currentWidget = widgetAtPoint; @@ -727,7 +727,7 @@ void Layout::leaveNotify (View *view, ButtonState state) lastWidget = widgetAtPoint; moveOutOfView (state); - if(lastWidget) { + if (lastWidget) { event.state = state; event.lastWidget = lastWidget; event.currentWidget = widgetAtPoint; @@ -765,7 +765,7 @@ void Layout::moveToWidget (Widget *newWidgetAtPoint, ButtonState state) if (newWidgetAtPoint && widgetAtPoint) ancestor = newWidgetAtPoint->getNearestCommonAncestor (widgetAtPoint); - else if(newWidgetAtPoint) + else if (newWidgetAtPoint) ancestor = newWidgetAtPoint->getTopLevel (); else ancestor = widgetAtPoint->getTopLevel (); @@ -777,7 +777,7 @@ void Layout::moveToWidget (Widget *newWidgetAtPoint, ButtonState state) for (w = widgetAtPoint; w != ancestor; w = w->getParent ()) trackLen++; trackLen++; // for the ancestor - if(newWidgetAtPoint) + if (newWidgetAtPoint) // second part for (w = newWidgetAtPoint; w != ancestor; w = w->getParent ()) trackLen++; @@ -789,7 +789,7 @@ void Layout::moveToWidget (Widget *newWidgetAtPoint, ButtonState state) for (w = widgetAtPoint; w != ancestor; w = w->getParent ()) track[i++] = w; track[i++] = ancestor; - if(newWidgetAtPoint) { + if (newWidgetAtPoint) { /* second part */ i = trackLen - 1; for (w = newWidgetAtPoint; w != ancestor; w = w->getParent ()) @@ -827,7 +827,7 @@ bool Layout::processMouseEvent (MousePositionEvent *event, Widget *widget; for (widget = widgetAtPoint; widget; widget = widget->getParent ()) { - if(!mayBeSuppressed || widget->isButtonSensitive ()) { + if (!mayBeSuppressed || widget->isButtonSensitive ()) { event->xWidget = event->xCanvas - widget->getAllocation()->x; event->yWidget = event->yCanvas - widget->getAllocation()->y; @@ -865,7 +865,7 @@ void Layout::scrollPosChanged (View *view, int x, int y) for (container::typed::Iterator <View> it = views->iterator (); it.hasNext (); ) { View *thisView = it.getNext(); - if(view != thisView && thisView->usesViewport ()) + if (view != thisView && thisView->usesViewport ()) thisView->scrollTo (scrollX, scrollY); } @@ -885,7 +885,7 @@ void Layout::viewportSizeChanged (View *view, int width, int height) /* If the width has become higher, we test again, whether the vertical * scrollbar (so to speak) can be hidden again. */ - if(usesViewport && width > viewportWidth) + if (usesViewport && width > viewportWidth) canvasHeightGreater = false; /* if size changes, redraw this view. @@ -907,7 +907,7 @@ void Layout::viewportSizeChanged (View *view, int width, int height) for (container::typed::Iterator <View> it = views->iterator (); it.hasNext (); ) { View *thisView = it.getNext(); - if(view != thisView && thisView->usesViewport ()) + if (view != thisView && thisView->usesViewport ()) thisView->setViewportSize (viewportWidth, viewportHeight, actualHScrollbarThickness, actualVScrollbarThickness); diff --git a/dw/style.hh b/dw/style.hh index 9e6672bb..e8897b36 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -503,7 +503,7 @@ public: } inline void ref () { refCount++; } - inline void unref () { if(--refCount == 0) delete this; } + inline void unref () { if (--refCount == 0) delete this; } }; @@ -532,7 +532,7 @@ public: inline void ref () { refCount++; } inline void unref () - { if(--refCount == 0) delete this; } + { if (--refCount == 0) delete this; } inline void onEnter () { } inline void onLeave () { } @@ -582,7 +582,7 @@ public: char *defaultFamily); inline void ref () { refCount++; } - inline void unref () { if(--refCount == 0) delete this; } + inline void unref () { if (--refCount == 0) delete this; } }; @@ -635,7 +635,7 @@ public: inline void ref () { refCount++; } inline void unref () - { if(--refCount == 0) delete this; } + { if (--refCount == 0) delete this; } }; void drawBorder (View *view, Rectangle *area, |