Skip to content

Commit

Permalink
SDK|Cleanup: Whitespace style refresh
Browse files Browse the repository at this point in the history
Use a space in `if`, `for`, etc. statements after the keyword.
This commit only contains whitespace changes.
  • Loading branch information
skyjake committed May 31, 2016
1 parent b0fcfe7 commit 8755d23
Show file tree
Hide file tree
Showing 319 changed files with 4,923 additions and 4,923 deletions.
Expand Up @@ -67,7 +67,7 @@ class LIBAPPFW_PUBLIC AtlasProceduralImage : public ProceduralImage

void release()
{
if(_atlas)
if (_atlas)
{
_atlas->release(_id);
_atlas = 0;
Expand All @@ -83,7 +83,7 @@ class LIBAPPFW_PUBLIC AtlasProceduralImage : public ProceduralImage

bool update()
{
if(_needUpdate)
if (_needUpdate)
{
alloc();
_needUpdate = false;
Expand All @@ -104,7 +104,7 @@ class LIBAPPFW_PUBLIC AtlasProceduralImage : public ProceduralImage

void glMakeGeometry(DefaultVertexBuf::Builder &verts, Rectanglef const &rect)
{
if(_atlas)
if (_atlas)
{
verts.makeQuad(rect, color(), _atlas->imageRectf(_id));
}
Expand Down
8 changes: 4 additions & 4 deletions doomsday/sdk/libappfw/include/de/framework/guiwidgetprivate.h
Expand Up @@ -70,7 +70,7 @@ class GuiWidgetPrivate : public Private<PublicType>,

void forgetRootAtlas()
{
if(_observingAtlas)
if (_observingAtlas)
{
_observingAtlas->audienceForReposition() -= this;
_observingAtlas->Asset::audienceForDeletion() -= this;
Expand All @@ -80,7 +80,7 @@ class GuiWidgetPrivate : public Private<PublicType>,

void observeRootAtlas() const
{
if(!_observingAtlas)
if (!_observingAtlas)
{
// Automatically start observing the root atlas.
_observingAtlas = &root().atlas();
Expand Down Expand Up @@ -129,7 +129,7 @@ class GuiWidgetPrivate : public Private<PublicType>,

void atlasContentRepositioned(Atlas &atlas)
{
if(_observingAtlas == &atlas)
if (_observingAtlas == &atlas)
{
// Make sure the new texture coordinates get used by the widget.
Base::self.requestGeometry();
Expand All @@ -138,7 +138,7 @@ class GuiWidgetPrivate : public Private<PublicType>,

void assetBeingDeleted(Asset &a)
{
if(_observingAtlas == &a)
if (_observingAtlas == &a)
{
_observingAtlas = nullptr;
}
Expand Down
Expand Up @@ -36,7 +36,7 @@ class StyleProceduralImage : public ProceduralImage
StyleProceduralImage(DotPath const &styleImageId, GuiWidget &owner, float angle = 0)
: _owner(owner), _imageId(styleImageId), _id(Id::None), _angle(angle)
{
if(_owner.hasRoot())
if (_owner.hasRoot())
{
// We can set this up right away.
alloc();
Expand Down Expand Up @@ -81,7 +81,7 @@ class StyleProceduralImage : public ProceduralImage

void glMakeGeometry(DefaultVertexBuf::Builder &verts, Rectanglef const &rect)
{
if(!_id.isNone())
if (!_id.isNone())
{
Matrix4f turn = Matrix4f::rotateAround(rect.middle(), _angle);
verts.makeQuad(rect, color(), root().atlas().imageRectf(_id), &turn);
Expand Down
10 changes: 5 additions & 5 deletions doomsday/sdk/libappfw/include/de/ui/defs.h
Expand Up @@ -41,7 +41,7 @@ enum Direction
};

inline Direction opposite(Direction dir) {
switch(dir) {
switch (dir) {
case Left: return Right;
case Right: return Left;
case Up: return Down;
Expand Down Expand Up @@ -85,20 +85,20 @@ typename RectType::Corner applyAlignment(Alignment align, SizeType const &size,
{
typename RectType::Corner p = bounds.topLeft;

if(align.testFlag(AlignRight))
if (align.testFlag(AlignRight))
{
p.x += int(bounds.width()) - int(size.x);
}
else if(!align.testFlag(AlignLeft))
else if (!align.testFlag(AlignLeft))
{
p.x += (int(bounds.width()) - int(size.x)) / 2;
}

if(align.testFlag(AlignBottom))
if (align.testFlag(AlignBottom))
{
p.y += int(bounds.height()) - int(size.y);
}
else if(!align.testFlag(AlignTop))
else if (!align.testFlag(AlignTop))
{
p.y += de::floor((double(bounds.height()) - double(size.y)) / 2.0);
}
Expand Down
4 changes: 2 additions & 2 deletions doomsday/sdk/libappfw/include/de/widgets/menuwidget.h
Expand Up @@ -112,8 +112,8 @@ class LIBAPPFW_PUBLIC MenuWidget : public ScrollAreaWidget, public IAssetGroup

template <typename WidgetType>
WidgetType *itemWidget(ui::DataPos itemPos) const {
if(itemPos < items().size()) {
if(auto *widget = organizer().itemWidget(items().at(itemPos))) {
if (itemPos < items().size()) {
if (auto *widget = organizer().itemWidget(items().at(itemPos))) {
return widget->maybeAs<WidgetType>();
}
}
Expand Down
Expand Up @@ -77,7 +77,7 @@ class LIBAPPFW_PUBLIC NotificationAreaWidget : public GuiWidget
void hideChild(GuiWidget &notif);

void showOrHide(GuiWidget &notif, bool doShow) {
if(doShow) showChild(notif); else hideChild(notif);
if (doShow) showChild(notif); else hideChild(notif);
}

bool isChildShown(GuiWidget &notif) const;
Expand Down
10 changes: 5 additions & 5 deletions doomsday/sdk/libappfw/src/baseguiapp.cpp
Expand Up @@ -43,7 +43,7 @@ static Value *Function_App_LoadFont(Context &, Function::ArgumentValues const &a
Block data(App::rootFolder().locate<File const>(args.at(0)->asText()));
int id;
id = QFontDatabase::addApplicationFontFromData(data);
if(id < 0)
if (id < 0)
{
LOG_RES_WARNING("Failed to load font:");
}
Expand All @@ -54,7 +54,7 @@ static Value *Function_App_LoadFont(Context &, Function::ArgumentValues const &a
//qDebug() << "Families:" << QFontDatabase::applicationFontFamilies(id);
}
}
catch(Error const &er)
catch (Error const &er)
{
LOG_RES_WARNING("Failed to load font:\n") << er.asText();
}
Expand All @@ -76,7 +76,7 @@ static Value *Function_App_AddFontMapping(Context &, Function::ArgumentValues co
{
NativeFont::Spec spec;
ArrayValue const &key = i->first.value->as<ArrayValue>();
if(key.at(0).asText() == "italic")
if (key.at(0).asText() == "italic")
{
spec.style = NativeFont::Italic;
}
Expand Down Expand Up @@ -104,7 +104,7 @@ DENG2_PIMPL_NOREF(BaseGuiApp)
// Use the Direct2D API to find out the desktop DPI factor.
ID2D1Factory *d2dFactory = nullptr;
HRESULT hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &d2dFactory);
if(SUCCEEDED(hr))
if (SUCCEEDED(hr))
{
FLOAT dpiX = 96;
FLOAT dpiY = 96;
Expand Down Expand Up @@ -146,7 +146,7 @@ void BaseGuiApp::initSubsystems(SubsystemInitFlags flags)
#endif

// The "-dpi" option overrides the detected DPI factor.
if(auto dpi = commandLine().check("-dpi", 1))
if (auto dpi = commandLine().check("-dpi", 1))
{
d->dpiFactor = dpi.params.at(0).toDouble();
}
Expand Down
18 changes: 9 additions & 9 deletions doomsday/sdk/libappfw/src/basewindow.cpp
Expand Up @@ -55,7 +55,7 @@ DENG2_PIMPL(BaseWindow)
/// subsystem passes it to window system. -jk

// Pass the event onto the window system.
if(!WindowSystem::get().processEvent(ev))
if (!WindowSystem::get().processEvent(ev))
{
// Maybe the fallback handler has use for this.
self.handleFallbackEvent(ev);
Expand All @@ -67,14 +67,14 @@ DENG2_PIMPL(BaseWindow)
MouseEvent ev = event;

// Translate mouse coordinates for direct interaction.
if(ev.type() == Event::MousePosition ||
if (ev.type() == Event::MousePosition ||
ev.type() == Event::MouseButton ||
ev.type() == Event::MouseWheel)
{
ev.setPos(xf->windowToLogicalCoords(event.pos()).toVector2i());
}

if(!WindowSystem::get().processEvent(ev))
if (!WindowSystem::get().processEvent(ev))
{
// Maybe the fallback handler has use for this.
self.handleFallbackEvent(ev);
Expand Down Expand Up @@ -118,17 +118,17 @@ bool BaseWindow::prepareForDraw()

void BaseWindow::draw()
{
if(!prepareForDraw())
if (!prepareForDraw())
{
// Not right now, please.
return;
}

// Initialize Oculus Rift if needed.
auto &vr = DENG2_BASE_GUI_APP->vr();
if(vr.mode() == VRConfig::OculusRift)
if (vr.mode() == VRConfig::OculusRift)
{
if(canvas().isGLReady())
if (canvas().isGLReady())
{
canvas().makeCurrent();
vr.oculusRift().init();
Expand All @@ -140,7 +140,7 @@ void BaseWindow::draw()
vr.oculusRift().deinit();
}

if(shouldRepaintManually())
if (shouldRepaintManually())
{
DENG2_ASSERT_IN_MAIN_THREAD();

Expand Down Expand Up @@ -175,7 +175,7 @@ void BaseWindow::swapBuffers()
void BaseWindow::preDraw()
{
auto &vr = DENG2_BASE_GUI_APP->vr();
if(vr.mode() == VRConfig::OculusRift)
if (vr.mode() == VRConfig::OculusRift)
{
vr.oculusRift().beginFrame();
}
Expand All @@ -184,7 +184,7 @@ void BaseWindow::preDraw()
void BaseWindow::postDraw()
{
auto &vr = DENG2_BASE_GUI_APP->vr();
if(vr.mode() == VRConfig::OculusRift)
if (vr.mode() == VRConfig::OculusRift)
{
vr.oculusRift().endFrame();
}
Expand Down

0 comments on commit 8755d23

Please sign in to comment.