Skip to content

Commit

Permalink
Cleanup: Renamed audience notification macros
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent f82a10c commit a11a985
Show file tree
Hide file tree
Showing 148 changed files with 321 additions and 321 deletions.
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/audio/base/s_cache.cpp
Expand Up @@ -476,7 +476,7 @@ DE_PIMPL(SfxSampleCache)
*/
void notifyRemove(CacheItem &item)
{
DE_FOR_PUBLIC_AUDIENCE(SampleRemove, i)
DE_NOTIFY_PUBLIC(SampleRemove, i)
{
i->sfxSampleCacheAboutToRemove(item.sample);
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/busyrunner.cpp
Expand Up @@ -341,7 +341,7 @@ void BusyRunner::loop()
bool pendingRemain = false;
if (ClientWindow::main().home().isHidden())
{
DE_FOR_AUDIENCE(DeferredGLTask, i)
DE_NOTIFY(DeferredGLTask, i)
{
if (i->performDeferredGLTask() == TasksPending)
{
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/client/clskyplane.cpp
Expand Up @@ -61,7 +61,7 @@ void ClSkyPlane::setHeight(ddouble newHeight)
if (d->height != newHeight)
{
d->height = newHeight;
DE_FOR_AUDIENCE(HeightChange, i) i->clSkyPlaneHeightChanged(*this);
DE_NOTIFY(HeightChange, i) i->clSkyPlaneHeightChanged(*this);
}
}

Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/src/configprofiles.cpp
Expand Up @@ -289,7 +289,7 @@ DE_PIMPL(ConfigProfiles)
setCurrent(profileName);
apply(current);

DE_FOR_PUBLIC_AUDIENCE_VAR(ProfileChange, i)
DE_NOTIFY_PUBLIC_VAR(ProfileChange, i)
{
i->currentProfileChanged(profileName);
}
Expand Down Expand Up @@ -476,7 +476,7 @@ void ConfigProfiles::resetToDefaults()
{
d->reset();

DE_FOR_AUDIENCE_VAR(ProfileChange, i)
DE_NOTIFY_VAR(ProfileChange, i)
{
i->currentProfileChanged(d->current);
}
Expand All @@ -493,7 +493,7 @@ bool ConfigProfiles::rename(String const &name)
{
d->setCurrent(name);

DE_FOR_AUDIENCE_VAR(ProfileChange, i)
DE_NOTIFY_VAR(ProfileChange, i)
{
i->currentProfileChanged(name);
}
Expand Down
10 changes: 5 additions & 5 deletions doomsday/apps/client/src/network/serverlink.cpp
Expand Up @@ -97,7 +97,7 @@ DE_PIMPL(ServerLink)

void notifyDiscoveryUpdate()
{
DE_FOR_PUBLIC_AUDIENCE(Discovery, i) i->serversDiscovered(self());
DE_NOTIFY_PUBLIC(Discovery, i) i->serversDiscovered(self());
}

bool handleInfoResponse(Block const &reply)
Expand Down Expand Up @@ -181,7 +181,7 @@ DE_PIMPL(ServerLink)
Reader src(data);
src.withHeader() >> outline;
}
DE_FOR_PUBLIC_AUDIENCE(MapOutline, i)
DE_NOTIFY_PUBLIC(MapOutline, i)
{
i->mapOutlineReceived(svAddress, outline);
}
Expand Down Expand Up @@ -226,7 +226,7 @@ DE_PIMPL(ServerLink)
// Call game's NetConnect.
gx.NetConnect(false);

DE_FOR_PUBLIC_AUDIENCE(Join, i) i->networkGameJoined();
DE_NOTIFY_PUBLIC(Join, i) i->networkGameJoined();

// G'day mate! The client is responsible for beginning the handshake.
Cl_SendHello();
Expand Down Expand Up @@ -572,7 +572,7 @@ void ServerLink::disconnect()
if (gx.NetDisconnect)
gx.NetDisconnect(true);

DE_FOR_AUDIENCE(Leave, i) i->networkGameLeft();
DE_NOTIFY(Leave, i) i->networkGameLeft();

LOG_NET_NOTE("Link to server %s disconnected") << address();
d->downloader.unmountServerRepository();
Expand Down Expand Up @@ -763,7 +763,7 @@ void ServerLink::handleIncomingPackets()
for (const TimeSpan i : d->pings) average += i;
average /= d->pings.count();

DE_FOR_AUDIENCE(PingResponse, i)
DE_NOTIFY(PingResponse, i)
{
i->pingResponse(svAddress, average);
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/render/modelloader.cpp
Expand Up @@ -266,7 +266,7 @@ DE_PIMPL(ModelLoader)
// Bind the mandatory common state.
ClientApp::shaders().build(*prog, name);

DE_FOR_PUBLIC_AUDIENCE(NewProgram, i)
DE_NOTIFY_PUBLIC(NewProgram, i)
{
i->newProgramCreated(*prog);
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/resource/abstractfont.cpp
Expand Up @@ -29,7 +29,7 @@ AbstractFont::AbstractFont(FontManifest &manifest)

AbstractFont::~AbstractFont()
{
DE_FOR_AUDIENCE_VAR(Deletion, i) i->fontBeingDeleted(*this);
DE_NOTIFY_VAR(Deletion, i) i->fontBeingDeleted(*this);
}

void AbstractFont::glInit() const
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/resource/fontmanifest.cpp
Expand Up @@ -40,7 +40,7 @@ DE_OBSERVES(AbstractFont, Deletion)

~Impl()
{
DE_FOR_PUBLIC_AUDIENCE_VAR(Deletion, i) i->fontManifestBeingDeleted(self());
DE_NOTIFY_PUBLIC_VAR(Deletion, i) i->fontManifestBeingDeleted(self());
}

// Observes AbstractFont::Deletion.
Expand Down Expand Up @@ -92,7 +92,7 @@ bool FontManifest::setUniqueId(int newUniqueId)
d->uniqueId = newUniqueId;

// Notify interested parties that the uniqueId has changed.
DE_FOR_AUDIENCE_VAR(UniqueIdChange, i) i->fontManifestUniqueIdChanged(*this);
DE_NOTIFY_VAR(UniqueIdChange, i) i->fontManifestUniqueIdChanged(*this);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/resource/fontscheme.cpp
Expand Up @@ -206,7 +206,7 @@ FontScheme::Manifest &FontScheme::declare(Path const &path)
newManifest->audienceForDeletion += d;

// Notify interested parties that a new manifest was defined in the scheme.
DE_FOR_AUDIENCE_VAR(ManifestDefined, i) i->fontSchemeManifestDefined(*this, *newManifest);
DE_NOTIFY_VAR(ManifestDefined, i) i->fontSchemeManifestDefined(*this, *newManifest);
}

return *newManifest;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/resource/materialanimator.cpp
Expand Up @@ -702,7 +702,7 @@ void MaterialAnimator::animate(timespan_t /*ticLength*/)
if (decorationStageChanged)
{
// Notify interested parties.
DE_FOR_AUDIENCE_VAR(DecorationStageChange, i) i->materialAnimatorDecorationStageChanged(*this);
DE_NOTIFY_VAR(DecorationStageChange, i) i->materialAnimatorDecorationStageChanged(*this);
}
}

Expand Down
10 changes: 5 additions & 5 deletions doomsday/apps/client/src/ui/bindcontext.cpp
Expand Up @@ -228,7 +228,7 @@ void BindContext::activate(bool yes)
d->active = yes;

// Notify interested parties.
DE_FOR_AUDIENCE(ActiveChange, i) i->bindContextActiveChanged(*this);
DE_NOTIFY(ActiveChange, i) i->bindContextActiveChanged(*this);
}

void BindContext::acquire(int deviceId, bool yes)
Expand All @@ -242,7 +242,7 @@ void BindContext::acquire(int deviceId, bool yes)
if (countBefore != d->acquireDevices.size())
{
// Notify interested parties.
DE_FOR_AUDIENCE(AcquireDeviceChange, i) i->bindContextAcquireDeviceChanged(*this);
DE_NOTIFY(AcquireDeviceChange, i) i->bindContextAcquireDeviceChanged(*this);
}
}

Expand All @@ -253,7 +253,7 @@ void BindContext::acquireAll(bool yes)
d->acquireAllDevices = yes;

// Notify interested parties.
DE_FOR_AUDIENCE(AcquireDeviceChange, i) i->bindContextAcquireDeviceChanged(*this);
DE_NOTIFY(AcquireDeviceChange, i) i->bindContextAcquireDeviceChanged(*this);
}
}

Expand Down Expand Up @@ -338,7 +338,7 @@ Record *BindContext::bindCommand(char const *eventDesc, char const *command)
d->deleteMatching(&bind.def(), nullptr);

// Notify interested parties.
DE_FOR_AUDIENCE(BindingAddition, i) i->bindContextBindingAdded(*this, bind.def(), true/*is-command*/);
DE_NOTIFY(BindingAddition, i) i->bindContextBindingAdded(*this, bind.def(), true/*is-command*/);

Con_MarkAsChanged(true);

Expand Down Expand Up @@ -372,7 +372,7 @@ Record *BindContext::bindImpulse(char const *ctrlDesc, PlayerImpulse const &impu
d->deleteMatching(nullptr, &bind.def());

// Notify interested parties.
DE_FOR_AUDIENCE(BindingAddition, i) i->bindContextBindingAdded(*this, bind.def(), false/*is-impulse*/);
DE_NOTIFY(BindingAddition, i) i->bindContextBindingAdded(*this, bind.def(), false/*is-impulse*/);

Con_MarkAsChanged(true);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/dialogs/serverinfodialog.cpp
Expand Up @@ -94,7 +94,7 @@ DE_GUI_PIMPL(ServerInfoDialog)
<< new DialogButtonItem(Default | Accept, "Close")
<< new DialogButtonItem(Action | ID_JOIN, "Join Game", [this] () {
self().accept();
DE_FOR_PUBLIC_AUDIENCE(JoinGame, i) i->joinGame(serverInfo);
DE_NOTIFY_PUBLIC(JoinGame, i) i->joinGame(serverInfo);
})
<< new DialogButtonItem(Action | ID_PING,
style().images().image("refresh"), "Ping", [this] () {
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/home/columnwidget.cpp
Expand Up @@ -229,7 +229,7 @@ bool ColumnWidget::dispatchEvent(Event const &event, bool (Widget::*memberFunc)(
if ((mouse.motion() == MouseEvent::Wheel || mouse.state() == MouseEvent::Pressed) &&
rule().recti().contains(mouse.pos()))
{
DE_FOR_AUDIENCE(Activity, i) i->mouseActivity(this);
DE_NOTIFY(Activity, i) i->mouseActivity(this);
}
}

Expand Down
Expand Up @@ -98,7 +98,7 @@ DE_GUI_PIMPL(MultiplayerPanelButtonWidget)
void joinButtonPressed() const
{
self().root().setFocus(nullptr);
DE_FOR_PUBLIC_AUDIENCE(AboutToJoin, i)
DE_NOTIFY_PUBLIC(AboutToJoin, i)
{
i->aboutToJoinMultiplayerGame(serverInfo);
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/home/packagescolumnwidget.cpp
Expand Up @@ -126,7 +126,7 @@ DE_GUI_PIMPL(PackagesColumnWidget)
countLabel->setText(Stringf("%u shown out of %u available", shown, total));
}
totalPackageCount = total;
DE_FOR_PUBLIC_AUDIENCE(AvailableCount, i) i->availablePackageCountChanged(total);
DE_NOTIFY_PUBLIC(AvailableCount, i) i->availablePackageCountChanged(total);
}

void currentGameChanged(Game const &game) override
Expand Down
8 changes: 4 additions & 4 deletions doomsday/apps/client/src/ui/home/savelistwidget.cpp
Expand Up @@ -116,7 +116,7 @@ DE_GUI_PIMPL(SaveListWidget)

button.setActionFn([this, &button] () {
toggleSelectedItem(button);
DE_FOR_EACH_OBSERVER(i, owner.audienceForActivity()) i->mouseActivity(owner);
DE_FOR_OBSERVERS(i, owner.audienceForActivity()) i->mouseActivity(owner);
});
button.addEventHandler(new ClickHandler(this));

Expand All @@ -141,7 +141,7 @@ DE_GUI_PIMPL(SaveListWidget)
updateItemHighlights(&button);
}

DE_FOR_PUBLIC_AUDIENCE(Selection, i) i->saveListSelectionChanged(selected);
DE_NOTIFY_PUBLIC(Selection, i) i->saveListSelectionChanged(selected);

// Keep focus on the clicked button.
self().root().setFocus(&self());
Expand Down Expand Up @@ -191,7 +191,7 @@ void SaveListWidget::setSelectedPos(ui::DataPos pos)
{
d->selected = pos;
d->updateItemHighlights(&itemWidget<ButtonWidget>(items().at(pos)));
DE_FOR_AUDIENCE(Selection, i) { i->saveListSelectionChanged(d->selected); }
DE_NOTIFY(Selection, i) { i->saveListSelectionChanged(d->selected); }
}
}

Expand All @@ -201,6 +201,6 @@ void SaveListWidget::clearSelection()
{
d->selected = ui::Data::InvalidPos;
d->updateItemHighlights(nullptr);
DE_FOR_AUDIENCE(DoubleClick, i) { i->saveListDoubleClicked(d->selected); }
DE_NOTIFY(DoubleClick, i) { i->saveListDoubleClicked(d->selected); }
}
}
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/infine/finale.cpp
Expand Up @@ -46,7 +46,7 @@ DE_PIMPL(Finale)

~Impl()
{
DE_FOR_PUBLIC_AUDIENCE(Deletion, i) i->finaleBeingDeleted(self());
DE_NOTIFY_PUBLIC(Deletion, i) i->finaleBeingDeleted(self());
}

void loadScript(String const &script)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/infine/finalewidget.cpp
Expand Up @@ -47,7 +47,7 @@ FinaleWidget::FinaleWidget(de::String const &name) : d(new Impl)

FinaleWidget::~FinaleWidget()
{
DE_FOR_AUDIENCE_VAR(Deletion, i) i->finaleWidgetBeingDeleted(*this);
DE_NOTIFY_VAR(Deletion, i) i->finaleWidgetBeingDeleted(*this);
}

Id FinaleWidget::id() const
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/inputdevice.cpp
Expand Up @@ -73,7 +73,7 @@ void InputDevice::activate(bool yes)
d->active = yes;

// Notify interested parties.
DE_FOR_AUDIENCE(ActiveChange, i) i->inputDeviceActiveChanged(*this);
DE_NOTIFY(ActiveChange, i) i->inputDeviceActiveChanged(*this);
}
}

Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/ui/widgets/consolewidget.cpp
Expand Up @@ -247,7 +247,7 @@ DE_GUI_PIMPL(ConsoleWidget)
if (scriptMode != yes)
{
scriptMode = yes;
DE_FOR_PUBLIC_AUDIENCE(CommandMode, i)
DE_NOTIFY_PUBLIC(CommandMode, i)
{
i->commandModeChanged();
}
Expand Down Expand Up @@ -631,7 +631,7 @@ void ConsoleWidget::commandLineFocusGained()
setFullyOpaque();
openLog();

DE_FOR_AUDIENCE(GotFocus, i) i->commandLineGotFocus();
DE_NOTIFY(GotFocus, i) i->commandLineGotFocus();
}

void ConsoleWidget::commandLineFocusLost()
Expand Down
8 changes: 4 additions & 4 deletions doomsday/apps/client/src/ui/widgets/homeitemwidget.cpp
Expand Up @@ -65,7 +65,7 @@ DE_GUI_PIMPL(HomeItemWidget)

case MouseClickFinished:
owner.itemRightClicked();
DE_FOR_EACH_OBSERVER(i, owner.audienceForContextMenu())
DE_FOR_OBSERVERS(i, owner.audienceForContextMenu())
{
i->openItemContextMenu(owner);
}
Expand All @@ -84,7 +84,7 @@ DE_GUI_PIMPL(HomeItemWidget)
if (mouse.state() == MouseEvent::DoubleClick &&
mouse.button() == MouseEvent::Left)
{
DE_FOR_EACH_OBSERVER(i, owner.audienceForDoubleClick())
DE_FOR_OBSERVERS(i, owner.audienceForDoubleClick())
{
i->itemCoubleClicked(owner);
}
Expand Down Expand Up @@ -433,8 +433,8 @@ bool HomeItemWidget::handleEvent(Event const &event)
void HomeItemWidget::focusGained()
{
setSelected(true);
DE_FOR_AUDIENCE(Selection, i) i->itemSelected(*this);
DE_FOR_AUDIENCE(Activity, i) i->mouseActivity(*this);
DE_NOTIFY(Selection, i) i->itemSelected(*this);
DE_NOTIFY(Activity, i) i->mouseActivity(*this);
}

void HomeItemWidget::focusLost()
Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/src/ui/widgets/homemenuwidget.cpp
Expand Up @@ -53,14 +53,14 @@ DE_GUI_PIMPL(HomeMenuWidget)
{
if (auto *clickedWidget = maybeAs<HomeItemWidget>(widget))
{
DE_FOR_PUBLIC_AUDIENCE(Click, i)
DE_NOTIFY_PUBLIC(Click, i)
{
i->menuItemClicked(self(), self().findItem(*clickedWidget));
}
}
if (auto *column = self().parentColumn())
{
DE_FOR_EACH_OBSERVER(i, column->audienceForActivity())
DE_FOR_OBSERVERS(i, column->audienceForActivity())
{
i->mouseActivity(column);
}
Expand All @@ -83,7 +83,7 @@ DE_GUI_PIMPL(HomeMenuWidget)

selectedIndex = previousSelectedIndex = newSelection;

DE_FOR_PUBLIC_AUDIENCE(Selection, i)
DE_NOTIFY_PUBLIC(Selection, i)
{
i->selectedIndexChanged(self(), selectedIndex);
}
Expand Down
Expand Up @@ -219,7 +219,7 @@ DE_PIMPL(MultiplayerServerMenuWidget)

void aboutToJoinMultiplayerGame(ServerInfo const &sv) override
{
DE_FOR_PUBLIC_AUDIENCE(AboutToJoin, i) i->aboutToJoinMultiplayerGame(sv);
DE_NOTIFY_PUBLIC(AboutToJoin, i) i->aboutToJoinMultiplayerGame(sv);
}

//- ChildWidgetOrganizer::IWidgetFactory --------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/ui/widgets/nativepathwidget.cpp
Expand Up @@ -48,7 +48,7 @@ DE_PIMPL(NativePathWidget)

void notifyChange()
{
DE_FOR_PUBLIC_AUDIENCE(UserChange, i)
DE_NOTIFY_PUBLIC(UserChange, i)
{
i->pathChangedByUser(self());
}
Expand Down Expand Up @@ -121,7 +121,7 @@ void NativePathWidget::chooseUsingNativeFileDialog()
{
d->path = dlg.selectedPath();
setText(d->labelText());
DE_FOR_AUDIENCE(UserChange, i) i->pathChangedByUser(*this);
DE_NOTIFY(UserChange, i) i->pathChangedByUser(*this);
}
}

Expand Down

0 comments on commit a11a985

Please sign in to comment.