diff --git a/doomsday/apps/client/src/audio/base/audiosystem.cpp b/doomsday/apps/client/src/audio/base/audiosystem.cpp index 6f213e7895..aca61995c3 100644 --- a/doomsday/apps/client/src/audio/base/audiosystem.cpp +++ b/doomsday/apps/client/src/audio/base/audiosystem.cpp @@ -509,7 +509,7 @@ DENG2_PIMPL(AudioSystem) // Let the music driver(s) know of the primary sfx interface, in case they // want to play audio through it. - setMusicProperty(AUDIOP_SFX_INTERFACE, self.sfx()); + setMusicProperty(AUDIOP_SFX_INTERFACE, self().sfx()); } /** @@ -878,7 +878,7 @@ DENG2_PIMPL(AudioSystem) if (musAvail) { // Tell audio drivers about our soundfont config. - self.updateMusicMidiFont(); + self().updateMusicMidiFont(); } } @@ -937,13 +937,13 @@ DENG2_PIMPL(AudioSystem) LOG_AUDIO_VERBOSE("Initializing sound effect playback..."); // No available interface? - if (!self.sfx()) return; + if (!self().sfx()) return; // This is based on the scientific calculations that if the DOOM marine // is 56 units tall, 60 is about two meters. //// @todo Derive from the viewheight. - self.sfx()->Listener(SFXLP_UNITS_PER_METER, 30); - self.sfx()->Listener(SFXLP_DOPPLER, 1.5f); + self().sfx()->Listener(SFXLP_UNITS_PER_METER, 30); + self().sfx()->Listener(SFXLP_DOPPLER, 1.5f); // The audio driver is working, let's create the channels. initSfxChannels(); @@ -963,11 +963,11 @@ DENG2_PIMPL(AudioSystem) dint disableRefresh = false; // Nothing to refresh? - if (!self.sfx()) goto noRefresh; + if (!self().sfx()) goto noRefresh; - if (self.sfx()->Getv) + if (self().sfx()->Getv) { - self.sfx()->Getv(SFXIP_DISABLE_CHANNEL_REFRESH, &disableRefresh); + self().sfx()->Getv(SFXIP_DISABLE_CHANNEL_REFRESH, &disableRefresh); } if (!disableRefresh) @@ -1023,7 +1023,7 @@ DENG2_PIMPL(AudioSystem) { if (!sfxAvail) return; - self.allowSfxRefresh(false); + self().allowSfxRefresh(false); sfxChannels->forAll([this, &id] (audio::SfxChannel &ch) { if (ch.hasBuffer()) @@ -1032,12 +1032,12 @@ DENG2_PIMPL(AudioSystem) if (sbuf.sample && sbuf.sample->id == id) { // Stop and unload. - self.sfx()->Reset(&sbuf); + self().sfx()->Reset(&sbuf); } } return LoopContinue; }); - self.allowSfxRefresh(true); + self().allowSfxRefresh(true); } /** @@ -1045,18 +1045,18 @@ DENG2_PIMPL(AudioSystem) */ void destroySfxChannels() { - self.allowSfxRefresh(false); + self().allowSfxRefresh(false); sfxChannels->forAll([this] (audio::SfxChannel &ch) { ch.stop(); if (ch.hasBuffer()) { - self.sfx()->Destroy(&ch.buffer()); + self().sfx()->Destroy(&ch.buffer()); ch.setBuffer(nullptr); } return LoopContinue; }); - self.allowSfxRefresh(true); + self().allowSfxRefresh(true); } void createSfxChannels() @@ -1069,13 +1069,13 @@ DENG2_PIMPL(AudioSystem) // Change the primary buffer format to match the channel format. dfloat parm[2] = { dfloat(bits), dfloat(rate) }; - self.sfx()->Listenerv(SFXLP_PRIMARY_FORMAT, parm); + self().sfx()->Listenerv(SFXLP_PRIMARY_FORMAT, parm); // Create sample buffers for the channels. dint idx = 0; sfxChannels->forAll([this, &num2D, &bits, &rate, &idx] (audio::SfxChannel &ch) { - ch.setBuffer(self.sfx()->Create(num2D-- > 0 ? 0 : SFXBF_3D, bits, rate)); + ch.setBuffer(self().sfx()->Create(num2D-- > 0 ? 0 : SFXBF_3D, bits, rate)); if (!ch.hasBuffer()) { LOG_AUDIO_WARNING("Failed to create sample buffer for #%i") << idx; @@ -1263,7 +1263,7 @@ DENG2_PIMPL(AudioSystem) // Are we stopping with this sector's emitter? if (flags & SSF_SECTOR) { - self.stopSound(soundId, (mobj_t *)sectorEmitter); + self().stopSound(soundId, (mobj_t *)sectorEmitter); } // Are we stopping with linked emitters? @@ -1274,7 +1274,7 @@ DENG2_PIMPL(AudioSystem) while ((base = (ddmobj_base_t *)base->thinker.next)) { // Stop sounds from this emitter. - self.stopSound(soundId, (mobj_t *)base); + self().stopSound(soundId, (mobj_t *)base); } } @@ -1301,8 +1301,8 @@ DENG2_PIMPL(AudioSystem) sfxListenerSubsector = nullptr; dfloat rev[4] = { 0, 0, 0, 0 }; - self.sfx()->Listenerv(SFXLP_REVERB, rev); - self.sfx()->Listener(SFXLP_UPDATE, 0); + self().sfx()->Listenerv(SFXLP_REVERB, rev); + self().sfx()->Listener(SFXLP_UPDATE, 0); } void updateSfxListener() @@ -1313,7 +1313,7 @@ DENG2_PIMPL(AudioSystem) if (!::sfxVolume) return; // Update the listener mobj. - self.setSfxListener(S_GetListenerMobj()); + self().setSfxListener(S_GetListenerMobj()); if (sfxListener) { { @@ -1321,7 +1321,7 @@ DENG2_PIMPL(AudioSystem) auto const origin = Vector4f(getSfxListenerOrigin().toVector3f(), 0); dfloat vec[4]; origin.decompose(vec); - self.sfx()->Listenerv(SFXLP_POSITION, vec); + self().sfx()->Listenerv(SFXLP_POSITION, vec); } { // Orientation. (0,0) will produce front=(1,0,0) and up=(0,0,1). @@ -1329,14 +1329,14 @@ DENG2_PIMPL(AudioSystem) sfxListener->angle / (dfloat) ANGLE_MAX * 360, (sfxListener->dPlayer ? LOOKDIR2DEG(sfxListener->dPlayer->lookDir) : 0) }; - self.sfx()->Listenerv(SFXLP_ORIENTATION, vec); + self().sfx()->Listenerv(SFXLP_ORIENTATION, vec); } { // Velocity. The unit is world distance units per second auto const velocity = Vector4f(Vector3d(sfxListener->mom).toVector3f(), 0) * TICSPERSEC; dfloat vec[4]; velocity.decompose(vec); - self.sfx()->Listenerv(SFXLP_VELOCITY, vec); + self().sfx()->Listenerv(SFXLP_VELOCITY, vec); } // Reverb effects. Has the current subsector changed? @@ -1354,12 +1354,12 @@ DENG2_PIMPL(AudioSystem) args[SFXLP_REVERB_DECAY ] = aenv.decay; args[SFXLP_REVERB_DAMPING] = aenv.damping; - self.sfx()->Listenerv(SFXLP_REVERB, args); + self().sfx()->Listenerv(SFXLP_REVERB, args); } } // Update all listener properties. - self.sfx()->Listener(SFXLP_UPDATE, 0); + self().sfx()->Listener(SFXLP_UPDATE, 0); } void updateSfx3DModeIfChanged() @@ -1426,7 +1426,7 @@ DENG2_PIMPL(AudioSystem) void reset() { #ifdef __CLIENT__ - self.reset(); + self().reset(); #endif sfxClearLogical(); } diff --git a/doomsday/apps/client/src/client/cledgeloop.cpp b/doomsday/apps/client/src/client/cledgeloop.cpp index 4dfc96bea4..2cac20dcde 100644 --- a/doomsday/apps/client/src/client/cledgeloop.cpp +++ b/doomsday/apps/client/src/client/cledgeloop.cpp @@ -56,9 +56,9 @@ DENG2_PIMPL(ClEdgeLoop) { Material *choice1 = nullptr, *choice2 = nullptr; - if (self.hasBackSubsector()) + if (self().hasBackSubsector()) { - ClientSubsector &backSubsec = self.backSubsector(); + ClientSubsector &backSubsec = self().backSubsector(); // Our first choice is the back subsector material in the back subsector. switch (section) diff --git a/doomsday/apps/client/src/client/clientsubsector.cpp b/doomsday/apps/client/src/client/clientsubsector.cpp index d3555bbac5..d2b1e90b44 100644 --- a/doomsday/apps/client/src/client/clientsubsector.cpp +++ b/doomsday/apps/client/src/client/clientsubsector.cpp @@ -386,7 +386,7 @@ DENG2_PIMPL(ClientSubsector) flags &= ~(NeverMapped | PartSelfRef); flags |= AllSelfRef | AllMissingBottom | AllMissingTop; - self.forAllSubspaces([this] (ConvexSubspace &subspace) + self().forAllSubspaces([this] (ConvexSubspace &subspace) { HEdge const *base = subspace.poly().hedge(); HEdge const *hedge = base; @@ -445,13 +445,13 @@ DENG2_PIMPL(ClientSubsector) flags &= ~AllMissingTop; } - if (backSpace.subsector().sector().floor().height() < self.sector().floor().height() + if (backSpace.subsector().sector().floor().height() < self().sector().floor().height() && backSide.bottom().hasDrawableNonFixMaterial()) { flags &= ~AllMissingBottom; } - if (backSpace.subsector().sector().ceiling().height() > self.sector().ceiling().height() + if (backSpace.subsector().sector().ceiling().height() > self().sector().ceiling().height() && backSide.top().hasDrawableNonFixMaterial()) { flags &= ~AllMissingTop; @@ -470,11 +470,11 @@ DENG2_PIMPL(ClientSubsector) if (boundaryData) return; boundaryData.reset(new BoundaryData); - QList neighbors = self.listUniqueBoundaryEdges(); + QList neighbors = self().listUniqueBoundaryEdges(); if (neighbors.count() == 1) { // Single neighbor => one implicit loop. - boundaryData->addEdgeLoop(new ClEdgeLoop(self, *neighbors.first())); + boundaryData->addEdgeLoop(new ClEdgeLoop(self(), *neighbors.first())); } else { @@ -508,7 +508,7 @@ DENG2_PIMPL(ClientSubsector) QRectF &boundary = boundaries[i]; HEdge *hedge = neighbors[i]; - boundaryData->addEdgeLoop(new ClEdgeLoop(self, *hedge, !(&boundary == largest || (largest && boundary == *largest)))); + boundaryData->addEdgeLoop(new ClEdgeLoop(self(), *hedge, !(&boundary == largest || (largest && boundary == *largest)))); } } } @@ -525,7 +525,7 @@ DENG2_PIMPL(ClientSubsector) if (classification() & (AllSelfRef | PartSelfRef)) { // Should we permanently map one or both planes to those of another sector? - self.forAllEdgeLoops([this] (ClEdgeLoop const &loop) + self().forAllEdgeLoops([this] (ClEdgeLoop const &loop) { auto &backSubsec = loop.backSubsector().as(); if (loop.isSelfReferencing() @@ -582,7 +582,7 @@ DENG2_PIMPL(ClientSubsector) // // The sector must have open space. - if (self.sector().ceiling().height() <= self.sector().floor().height()) + if (self().sector().ceiling().height() <= self().sector().floor().height()) return; bool doFloor = !floorIsMapped() && classification().testFlag(AllMissingBottom); @@ -606,14 +606,14 @@ DENG2_PIMPL(ClientSubsector) { if (doFloor && !floorIsMapped() && !backSubsec.hasSkyFloor() - && backSubsec.visFloor().height() > self.sector().floor().height()) + && backSubsec.visFloor().height() > self().sector().floor().height()) { map(Sector::Floor, &backSubsec); if (!doCeiling) break; } if (doCeiling && !ceilingIsMapped() && !backSubsec.hasSkyCeiling() - && backSubsec.visCeiling().height() < self.sector().ceiling().height()) + && backSubsec.visCeiling().height() < self().sector().ceiling().height()) { map(Sector::Ceiling, &backSubsec); if (!doFloor) break; @@ -641,12 +641,12 @@ DENG2_PIMPL(ClientSubsector) && !(backSubsec.d->classification() & NeverMapped)) { if (doFloor && floorIsMapped() - && backSubsec.visFloor().height() >= self.sector().floor().height()) + && backSubsec.visFloor().height() >= self().sector().floor().height()) { backSubsec.d->clearMapping(Sector::Floor); } if (doCeiling && ceilingIsMapped() - && backSubsec.visCeiling().height() <= self.sector().ceiling().height()) + && backSubsec.visCeiling().height() <= self().sector().ceiling().height()) { backSubsec.d->clearMapping(Sector::Ceiling); } @@ -662,15 +662,15 @@ DENG2_PIMPL(ClientSubsector) if (!hedge->hasMapElement()) return; MapElement *mapElement = &hedge->mapElement(); - if (Shard *shard = self.findShard(*mapElement, LineSide::Middle)) + if (Shard *shard = self().findShard(*mapElement, LineSide::Middle)) { shard->updateBiasAfterMove(); } - if (Shard *shard = self.findShard(*mapElement, LineSide::Bottom)) + if (Shard *shard = self().findShard(*mapElement, LineSide::Bottom)) { shard->updateBiasAfterMove(); } - if (Shard *shard = self.findShard(*mapElement, LineSide::Top)) + if (Shard *shard = self().findShard(*mapElement, LineSide::Top)) { shard->updateBiasAfterMove(); } @@ -738,9 +738,9 @@ DENG2_PIMPL(ClientSubsector) */ void findReverbSubspaces() { - Map const &map = self.sector().map(); + Map const &map = self().sector().map(); - AABoxd box = self.bounds(); + AABoxd box = self().bounds(); box.minX -= 128; box.minY -= 128; box.maxX += 128; @@ -783,8 +783,8 @@ DENG2_PIMPL(ClientSubsector) needReverbUpdate = false; - duint spaceVolume = dint((self.visCeiling().height() - self.visFloor().height()) - * self.roughArea()); + duint spaceVolume = dint((self().visCeiling().height() - self().visFloor().height()) + * self().roughArea()); reverb.reset(); @@ -833,7 +833,7 @@ DENG2_PIMPL(ClientSubsector) if (reverb.space > .99) reverb.space = .99f; - if (self.hasSkyPlane()) + if (self().hasSkyPlane()) { // An "exterior" space. // It can still be small, in which case; reverb is diminished a bit. @@ -975,11 +975,11 @@ DENG2_PIMPL(ClientSubsector) Vector3d decorOrigin = origin + delta * patternOffset; // The point must be in the correct subsector. - if (suf.map().subsectorAt(decorOrigin) == &self) + if (suf.map().subsectorAt(decorOrigin) == thisPublic) { std::unique_ptr decor(new LightDecoration(decorSS, decorOrigin)); decor->setSurface(&suf); - if (self.sector().hasMap()) decor->setMap(&self.sector().map()); + if (self().sector().hasMap()) decor->setMap(&self().sector().map()); static_cast(suf.decorationState())-> decorations.append(decor.get()); // take ownership. decor.release(); @@ -1038,18 +1038,18 @@ DENG2_PIMPL(ClientSubsector) if (::ddMapSetup) return; LOGDEV_MAP_XVERBOSE_DEBUGONLY("Marking [%p] (sector: %i) for redecoration..." - , thisPublic << self.sector().indexInMap() + , thisPublic << self().sector().indexInMap() ); // Mark surfaces of the edge loops. - self.forAllEdgeLoops([this, &plane, &yes] (ClEdgeLoop const &loop) + self().forAllEdgeLoops([this, &plane, &yes] (ClEdgeLoop const &loop) { SubsectorCirculator it(&loop.first()); do { if (it->hasMapElement()) // BSP errors may fool the circulator wrt interior edges -ds { - if ( &plane == &self.visPlane(plane.indexInSector()) + if ( &plane == &self().visPlane(plane.indexInSector()) || (&plane == (it->hasTwin() && it->twin().hasFace() ? &it->twin().face().mapElementAs() .subsector().as().visPlane(plane.indexInSector()) @@ -1071,7 +1071,7 @@ DENG2_PIMPL(ClientSubsector) return LoopContinue; }); - if (&plane == &self.visPlane(plane.indexInSector())) + if (&plane == &self().visPlane(plane.indexInSector())) { LOGDEV_MAP_XVERBOSE_DEBUGONLY(" ", composeSurfacePath(plane.surface())); if (auto *decor = plane.surface().decorationState()) @@ -1086,11 +1086,11 @@ DENG2_PIMPL(ClientSubsector) if (::ddMapSetup) return; LOGDEV_MAP_XVERBOSE_DEBUGONLY("Marking [%p] (sector: %i) for redecoration..." - , thisPublic << self.sector().indexInMap() + , thisPublic << self().sector().indexInMap() ); // Surfaces of the edge loops. - self.forAllEdgeLoops([this, &material, &yes] (ClEdgeLoop const &loop) + self().forAllEdgeLoops([this, &material, &yes] (ClEdgeLoop const &loop) { SubsectorCirculator it(&loop.first()); do @@ -1116,7 +1116,7 @@ DENG2_PIMPL(ClientSubsector) }); // Surfaces of the visual planes. - Plane &floor = self.visFloor(); + Plane &floor = self().visFloor(); if (floor.surface().materialPtr() == &material) { LOGDEV_MAP_XVERBOSE_DEBUGONLY(" ", composeSurfacePath(floor.surface())); @@ -1125,7 +1125,7 @@ DENG2_PIMPL(ClientSubsector) static_cast(decor)->markForUpdate(yes); } } - Plane &ceiling = self.visCeiling(); + Plane &ceiling = self().visCeiling(); if (ceiling.surface().materialPtr() == &material) { LOGDEV_MAP_XVERBOSE_DEBUGONLY(" ", composeSurfacePath(ceiling.surface())); @@ -1142,7 +1142,7 @@ DENG2_PIMPL(ClientSubsector) LOG_AS("ClientSubsector"); line.forAllSides([this, &oldFlags] (LineSide &side) { - if (side.sectorPtr() == &self.sector()) + if (side.sectorPtr() == &self().sector()) { if ((side.line().flags() & DDLF_DONTPEGTOP) != (oldFlags & DDLF_DONTPEGTOP)) { @@ -1198,7 +1198,7 @@ DENG2_PIMPL(ClientSubsector) maybeInvalidateMapping(plane.indexInSector()); // We may need to fix newly revealed missing materials. - self.forAllEdgeLoops([] (ClEdgeLoop &loop) + self().forAllEdgeLoops([] (ClEdgeLoop &loop) { loop.fixSurfacesMissingMaterials(); return LoopContinue; @@ -1207,7 +1207,7 @@ DENG2_PIMPL(ClientSubsector) // We may need to project new decorations. markDependentSurfacesForRedecoration(plane); - bool const planeIsInterior = (&plane == &self.visPlane(plane.indexInSector())); + bool const planeIsInterior = (&plane == &self().visPlane(plane.indexInSector())); if (planeIsInterior) { // We'll need to recalculate environmental audio characteristics. @@ -1221,8 +1221,8 @@ DENG2_PIMPL(ClientSubsector) if (plr.isInGame() && (ddpl.flags & DDPF_CAMERA) && Mobj_SubsectorPtr(*ddpl.mo) == thisPublic - && ( ddpl.mo->origin[2] > self.visCeiling().height() - 4 - || ddpl.mo->origin[2] < self.visFloor ().height())) + && ( ddpl.mo->origin[2] > self().visCeiling().height() - 4 + || ddpl.mo->origin[2] < self().visFloor ().height())) { plr.as().inVoid = true; } @@ -1232,9 +1232,9 @@ DENG2_PIMPL(ClientSubsector) // Inform bias surfaces of changed geometry? if (!::ddMapSetup && ::useBias) { - self.forAllSubspaces([this, &plane] (ConvexSubspace &subspace) + self().forAllSubspaces([this, &plane] (ConvexSubspace &subspace) { - if (Shard *shard = self.findShard(subspace, plane.indexInSector())) + if (Shard *shard = self().findShard(subspace, plane.indexInSector())) { shard->updateBiasAfterMove(); } @@ -1273,22 +1273,22 @@ DENG2_PIMPL(ClientSubsector) /// Observes Sector LightLevelChange. void sectorLightLevelChanged(Sector &DENG2_DEBUG_ONLY(changed)) { - DENG2_ASSERT(&changed == &self.sector()); + DENG2_ASSERT(&changed == &self().sector()); LOG_AS("ClientSubsector"); - if (self.sector().map().hasLightGrid()) + if (self().sector().map().hasLightGrid()) { - self.sector().map().lightGrid().blockLightSourceChanged(thisPublic); + self().sector().map().lightGrid().blockLightSourceChanged(thisPublic); } } /// Observes Sector LightColorChange. void sectorLightColorChanged(Sector &DENG2_DEBUG_ONLY(changed)) { - DENG2_ASSERT(&changed == &self.sector()); + DENG2_ASSERT(&changed == &self().sector()); LOG_AS("ClientSubsector"); - if (self.sector().map().hasLightGrid()) + if (self().sector().map().hasLightGrid()) { - self.sector().map().lightGrid().blockLightSourceChanged(thisPublic); + self().sector().map().lightGrid().blockLightSourceChanged(thisPublic); } } diff --git a/doomsday/apps/client/src/clientapp.cpp b/doomsday/apps/client/src/clientapp.cpp index a6817656c9..b382167712 100644 --- a/doomsday/apps/client/src/clientapp.cpp +++ b/doomsday/apps/client/src/clientapp.cpp @@ -228,10 +228,10 @@ DENG2_PIMPL(ClientApp) LogBuffer::get().addSink(logAlarm); DoomsdayApp::plugins().audienceForPublishAPI() += this; DoomsdayApp::plugins().audienceForNotification() += this; - self.audienceForGameChange() += this; - self.audienceForGameUnload() += this; - self.audienceForConsoleRegistration() += this; - self.games().audienceForProgress() += this; + self().audienceForGameChange() += this; + self().audienceForGameUnload() += this; + self().audienceForConsoleRegistration() += this; + self().games().audienceForProgress() += this; } ~Impl() @@ -242,12 +242,12 @@ DENG2_PIMPL(ClientApp) LogBuffer::get().removeSink(logAlarm); - self.players().forAll([] (Player &p) + self().players().forAll([] (Player &p) { p.as().viewCompositor().glDeinit(); return LoopContinue; }); - self.glDeinit(); + self().glDeinit(); Sys_Shutdown(); DD_Shutdown(); @@ -291,7 +291,7 @@ DENG2_PIMPL(ClientApp) if (data) { auto const *args = (ddnotify_psprite_state_changed_t *) data; - self.player(args->player).weaponStateChanged(args->state); + self().player(args->player).weaponStateChanged(args->state); } break; @@ -299,7 +299,7 @@ DENG2_PIMPL(ClientApp) if (data) { auto const *args = (ddnotify_player_weapon_changed_t *) data; - self.player(args->player).setWeaponAssetId(args->weaponId); + self().player(args->player).setWeaponAssetId(args->weaponId); } break; @@ -451,7 +451,7 @@ DENG2_PIMPL(ClientApp) void printHelpToStdOut() { printVersionToStdOut(); - printf("Usage: %s [options]\n", self.commandLine().at(0).toLatin1().constData()); + printf("Usage: %s [options]\n", self().commandLine().at(0).toLatin1().constData()); printf(" -iwad (dir) Set directory containing IWAD files.\n"); printf(" -file (f) Load one or more PWAD files at startup.\n"); printf(" -game (id) Set game to load at startup.\n"); diff --git a/doomsday/apps/client/src/configprofiles.cpp b/doomsday/apps/client/src/configprofiles.cpp index a54161e4c3..7869a99245 100644 --- a/doomsday/apps/client/src/configprofiles.cpp +++ b/doomsday/apps/client/src/configprofiles.cpp @@ -191,18 +191,18 @@ DENG2_PIMPL(ConfigProfiles) { Profile *prof = new Profile; prof->setName(name); - self.add(prof); + self().add(prof); return prof; } Profile *tryFind(String const &name) const { - return self.tryFind(name)->maybeAs(); + return self().tryFind(name)->maybeAs(); } Profile ¤tProfile() const { - return self.find(current).as(); + return self().find(current).as(); } QVariant getDefaultFromConfig(String const &name) @@ -246,7 +246,7 @@ DENG2_PIMPL(ConfigProfiles) */ void fetch(String const &profileName) { - Profile &prof = self.find(profileName).as(); + Profile &prof = self().find(profileName).as(); if (prof.isReadOnly()) return; foreach (Setting const &st, settings.values()) @@ -288,7 +288,7 @@ DENG2_PIMPL(ConfigProfiles) { current = name; - if (!self.persistentName().isEmpty()) + if (!self().persistentName().isEmpty()) { App::config().set(configVarName(), name); } @@ -296,7 +296,7 @@ DENG2_PIMPL(ConfigProfiles) void apply(String const &profileName) { - Profile &profile = self.find(profileName).as(); + Profile &profile = self().find(profileName).as(); foreach (Setting const &st, settings.values()) { @@ -312,9 +312,9 @@ DENG2_PIMPL(ConfigProfiles) if (current == profileName) return; - if (!self.persistentName().isEmpty()) + if (!self().persistentName().isEmpty()) { - LOG_MSG("Changing %s profile to '%s'") << self.persistentName() << profileName; + LOG_MSG("Changing %s profile to '%s'") << self().persistentName() << profileName; } // First update the old profile. @@ -352,8 +352,8 @@ DENG2_PIMPL(ConfigProfiles) */ String configVarName() const { - if (self.persistentName().isEmpty()) return ""; - return self.persistentName().concatenateMember("profile"); + if (self().persistentName().isEmpty()) return ""; + return self().persistentName().concatenateMember("profile"); } QVariant textToSettingValue(String const &text, String const &settingName) const @@ -402,12 +402,12 @@ DENG2_PIMPL(ConfigProfiles) */ void currentGameChanged(Game const &newGame) { - if (!self.isPersistent() || newGame.isNull()) return; + if (!self().isPersistent() || newGame.isNull()) return; LOG_AS("ConfigProfiles"); - LOG_DEBUG("Game has been loaded, deserializing %s profiles") << self.persistentName(); + LOG_DEBUG("Game has been loaded, deserializing %s profiles") << self().persistentName(); - self.deserialize(); + self().deserialize(); // Settings haven't previously been created -- make sure we at least // have the Custom profile. @@ -428,7 +428,7 @@ DENG2_PIMPL(ConfigProfiles) } else { - current = self.profiles().first(); + current = self().profiles().first(); } } @@ -448,10 +448,10 @@ DENG2_PIMPL(ConfigProfiles) */ void aboutToUnloadGame(Game const &gameBeingUnloaded) { - if (!self.isPersistent() || gameBeingUnloaded.isNull()) return; + if (!self().isPersistent() || gameBeingUnloaded.isNull()) return; LOG_AS("ConfigProfiles"); - LOG_DEBUG("Game being unloaded, serializing %s profiles") << self.persistentName(); + LOG_DEBUG("Game being unloaded, serializing %s profiles") << self().persistentName(); // Update the current profile. fetch(current); @@ -459,7 +459,7 @@ DENG2_PIMPL(ConfigProfiles) // Remember which profile is the current one. App::config().set(configVarName(), current); - self.serialize(); + self().serialize(); } }; diff --git a/doomsday/apps/client/src/network/serverlink.cpp b/doomsday/apps/client/src/network/serverlink.cpp index 2af9961080..83fdc97741 100644 --- a/doomsday/apps/client/src/network/serverlink.cpp +++ b/doomsday/apps/client/src/network/serverlink.cpp @@ -75,8 +75,8 @@ DENG2_PIMPL(ServerLink) void notifyDiscoveryUpdate() { - DENG2_FOR_PUBLIC_AUDIENCE(DiscoveryUpdate, i) i->linkDiscoveryUpdate(self); - emit self.serversDiscovered(); + DENG2_FOR_PUBLIC_AUDIENCE(DiscoveryUpdate, i) i->linkDiscoveryUpdate(self()); + emit self().serversDiscovered(); } bool handleInfoResponse(Block const &reply) @@ -84,13 +84,13 @@ DENG2_PIMPL(ServerLink) DENG2_ASSERT(state == WaitingForInfoResponse); // Address of the server where the info was received. - Address svAddress = self.address(); + Address svAddress = self().address(); // Local addresses are all represented as "localhost". if (svAddress.isLocal()) svAddress.setHost(QHostAddress::LocalHost); // Close the connection; that was all the information we need. - self.disconnect(); + self().disconnect(); // Did we receive what we expected to receive? if (reply.size() >= 5 && reply.startsWith("Info\n")) @@ -159,7 +159,7 @@ DENG2_PIMPL(ServerLink) LOG_NET_WARNING("Server refused connection"); LOGDEV_NET_WARNING("Received %i bytes instead of \"Enter\")") << reply.size(); - self.disconnect(); + self().disconnect(); return false; } @@ -227,7 +227,7 @@ DENG2_PIMPL(ServerLink) // Do we have information about this host? shell::ServerInfo info; - if (!self.foundServerInfo(host, info)) + if (!self().foundServerInfo(host, info)) { return false; } diff --git a/doomsday/apps/client/src/render/biassource.cpp b/doomsday/apps/client/src/render/biassource.cpp index 1975fe41db..4a15affa7f 100644 --- a/doomsday/apps/client/src/render/biassource.cpp +++ b/doomsday/apps/client/src/render/biassource.cpp @@ -97,7 +97,7 @@ DENG2_PIMPL(BiasSource) { DENG2_FOR_PUBLIC_AUDIENCE(OriginChange, i) { - i->grabbableOriginChanged(self); + i->grabbableOriginChanged(self()); } } @@ -105,7 +105,7 @@ DENG2_PIMPL(BiasSource) { DENG2_FOR_PUBLIC_AUDIENCE(IntensityChange, i) { - i->biasSourceIntensityChanged(self, oldIntensity); + i->biasSourceIntensityChanged(self(), oldIntensity); } } @@ -121,7 +121,7 @@ DENG2_PIMPL(BiasSource) DENG2_FOR_PUBLIC_AUDIENCE(ColorChange, i) { - i->biasSourceColorChanged(self, oldColor, changedComponents); + i->biasSourceColorChanged(self(), oldColor, changedComponents); } } }; diff --git a/doomsday/apps/client/src/render/fx/lensflares.cpp b/doomsday/apps/client/src/render/fx/lensflares.cpp index 1925982cba..ccde0a2c5c 100644 --- a/doomsday/apps/client/src/render/fx/lensflares.cpp +++ b/doomsday/apps/client/src/render/fx/lensflares.cpp @@ -276,7 +276,7 @@ DENG2_PIMPL(LensFlares) buffer = new VBuf; drawable.addBuffer(buffer); - self.shaders().build(drawable.program(), "fx.lensflares") + self().shaders().build(drawable.program(), "fx.lensflares") << uMvpMatrix << uViewUnit << uPixelAsUv << uActiveRect << uAtlas << uDepthBuf; diff --git a/doomsday/apps/client/src/render/lightgrid.cpp b/doomsday/apps/client/src/render/lightgrid.cpp index 5f27a6d0a4..38a7222b5c 100644 --- a/doomsday/apps/client/src/render/lightgrid.cpp +++ b/doomsday/apps/client/src/render/lightgrid.cpp @@ -272,7 +272,7 @@ DENG2_PIMPL(LightGrid) ~Impl() { clearBlocks(); } inline LightBlock &block(Index index) { return *blocks[index]; } - inline LightBlock &block(Ref const &gref) { return block(self.toIndex(gref)); } + inline LightBlock &block(Ref const &gref) { return block(self().toIndex(gref)); } void clearBlocks() { @@ -410,7 +410,7 @@ DENG2_PIMPL(LightGrid) M_Free(contribBitfield); // A full update is needed after this. - self.scheduleFullUpdate(); + self().scheduleFullUpdate(); } }; diff --git a/doomsday/apps/client/src/render/skydrawable.cpp b/doomsday/apps/client/src/render/skydrawable.cpp index 8dbe240ce9..54fe3f7957 100644 --- a/doomsday/apps/client/src/render/skydrawable.cpp +++ b/doomsday/apps/client/src/render/skydrawable.cpp @@ -375,7 +375,7 @@ DENG2_PIMPL(SkyDrawable) ~Impl() { // Stop observing Sky change notifications (if observing). - self.configure(); + self().configure(); } /** @@ -578,7 +578,7 @@ DENG2_PIMPL(SkyDrawable) void skyBeingDeleted(Sky const &) { // Stop observing Sky change notifications. - self.configure(); + self().configure(); } /// Observes Sky HeightChange diff --git a/doomsday/apps/client/src/render/skyfixedge.cpp b/doomsday/apps/client/src/render/skyfixedge.cpp index efb151c841..fcbdbe147b 100644 --- a/doomsday/apps/client/src/render/skyfixedge.cpp +++ b/doomsday/apps/client/src/render/skyfixedge.cpp @@ -221,7 +221,7 @@ DENG2_PIMPL(SkyFixEdge) isValid = hi > lo; if (!isValid) return; - pOrigin = Vector3d(self.origin(), lo); + pOrigin = Vector3d(self().origin(), lo); pDirection = Vector3d(0, 0, hi - lo); } }; diff --git a/doomsday/apps/client/src/render/stateanimator.cpp b/doomsday/apps/client/src/render/stateanimator.cpp index eb46667cc5..0ec741a4c6 100644 --- a/doomsday/apps/client/src/render/stateanimator.cpp +++ b/doomsday/apps/client/src/render/stateanimator.cpp @@ -151,7 +151,7 @@ DENG2_PIMPL(StateAnimator) Impl(Public *i, DotPath const &id) : Base(i) { - names.add(Record::VAR_NATIVE_SELF).set(new NativePointerValue(&self)).setReadOnly(); + names.add(Record::VAR_NATIVE_SELF).set(new NativePointerValue(thisPublic)).setReadOnly(); names.addSuperRecord(ScriptSystem::builtInClass(QStringLiteral("Render"), QStringLiteral("StateAnimator"))); names.addText(VAR_ID, id).setReadOnly(); @@ -160,9 +160,9 @@ DENG2_PIMPL(StateAnimator) initVariables(); // Set up the model drawing parameters. - if (!self.model().passes.isEmpty()) + if (!self().model().passes.isEmpty()) { - appearance.drawPasses = &self.model().passes; + appearance.drawPasses = &self().model().passes; } appearance.programCallback = [this] (GLProgram &program, ModelDrawable::ProgramBinding binding) { @@ -171,7 +171,7 @@ DENG2_PIMPL(StateAnimator) }; appearance.passCallback = [this] (ModelDrawable::Pass const &pass, ModelDrawable::PassState state) { - bindPassUniforms(*self.model().currentProgram(), + bindPassUniforms(*self().model().currentProgram(), pass.name, state == ModelDrawable::PassBegun? Bind : Unbind); }; @@ -184,7 +184,7 @@ DENG2_PIMPL(StateAnimator) void initVariables() { - int const passCount = self.model().passes.size(); + int const passCount = self().model().passes.size(); // Clear lookups affected by the variables. indexForPassName.clear(); @@ -257,7 +257,7 @@ DENG2_PIMPL(StateAnimator) Variable &passMaterialVar = names.addText(passName.concatenateMember(VAR_MATERIAL), block.gets(DEF_MATERIAL, DEFAULT_MATERIAL)); passMaterialVar.audienceForChange() += this; - passForMaterialVariable.insert(&passMaterialVar, self.model().passes.findName(passName)); + passForMaterialVariable.insert(&passMaterialVar, self().model().passes.findName(passName)); /// @todo Should observe if the variable above is deleted unexpectedly. -jk @@ -297,7 +297,7 @@ DENG2_PIMPL(StateAnimator) // The model should now be transformed even without active // animation sequences so that the variables are applied. - self.setFlags(AlwaysTransformNodes); + self().setFlags(AlwaysTransformNodes); } catch (Error const &er) { @@ -328,7 +328,7 @@ DENG2_PIMPL(StateAnimator) Variable const &materialVariableForPass(duint passIndex) const { - auto const &model = self.model(); + auto const &model = self().model(); if (!model.passes.isEmpty()) { String const varName = model.passes.at(passIndex).name.concatenateMember(VAR_MATERIAL); @@ -383,7 +383,7 @@ DENG2_PIMPL(StateAnimator) */ duint materialForUserProvidedName(String const &materialName) const { - auto const &model = self.model(); + auto const &model = self().model(); auto const matIndex = model.materialIndexForName.constFind(materialName); if (matIndex != model.materialIndexForName.constEnd()) { @@ -470,13 +470,13 @@ DENG2_PIMPL(StateAnimator) int animationId(String const &name) const { return ModelRenderer::identifierFromText(name, [this] (String const &name) { - return self.model().animationIdForName(name); + return self().model().animationIdForName(name); }); } Sequence &start(Sequence const &spec) { - Sequence &anim = self.start(spec.animId, spec.node).as(); + Sequence &anim = self().start(spec.animId, spec.node).as(); anim.apply(spec); if (anim.timeline) { @@ -508,7 +508,7 @@ void StateAnimator::setOwnerNamespace(Record &names, String const &varName) Record ns; ns.add(QStringLiteral("self")).set(new RecordValue(d->names)); Process::scriptCall(Process::IgnoreResult, ns, - QStringLiteral("self.ASSET.onInit"), + QStringLiteral("self().ASSET.onInit"), "$self"); } } @@ -596,7 +596,7 @@ void StateAnimator::triggerByState(String const &stateName) } /*LOG_GL_XVERBOSE("Mobj %i starting animation: " _E(b)) - << d->names.geti("self.__id__") << seq.name;*/ + << d->names.geti("self().__id__") << seq.name;*/ break; } } @@ -618,7 +618,7 @@ void StateAnimator::triggerDamage(int points, struct mobj_s const *inflictor) Record ns; ns.add(QStringLiteral("self")).set(new RecordValue(d->names)); Process::scriptCall(Process::IgnoreResult, ns, - QStringLiteral("self.ASSET.onDamage"), + QStringLiteral("self().ASSET.onDamage"), "$self", points, inflictor? &THINKER_DATA(inflictor->thinker, ThinkerData) : nullptr); diff --git a/doomsday/apps/client/src/resource/bitmapfont.cpp b/doomsday/apps/client/src/resource/bitmapfont.cpp index e54422c302..0a6e50f2a2 100644 --- a/doomsday/apps/client/src/resource/bitmapfont.cpp +++ b/doomsday/apps/client/src/resource/bitmapfont.cpp @@ -79,7 +79,7 @@ DENG2_PIMPL(BitmapFont) ~Impl() { - self.glDeinit(); + self().glDeinit(); } /** @@ -117,8 +117,8 @@ DENG2_PIMPL(BitmapFont) { DENG2_ASSERT(file != 0); - self._flags |= AbstractFont::Colorize; - self._flags &= ~AbstractFont::Shadowed; + self()._flags |= AbstractFont::Colorize; + self()._flags &= ~AbstractFont::Shadowed; texMargin = Vector2ui(0, 0); // Load in the data. @@ -143,7 +143,7 @@ DENG2_PIMPL(BitmapFont) int bitmapFormat = inByte(file); if(bitmapFormat > 0) { - de::Uri uri = self.manifest().composeUri(); + de::Uri uri = self().manifest().composeUri(); throw Error("BitmapFont::readFormat0", QString("Font \"%1\" uses unknown format '%2'").arg(uri).arg(bitmapFormat)); } @@ -172,12 +172,12 @@ DENG2_PIMPL(BitmapFont) { DENG2_ASSERT(file != 0); - self._flags |= AbstractFont::Colorize | AbstractFont::Shadowed; + self()._flags |= AbstractFont::Colorize | AbstractFont::Shadowed; int bitmapFormat = inByte(file); if(bitmapFormat != 1 && bitmapFormat != 0) // Luminance + Alpha. { - de::Uri uri = self.manifest().composeUri(); + de::Uri uri = self().manifest().composeUri(); throw Error("BitmapFont::readFormat2", QString("Font \"%1\" uses unknown format '%2'").arg(uri).arg(bitmapFormat)); } diff --git a/doomsday/apps/client/src/resource/clientmaterial.cpp b/doomsday/apps/client/src/resource/clientmaterial.cpp index 44a1fb8f80..4a14c25748 100644 --- a/doomsday/apps/client/src/resource/clientmaterial.cpp +++ b/doomsday/apps/client/src/resource/clientmaterial.cpp @@ -124,8 +124,8 @@ DENG2_PIMPL(ClientMaterial) ~Impl() { - self.clearAllAnimators(); - self.clearAllDecorations(); + self().clearAllAnimators(); + self().clearAllDecorations(); } MaterialAnimator *findAnimator(MaterialVariantSpec const &spec, bool canCreate = false) @@ -140,7 +140,7 @@ DENG2_PIMPL(ClientMaterial) if (!canCreate) return nullptr; - animators.append(new MaterialAnimator(self, spec)); + animators.append(new MaterialAnimator(self(), spec)); return animators.back(); } }; diff --git a/doomsday/apps/client/src/resource/clientresources.cpp b/doomsday/apps/client/src/resource/clientresources.cpp index 148e765d9b..db4d94a902 100644 --- a/doomsday/apps/client/src/resource/clientresources.cpp +++ b/doomsday/apps/client/src/resource/clientresources.cpp @@ -194,15 +194,15 @@ DENG2_PIMPL(ClientResources) createFontScheme("System"); createFontScheme("Game"); - self.colorPalettes().audienceForAddition() += this; + self().colorPalettes().audienceForAddition() += this; } ~Impl() { - self.clearAllFontSchemes(); + self().clearAllFontSchemes(); clearFontManifests(); - self.clearAllRawTextures(); - self.purgeCacheQueue(); + self().clearAllRawTextures(); + self().purgeCacheQueue(); clearAllTextureSpecs(); clearMaterialSpecs(); @@ -242,16 +242,16 @@ DENG2_PIMPL(ClientResources) void clearRuntimeFonts() { - self.fontScheme("Game").clear(); + self().fontScheme("Game").clear(); - self.pruneUnusedTextureSpecs(); + self().pruneUnusedTextureSpecs(); } void clearSystemFonts() { - self.fontScheme("System").clear(); + self().fontScheme("System").clear(); - self.pruneUnusedTextureSpecs(); + self().pruneUnusedTextureSpecs(); } void clearMaterialSpecs() @@ -295,7 +295,7 @@ DENG2_PIMPL(ClientResources) } TextureVariantSpec const &primarySpec = - self.textureSpec(primaryContext, flags, border, tClass, tMap, + self().textureSpec(primaryContext, flags, border, tClass, tMap, wrapS, wrapT, minFilter, magFilter, anisoFilter, mipmapped, gammaCorrection, noStretch, toAlpha); @@ -435,7 +435,7 @@ DENG2_PIMPL(ClientResources) bool textureSpecInUse(TextureVariantSpec const &spec) { - for (res::Texture *texture : self.textures().allTextures()) + for (res::Texture *texture : self().textures().allTextures()) { for (TextureVariant *variant : static_cast(texture)->variants()) { @@ -556,7 +556,7 @@ DENG2_PIMPL(ClientResources) MaterialVariantSpec const &contextSpec, bool cacheGroups = true) { - if (auto const *sprites = self.sprites().tryFindSpriteSet(id)) + if (auto const *sprites = self().sprites().tryFindSpriteSet(id)) { for (Record const &sprite : *sprites) { @@ -634,9 +634,9 @@ DENG2_PIMPL(ClientResources) if (id.isEmpty()) return nullptr; // First try to find an existing modef. - if (self.hasModelDef(id)) + if (self().hasModelDef(id)) { - return &self.modelDef(id); + return &self().modelDef(id); } // Get a new entry. @@ -689,7 +689,7 @@ DENG2_PIMPL(ClientResources) try { return fileSys().findPath(de::Uri("Models", modelFilePath.toString().fileNamePath() / skinPath.fileName()), - RLF_DEFAULT, self.resClass(RC_GRAPHIC)); + RLF_DEFAULT, self().resClass(RC_GRAPHIC)); } catch (FS1::NotFoundError const &) {} // Ignore this error. @@ -697,7 +697,7 @@ DENG2_PIMPL(ClientResources) /// @throws FS1::NotFoundError if no resource was found. return fileSys().findPath(de::Uri("Models", skinPath), RLF_DEFAULT, - self.resClass(RC_GRAPHIC)); + self().resClass(RC_GRAPHIC)); } /** @@ -705,7 +705,7 @@ DENG2_PIMPL(ClientResources) */ short defineSkinAndAddToModelIndex(FrameModel &mdl, Path const &skinPath) { - if (ClientTexture *tex = static_cast(self.textures().defineTexture("ModelSkins", de::Uri(skinPath)))) + if (ClientTexture *tex = static_cast(self().textures().defineTexture("ModelSkins", de::Uri(skinPath)))) { // A duplicate? (return existing skin number) for (dint i = 0; i < mdl.skinCount(); ++i) @@ -734,7 +734,7 @@ DENG2_PIMPL(ClientResources) { de::Uri foundResourceUri(Path(findSkinPath(skin.name, modelFilePath))); - skin.texture = self.textures().defineTexture("ModelSkins", foundResourceUri); + skin.texture = self().textures().defineTexture("ModelSkins", foundResourceUri); // We have found one more skin for this model. numFoundSkins += 1; @@ -753,7 +753,7 @@ DENG2_PIMPL(ClientResources) try { String foundPath = fileSys().findPath(searchPath, RLF_DEFAULT, - self.resClass(RC_GRAPHIC)); + self().resClass(RC_GRAPHIC)); // Ensure the found path is absolute. foundPath = App_BasePath() / foundPath; @@ -804,7 +804,7 @@ DENG2_PIMPL(ClientResources) // Find the top and bottom heights. dfloat top, bottom; - dfloat height = self.model(smf.modelId).frame(smf.frame).horizontalRange(&top, &bottom); + dfloat height = self().model(smf.modelId).frame(smf.frame).horizontalRange(&top, &bottom); if (fequal(height, 0.f)) height = 1; dfloat scale = destHeight / height; @@ -845,7 +845,7 @@ DENG2_PIMPL(ClientResources) SubmodelDef &sub = def->subModelDef(i); - self.model(sub.modelId).frame(sub.frame).bounds(min, max); + self().model(sub.modelId).frame(sub.frame).bounds(min, max); // Half the distance from bottom left to top right. dfloat radius = ( def->scale.x * (max.x - min.x) @@ -918,7 +918,7 @@ DENG2_PIMPL(ClientResources) try { String foundPath = fileSys().findPath(searchPath, RLF_DEFAULT, - self.resClass(RC_MODEL)); + self().resClass(RC_MODEL)); // Ensure the found path is absolute. foundPath = App_BasePath() / foundPath; @@ -1037,7 +1037,7 @@ DENG2_PIMPL(ClientResources) { de::Uri foundResourceUri(Path(findSkinPath(skinFilePath, modelFilePath))); - sub->shinySkin = self.textures().defineTexture("ModelReflectionSkins", foundResourceUri); + sub->shinySkin = self().textures().defineTexture("ModelReflectionSkins", foundResourceUri); } catch (FS1::NotFoundError const &) { @@ -1080,7 +1080,7 @@ DENG2_PIMPL(ClientResources) sprFrame = modef->state->frame; } - if (Record const *sprite = self.sprites().spritePtr(sprNum, sprFrame)) + if (Record const *sprite = self().sprites().spritePtr(sprNum, sprFrame)) { scaleModelToSprite(*modef, sprite); } @@ -1094,17 +1094,17 @@ DENG2_PIMPL(ClientResources) if (stateModefs[stateNum] < 0) { // No modef; use this. - stateModefs[stateNum] = self.indexOf(modef); + stateModefs[stateNum] = self().indexOf(modef); } else { // Must check intermark; smallest wins! - FrameModelDef *other = self.modelDefForState(stateNum); + FrameModelDef *other = self().modelDefForState(stateNum); if ((modef->interMark <= other->interMark && // Should never be == modef->select == other->select) || modef->select < other->select) // Smallest selector? { - stateModefs[stateNum] = self.indexOf(modef); + stateModefs[stateNum] = self().indexOf(modef); } } } @@ -1116,7 +1116,7 @@ DENG2_PIMPL(ClientResources) SubmodelDef *sub = &modef->subModelDef(i); if (sub->modelId && sub->frame >= 0) { - self.model(sub->modelId).frame(sub->frame).bounds(min, max); + self().model(sub->modelId).frame(sub->frame).bounds(min, max); modef->setParticleOffset(i, ((max + min) / 2 + sub->offset) * modef->scale + modef->offset); } } @@ -1202,7 +1202,7 @@ DENG2_PIMPL(ClientResources) void colorPaletteColorTableChanged(res::ColorPalette &colorPalette) { // Release all GL-textures prepared using @a colorPalette. - foreach (res::Texture *texture, self.textures().allTextures()) + foreach (res::Texture *texture, self().textures().allTextures()) { colorpalette_analysis_t *cp = reinterpret_cast(texture->analysisDataPointer(res::Texture::ColorPaletteAnalysis)); if (cp && cp->paletteId == colorpaletteid_t(colorPalette.id())) diff --git a/doomsday/apps/client/src/resource/clienttexture.cpp b/doomsday/apps/client/src/resource/clienttexture.cpp index 1d7c98381f..6efe60b028 100644 --- a/doomsday/apps/client/src/resource/clienttexture.cpp +++ b/doomsday/apps/client/src/resource/clienttexture.cpp @@ -55,7 +55,7 @@ DENG2_PIMPL(ClientTexture) LOG_AS("ClientTexture::clearVariants") LOGDEV_RES_WARNING("GLName (%i) still set for a variant of \"%s\" %p. Perhaps it wasn't released?") << variant->glName() - << self.manifest().composeUri() + << self().manifest().composeUri() << this << textualVariantSpec; } diff --git a/doomsday/apps/client/src/resource/compositebitmapfont.cpp b/doomsday/apps/client/src/resource/compositebitmapfont.cpp index b6c8fc4b13..4df6697d5a 100644 --- a/doomsday/apps/client/src/resource/compositebitmapfont.cpp +++ b/doomsday/apps/client/src/resource/compositebitmapfont.cpp @@ -53,12 +53,12 @@ DENG2_PIMPL(CompositeBitmapFont) { zap(glyphs); zap(missingGlyph); - self._flags |= AbstractFont::Colorize; + self()._flags |= AbstractFont::Colorize; } ~Impl() { - self.glDeinit(); + self().glDeinit(); } Glyph &glyph(uchar ch) diff --git a/doomsday/apps/client/src/resource/fontmanifest.cpp b/doomsday/apps/client/src/resource/fontmanifest.cpp index b69effadcb..a9dac913f4 100644 --- a/doomsday/apps/client/src/resource/fontmanifest.cpp +++ b/doomsday/apps/client/src/resource/fontmanifest.cpp @@ -40,7 +40,7 @@ DENG2_OBSERVES(AbstractFont, Deletion) ~Impl() { - DENG2_FOR_PUBLIC_AUDIENCE(Deletion, i) i->fontManifestBeingDeleted(self); + DENG2_FOR_PUBLIC_AUDIENCE(Deletion, i) i->fontManifestBeingDeleted(self()); } // Observes AbstractFont::Deletion. diff --git a/doomsday/apps/client/src/resource/fontscheme.cpp b/doomsday/apps/client/src/resource/fontscheme.cpp index 9536d6dc59..5873685926 100644 --- a/doomsday/apps/client/src/resource/fontscheme.cpp +++ b/doomsday/apps/client/src/resource/fontscheme.cpp @@ -44,7 +44,7 @@ DENG2_OBSERVES(FontManifest, Deletion) ~Impl() { - self.clear(); + self().clear(); DENG2_ASSERT(index.isEmpty()); // sanity check. } diff --git a/doomsday/apps/client/src/resource/framemodel.cpp b/doomsday/apps/client/src/resource/framemodel.cpp index 315b2f4a0d..94a651cdcd 100644 --- a/doomsday/apps/client/src/resource/framemodel.cpp +++ b/doomsday/apps/client/src/resource/framemodel.cpp @@ -160,7 +160,7 @@ DENG2_PIMPL(FrameModel) ~Impl() { - self.clearAllFrames(); + self().clearAllFrames(); } #pragma pack(1) diff --git a/doomsday/apps/client/src/resource/materialanimator.cpp b/doomsday/apps/client/src/resource/materialanimator.cpp index e5c70b82a3..9632ed9dc2 100644 --- a/doomsday/apps/client/src/resource/materialanimator.cpp +++ b/doomsday/apps/client/src/resource/materialanimator.cpp @@ -348,7 +348,7 @@ DENG2_PIMPL(MaterialAnimator) void initLayers() { clearLayers(); - for (int i = 0; i < self.material().layerCount(); ++i) + for (int i = 0; i < self().material().layerCount(); ++i) { layers << new LayerState; } @@ -361,7 +361,7 @@ DENG2_PIMPL(MaterialAnimator) { layers[i]->stageTextures.clear(); - if (world::TextureMaterialLayer const *layer = self.material().layer(i).maybeAs()) + if (world::TextureMaterialLayer const *layer = self().material().layer(i).maybeAs()) { for (int k = 0; k < layer->stageCount(); ++k) { @@ -379,7 +379,7 @@ DENG2_PIMPL(MaterialAnimator) void initDecorations() { clearDecorations(); - self.material().forAllDecorations([this] (MaterialDecoration &decor) + self().material().forAllDecorations([this] (MaterialDecoration &decor) { decorations << new Decoration(decor); return LoopContinue; diff --git a/doomsday/apps/client/src/resource/texturevariant.cpp b/doomsday/apps/client/src/resource/texturevariant.cpp index 50e25a3ff3..2f5786cb10 100644 --- a/doomsday/apps/client/src/resource/texturevariant.cpp +++ b/doomsday/apps/client/src/resource/texturevariant.cpp @@ -290,7 +290,7 @@ DENG2_PIMPL(ClientTexture::Variant) ~Impl() { // Release any GL texture we may have prepared. - self.release(); + self().release(); } }; diff --git a/doomsday/apps/client/src/ui/bindcontext.cpp b/doomsday/apps/client/src/ui/bindcontext.cpp index 062bada252..cc5e2b7184 100644 --- a/doomsday/apps/client/src/ui/bindcontext.cpp +++ b/doomsday/apps/client/src/ui/bindcontext.cpp @@ -172,7 +172,7 @@ DENG2_PIMPL(BindContext) { LOG_INPUT_VERBOSE("Deleting binding %i, it has been overridden by binding %i") << bindId << (cmdBinding? cmdBinding->geti(VAR_ID) : impBinding->geti(VAR_ID)); - self.deleteBinding(bindId); + self().deleteBinding(bindId); } } } diff --git a/doomsday/apps/client/src/ui/clientwindow.cpp b/doomsday/apps/client/src/ui/clientwindow.cpp index 7fde36f00f..64acbd78d5 100644 --- a/doomsday/apps/client/src/ui/clientwindow.cpp +++ b/doomsday/apps/client/src/ui/clientwindow.cpp @@ -128,7 +128,7 @@ DENG2_PIMPL(ClientWindow) , quitX (new AnimationRule(0, Animation::EaseBoth)) , contentXf (*i) { - self.setTransform(contentXf); + self().setTransform(contentXf); /// @todo The decision whether to receive input notifications from the /// canvas is really a concern for the input drivers. @@ -137,7 +137,7 @@ DENG2_PIMPL(ClientWindow) App::app().audienceForStartupComplete() += this; // Listen to input. - self.eventHandler().audienceForMouseStateChange() += this; + self().eventHandler().audienceForMouseStateChange() += this; foreach (String s, configVariableNames()) { @@ -163,8 +163,8 @@ DENG2_PIMPL(ClientWindow) StringList configVariableNames() const { return StringList() - << self.configName("fsaa") - << self.configName("vsync"); + << self().configName("fsaa") + << self().configName("vsync"); } void setupUI() @@ -352,7 +352,7 @@ DENG2_PIMPL(ClientWindow) #endif */ - self.audienceForAttributeChange() += this; + self().audienceForAttributeChange() += this; } void appStartupCompleted() @@ -385,7 +385,7 @@ DENG2_PIMPL(ClientWindow) // Check with Style if blurring is allowed. taskBar->console().enableBlur(taskBar->style().isBlurringAllowed()); - self.hideTaskBarBlur(); // update background blur mode + self().hideTaskBarBlur(); // update background blur mode activateOculusRiftModeIfConnected(); } @@ -450,7 +450,7 @@ DENG2_PIMPL(ClientWindow) GL_state.features.multisample = GLTextureFramebuffer::defaultMultisampling() > 1; LOGDEV_GL_MSG("GL feature: Multisampling: %b") << GL_state.features.multisample; - if (vrCfg().needsStereoGLFormat() && !self.format().stereo()) + if (vrCfg().needsStereoGLFormat() && !self().format().stereo()) { LOG_GL_WARNING("Current VR mode needs a stereo buffer, but it isn't supported"); } @@ -459,7 +459,7 @@ DENG2_PIMPL(ClientWindow) game->enable(); // Configure a viewport immediately. - GLState::current().setViewport(Rectangleui(0, 0, self.pixelWidth(), self.pixelHeight())).apply(); + GLState::current().setViewport(Rectangleui(0, 0, self().pixelWidth(), self().pixelHeight())).apply(); LOG_DEBUG("GameWidget enabled"); @@ -467,16 +467,16 @@ DENG2_PIMPL(ClientWindow) { needMainInit = false; - self.raise(); - self.requestActivate(); + self().raise(); + self().requestActivate(); - self.eventHandler().audienceForFocusChange() += this; + self().eventHandler().audienceForFocusChange() += this; /*#ifdef WIN32 - if (self.isFullScreen()) + if (self().isFullScreen()) { // It would seem we must manually give our canvas focus. Bug in Qt? - self.canvas().setFocus(); + self().canvas().setFocus(); } #endif*/ @@ -491,7 +491,7 @@ DENG2_PIMPL(ClientWindow) { LOG_AS("ClientWindow"); - Size size = self.pixelSize(); + Size size = self().pixelSize(); LOG_TRACE("Window resized to %s pixels") << size.asText(); GLState::current().setViewport(Rectangleui(0, 0, size.x, size.y)); @@ -509,7 +509,7 @@ DENG2_PIMPL(ClientWindow) ClientApp::app().postFrame(); /// @todo what about multiwindow? // Frame has been shown, now we can do post-frame updates. - updateFpsNotification(self.frameRate()); + updateFpsNotification(self().frameRate()); completeFade(); } @@ -521,7 +521,7 @@ DENG2_PIMPL(ClientWindow) void showOrHideQuitButton() { TimeDelta const SPAN = 0.6; - if (self.isFullScreen() && !DoomsdayApp::isGameLoaded()) + if (self().isFullScreen() && !DoomsdayApp::isGameLoaded()) { quitX->set(-quitButton->rule().width() - Style::get().rules().rule("gap"), SPAN); } @@ -585,7 +585,7 @@ DENG2_PIMPL(ClientWindow) void windowFocusChanged(GLWindow &, bool hasFocus) { LOG_DEBUG("windowFocusChanged focus:%b fullscreen:%b hidden:%b minimized:%b") - << hasFocus << self.isFullScreen() << self.isHidden() << self.isMinimized(); + << hasFocus << self().isFullScreen() << self().isHidden() << self().isMinimized(); if (!hasFocus) { @@ -596,12 +596,12 @@ DENG2_PIMPL(ClientWindow) }); InputSystem::get().clearEvents(); - self.eventHandler().trapMouse(false); + self().eventHandler().trapMouse(false); } - else if (self.isFullScreen() && !taskBar->isOpen() && DoomsdayApp::isGameLoaded()) + else if (self().isFullScreen() && !taskBar->isOpen() && DoomsdayApp::isGameLoaded()) { // Trap the mouse again in fullscreen mode. - self.eventHandler().trapMouse(); + self().eventHandler().trapMouse(); } // Generate an event about this. @@ -615,7 +615,7 @@ DENG2_PIMPL(ClientWindow) void updateFpsNotification(float fps) { - notifications->showOrHide(*fpsCounter, self.isFPSCounterVisible()); + notifications->showOrHide(*fpsCounter, self().isFPSCounterVisible()); if (!fequal(oldFps, fps)) { @@ -628,12 +628,12 @@ DENG2_PIMPL(ClientWindow) { if (variable.name() == "fsaa") { - //self.updateCanvasFormat(); + //self().updateCanvasFormat(); } else if (variable.name() == "vsync") { /*#ifdef WIN32 - self.updateCanvasFormat(); + self().updateCanvasFormat(); DENG2_UNUSED(newValue); #else*/ GL_SetVSync(newValue.isTrue()); @@ -699,7 +699,7 @@ DENG2_PIMPL(ClientWindow) needRootSizeUpdate = false; - Vector2ui const size = contentXf.logicalRootSize(self.pixelSize()); + Vector2ui const size = contentXf.logicalRootSize(self().pixelSize()); // Tell the widgets. root.setViewSize(size); @@ -712,7 +712,7 @@ DENG2_PIMPL(ClientWindow) if (mini && !isGameMini) { // Get rid of the sidebar, if it's open. - self.setSidebar(RightEdge, nullptr); + self().setSidebar(RightEdge, nullptr); auto const &unit = Style::get().rules().rule(RuleBank::UNIT); @@ -733,7 +733,7 @@ DENG2_PIMPL(ClientWindow) void updateMouseCursor() { // The cursor is only needed if the content is warped. - cursor->show(!self.eventHandler().isMouseTrapped() && VRConfig::modeAppliesDisplacement(vrCfg().mode())); + cursor->show(!self().eventHandler().isMouseTrapped() && VRConfig::modeAppliesDisplacement(vrCfg().mode())); // Show or hide the native mouse cursor. if (cursor->isVisible()) diff --git a/doomsday/apps/client/src/ui/clientwindowsystem.cpp b/doomsday/apps/client/src/ui/clientwindowsystem.cpp index 9d80fb3528..f1f52c5f1e 100644 --- a/doomsday/apps/client/src/ui/clientwindowsystem.cpp +++ b/doomsday/apps/client/src/ui/clientwindowsystem.cpp @@ -43,8 +43,8 @@ DENG2_PIMPL(ClientWindowSystem) Impl(Public *i) : Base(i) { - self.setStyle(new ClientStyle); - self.style().load(App::packageLoader().load("net.dengine.client.defaultstyle")); + self().setStyle(new ClientStyle); + self().style().load(App::packageLoader().load("net.dengine.client.defaultstyle")); using SReg = ConfigProfiles; settings.define(SReg::ConfigVariable, "window.main.showFps") diff --git a/doomsday/apps/client/src/ui/dialogs/aboutdialog.cpp b/doomsday/apps/client/src/ui/dialogs/aboutdialog.cpp index 1fcd93379a..f916f7407e 100644 --- a/doomsday/apps/client/src/ui/dialogs/aboutdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/aboutdialog.cpp @@ -44,12 +44,12 @@ DENG2_PIMPL(AboutDialog) // Popup with GL info. glPopup = new DocumentPopupWidget; glPopup->document().setText(Sys_GLDescription()); - self.add(glPopup); + self().add(glPopup); // Popup with audio info. audioPopup = new DocumentPopupWidget; audioPopup->document().setText(App_AudioSystem().description()); - self.add(audioPopup); + self().add(audioPopup); } }; diff --git a/doomsday/apps/client/src/ui/dialogs/alertdialog.cpp b/doomsday/apps/client/src/ui/dialogs/alertdialog.cpp index d75df652f4..8e58821617 100644 --- a/doomsday/apps/client/src/ui/dialogs/alertdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/alertdialog.cpp @@ -106,12 +106,12 @@ DENG_GUI_PIMPL(AlertDialog) notification->setImage(style().images().image("alert")); notification->setOverrideImageSize(style().fonts().font("default").height().value()); notification->setOpener([this] (PopupWidget *) { - self.showListOfAlerts(); + self().showListOfAlerts(); }); // The menu expands with all the alerts, and the dialog's scroll area allows // browsing it up and down. - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); alerts = new MenuWidget; alerts->enableScrolling(false); alerts->setGridSize(1, ui::Expand, 0, ui::Expand); diff --git a/doomsday/apps/client/src/ui/dialogs/audiosettingsdialog.cpp b/doomsday/apps/client/src/ui/dialogs/audiosettingsdialog.cpp index d359014845..3958499b5f 100644 --- a/doomsday/apps/client/src/ui/dialogs/audiosettingsdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/audiosettingsdialog.cpp @@ -56,7 +56,7 @@ DENG_GUI_PIMPL(AudioSettingsDialog) Impl(Public *i) : Base(i) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); if (DoomsdayApp::isGameLoaded()) { @@ -83,7 +83,7 @@ DENG_GUI_PIMPL(AudioSettingsDialog) musicVolume->setStep(1.0 / musicVolume->displayFactor()); // Developer options. - self.add(devPopup = new GridPopupWidget); + self().add(devPopup = new GridPopupWidget); soundInfo = new CVarToggleWidget("sound-info", tr("Sound Channel Status")); *devPopup << soundInfo; devPopup->commit(); @@ -139,7 +139,7 @@ DENG_GUI_PIMPL(AudioSettingsDialog) { if (!DoomsdayApp::isGameLoaded()) return; - foreach (Widget *w, self.area().childWidgets() + devPopup->content().childWidgets()) + foreach (Widget *w, self().area().childWidgets() + devPopup->content().childWidgets()) { if (ICVarWidget *cv = w->maybeAs()) { diff --git a/doomsday/apps/client/src/ui/dialogs/coloradjustmentdialog.cpp b/doomsday/apps/client/src/ui/dialogs/coloradjustmentdialog.cpp index 53c7be33f0..d20eaef40d 100644 --- a/doomsday/apps/client/src/ui/dialogs/coloradjustmentdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/coloradjustmentdialog.cpp @@ -33,7 +33,7 @@ DENG_GUI_PIMPL(ColorAdjustmentDialog) Impl(Public *i) : Base(i) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); LabelWidget *gammaLabel = LabelWidget::newWithText(tr("Gamma:"), &area); LabelWidget *contrastLabel = LabelWidget::newWithText(tr("Contrast:"), &area); diff --git a/doomsday/apps/client/src/ui/dialogs/createprofiledialog.cpp b/doomsday/apps/client/src/ui/dialogs/createprofiledialog.cpp index 55dd1ab101..82edcad777 100644 --- a/doomsday/apps/client/src/ui/dialogs/createprofiledialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/createprofiledialog.cpp @@ -44,7 +44,7 @@ DENG_GUI_PIMPL(CreateProfileDialog) { bool valid = false; - String const entry = self.profileName(); + String const entry = self().profileName(); if (!entry.isEmpty()) { if (editing && oldName == entry) @@ -66,7 +66,7 @@ DENG_GUI_PIMPL(CreateProfileDialog) // A game must be selected, too. if (!gameChoice->isValidSelection()) valid = false; - self.buttonWidget(Id1)->enable(valid); + self().buttonWidget(Id1)->enable(valid); } void gameChanged() diff --git a/doomsday/apps/client/src/ui/dialogs/inputsettingsdialog.cpp b/doomsday/apps/client/src/ui/dialogs/inputsettingsdialog.cpp index 71c73f59c5..547f812e49 100644 --- a/doomsday/apps/client/src/ui/dialogs/inputsettingsdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/inputsettingsdialog.cpp @@ -53,7 +53,7 @@ DENG_GUI_PIMPL(InputSettingsDialog) Impl(Public *i) : Base(i) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); // Gamepad. area.add(joyEnable = new CVarToggleWidget("input-joy")); @@ -82,7 +82,7 @@ DENG_GUI_PIMPL(InputSettingsDialog) // Developer options. syncInput = new CVarToggleWidget("input-sharp"); - self.add(devPopup = new GridPopupWidget); + self().add(devPopup = new GridPopupWidget); devPopup->addSpanning(syncInput); *devPopup << LabelWidget::newWithText(tr("Key Grabber:")) << new KeyGrabberWidget; diff --git a/doomsday/apps/client/src/ui/dialogs/logsettingsdialog.cpp b/doomsday/apps/client/src/ui/dialogs/logsettingsdialog.cpp index a7e33b67ac..86973d4f14 100644 --- a/doomsday/apps/client/src/ui/dialogs/logsettingsdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/logsettingsdialog.cpp @@ -96,10 +96,10 @@ DENG2_PIMPL(LogSettingsDialog) { initDomain(domainText[i], domWidgets[i], - i == 0? &self.area() : &fold->content()); + i == 0? &self().area() : &fold->content()); } - self.area().add(separately); - self.area().add(fold); + self().area().add(separately); + self().area().add(fold); // This'll keep the dialog's size fixed even though the choices change size. columnWidth->setSource(domWidgets[0].level->maximumWidth()); diff --git a/doomsday/apps/client/src/ui/dialogs/manualconnectiondialog.cpp b/doomsday/apps/client/src/ui/dialogs/manualconnectiondialog.cpp index c7de76eb68..36f8741036 100644 --- a/doomsday/apps/client/src/ui/dialogs/manualconnectiondialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/manualconnectiondialog.cpp @@ -57,8 +57,8 @@ DENG2_PIMPL(ManualConnectionDialog) // Time to show what we found. querying = false; progress->setRotationSpeed(0); - self.editor().enable(); - self.validate(); + self().editor().enable(); + self().validate(); if (link.foundServerCount(ServerLink::Direct) > 0) { @@ -82,12 +82,12 @@ DENG2_PIMPL(ManualConnectionDialog) ButtonWidget &connectButton() { - return self.buttonWidget(tr("Connect")); + return self().buttonWidget(tr("Connect")); } void aboutToJoinMultiplayerGame(shell::ServerInfo const &) override { - self.accept(); + self().accept(); } }; diff --git a/doomsday/apps/client/src/ui/dialogs/networksettingsdialog.cpp b/doomsday/apps/client/src/ui/dialogs/networksettingsdialog.cpp index 4b341a12ec..6a9b30f6bf 100644 --- a/doomsday/apps/client/src/ui/dialogs/networksettingsdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/networksettingsdialog.cpp @@ -40,12 +40,12 @@ DENG_GUI_PIMPL(NetworkSettingsDialog) Impl(Public *i) : Base(i) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); area.add(webApiUrl = new VariableLineEditWidget(App::config("apiUrl"))); // Developer options. - self.add(devPopup = new GridPopupWidget); + self().add(devPopup = new GridPopupWidget); devPopup->layout().setGridSize(1, 0); *devPopup << (devInfo = new CVarToggleWidget("net-dev")); devPopup->commit(); @@ -53,7 +53,7 @@ DENG_GUI_PIMPL(NetworkSettingsDialog) void fetch() { - foreach (Widget *w, self.area().childWidgets() + devPopup->content().childWidgets()) + foreach (Widget *w, self().area().childWidgets() + devPopup->content().childWidgets()) { if (ICVarWidget *cv = w->maybeAs()) { diff --git a/doomsday/apps/client/src/ui/dialogs/packagecompatibilitydialog.cpp b/doomsday/apps/client/src/ui/dialogs/packagecompatibilitydialog.cpp index 440dd4a2bb..d0037f37e8 100644 --- a/doomsday/apps/client/src/ui/dialogs/packagecompatibilitydialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/packagecompatibilitydialog.cpp @@ -43,7 +43,7 @@ DENG2_PIMPL(PackageCompatibilityDialog) Impl(Public *i) : Base(i) { - self.add(updating = new ProgressWidget); + self().add(updating = new ProgressWidget); updating->setSizePolicy(ui::Expand, ui::Expand); updating->useMiniStyle("altaccent"); updating->setText(tr("Updating...")); @@ -51,9 +51,9 @@ DENG2_PIMPL(PackageCompatibilityDialog) updating->setMode(ProgressWidget::Indefinite); updating->setOpacity(0); updating->rule() - .setInput(Rule::Top, self.buttonsMenu().rule().top()) - .setInput(Rule::Right, self.buttonsMenu().rule().left()) - .setInput(Rule::Height, self.buttonsMenu().rule().height() - self.margins().bottom()); + .setInput(Rule::Top, self().buttonsMenu().rule().top()) + .setInput(Rule::Right, self().buttonsMenu().rule().left()) + .setInput(Rule::Height, self().buttonsMenu().rule().height() - self().margins().bottom()); } String defaultButtonLabel() const @@ -73,7 +73,7 @@ DENG2_PIMPL(PackageCompatibilityDialog) void enableIgnore(bool yes) { ignoreCheck = yes; - if (auto *button = self.buttonWidget(Id1)) + if (auto *button = self().buttonWidget(Id1)) { button->setText(defaultButtonLabel()); } @@ -86,7 +86,7 @@ DENG2_PIMPL(PackageCompatibilityDialog) delete list; list = nullptr; } - self.buttons().clear(); + self().buttons().clear(); try { @@ -96,10 +96,10 @@ DENG2_PIMPL(PackageCompatibilityDialog) return new PackagePopupWidget(list->actionPackage()); }); - self.area().add(list = new PackagesWidget(wanted)); + self().area().add(list = new PackagesWidget(wanted)); list->setActionItems(actions); list->setActionsAlwaysShown(true); - list->setFilterEditorMinimumY(self.area().rule().top()); + list->setFilterEditorMinimumY(self().area().rule().top()); StringList const loaded = DoomsdayApp::loadedPackagesAffectingGameplay(); //qDebug() << "Currently loaded:" << loaded; @@ -109,33 +109,33 @@ DENG2_PIMPL(PackageCompatibilityDialog) conflicted = true; if (list->itemCount() > 0) { - self.message().setText(message + "\n\n" + tr("The packages listed below " + self().message().setText(message + "\n\n" + tr("The packages listed below " "should be loaded.")); - self.buttons() + self().buttons() << new DialogButtonItem(Default | Accept | Id1, defaultButtonLabel(), new CallbackAction([this] () { resolvePackages(); })); } else { list->hide(); - self.message().setText(message + "\n\n" + tr("All additional packages " + self().message().setText(message + "\n\n" + tr("All additional packages " "should be unloaded.")); - self.buttons() + self().buttons() << new DialogButtonItem(Default | Accept | Id1, defaultButtonLabel(), new CallbackAction([this] () { resolvePackages(); })); } - self.buttons() + self().buttons() << new DialogButtonItem(Reject, tr("Cancel")); } } catch (PackagesWidget::UnavailableError const &er) { conflicted = true; - self.message().setText(message + "\n\n" + er.asText()); - self.buttons() << new DialogButtonItem(Default | Reject); + self().message().setText(message + "\n\n" + er.asText()); + self().buttons() << new DialogButtonItem(Default | Reject); } - self.updateLayout(); + self().updateLayout(); } static bool containsIdentifier(String const &identifier, StringList const &ids) @@ -152,7 +152,7 @@ DENG2_PIMPL(PackageCompatibilityDialog) if (ignoreCheck) { LOG_RES_NOTE("Ignoring package compatibility check due to user request"); - self.accept(); + self().accept(); return; } @@ -207,13 +207,13 @@ DENG2_PIMPL(PackageCompatibilityDialog) qDebug() << DoomsdayApp::loadedPackagesAffectingGameplay(); - self.buttonsMenu().disable(); + self().buttonsMenu().disable(); updating->setOpacity(1, 0.3); // Refresh resources. DD_UpdateEngineState(); - self.accept(); + self().accept(); } }; diff --git a/doomsday/apps/client/src/ui/dialogs/packagesdialog.cpp b/doomsday/apps/client/src/ui/dialogs/packagesdialog.cpp index 86e24cad62..5111e2cabc 100644 --- a/doomsday/apps/client/src/ui/dialogs/packagesdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/packagesdialog.cpp @@ -161,7 +161,7 @@ DENG_GUI_PIMPL(PackagesDialog) Impl(Public *i) : Base(i) { - self.leftArea().add(gameTitle = new LabelWidget); + self().leftArea().add(gameTitle = new LabelWidget); gameTitle->add(gameDataFiles = new LabelWidget); // Indicator that is only visible when no packages have been added to the profile. @@ -170,9 +170,9 @@ DENG_GUI_PIMPL(PackagesDialog) nothingSelected->setFont("heading"); nothingSelected->setOpacity(0.5f); nothingSelected->rule() - .setRect(self.leftArea().rule()) + .setRect(self().leftArea().rule()) .setInput(Rule::Top, gameTitle->rule().bottom()); - self.leftArea().add(nothingSelected); + self().leftArea().add(nothingSelected); // Currently selected packages. gameTitle->setSizePolicy(ui::Filled, ui::Expand); @@ -184,21 +184,21 @@ DENG_GUI_PIMPL(PackagesDialog) gameDataFiles->setTextLineAlignment(ui::AlignLeft); gameDataFiles->setAlignment(ui::AlignLeft); gameTitle->rule() - .setInput(Rule::Left, self.leftArea().contentRule().left()) - .setInput(Rule::Top, self.leftArea().contentRule().top()) + .setInput(Rule::Left, self().leftArea().contentRule().left()) + .setInput(Rule::Top, self().leftArea().contentRule().top()) .setInput(Rule::Width, rule("dialog.packages.width")); gameDataFiles->rule() .setRect(gameTitle->rule()) .clearInput(Rule::Top); - self.leftArea().add(menu = new HomeMenuWidget); + self().leftArea().add(menu = new HomeMenuWidget); menu->layout().setRowPadding(Const(0)); menu->rule() - .setInput(Rule::Left, self.leftArea().contentRule().left()) + .setInput(Rule::Left, self().leftArea().contentRule().left()) .setInput(Rule::Top, gameTitle->rule().bottom()) .setInput(Rule::Width, rule("dialog.packages.width")); menu->organizer().setWidgetFactory(*this); menu->audienceForChildAddition() += this; - self.leftArea().enableIndicatorDraw(true); + self().leftArea().enableIndicatorDraw(true); QObject::connect(menu, &HomeMenuWidget::itemClicked, [this] (int index) { @@ -210,8 +210,8 @@ DENG_GUI_PIMPL(PackagesDialog) }); // Package browser. - self.rightArea().add(browser = new PackagesWidget(PackagesWidget::PopulationDisabled, - self.name() + ".filter")); + self().rightArea().add(browser = new PackagesWidget(PackagesWidget::PopulationDisabled, + self().name() + ".filter")); browser->setActionsAlwaysShown(true); browser->setPackageStatus(*this); @@ -265,11 +265,11 @@ DENG_GUI_PIMPL(PackagesDialog) //browser->setColorTheme(Normal, Normal, Normal, Normal); browser->rule() - .setInput(Rule::Left, self.rightArea().contentRule().left()) - .setInput(Rule::Top, self.rightArea().contentRule().top()) + .setInput(Rule::Left, self().rightArea().contentRule().left()) + .setInput(Rule::Top, self().rightArea().contentRule().top()) .setInput(Rule::Width, menu->rule().width()); - self.rightArea().enableIndicatorDraw(true); - browser->setFilterEditorMinimumY(self.rightArea().rule().top()); + self().rightArea().enableIndicatorDraw(true); + browser->setFilterEditorMinimumY(self().rightArea().rule().top()); } void populate() @@ -319,7 +319,7 @@ DENG_GUI_PIMPL(PackagesDialog) GuiWidget *makeItemWidget(ui::Item const &item, GuiWidget const *) { - return new SelectedPackageWidget(item.as(), self); + return new SelectedPackageWidget(item.as(), self()); } void updateItemWidget(GuiWidget &widget, ui::Item const &) diff --git a/doomsday/apps/client/src/ui/dialogs/renderersettingsdialog.cpp b/doomsday/apps/client/src/ui/dialogs/renderersettingsdialog.cpp index a3bd630fb5..d3a392f976 100644 --- a/doomsday/apps/client/src/ui/dialogs/renderersettingsdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/renderersettingsdialog.cpp @@ -61,7 +61,7 @@ DENG_GUI_PIMPL(RendererSettingsDialog) Impl(Public *i) : Base(i) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); area.add(appear = new ProfilePickerWidget(ClientApp::renderSystem().appearanceSettings(), tr("appearance"), "profile-picker")); @@ -76,7 +76,7 @@ DENG_GUI_PIMPL(RendererSettingsDialog) area.add(disableExtPatches = new VariableToggleWidget(tr("Disable for patches"), App::config("resource.noHighResPatches"))); // Set up a separate popup for developer settings. - self.add(devPopup = new GridPopupWidget); + self().add(devPopup = new GridPopupWidget); CVarChoiceWidget *rendTex = new CVarChoiceWidget("rend-tex"); rendTex->items() @@ -129,7 +129,7 @@ DENG_GUI_PIMPL(RendererSettingsDialog) /// @todo These widgets should be intelligent enough to fetch their /// cvar values when they need to.... - foreach (Widget *child, self.area().childWidgets() + devPopup->content().childWidgets()) + foreach (Widget *child, self().area().childWidgets() + devPopup->content().childWidgets()) { if (ICVarWidget *w = child->maybeAs()) { diff --git a/doomsday/apps/client/src/ui/dialogs/uisettingsdialog.cpp b/doomsday/apps/client/src/ui/dialogs/uisettingsdialog.cpp index 6725344a3a..550fdaf94e 100644 --- a/doomsday/apps/client/src/ui/dialogs/uisettingsdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/uisettingsdialog.cpp @@ -42,7 +42,7 @@ DENG2_PIMPL(UISettingsDialog) Impl(Public *i) : Base(i) { - auto &area = self.area(); + auto &area = self().area(); area.add(uiScale = new VariableChoiceWidget(App::config("ui.scaleFactor"))); area.add(showAnnotations = new VariableToggleWidget(tr("Menu Annotations"), App::config("ui.showAnnotations"))); diff --git a/doomsday/apps/client/src/ui/dialogs/videosettingsdialog.cpp b/doomsday/apps/client/src/ui/dialogs/videosettingsdialog.cpp index d7a81d21ff..b56c378759 100644 --- a/doomsday/apps/client/src/ui/dialogs/videosettingsdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/videosettingsdialog.cpp @@ -68,7 +68,7 @@ DENG2_OBSERVES(PersistentGLWindow, AttributeChange) : Base(i) , win(ClientWindow::main()) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); area.add(showFps = new VariableToggleWidget(App::config("window.main.showFps"))); area.add(fullscreen = new ToggleWidget); @@ -152,7 +152,7 @@ DENG2_OBSERVES(PersistentGLWindow, AttributeChange) depths->setSelected(depths->items().findData(win.colorDepthBits())); #endif - foreach (Widget *child, self.area().childWidgets()) + foreach (Widget *child, self().area().childWidgets()) { if (ICVarWidget *cw = child->maybeAs()) cw->updateFromCVar(); diff --git a/doomsday/apps/client/src/ui/dialogs/vrsettingsdialog.cpp b/doomsday/apps/client/src/ui/dialogs/vrsettingsdialog.cpp index e3430f8e15..141f042cbc 100644 --- a/doomsday/apps/client/src/ui/dialogs/vrsettingsdialog.cpp +++ b/doomsday/apps/client/src/ui/dialogs/vrsettingsdialog.cpp @@ -51,7 +51,7 @@ DENG_GUI_PIMPL(VRSettingsDialog) , riftReset(0) , riftSetup(0) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); area.add(mode = new CVarChoiceWidget("rend-vr-mode")); mode->items() @@ -104,7 +104,7 @@ DENG_GUI_PIMPL(VRSettingsDialog) void fetch() { - foreach (Widget *child, self.area().childWidgets()) + foreach (Widget *child, self().area().childWidgets()) { if (ICVarWidget *w = child->maybeAs()) { diff --git a/doomsday/apps/client/src/ui/editors/modelasseteditor.cpp b/doomsday/apps/client/src/ui/editors/modelasseteditor.cpp index 4a2ed74f05..87c665fc00 100644 --- a/doomsday/apps/client/src/ui/editors/modelasseteditor.cpp +++ b/doomsday/apps/client/src/ui/editors/modelasseteditor.cpp @@ -76,7 +76,7 @@ DENG_GUI_PIMPL(ModelAssetEditor) App::packageLoader().audienceForActivity() += this; // The contents of the editor will scroll. - GuiWidget *container = &self.containerWidget(); + GuiWidget *container = &self().containerWidget(); container->add(assetChoice = new ChoiceWidget); assetChoice->popup().useInfoStyle(); @@ -103,8 +103,8 @@ DENG_GUI_PIMPL(ModelAssetEditor) updateAssetsList(); } - Rule const &firstColumnWidthRule() const { return self.firstColumnWidth(); } - ScrollAreaWidget &containerWidget() { return self.containerWidget(); } + Rule const &firstColumnWidthRule() const { return self().firstColumnWidth(); } + ScrollAreaWidget &containerWidget() { return self().containerWidget(); } void resetToDefaults(String const &/*settingName*/) {} @@ -462,7 +462,7 @@ DENG_GUI_PIMPL(ModelAssetEditor) void redoLayout() { - SequentialLayout &layout = self.layout(); + SequentialLayout &layout = self().layout(); layout.clear(); layout << *info << *instLabel; @@ -470,7 +470,7 @@ DENG_GUI_PIMPL(ModelAssetEditor) { layout << g->title() << *g; } - self.updateSidebarLayout(assetLabel->rule().width() + + self().updateSidebarLayout(assetLabel->rule().width() + assetChoice->rule().width(), assetChoice->rule().height()); } diff --git a/doomsday/apps/client/src/ui/editors/rendererappearanceeditor.cpp b/doomsday/apps/client/src/ui/editors/rendererappearanceeditor.cpp index 5ec0fbafe2..ead3c05aac 100644 --- a/doomsday/apps/client/src/ui/editors/rendererappearanceeditor.cpp +++ b/doomsday/apps/client/src/ui/editors/rendererappearanceeditor.cpp @@ -65,7 +65,7 @@ public VariableGroupEditor::IOwner { settings.audienceForProfileChange += this; - GuiWidget *container = &self.containerWidget(); + GuiWidget *container = &self().containerWidget(); // The contents of the editor will scroll. container->add(profile = new ProfilePickerWidget(settings, tr("appearance"))); @@ -378,12 +378,12 @@ public VariableGroupEditor::IOwner Rule const &firstColumnWidthRule() const { - return self.firstColumnWidth(); + return self().firstColumnWidth(); } ScrollAreaWidget &containerWidget() { - return self.containerWidget(); + return self().containerWidget(); } void resetToDefaults(String const &settingName) @@ -401,7 +401,7 @@ public VariableGroupEditor::IOwner { bool const isReadOnly = settings.find(settings.currentProfile()).isReadOnly(); - foreach (Widget *child, self.containerWidget().childWidgets()) + foreach (Widget *child, self().containerWidget().childWidgets()) { if (Group *g = child->maybeAs()) { @@ -423,11 +423,11 @@ public VariableGroupEditor::IOwner void saveFoldState(PersistentState &toState) { - foreach (Widget *child, self.containerWidget().childWidgets()) + foreach (Widget *child, self().containerWidget().childWidgets()) { if (Group *g = child->maybeAs()) { - toState.objectNamespace().set(self.name() + "." + g->name() + ".open", + toState.objectNamespace().set(self().name() + "." + g->name() + ".open", g->isOpen()); } } @@ -437,11 +437,11 @@ public VariableGroupEditor::IOwner { bool gotState = false; - foreach (Widget *child, self.containerWidget().childWidgets()) + foreach (Widget *child, self().containerWidget().childWidgets()) { if (Group *g = child->maybeAs()) { - String const var = self.name() + "." + g->name() + ".open"; + String const var = self().name() + "." + g->name() + ".open"; if (fromState.objectNamespace().has(var)) { gotState = true; diff --git a/doomsday/apps/client/src/ui/home/gamecolumnwidget.cpp b/doomsday/apps/client/src/ui/home/gamecolumnwidget.cpp index 187023214b..1993ec5fc5 100644 --- a/doomsday/apps/client/src/ui/home/gamecolumnwidget.cpp +++ b/doomsday/apps/client/src/ui/home/gamecolumnwidget.cpp @@ -102,14 +102,14 @@ DENG_GUI_PIMPL(GameColumnWidget) , gameFamily(gameFamily) , savedItems(savedItems) { - ScrollAreaWidget &area = self.scrollArea(); + ScrollAreaWidget &area = self().scrollArea(); area.add(menu = new HomeMenuWidget); menu->organizer().setWidgetFactory(*this); menu->rule() .setInput(Rule::Width, area.contentRule().width()) .setInput(Rule::Left, area.contentRule().left()) - .setInput(Rule::Top, self.header().rule().bottom()); + .setInput(Rule::Top, self().header().rule().bottom()); menu->margins().setBottom(""); area.add(newProfileButton = new ButtonWidget); @@ -456,7 +456,7 @@ DENG_GUI_PIMPL(GameColumnWidget) float actionOpacity() const { - return self.isHighlighted()? .4f : 0.f; + return self().isHighlighted()? .4f : 0.f; } void buttonStateChanged(ButtonWidget &button, ButtonWidget::State state) diff --git a/doomsday/apps/client/src/ui/home/gamepanelbuttonwidget.cpp b/doomsday/apps/client/src/ui/home/gamepanelbuttonwidget.cpp index 05b59f7d9a..868d93b005 100644 --- a/doomsday/apps/client/src/ui/home/gamepanelbuttonwidget.cpp +++ b/doomsday/apps/client/src/ui/home/gamepanelbuttonwidget.cpp @@ -102,7 +102,7 @@ DENG_GUI_PIMPL(GamePanelButtonWidget) playButtonPressed(); })); }); - self.addButton(packagesButton); + self().addButton(packagesButton); QObject::connect(packagesButton, &PackagesButtonWidget::packageSelectionChanged, @@ -123,12 +123,12 @@ DENG_GUI_PIMPL(GamePanelButtonWidget) playButton->setStyleImage("play", "default"); playButton->setImageColor(style().colors().colorf("inverted.text")); playButton->setActionFn([this] () { playButtonPressed(); }); - self.addButton(playButton); + self().addButton(playButton); // List of saved games. - saves = new SaveListWidget(self); - saves->rule().setInput(Rule::Width, self.rule().width()); - saves->margins().setZero().setLeft(self.icon().rule().width()); + saves = new SaveListWidget(self()); + saves->rule().setInput(Rule::Width, self().rule().width()); + saves->margins().setZero().setLeft(self().icon().rule().width()); saves->setItems(savedItems); deleteSaveButton = new ButtonWidget; @@ -137,14 +137,14 @@ DENG_GUI_PIMPL(GamePanelButtonWidget) deleteSaveButton->set(Background()); deleteSaveButton->hide(); deleteSaveButton->setActionFn([this] () { deleteButtonPressed(); }); - self.panel().add(deleteSaveButton); + self().panel().add(deleteSaveButton); problemIcon = new LabelWidget; problemIcon->setStyleImage("alert", "default"); problemIcon->setImageColor(style().colors().colorf("accent")); - problemIcon->rule().setRect(self.icon().rule()); + problemIcon->rule().setRect(self().icon().rule()); problemIcon->hide(); - self.icon().add(problemIcon); + self().icon().add(problemIcon); // Package count indicator (non-interactive). packagesCounter = new LabelWidget; @@ -156,15 +156,15 @@ DENG_GUI_PIMPL(GamePanelButtonWidget) packagesCounter->margins().setLeft(""); packagesCounter->setTextAlignment(ui::AlignLeft); packagesCounter->rule() - .setInput(Rule::Right, self.label().rule().right()) - .setMidAnchorY(self.label().rule().midY()); + .setInput(Rule::Right, self().label().rule().right()) + .setMidAnchorY(self().label().rule().midY()); packagesCounter->hide(); - self.label().add(packagesCounter); - self.label().setMinimumHeight(style().fonts().font("default").lineSpacing() * 3 + - self.label().margins().height()); + self().label().add(packagesCounter); + self().label().setMinimumHeight(style().fonts().font("default").lineSpacing() * 3 + + self().label().margins().height()); - self.panel().setContent(saves); - self.panel().open(); + self().panel().setContent(saves); + self().panel().open(); } Game const &game() const @@ -175,18 +175,18 @@ DENG_GUI_PIMPL(GamePanelButtonWidget) void updatePackagesIndicator() { int const count = gameProfile.packages().size(); - bool const shown = count > 0 && !self.isSelected(); + bool const shown = count > 0 && !self().isSelected(); packagesCounter->setText(String::number(count)); packagesCounter->show(shown); if (shown) { - self.setLabelMinimumRightMargin(packagesCounter->rule().width()); + self().setLabelMinimumRightMargin(packagesCounter->rule().width()); } else { - self.setLabelMinimumRightMargin(Const(0)); + self().setLabelMinimumRightMargin(Const(0)); } } @@ -226,18 +226,18 @@ DENG_GUI_PIMPL(GamePanelButtonWidget) { // Delete the savegame file; the UI will be automatically updated. String const path = savedItems.at(saves->selectedPos()).savePath(); - self.unselectSave(); + self().unselectSave(); App::rootFolder().removeFile(path); App::fileSystem().refresh(); })) << new ui::ActionItem(tr("Cancel"), new Action /* nop */); - self.add(pop); + self().add(pop); pop->open(); } void updateGameTitleImage() { - self.icon().setImage(self.makeGameLogo(game(), catalog)); + self().icon().setImage(self().makeGameLogo(game(), catalog)); } }; diff --git a/doomsday/apps/client/src/ui/home/headerwidget.cpp b/doomsday/apps/client/src/ui/home/headerwidget.cpp index b77d8f7ccf..de89b3f04e 100644 --- a/doomsday/apps/client/src/ui/home/headerwidget.cpp +++ b/doomsday/apps/client/src/ui/home/headerwidget.cpp @@ -38,10 +38,10 @@ DENG_GUI_PIMPL(HeaderWidget) Impl(Public *i) : Base(i) { - self.add(logoBg = new LabelWidget); - self.add(logo = new LabelWidget); - self.add(title = new LabelWidget); - self.add(infoPanel = new PanelWidget); + self().add(logoBg = new LabelWidget); + self().add(logo = new LabelWidget); + self().add(title = new LabelWidget); + self().add(infoPanel = new PanelWidget); info = new LabelWidget; infoPanel->setContent(info); @@ -49,7 +49,7 @@ DENG_GUI_PIMPL(HeaderWidget) { infoPanel->open(); } - self.add(menuButton = new PopupButtonWidget); + self().add(menuButton = new PopupButtonWidget); showDescriptionVar().audienceForChange() += this; } diff --git a/doomsday/apps/client/src/ui/home/homewidget.cpp b/doomsday/apps/client/src/ui/home/homewidget.cpp index 1238d1f4a5..a94078c5d9 100644 --- a/doomsday/apps/client/src/ui/home/homewidget.cpp +++ b/doomsday/apps/client/src/ui/home/homewidget.cpp @@ -119,8 +119,8 @@ DENG_GUI_PIMPL(HomeWidget) taskBarHintButton->setFont("small"); taskBarHintButton->setOpacity(.66f); taskBarHintButton->rule() - .setInput(Rule::Right, self.rule().right() - rule("dialog.gap")) - .setInput(Rule::Bottom, self.rule().bottom() - rule("dialog.gap") + *dismissOffset); + .setInput(Rule::Right, self().rule().right() - rule("dialog.gap")) + .setInput(Rule::Bottom, self().rule().bottom() - rule("dialog.gap") + *dismissOffset); taskBarHintButton->setActionFn([this] () { ClientWindow::main().taskBar().open(); }); @@ -171,7 +171,7 @@ DENG_GUI_PIMPL(HomeWidget) button.rule() .setInput(Rule::Width, rule(RuleBank::UNIT)) - .setInput(Rule::Bottom, self.rule().bottom()) + .setInput(Rule::Bottom, self().rule().bottom()) .setInput(Rule::Top, tabs->rule().bottom()); } @@ -241,7 +241,7 @@ DENG_GUI_PIMPL(HomeWidget) void aboutToLoadGame(Game const &gameBeingLoaded) { - self.root().setFocus(nullptr); + self().root().setFocus(nullptr); if (gameBeingLoaded.isNull()) { @@ -250,7 +250,7 @@ DENG_GUI_PIMPL(HomeWidget) else { TimeDelta span = DISMISS_SPAN; - auto &win = self.root().window().as(); + auto &win = self().root().window().as(); if (win.isGameMinimized()) { win.busy().clearTransitionFrameToBlack(); @@ -277,14 +277,14 @@ DENG_GUI_PIMPL(HomeWidget) void moveOffscreen(TimeDelta span = DISMISS_SPAN) { - self.root().setFocus(nullptr); + self().root().setFocus(nullptr); // Home is being moved offscreen, so the game can take over in full size. ClientWindow::main().setGameMinimized(false); if (fequal(dismissOffset->animation().target(), 0.f)) { - dismissOffset->set(-self.rule().height(), span); + dismissOffset->set(-self().rule().height(), span); dismissing = true; } } @@ -293,7 +293,7 @@ DENG_GUI_PIMPL(HomeWidget) { if (!fequal(dismissOffset->animation().target(), 0.f)) { - self.show(); + self().show(); dismissOffset->set(0, span); } } @@ -302,7 +302,7 @@ DENG_GUI_PIMPL(HomeWidget) { if (dismissing && dismissOffset->animation().done()) { - self.hide(); + self().hide(); dismissing = false; } } @@ -315,8 +315,8 @@ DENG_GUI_PIMPL(HomeWidget) col->scrollArea().margins().setTop(tabsBackground->rule().height()); col->rule() .setInput(Rule::Width, *columnWidth) - .setInput(Rule::Height, self.rule().height()); - self.add(col); + .setInput(Rule::Height, self().rule().height()); + self().add(col); Variable *conf = col->configVariable(); if (conf) @@ -328,7 +328,7 @@ DENG_GUI_PIMPL(HomeWidget) void calculateColumnCount() { - visibleColumnCount = de::min(de::max(dsize(1), dsize(self.rule().width().valuei() / + visibleColumnCount = de::min(de::max(dsize(1), dsize(self().rule().width().valuei() / rule("home.column.width").valuei())), tabs->items().size()); } @@ -336,13 +336,13 @@ DENG_GUI_PIMPL(HomeWidget) void updateLayout() { columns.clear(); - columnWidth->setSource(self.rule().width() / visibleColumnCount); + columnWidth->setSource(self().rule().width() / visibleColumnCount); // Lay out the columns from left to right. - SequentialLayout layout(self.rule().left() - *scrollOffset, - self.rule().top() + *dismissOffset, + SequentialLayout layout(self().rule().left() - *scrollOffset, + self().rule().top() + *dismissOffset, ui::Right); - for (Widget *widget : self.childWidgets()) + for (Widget *widget : self().childWidgets()) { if (!widget->behavior().testFlag(Widget::Hidden)) { diff --git a/doomsday/apps/client/src/ui/home/multiplayercolumnwidget.cpp b/doomsday/apps/client/src/ui/home/multiplayercolumnwidget.cpp index 08aa7fa18f..7d85694de5 100644 --- a/doomsday/apps/client/src/ui/home/multiplayercolumnwidget.cpp +++ b/doomsday/apps/client/src/ui/home/multiplayercolumnwidget.cpp @@ -40,10 +40,10 @@ DENG_GUI_PIMPL(MultiplayerColumnWidget) Impl(Public *i) : Base(i) { // Set up the widgets. - ScrollAreaWidget &area = self.scrollArea(); + ScrollAreaWidget &area = self().scrollArea(); area.add(menu = new MultiplayerServerMenuWidget); - self.header().menuButton().setPopup([] (PopupButtonWidget const &) -> PopupWidget * { + self().header().menuButton().setPopup([] (PopupButtonWidget const &) -> PopupWidget * { auto *menu = new PopupMenuWidget; menu->items() << new ui::ActionItem(tr("Connect to Server..."), @@ -56,7 +56,7 @@ DENG_GUI_PIMPL(MultiplayerColumnWidget) menu->rule() .setInput(Rule::Width, area.contentRule().width()) .setInput(Rule::Left, area.contentRule().left()) - .setInput(Rule::Top, self.header().rule().bottom()); + .setInput(Rule::Top, self().header().rule().bottom()); } }; diff --git a/doomsday/apps/client/src/ui/home/multiplayerpanelbuttonwidget.cpp b/doomsday/apps/client/src/ui/home/multiplayerpanelbuttonwidget.cpp index 38d2b69cce..ec51ca9813 100644 --- a/doomsday/apps/client/src/ui/home/multiplayerpanelbuttonwidget.cpp +++ b/doomsday/apps/client/src/ui/home/multiplayerpanelbuttonwidget.cpp @@ -58,14 +58,14 @@ DENG_GUI_PIMPL(MultiplayerPanelButtonWidget) joinButton->useInfoStyle(); joinButton->setSizePolicy(ui::Expand, ui::Expand); joinButton->setActionFn([this] () { joinButtonPressed(); }); - self.addButton(joinButton); + self().addButton(joinButton); info = new LabelWidget; info->setSizePolicy(ui::Fixed, ui::Expand); info->setAlignment(ui::AlignLeft); info->setTextLineAlignment(ui::AlignLeft); - info->rule().setInput(Rule::Width, self.rule().width()); - info->margins().setLeft(self.icon().rule().width()); + info->rule().setInput(Rule::Width, self().rule().width()); + info->margins().setLeft(self().icon().rule().width()); // Menu for additional functions. extra = new PopupButtonWidget; @@ -76,16 +76,16 @@ DENG_GUI_PIMPL(MultiplayerPanelButtonWidget) extra->margins().setTopBottom(RuleBank::UNIT); extra->rule() .setInput(Rule::Bottom, info->rule().bottom() - info->margins().bottom()) - .setMidAnchorX(info->rule().left() + self.icon().rule().width()/2); + .setMidAnchorX(info->rule().left() + self().icon().rule().width()/2); info->add(extra); - self.panel().setContent(info); - self.panel().open(); + self().panel().setContent(info); + self().panel().open(); } void joinButtonPressed() const { - self.root().setFocus(nullptr); + self().root().setFocus(nullptr); DENG2_FOR_PUBLIC_AUDIENCE2(AboutToJoin, i) i->aboutToJoinMultiplayerGame(serverInfo); @@ -156,7 +156,7 @@ DENG_GUI_PIMPL(MultiplayerPanelButtonWidget) { // Let's refresh the icons. catalog.clear(); - self.updateContent(serverInfo); + self().updateContent(serverInfo); } DENG2_PIMPL_AUDIENCE(AboutToJoin) diff --git a/doomsday/apps/client/src/ui/home/packagescolumnwidget.cpp b/doomsday/apps/client/src/ui/home/packagescolumnwidget.cpp index d05573694f..7352601960 100644 --- a/doomsday/apps/client/src/ui/home/packagescolumnwidget.cpp +++ b/doomsday/apps/client/src/ui/home/packagescolumnwidget.cpp @@ -92,13 +92,13 @@ DENG_GUI_PIMPL(PackagesColumnWidget) countLabel = new LabelWidget; - ScrollAreaWidget &area = self.scrollArea(); + ScrollAreaWidget &area = self().scrollArea(); area.add(packages = new PackagesWidget(PackagesWidget::PopulationEnabled, "home-packages")); - //packages->setMaximumPanelHeight(self.rule().height() - self.margins().height() - rule("gap")*3); + //packages->setMaximumPanelHeight(self().rule().height() - self().margins().height() - rule("gap")*3); packages->setActionItems(actions); packages->rule() .setInput(Rule::Width, area.contentRule().width()) - .setInput(Rule::Top, self.header().rule().bottom() + rule("gap")) + .setInput(Rule::Top, self().header().rule().bottom() + rule("gap")) .setInput(Rule::Left, area.contentRule().left()); QObject::connect(packages, &PackagesWidget::itemCountChanged, @@ -115,7 +115,7 @@ DENG_GUI_PIMPL(PackagesColumnWidget) }); // Column menu. - self.header().menuButton().setPopup([] (PopupButtonWidget const &) -> PopupWidget * { + self().header().menuButton().setPopup([] (PopupButtonWidget const &) -> PopupWidget * { auto *menu = new PopupMenuWidget; menu->items() << new ui::SubwidgetItem(tr("Folders"), ui::Left, makePackageFoldersDialog); return menu; diff --git a/doomsday/apps/client/src/ui/home/savelistwidget.cpp b/doomsday/apps/client/src/ui/home/savelistwidget.cpp index 7e58c7d980..a073f2ba14 100644 --- a/doomsday/apps/client/src/ui/home/savelistwidget.cpp +++ b/doomsday/apps/client/src/ui/home/savelistwidget.cpp @@ -45,8 +45,8 @@ DENG_GUI_PIMPL(SaveListWidget) MouseEvent const &mouse = event.as(); if (button.hitTest(mouse) && mouse.state() == MouseEvent::DoubleClick) { - emit d->self.doubleClicked(d->self.items().find( - *d->self.organizer().findItemForWidget(button))); + emit d->self().doubleClicked(d->self().items().find( + *d->self().organizer().findItemForWidget(button))); return true; } } @@ -59,7 +59,7 @@ DENG_GUI_PIMPL(SaveListWidget) Impl(Public *i, GamePanelButtonWidget &owner) : Base(i), owner(owner) { - self.organizer().audienceForWidgetUpdate() += this; + self().organizer().audienceForWidgetUpdate() += this; } void widgetUpdatedForItem(GuiWidget &widget, ui::Item const &item) @@ -86,7 +86,7 @@ DENG_GUI_PIMPL(SaveListWidget) void toggleSelectedItem(ButtonWidget &button) { - auto const buttonItemPos = self.items().find(*self.organizer().findItemForWidget(button)); + auto const buttonItemPos = self().items().find(*self().organizer().findItemForWidget(button)); if (selected == buttonItemPos) { @@ -100,12 +100,12 @@ DENG_GUI_PIMPL(SaveListWidget) updateItemHighlights(&button); } - emit self.selectionChanged(selected); + emit self().selectionChanged(selected); } void updateItemHighlights(ButtonWidget *selectedButton) { - for (auto *w : self.childWidgets()) + for (auto *w : self().childWidgets()) { if (auto *bw = w->maybeAs()) { diff --git a/doomsday/apps/client/src/ui/infine/finale.cpp b/doomsday/apps/client/src/ui/infine/finale.cpp index 71f93a71f1..ab013545b2 100644 --- a/doomsday/apps/client/src/ui/infine/finale.cpp +++ b/doomsday/apps/client/src/ui/infine/finale.cpp @@ -46,7 +46,7 @@ DENG2_PIMPL(Finale) ~Impl() { - DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->finaleBeingDeleted(self); + DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->finaleBeingDeleted(self()); } void loadScript(String const &script) diff --git a/doomsday/apps/client/src/ui/infine/finaleinterpreter.cpp b/doomsday/apps/client/src/ui/infine/finaleinterpreter.cpp index e988220851..c6c554fdf7 100644 --- a/doomsday/apps/client/src/ui/infine/finaleinterpreter.cpp +++ b/doomsday/apps/client/src/ui/infine/finaleinterpreter.cpp @@ -759,7 +759,7 @@ DENG2_PIMPL(FinaleInterpreter) if (!(didSkip = skippingCommand(cmd))) { // Execute forthwith! - cmd->func(*cmd, ops, self); + cmd->func(*cmd, ops, self()); } } diff --git a/doomsday/apps/client/src/ui/inputsystem.cpp b/doomsday/apps/client/src/ui/inputsystem.cpp index f1916fae65..809c50eede 100644 --- a/doomsday/apps/client/src/ui/inputsystem.cpp +++ b/doomsday/apps/client/src/ui/inputsystem.cpp @@ -362,7 +362,7 @@ DENG2_PIMPL(InputSystem) ~Impl() { - self.clearAllContexts(); + self().clearAllContexts(); clearAllDevices(); // Shutdown system APIs. @@ -413,7 +413,7 @@ DENG2_PIMPL(InputSystem) // enough for an echo. if (ev.type == E_AXIS) { - InputDevice const &device = self.device(ev.device); + InputDevice const &device = self().device(ev.device); float const pos = device.axis(ev.axis.id).translateRealPosition(ev.axis.pos); if ((ev.axis.type == EAXIS_ABSOLUTE && fabs(pos) < .5f) || @@ -434,7 +434,7 @@ DENG2_PIMPL(InputSystem) echo.symbolic.name = nameUtf8.constData(); LOG_INPUT_XVERBOSE("Symbolic echo: %s") << name; - self.postEvent(&echo); + self().postEvent(&echo); } /** @@ -448,7 +448,7 @@ DENG2_PIMPL(InputSystem) while ((ddev = nextFromQueue(q))) { // Update the state of the input device tracking table. - self.trackEvent(*ddev); + self().trackEvent(*ddev); if (ignoreInput && ddev->type != E_FOCUS) continue; @@ -458,7 +458,7 @@ DENG2_PIMPL(InputSystem) if (callGameResponders) { // Events must first be converted for the game responders. - validGameEvent = self.convertEvent(*ddev, ev); + validGameEvent = self().convertEvent(*ddev, ev); } if (callGameResponders && validGameEvent && gx.PrivilegedResponder) @@ -480,7 +480,7 @@ DENG2_PIMPL(InputSystem) // Try the binding system to see if we need to respond to the event // and if so, trigger any associated actions. - if (self.tryEvent(*ddev)) + if (self().tryEvent(*ddev)) { continue; } @@ -566,7 +566,7 @@ DENG2_PIMPL(InputSystem) << ev.toggle.text << strlen(ev.toggle.text) << ev.toggle.state; - self.postEvent(&ev); + self().postEvent(&ev); } #undef QUEUESIZE @@ -633,13 +633,13 @@ DENG2_PIMPL(InputSystem) { ev.axis.id = 0; ev.axis.pos = xpos; - self.postEvent(&ev); + self().postEvent(&ev); } if (ypos) { ev.axis.id = 1; ev.axis.pos = ypos; - self.postEvent(&ev); + self().postEvent(&ev); } // Some very verbose output about mouse buttons. @@ -669,13 +669,13 @@ DENG2_PIMPL(InputSystem) { ev.toggle.state = ETOG_DOWN; LOG_INPUT_XVERBOSE("Mouse button %i down") << i; - self.postEvent(&ev); + self().postEvent(&ev); } if (mouse.buttonUps[i]-- > 0) { ev.toggle.state = ETOG_UP; LOG_INPUT_XVERBOSE("Mouse button %i up") << i; - self.postEvent(&ev); + self().postEvent(&ev); } } } @@ -709,13 +709,13 @@ DENG2_PIMPL(InputSystem) if (state.buttonDowns[i]-- > 0) { ev.toggle.state = ETOG_DOWN; - self.postEvent(&ev); + self().postEvent(&ev); LOG_INPUT_XVERBOSE("Joy button %i down") << i; } if (state.buttonUps[i]-- > 0) { ev.toggle.state = ETOG_UP; - self.postEvent(&ev); + self().postEvent(&ev); LOG_INPUT_XVERBOSE("Joy button %i up") << i; } } @@ -742,7 +742,7 @@ DENG2_PIMPL(InputSystem) } LOG_INPUT_XVERBOSE("Joy hat %i angle %f") << i << ev.angle.pos; - self.postEvent(&ev); + self().postEvent(&ev); oldPOV[i] = state.hatAngle[i]; } @@ -757,7 +757,7 @@ DENG2_PIMPL(InputSystem) ev.axis.id = i; ev.axis.pos = state.axis[i]; ev.axis.type = EAXIS_ABSOLUTE; - self.postEvent(&ev); + self().postEvent(&ev); } } @@ -770,11 +770,11 @@ DENG2_PIMPL(InputSystem) // If a head tracking device is connected, the device is marked active. if (!DD_GetInteger(DD_USING_HEAD_TRACKING)) { - self.device(IDEV_HEAD_TRACKER).deactivate(); + self().device(IDEV_HEAD_TRACKER).deactivate(); return; } - self.device(IDEV_HEAD_TRACKER).activate(); + self().device(IDEV_HEAD_TRACKER).activate(); // Get the latest values. //vrCfg().oculusRift().allowUpdate(); @@ -790,16 +790,16 @@ DENG2_PIMPL(InputSystem) // Yaw (1.0 means 180 degrees). ev.axis.id = 0; // Yaw. ev.axis.pos = de::radianToDegree(pry[2]) * 1.0 / 180.0; - self.postEvent(&ev); + self().postEvent(&ev); ev.axis.id = 1; // Pitch (1.0 means 85 degrees). ev.axis.pos = de::radianToDegree(pry[0]) * 1.0 / 85.0; - self.postEvent(&ev); + self().postEvent(&ev); // So I'll assume that if roll ever gets used, 1.0 will mean 180 degrees there too. ev.axis.id = 2; // Roll. ev.axis.pos = de::radianToDegree(pry[1]) * 1.0 / 180.0; - self.postEvent(&ev); + self().postEvent(&ev); } /** @@ -836,9 +836,9 @@ DENG2_PIMPL(InputSystem) InputControl *ctrl = nullptr; switch (bind.geti("type")) { - case E_AXIS: ctrl = &self.device(bind.geti("deviceId")).axis (bind.geti("controlId")); break; - case E_TOGGLE: ctrl = &self.device(bind.geti("deviceId")).button(bind.geti("controlId")); break; - case E_ANGLE: ctrl = &self.device(bind.geti("deviceId")).hat (bind.geti("controlId")); break; + case E_AXIS: ctrl = &self().device(bind.geti("deviceId")).axis (bind.geti("controlId")); break; + case E_TOGGLE: ctrl = &self().device(bind.geti("deviceId")).button(bind.geti("controlId")); break; + case E_ANGLE: ctrl = &self().device(bind.geti("deviceId")).hat (bind.geti("controlId")); break; case E_SYMBOLIC: break; @@ -860,7 +860,7 @@ DENG2_PIMPL(InputSystem) { //ImpulseBinding bind(rec); auto const &bind = rec.compiled(); - InputDevice &dev = self.device(bind.deviceId); + InputDevice &dev = self().device(bind.deviceId); InputControl *ctrl = nullptr; switch (bind.type) diff --git a/doomsday/apps/client/src/ui/savelistdata.cpp b/doomsday/apps/client/src/ui/savelistdata.cpp index 1a68653356..cb78461122 100644 --- a/doomsday/apps/client/src/ui/savelistdata.cpp +++ b/doomsday/apps/client/src/ui/savelistdata.cpp @@ -51,7 +51,7 @@ DENG2_PIMPL(SaveListData) mainCall.enqueue([this, &saveFolder] () { // Needs to be added. - self.append(new SaveItem(saveFolder)); + self().append(new SaveItem(saveFolder)); }); } } @@ -61,11 +61,11 @@ DENG2_PIMPL(SaveListData) // Remove obsolete entries. mainCall.enqueue([this] () { - for (ui::Data::Pos idx = self.size() - 1; idx < self.size(); --idx) + for (ui::Data::Pos idx = self().size() - 1; idx < self().size(); --idx) { - if (!self.at(idx).isValid()) + if (!self().at(idx).isValid()) { - self.remove(idx); + self().remove(idx); } } }); @@ -78,7 +78,7 @@ DENG2_PIMPL(SaveListData) GameStateFolder &save = file->as(); if (shouldAddFolder(save)) { - self.append(new SaveItem(save)); + self().append(new SaveItem(save)); } } } diff --git a/doomsday/apps/client/src/ui/widgets/busywidget.cpp b/doomsday/apps/client/src/ui/widgets/busywidget.cpp index cc65324e3a..14b24ab0e5 100644 --- a/doomsday/apps/client/src/ui/widgets/busywidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/busywidget.cpp @@ -52,8 +52,8 @@ DENG_GUI_PIMPL(BusyWidget) progress->setAlignment(ui::AlignCenter, LabelWidget::AlignOnlyByImage); progress->setRange(Rangei(0, 200)); progress->setImageScale(.2f); - progress->rule().setRect(self.rule()); - self.add(progress); + progress->rule().setRect(self().rule()); + self().add(progress); } void glInit() diff --git a/doomsday/apps/client/src/ui/widgets/consolecommandwidget.cpp b/doomsday/apps/client/src/ui/widgets/consolecommandwidget.cpp index 847ebc5bd8..44d0bec94f 100644 --- a/doomsday/apps/client/src/ui/widgets/consolecommandwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/consolecommandwidget.cpp @@ -57,7 +57,7 @@ DENG2_OBSERVES(DoomsdayApp, GameChange) void updateLexicon() { - self.setLexicon(Con_Lexicon()); + self().setLexicon(Con_Lexicon()); } }; diff --git a/doomsday/apps/client/src/ui/widgets/consolewidget.cpp b/doomsday/apps/client/src/ui/widgets/consolewidget.cpp index 590de883e1..b9c30892fe 100644 --- a/doomsday/apps/client/src/ui/widgets/consolewidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/consolewidget.cpp @@ -137,47 +137,47 @@ DENG_GUI_PIMPL(ConsoleWidget) if (grabbed == RightEdge) { // Adjust width. - width->set(mouse.pos().x - self.rule().left().valuei(), .1f); + width->set(mouse.pos().x - self().rule().left().valuei(), .1f); return true; } else if (grabbed == TopEdge) { - if (mouse.pos().y < self.rule().bottom().valuei()) + if (mouse.pos().y < self().rule().bottom().valuei()) { - height->set(self.rule().bottom().valuei() - mouse.pos().y, .1f); + height->set(self().rule().bottom().valuei() - mouse.pos().y, .1f); log->enablePageKeys(false); } return true; } // Check for grab at the right edge. - Rectanglei pos = self.rule().recti(); + Rectanglei pos = self().rule().recti(); pos.topLeft.x = pos.bottomRight.x - grabWidth; if (pos.contains(mouse.pos())) { if (grabHover != RightEdge) { grabHover = RightEdge; - self.root().window().setCursor(Qt::SizeHorCursor); + self().root().window().setCursor(Qt::SizeHorCursor); } } else { // Maybe a grab at the top edge, then. - pos = self.rule().recti(); + pos = self().rule().recti(); pos.bottomRight.y = pos.topLeft.y + grabWidth; if (pos.contains(mouse.pos())) { if (grabHover != TopEdge) { grabHover = TopEdge; - self.root().window().setCursor(Qt::SizeVerCursor); + self().root().window().setCursor(Qt::SizeVerCursor); } } else if (grabHover != NotGrabbed) { grabHover = NotGrabbed; - self.root().window().setCursor(Qt::ArrowCursor); + self().root().window().setCursor(Qt::ArrowCursor); } } @@ -217,7 +217,7 @@ DENG_GUI_PIMPL(ConsoleWidget) promptButton->setText(yes? _E(b)_E(F) "$" : ">"); // Bottom of the console must follow the active command line height. - self.rule().setInput(Rule::Bottom, next->rule().top() - rule(RuleBank::UNIT)); + self().rule().setInput(Rule::Bottom, next->rule().top() - rule(RuleBank::UNIT)); if (scriptMode == yes) { @@ -240,7 +240,7 @@ DENG_GUI_PIMPL(ConsoleWidget) scriptMode = yes; - emit self.commandModeChanged(); + emit self().commandModeChanged(); } struct RightClick : public GuiWidget::IEventHandler diff --git a/doomsday/apps/client/src/ui/widgets/gamewidget.cpp b/doomsday/apps/client/src/ui/widgets/gamewidget.cpp index 86bb8f5b93..d9115f9170 100644 --- a/doomsday/apps/client/src/ui/widgets/gamewidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/gamewidget.cpp @@ -141,7 +141,7 @@ DENG2_PIMPL(GameWidget) void updateSize() { LOG_AS("GameWidget"); - LOG_GL_XVERBOSE("View resized to ") << self.rule().recti().size().asText(); + LOG_GL_XVERBOSE("View resized to ") << self().rule().recti().size().asText(); // Update viewports. R_SetViewGrid(0, 0); diff --git a/doomsday/apps/client/src/ui/widgets/homeitemwidget.cpp b/doomsday/apps/client/src/ui/widgets/homeitemwidget.cpp index 5bafad27b6..2b86653a70 100644 --- a/doomsday/apps/client/src/ui/widgets/homeitemwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/homeitemwidget.cpp @@ -110,9 +110,9 @@ DENG_GUI_PIMPL(HomeItemWidget) { labelRightMargin = new AnimationRule(0); - self.add(background = new LabelWidget); - self.add(icon = new LabelWidget); - self.add(label = new LabelWidget); + self().add(background = new LabelWidget); + self().add(icon = new LabelWidget); + self().add(label = new LabelWidget); // Observe state of the labels. assets += *background; @@ -167,7 +167,7 @@ DENG_GUI_PIMPL(HomeItemWidget) for (auto *button : buttons) button->show(); } - TimeDelta const SPAN = (self.hasBeenUpdated()? 0.4 : 0.0); + TimeDelta const SPAN = (self().hasBeenUpdated()? 0.4 : 0.0); if (show) { labelRightMargin->set(*buttonsWidth, SPAN/2); @@ -183,8 +183,8 @@ DENG_GUI_PIMPL(HomeItemWidget) void menuItemTriggered(ui::Item const &actionItem) override { // Let the parent menu know which of its items is being interacted with. - self.parentMenu()->setInteractedItem(self.parentMenu()->organizer() - .findItemForWidget(self), + self().parentMenu()->setInteractedItem(self().parentMenu()->organizer() + .findItemForWidget(self()), &actionItem); } @@ -202,7 +202,7 @@ DENG_GUI_PIMPL(HomeItemWidget) */ bool hasColumnAncestor() const { - for (Widget *i = self.parentWidget(); i; i = i->parent()) + for (Widget *i = self().parentWidget(); i; i = i->parent()) { if (i->is()) return true; } diff --git a/doomsday/apps/client/src/ui/widgets/homemenuwidget.cpp b/doomsday/apps/client/src/ui/widgets/homemenuwidget.cpp index de3f55086e..4894553787 100644 --- a/doomsday/apps/client/src/ui/widgets/homemenuwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/homemenuwidget.cpp @@ -33,7 +33,7 @@ DENG_GUI_PIMPL(HomeMenuWidget) Impl(Public *i) : Base(i) { - self.organizer().audienceForWidgetCreation() += this; + self().organizer().audienceForWidgetCreation() += this; } void widgetCreatedForItem(GuiWidget &widget, ui::Item const &) @@ -51,18 +51,18 @@ DENG_GUI_PIMPL(HomeMenuWidget) { if (asset.state() == Asset::Ready) { - self.assets().audienceForStateChange() -= this; // only scroll once + self().assets().audienceForStateChange() -= this; // only scroll once scrollToSelected(); } } void scrollToSelected() { - if (self.hasRoot()) + if (self().hasRoot()) { - if (auto *widget = self.itemWidget(selectedIndex)) + if (auto *widget = self().itemWidget(selectedIndex)) { - self.findTopmostScrollable().scrollToWidget(*widget); + self().findTopmostScrollable().scrollToWidget(*widget); } } } diff --git a/doomsday/apps/client/src/ui/widgets/inputbindingwidget.cpp b/doomsday/apps/client/src/ui/widgets/inputbindingwidget.cpp index 3e1ccaa358..822f808b59 100644 --- a/doomsday/apps/client/src/ui/widgets/inputbindingwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/inputbindingwidget.cpp @@ -48,13 +48,13 @@ DENG_GUI_PIMPL(InputBindingWidget) Impl(Public *i) : Base(i) { - //self.setTextLineAlignment(ui::AlignLeft); - self.setSizePolicy(ui::Fixed, ui::Expand); + //self().setTextLineAlignment(ui::AlignLeft); + self().setSizePolicy(ui::Fixed, ui::Expand); - self.auxiliary().setText(_E(l) + tr("Reset")); + self().auxiliary().setText(_E(l) + tr("Reset")); - self.audienceForPress() += this; - self.auxiliary().audienceForPress() += this; + self().audienceForPress() += this; + self().auxiliary().audienceForPress() += this; } String prettyKey(String const &eventDesc) @@ -110,7 +110,7 @@ DENG_GUI_PIMPL(InputBindingWidget) } } - self.setText(_E(b) + text); + self().setText(_E(b) + text); } void bindCommand(String const &eventDesc) @@ -136,7 +136,7 @@ DENG_GUI_PIMPL(InputBindingWidget) { if (&button == thisPublic) { - if (!self.hasFocus()) + if (!self().hasFocus()) { focus(); } @@ -156,15 +156,15 @@ DENG_GUI_PIMPL(InputBindingWidget) void focus() { root().setFocus(thisPublic); - self.auxiliary().disable(); - self.invertStyle(); + self().auxiliary().disable(); + self().invertStyle(); } void unfocus() { root().setFocus(0); - self.auxiliary().enable(); - self.invertStyle(); + self().auxiliary().enable(); + self().invertStyle(); } }; diff --git a/doomsday/apps/client/src/ui/widgets/keygrabberwidget.cpp b/doomsday/apps/client/src/ui/widgets/keygrabberwidget.cpp index 77f48b5151..cf5877e602 100644 --- a/doomsday/apps/client/src/ui/widgets/keygrabberwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/keygrabberwidget.cpp @@ -36,15 +36,15 @@ DENG_GUI_PIMPL(KeyGrabberWidget) void focus() { root().setFocus(thisPublic); - self.set(Background(Background::GradientFrame, style().colors().colorf("accent"), 6)); - self.setText(tr("Waiting for a key...")); + self().set(Background(Background::GradientFrame, style().colors().colorf("accent"), 6)); + self().setText(tr("Waiting for a key...")); } void unfocus() { root().setFocus(0); - self.set(Background()); - self.setText(tr("Click to focus")); + self().set(Background()); + self().setText(tr("Click to focus")); } }; diff --git a/doomsday/apps/client/src/ui/widgets/multiplayerservermenuwidget.cpp b/doomsday/apps/client/src/ui/widgets/multiplayerservermenuwidget.cpp index 973712b9c2..721a0ff30d 100644 --- a/doomsday/apps/client/src/ui/widgets/multiplayerservermenuwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/multiplayerservermenuwidget.cpp @@ -93,14 +93,14 @@ DENG2_PIMPL(MultiplayerServerMenuWidget) DoomsdayApp::games().audienceForReadiness() += this; link().audienceForDiscoveryUpdate += this; - self.organizer().setWidgetFactory(*this); + self().organizer().setWidgetFactory(*this); } void linkDiscoveryUpdate(ServerLink const &link) override { bool changed = false; - ui::Data &items = self.items(); + ui::Data &items = self().items(); // Remove obsolete entries. for (ui::Data::Pos idx = 0; idx < items.size(); ++idx) @@ -175,7 +175,7 @@ DENG2_PIMPL(MultiplayerServerMenuWidget) void gameReadinessUpdated() override { - foreach (Widget *w, self.childWidgets()) + foreach (Widget *w, self().childWidgets()) { updateAvailability(w->as()); } @@ -183,7 +183,7 @@ DENG2_PIMPL(MultiplayerServerMenuWidget) void updateAvailability(GuiWidget &menuItemWidget) { - auto const &item = self.organizer().findItemForWidget(menuItemWidget)->as(); + auto const &item = self().organizer().findItemForWidget(menuItemWidget)->as(); bool playable = false; String gameId = item.gameId(); diff --git a/doomsday/apps/client/src/ui/widgets/multiplayerstatuswidget.cpp b/doomsday/apps/client/src/ui/widgets/multiplayerstatuswidget.cpp index a992ef8cab..219950edd5 100644 --- a/doomsday/apps/client/src/ui/widgets/multiplayerstatuswidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/multiplayerstatuswidget.cpp @@ -47,7 +47,7 @@ DENG_GUI_PIMPL(MultiplayerStatusWidget) void networkGameJoined() { - /*self.menu().organizer().itemWidget(POS_SERVER_ADDRESS)->as() + /*self().menu().organizer().itemWidget(POS_SERVER_ADDRESS)->as() .setText(_E(l) + tr("Server:") + _E(.) + " " + link().address().asText());*/ } diff --git a/doomsday/apps/client/src/ui/widgets/packagecontentoptionswidget.cpp b/doomsday/apps/client/src/ui/widgets/packagecontentoptionswidget.cpp index 8388d7eef0..243cc211eb 100644 --- a/doomsday/apps/client/src/ui/widgets/packagecontentoptionswidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/packagecontentoptionswidget.cpp @@ -121,13 +121,13 @@ DENG_GUI_PIMPL(PackageContentOptionsWidget) : Base(i) , packageId(packageId) { - self.add(summary = new LabelWidget); + self().add(summary = new LabelWidget); summary->setSizePolicy(ui::Fixed, ui::Expand); summary->setFont("small"); summary->setTextColor("altaccent"); summary->setAlignment(ui::AlignLeft); - auto *label = LabelWidget::newWithText(tr("Select:"), &self); + auto *label = LabelWidget::newWithText(tr("Select:"), thisPublic); label->setSizePolicy(ui::Expand, ui::Expand); label->setFont("small"); label->setAlignment(ui::AlignLeft); @@ -136,19 +136,19 @@ DENG_GUI_PIMPL(PackageContentOptionsWidget) allButton->setSizePolicy(ui::Expand, ui::Expand); allButton->setText(tr("All")); allButton->setFont("small"); - self.add(allButton); + self().add(allButton); auto *noneButton = new ButtonWidget; noneButton->setSizePolicy(ui::Expand, ui::Expand); noneButton->setText(tr("None")); noneButton->setFont("small"); - self.add(noneButton); + self().add(noneButton); auto *defaultsButton = new ButtonWidget; defaultsButton->setSizePolicy(ui::Expand, ui::Expand); defaultsButton->setText(tr("Defaults")); defaultsButton->setFont("small"); - self.add(defaultsButton); + self().add(defaultsButton); contents = new MenuWidget; contents->enableIndicatorDraw(true); @@ -158,29 +158,29 @@ DENG_GUI_PIMPL(PackageContentOptionsWidget) contents->layout().setRowPadding(Const(0)); contents->organizer().setWidgetFactory(*this); contents->setGridSize(1, ui::Filled, 0, ui::Fixed); - self.add(contents); + self().add(contents); // Layout. - auto &rect = self.rule(); - SequentialLayout layout(rect.left() + self.margins().left(), - rect.top() + self.margins().top()); + auto &rect = self().rule(); + SequentialLayout layout(rect.left() + self().margins().left(), + rect.top() + self().margins().top()); layout << *label << *summary << *contents; summary->rule() - .setInput(Rule::Width, rect.width() - self.margins().width()); + .setInput(Rule::Width, rect.width() - self().margins().width()); contents->rule() .setInput(Rule::Left, rect.left()) - .setInput(Rule::Width, summary->rule().width() + self.margins().left()) + .setInput(Rule::Width, summary->rule().width() + self().margins().left()) .setInput(Rule::Height, OperatorRule::minimum(contents->contentHeight(), - maxHeight - self.margins().height() - + maxHeight - self().margins().height() - label->rule().height() - summary->rule().height())); SequentialLayout(label->rule().right(), label->rule().top(), ui::Right) << *defaultsButton << *noneButton << *allButton; - self.rule().setInput(Rule::Height, layout.height() + self.margins().bottom()); + self().rule().setInput(Rule::Height, layout.height() + self().margins().bottom()); // Configure margins. - for (Widget *w : self.childWidgets()) + for (Widget *w : self().childWidgets()) { w->as().margins().set("dialog.gap"); } diff --git a/doomsday/apps/client/src/ui/widgets/packagesbuttonwidget.cpp b/doomsday/apps/client/src/ui/widgets/packagesbuttonwidget.cpp index d23ca7462c..4b4f9b144a 100644 --- a/doomsday/apps/client/src/ui/widgets/packagesbuttonwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/packagesbuttonwidget.cpp @@ -36,21 +36,21 @@ DENG_GUI_PIMPL(PackagesButtonWidget) void updateLabel() { - self.setStyleImage("package"); + self().setStyleImage("package"); if (packages.isEmpty()) { - self.setText(noneLabel); - self.setTextColor("text"); - self.setImageColor(style().colors().colorf("text")); + self().setText(noneLabel); + self().setTextColor("text"); + self().setImageColor(style().colors().colorf("text")); - if (!noneLabel.isEmpty()) self.setImage(nullptr); + if (!noneLabel.isEmpty()) self().setImage(nullptr); } else { - self.setText(String::format("%i", packages.count())); - self.setTextColor("accent"); - self.setImageColor(style().colors().colorf("accent")); + self().setText(String::format("%i", packages.count())); + self().setTextColor("accent"); + self().setImageColor(style().colors().colorf("accent")); } } @@ -73,7 +73,7 @@ DENG_GUI_PIMPL(PackagesButtonWidget) // Notify. QStringList ids; for (auto const &p : packages) ids << p; - emit self.packageSelectionChanged(ids); + emit self().packageSelectionChanged(ids); })); root().addOnTop(dlg); if (setupFunc) setupFunc(*dlg); diff --git a/doomsday/apps/client/src/ui/widgets/packagessidebarwidget.cpp b/doomsday/apps/client/src/ui/widgets/packagessidebarwidget.cpp index 0c576a803b..ae7412b5c6 100644 --- a/doomsday/apps/client/src/ui/widgets/packagessidebarwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/packagessidebarwidget.cpp @@ -32,7 +32,7 @@ DENG_GUI_PIMPL(PackagesSidebarWidget) Impl(Public *i) : Base(i) { - GuiWidget *container = &self.containerWidget(); + GuiWidget *container = &self().containerWidget(); container->add(browser = new PackagesWidget); browser->setFilterEditorMinimumY(Const(0)); diff --git a/doomsday/apps/client/src/ui/widgets/packageswidget.cpp b/doomsday/apps/client/src/ui/widgets/packageswidget.cpp index 59f9d80204..d4ac2e91c7 100644 --- a/doomsday/apps/client/src/ui/widgets/packageswidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/packageswidget.cpp @@ -393,17 +393,17 @@ DENG_GUI_PIMPL(PackagesWidget) })); //maxPanelHeight = new IndirectRule; - //maxPanelHeight->setSource(self.rule().height()); + //maxPanelHeight->setSource(self().rule().height()); - self.add(menu = new HomeMenuWidget); - self.add(search = new LineEditWidget); - self.add(clearSearch = new ButtonWidget); + self().add(menu = new HomeMenuWidget); + self().add(search = new LineEditWidget); + self().add(clearSearch = new ButtonWidget); // Search/filter terms. search->rule() - .setInput(Rule::Left, self.rule().left()) - .setInput(Rule::Right, self.rule().right()) - .setInput(Rule::Top, self.rule().top()); + .setInput(Rule::Left, self().rule().left()) + .setInput(Rule::Right, self().rule().right()) + .setInput(Rule::Top, self().rule().top()); search->setEmptyContentHint(tr("Search packages")); search->setSignalOnEnter(true); search->margins().setRight(style().fonts().font("default").height() + rule("gap")); @@ -444,15 +444,15 @@ DENG_GUI_PIMPL(PackagesWidget) }); menu->setItems(filteredPackages); menu->setBehavior(ChildVisibilityClipping); - if (!self.name().isEmpty()) + if (!self().name().isEmpty()) { menu->setOpacity(0); // initially } menu->layout().setRowPadding(Const(0)); menu->rule() - .setInput(Rule::Left, self.rule().left()) - .setInput(Rule::Right, self.rule().right()) - .setInput(Rule::Top, self.rule().top() + search->rule().height()); + .setInput(Rule::Left, self().rule().left()) + .setInput(Rule::Right, self().rule().right()) + .setInput(Rule::Top, self().rule().top() + search->rule().height()); menu->organizer().setWidgetFactory(*this); menu->setVirtualizationEnabled(true, rule("gap").valuei()*2 + rule(RuleBank::UNIT).valuei() + int(style().fonts().font("default").height().value()*3)); @@ -468,12 +468,12 @@ DENG_GUI_PIMPL(PackagesWidget) refreshProgress = new ProgressWidget; refreshProgress->setMode(ProgressWidget::Indefinite); refreshProgress->setImageScale(.3f); - self.add(refreshProgress); + self().add(refreshProgress); // By default, only the progress indicator is shown. showProgressIndicator(true); - self.rule().setInput(Rule::Height, search->rule().height() + menu->rule().height()); + self().rule().setInput(Rule::Height, search->rule().height() + menu->rule().height()); } ~Impl() @@ -567,7 +567,7 @@ DENG_GUI_PIMPL(PackagesWidget) allPackages.sort(); - emit self.itemCountChanged(filteredPackages.size(), allPackages.size()); + emit self().itemCountChanged(filteredPackages.size(), allPackages.size()); } void updateItems() @@ -612,7 +612,7 @@ DENG_GUI_PIMPL(PackagesWidget) filteredPackages.refilter(); - emit self.itemCountChanged(filteredPackages.size(), allPackages.size()); + emit self().itemCountChanged(filteredPackages.size(), allPackages.size()); } void focusFirstListedPackage() @@ -633,7 +633,7 @@ DENG_GUI_PIMPL(PackagesWidget) { //qDebug() << "Bundles identified, re-populating" << &self; populateEnabled = true; - self.populate(); + self().populate(); }); } } @@ -674,7 +674,7 @@ DENG_GUI_PIMPL(PackagesWidget) GuiWidget *makeItemWidget(ui::Item const &item, GuiWidget const *) { - return new PackageListItemWidget(item.as(), self); + return new PackageListItemWidget(item.as(), self()); } void updateItemWidget(GuiWidget &widget, ui::Item const &) diff --git a/doomsday/apps/client/src/ui/widgets/panelbuttonwidget.cpp b/doomsday/apps/client/src/ui/widgets/panelbuttonwidget.cpp index 4f04d69cc7..2ce241131b 100644 --- a/doomsday/apps/client/src/ui/widgets/panelbuttonwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/panelbuttonwidget.cpp @@ -26,7 +26,7 @@ DENG_GUI_PIMPL(PanelButtonWidget) Impl(Public *i) : Base(i) { - self.add(drawer = new PanelWidget); + self().add(drawer = new PanelWidget); drawer->set(Background(Vector4f(0, 0, 0, .15f))); } }; diff --git a/doomsday/apps/client/src/ui/widgets/privilegedlogwidget.cpp b/doomsday/apps/client/src/ui/widgets/privilegedlogwidget.cpp index f794bd0fac..122cbb3df9 100644 --- a/doomsday/apps/client/src/ui/widgets/privilegedlogwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/privilegedlogwidget.cpp @@ -34,14 +34,14 @@ DENG_GUI_PIMPL(PrivilegedLogWidget) log = new LogWidget("privlog"); log->setLogFormatter(formatter); log->setPrivilegedEntries(true); - self.add(log); + self().add(log); closeButton = new ButtonWidget; closeButton->setSizePolicy(ui::Expand, ui::Expand); closeButton->setImage(style().images().image("close.ringless")); closeButton->setImageScale(toDevicePixels(.25f)); closeButton->setImageColor(style().colors().colorf("altaccent")); - self.add(closeButton); + self().add(closeButton); } }; diff --git a/doomsday/apps/client/src/ui/widgets/profilepickerwidget.cpp b/doomsday/apps/client/src/ui/widgets/profilepickerwidget.cpp index 8f515a7f14..fe142e0a25 100644 --- a/doomsday/apps/client/src/ui/widgets/profilepickerwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/profilepickerwidget.cpp @@ -41,9 +41,9 @@ DENG_GUI_PIMPL(ProfilePickerWidget) , settings(reg) , button(0) { - self.add(button = new PopupButtonWidget); + self().add(button = new PopupButtonWidget); button->setOpener([this] (PopupWidget *) { - self.openMenu(); + self().openMenu(); }); updateStyle(); @@ -58,22 +58,22 @@ DENG_GUI_PIMPL(ProfilePickerWidget) void populate() { - self.items().clear(); + self().items().clear(); foreach (String prof, settings.profiles()) { - self.items() << new ChoiceItem(prof.left(MAX_VISIBLE_PROFILE_NAME), prof); + self().items() << new ChoiceItem(prof.left(MAX_VISIBLE_PROFILE_NAME), prof); } // The items are alphabetically ordered. - self.items().sort(); + self().items().sort(); - self.setSelected(self.items().findData(settings.currentProfile())); + self().setSelected(self().items().findData(settings.currentProfile())); } String currentProfile() const { - return self.selectedItem().data().toString(); + return self().selectedItem().data().toString(); } }; diff --git a/doomsday/apps/client/src/ui/widgets/sidebarwidget.cpp b/doomsday/apps/client/src/ui/widgets/sidebarwidget.cpp index a9129d50b8..c98770353e 100644 --- a/doomsday/apps/client/src/ui/widgets/sidebarwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/sidebarwidget.cpp @@ -69,7 +69,7 @@ DENG_GUI_PIMPL(SidebarWidget) if (newGame.isNull()) { // Back to Home -- sidebars are not expected to remain open. - self.close(); + self().close(); } } }; diff --git a/doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp b/doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp index 3a35f2a47e..456a99e3e5 100644 --- a/doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/taskbarwidget.cpp @@ -141,7 +141,7 @@ DENG_GUI_PIMPL(TaskBarWidget) , uColor ("uColor", GLUniform::Vec4) { uColor = Vector4f(1, 1, 1, 1); - self.set(Background(style().colors().colorf("background"))); + self().set(Background(style().colors().colorf("background"))); vertShift = new AnimationRule(0); @@ -199,8 +199,8 @@ DENG_GUI_PIMPL(TaskBarWidget) break; } - self.updateCommandLineLayout(); - self.requestGeometry(); + self().updateCommandLineLayout(); + self().requestGeometry(); console->commandLine().requestGeometry(); } } @@ -254,12 +254,12 @@ DENG_GUI_PIMPL(TaskBarWidget) void updateGeometry() { Rectanglei pos; - if (self.hasChangedPlace(pos) || self.geometryRequested()) + if (self().hasChangedPlace(pos) || self().geometryRequested()) { - self.requestGeometry(false); + self().requestGeometry(false); VertexBuf::Builder verts; - self.glMakeGeometry(verts); + self().glMakeGeometry(verts); drawable.buffer().setVertices(gl::TriangleStrip, verts, gl::Static); } } @@ -288,7 +288,7 @@ DENG_GUI_PIMPL(TaskBarWidget) itemWidget(configMenu, POS_INPUT_SETTINGS) .show(!game.isNull()); itemWidget(configMenu, POS_DATA_FILES) .show(game.isNull()); - if (self.hasRoot()) + if (self().hasRoot()) { configMenu->menu().updateLayout(); mainMenu->menu().updateLayout(); // Include/exclude shown/hidden menu items. @@ -305,13 +305,13 @@ DENG_GUI_PIMPL(TaskBarWidget) void networkGameJoined() { multi->show(); - self.updateCommandLineLayout(); + self().updateCommandLineLayout(); } void networkGameLeft() { multi->hide(); - self.updateCommandLineLayout(); + self().updateCommandLineLayout(); } void updateStatus() @@ -332,7 +332,7 @@ DENG_GUI_PIMPL(TaskBarWidget) void panelAboutToOpen(PanelWidget &) { - if (self.root().window().as().isGameMinimized()) + if (self().root().window().as().isGameMinimized()) { mainMenu->items().at(POS_MULTIPLAYER).setLabel(tr("Hide Home")); } diff --git a/doomsday/apps/client/src/ui/widgets/tutorialwidget.cpp b/doomsday/apps/client/src/ui/widgets/tutorialwidget.cpp index 6d0b2ce8ea..02dc52e8a5 100644 --- a/doomsday/apps/client/src/ui/widgets/tutorialwidget.cpp +++ b/doomsday/apps/client/src/ui/widgets/tutorialwidget.cpp @@ -76,7 +76,7 @@ DENG_GUI_PIMPL(TutorialWidget) exampleAlert->setImageColor(style().colors().colorf("accent")); // Highlight rectangle. - self.add(highlight = new LabelWidget); + self().add(highlight = new LabelWidget); highlight->set(Background(Background::GradientFrame, style().colors().colorf("accent"), 6)); highlight->setOpacity(0); @@ -195,7 +195,7 @@ DENG_GUI_PIMPL(TutorialWidget) if (s == Finish) { - self.stop(); + self().stop(); return; } @@ -243,7 +243,7 @@ DENG_GUI_PIMPL(TutorialWidget) "chance to pick a shortcut key for opening the console.\n\n" "The tutorial can be restarted later via the application menu.")); //.arg(_E(b) DOOMSDAY_NICENAME _E(.))); - dlg->setAnchor(self.rule().midX(), self.rule().top()); + dlg->setAnchor(self().rule().midX(), self().rule().top()); dlg->setOpeningDirection(ui::Down); break; @@ -287,7 +287,7 @@ DENG_GUI_PIMPL(TutorialWidget) win.taskBar().open(); win.taskBar().closeMainMenu(); win.taskBar().closeConfigMenu(); - dlg->setAnchor(self.rule().midX(), win.taskBar().rule().top()); + dlg->setAnchor(self().rule().midX(), win.taskBar().rule().top()); dlg->setOpeningDirection(ui::Up); startHighlight(win.taskBar()); break; @@ -375,10 +375,10 @@ DENG_GUI_PIMPL(TutorialWidget) .setInput(Rule::Right, dlg->rule().right()); dlg->add(progress); - GuiRootWidget &root = self.root(); + GuiRootWidget &root = self().root(); // Keep the tutorial above any dialogs etc. that might've been opened. - root.moveToTop(self); + root.moveToTop(self()); root.addOnTop(dlg); dlg->open(); diff --git a/doomsday/apps/client/src/updater/downloaddialog.cpp b/doomsday/apps/client/src/updater/downloaddialog.cpp index 943aa219a6..6ca288e87a 100644 --- a/doomsday/apps/client/src/updater/downloaddialog.cpp +++ b/doomsday/apps/client/src/updater/downloaddialog.cpp @@ -71,7 +71,7 @@ DENG2_PIMPL(DownloadDialog) : Base(d), state(Connecting), uri(downloadUri), uri2(fallbackUri), reply(0), receivedBytes(0), totalBytes(0) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); progress = new ProgressWidget; area.add(progress); @@ -81,11 +81,11 @@ DENG2_PIMPL(DownloadDialog) progress->setRange(Rangei(0, 100)); progress->rule() .setLeftTop(area.contentRule().left(), area.contentRule().top()) - .setInput(Rule::Width, self.rule("dialog.download.width")); + .setInput(Rule::Width, self().rule("dialog.download.width")); area.setContentSize(progress->rule().width(), progress->rule().height()); - self.buttons() << new DialogButtonItem(DialogWidget::Reject, + self().buttons() << new DialogButtonItem(DialogWidget::Reject, tr("Cancel Download"), new SignalAction(thisPublic, SLOT(cancel()))); diff --git a/doomsday/apps/client/src/updater/updateavailabledialog.cpp b/doomsday/apps/client/src/updater/updateavailabledialog.cpp index 918da53149..e228695d0a 100644 --- a/doomsday/apps/client/src/updater/updateavailabledialog.cpp +++ b/doomsday/apps/client/src/updater/updateavailabledialog.cpp @@ -70,12 +70,12 @@ DENG2_OBSERVES(ToggleWidget, Toggle) void showProgress(bool show, TimeDelta span) { checking->setOpacity(show? 1 : 0, span); - self.area().setOpacity(show? 0 : 1, span); + self().area().setOpacity(show? 0 : 1, span); if (show) { // Set up a cancel button. - self.buttons().clear() + self().buttons().clear() << new DialogButtonItem(DialogWidget::Reject); } } @@ -86,17 +86,17 @@ DENG2_OBSERVES(ToggleWidget, Toggle) checking->setText(tr("Checking for Updates...")); // The checking indicator is overlaid on the normal content. - checking->rule().setRect(self.rule()); - self.add(checking); + checking->rule().setRect(self().rule()); + self().add(checking); autoCheck = new ToggleWidget; - self.area().add(autoCheck); + self().area().add(autoCheck); autoCheck->setAlignment(ui::AlignLeft); autoCheck->setText(tr("Check for updates automatically")); autoCheck->audienceForToggle() += this; // Include the toggle in the layout. - self.updateLayout(); + self().updateLayout(); } void updateResult(Version const &latest, TimeDelta showSpan) @@ -116,17 +116,17 @@ DENG2_OBSERVES(ToggleWidget, Toggle) { askUpgrade = true; - self.title().setText(tr("Update Available")); - self.title().setImage(style().images().image("updater")); - self.message().setText(tr("There is an update available. The latest %1 release is %2, while you are running %3.") + self().title().setText(tr("Update Available")); + self().title().setImage(style().images().image("updater")); + self().message().setText(tr("There is an update available. The latest %1 release is %2, while you are running %3.") .arg(channel) .arg(_E(b) + latestVersion.asText() + _E(.)) .arg(currentVersion.asText())); } else if (channel == builtInType) // same release type { - self.title().setText(tr("Up to Date")); - self.message().setText(tr("The installed %1 is the latest available %2 build.") + self().title().setText(tr("Up to Date")); + self().message().setText(tr("The installed %1 is the latest available %2 build.") .arg(currentVersion.asText()) .arg(_E(b) + channel + _E(.))); } @@ -134,43 +134,43 @@ DENG2_OBSERVES(ToggleWidget, Toggle) { askDowngrade = true; - self.title().setText(tr("Up to Date")); - self.message().setText(tr("The installed %1 is newer than the latest available %2 build.") + self().title().setText(tr("Up to Date")); + self().message().setText(tr("The installed %1 is newer than the latest available %2 build.") .arg(currentVersion.asText()) .arg(_E(b) + channel + _E(.))); } autoCheck->setInactive(UpdaterSettings().onlyCheckManually()); - self.buttons().clear(); + self().buttons().clear(); if (askDowngrade) { - self.buttons() + self().buttons() << new DialogButtonItem(DialogWidget::Accept, tr("Downgrade to Older")) << new DialogButtonItem(DialogWidget::Reject | DialogWidget::Default, tr("Close")); } else if (askUpgrade) { - self.buttons() + self().buttons() << new DialogButtonItem(DialogWidget::Accept | DialogWidget::Default, tr("Upgrade")) << new DialogButtonItem(DialogWidget::Reject, tr("Not Now")); } else { - self.buttons() + self().buttons() << new DialogButtonItem(DialogWidget::Accept, tr("Reinstall")) << new DialogButtonItem(DialogWidget::Reject | DialogWidget::Default, tr("Close")); } - self.buttons() + self().buttons() << new DialogButtonItem(DialogWidget::Action | DialogWidget::Id1, style().images().image("gear"), new SignalAction(thisPublic, SLOT(editSettings()))); if (askUpgrade) { - self.buttons() + self().buttons() << new DialogButtonItem(DialogWidget::Action, tr("What's New?"), new SignalAction(thisPublic, SLOT(showWhatsNew()))); } diff --git a/doomsday/apps/client/src/updater/updatersettingsdialog.cpp b/doomsday/apps/client/src/updater/updatersettingsdialog.cpp index e55b657eb5..f8efe766ef 100644 --- a/doomsday/apps/client/src/updater/updatersettingsdialog.cpp +++ b/doomsday/apps/client/src/updater/updatersettingsdialog.cpp @@ -61,7 +61,7 @@ DENG2_OBSERVES(ToggleWidget, Toggle) Impl(Public *i, Mode mode) : Base(i) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); // Create the widgets. area.add(autoCheck = new ToggleWidget); @@ -132,12 +132,12 @@ DENG2_OBSERVES(ToggleWidget, Toggle) area.setContentSize(layout.width(), layout.height()); - self.buttons() + self().buttons() << new DialogButtonItem(DialogWidget::Default | DialogWidget::Accept, tr("Close")); if (mode == WithApplyAndCheckButton) { - self.buttons() + self().buttons() << new DialogButtonItem(DialogWidget::Action, tr("Check Now"), new SignalAction(thisPublic, SLOT(applyAndCheckNow()))); } diff --git a/doomsday/apps/client/src/world/base/clientserverworld.cpp b/doomsday/apps/client/src/world/base/clientserverworld.cpp index 93a7845ad9..cce4383c3c 100644 --- a/doomsday/apps/client/src/world/base/clientserverworld.cpp +++ b/doomsday/apps/client/src/world/base/clientserverworld.cpp @@ -473,7 +473,7 @@ DENG2_PIMPL(ClientServerWorld) void makeCurrent(Map *map) { // This is now the current map (if any). - self.setMap(map); + self().setMap(map); if(!map) return; // We cannot make an editable map current. @@ -495,7 +495,7 @@ DENG2_PIMPL(ClientServerWorld) /// so that it may perform the connection itself. Such notification /// would also afford the map the opportunity to prepare various data /// which is only needed when made current (e.g., caches for render). - self.audienceForFrameBegin() += map; + self().audienceForFrameBegin() += map; #endif // Print summary information about this map. @@ -699,20 +699,20 @@ DENG2_PIMPL(ClientServerWorld) Z_PrintStatus(); // Inform interested parties that the "current" map has changed. - self.notifyMapChange(); + self().notifyMapChange(); } /// @todo Split this into subtasks (load, make current, cache assets). bool changeMap(res::MapManifest *mapManifest = nullptr) { - Map *map = self.mapPtr(); + Map *map = self().mapPtr(); #ifdef __CLIENT__ if(map) { // Remove the current map from our audiences. /// @todo Map should handle this. - self.audienceForFrameBegin() -= map; + self().audienceForFrameBegin() -= map; } #endif @@ -726,7 +726,7 @@ DENG2_PIMPL(ClientServerWorld) R_DestroyContactLists(); #endif delete map; - self.setMap(nullptr); + self().setMap(nullptr); Z_FreeTags(PU_MAP, PU_PURGELEVEL - 1); @@ -765,13 +765,13 @@ DENG2_PIMPL(ClientServerWorld) // Output a human-readable report of any issues encountered during conversion. reporter.writeLog(); - return self.hasMap(); + return self().hasMap(); } #ifdef __CLIENT__ void updateHandOrigin() { - DENG2_ASSERT(hand != nullptr && self.hasMap()); + DENG2_ASSERT(hand != nullptr && self().hasMap()); viewdata_t const *viewData = &::viewPlayer->viewport(); hand->setOrigin(viewData->current.origin + viewData->frontVec.xzy() * handDistance); diff --git a/doomsday/apps/client/src/world/base/convexsubspace.cpp b/doomsday/apps/client/src/world/base/convexsubspace.cpp index fe179a54a7..2c0c15ac9d 100644 --- a/doomsday/apps/client/src/world/base/convexsubspace.cpp +++ b/doomsday/apps/client/src/world/base/convexsubspace.cpp @@ -106,11 +106,11 @@ DENG2_PIMPL(ConvexSubspace) { #define MIN_TRIANGLE_EPSILON (0.1) ///< Area - HEdge *firstNode = self.poly().hedge(); + HEdge *firstNode = self().poly().hedge(); fanBase = firstNode; - if(self.poly().hedgeCount() > 3) + if(self().poly().hedgeCount() > 3) { // Splines with higher vertex counts demand checking. Vertex const *base, *a, *b; diff --git a/doomsday/apps/client/src/world/base/line.cpp b/doomsday/apps/client/src/world/base/line.cpp index 6d2449b383..df23102bca 100644 --- a/doomsday/apps/client/src/world/base/line.cpp +++ b/doomsday/apps/client/src/world/base/line.cpp @@ -218,14 +218,14 @@ DENG2_PIMPL(Line::Side) #ifdef __CLIENT__ void updateRadioCorner(shadowcorner_t &sc, dfloat openness, Plane *proximityPlane = nullptr, bool top = false) { - DENG2_ASSERT(self._sector); + DENG2_ASSERT(self()._sector); sc.corner = openness; sc.proximity = proximityPlane; if (sc.proximity) { // Determine relative height offsets (affects shadow map selection). sc.pHeight = sc.proximity->heightSmoothed(); - sc.pOffset = sc.pHeight - self._sector->plane(top? Sector::Ceiling : Sector::Floor).heightSmoothed(); + sc.pOffset = sc.pHeight - self()._sector->plane(top? Sector::Ceiling : Sector::Floor).heightSmoothed(); } else { @@ -1099,7 +1099,7 @@ DENG2_PIMPL(Line) if (!gdata) { // Time to calculate this info. - gdata.reset(new GeomData(self.from(), self.to())); + gdata.reset(new GeomData(self().from(), self().to())); } return *gdata; } diff --git a/doomsday/apps/client/src/world/base/map.cpp b/doomsday/apps/client/src/world/base/map.cpp index 4ee1eed6cb..0678276359 100644 --- a/doomsday/apps/client/src/world/base/map.cpp +++ b/doomsday/apps/client/src/world/base/map.cpp @@ -327,8 +327,8 @@ DENG2_PIMPL(Map) ~Impl() { #ifdef __CLIENT__ - self.removeAllLumobjs(); - self.removeAllBiasSources(); + self().removeAllLumobjs(); + self().removeAllBiasSources(); #endif // Delete thinkers before the map elements, because thinkers may reference them @@ -546,7 +546,7 @@ DENG2_PIMPL(Map) } validCount++; - self.forAllLinesInBox(scanRegion, LIF_SECTOR, [&p] (Line &line) + self().forAllLinesInBox(scanRegion, LIF_SECTOR, [&p] (Line &line) { testForWindowEffect2(line, p); return LoopContinue; @@ -575,7 +575,7 @@ DENG2_PIMPL(Map) Time begunAt; LOGDEV_MAP_XVERBOSE("Building BSP for \"%s\" with split cost factor %d...") - << (self.hasManifest() ? self.manifest().composeUri() : "(unknown map)") << bspSplitFactor; + << (self().hasManifest() ? self().manifest().composeUri() : "(unknown map)") << bspSplitFactor; // First we'll scan for so-called "one-way window" constructs and mark // them so that the space partitioner can treat them specially. @@ -912,7 +912,7 @@ DENG2_PIMPL(Map) mob.lineRoot = NP_New(&mobjNodes, NP_ROOT_NODE); validCount++; - self.forAllLinesInBox(box, [this, &mob, &box] (Line &line) + self().forAllLinesInBox(box, [this, &mob, &box] (Line &line) { // Do the bounding boxes intercept? if (!( box.minX >= line.bounds().maxX @@ -1285,7 +1285,7 @@ DENG2_PIMPL(Map) void spawnMapParticleGens() { - if (!self.hasManifest()) return; + if (!self().hasManifest()) return; for (dint i = 0; i < DED_Definitions()->ptcGens.size(); ++i) { @@ -1293,14 +1293,14 @@ DENG2_PIMPL(Map) if (!genDef->map) continue; - if (*genDef->map != self.manifest().composeUri()) + if (*genDef->map != self().manifest().composeUri()) continue; // Are we still spawning using this generator? if (genDef->spawnAge > 0 && App_World().time() > genDef->spawnAge) continue; - Generator *gen = self.newGenerator(); + Generator *gen = self().newGenerator(); if (!gen) return; // No more generators. // Initialize the particle generator. @@ -1331,7 +1331,7 @@ DENG2_PIMPL(Map) if (def->typeNum != DED_PTCGEN_ANY_MOBJ_TYPE && def->typeNum < 0) continue; - Generator *gen = self.newGenerator(); + Generator *gen = self().newGenerator(); if (!gen) return; // No more generators. // Initialize the particle generator. diff --git a/doomsday/apps/client/src/world/base/plane.cpp b/doomsday/apps/client/src/world/base/plane.cpp index 5db141fe7b..7dc83b3422 100644 --- a/doomsday/apps/client/src/world/base/plane.cpp +++ b/doomsday/apps/client/src/world/base/plane.cpp @@ -74,15 +74,15 @@ DENG2_PIMPL(Plane) ~Impl() { - DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->planeBeingDeleted(self); + DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->planeBeingDeleted(self()); #ifdef __CLIENT__ // Stop movement tracking of this plane. - map().trackedPlanes().remove(&self); + map().trackedPlanes().remove(thisPublic); #endif } - inline Map &map() const { return self.map(); } + inline Map &map() const { return self().map(); } void setHeight(ddouble newHeight) { @@ -105,7 +105,7 @@ DENG2_PIMPL(Plane) if(!ddMapSetup) { // Update the sound emitter origin for the plane. - self.updateSoundEmitterOrigin(); + self().updateSoundEmitterOrigin(); } notifyHeightChanged(); @@ -114,7 +114,7 @@ DENG2_PIMPL(Plane) if(!ddMapSetup) { // Add ourself to tracked plane list (for movement interpolation). - map().trackedPlanes().insert(&self); + map().trackedPlanes().insert(thisPublic); } #endif } @@ -139,13 +139,13 @@ DENG2_PIMPL(Plane) void notifyHeightChanged() { - DENG2_FOR_PUBLIC_AUDIENCE2(HeightChange, i) i->planeHeightChanged(self); + DENG2_FOR_PUBLIC_AUDIENCE2(HeightChange, i) i->planeHeightChanged(self()); } #ifdef __CLIENT__ void notifySmoothedHeightChanged() { - DENG2_FOR_PUBLIC_AUDIENCE2(HeightSmoothedChange, i) i->planeHeightSmoothedChanged(self); + DENG2_FOR_PUBLIC_AUDIENCE2(HeightSmoothedChange, i) i->planeHeightSmoothedChanged(self()); } void surfaceMaterialChanged(Surface &suf) @@ -155,7 +155,7 @@ DENG2_PIMPL(Plane) if (!::ddMapSetup && surface.hasMaterial()) { de::Uri uri = surface.material().manifest().composeUri(); - self.spawnParticleGen(Def_GetGenerator(reinterpret_cast(&uri))); + self().spawnParticleGen(Def_GetGenerator(reinterpret_cast(&uri))); } } #endif diff --git a/doomsday/apps/client/src/world/base/sector.cpp b/doomsday/apps/client/src/world/base/sector.cpp index 95af16a7e1..4122f7d321 100644 --- a/doomsday/apps/client/src/world/base/sector.cpp +++ b/doomsday/apps/client/src/world/base/sector.cpp @@ -153,7 +153,7 @@ DENG2_PIMPL(Sector) // Ensure planes are cleared first (subsectors may include mappings). planes.clear(); - delete [] self._lookupPlanes; + delete [] self()._lookupPlanes; } /** @@ -214,7 +214,7 @@ DENG2_PIMPL(Sector) void updateEmitterOriginZ() { - emitter->origin[2] = (self.floor().height() + self.ceiling().height()) / 2; + emitter->origin[2] = (self().floor().height() + self().ceiling().height()) / 2; } void updateSideEmitterOrigins() @@ -239,10 +239,10 @@ DENG2_PIMPL(Sector) void updatePlanesLookup() { - delete [] self._lookupPlanes; + delete [] self()._lookupPlanes; - self._lookupPlanes = new Plane *[planes.size()]; - Plane **ptr = self._lookupPlanes; + self()._lookupPlanes = new Plane *[planes.size()]; + Plane **ptr = self()._lookupPlanes; for (Plane *p : planes) { *ptr++ = p; diff --git a/doomsday/apps/client/src/world/base/sky.cpp b/doomsday/apps/client/src/world/base/sky.cpp index 50b465e498..25c5014f3c 100644 --- a/doomsday/apps/client/src/world/base/sky.cpp +++ b/doomsday/apps/client/src/world/base/sky.cpp @@ -160,7 +160,7 @@ DENG2_PIMPL(Sky) { for(dint i = 0; i < NUM_LAYERS; ++i) { - layers.append(new Layer(self)); + layers.append(new Layer(self())); #ifdef __CLIENT__ Layer *layer = layers.last(); layer->audienceForActiveChange() += this; @@ -172,7 +172,7 @@ DENG2_PIMPL(Sky) ~Impl() { - DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->skyBeingDeleted(self); + DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->skyBeingDeleted(self()); } #ifdef __CLIENT__ diff --git a/doomsday/apps/client/src/world/base/surface.cpp b/doomsday/apps/client/src/world/base/surface.cpp index 40798e2ee5..424246cdac 100644 --- a/doomsday/apps/client/src/world/base/surface.cpp +++ b/doomsday/apps/client/src/world/base/surface.cpp @@ -90,17 +90,17 @@ DENG2_PIMPL(Surface) ~Impl() { // Stop scroll interpolation for this surface. - self.map().scrollingSurfaces().remove(&self); + self().map().scrollingSurfaces().remove(thisPublic); } #endif - inline MapElement &owner() const { return self.parent(); } + inline MapElement &owner() const { return self().parent(); } #ifdef DENG_DEBUG bool isSideMiddle() const { return owner().type() == DMU_SIDE - && &self == &owner().as().middle(); + && thisPublic == &owner().as().middle(); } bool isSectorExtraPlane() const @@ -126,7 +126,7 @@ DENG2_PIMPL(Surface) #ifdef __CLIENT__ void notifyOriginSmoothedChanged() { - DENG2_FOR_PUBLIC_AUDIENCE2(OriginSmoothedChange, i) i->surfaceOriginSmoothedChanged(self); + DENG2_FOR_PUBLIC_AUDIENCE2(OriginSmoothedChange, i) i->surfaceOriginSmoothedChanged(self()); } #endif diff --git a/doomsday/apps/client/src/world/base/thinkers.cpp b/doomsday/apps/client/src/world/base/thinkers.cpp index 8e2e32f296..af63b51a30 100644 --- a/doomsday/apps/client/src/world/base/thinkers.cpp +++ b/doomsday/apps/client/src/world/base/thinkers.cpp @@ -163,10 +163,10 @@ DENG2_PIMPL(Thinkers) { // Increment the ID dealer until a free ID is found. /// @todo fixme: What if all IDs are in use? 65535 thinkers!? - while(self.isUsedMobjId(++iddealer)) {} + while(self().isUsedMobjId(++iddealer)) {} // Mark this ID as used. - self.setMobjId(iddealer); + self().setMobjId(iddealer); return iddealer; } diff --git a/doomsday/apps/client/src/world/clientmobjthinkerdata.cpp b/doomsday/apps/client/src/world/clientmobjthinkerdata.cpp index 1ced6cbd70..9c3b6216da 100644 --- a/doomsday/apps/client/src/world/clientmobjthinkerdata.cpp +++ b/doomsday/apps/client/src/world/clientmobjthinkerdata.cpp @@ -72,18 +72,18 @@ DENG2_PIMPL(ClientMobjThinkerData) String thingName() const { - return DED_Definitions()->getMobjName(self.mobj()->type); + return DED_Definitions()->getMobjName(self().mobj()->type); } String stateName() const { - return Def_GetStateName(self.mobj()->state); + return Def_GetStateName(self().mobj()->state); } bool isStateInCurrentSequence(state_t const *previous) { if(!previous) return false; - return Def_GetState(previous->nextState) == self.mobj()->state; + return Def_GetState(previous->nextState) == self().mobj()->state; } String modelId() const @@ -121,14 +121,14 @@ DENG2_PIMPL(ClientMobjThinkerData) model.audienceForDeletion() += this; animator.reset(new render::StateAnimator(modelId(), model)); - animator->setOwnerNamespace(self.objectNamespace(), QStringLiteral("THING")); + animator->setOwnerNamespace(self().objectNamespace(), QStringLiteral("THING")); // Apply possible scaling operations on the model. modelMatrix = model.transformation; if(model.flags & render::Model::AutoscaleToThingHeight) { Vector3f const dims = modelMatrix * model.dimensions(); - modelMatrix = Matrix4f::scale(self.mobj()->height / dims.y * 1.2f /*aspect correct*/) * modelMatrix; + modelMatrix = Matrix4f::scale(self().mobj()->height / dims.y * 1.2f /*aspect correct*/) * modelMatrix; } } catch(Error const &er) @@ -136,7 +136,7 @@ DENG2_PIMPL(ClientMobjThinkerData) model.audienceForDeletion() -= this; LOG_RES_ERROR("Failed to set up asset '%s' for map object %i: %s") - << modelId() << self.mobj()->thinker.id << er.asText(); + << modelId() << self().mobj()->thinker.id << er.asText(); } } } @@ -190,13 +190,13 @@ DENG2_PIMPL(ClientMobjThinkerData) void triggerParticleGenerators(bool justSpawned) { // Check for a ptcgen trigger. - for(ded_ptcgen_t *pg = runtimeDefs.stateInfo[self.stateIndex()].ptcGens; + for(ded_ptcgen_t *pg = runtimeDefs.stateInfo[self().stateIndex()].ptcGens; pg; pg = pg->stateNext) { if(!(pg->flags & Generator::SpawnOnly) || justSpawned) { // We are allowed to spawn the generator. - Mobj_SpawnParticleGen(self.mobj(), pg); + Mobj_SpawnParticleGen(self().mobj(), pg); } } } diff --git a/doomsday/apps/client/src/world/hand.cpp b/doomsday/apps/client/src/world/hand.cpp index ddf3a0a389..57f380bbdd 100644 --- a/doomsday/apps/client/src/world/hand.cpp +++ b/doomsday/apps/client/src/world/hand.cpp @@ -61,7 +61,7 @@ DENG2_PIMPL(Hand) { DENG2_FOR_PUBLIC_AUDIENCE(Grabbed, i) { - i->handGrabbed(self, grabbed); + i->handGrabbed(self(), grabbed); } } @@ -69,7 +69,7 @@ DENG2_PIMPL(Hand) { DENG2_FOR_PUBLIC_AUDIENCE(Ungrabbed, i) { - i->handUngrabbed(self, ungrabbed); + i->handUngrabbed(self(), ungrabbed); } } diff --git a/doomsday/apps/libdoomsday/src/doomsdayapp.cpp b/doomsday/apps/libdoomsday/src/doomsdayapp.cpp index 7beb2bf2f0..b142fde155 100644 --- a/doomsday/apps/libdoomsday/src/doomsdayapp.cpp +++ b/doomsday/apps/libdoomsday/src/doomsdayapp.cpp @@ -335,7 +335,7 @@ DENG2_PIMPL(DoomsdayApp) App::setCurrentWorkPath(App::app().nativeHomePath()); // libcore has determined the native base path, so let FS1 know about it. - self.setDoomsdayBasePath(DENG2_APP->nativeBasePath()); + self().setDoomsdayBasePath(DENG2_APP->nativeBasePath()); } #endif // UNIX @@ -345,14 +345,14 @@ DENG2_PIMPL(DoomsdayApp) // Use a custom base directory? if (CommandLine_CheckWith("-basedir", 1)) { - self.setDoomsdayBasePath(CommandLine_Next()); + self().setDoomsdayBasePath(CommandLine_Next()); } else { // The default base directory is one level up from the bin dir. String binDir = App::executablePath().fileNamePath().withSeparators('/'); String baseDir = String(QDir::cleanPath(binDir / String(".."))) + '/'; - self.setDoomsdayBasePath(baseDir); + self().setDoomsdayBasePath(baseDir); } } #endif // WIN32 diff --git a/doomsday/apps/libdoomsday/src/filesys/fs_main.cpp b/doomsday/apps/libdoomsday/src/filesys/fs_main.cpp index 770bedfd55..cb879590a3 100644 --- a/doomsday/apps/libdoomsday/src/filesys/fs_main.cpp +++ b/doomsday/apps/libdoomsday/src/filesys/fs_main.cpp @@ -236,7 +236,7 @@ DENG2_PIMPL(FS1) File1 &file = loadedFiles[i]->file(); if (!index || index->catalogues(file)) { - self.deindex(file); + self().deindex(file); delete &file; } } @@ -258,7 +258,7 @@ DENG2_PIMPL(FS1) // Within a subspace scheme? try { - Scheme &scheme = self.scheme(search.scheme()); + Scheme &scheme = self().scheme(search.scheme()); LOG_RES_XVERBOSE("Using scheme '%s'...") << scheme.name(); // Ensure the scheme's index is up to date. @@ -324,10 +324,10 @@ DENG2_PIMPL(FS1) LumpMapping const &mapping = *i; if (mapping.first.compare(path)) continue; - lumpnum_t lumpNum = self.lumpNumForName(mapping.second); + lumpnum_t lumpNum = self().lumpNumForName(mapping.second); if (lumpNum < 0) continue; - return &self.lump(lumpNum); + return &self().lump(lumpNum); } } @@ -404,7 +404,7 @@ DENG2_PIMPL(FS1) if (File1 *found = findLump(path, mode)) { // Do not read files twice. - if (!allowDuplicate && !self.checkFileId(found->composeUri())) return 0; + if (!allowDuplicate && !self().checkFileId(found->composeUri())) return 0; // Get a handle to the lump we intend to open. /// @todo The way this buffering works is nonsensical it should not be done here @@ -423,7 +423,7 @@ DENG2_PIMPL(FS1) if (FILE *found = findAndOpenNativeFile(path, mode, foundPath)) { // Do not read files twice. - if (!allowDuplicate && !self.checkFileId(de::Uri(foundPath, RC_NULL))) + if (!allowDuplicate && !self().checkFileId(de::Uri(foundPath, RC_NULL))) { fclose(found); return 0; @@ -444,7 +444,7 @@ DENG2_PIMPL(FS1) // been mapped to another location. We want the file to be attributed with // the path it is to be known by throughout the virtual file system. - File1 &file = self.interpret(*hndl, path, info); + File1 &file = self().interpret(*hndl, path, info); if (loadingForStartup) { diff --git a/doomsday/apps/libdoomsday/src/filesys/lumpindex.cpp b/doomsday/apps/libdoomsday/src/filesys/lumpindex.cpp index da0e3a293f..648282e12f 100644 --- a/doomsday/apps/libdoomsday/src/filesys/lumpindex.cpp +++ b/doomsday/apps/libdoomsday/src/filesys/lumpindex.cpp @@ -340,7 +340,7 @@ DENG2_PIMPL(LumpIndex) , needPruneDuplicateLumps(false) {} - ~Impl() { self.clear(); } + ~Impl() { self().clear(); } void buildLumpsByPathIfNeeded() { @@ -367,7 +367,7 @@ DENG2_PIMPL(LumpIndex) (*lumpsByPath)[k].head = i; } - LOG_RES_XVERBOSE("Rebuilt hashMap for LumpIndex %p") << &self; + LOG_RES_XVERBOSE("Rebuilt hashMap for LumpIndex %p") << thisPublic; } /** diff --git a/doomsday/apps/libdoomsday/src/filesys/zip.cpp b/doomsday/apps/libdoomsday/src/filesys/zip.cpp index 91f1f2f064..56f921f220 100644 --- a/doomsday/apps/libdoomsday/src/filesys/zip.cpp +++ b/doomsday/apps/libdoomsday/src/filesys/zip.cpp @@ -334,7 +334,7 @@ DENG2_PIMPL(Zip) LOG_AS("Zip"); FileInfo const &lumpInfo = lump.info(); - self.handle_->seek(lumpInfo.baseOffset, SeekSet); + self().handle_->seek(lumpInfo.baseOffset, SeekSet); if (lumpInfo.isCompressed()) { @@ -343,7 +343,7 @@ DENG2_PIMPL(Zip) if (!compressedData) throw Error("Zip::bufferLump", QString("Failed on allocation of %1 bytes for decompression buffer").arg(lumpInfo.compressedSize)); // Read the compressed data into a temporary buffer for decompression. - self.handle_->read(compressedData, lumpInfo.compressedSize); + self().handle_->read(compressedData, lumpInfo.compressedSize); // Uncompress into the buffer provided by the caller. result = uncompressRaw(compressedData, lumpInfo.compressedSize, buffer, lumpInfo.size); @@ -354,7 +354,7 @@ DENG2_PIMPL(Zip) else { // Read the uncompressed data directly to the buffer provided by the caller. - self.handle_->read(buffer, lumpInfo.size); + self().handle_->read(buffer, lumpInfo.size); } return lumpInfo.size; } diff --git a/doomsday/apps/libdoomsday/src/game.cpp b/doomsday/apps/libdoomsday/src/game.cpp index 7767eefebe..d2eaec8ff1 100644 --- a/doomsday/apps/libdoomsday/src/game.cpp +++ b/doomsday/apps/libdoomsday/src/game.cpp @@ -85,7 +85,7 @@ DENG2_PIMPL(Game) GameProfile const *profile() const { - return DoomsdayApp::gameProfiles().tryFind(self.title())->maybeAs(); + return DoomsdayApp::gameProfiles().tryFind(self().title())->maybeAs(); } StringList packagesFromProfile() const diff --git a/doomsday/apps/libdoomsday/src/gameprofiles.cpp b/doomsday/apps/libdoomsday/src/gameprofiles.cpp index 7a1c201732..69c1e91cc4 100644 --- a/doomsday/apps/libdoomsday/src/gameprofiles.cpp +++ b/doomsday/apps/libdoomsday/src/gameprofiles.cpp @@ -48,11 +48,11 @@ DENG2_PIMPL(GameProfiles) * configuration for each game is persistently stored using these profiles. * (User-created profiles must use different names.) */ - if (!self.tryFind(game.title())) + if (!self().tryFind(game.title())) { auto *prof = new Profile(game.title()); prof->setGame(game.id()); - self.add(prof); + self().add(prof); } } }; diff --git a/doomsday/apps/libdoomsday/src/games.cpp b/doomsday/apps/libdoomsday/src/games.cpp index 6ce2c2bf9d..8cdfa95c66 100644 --- a/doomsday/apps/libdoomsday/src/games.cpp +++ b/doomsday/apps/libdoomsday/src/games.cpp @@ -126,7 +126,7 @@ DENG2_PIMPL(Games) { if (!mainCall) { - mainCall.enqueue([this] () { self.checkReadiness(); }); + mainCall.enqueue([this] () { self().checkReadiness(); }); } } @@ -303,7 +303,7 @@ void Games::checkReadiness() locateStartupResources(game); Games &self = *this; // MSVC 2013 cannot figure it out inside the lambda... - DENG2_FOR_EACH_OBSERVER(ProgressAudience, i, self.audienceForProgress()) + DENG2_FOR_EACH_OBSERVER(ProgressAudience, i, self().audienceForProgress()) { i->gameWorkerProgress(n * 200 / count() - 1); } diff --git a/doomsday/apps/libdoomsday/src/gamestatefolder.cpp b/doomsday/apps/libdoomsday/src/gamestatefolder.cpp index 23520b464e..39e4bdc2b1 100644 --- a/doomsday/apps/libdoomsday/src/gamestatefolder.cpp +++ b/doomsday/apps/libdoomsday/src/gamestatefolder.cpp @@ -70,7 +70,7 @@ DENG2_PIMPL(GameStateFolder) try { Block raw; - self.locate("Info") >> raw; + self().locate("Info") >> raw; metadata.parse(String::fromUtf8(raw)); @@ -79,19 +79,19 @@ DENG2_PIMPL(GameStateFolder) } catch (IByteArray::OffsetError const &) { - LOG_RES_WARNING("Archive in %s is truncated") << self.description(); + LOG_RES_WARNING("Archive in %s is truncated") << self().description(); } catch (IIStream::InputError const &) { - LOG_RES_WARNING("%s cannot be read") << self.description(); + LOG_RES_WARNING("%s cannot be read") << self().description(); } catch (Archive::FormatError const &) { - LOG_RES_WARNING("Archive in %s is invalid") << self.description(); + LOG_RES_WARNING("Archive in %s is invalid") << self().description(); } catch (Folder::NotFoundError const &) { - LOG_RES_WARNING("%s does not appear to be a .save package") << self.description(); + LOG_RES_WARNING("%s does not appear to be a .save package") << self().description(); } return 0; } diff --git a/doomsday/apps/libdoomsday/src/resource/colorpalette.cpp b/doomsday/apps/libdoomsday/src/resource/colorpalette.cpp index 68c35a488f..cee9dfed33 100644 --- a/doomsday/apps/libdoomsday/src/resource/colorpalette.cpp +++ b/doomsday/apps/libdoomsday/src/resource/colorpalette.cpp @@ -192,7 +192,7 @@ DENG2_PIMPL(ColorPalette) { DENG2_FOR_PUBLIC_AUDIENCE(ColorTableChange, i) { - i->colorPaletteColorTableChanged(self); + i->colorPaletteColorTableChanged(self()); } } diff --git a/doomsday/apps/libdoomsday/src/resource/databundle.cpp b/doomsday/apps/libdoomsday/src/resource/databundle.cpp index d2a6361dbd..9b21c79e87 100644 --- a/doomsday/apps/libdoomsday/src/resource/databundle.cpp +++ b/doomsday/apps/libdoomsday/src/resource/databundle.cpp @@ -167,7 +167,7 @@ DENG2_PIMPL(DataBundle), public Lockable << "\nfileSize:" << source->size() << "\nlumpDirCRC32:" << QString::number(lumpDir->crc32(), 16).toLatin1();*/ } - else if (!self.containerPackageId().isEmpty()) + else if (!self().containerPackageId().isEmpty()) { // This file is inside a package, so the package will take care of it. /*qDebug() << "[DataBundle]" << source->description().toLatin1().constData() @@ -177,9 +177,9 @@ DENG2_PIMPL(DataBundle), public Lockable } // Search for known data files in the bundle registry. - res::Bundles::MatchResult matched = DoomsdayApp::bundles().match(self); + res::Bundles::MatchResult matched = DoomsdayApp::bundles().match(self()); - File &dataFile = self.asFile(); + File &dataFile = self().asFile(); String const dataFilePath = dataFile.path(); // Metadata for the package will be collected into this record. @@ -210,7 +210,7 @@ DENG2_PIMPL(DataBundle), public Lockable return false; } - DataBundle *container = self.containerBundle(); + DataBundle *container = self().containerBundle(); if (container) { // Make sure that the container has been fully identified. @@ -437,7 +437,7 @@ DENG2_PIMPL(DataBundle), public Lockable */ bool isAutoLoaded() const { - Path const path(self.asFile().path()); + Path const path(self().asFile().path()); //qDebug() << "checking" << path.toString(); @@ -590,7 +590,7 @@ DENG2_PIMPL(DataBundle), public Lockable // Look at the path and contents of the bundle to estimate which game it is // compatible with. - Path const path(self.asFile().path()); + Path const path(self().asFile().path()); for (auto const &tag : gameTags) { QRegExp reTag(tag, Qt::CaseInsensitive); diff --git a/doomsday/apps/libdoomsday/src/resource/resources.cpp b/doomsday/apps/libdoomsday/src/resource/resources.cpp index 48431ef622..3e9655098b 100644 --- a/doomsday/apps/libdoomsday/src/resource/resources.cpp +++ b/doomsday/apps/libdoomsday/src/resource/resources.cpp @@ -174,7 +174,7 @@ DENG2_PIMPL(Resources) if (!deferredReset && needReset) { - deferredReset.enqueue([this] () { self.reloadAllResources(); }); + deferredReset.enqueue([this] () { self().reloadAllResources(); }); } } }; diff --git a/doomsday/apps/libdoomsday/src/resource/texture.cpp b/doomsday/apps/libdoomsday/src/resource/texture.cpp index 5a111be82b..13cd6b70ac 100644 --- a/doomsday/apps/libdoomsday/src/resource/texture.cpp +++ b/doomsday/apps/libdoomsday/src/resource/texture.cpp @@ -61,13 +61,13 @@ DENG2_PIMPL(Texture) ~Impl() { - self.clearAnalyses(); + self().clearAnalyses(); } /// Notify iterested parties of a change in world dimensions. void notifyDimensionsChanged() { - DENG2_FOR_PUBLIC_AUDIENCE(DimensionsChange, i) i->textureDimensionsChanged(self); + DENG2_FOR_PUBLIC_AUDIENCE(DimensionsChange, i) i->textureDimensionsChanged(self()); } }; diff --git a/doomsday/apps/libdoomsday/src/resource/texturemanifest.cpp b/doomsday/apps/libdoomsday/src/resource/texturemanifest.cpp index 2b2e5fc43c..6a7ebcb604 100644 --- a/doomsday/apps/libdoomsday/src/resource/texturemanifest.cpp +++ b/doomsday/apps/libdoomsday/src/resource/texturemanifest.cpp @@ -46,7 +46,7 @@ DENG2_PIMPL(TextureManifest) ~Impl() { if (texture) texture->audienceForDeletion -= this; - DENG2_FOR_PUBLIC_AUDIENCE(Deletion, i) i->textureManifestBeingDeleted(self); + DENG2_FOR_PUBLIC_AUDIENCE(Deletion, i) i->textureManifestBeingDeleted(self()); } // Observes Texture Deletion. diff --git a/doomsday/apps/libdoomsday/src/resource/textures.cpp b/doomsday/apps/libdoomsday/src/resource/textures.cpp index 832d83bace..35709138a1 100644 --- a/doomsday/apps/libdoomsday/src/resource/textures.cpp +++ b/doomsday/apps/libdoomsday/src/resource/textures.cpp @@ -453,7 +453,7 @@ DENG2_PIMPL(Textures) LOG_RES_VERBOSE("Initializing composite textures..."); - //self.textures().textureScheme("Textures").clear(); + //self().textures().textureScheme("Textures").clear(); // Load texture definitions from TEXTURE1/2 lumps. Composites allDefs = loadCompositeTextureDefs(); @@ -475,7 +475,7 @@ DENG2_PIMPL(Textures) try { TextureManifest &manifest = - self.declareTexture(uri, flags, def.logicalDimensions(), + self().declareTexture(uri, flags, def.logicalDimensions(), Vector2i(), def.origIndex()); // Are we redefining an existing texture? @@ -520,7 +520,7 @@ DENG2_PIMPL(Textures) LOG_RES_VERBOSE("Initializing Flat textures..."); - //self.textures().textureScheme("Flats").clear(); + //self().textures().textureScheme("Flats").clear(); LumpIndex const &index = App_FileSystem().nameIndex(); lumpnum_t firstFlatMarkerLumpNum = index.findFirst(Path("F_START.lmp")); @@ -560,7 +560,7 @@ DENG2_PIMPL(Textures) !percentEncodedName.compareWithoutCase("FF_END")) continue; de::Uri uri(QStringLiteral("Flats"), Path(percentEncodedName)); - if (self.textureManifestPtr(uri)) continue; + if (self().textureManifestPtr(uri)) continue; Texture::Flags flags; if (file.container().hasCustom()) flags |= Texture::Custom; @@ -577,13 +577,13 @@ DENG2_PIMPL(Textures) int const uniqueId = lumpNum - (firstFlatMarkerLumpNum + 1); de::Uri resourceUri = LumpIndex::composeResourceUrn(lumpNum); - self.declareTexture(uri, flags, dimensions, origin, uniqueId, &resourceUri); + self().declareTexture(uri, flags, dimensions, origin, uniqueId, &resourceUri); } } // Define any as yet undefined flat textures. /// @todo Defer until necessary (manifest texture is first referenced). - self.deriveAllTexturesInScheme("Flats"); + self().deriveAllTexturesInScheme("Flats"); LOG_RES_VERBOSE("Flat textures initialized in %.2f seconds") << begunAt.since(); } @@ -594,7 +594,7 @@ DENG2_PIMPL(Textures) LOG_RES_VERBOSE("Initializing Sprite textures..."); - //self.textures().textureScheme("Sprites").clear(); + //self().textures().textureScheme("Sprites").clear(); dint uniqueId = 1/*1-based index*/; @@ -673,7 +673,7 @@ DENG2_PIMPL(Textures) de::Uri const resourceUri = LumpIndex::composeResourceUrn(i); try { - self.declareTexture(uri, flags, dimensions, origin, uniqueId, &resourceUri); + self().declareTexture(uri, flags, dimensions, origin, uniqueId, &resourceUri); uniqueId++; } catch (TextureScheme::InvalidPathError const &er) @@ -691,7 +691,7 @@ DENG2_PIMPL(Textures) // Define any as yet undefined sprite textures. /// @todo Defer until necessary (manifest texture is first referenced). - self.deriveAllTexturesInScheme("Sprites"); + self().deriveAllTexturesInScheme("Sprites"); LOG_RES_VERBOSE("Sprite textures initialized in %.2f seconds") << begunAt.since(); } diff --git a/doomsday/apps/libdoomsday/src/resource/texturescheme.cpp b/doomsday/apps/libdoomsday/src/resource/texturescheme.cpp index 4b215907fb..e801ecc31d 100644 --- a/doomsday/apps/libdoomsday/src/resource/texturescheme.cpp +++ b/doomsday/apps/libdoomsday/src/resource/texturescheme.cpp @@ -51,7 +51,7 @@ DENG2_PIMPL(TextureScheme) ~Impl() { - self.clear(); + self().clear(); DENG_ASSERT(index.isEmpty()); } diff --git a/doomsday/apps/libdoomsday/src/world/map.cpp b/doomsday/apps/libdoomsday/src/world/map.cpp index 4fdd7bb0b4..43292be7c3 100644 --- a/doomsday/apps/libdoomsday/src/world/map.cpp +++ b/doomsday/apps/libdoomsday/src/world/map.cpp @@ -35,7 +35,7 @@ DENG2_PIMPL(BaseMap) ~Impl() { - DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->mapBeingDeleted(self); + DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->mapBeingDeleted(self()); } void recordBeingDeleted(Record &record) diff --git a/doomsday/apps/libdoomsday/src/world/material.cpp b/doomsday/apps/libdoomsday/src/world/material.cpp index a1e7d78e6f..6844488d50 100644 --- a/doomsday/apps/libdoomsday/src/world/material.cpp +++ b/doomsday/apps/libdoomsday/src/world/material.cpp @@ -86,8 +86,8 @@ DENG2_PIMPL(Material) ~Impl() { - qDeleteAll(self._layers); - //self.clearAllLayers(); + qDeleteAll(self()._layers); + //self().clearAllLayers(); } inline bool haveValidDimensions() const { @@ -96,7 +96,7 @@ DENG2_PIMPL(Material) TextureMaterialLayer *firstTextureLayer() const { - for (Layer *layer : self._layers) + for (Layer *layer : self()._layers) { if (layer->is()) continue; if (layer->is()) continue; @@ -153,7 +153,7 @@ DENG2_PIMPL(Material) void textureDimensionsChanged(res::Texture const &texture) { DENG2_ASSERT(!haveValidDimensions()); // Sanity check. - self.setDimensions(texture.dimensions()); + self().setDimensions(texture.dimensions()); } // Observes Texture Deletion. diff --git a/doomsday/apps/libdoomsday/src/world/materials.cpp b/doomsday/apps/libdoomsday/src/world/materials.cpp index 633ab308ac..318ceb51d9 100644 --- a/doomsday/apps/libdoomsday/src/world/materials.cpp +++ b/doomsday/apps/libdoomsday/src/world/materials.cpp @@ -72,8 +72,8 @@ DENG2_PIMPL(Materials) ~Impl() { - self.clearAllMaterialGroups(); - self.clearAllMaterialSchemes(); + self().clearAllMaterialGroups(); + self().clearAllMaterialSchemes(); clearMaterialManifests(); } diff --git a/doomsday/apps/libdoomsday/src/world/materialscheme.cpp b/doomsday/apps/libdoomsday/src/world/materialscheme.cpp index 91e3fc0133..a57d9c49f9 100644 --- a/doomsday/apps/libdoomsday/src/world/materialscheme.cpp +++ b/doomsday/apps/libdoomsday/src/world/materialscheme.cpp @@ -37,7 +37,7 @@ DENG2_PIMPL(MaterialScheme) ~Impl() { - self.clear(); + self().clear(); DENG2_ASSERT(index.isEmpty()); } }; diff --git a/doomsday/apps/plugins/common/src/game/gamesession.cpp b/doomsday/apps/plugins/common/src/game/gamesession.cpp index 1e005fa81d..38a4d25a24 100644 --- a/doomsday/apps/plugins/common/src/game/gamesession.cpp +++ b/doomsday/apps/plugins/common/src/game/gamesession.cpp @@ -209,7 +209,7 @@ DENG2_PIMPL(GameSession), public GameStateFolder::IMapStateReaderFactory meta.set("userDescription", "(Unsaved)"); meta.set("mapUri", mapUri.compose()); meta.set("mapTime", ::mapTime); - meta.add("gameRules", self.rules().toRecord()); // Takes ownership. + meta.add("gameRules", self().rules().toRecord()); // Takes ownership. auto *loadedPackages = new ArrayValue; for (String id : PackageLoader::get().loadedPackageIdsInOrder()) @@ -587,7 +587,7 @@ DENG2_PIMPL(GameSession), public GameStateFolder::IMapStateReaderFactory Con_SetUri2("map-id", reinterpret_cast(&mapUri), SVF_WRITE_OVERRIDE); String hubId; - if (Record const *hubRec = defn::Episode(*self.episodeDef()).tryFindHubByMapId(mapUri.compose())) + if (Record const *hubRec = defn::Episode(*self().episodeDef()).tryFindHubByMapId(mapUri.compose())) { hubId = hubRec->gets("id"); } diff --git a/doomsday/apps/plugins/common/src/hud/widgets/automapwidget.cpp b/doomsday/apps/plugins/common/src/hud/widgets/automapwidget.cpp index f2b34da2b7..789da15998 100644 --- a/doomsday/apps/plugins/common/src/hud/widgets/automapwidget.cpp +++ b/doomsday/apps/plugins/common/src/hud/widgets/automapwidget.cpp @@ -301,8 +301,8 @@ DENG2_PIMPL(AutomapWidget) Vector2d const bottomLeft(bounds[BOXLEFT ], bounds[BOXBOTTOM]); coord_t const dist = de::abs((topRight - bottomLeft).length()); - Vector2f const dimensions(Rect_Width (&self.geometry()), - Rect_Height(&self.geometry())); + Vector2f const dimensions(Rect_Width (&self().geometry()), + Rect_Height(&self().geometry())); Vector2f const scale = dimensions / dist; minScaleMTOF = (scale.x < scale.y ? scale.x : scale.y); @@ -694,7 +694,7 @@ DENG2_PIMPL(AutomapWidget) if(!addToLists) { AABoxd aaBox; - self.pvisibleBounds(&aaBox.minX, &aaBox.maxX, &aaBox.minY, &aaBox.maxY); + self().pvisibleBounds(&aaBox.minX, &aaBox.maxX, &aaBox.minY, &aaBox.maxY); Subspace_BoxIterator(&aaBox, drawLinesForSubspaceWorker, const_cast(this)); } else @@ -814,7 +814,7 @@ DENG2_PIMPL(AutomapWidget) // Draw any polyobjects in view. AABoxd aaBox; - self.pvisibleBounds(&aaBox.minX, &aaBox.maxX, &aaBox.minY, &aaBox.maxY); + self().pvisibleBounds(&aaBox.minX, &aaBox.maxX, &aaBox.minY, &aaBox.maxY); Line_BoxIterator(&aaBox, LIF_POLYOBJ, drawLine_polyob, const_cast(this)); } @@ -861,7 +861,7 @@ DENG2_PIMPL(AutomapWidget) rs.obType = -1; AABoxd aaBox; - self.pvisibleBounds(&aaBox.minX, &aaBox.maxX, &aaBox.minY, &aaBox.maxY); + self().pvisibleBounds(&aaBox.minX, &aaBox.maxX, &aaBox.minY, &aaBox.maxY); Line_BoxIterator(&aaBox, LIF_SECTOR, drawLine_xg, const_cast(this)); #endif } @@ -874,7 +874,7 @@ DENG2_PIMPL(AutomapWidget) for(dint i = 0; i < MAXPLAYERS; ++i) { // Do not show markers for other players in deathmatch. - if(COMMON_GAMESESSION->rules().deathmatch && i != self.player()) + if(COMMON_GAMESESSION->rules().deathmatch && i != self().player()) { continue; } @@ -978,7 +978,7 @@ DENG2_PIMPL(AutomapWidget) parm.opacity = de::clamp(0.f, cfg.common.automapLineAlpha * alpha, 1.f); AABoxd aaBox; - self.pvisibleBounds(&aaBox.minX, &aaBox.maxX, &aaBox.minY, &aaBox.maxY); + self().pvisibleBounds(&aaBox.minX, &aaBox.maxX, &aaBox.minY, &aaBox.maxY); VALIDCOUNT++; Mobj_BoxIterator(&aaBox, drawThingPoint, &parm); @@ -991,7 +991,7 @@ DENG2_PIMPL(AutomapWidget) if(points.isEmpty()) return; // Calculate final scale factor. - scale = self.frameToMap(1) * scale; + scale = self().frameToMap(1) * scale; #if __JHERETIC__ || __JHEXEN__ // These games use a larger font, so use a smaller scale. scale *= .5f; @@ -1056,7 +1056,7 @@ DENG2_PIMPL(AutomapWidget) AM_GetMapColor(bgColor, cfg.common.automapBack, BACKGROUND, customPal); #endif - RectRaw geom; Rect_Raw(&self.geometry(), &geom); + RectRaw geom; Rect_Raw(&self().geometry(), &geom); // Do we want a background texture? if(autopageLumpNum != -1) @@ -1076,10 +1076,10 @@ DENG2_PIMPL(AutomapWidget) // Apply the parallax scrolling, map rotation and counteract the // aspect of the quad (sized to map window dimensions). - DGL_Translatef(self.mapToFrame(viewPL.x) + .5f, - self.mapToFrame(viewPL.y) + .5f, 0); + DGL_Translatef(self().mapToFrame(viewPL.x) + .5f, + self().mapToFrame(viewPL.y) + .5f, 0); DGL_Scalef(1, 1.2f/*aspect correct*/, 1); - DGL_Rotatef(360 - self.cameraAngle(), 0, 0, 1); + DGL_Rotatef(360 - self().cameraAngle(), 0, 0, 1); DGL_Scalef(1, (dfloat)geom.size.height / geom.size.width, 1); DGL_Translatef(-(.5f), -(.5f), 0); @@ -1107,7 +1107,7 @@ DENG2_PIMPL(AutomapWidget) IIT_DEMONKEY1, IIT_DEMONKEY2, IIT_DEMONKEY3 }; - dint player = self.player(); + dint player = self().player(); dint num = 0; for(inventoryitemtype_t const &item : items) { @@ -1167,7 +1167,7 @@ DENG2_PIMPL(AutomapWidget) // Setup the scissor clipper. /// @todo Do this in the UI module. dint const border = .5f + UIAUTOMAP_BORDER * aspectScale; - RectRaw clipRegion; Rect_Raw(&self.geometry(), &clipRegion); + RectRaw clipRegion; Rect_Raw(&self().geometry(), &clipRegion); clipRegion.origin.x += border; clipRegion.origin.y += border; clipRegion.size.width -= 2 * border; diff --git a/doomsday/apps/plugins/common/src/hud/widgets/chatwidget.cpp b/doomsday/apps/plugins/common/src/hud/widgets/chatwidget.cpp index b43e8a3cb9..f0d2aebc24 100644 --- a/doomsday/apps/plugins/common/src/hud/widgets/chatwidget.cpp +++ b/doomsday/apps/plugins/common/src/hud/widgets/chatwidget.cpp @@ -62,7 +62,7 @@ DENG2_PIMPL(ChatWidget) void sendMessage() { - String const msg = self.messageAsText(); + String const msg = self().messageAsText(); if(msg.isEmpty()) return; if(destination == 0) diff --git a/doomsday/apps/plugins/common/src/menu/page.cpp b/doomsday/apps/plugins/common/src/menu/page.cpp index be0a266a50..9b2c87cce6 100644 --- a/doomsday/apps/plugins/common/src/menu/page.cpp +++ b/doomsday/apps/plugins/common/src/menu/page.cpp @@ -106,7 +106,7 @@ DENG2_PIMPL(Page) fontid_t oldFont = FR_Font(); /// @kludge We cannot yet query line height from the font... - FR_SetFont(self.predefinedFont(MENU_FONT1)); + FR_SetFont(self().predefinedFont(MENU_FONT1)); int lh = FR_TextHeight("{case}WyQ"); if(lineOffset) { @@ -225,7 +225,7 @@ DENG2_PIMPL(Page) { DENG2_ASSERT(newFocus != 0); - if(Widget *focused = self.focusWidget()) + if(Widget *focused = self().focusWidget()) { if(focused != newFocus) { @@ -238,7 +238,7 @@ DENG2_PIMPL(Page) } } - focus = self.indexOf(newFocus); + focus = self().indexOf(newFocus); newFocus->setFlags(Widget::Focused); newFocus->execAction(Widget::FocusGained); } diff --git a/doomsday/apps/plugins/common/src/menu/widgets/coloreditwidget.cpp b/doomsday/apps/plugins/common/src/menu/widgets/coloreditwidget.cpp index 87f1e08453..dd973ac90e 100644 --- a/doomsday/apps/plugins/common/src/menu/widgets/coloreditwidget.cpp +++ b/doomsday/apps/plugins/common/src/menu/widgets/coloreditwidget.cpp @@ -47,7 +47,7 @@ DENG2_PIMPL(ColorEditWidget) { if(!(flags & MNCOLORBOX_SCF_NO_ACTION)) { - self.execAction(Modified); + self().execAction(Modified); } return true; } @@ -63,7 +63,7 @@ DENG2_PIMPL(ColorEditWidget) { if(!(flags & MNCOLORBOX_SCF_NO_ACTION)) { - self.execAction(Modified); + self().execAction(Modified); } return true; } @@ -79,7 +79,7 @@ DENG2_PIMPL(ColorEditWidget) { if(!(flags & MNCOLORBOX_SCF_NO_ACTION)) { - self.execAction(Modified); + self().execAction(Modified); } return true; } @@ -96,7 +96,7 @@ DENG2_PIMPL(ColorEditWidget) { if(!(flags & MNCOLORBOX_SCF_NO_ACTION)) { - self.execAction(Modified); + self().execAction(Modified); } return true; } diff --git a/doomsday/apps/plugins/common/src/menu/widgets/cvartextualsliderwidget.cpp b/doomsday/apps/plugins/common/src/menu/widgets/cvartextualsliderwidget.cpp index 59776ab2ec..6b3f67ede2 100644 --- a/doomsday/apps/plugins/common/src/menu/widgets/cvartextualsliderwidget.cpp +++ b/doomsday/apps/plugins/common/src/menu/widgets/cvartextualsliderwidget.cpp @@ -40,7 +40,7 @@ DENG2_PIMPL(CVarTextualSliderWidget) inline bool valueIsOne(float value) { - if(self.floatMode()) + if(self().floatMode()) { return INRANGE_OF(1, value, .0001f); } @@ -62,7 +62,7 @@ DENG2_PIMPL(CVarTextualSliderWidget) String composeTextualValue(float value, int precision = 0) { - if(self.floatMode() && !valueIsOne(value)) + if(self().floatMode() && !valueIsOne(value)) { return String::number(value, 'f', de::max(0, precision)); } @@ -74,7 +74,7 @@ DENG2_PIMPL(CVarTextualSliderWidget) String valueAsText(float emptyValue = 0, int precision = 0) { - float const value = de::clamp(self.min(), self.value(), self.max()); /// @todo clamp necessary? + float const value = de::clamp(self().min(), self().value(), self().max()); /// @todo clamp necessary? // Is the empty-value-string in use? if(!emptyText.isEmpty() && INRANGE_OF(value, emptyValue, .0001f)) diff --git a/doomsday/apps/plugins/common/src/menu/widgets/sliderwidget.cpp b/doomsday/apps/plugins/common/src/menu/widgets/sliderwidget.cpp index 5598b1b780..4d42af747c 100644 --- a/doomsday/apps/plugins/common/src/menu/widgets/sliderwidget.cpp +++ b/doomsday/apps/plugins/common/src/menu/widgets/sliderwidget.cpp @@ -55,7 +55,7 @@ DENG2_PIMPL(SliderWidget) float range = max - min; if(!range) range = 1; // Should never happen... - float useVal = self.value() - min; + float useVal = self().value() - min; return useVal / range * MNDATA_SLIDER_SLOTS * WIDTH; #undef WIDTH diff --git a/doomsday/apps/plugins/common/src/world/mapstatereader.cpp b/doomsday/apps/plugins/common/src/world/mapstatereader.cpp index c8befdd99f..73a1f66322 100644 --- a/doomsday/apps/plugins/common/src/world/mapstatereader.cpp +++ b/doomsday/apps/plugins/common/src/world/mapstatereader.cpp @@ -197,7 +197,7 @@ DENG2_PIMPL(MapStateReader) dummyPlayer.plr = &dummyDDPlayer; #if !__JHEXEN__ - ArrayValue const &presentPlayers = self.metadata().geta("players"); + ArrayValue const &presentPlayers = self().metadata().geta("players"); #endif for(int i = 0; i < MAXPLAYERS; ++i) { diff --git a/doomsday/apps/plugins/common/src/world/thingarchive.cpp b/doomsday/apps/plugins/common/src/world/thingarchive.cpp index c272ffe7db..8865ba62db 100644 --- a/doomsday/apps/plugins/common/src/world/thingarchive.cpp +++ b/doomsday/apps/plugins/common/src/world/thingarchive.cpp @@ -47,7 +47,7 @@ DENG2_PIMPL(ThingArchive) ~Impl() { - self.clear(); + self().clear(); } struct countmobjthinkerstoarchive_params_t diff --git a/doomsday/apps/plugins/importidtech1/src/mapimporter.cpp b/doomsday/apps/plugins/importidtech1/src/mapimporter.cpp index 42d3108caa..bc0318521a 100644 --- a/doomsday/apps/plugins/importidtech1/src/mapimporter.cpp +++ b/doomsday/apps/plugins/importidtech1/src/mapimporter.cpp @@ -722,7 +722,7 @@ DENG2_PIMPL(MapImporter) lines.reserve(lines.size() + numElements); for(dint n = 0; n < numElements; ++n) { - lines.push_back(LineDef(self)); + lines.push_back(LineDef(self())); LineDef &line = lines.back(); line << reader; line.index = n; @@ -735,7 +735,7 @@ DENG2_PIMPL(MapImporter) sides.reserve(sides.size() + numElements); for(dint n = 0; n < numElements; ++n) { - sides.push_back(SideDef(self)); + sides.push_back(SideDef(self())); SideDef &side = sides.back(); side << reader; side.index = n; @@ -748,7 +748,7 @@ DENG2_PIMPL(MapImporter) sectors.reserve(sectors.size() + numElements); for(dint n = 0; n < numElements; ++n) { - sectors.push_back(SectorDef(self)); + sectors.push_back(SectorDef(self())); SectorDef §or = sectors.back(); sector << reader; sector.index = n; @@ -761,7 +761,7 @@ DENG2_PIMPL(MapImporter) things.reserve(things.size() + numElements); for(dint n = 0; n < numElements; ++n) { - things.push_back(Thing(self)); + things.push_back(Thing(self())); Thing &thing = things.back(); thing << reader; thing.index = n; @@ -774,7 +774,7 @@ DENG2_PIMPL(MapImporter) surfaceTints.reserve(surfaceTints.size() + numElements); for(dint n = 0; n < numElements; ++n) { - surfaceTints.push_back(TintColor(self)); + surfaceTints.push_back(TintColor(self())); TintColor &tint = surfaceTints.back(); tint << reader; tint.index = n; diff --git a/doomsday/apps/server/src/remoteuser.cpp b/doomsday/apps/server/src/remoteuser.cpp index ad71952afc..6c7c54d99f 100644 --- a/doomsday/apps/server/src/remoteuser.cpp +++ b/doomsday/apps/server/src/remoteuser.cpp @@ -122,7 +122,7 @@ DENG2_PIMPL(RemoteUser) // If the command is too long, it'll be considered invalid. if (length >= 256) { - self.deleteLater(); + self().deleteLater(); return false; } @@ -137,7 +137,7 @@ DENG2_PIMPL(RemoteUser) LOGDEV_NET_VERBOSE("Info reply:\n%s") << String::fromUtf8(msg); //Str_Text(&msg); - self << msg; //mRefArray(Str_Text(&msg), Str_Length(&msg)); + self() << msg; //mRefArray(Str_Text(&msg), Str_Length(&msg)); //Str_Free(&msg); } @@ -149,7 +149,7 @@ DENG2_PIMPL(RemoteUser) if (strlen(netPassword) > 0 && !isFromLocal) { // Need to ask for a password, too. - self << ByteRefArray("Psw?", 4); + self() << ByteRefArray("Psw?", 4); return true; } } @@ -161,7 +161,7 @@ DENG2_PIMPL(RemoteUser) if (supplied != QCryptographicHash::hash(pwd, QCryptographicHash::Sha1)) { // Wrong! - self.deleteLater(); + self().deleteLater(); return false; } } @@ -180,12 +180,12 @@ DENG2_PIMPL(RemoteUser) // with ours. name = String::fromUtf8(command.mid(10)); - if (App_ServerSystem().isUserAllowedToJoin(self)) + if (App_ServerSystem().isUserAllowedToJoin(self())) { state = Joined; // Successful! Send a reply. - self << ByteRefArray("Enter", 5); + self() << ByteRefArray("Enter", 5); // Inform the higher levels of this occurence. netevent_t netEvent; @@ -196,7 +196,7 @@ DENG2_PIMPL(RemoteUser) else { // Couldn't join the game, so close the connection. - self.deleteLater(); + self().deleteLater(); return false; } } @@ -204,7 +204,7 @@ DENG2_PIMPL(RemoteUser) { // Too bad, scoundrel! Goodbye. LOG_NET_WARNING("Received an invalid request from %s") << id; - self.deleteLater(); + self().deleteLater(); return false; } diff --git a/doomsday/apps/server/src/serverapp.cpp b/doomsday/apps/server/src/serverapp.cpp index 4a3ce01266..35d064825a 100644 --- a/doomsday/apps/server/src/serverapp.cpp +++ b/doomsday/apps/server/src/serverapp.cpp @@ -76,8 +76,8 @@ DENG2_PIMPL(ServerApp) serverAppSingleton = thisPublic; DoomsdayApp::plugins().audienceForPublishAPI() += this; - self.audienceForGameUnload() += this; - self.audienceForConsoleRegistration() += this; + self().audienceForGameUnload() += this; + self().audienceForConsoleRegistration() += this; } ~Impl() @@ -123,7 +123,7 @@ DENG2_PIMPL(ServerApp) void printHelpToStdOut() { printVersionToStdOut(); - printf("Usage: %s [options]\n", self.commandLine().at(0).toLatin1().constData()); + printf("Usage: %s [options]\n", self().commandLine().at(0).toLatin1().constData()); printf(" -iwad (dir) Set directory containing IWAD files.\n"); printf(" -file (f) Load one or more PWAD files at startup.\n"); printf(" -game (id) Set game to load at startup.\n"); diff --git a/doomsday/apps/server/src/shelluser.cpp b/doomsday/apps/server/src/shelluser.cpp index af3151f43b..8c6909b021 100644 --- a/doomsday/apps/server/src/shelluser.cpp +++ b/doomsday/apps/server/src/shelluser.cpp @@ -70,9 +70,9 @@ DENG2_PIMPL(ShellUser), public LogSink */ void flush() { - if (!logEntryPacket.isEmpty() && self.status() == shell::Link::Connected) + if (!logEntryPacket.isEmpty() && self().status() == shell::Link::Connected) { - self << logEntryPacket; + self() << logEntryPacket; logEntryPacket.clear(); } } diff --git a/doomsday/sdk/libappfw/include/de/framework/guiwidgetprivate.h b/doomsday/sdk/libappfw/include/de/framework/guiwidgetprivate.h index d9365c17e9..c209f0a47b 100644 --- a/doomsday/sdk/libappfw/include/de/framework/guiwidgetprivate.h +++ b/doomsday/sdk/libappfw/include/de/framework/guiwidgetprivate.h @@ -65,7 +65,7 @@ class GuiWidgetPrivate : public Private, * * @see GuiWidget::destroy() */ - DENG2_ASSERT(!Base::self.isInitialized()); + DENG2_ASSERT(!Base::self().isInitialized()); } void forgetRootAtlas() @@ -91,13 +91,13 @@ class GuiWidgetPrivate : public Private, bool hasRoot() const { - return Base::self.hasRoot(); + return Base::self().hasRoot(); } GuiRootWidget &root() const { DENG2_ASSERT(hasRoot()); - return Base::self.root(); + return Base::self().root(); } AtlasTexture &atlas() const @@ -119,12 +119,12 @@ class GuiWidgetPrivate : public Private, Style const &style() const { - return Base::self.style(); + return Base::self().style(); } Rule const &rule(DotPath const &path) const { - return Base::self.rule(path); + return Base::self().rule(path); } void atlasContentRepositioned(Atlas &atlas) @@ -132,7 +132,7 @@ class GuiWidgetPrivate : public Private, if (_observingAtlas == &atlas) { // Make sure the new texture coordinates get used by the widget. - Base::self.requestGeometry(); + Base::self().requestGeometry(); } } diff --git a/doomsday/sdk/libappfw/src/basewindow.cpp b/doomsday/sdk/libappfw/src/basewindow.cpp index 7a161e4b04..7659c92131 100644 --- a/doomsday/sdk/libappfw/src/basewindow.cpp +++ b/doomsday/sdk/libappfw/src/basewindow.cpp @@ -39,14 +39,14 @@ DENG2_PIMPL(BaseWindow) Impl(Public *i) : Base(i) - , defaultXf(self) + , defaultXf(*i) , xf(&defaultXf) { - self.audienceForInit() += this; + self().audienceForInit() += this; // Listen to input. - self.eventHandler().audienceForKeyEvent() += this; - self.eventHandler().audienceForMouseEvent() += this; + self().eventHandler().audienceForKeyEvent() += this; + self().eventHandler().audienceForMouseEvent() += this; } void windowInit(GLWindow &) @@ -66,7 +66,7 @@ DENG2_PIMPL(BaseWindow) if (!WindowSystem::get().processEvent(ev)) { // Maybe the fallback handler has use for this. - self.handleFallbackEvent(ev); + self().handleFallbackEvent(ev); } } @@ -85,7 +85,7 @@ DENG2_PIMPL(BaseWindow) if (!WindowSystem::get().processEvent(ev)) { // Maybe the fallback handler has use for this. - self.handleFallbackEvent(ev); + self().handleFallbackEvent(ev); } } }; diff --git a/doomsday/sdk/libappfw/src/dialogs/directorylistdialog.cpp b/doomsday/sdk/libappfw/src/dialogs/directorylistdialog.cpp index 144e848439..0f51971004 100644 --- a/doomsday/sdk/libappfw/src/dialogs/directorylistdialog.cpp +++ b/doomsday/sdk/libappfw/src/dialogs/directorylistdialog.cpp @@ -33,7 +33,7 @@ DENG2_PIMPL(DirectoryListDialog) array.set(new ArrayValue); list = new DirectoryArrayWidget(array); list->margins().setZero(); - self.add(list->detachAddButton(self.area().rule().width())); + self().add(list->detachAddButton(self().area().rule().width())); list->addButton().hide(); } }; diff --git a/doomsday/sdk/libappfw/src/dialogs/messagedialog.cpp b/doomsday/sdk/libappfw/src/dialogs/messagedialog.cpp index 542ef19e05..b64d9b17c5 100644 --- a/doomsday/sdk/libappfw/src/dialogs/messagedialog.cpp +++ b/doomsday/sdk/libappfw/src/dialogs/messagedialog.cpp @@ -32,7 +32,7 @@ DENG_GUI_PIMPL(MessageDialog) Impl(Public *i) : Base(i) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); // Create widgets. area.add(title = new LabelWidget); @@ -57,7 +57,7 @@ DENG_GUI_PIMPL(MessageDialog) void updateLayout(LayoutBehavior behavior = ExcludeHidden) { - ScrollAreaWidget &area = self.area(); + ScrollAreaWidget &area = self().area(); // Simple vertical layout. SequentialLayout layout(area.contentRule().left(), diff --git a/doomsday/sdk/libappfw/src/guirootwidget.cpp b/doomsday/sdk/libappfw/src/guirootwidget.cpp index e8162fa790..a2b146a979 100644 --- a/doomsday/sdk/libappfw/src/guirootwidget.cpp +++ b/doomsday/sdk/libappfw/src/guirootwidget.cpp @@ -131,8 +131,8 @@ DENG2_PIMPL(GuiRootWidget) , uTexAtlas("uTex", GLUniform::Sampler2D) , noFramesDrawnYet(true) { - self.audienceForChildAddition() += this; - self.audienceForFocusChange() += this; + self().audienceForChildAddition() += this; + self().audienceForFocusChange() += this; // The focus indicator exists outside the widget tree. focusIndicator = new FocusWidget; @@ -151,11 +151,11 @@ DENG2_PIMPL(GuiRootWidget) // class destructor will destroy all widgets, but this class governs // shared GL resources, so we'll ask the widgets to do this now. focusIndicator->deinitialize(); - self.notifyTree(&Widget::deinitialize); + self().notifyTree(&Widget::deinitialize); // Destroy GUI widgets while the shared resources are still available. GuiWidget::destroy(focusIndicator); - self.clearTree(); + self().clearTree(); } void initAtlas() @@ -169,7 +169,7 @@ DENG2_PIMPL(GuiRootWidget) texBank.setAtlas(atlas.data()); // Load a set of general purpose textures (derived classes may extend this). - self.loadCommonTextures(); + self().loadCommonTextures(); } } diff --git a/doomsday/sdk/libappfw/src/guiwidget.cpp b/doomsday/sdk/libappfw/src/guiwidget.cpp index d025b02c67..f8cd9c6891 100644 --- a/doomsday/sdk/libappfw/src/guiwidget.cpp +++ b/doomsday/sdk/libappfw/src/guiwidget.cpp @@ -87,12 +87,12 @@ DENG2_PIMPL(GuiWidget) , fontId("default") , textColorId("text") { - self.audienceForChildAddition() += this; + self().audienceForChildAddition() += this; margins.audienceForChange() += this; #ifdef DENG2_DEBUG - self.audienceForParentChange() += this; - rule.setDebugName(self.path()); + self().audienceForParentChange() += this; + rule.setDebugName(self().path()); #endif } @@ -102,7 +102,7 @@ DENG2_PIMPL(GuiWidget) // The base class will delete all children, but we need to deinitialize // them first. - self.notifyTree(&Widget::deinitialize); + self().notifyTree(&Widget::deinitialize); deinitBlur(); @@ -112,7 +112,7 @@ DENG2_PIMPL(GuiWidget) * first before beginning destruction. */ #ifdef DENG2_DEBUG - if (inited) qDebug() << "GuiWidget" << &self << self.name() << "is still inited!"; + if (inited) qDebug() << "GuiWidget" << thisPublic << self().name() << "is still inited!"; DENG2_ASSERT(!inited); #endif } @@ -125,13 +125,13 @@ DENG2_PIMPL(GuiWidget) #ifdef DENG2_DEBUG void widgetParentChanged(Widget &, Widget *, Widget *) { - rule.setDebugName(self.path()); + rule.setDebugName(self().path()); } #endif void widgetChildAdded(Widget &child) { - if (self.hasRoot()) + if (self().hasRoot()) { // Make sure newly added children know the view size. child.viewResized(); @@ -145,9 +145,9 @@ DENG2_PIMPL(GuiWidget) bool isClipCulled() const { bool wasClipped = false; - Rectanglei visibleArea = self.root().viewRule().recti(); + Rectanglei visibleArea = self().root().viewRule().recti(); - for (Widget const *w = self.parentWidget(); w; w = w->parent()) + for (Widget const *w = self().parentWidget(); w; w = w->parent()) { if (!w->is()) continue; @@ -160,12 +160,12 @@ DENG2_PIMPL(GuiWidget) } if (!wasClipped) return false; - if (self.isClipped()) + if (self().isClipped()) { int const CULL_SAFETY_WIDTH = 50; // avoid pop-in when scrolling // Clipped widgets are guaranteed to be within their rectangle. - return !visibleArea.overlaps(self.rule().recti().expanded( + return !visibleArea.overlaps(self().rule().recti().expanded( GuiWidget::toDevicePixels(CULL_SAFETY_WIDTH))); } // Otherwise widgets may draw anywhere in the view. @@ -179,7 +179,7 @@ DENG2_PIMPL(GuiWidget) blur.reset(new BlurState); // The blurred version of the view is downsampled. - blur->size = (self.root().viewSize() / GuiWidget::toDevicePixels(4)).max(Vector2ui(1, 1)); + blur->size = (self().root().viewSize() / GuiWidget::toDevicePixels(4)).max(Vector2ui(1, 1)); for (int i = 0; i < 2; ++i) { @@ -202,14 +202,14 @@ DENG2_PIMPL(GuiWidget) blur->uBlurStep = Vector2f(1.f / float(blur->size.x), 1.f / float(blur->size.y)); - self.root().shaders().build(blur->drawable.program(), "fx.blur.horizontal") + self().root().shaders().build(blur->drawable.program(), "fx.blur.horizontal") << blur->uMvpMatrix << blur->uTex << blur->uBlurStep << blur->uWindow; blur->drawable.addProgram("vert"); - self.root().shaders().build(blur->drawable.program("vert"), "fx.blur.vertical") + self().root().shaders().build(blur->drawable.program("vert"), "fx.blur.vertical") << blur->uMvpMatrix << blur->uTex << blur->uColor @@ -248,7 +248,7 @@ DENG2_PIMPL(GuiWidget) DENG2_ASSERT(background.blur != 0); if (background.blur) { - background.blur->drawBlurredRect(self.rule().recti(), background.solidFill); + background.blur->drawBlurredRect(self().rule().recti(), background.solidFill); } return; } @@ -272,7 +272,7 @@ DENG2_PIMPL(GuiWidget) .setTarget(*blur->fb[0]) .setViewport(Rectangleui::fromSize(blur->size)); blur->fb[0]->clear(GLFramebuffer::Depth); - self.root().drawUntil(self); + self().root().drawUntil(self()); GLState::pop(); blur->fb[0]->resolveSamples(); @@ -294,14 +294,14 @@ DENG2_PIMPL(GuiWidget) // Pass 3: apply the vertical blur filter, drawing the final result // into the original target. Vector4f blurColor = background.solidFill; - float blurOpacity = self.visibleOpacity(); + float blurOpacity = self().visibleOpacity(); if (background.type == Background::BlurredWithSolidFill) { blurColor.w = 1; } if (!attribs.testFlag(DontDrawContent) && blurColor.w > 0 && blurOpacity > 0) { - self.drawBlurredRect(self.rule().recti(), blurColor, blurOpacity); + self().drawBlurredRect(self().rule().recti(), blurColor, blurOpacity); } } @@ -312,7 +312,7 @@ DENG2_PIMPL(GuiWidget) void updateOpacityForDisabledWidgets() { - float const opac = (self.isDisabled()? .3f : 1.f); + float const opac = (self().isDisabled()? .3f : 1.f); if (opacityWhenDisabled.target() != opac) { opacityWhenDisabled.setValue(opac, .3f); @@ -328,7 +328,7 @@ DENG2_PIMPL(GuiWidget) { try { - if (IPersistent *po = self.maybeAs()) + if (IPersistent *po = self().maybeAs()) { DENG2_BASE_GUI_APP->persistentUIState() >> *po; } @@ -337,7 +337,7 @@ DENG2_PIMPL(GuiWidget) { // Benign: widget will use default state. LOG_VERBOSE("Failed to restore state of widget '%s': %s") - << self.path() << er.asText(); + << self().path() << er.asText(); } } @@ -345,7 +345,7 @@ DENG2_PIMPL(GuiWidget) { try { - if (IPersistent *po = self.maybeAs()) + if (IPersistent *po = self().maybeAs()) { DENG2_BASE_GUI_APP->persistentUIState() << *po; } @@ -353,16 +353,16 @@ DENG2_PIMPL(GuiWidget) catch (Error const &er) { LOG_WARNING("Failed to save state of widget '%s': %s") - << self.path() << er.asText(); + << self().path() << er.asText(); } } GuiWidget *findNextWidgetToFocus(WalkDirection dir) { - PopupWidget *parentPopup = self.findParentPopup(); - Rectanglei const viewRect = self.root().viewRule().recti(); + PopupWidget *parentPopup = self().findParentPopup(); + Rectanglei const viewRect = self().root().viewRule().recti(); bool escaped = false; - auto *widget = self.walkInOrder(dir, [this, &viewRect, parentPopup, &escaped] (Widget &widget) + auto *widget = self().walkInOrder(dir, [this, &viewRect, parentPopup, &escaped] (Widget &widget) { if (parentPopup && !widget.hasAncestor(*parentPopup)) { @@ -390,13 +390,13 @@ DENG2_PIMPL(GuiWidget) float scoreForWidget(GuiWidget const &widget, ui::Direction dir) const { - if (!widget.canBeFocused() || &widget == &self) + if (!widget.canBeFocused() || &widget == thisPublic) { return -1; } - Rectanglef const viewRect = self.root().viewRule().rect(); - Rectanglef const selfRect = self.hitRule().rect(); + Rectanglef const viewRect = self().root().viewRule().rect(); + Rectanglef const selfRect = self().hitRule().rect(); Rectanglef const otherRect = widget.hitRule().rect(); Vector2f const otherMiddle = (dir == ui::Up? otherRect.midBottom() : @@ -466,11 +466,11 @@ DENG2_PIMPL(GuiWidget) } float favorability = 1; - if (widget.parentWidget() == self.parentWidget()) + if (widget.parentWidget() == self().parentWidget()) { favorability = .1f; // Siblings are much preferred. } - else if (self.hasAncestor(widget) || widget.hasAncestor(self)) + else if (self().hasAncestor(widget) || widget.hasAncestor(self())) { favorability = .2f; // Ancestry is also good. } @@ -486,8 +486,8 @@ DENG2_PIMPL(GuiWidget) // Focus navigation is always contained within the popup where the focus is // currently in. - Widget *walkRoot = self.findParentPopup(); - if (!walkRoot) walkRoot = &self.root(); + Widget *walkRoot = self().findParentPopup(); + if (!walkRoot) walkRoot = &self().root(); walkRoot->walkChildren(Forward, [this, &dir, &bestScore, &bestWidget] (Widget &widget) { @@ -519,7 +519,7 @@ DENG2_PIMPL(GuiWidget) << "opacity:" << bestWidget->visibleOpacity() << "visible:" << bestWidget->isVisible(); }*/ - return bestWidget? bestWidget : &self; + return bestWidget? bestWidget : thisPublic; } static float toDevicePixels(double logicalPixels) diff --git a/doomsday/sdk/libappfw/src/textdrawable.cpp b/doomsday/sdk/libappfw/src/textdrawable.cpp index b5891f7930..868058ea24 100644 --- a/doomsday/sdk/libappfw/src/textdrawable.cpp +++ b/doomsday/sdk/libappfw/src/textdrawable.cpp @@ -276,8 +276,8 @@ DENG2_PIMPL(TextDrawable) DENG2_ASSERT(visibleWrap != nullptr); - self.setWrapping(*visibleWrap); - self.GLTextComposer::setText(visibleWrap->plainText, visibleWrap->format); + self().setWrapping(*visibleWrap); + self().GLTextComposer::setText(visibleWrap->plainText, visibleWrap->format); return true; } diff --git a/doomsday/sdk/libappfw/src/vrwindowtransform.cpp b/doomsday/sdk/libappfw/src/vrwindowtransform.cpp index 207137eaf7..e363bcdaf6 100644 --- a/doomsday/sdk/libappfw/src/vrwindowtransform.cpp +++ b/doomsday/sdk/libappfw/src/vrwindowtransform.cpp @@ -54,17 +54,17 @@ DENG2_PIMPL(VRWindowTransform) GLFramebuffer &target() const { - return self.window().framebuffer(); + return self().window().framebuffer(); } int width() const { - return self.window().pixelWidth(); + return self().window().pixelWidth(); } int height() const { - return self.window().pixelHeight(); + return self().window().pixelHeight(); } float displayModeDependentUIScalingFactor() const @@ -80,7 +80,7 @@ DENG2_PIMPL(VRWindowTransform) void drawContent() const { LIBGUI_ASSERT_GL_OK(); - self.window().drawWindowContent(); + self().window().drawWindowContent(); LIBGUI_ASSERT_GL_OK(); } @@ -266,7 +266,7 @@ DENG2_PIMPL(VRWindowTransform) break; case VRConfig::QuadBuffered: - if (self.window().format().stereo()) + if (self().window().format().stereo()) { /// @todo Fix me! @@ -291,7 +291,7 @@ DENG2_PIMPL(VRWindowTransform) // Use absolute screen position of window to determine whether the // first scan line is odd or even. QPoint ulCorner(0, 0); - ulCorner = self.window().mapToGlobal(ulCorner); // widget to screen coordinates + ulCorner = self().window().mapToGlobal(ulCorner); // widget to screen coordinates bool const rowParityIsEven = ((ulCorner.y() % 2) == 0); // Draw left eye view directly to the screen diff --git a/doomsday/sdk/libappfw/src/widgets/auxbuttonwidget.cpp b/doomsday/sdk/libappfw/src/widgets/auxbuttonwidget.cpp index 16627e1d65..aaeb1eb2a2 100644 --- a/doomsday/sdk/libappfw/src/widgets/auxbuttonwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/auxbuttonwidget.cpp @@ -30,20 +30,20 @@ DENG_GUI_PIMPL(AuxButtonWidget) : Base(i) , inverted(false) { - self.add(aux = new ButtonWidget); + self().add(aux = new ButtonWidget); aux->setFont("small"); aux->setTextColor("text"); aux->setSizePolicy(ui::Expand, ui::Fixed); Rule const &unit = rule(RuleBank::UNIT); aux->rule() - .setInput(Rule::Right, self.rule().right() - unit) - .setInput(Rule::Top, self.rule().top() + unit) - .setInput(Rule::Bottom, self.rule().bottom() - unit); + .setInput(Rule::Right, self().rule().right() - unit) + .setInput(Rule::Top, self().rule().top() + unit) + .setInput(Rule::Bottom, self().rule().bottom() - unit); aux->audienceForStateChange() += this; - self.margins().set("dialog.gap").setLeft("gap"); - self.margins().setRight(aux->rule().width() + rule("gap")); + self().margins().set("dialog.gap").setLeft("gap"); + self().margins().setRight(aux->rule().width() + rule("gap")); } void setAuxBorderColorf(Vector4f const &colorf) diff --git a/doomsday/sdk/libappfw/src/widgets/buttonwidget.cpp b/doomsday/sdk/libappfw/src/widgets/buttonwidget.cpp index 52d535db16..7f9ac331b7 100644 --- a/doomsday/sdk/libappfw/src/widgets/buttonwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/buttonwidget.cpp @@ -60,8 +60,8 @@ DENG2_OBSERVES(Action, Triggered) if (st == Hover && state == Up) { // Remember the original text color. - originalTextColor = self.textColorId(); - originalTextModColor = self.textModulationColorf(); + originalTextColor = self().textColorId(); + originalTextModColor = self().textModulationColorf(); } State const prev = state; @@ -80,10 +80,10 @@ DENG2_OBSERVES(Action, Triggered) switch (hoverColorMode) { case ModulateColor: - self.setTextModulationColorf(originalTextModColor); + self().setTextModulationColorf(originalTextModColor); break; case ReplaceColor: - self.setTextColor(originalTextColor); + self().setTextColor(originalTextColor); break; } } @@ -96,10 +96,10 @@ DENG2_OBSERVES(Action, Triggered) switch (hoverColorMode) { case ModulateColor: - self.setTextModulationColorf(style().colors().colorf(hoverTextColor)); + self().setTextModulationColorf(style().colors().colorf(hoverTextColor)); break; case ReplaceColor: - self.setTextColor(hoverTextColor); + self().setTextColor(hoverTextColor); break; } } @@ -113,20 +113,20 @@ DENG2_OBSERVES(Action, Triggered) DENG2_FOR_PUBLIC_AUDIENCE2(StateChange, i) { - i->buttonStateChanged(self, state); + i->buttonStateChanged(self(), state); } } void updateHover(Vector2i const &pos) { if (state == Down) return; - if (self.isDisabled()) + if (self().isDisabled()) { setState(Up); return; } - if (self.hitTest(pos)) + if (self().hitTest(pos)) { if (state == Up) setState(Hover); } @@ -144,19 +144,19 @@ DENG2_OBSERVES(Action, Triggered) void setDefaultBackground() { - self.set(Background(style().colors().colorf(bgColorId), + self().set(Background(style().colors().colorf(bgColorId), bgType, borderColor(), 6)); } void updateBackground() { - Background bg = self.background(); + Background bg = self().background(); if (bg.type == Background::GradientFrame || bg.type == Background::GradientFrameWithRoundedFill) { bg.solidFill = style().colors().colorf(bgColorId); bg.color = borderColor(); - self.set(bg); + self().set(bg); } } @@ -165,7 +165,7 @@ DENG2_OBSERVES(Action, Triggered) if (animating) { updateBackground(); - self.requestGeometry(); + self().requestGeometry(); if (scale.done() && frameOpacity.done()) { animating = false; @@ -177,7 +177,7 @@ DENG2_OBSERVES(Action, Triggered) { DENG2_FOR_PUBLIC_AUDIENCE2(Triggered, i) { - i->buttonActionTriggered(self); + i->buttonActionTriggered(self()); } } diff --git a/doomsday/sdk/libappfw/src/widgets/choicewidget.cpp b/doomsday/sdk/libappfw/src/widgets/choicewidget.cpp index cf9a7cf68a..31f2f0c4ed 100644 --- a/doomsday/sdk/libappfw/src/widgets/choicewidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/choicewidget.cpp @@ -51,7 +51,7 @@ DENG2_OBSERVES(ChildWidgetOrganizer, WidgetUpdate) wd->updateItemHighlight(); wd->choices->dismiss(); - emit wd->self.selectionChangedByUser(wd->selected); + emit wd->self().selectionChangedByUser(wd->selected); } }; @@ -64,7 +64,7 @@ DENG2_OBSERVES(ChildWidgetOrganizer, WidgetUpdate) { maxWidth = new IndirectRule; - self.setFont("choice.selected"); + self().setFont("choice.selected"); choices = new PopupMenuWidget; choices->items().audienceForAddition() += this; @@ -72,9 +72,9 @@ DENG2_OBSERVES(ChildWidgetOrganizer, WidgetUpdate) choices->items().audienceForOrderChange() += this; choices->menu().organizer().audienceForWidgetCreation() += this; choices->menu().organizer().audienceForWidgetUpdate() += this; - self.add(choices); + self().add(choices); - self.setPopup(*choices, ui::Right); + self().setPopup(*choices, ui::Right); QObject::connect(choices, &PanelWidget::opened, [this] () { @@ -112,10 +112,10 @@ DENG2_OBSERVES(ChildWidgetOrganizer, WidgetUpdate) void widgetUpdatedForItem(GuiWidget &, ui::Item const &item) { - if (isValidSelection() && &item == &self.selectedItem()) + if (isValidSelection() && &item == &self().selectedItem()) { // Make sure the button is up to date, too. - updateButtonWithItem(self.selectedItem()); + updateButtonWithItem(self().selectedItem()); } } @@ -123,7 +123,7 @@ DENG2_OBSERVES(ChildWidgetOrganizer, WidgetUpdate) { // We'll need to calculate this manually because the fonts keep changing due to // selection and thus we can't just check the current layout. - Font const &font = self.font(); + Font const &font = self().font(); int widest = 0; for (uint i = 0; i < items().size(); ++i) { @@ -131,7 +131,7 @@ DENG2_OBSERVES(ChildWidgetOrganizer, WidgetUpdate) esc.parse(items().at(i).label()); widest = de::max(widest, font.advanceWidth(esc.plainText())); } - maxWidth->setSource(Const(widest) + self.margins().width()); + maxWidth->setSource(Const(widest) + self().margins().width()); } Data const &items() const @@ -194,12 +194,12 @@ DENG2_OBSERVES(ChildWidgetOrganizer, WidgetUpdate) void updateButtonWithItem(ui::Item const &item) { - self.setText(item.label()); + self().setText(item.label()); ActionItem const *act = dynamic_cast(&item); if (act) { - self.setImage(act->image()); + self().setImage(act->image()); } } @@ -213,11 +213,11 @@ DENG2_OBSERVES(ChildWidgetOrganizer, WidgetUpdate) else { // No valid selection. - self.setText(noSelectionHint); - self.setImage(Image()); + self().setText(noSelectionHint); + self().setImage(Image()); } - emit self.selectionChanged(selected); + emit self().selectionChanged(selected); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/commandwidget.cpp b/doomsday/sdk/libappfw/src/widgets/commandwidget.cpp index f3c366a067..cc51eafc6d 100644 --- a/doomsday/sdk/libappfw/src/widgets/commandwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/commandwidget.cpp @@ -41,9 +41,9 @@ DENG_GUI_PIMPL(CommandWidget) // Height for the content: depends on the document height (plus margins), but at // most 400; never extend outside the view, though. popup->setPreferredHeight(rule("editor.completion.height"), - self.rule().top() - rule("gap")); + self().rule().top() - rule("gap")); - self.add(popup); + self().add(popup); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/compositorwidget.cpp b/doomsday/sdk/libappfw/src/widgets/compositorwidget.cpp index dc61779be6..41f1dfaced 100644 --- a/doomsday/sdk/libappfw/src/widgets/compositorwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/compositorwidget.cpp @@ -104,7 +104,7 @@ DENG_GUI_PIMPL(CompositorWidget) bool shouldBeDrawn() const { - return self.isInitialized() && !self.isHidden() && self.visibleOpacity() > 0 && + return self().isInitialized() && !self().isHidden() && self().visibleOpacity() > 0 && GLState::current().target().rectInUse().size() != Vector2ui(); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/dialogwidget.cpp b/doomsday/sdk/libappfw/src/widgets/dialogwidget.cpp index 2837afc4ff..c9bea9cced 100644 --- a/doomsday/sdk/libappfw/src/widgets/dialogwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/dialogwidget.cpp @@ -159,8 +159,8 @@ DENG_GUI_PIMPL(DialogWidget) extraButtons->setGridSize(0, ui::Expand, 1, ui::Expand); area->rule() - .setInput(Rule::Left, self.rule().left()) - .setInput(Rule::Top, self.rule().top()) + .setInput(Rule::Left, self().rule().left()) + .setInput(Rule::Top, self().rule().top()) .setInput(Rule::Width, area->contentRule().width() + area->margins().width()); // Will a title be included? @@ -183,8 +183,8 @@ DENG_GUI_PIMPL(DialogWidget) container->add(heading); heading->rule() - .setInput(Rule::Top, self.rule().top()) - .setInput(Rule::Left, self.rule().left()) + .setInput(Rule::Top, self().rule().top()) + .setInput(Rule::Left, self().rule().left()) .setInput(Rule::Right, area->rule().right()); area->rule().setInput(Rule::Top, heading->rule().bottom()); @@ -195,10 +195,10 @@ DENG_GUI_PIMPL(DialogWidget) // Buttons below the area. buttons->rule() .setInput(Rule::Bottom, container->rule().bottom()) - .setInput(Rule::Right, self.rule().right()); + .setInput(Rule::Right, self().rule().right()); extraButtons->rule() .setInput(Rule::Top, buttons->rule().top()) - .setInput(Rule::Left, self.rule().left()); + .setInput(Rule::Left, self().rule().left()); // A blank container widget acts as the popup content parent. container->rule().setInput(Rule::Width, OperatorRule::maximum( @@ -217,7 +217,7 @@ DENG_GUI_PIMPL(DialogWidget) container->add(area); container->add(extraButtons); container->add(buttons); - self.setContent(container); + self().setContent(container); } ~Impl() @@ -232,7 +232,7 @@ DENG_GUI_PIMPL(DialogWidget) if (!rightArea) { rightArea = new ScrollAreaWidget("rightArea"); - self.content().add(rightArea); + self().content().add(rightArea); rightArea->rule() .setInput(Rule::Top, area->rule().top()) @@ -246,12 +246,12 @@ DENG_GUI_PIMPL(DialogWidget) } // Content size is now wider. - self.content().rule().setInput(Rule::Width, OperatorRule::maximum( + self().content().rule().setInput(Rule::Width, OperatorRule::maximum( area->rule().width() + rightArea->rule().width(), buttons->rule().width() + extraButtons->rule().width(), *minWidth)); - if (self.isOpen()) updateContentHeight(); + if (self().isOpen()) updateContentHeight(); } } @@ -259,9 +259,9 @@ DENG_GUI_PIMPL(DialogWidget) { // Determine suitable maximum height. Rule const *maxHeight = holdRef(root().viewHeight()); - if (self.openingDirection() == ui::Down) + if (self().openingDirection() == ui::Down) { - changeRef(maxHeight, *maxHeight - self.anchor().top() - rule("gap")); + changeRef(maxHeight, *maxHeight - self().anchor().top() - rule("gap")); } // Scrollable area content height. @@ -276,12 +276,12 @@ DENG_GUI_PIMPL(DialogWidget) // the dialog tries to show the full height of the content area. if (!flags.testFlag(WithHeading)) { - self.content().rule().setInput(Rule::Height, + self().content().rule().setInput(Rule::Height, OperatorRule::minimum(*maxHeight, areaContentHeight + buttons->rule().height())); } else { - self.content().rule().setInput(Rule::Height, + self().content().rule().setInput(Rule::Height, OperatorRule::minimum(*maxHeight, (heading? heading->rule().height() : Const(0)) + areaContentHeight + buttons->rule().height())); } @@ -412,26 +412,26 @@ DENG_GUI_PIMPL(DialogWidget) { animatingGlow = true; glow.setValueFrom(1, normalGlow, FLASH_ANIM_SPAN); - Background bg = self.background(); + Background bg = self().background(); bg.color.w = glow; - self.set(bg); + self().set(bg); } void updateBorderFlash() { - Background bg = self.background(); + Background bg = self().background(); bg.color.w = glow; - self.set(bg); + self().set(bg); if (glow.done()) animatingGlow = false; } void updateBackground() { - Background bg = self.background(); - if (self.isUsingInfoStyle()) + Background bg = self().background(); + if (self().isUsingInfoStyle()) { - bg = self.infoStyleBackground(); + bg = self().infoStyleBackground(); } else if (Style::get().isBlurringAllowed()) { @@ -445,7 +445,7 @@ DENG_GUI_PIMPL(DialogWidget) bg.type = Background::BorderGlow; bg.solidFill = style().colors().colorf("dialog.background"); } - self.set(bg); + self().set(bg); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/documentwidget.cpp b/doomsday/sdk/libappfw/src/widgets/documentwidget.cpp index 0d57377d0f..f4f942c420 100644 --- a/doomsday/sdk/libappfw/src/widgets/documentwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/documentwidget.cpp @@ -66,9 +66,9 @@ public Font::RichFormat::IStyle progress = new ProgressWidget("progress-indicator"); progress->setColor("progress.dark.wheel"); progress->setShadowColor("progress.dark.shadow"); - progress->rule().setRect(self.rule()); + progress->rule().setRect(self().rule()); progress->hide(); - self.add(progress); + self().add(progress); maxLineWidth = GuiWidget::toDevicePixels(1000); } @@ -88,8 +88,8 @@ public Font::RichFormat::IStyle accentColor = st.colors().color("document.accent"); dimAccentColor = st.colors().color("document.dimaccent"); - glText.setFont(self.font()); - self.requestGeometry(); + glText.setFont(self().font()); + self().requestGeometry(); } Font::RichFormat::IStyle::Color richStyleColor(int index) const @@ -132,9 +132,9 @@ public Font::RichFormat::IStyle { atlas().audienceForReposition() += this; - glText.init(atlas(), self.font(), this); + glText.init(atlas(), self().font(), this); - self.setIndicatorUv(atlas().imageRectf(root().solidWhitePixel()).middle()); + self().setIndicatorUv(atlas().imageRectf(root().solidWhitePixel()).middle()); drawable.addBuffer(ID_BACKGROUND, new VertexBuf); drawable.addBuffer(ID_TEXT, new VertexBuf); @@ -157,24 +157,24 @@ public Font::RichFormat::IStyle void atlasContentRepositioned(Atlas &atlas) { - self.setIndicatorUv(atlas.imageRectf(root().solidWhitePixel()).middle()); - self.requestGeometry(); + self().setIndicatorUv(atlas.imageRectf(root().solidWhitePixel()).middle()); + self().requestGeometry(); } void updateGeometry() { // If scroll position has changed, must update text geometry. - int scrollY = self.scrollPositionY().valuei(); + int scrollY = self().scrollPositionY().valuei(); if (oldScrollY != scrollY) { oldScrollY = scrollY; - self.requestGeometry(); + self().requestGeometry(); } Rectanglei pos; - if (self.hasChangedPlace(pos)) + if (self().hasChangedPlace(pos)) { - self.requestGeometry(); + self().requestGeometry(); } // Make sure the text has been wrapped for the current dimensions. @@ -185,7 +185,7 @@ public Font::RichFormat::IStyle } else { - wrapWidth = self.rule().width().valuei() - self.margins().width().valuei(); + wrapWidth = self().rule().width().valuei() - self().margins().width().valuei(); } glText.setLineWrapWidth(wrapWidth); if (glText.update()) @@ -194,20 +194,20 @@ public Font::RichFormat::IStyle if (!glText.isBeingWrapped() && progress->isVisible()) { contentMaxWidth->set(de::max(contentMaxWidth->value(), float(glText.wrappedSize().x))); - self.setContentSize(Vector2ui(contentMaxWidth->valuei(), glText.wrappedSize().y)); + self().setContentSize(Vector2ui(contentMaxWidth->valuei(), glText.wrappedSize().y)); progress->hide(); } - self.requestGeometry(); + self().requestGeometry(); } - if (!self.geometryRequested()) return; + if (!self().geometryRequested()) return; // Background and scroll indicator. VertexBuf::Builder verts; - self.glMakeGeometry(verts); + self().glMakeGeometry(verts); drawable.buffer(ID_BACKGROUND) - .setVertices(gl::TriangleStrip, verts, self.isScrolling()? gl::Dynamic : gl::Static); + .setVertices(gl::TriangleStrip, verts, self().isScrolling()? gl::Dynamic : gl::Static); uMvpMatrix = root().projMatrix2D(); @@ -216,8 +216,8 @@ public Font::RichFormat::IStyle DENG2_ASSERT(glText.isReady()); // Determine visible range of lines. - Font const &font = self.font(); - int contentHeight = de::min(self.contentHeight(), self.rule().height().valuei()); + Font const &font = self().font(); + int contentHeight = de::min(self().contentHeight(), self().rule().height().valuei()); int const extraLines = 1; int numVisLines = contentHeight / font.lineSpacing().valuei() + 2 * extraLines; int firstVisLine = scrollY / font.lineSpacing().valuei() - extraLines + 1; @@ -234,27 +234,27 @@ public Font::RichFormat::IStyle drawable.buffer(ID_TEXT).setVertices(gl::TriangleStrip, verts, gl::Static); // Update content size to match the generated vertices exactly. - self.setContentWidth(glText.verticesMaxWidth()); + self().setContentWidth(glText.verticesMaxWidth()); } uScrollMvpMatrix = root().projMatrix2D() * - Matrix4f::translate(Vector2f(self.contentRule().left().valuei(), - self.contentRule().top().valuei())); + Matrix4f::translate(Vector2f(self().contentRule().left().valuei(), + self().contentRule().top().valuei())); } // Geometry is now up to date. - self.requestGeometry(false); + self().requestGeometry(false); } void draw() { updateGeometry(); - uColor = Vector4f(1, 1, 1, self.visibleOpacity()); + uColor = Vector4f(1, 1, 1, self().visibleOpacity()); // Update the scissor for the text. clippedTextState = GLState::current(); - clippedTextState.setNormalizedScissor(self.normalizedContentRect()); + clippedTextState.setNormalizedScissor(self().normalizedContentRect()); drawable.draw(); } diff --git a/doomsday/sdk/libappfw/src/widgets/labelwidget.cpp b/doomsday/sdk/libappfw/src/widgets/labelwidget.cpp index 3238056560..59f28bbcea 100644 --- a/doomsday/sdk/libappfw/src/widgets/labelwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/labelwidget.cpp @@ -131,7 +131,7 @@ public Font::RichFormat::IStyle void updateStyle() { - Style const &st = self.style(); + Style const &st = self().style(); gap = rule(gapId).valuei(); @@ -143,15 +143,15 @@ public Font::RichFormat::IStyle altAccentColor = st.colors().color("label.altaccent"); shadowColor = st.colors().colorf(textShadowColorId); - glText.setFont(self.font()); + glText.setFont(self().font()); glText.forceUpdate(); - self.requestGeometry(); + self().requestGeometry(); } Vector4i margin() const { - return self.margins().toVector(); + return self().margins().toVector(); } Color richStyleColor(int index) const @@ -160,7 +160,7 @@ public Font::RichFormat::IStyle { default: case Font::RichFormat::NormalColor: - return self.textColor(); + return self().textColor(); case Font::RichFormat::HighlightColor: return highlightColor; @@ -207,7 +207,7 @@ public Font::RichFormat::IStyle shaders().build(drawable.program(), shaderId) << uMvpMatrix << uColor << uAtlas(); - glText.init(atlas(), self.font(), this); + glText.init(atlas(), self().font(), this); if (!image.isNull()) { @@ -275,7 +275,7 @@ public Font::RichFormat::IStyle */ void contentPlacement(ContentLayout &layout) const { - Rectanglei const contentRect = self.contentRect(); + Rectanglei const contentRect = self().contentRect(); Vector2f const imgSize = imageSize() * imageScale; @@ -453,11 +453,11 @@ public Font::RichFormat::IStyle } else { - w = self.rule().width().valuei() - (margin().x + margin().z); + w = self().rule().width().valuei() - (margin().x + margin().z); } if (vertPolicy != Expand) { - h = self.rule().height().valuei() - (margin().y + margin().w); + h = self().rule().height().valuei() - (margin().y + margin().w); } if (hasImage()) @@ -494,8 +494,8 @@ public Font::RichFormat::IStyle ContentLayout layout; contentPlacement(layout); Rectanglef combined = layout.image | layout.text; - width->set (combined.width() + self.margins().width().valuei()); - height->set(combined.height() + self.margins().height().valuei()); + width->set (combined.width() + self().margins().width().valuei()); + height->set(combined.height() + self().margins().height().valuei()); } void updateAppearanceAnimation() @@ -515,11 +515,11 @@ public Font::RichFormat::IStyle // Update the image on the atlas. if (!image.isNull() && image->update()) { - self.requestGeometry(); + self().requestGeometry(); } if (!overlayImage.isNull() && overlayImage->update()) { - self.requestGeometry(); + self().requestGeometry(); } glText.setLineWrapWidth(availableTextWidth()); @@ -527,28 +527,28 @@ public Font::RichFormat::IStyle { // Need to recompose. updateSize(); - self.requestGeometry(); + self().requestGeometry(); } Rectanglei pos; - if (!self.hasChangedPlace(pos) && !self.geometryRequested()) + if (!self().hasChangedPlace(pos) && !self().geometryRequested()) { // Nothing changed. return; } VertexBuf::Builder verts; - self.glMakeGeometry(verts); + self().glMakeGeometry(verts); drawable.buffer().setVertices(gl::TriangleStrip, verts, gl::Static); - self.requestGeometry(false); + self().requestGeometry(false); } void draw() { updateGeometry(); - self.updateModelViewProjection(uMvpMatrix); + self().updateModelViewProjection(uMvpMatrix); drawable.draw(); } diff --git a/doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp b/doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp index 7451892f77..a56eb9bfa7 100644 --- a/doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/lineeditwidget.cpp @@ -73,12 +73,12 @@ DENG_GUI_PIMPL(LineEditWidget) { height = new AnimationRule(0); - self.setFont("editor.plaintext"); + self().setFont("editor.plaintext"); updateStyle(); uCursorColor = Vector4f(1, 1, 1, 1); - self.set(Background(Vector4f(1, 1, 1, 1), Background::GradientFrame)); + self().set(Background(Vector4f(1, 1, 1, 1), Background::GradientFrame)); } ~Impl() @@ -91,7 +91,7 @@ DENG_GUI_PIMPL(LineEditWidget) */ void updateStyle() { - font = &self.font(); + font = &self().font(); updateBackground(); @@ -106,7 +106,7 @@ DENG_GUI_PIMPL(LineEditWidget) int calculateHeight() { int const hgt = de::max(font->height().valuei(), wraps.totalHeightInPixels()); - return hgt + self.margins().height().valuei(); + return hgt + self().margins().height().valuei(); } void updateProjection() @@ -117,10 +117,10 @@ DENG_GUI_PIMPL(LineEditWidget) void updateBackground() { // If using a gradient frame, update parameters automatically. - if (self.background().type == Background::GradientFrame) + if (self().background().type == Background::GradientFrame) { Background bg; - if (!self.hasFocus()) + if (!self().hasFocus()) { bg = Background(Background::GradientFrame, Vector4f(1, 1, 1, .15f + hovering * .2f), 6); if (unfocusedBackgroundOpacity > 0.f) @@ -134,14 +134,14 @@ DENG_GUI_PIMPL(LineEditWidget) bg = Background(style().colors().colorf("background"), Background::GradientFrame, Vector4f(1, 1, 1, .25f + hovering * .3f), 6); } - self.set(bg); + self().set(bg); } } void glInit() { composer.setAtlas(atlas()); - composer.setText(self.text()); + composer.setText(self().text()); drawable.addBuffer(ID_BUF_TEXT, new VertexBuf); drawable.addBufferWithNewProgram(ID_BUF_CURSOR, new VertexBuf, "cursor"); @@ -165,36 +165,36 @@ DENG_GUI_PIMPL(LineEditWidget) bool showingHint() const { - return self.text().isEmpty() && !hint->text().isEmpty() && !self.hasFocus(); + return self().text().isEmpty() && !hint->text().isEmpty() && !self().hasFocus(); } void updateGeometry() { updateBackground(); - if (composer.update()) self.requestGeometry(); + if (composer.update()) self().requestGeometry(); // Do we actually need to update geometry? Rectanglei pos; - if (!self.hasChangedPlace(pos) && !self.geometryRequested()) + if (!self().hasChangedPlace(pos) && !self().geometryRequested()) { return; } // Generate all geometry. - self.requestGeometry(false); + self().requestGeometry(false); VertexBuf::Builder verts; - self.glMakeGeometry(verts); + self().glMakeGeometry(verts); drawable.buffer(ID_BUF_TEXT) .setVertices(gl::TriangleStrip, verts, gl::Static); // Cursor. - Rectanglei const caret = self.cursorRect(); + Rectanglei const caret = self().cursorRect(); verts.clear(); verts.makeQuad(caret, Vector4f(1, 1, 1, 1), - atlas().imageRectf(self.root().solidWhitePixel()).middle()); + atlas().imageRectf(self().root().solidWhitePixel()).middle()); drawable.buffer(ID_BUF_CURSOR) .setVertices(gl::TriangleStrip, verts, gl::Static); @@ -202,7 +202,7 @@ DENG_GUI_PIMPL(LineEditWidget) void updateHover(Vector2i const &pos) { - if (/*!self.hasFocus() && */ self.hitTest(pos)) + if (/*!self().hasFocus() && */ self().hitTest(pos)) { if (hovering.target() < 1) { @@ -217,16 +217,16 @@ DENG_GUI_PIMPL(LineEditWidget) void contentChanged(bool notify) { - composer.setText(self.text()); + composer.setText(self().text()); if (notify) { - emit self.editorContentChanged(); + emit self().editorContentChanged(); } } void atlasContentRepositioned(Atlas &) { - self.requestGeometry(); + self().requestGeometry(); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/logwidget.cpp b/doomsday/sdk/libappfw/src/widgets/logwidget.cpp index 7a73577ff7..399af7d099 100644 --- a/doomsday/sdk/libappfw/src/widgets/logwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/logwidget.cpp @@ -375,7 +375,7 @@ public Font::RichFormat::IStyle , uColor ("uColor", GLUniform::Vec4) , uBgMvpMatrix("uMvpMatrix", GLUniform::Mat4) { - self.setFont("log.normal"); + self().setFont("log.normal"); updateStyle(); } @@ -389,7 +389,7 @@ public Font::RichFormat::IStyle { sink.clear(); clearCache(); - self.setContentHeight(0); + self().setContentHeight(0); } void clearCache() @@ -402,7 +402,7 @@ public Font::RichFormat::IStyle { Style const &st = style(); - font = &self.font(); + font = &self().font(); normalColor = st.colors().color("log.normal"); highlightColor = st.colors().color("log.highlight"); @@ -411,7 +411,7 @@ public Font::RichFormat::IStyle dimAccentColor = st.colors().color("log.dimaccent"); altAccentColor = st.colors().color("log.altaccent"); - self.set(Background(st.colors().colorf("background"))); + self().set(Background(st.colors().colorf("background"))); } Font::RichFormat::IStyle::Color richStyleColor(int index) const @@ -467,8 +467,8 @@ public Font::RichFormat::IStyle /*Image solidWhitePixel = Image::solidColor(Image::Color(255, 255, 255, 255), Image::Size(1, 1)); scrollTex = entryAtlas->alloc(solidWhitePixel); - self.setIndicatorUv(entryAtlas->imageRectf(scrollTex).middle());*/ - //self.setIndicatorUv(root().atlas().imageRectf(root().solidWhitePixel()).middle()); + self().setIndicatorUv(entryAtlas->imageRectf(scrollTex).middle());*/ + //self().setIndicatorUv(root().atlas().imageRectf(root().solidWhitePixel()).middle()); uTex = entryAtlas; uColor = Vector4f(1, 1, 1, 1); @@ -503,7 +503,7 @@ public Font::RichFormat::IStyle if (entryAtlas == &atlas) { entryAtlasLayoutChanged = true; - self.setIndicatorUv(entryAtlas->imageRectf(scrollTex).middle()); + self().setIndicatorUv(entryAtlas->imageRectf(scrollTex).middle()); } } @@ -517,25 +517,25 @@ public Font::RichFormat::IStyle duint contentWidth() const { - return self.viewportSize().x; + return self().viewportSize().x; } int maxVisibleOffset() { - return self.maximumScrollY().valuei(); + return self().maximumScrollY().valuei(); } void modifyContentHeight(float delta) { - self.modifyContentHeight(delta); + self().modifyContentHeight(delta); // TODO: If content height changes below the visible range, we should adjust // the current scroll position so that the entries don't change position // inside the view. - if (!self.isAtBottom()) + if (!self().isAtBottom()) { - self.scrollPositionY().shift(delta); + self().scrollPositionY().shift(delta); } } @@ -615,7 +615,7 @@ public Font::RichFormat::IStyle sink.remove(0, num); for (int i = 0; i < num; ++i) { - self.modifyContentHeight(-cache.first()->height()); + self().modifyContentHeight(-cache.first()->height()); delete cache.takeFirst(); } } @@ -638,7 +638,7 @@ public Font::RichFormat::IStyle { bool needHeightNotify = false; // if changed as entries are updated int heightDelta = 0; - Vector2i const contentSize = self.viewportSize(); + Vector2i const contentSize = self().viewportSize(); // If the width of the widget changes, text needs to be reflowed with the // new width. @@ -654,7 +654,7 @@ public Font::RichFormat::IStyle VertexBuf::Builder verts; // Draw in reverse, as much as we need. - int initialYBottom = contentSize.y + self.scrollPositionY().valuei(); + int initialYBottom = contentSize.y + self().scrollPositionY().valuei(); contentOffsetForDrawing = std::ceil(contentOffset.value()); Rangei visiblePixelRange = extendPixelRangeWithPadding( @@ -732,7 +732,7 @@ public Font::RichFormat::IStyle } // Draw the scroll indicator, too. - //self.glMakeScrollIndicatorGeometry(verts); + //self().glMakeScrollIndicatorGeometry(verts); buf->setVertices(gl::TriangleStrip, verts, gl::Dynamic); @@ -743,7 +743,7 @@ public Font::RichFormat::IStyle modifyContentHeight(heightDelta); if (needHeightNotify && heightDelta > 0) { - emit self.contentHeightIncreased(heightDelta); + emit self().contentHeightIncreased(heightDelta); } } @@ -753,32 +753,32 @@ public Font::RichFormat::IStyle bool isVisible() const { - Rectanglei vp = self.viewport(); + Rectanglei vp = self().viewport(); return vp.height() > 0 && vp.right() >= 0; } void draw() { Rectanglei pos; - if (self.hasChangedPlace(pos) || !bgBuf->isReady()) + if (self().hasChangedPlace(pos) || !bgBuf->isReady()) { // Update the background quad. VertexBuf::Builder bgVerts; - self.glMakeGeometry(bgVerts); + self().glMakeGeometry(bgVerts); bgBuf->setVertices(gl::TriangleStrip, bgVerts, gl::Static); } background.draw(); - Rectanglei vp = self.viewport(); + Rectanglei vp = self().viewport(); if (vp.height() > 0) { GLState &st = GLState::push(); // Leave room for the indicator in the scissor. st.setNormalizedScissor( - self.normalizedRect( - vp.adjusted(Vector2i(), Vector2i(self.margins().right().valuei(), 0)))); + self().normalizedRect( + vp.adjusted(Vector2i(), Vector2i(self().margins().right().valuei(), 0)))); // First draw the shadow of the text. uMvpMatrix = projMatrix * Matrix4f::translate( diff --git a/doomsday/sdk/libappfw/src/widgets/menuwidget.cpp b/doomsday/sdk/libappfw/src/widgets/menuwidget.cpp index 2eb5687e65..e71d08b188 100644 --- a/doomsday/sdk/libappfw/src/widgets/menuwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/menuwidget.cpp @@ -62,7 +62,7 @@ DENG2_PIMPL(MenuWidget) _widget.reset(w); // Popups need a parent. - //d->self.add(_widget); + //d->self().add(_widget); _dir = openingDirection; } @@ -82,13 +82,13 @@ DENG2_PIMPL(MenuWidget) void trigger() { DENG2_ASSERT(bool(_widget)); - DENG2_ASSERT(d->self.hasRoot()); + DENG2_ASSERT(d->self().hasRoot()); if (_widget->isOpeningOrClosing()) return; if (!_widget->parentWidget()) { - d->self.root().add(_widget); + d->self().root().add(_widget); } Action::trigger(); @@ -180,8 +180,8 @@ DENG2_PIMPL(MenuWidget) SizePolicy rowPolicy = Fixed; Impl(Public *i) - : Base(i), - organizer(self) + : Base(i) + , organizer(*i) { outContentHeight = new IndirectRule; @@ -191,8 +191,8 @@ DENG2_PIMPL(MenuWidget) // The default context is empty. setContext(&defaultItems); - self.audienceForChildAddition() += this; - self.audienceForChildRemoval() += this; + self().audienceForChildAddition() += this; + self().audienceForChildRemoval() += this; } ~Impl() @@ -412,7 +412,7 @@ DENG2_PIMPL(MenuWidget) w->audienceForClose() += this; w->audienceForDeletion() += this; - emit self.subWidgetOpened(w); + emit self().subWidgetOpened(w); // Automatically close other subwidgets when one is opened. foreach (auto *panel, openSubs) @@ -433,7 +433,7 @@ DENG2_PIMPL(MenuWidget) int countVisible() const { int num = 0; - foreach (Widget *i, self.childWidgets()) + foreach (Widget *i, self().childWidgets()) { if (isVisibleItem(i)) ++num; } @@ -446,11 +446,11 @@ DENG2_PIMPL(MenuWidget) if (organizer.virtualizationEnabled()) { - layout.setLeftTop(self.contentRule().left(), - self.contentRule().top() + organizer.virtualStrut()); + layout.setLeftTop(self().contentRule().left(), + self().contentRule().top() + organizer.virtualStrut()); } - foreach (Widget *child, self.childWidgets()) + foreach (Widget *child, self().childWidgets()) { GuiWidget *w = child->maybeAs(); if (!isVisibleItem(w)) continue; diff --git a/doomsday/sdk/libappfw/src/widgets/notificationareawidget.cpp b/doomsday/sdk/libappfw/src/widgets/notificationareawidget.cpp index a374b42f09..8d24519b0b 100644 --- a/doomsday/sdk/libappfw/src/widgets/notificationareawidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/notificationareawidget.cpp @@ -64,10 +64,10 @@ DENG_GUI_PIMPL(NotificationAreaWidget) Rule const &gap = rule(RuleBank::UNIT); // The children are laid out simply in a row from right to left. - SequentialLayout layout(self.rule().right(), self.rule().top(), ui::Left); + SequentialLayout layout(self().rule().right(), self().rule().top(), ui::Left); bool first = true; - foreach (Widget *child, self.childWidgets()) + foreach (Widget *child, self().childWidgets()) { GuiWidget *w = child->as().target(); DENG2_ASSERT(w != nullptr); @@ -81,19 +81,19 @@ DENG_GUI_PIMPL(NotificationAreaWidget) } // Update the total size of the notification area. - self.rule().setSize(layout.width(), layout.height()); + self().rule().setSize(layout.width(), layout.height()); } void show() { shift->set(0, ANIM_SPAN); shift->setStyle(Animation::EaseOut); - self.show(); + self().show(); } void hide(TimeDelta const &span = ANIM_SPAN) { - shift->set(self.rule().height() + rule("gap"), span); + shift->set(self().rule().height() + rule("gap"), span); shift->setStyle(Animation::EaseIn); } @@ -106,12 +106,12 @@ DENG_GUI_PIMPL(NotificationAreaWidget) * observing the notification for deletion and we don't know if the relay * will still be notified after this. */ - self.remove(*relay); + self().remove(*relay); GuiWidget::destroyLater(relay); - if (!self.childCount()) + if (!self().childCount()) { - self.hide(); + self().hide(); } updateChildLayout(); } diff --git a/doomsday/sdk/libappfw/src/widgets/panelwidget.cpp b/doomsday/sdk/libappfw/src/widgets/panelwidget.cpp index 378d551bff..748258f312 100644 --- a/doomsday/sdk/libappfw/src/widgets/panelwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/panelwidget.cpp @@ -88,18 +88,18 @@ DENG_GUI_PIMPL(PanelWidget) // Widget's size depends on the opening animation. if (isVerticalAnimation()) { - self.rule().setInput(Rule::Height, *openingRule); + self().rule().setInput(Rule::Height, *openingRule); if (secondaryPolicy == ui::Expand) { - self.rule().setInput(Rule::Width, content->rule().width()); + self().rule().setInput(Rule::Width, content->rule().width()); } } else { - self.rule().setInput(Rule::Width, *openingRule); + self().rule().setInput(Rule::Width, *openingRule); if (secondaryPolicy == ui::Expand) { - self.rule().setInput(Rule::Height, content->rule().height()); + self().rule().setInput(Rule::Height, content->rule().height()); } } } @@ -107,12 +107,12 @@ DENG_GUI_PIMPL(PanelWidget) void updateGeometry() { Rectanglei pos; - if (self.hasChangedPlace(pos) || self.geometryRequested()) + if (self().hasChangedPlace(pos) || self().geometryRequested()) { - self.requestGeometry(false); + self().requestGeometry(false); VertexBuf::Builder verts; - self.glMakeGeometry(verts); + self().glMakeGeometry(verts); drawable.buffer().setVertices(gl::TriangleStrip, verts, gl::Static); } } @@ -136,20 +136,20 @@ DENG_GUI_PIMPL(PanelWidget) opened = false; - self.setBehavior(DisableEventDispatchToChildren); + self().setBehavior(DisableEventDispatchToChildren); // Begin the closing animation. openingRule->set(0, CLOSING_ANIM_SPAN + delay, delay); openingRule->setStyle(Animation::EaseIn); - self.panelClosing(); + self().panelClosing(); DENG2_FOR_PUBLIC_AUDIENCE2(Close, i) { - i->panelBeingClosed(self); + i->panelBeingClosed(self()); } - emit self.closed(); + emit self().closed(); dismissTimer.start(); dismissTimer.setInterval((CLOSING_ANIM_SPAN + delay).asMilliSeconds()); diff --git a/doomsday/sdk/libappfw/src/widgets/popupbuttonwidget.cpp b/doomsday/sdk/libappfw/src/widgets/popupbuttonwidget.cpp index 06f8fa691b..c85ada1e41 100644 --- a/doomsday/sdk/libappfw/src/widgets/popupbuttonwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/popupbuttonwidget.cpp @@ -48,9 +48,9 @@ DENG2_PIMPL(PopupButtonWidget) { if (constructor) { - pop.reset(constructor(self)); - self.add(pop); - self.setOpeningDirection(direction); + pop.reset(constructor(self())); + self().add(pop); + self().setOpeningDirection(direction); pop->setDeleteAfterDismissed(true); } if (opener) @@ -62,7 +62,7 @@ DENG2_PIMPL(PopupButtonWidget) pop->open(); } - if (auto *parentPop = self.findParentPopup()) + if (auto *parentPop = self().findParentPopup()) { parentPop->audienceForClose() += this; } @@ -71,7 +71,7 @@ DENG2_PIMPL(PopupButtonWidget) void panelBeingClosed(PanelWidget &) { - if (self.isOpen()) pop->close(); + if (self().isOpen()) pop->close(); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/popupmenuwidget.cpp b/doomsday/sdk/libappfw/src/widgets/popupmenuwidget.cpp index 8e03f382f3..bd66a7dbf8 100644 --- a/doomsday/sdk/libappfw/src/widgets/popupmenuwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/popupmenuwidget.cpp @@ -214,12 +214,12 @@ DENG_GUI_PIMPL(PopupMenuWidget) void updateItemHitRules() { - GridLayout const &layout = self.menu().layout(); + GridLayout const &layout = self().menu().layout(); - foreach (Widget *child, self.menu().childWidgets()) + foreach (Widget *child, self().menu().childWidgets()) { GuiWidget &widget = child->as(); - if (self.menu().isWidgetPartOfMenu(widget)) + if (self().menu().isWidgetPartOfMenu(widget)) { Vector2i cell = layout.widgetPos(widget); DENG2_ASSERT(cell.x >= 0 && cell.y >= 0); @@ -227,9 +227,9 @@ DENG_GUI_PIMPL(PopupMenuWidget) // We want items to be hittable throughout the width of the menu, however // restrict this to the item's column if there are multiple columns. widget.hitRule() - .setInput(Rule::Left, (!cell.x? self.rule().left() : + .setInput(Rule::Left, (!cell.x? self().rule().left() : layout.columnLeft(cell.x))) - .setInput(Rule::Right, (cell.x == layout.gridSize().x - 1? self.rule().right() : + .setInput(Rule::Right, (cell.x == layout.gridSize().x - 1? self().rule().right() : layout.columnRight(cell.x))); } } @@ -237,7 +237,7 @@ DENG_GUI_PIMPL(PopupMenuWidget) bool hasButtonsWithImages() const { - foreach (Widget *child, self.menu().childWidgets()) + foreach (Widget *child, self().menu().childWidgets()) { if (ButtonWidget *button = child->maybeAs()) { @@ -261,14 +261,14 @@ DENG_GUI_PIMPL(PopupMenuWidget) auto const &padding = rule("popup.menu.paddedmargin"); auto const &none = rule("popup.menu.margin"); - foreach (Widget *child, self.menu().childWidgets()) + foreach (Widget *child, self().menu().childWidgets()) { GuiWidget &widget = child->as(); // Pad annotations with the full amount. if (LabelWidget *label = widget.maybeAs()) { - ui::Item const *item = self.menu().organizer().findItemForWidget(widget); + ui::Item const *item = self().menu().organizer().findItemForWidget(widget); if (item->semantics().testFlag(ui::Item::Annotation)) { if (useExtraPadding) @@ -323,14 +323,14 @@ DENG_GUI_PIMPL(PopupMenuWidget) if (&button == hover && state == ButtonWidget::Up) { hover = 0; - self.requestGeometry(); + self().requestGeometry(); return; } if (state == ButtonWidget::Hover || state == ButtonWidget::Down) { hover = &button; - self.requestGeometry(); + self().requestGeometry(); } } @@ -345,13 +345,13 @@ DENG_GUI_PIMPL(PopupMenuWidget) hi.bottomRight.y = hover->hitRule().bottom().valuei(); } // Clip the highlight to the main popup area. - return hi & self.rule().recti(); + return hi & self().rule().recti(); } void buttonActionTriggered(ButtonWidget &) { // The popup menu is closed when an action is triggered. - self.close(); + self().close(); if (parentPopup) parentPopup->close(); } @@ -359,7 +359,7 @@ DENG_GUI_PIMPL(PopupMenuWidget) void updateIfScrolled() { // If the menu is scrolled, we need to update some things. - int scrollY = self.menu().scrollPositionY().valuei(); + int scrollY = self().menu().scrollPositionY().valuei(); if (scrollY == oldScrollY) { return; @@ -371,7 +371,7 @@ DENG_GUI_PIMPL(PopupMenuWidget) // Resend the mouse position so the buttons realize they've moved. root().dispatchLatestMousePosition(); - self.requestGeometry(); + self().requestGeometry(); } void variableValueChanged(Variable &, Value const &newValue) @@ -379,9 +379,9 @@ DENG_GUI_PIMPL(PopupMenuWidget) bool changed = false; // Update widgets of annotation items. - self.items().forAll([this, &newValue, &changed] (ui::Item const &item) { + self().items().forAll([this, &newValue, &changed] (ui::Item const &item) { if (item.semantics().testFlag(ui::Item::Annotation)) { - self.menu().itemWidget(item).show(newValue.isTrue()); + self().menu().itemWidget(item).show(newValue.isTrue()); changed = true; } return LoopContinue; @@ -389,13 +389,13 @@ DENG_GUI_PIMPL(PopupMenuWidget) if (changed) { - self.menu().updateLayout(); + self().menu().updateLayout(); } } void updateButtonColors() { - for (Widget *w : self.menu().childWidgets()) + for (Widget *w : self().menu().childWidgets()) { if (ButtonWidget *btn = w->maybeAs()) { diff --git a/doomsday/sdk/libappfw/src/widgets/popupwidget.cpp b/doomsday/sdk/libappfw/src/widgets/popupwidget.cpp index e0d373b9d5..d1e638f81e 100644 --- a/doomsday/sdk/libappfw/src/widgets/popupwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/popupwidget.cpp @@ -51,35 +51,35 @@ DENG_GUI_PIMPL(PopupWidget) void flipOpeningDirectionIfNeeded() { - ui::Direction openDir = self.openingDirection(); + ui::Direction openDir = self().openingDirection(); // Opening direction depends on the anchor position: popup will open to // direction that has more space available. switch (openDir) { case ui::Up: - if (anchor.midY().value() < self.root().viewHeight().value()/2) + if (anchor.midY().value() < self().root().viewHeight().value()/2) { openDir = ui::Down; } break; case ui::Down: - if (anchor.midY().value() > self.root().viewHeight().value()/2) + if (anchor.midY().value() > self().root().viewHeight().value()/2) { openDir = ui::Up; } break; case ui::Left: - if (anchor.midX().value() < self.root().viewWidth().value()/2) + if (anchor.midX().value() < self().root().viewWidth().value()/2) { openDir = ui::Right; } break; case ui::Right: - if (anchor.midX().value() > self.root().viewWidth().value()/2) + if (anchor.midX().value() > self().root().viewWidth().value()/2) { openDir = ui::Left; } @@ -89,14 +89,14 @@ DENG_GUI_PIMPL(PopupWidget) break; } - self.setOpeningDirection(openDir); + self().setOpeningDirection(openDir); } typedef Vector2 Vector2R; Vector2R anchorRule() const { - switch (self.openingDirection()) + switch (self().openingDirection()) { case ui::Up: return Vector2R(&anchor.midX(), &anchor.top()); @@ -125,7 +125,7 @@ DENG_GUI_PIMPL(PopupWidget) void updateLayout() { - self.rule() + self().rule() .clearInput(Rule::Left) .clearInput(Rule::Right) .clearInput(Rule::Top) @@ -135,55 +135,55 @@ DENG_GUI_PIMPL(PopupWidget) auto anchorPos = anchorRule(); - switch (self.openingDirection()) + switch (self().openingDirection()) { case ui::Up: - self.rule() + self().rule() .setInput(Rule::Bottom, OperatorRule::maximum( *anchorPos.y - *marker, - self.rule().height())) + self().rule().height())) .setInput(Rule::Left, OperatorRule::clamped( - *anchorPos.x - self.rule().width() / 2, - self.margins().left(), - self.root().viewWidth() - self.rule().width() - self.margins().right())); + *anchorPos.x - self().rule().width() / 2, + self().margins().left(), + self().root().viewWidth() - self().rule().width() - self().margins().right())); break; case ui::Down: - self.rule() + self().rule() .setInput(Rule::Top, OperatorRule::minimum( *anchorPos.y + *marker, - self.root().viewHeight() - self.rule().height() - self.margins().bottom())) + self().root().viewHeight() - self().rule().height() - self().margins().bottom())) .setInput(Rule::Left, OperatorRule::clamped( - *anchorPos.x - self.rule().width() / 2, - self.margins().left(), - self.root().viewWidth() - self.rule().width() - self.margins().right())); + *anchorPos.x - self().rule().width() / 2, + self().margins().left(), + self().root().viewWidth() - self().rule().width() - self().margins().right())); break; case ui::Left: - self.rule() + self().rule() .setInput(Rule::Right, OperatorRule::maximum( *anchorPos.x - *marker, - self.rule().width())) + self().rule().width())) .setInput(Rule::Top, OperatorRule::clamped( - *anchorPos.y - self.rule().height() / 2, - self.margins().top(), - self.root().viewHeight() - self.rule().height() - - self.margins().bottom() + self.margins().top())); + *anchorPos.y - self().rule().height() / 2, + self().margins().top(), + self().root().viewHeight() - self().rule().height() - + self().margins().bottom() + self().margins().top())); break; case ui::Right: - self.rule() + self().rule() .setInput(Rule::Left, OperatorRule::minimum( *anchorPos.x + *marker, - self.root().viewWidth() - self.rule().width() - self.margins().right())) + self().root().viewWidth() - self().rule().width() - self().margins().right())) .setInput(Rule::Top, OperatorRule::clamped( - *anchorPos.y - self.rule().height() / 2, - self.margins().top(), - self.root().viewHeight() - self.rule().height() - self.margins().bottom())); + *anchorPos.y - self().rule().height() / 2, + self().margins().top(), + self().root().viewHeight() - self().rule().height() - self().margins().bottom())); break; case ui::NoDirection: - self.rule().setMidAnchorX(*anchorPos.x) + self().rule().setMidAnchorX(*anchorPos.x) .setMidAnchorY(*anchorPos.y); break; } @@ -192,11 +192,11 @@ DENG_GUI_PIMPL(PopupWidget) void updateStyle() { Style const &st = style(); - bool const opaqueBackground = (self.levelOfNesting() > 0); + bool const opaqueBackground = (self().levelOfNesting() > 0); if (colorTheme == Inverted) { - self.set(self.infoStyleBackground()); + self().set(self().infoStyleBackground()); } else { @@ -206,13 +206,13 @@ DENG_GUI_PIMPL(PopupWidget) st.colors().colorf("glow"), st.rules().rule("glow").valuei()); bg.blur = style().sharedBlurWidget(); - self.set(bg); + self().set(bg); } if (opaqueBackground) { // If nested, use an opaque background. - self.set(self.background().withSolidFillOpacity(1)); + self().set(self().background().withSolidFillOpacity(1)); } } }; diff --git a/doomsday/sdk/libappfw/src/widgets/progresswidget.cpp b/doomsday/sdk/libappfw/src/widgets/progresswidget.cpp index 28c16d4983..8be82c087c 100644 --- a/doomsday/sdk/libappfw/src/widgets/progresswidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/progresswidget.cpp @@ -51,18 +51,18 @@ DENG_GUI_PIMPL(ProgressWidget), public Lockable { if (mini) { - self.setImageColor(Vector4f()); + self().setImageColor(Vector4f()); } else { - self.setImageColor(style().colors().colorf(colorId)); + self().setImageColor(style().colors().colorf(colorId)); } } void useDotStyle() { mini = true; - self.setImage(nullptr); + self().setImage(nullptr); updateStyle(); } @@ -79,7 +79,7 @@ DENG_GUI_PIMPL(ProgressWidget), public Lockable void makeRingGeometry(DefaultVertexBuf::Builder &verts) { ContentLayout layout; - self.contentLayout(layout); + self().contentLayout(layout); // There is a shadow behind the wheel. float gradientThick = layout.image.width() * 2.f; @@ -95,7 +95,7 @@ DENG_GUI_PIMPL(ProgressWidget), public Lockable shadowColor, root().atlas().imageRectf(root().borderGlow()), 0); - self.LabelWidget::glMakeGeometry(verts); + self().LabelWidget::glMakeGeometry(verts); if (pos.done()) { @@ -145,7 +145,7 @@ DENG_GUI_PIMPL(ProgressWidget), public Lockable { Image::Size const dotSize = atlas().imageRect(root().tinyDot()).size(); - Rectanglei rect = self.contentRect().shrunk(dotSize.x / 2); + Rectanglei rect = self().contentRect().shrunk(dotSize.x / 2); int const midY = rect.middle().y; int count = range.size(); Vector4f color = style().colors().colorf(colorId); diff --git a/doomsday/sdk/libappfw/src/widgets/relaywidget.cpp b/doomsday/sdk/libappfw/src/widgets/relaywidget.cpp index 2954d45e7a..3644c724d3 100644 --- a/doomsday/sdk/libappfw/src/widgets/relaywidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/relaywidget.cpp @@ -45,7 +45,7 @@ DENG2_PIMPL(RelayWidget) { DENG2_FOR_PUBLIC_AUDIENCE2(Target, i) { - i->relayTargetBeingDeleted(self); + i->relayTargetBeingDeleted(self()); } target = nullptr; } diff --git a/doomsday/sdk/libappfw/src/widgets/scriptcommandwidget.cpp b/doomsday/sdk/libappfw/src/widgets/scriptcommandwidget.cpp index b6b1b63943..31898b3b35 100644 --- a/doomsday/sdk/libappfw/src/widgets/scriptcommandwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/scriptcommandwidget.cpp @@ -46,7 +46,7 @@ DENG2_PIMPL(ScriptCommandWidget) void appStartupCompleted() { - self.updateCompletion(); + self().updateCompletion(); } void importNativeModules() @@ -84,7 +84,7 @@ DENG2_PIMPL(ScriptCommandWidget) lexi.addTerm(keyword); } - self.setLexicon(lexi); + self().setLexicon(lexi); } bool shouldShowAsPopup(Error const &) diff --git a/doomsday/sdk/libappfw/src/widgets/scrollareawidget.cpp b/doomsday/sdk/libappfw/src/widgets/scrollareawidget.cpp index 69640e0090..cc4a3cad14 100644 --- a/doomsday/sdk/libappfw/src/widgets/scrollareawidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/scrollareawidget.cpp @@ -74,10 +74,10 @@ DENG_GUI_PIMPL(ScrollAreaWidget), public Lockable y = new AnimationRule(0); maxX = new OperatorRule(OperatorRule::Maximum, Const(0), - contentRule.width() - self.rule().width() + self.margins().width()); + contentRule.width() - self().rule().width() + self().margins().width()); maxY = new OperatorRule(OperatorRule::Maximum, Const(0), - contentRule.height() - self.rule().height() + self.margins().height()); + contentRule.height() - self().rule().height() + self().margins().height()); } ~Impl() @@ -117,7 +117,7 @@ DENG_GUI_PIMPL(ScrollAreaWidget), public Lockable void restartScrollOpacityFade() { indicatorAnimating = true; - if (origin == Bottom && self.isAtBottom()) + if (origin == Bottom && self().isAtBottom()) { scrollOpacity.setValue(0, .7f, .2f); } @@ -133,7 +133,7 @@ DENG_GUI_PIMPL(ScrollAreaWidget), public Lockable if (hover != scrollBarHover) { scrollBarHover = hover; - self.requestGeometry(); + self().requestGeometry(); } } @@ -141,17 +141,17 @@ DENG_GUI_PIMPL(ScrollAreaWidget), public Lockable RectanglefPair scrollIndicatorRects(Vector2f const &originPos) const { - Vector2i const viewSize = self.viewportSize(); + Vector2i const viewSize = self().viewportSize(); if (viewSize == Vector2i()) return RectanglefPair(); - auto const &margins = self.margins(); + auto const &margins = self().margins(); int const indHeight = de::clamp( margins.height().valuei(), int(float(viewSize.y * viewSize.y) / float(contentRule.height().value())), viewSize.y / 2); - float indPos = self.scrollPositionY().value() / self.maximumScrollY().value(); + float indPos = self().scrollPositionY().value() / self().maximumScrollY().value(); if (origin == Top) indPos = 1 - indPos; float const avail = viewSize.y - indHeight; diff --git a/doomsday/sdk/libappfw/src/widgets/sliderwidget.cpp b/doomsday/sdk/libappfw/src/widgets/sliderwidget.cpp index 80d4a36a81..a76c85e15f 100644 --- a/doomsday/sdk/libappfw/src/widgets/sliderwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/sliderwidget.cpp @@ -121,7 +121,7 @@ DENG_GUI_PIMPL(SliderWidget) uMvpMatrix("uMvpMatrix", GLUniform::Mat4), uColor ("uColor", GLUniform::Vec4) { - self.setFont("slider.label"); + self().setFont("slider.label"); frameOpacity.setValue(.25f); @@ -137,7 +137,7 @@ DENG_GUI_PIMPL(SliderWidget) for (int i = 0; i < int(NUM_LABELS); ++i) { - labels[i].setFont(i == Value? style().fonts().font("slider.value") : self.font()); + labels[i].setFont(i == Value? style().fonts().font("slider.value") : self().font()); labels[i].setLineWrapWidth(endLabelSize); } } @@ -152,7 +152,7 @@ DENG_GUI_PIMPL(SliderWidget) for (int i = 0; i < int(NUM_LABELS); ++i) { - labels[i].init(atlas(), self.font()); + labels[i].init(atlas(), self().font()); } updateValueLabel(); @@ -171,7 +171,7 @@ DENG_GUI_PIMPL(SliderWidget) /// Determines the total area where the slider is moving. Rectanglei sliderRect() const { - Rectanglei const rect = self.contentRect(); + Rectanglei const rect = self().contentRect(); return Rectanglei(Vector2i(rect.topLeft.x + endLabelSize, rect.topLeft.y), Vector2i(rect.bottomRight.x - endLabelSize, rect.bottomRight.y)); } @@ -190,9 +190,9 @@ DENG_GUI_PIMPL(SliderWidget) void updateGeometry() { Rectanglei rect; - if (self.hasChangedPlace(rect)) + if (self().hasChangedPlace(rect)) { - self.requestGeometry(); + self().requestGeometry(); } // Update texts. @@ -201,17 +201,17 @@ DENG_GUI_PIMPL(SliderWidget) if (labels[i].update()) { //qDebug() << "label" << i << "updated"; - self.requestGeometry(); + self().requestGeometry(); } } - if (!self.geometryRequested()) return; + if (!self().geometryRequested()) return; - Vector4i const margin = self.margins().toVector(); + Vector4i const margin = self().margins().toVector(); rect = rect.adjusted(margin.xy(), -margin.zw()); DefaultVertexBuf::Builder verts; - self.glMakeGeometry(verts); + self().glMakeGeometry(verts); // Determine the area where the slider is moving. Rectanglei sliderArea = sliderRect(); @@ -282,14 +282,14 @@ DENG_GUI_PIMPL(SliderWidget) drawable.buffer() .setVertices(gl::TriangleStrip, verts, animating? gl::Dynamic : gl::Static); - self.requestGeometry(false); + self().requestGeometry(false); } void draw() { updateGeometry(); - uColor = Vector4f(1, 1, 1, self.visibleOpacity()); + uColor = Vector4f(1, 1, 1, self().visibleOpacity()); drawable.draw(); } @@ -321,14 +321,14 @@ DENG_GUI_PIMPL(SliderWidget) break; } - self.requestGeometry(); + self().requestGeometry(); } void updateHover(Vector2i const &pos) { if (state == Grabbed) return; - if (self.hitTest(pos)) + if (self().hitTest(pos)) { if (state == Inert) setState(Hovering); } @@ -372,9 +372,9 @@ DENG_GUI_PIMPL(SliderWidget) animating = true; pos.setValue(float(value), 0.1); - self.requestGeometry(); + self().requestGeometry(); - emit self.valueChanged(v); + emit self().valueChanged(v); } } @@ -404,7 +404,7 @@ DENG_GUI_PIMPL(SliderWidget) ddouble unitsPerPixel = range.size() / (area.width() - endLabelSize); setValue(grabValue + (ev.pos().x - grabFrom.x) * unitsPerPixel); - emit self.valueChangedByUser(value); + emit self().valueChangedByUser(value); } /// Amount to step when clicking a label. @@ -426,7 +426,7 @@ DENG_GUI_PIMPL(SliderWidget) } else { - Rectanglei const rect = self.contentRect(); + Rectanglei const rect = self().contentRect(); //qDebug() << "click step:" << clickStep() << "value:" << value << "range:" // << range.asText() << "new value:" << value - clickStep(); @@ -437,12 +437,12 @@ DENG_GUI_PIMPL(SliderWidget) if (ev.pos().x < rect.left() + endLabelSize) { setValue(value - clickStep()); - emit self.valueChangedByUser(value); + emit self().valueChangedByUser(value); } else if (ev.pos().x > rect.right() - endLabelSize) { setValue(value + clickStep()); - emit self.valueChangedByUser(value); + emit self().valueChangedByUser(value); } } } diff --git a/doomsday/sdk/libappfw/src/widgets/tabwidget.cpp b/doomsday/sdk/libappfw/src/widgets/tabwidget.cpp index 6dbad12835..1b86a832a1 100644 --- a/doomsday/sdk/libappfw/src/widgets/tabwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/tabwidget.cpp @@ -42,7 +42,7 @@ DENG_GUI_PIMPL(TabWidget) Impl(Public *i) : Base(i) { - self.add(buttons = new MenuWidget); + self().add(buttons = new MenuWidget); buttons->enableScrolling(false); buttons->margins().set(""); buttons->setGridSize(0, ui::Expand, 1, ui::Expand, GridLayout::ColumnFirst); @@ -53,12 +53,12 @@ DENG_GUI_PIMPL(TabWidget) // Center the buttons inside the widget. buttons->rule() - .setInput(Rule::AnchorX, self.rule().left() + self.rule().width() / 2) - .setInput(Rule::Top, self.rule().top()) + .setInput(Rule::AnchorX, self().rule().left() + self().rule().width() / 2) + .setInput(Rule::Top, self().rule().top()) .setAnchorPoint(Vector2f(.5f, 0)); // Selection highlight. - self.add(selected = new LabelWidget); + self().add(selected = new LabelWidget); } ~Impl() @@ -82,7 +82,7 @@ DENG_GUI_PIMPL(TabWidget) void buttonPressed(ButtonWidget &button) { - self.setCurrent(buttons->items().find(*buttons->organizer().findItemForWidget(button))); + self().setCurrent(buttons->items().find(*buttons->organizer().findItemForWidget(button))); } void dataItemAdded(ui::Data::Pos, ui::Item const &) @@ -101,7 +101,7 @@ DENG_GUI_PIMPL(TabWidget) { current = pos; updateSelected(); - emit self.currentTabChanged(); + emit self().currentTabChanged(); } } diff --git a/doomsday/sdk/libappfw/src/widgets/togglewidget.cpp b/doomsday/sdk/libappfw/src/widgets/togglewidget.cpp index 70748eea60..45e33b8db9 100644 --- a/doomsday/sdk/libappfw/src/widgets/togglewidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/togglewidget.cpp @@ -117,19 +117,19 @@ DENG2_OBSERVES(ButtonWidget, Press) Impl(Public *i) : Base(i), state(Inactive), - procImage(new ToggleProceduralImage(self)) + procImage(new ToggleProceduralImage(*i)) { - self.setImage(procImage); // base class owns it + self().setImage(procImage); // base class owns it - self.audienceForPress() += this; + self().audienceForPress() += this; } void buttonPressed(ButtonWidget &) { // Toggle the state. - self.setActive(self.isInactive()); + self().setActive(self().isInactive()); - emit self.stateChangedByUser(self.toggleState()); + emit self().stateChangedByUser(self().toggleState()); } DENG2_PIMPL_AUDIENCE(Toggle) diff --git a/doomsday/sdk/libappfw/src/widgets/variablearraywidget.cpp b/doomsday/sdk/libappfw/src/widgets/variablearraywidget.cpp index 55afbe575c..adccc955fc 100644 --- a/doomsday/sdk/libappfw/src/widgets/variablearraywidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/variablearraywidget.cpp @@ -84,7 +84,7 @@ DENG_GUI_PIMPL(VariableArrayWidget) label.setSizePolicy(ui::Expand, ui::Expand); label.setMaximumTextWidth(*maxWidth); widget.margins().setLeftRight("").setTopBottom(RuleBank::UNIT); - widget.addEventHandler(new HoverHandler(self)); + widget.addEventHandler(new HoverHandler(self())); } void widgetUpdatedForItem(GuiWidget &widget, ui::Item const &item) override @@ -102,7 +102,7 @@ DENG_GUI_PIMPL(VariableArrayWidget) { for (Value const *value : array->elements()) { - menu->items() << self.makeItem(*value); + menu->items() << self().makeItem(*value); } } else @@ -110,7 +110,7 @@ DENG_GUI_PIMPL(VariableArrayWidget) String const value = var->value().asText(); if (!value.isEmpty()) { - menu->items() << self.makeItem(var->value()); + menu->items() << self().makeItem(var->value()); } } } @@ -149,7 +149,7 @@ DENG_GUI_PIMPL(VariableArrayWidget) void variableBeingDeleted(Variable &) override { var = nullptr; - self.disable(); + self().disable(); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/variablechoicewidget.cpp b/doomsday/sdk/libappfw/src/widgets/variablechoicewidget.cpp index bbe58f6546..8dea4664b9 100644 --- a/doomsday/sdk/libappfw/src/widgets/variablechoicewidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/variablechoicewidget.cpp @@ -43,11 +43,11 @@ DENG2_OBSERVES(Variable, Change ) if (var->value().is()) { - self.setSelected(self.items().findData(var->value().asText())); + self().setSelected(self().items().findData(var->value().asText())); } else { - self.setSelected(self.items().findData(var->value().asNumber())); + self().setSelected(self().items().findData(var->value().asNumber())); } } @@ -58,11 +58,11 @@ DENG2_OBSERVES(Variable, Change ) var->audienceForChange() -= this; if (var->value().is()) { - var->set(TextValue(self.selectedItem().data().toString())); + var->set(TextValue(self().selectedItem().data().toString())); } else { - var->set(NumberValue(self.selectedItem().data().toDouble())); + var->set(NumberValue(self().selectedItem().data().toDouble())); } var->audienceForChange() += this; } @@ -75,7 +75,7 @@ DENG2_OBSERVES(Variable, Change ) void variableBeingDeleted(Variable &) { var = 0; - self.disable(); + self().disable(); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/variablelineeditwidget.cpp b/doomsday/sdk/libappfw/src/widgets/variablelineeditwidget.cpp index 9b98b03ccb..18b04ceee3 100644 --- a/doomsday/sdk/libappfw/src/widgets/variablelineeditwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/variablelineeditwidget.cpp @@ -40,7 +40,7 @@ DENG2_OBSERVES(Variable, Change ) { if (!var) return; - self.setText(var->value()); + self().setText(var->value()); } void setVariableFromWidget() @@ -48,7 +48,7 @@ DENG2_OBSERVES(Variable, Change ) if (!var) return; var->audienceForChange() -= this; - var->set(TextValue(self.text())); + var->set(TextValue(self().text())); var->audienceForChange() += this; } @@ -60,7 +60,7 @@ DENG2_OBSERVES(Variable, Change ) void variableBeingDeleted(Variable &) { var = 0; - self.disable(); + self().disable(); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/variablesliderwidget.cpp b/doomsday/sdk/libappfw/src/widgets/variablesliderwidget.cpp index bae9bbd883..438a4c03d9 100644 --- a/doomsday/sdk/libappfw/src/widgets/variablesliderwidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/variablesliderwidget.cpp @@ -39,7 +39,7 @@ DENG2_PIMPL(VariableSliderWidget) void init() { - self.updateFromVariable(); + self().updateFromVariable(); QObject::connect(thisPublic, SIGNAL(valueChangedByUser(double)), thisPublic, SLOT(setVariableFromWidget())); } @@ -51,11 +51,11 @@ DENG2_PIMPL(VariableSliderWidget) switch (valueType) { case VariableSliderWidget::Number: - self.setValue(var->value().asNumber()); + self().setValue(var->value().asNumber()); break; case VariableSliderWidget::Animation: - self.setValue(var->value().nativeObject()->target()); + self().setValue(var->value().nativeObject()->target()); break; } } @@ -68,11 +68,11 @@ DENG2_PIMPL(VariableSliderWidget) switch (valueType) { case VariableSliderWidget::Number: - var->set(NumberValue(self.value())); + var->set(NumberValue(self().value())); break; case VariableSliderWidget::Animation: - var->value().nativeObject()->setValue(float(self.value())); + var->value().nativeObject()->setValue(float(self().value())); break; } var->audienceForChange() += this; @@ -86,7 +86,7 @@ DENG2_PIMPL(VariableSliderWidget) void variableBeingDeleted(Variable &) { var = 0; - self.disable(); + self().disable(); } }; diff --git a/doomsday/sdk/libappfw/src/widgets/variabletogglewidget.cpp b/doomsday/sdk/libappfw/src/widgets/variabletogglewidget.cpp index e88e3d66fd..21fe8b2b64 100644 --- a/doomsday/sdk/libappfw/src/widgets/variabletogglewidget.cpp +++ b/doomsday/sdk/libappfw/src/widgets/variabletogglewidget.cpp @@ -39,7 +39,7 @@ DENG2_OBSERVES(ToggleWidget, Toggle ) { updateFromVariable(); - self.audienceForToggle() += this; + self().audienceForToggle() += this; var->audienceForDeletion() += this; var->audienceForChange() += this; } @@ -48,7 +48,7 @@ DENG2_OBSERVES(ToggleWidget, Toggle ) { if (!var) return; - self.setToggleState(!var->value().compare(activeValue)? Active : Inactive, + self().setToggleState(!var->value().compare(activeValue)? Active : Inactive, false /*don't notify*/); } @@ -57,7 +57,7 @@ DENG2_OBSERVES(ToggleWidget, Toggle ) if (!var) return; var->audienceForChange() -= this; - var->set(self.isActive()? activeValue : inactiveValue); + var->set(self().isActive()? activeValue : inactiveValue); var->audienceForChange() += this; } @@ -74,7 +74,7 @@ DENG2_OBSERVES(ToggleWidget, Toggle ) void variableBeingDeleted(Variable &) { var = 0; - self.disable(); + self().disable(); } }; diff --git a/doomsday/sdk/libappfw/src/windowsystem.cpp b/doomsday/sdk/libappfw/src/windowsystem.cpp index 447bc2112b..dac15d5e32 100644 --- a/doomsday/sdk/libappfw/src/windowsystem.cpp +++ b/doomsday/sdk/libappfw/src/windowsystem.cpp @@ -43,7 +43,7 @@ DENG2_PIMPL(WindowSystem) ~Impl() { - self.closeAll(); + self().closeAll(); } void setStyle(Style *s) @@ -54,7 +54,7 @@ DENG2_PIMPL(WindowSystem) void processLatestMousePosition() { - self.rootProcessEvent(MouseEvent(MouseEvent::Absolute, latestMousePos)); + self().rootProcessEvent(MouseEvent(MouseEvent::Absolute, latestMousePos)); } void processLatestMousePositionIfMoved() diff --git a/doomsday/sdk/libcore/include/de/data/observers.h b/doomsday/sdk/libcore/include/de/data/observers.h index 3e3f6815df..fe0d03b2e9 100644 --- a/doomsday/sdk/libcore/include/de/data/observers.h +++ b/doomsday/sdk/libcore/include/de/data/observers.h @@ -138,10 +138,10 @@ * @param Var Variable used in the loop. */ #define DENG2_FOR_PUBLIC_AUDIENCE(Name, Var) \ - DENG2_FOR_EACH_OBSERVER(Name##Audience, Var, self.audienceFor##Name) + DENG2_FOR_EACH_OBSERVER(Name##Audience, Var, self().audienceFor##Name) #define DENG2_FOR_PUBLIC_AUDIENCE2(Name, Var) \ - DENG2_FOR_EACH_OBSERVER(Name##Audience, Var, self.audienceFor##Name()) + DENG2_FOR_EACH_OBSERVER(Name##Audience, Var, self().audienceFor##Name()) namespace de { diff --git a/doomsday/sdk/libcore/src/concurrency/taskpool.cpp b/doomsday/sdk/libcore/src/concurrency/taskpool.cpp index 1d0fea8bdb..a61441b1f7 100644 --- a/doomsday/sdk/libcore/src/concurrency/taskpool.cpp +++ b/doomsday/sdk/libcore/src/concurrency/taskpool.cpp @@ -117,8 +117,8 @@ DENG2_PIMPL(TaskPool), public Lockable, public Waitable, public TaskPool::IPool { try { - emit self.allTasksDone(); - DENG2_FOR_AUDIENCE(Done, i) i->taskPoolDone(self); + emit self().allTasksDone(); + DENG2_FOR_AUDIENCE(Done, i) i->taskPoolDone(self()); } catch (Error const &er) { diff --git a/doomsday/sdk/libcore/src/core/app.cpp b/doomsday/sdk/libcore/src/core/app.cpp index 0a1eef0685..9ad7f3c7ab 100644 --- a/doomsday/sdk/libcore/src/core/app.cpp +++ b/doomsday/sdk/libcore/src/core/app.cpp @@ -165,7 +165,7 @@ DENG2_PIMPL(App) NativePath appDir = appPath.fileNamePath(); return appDir / "..\\modules"; #else - return self.nativeBasePath() / "modules"; + return self().nativeBasePath() / "modules"; #endif } @@ -178,12 +178,12 @@ DENG2_PIMPL(App) // directories into the appropriate places in the file system. // All of these are in read-only mode. - if (ZipArchive::recognize(self.nativeBasePath())) + if (ZipArchive::recognize(self().nativeBasePath())) { // As a special case, if the base path points to a resource pack, // use the contents of the pack as the root of the file system. // The pack itself does not appear in the file system. - basePackFile.reset(NativeFile::newStandalone(self.nativeBasePath())); + basePackFile.reset(NativeFile::newStandalone(self().nativeBasePath())); fs.root().attach(new ArchiveFeed(*basePackFile)); } else @@ -191,19 +191,19 @@ DENG2_PIMPL(App) #ifdef MACOSX NativePath appDir = appPath.fileNamePath(); binFolder.attach(new DirectoryFeed(appDir)); - fs.makeFolder("/data").attach(new DirectoryFeed(self.nativeBasePath())); + fs.makeFolder("/data").attach(new DirectoryFeed(self().nativeBasePath())); #elif WIN32 NativePath appDir = appPath.fileNamePath(); fs.makeFolder("/data").attach(new DirectoryFeed(appDir / "..\\data")); #else // UNIX - if ((self.nativeBasePath() / "data").exists()) + if ((self().nativeBasePath() / "data").exists()) { - fs.makeFolder("/data").attach(new DirectoryFeed(self.nativeBasePath() / "data")); + fs.makeFolder("/data").attach(new DirectoryFeed(self().nativeBasePath() / "data")); } else { - fs.makeFolder("/data").attach(new DirectoryFeed(self.nativeBasePath())); + fs.makeFolder("/data").attach(new DirectoryFeed(self().nativeBasePath())); } #endif if (defaultNativeModulePath().exists()) @@ -214,11 +214,11 @@ DENG2_PIMPL(App) if (allowPlugins) { - binFolder.attach(new DirectoryFeed(self.nativePluginBinaryPath())); + binFolder.attach(new DirectoryFeed(self().nativePluginBinaryPath())); } // User's home folder. - fs.makeFolder("/home", FS::DontInheritFeeds).attach(new DirectoryFeed(self.nativeHomePath(), + fs.makeFolder("/home", FS::DontInheritFeeds).attach(new DirectoryFeed(self().nativeHomePath(), DirectoryFeed::AllowWrite | DirectoryFeed::CreateIfMissing | DirectoryFeed::DefaultFlags)); // Loaded packages (as links). @@ -286,7 +286,7 @@ DENG2_PIMPL(App) { if (CommandLine::ArgWithParams arg = cmdLine.check("-errors", 1)) { - File &errors = self.rootFolder().replaceFile(Path("/home") / arg.params.at(0)); + File &errors = self().rootFolder().replaceFile(Path("/home") / arg.params.at(0)); errorSink.reset(new FileLogSink(errors)); errorSink->setMode(LogSink::OnlyWarningEntries); logBuffer.addSink(*errorSink); diff --git a/doomsday/sdk/libcore/src/core/logbuffer.cpp b/doomsday/sdk/libcore/src/core/logbuffer.cpp index 2e832ce200..de1062276c 100644 --- a/doomsday/sdk/libcore/src/core/logbuffer.cpp +++ b/doomsday/sdk/libcore/src/core/logbuffer.cpp @@ -123,7 +123,7 @@ DENG2_PIMPL(LogBuffer) DENG2_ASSERT(outputFile == &file); DENG2_UNUSED(file); - self.flush(); + self().flush(); disposeFileLogSink(); outputFile = 0; } diff --git a/doomsday/sdk/libcore/src/core/textapp.cpp b/doomsday/sdk/libcore/src/core/textapp.cpp index 922f3eeaa3..b9ea016aad 100644 --- a/doomsday/sdk/libcore/src/core/textapp.cpp +++ b/doomsday/sdk/libcore/src/core/textapp.cpp @@ -30,7 +30,7 @@ DENG2_PIMPL(TextApp) Impl(Public *i) : Base(i) { - loop.audienceForIteration() += self; + loop.audienceForIteration() += self(); // In text-based apps, we can limit the loop frequency. loop.setRate(35); diff --git a/doomsday/sdk/libcore/src/data/archive.cpp b/doomsday/sdk/libcore/src/data/archive.cpp index b2d99a4b5b..60a2e2d79a 100644 --- a/doomsday/sdk/libcore/src/data/archive.cpp +++ b/doomsday/sdk/libcore/src/data/archive.cpp @@ -58,7 +58,7 @@ DENG2_PIMPL(Archive) return; } - self.readFromSource(entry, path, deserializedData); + self().readFromSource(entry, path, deserializedData); } }; diff --git a/doomsday/sdk/libcore/src/data/bank.cpp b/doomsday/sdk/libcore/src/data/bank.cpp index abea95ed24..973e2afbe8 100644 --- a/doomsday/sdk/libcore/src/data/bank.cpp +++ b/doomsday/sdk/libcore/src/data/bank.cpp @@ -655,7 +655,7 @@ DENG2_PIMPL(Bank) void load(Path const &path, Importance importance) { - beginJob(new Job(self, Job::Load, path), importance); + beginJob(new Job(self(), Job::Load, path), importance); } void unload(Path const &path, CacheLevel toLevel, Importance importance) @@ -664,7 +664,7 @@ DENG2_PIMPL(Bank) { Job::Task const task = (toLevel == InHotStorage && serialCache? Job::Serialize : Job::Unload); - beginJob(new Job(self, task, path), importance); + beginJob(new Job(self(), task, path), importance); } } diff --git a/doomsday/sdk/libcore/src/data/info.cpp b/doomsday/sdk/libcore/src/data/info.cpp index be56c7373d..26a4ef7c21 100644 --- a/doomsday/sdk/libcore/src/data/info.cpp +++ b/doomsday/sdk/libcore/src/data/info.cpp @@ -543,7 +543,7 @@ DENG2_PIMPL(Info) blockType = implicitBlockType; } - block.reset(new BlockElement(blockType, blockName, self)); + block.reset(new BlockElement(blockType, blockName, self())); startLine = currentLine; // How about some attributes? @@ -615,7 +615,7 @@ DENG2_PIMPL(Info) DENG2_ASSERT(finder != 0); String includePath; - String content = finder->findIncludedInfoSource(includeName, self, &includePath); + String content = finder->findIncludedInfoSource(includeName, self(), &includePath); Info included; included.setImplicitBlockType(implicitBlockType); diff --git a/doomsday/sdk/libcore/src/data/infobank.cpp b/doomsday/sdk/libcore/src/data/infobank.cpp index 7abae2216c..86236342a6 100644 --- a/doomsday/sdk/libcore/src/data/infobank.cpp +++ b/doomsday/sdk/libcore/src/data/infobank.cpp @@ -70,7 +70,7 @@ DENG2_PIMPL(InfoBank) << fullIdentifier << ScriptedInfo::sourceLocation(sub); - self.remove(fullIdentifier); + self().remove(fullIdentifier); delete group.remove(name); } return LoopContinue; diff --git a/doomsday/sdk/libcore/src/data/profiles.cpp b/doomsday/sdk/libcore/src/data/profiles.cpp index f66eaf54d3..d608b46060 100644 --- a/doomsday/sdk/libcore/src/data/profiles.cpp +++ b/doomsday/sdk/libcore/src/data/profiles.cpp @@ -143,7 +143,7 @@ DENG2_PIMPL(Profiles) LOG_VERBOSE("Reading profile '%s'") << profileName; - auto *prof = self.profileFromInfoBlock(profBlock); + auto *prof = self().profileFromInfoBlock(profBlock); prof->setName(profileName); prof->setReadOnly(markReadOnly); add(prof); @@ -342,7 +342,7 @@ DENG2_PIMPL(Profiles::AbstractProfile) { if (owner) { - owner->remove(self); + owner->remove(self()); } } }; diff --git a/doomsday/sdk/libcore/src/data/record.cpp b/doomsday/sdk/libcore/src/data/record.cpp index 33ff56f51e..4249852717 100644 --- a/doomsday/sdk/libcore/src/data/record.cpp +++ b/doomsday/sdk/libcore/src/data/record.cpp @@ -102,7 +102,7 @@ DENG2_PIMPL(Record) continue; } - DENG2_FOR_PUBLIC_AUDIENCE2(Removal, o) o->recordMemberRemoved(self, **i); + DENG2_FOR_PUBLIC_AUDIENCE2(Removal, o) o->recordMemberRemoved(self(), **i); i.value()->audienceForDeletion() -= this; delete i.value(); @@ -130,7 +130,7 @@ DENG2_PIMPL(Record) if (!alreadyExists) { // Notify about newly added members. - DENG2_FOR_PUBLIC_AUDIENCE2(Addition, i) i->recordMemberAdded(self, *var); + DENG2_FOR_PUBLIC_AUDIENCE2(Addition, i) i->recordMemberAdded(self(), *var); } /// @todo Should also notify if the value of an existing variable changes. -jk @@ -196,8 +196,8 @@ DENG2_PIMPL(Record) String subName = name.substr(0, pos); String remaining = name.substr(pos + 1); // If it is a subrecord we can descend into it. - if (!self.hasRecord(subName)) return 0; - return self[subName].value().dereference().d->findMemberByPath(remaining); + if (!self().hasRecord(subName)) return 0; + return self()[subName].value().dereference().d->findMemberByPath(remaining); } DENG2_GUARD(this); @@ -230,19 +230,19 @@ DENG2_PIMPL(Record) String remaining = pathOrName.substr(pos + 1); Record *rec = 0; - if (!self.hasSubrecord(subName)) + if (!self().hasSubrecord(subName)) { // Create it now. - rec = &self.addSubrecord(subName); + rec = &self().addSubrecord(subName); } else { - rec = &self.subrecord(subName); + rec = &self().subrecord(subName); } return rec->d->parentRecordByPath(remaining); } - return self; + return self(); } // Observes Variable deletion. @@ -250,7 +250,7 @@ DENG2_PIMPL(Record) { DENG2_ASSERT(findMemberByPath(variable.name())); - LOG_TRACE_DEBUGONLY("Variable %p deleted, removing from Record %p", &variable << &self); + LOG_TRACE_DEBUGONLY("Variable %p deleted, removing from Record %p", &variable << thisPublic); // Remove from our index. DENG2_GUARD(this); diff --git a/doomsday/sdk/libcore/src/filesys/archivefeed.cpp b/doomsday/sdk/libcore/src/filesys/archivefeed.cpp index 84f37fa7c5..783dad2654 100644 --- a/doomsday/sdk/libcore/src/filesys/archivefeed.cpp +++ b/doomsday/sdk/libcore/src/filesys/archivefeed.cpp @@ -181,7 +181,7 @@ DENG2_PIMPL(ArchiveFeed) //folder.add(f); // We will decide on pruning this. - f->setOriginFeed(&self); + f->setOriginFeed(thisPublic); // Include the file in the main index. //folder.fileSystem().index(*f); diff --git a/doomsday/sdk/libcore/src/filesys/folder.cpp b/doomsday/sdk/libcore/src/filesys/folder.cpp index 9f842e804c..9531273ed6 100644 --- a/doomsday/sdk/libcore/src/filesys/folder.cpp +++ b/doomsday/sdk/libcore/src/filesys/folder.cpp @@ -60,7 +60,7 @@ DENG2_PIMPL(Folder), public Lockable void add(File *file) { contents.insert(file->name().toLower(), file); - file->setParent(&self); + file->setParent(thisPublic); } QList subfolders() const diff --git a/doomsday/sdk/libcore/src/filesys/nativefile.cpp b/doomsday/sdk/libcore/src/filesys/nativefile.cpp index 35d05ad30b..fd87e58573 100644 --- a/doomsday/sdk/libcore/src/filesys/nativefile.cpp +++ b/doomsday/sdk/libcore/src/filesys/nativefile.cpp @@ -74,10 +74,10 @@ DENG2_PIMPL(NativeFile) if (!out) { // Are we allowed to output? - self.verifyWriteAccess(); + self().verifyWriteAccess(); QFile::OpenMode fileMode = QFile::ReadWrite; - if (self.mode() & Truncate) + if (self().mode() & Truncate) { if (needTruncation) { @@ -93,12 +93,12 @@ DENG2_PIMPL(NativeFile) /// @throw OutputError Opening the output stream failed. throw OutputError("NativeFile::output", "Failed to write " + nativePath); } - if (self.mode() & Truncate) + if (self().mode() & Truncate) { - Status st = self.status(); + Status st = self().status(); st.size = 0; st.modifiedAt = Time(); - self.setStatus(st); + self().setStatus(st); } } return *out; diff --git a/doomsday/sdk/libcore/src/filesys/package.cpp b/doomsday/sdk/libcore/src/filesys/package.cpp index 9f71745b39..7fc9024515 100644 --- a/doomsday/sdk/libcore/src/filesys/package.cpp +++ b/doomsday/sdk/libcore/src/filesys/package.cpp @@ -89,16 +89,16 @@ DENG2_PIMPL(Package) StringList importPaths() const { StringList paths; - if (self.objectNamespace().has(PACKAGE_IMPORT_PATH)) + if (self().objectNamespace().has(PACKAGE_IMPORT_PATH)) { - ArrayValue const &imp = self.objectNamespace().geta(PACKAGE_IMPORT_PATH); + ArrayValue const &imp = self().objectNamespace().geta(PACKAGE_IMPORT_PATH); DENG2_FOR_EACH_CONST(ArrayValue::Elements, i, imp.elements()) { Path importPath = (*i)->asText(); if (!importPath.isAbsolute()) { // Relative to the package root, and must exist. - importPath = self.root().locate(importPath).path(); + importPath = self().root().locate(importPath).path(); } paths << importPath; } @@ -108,7 +108,7 @@ DENG2_PIMPL(Package) Record &packageInfo() { - return self.objectNamespace().subrecord(VAR_PACKAGE); + return self().objectNamespace().subrecord(VAR_PACKAGE); } }; diff --git a/doomsday/sdk/libcore/src/filesys/packageloader.cpp b/doomsday/sdk/libcore/src/filesys/packageloader.cpp index bfecfc8634..d6ada8a095 100644 --- a/doomsday/sdk/libcore/src/filesys/packageloader.cpp +++ b/doomsday/sdk/libcore/src/filesys/packageloader.cpp @@ -293,9 +293,9 @@ DENG2_PIMPL(PackageLoader) { for (String const &reqId : Package::requires(packageFile)) { - if (!self.isLoaded(reqId)) + if (!self().isLoaded(reqId)) { - self.load(reqId); + self().load(reqId); } } } @@ -349,9 +349,9 @@ DENG2_PIMPL(PackageLoader) { forOptionalContent(packageFile, [this] (String const &pkgId) { - if (!self.isLoaded(pkgId)) + if (!self().isLoaded(pkgId)) { - self.load(pkgId); + self().load(pkgId); } }); } diff --git a/doomsday/sdk/libcore/src/scriptsys/context.cpp b/doomsday/sdk/libcore/src/scriptsys/context.cpp index 96d38f5852..925cd5debc 100644 --- a/doomsday/sdk/libcore/src/scriptsys/context.cpp +++ b/doomsday/sdk/libcore/src/scriptsys/context.cpp @@ -92,7 +92,7 @@ DENG2_PIMPL(Context) : Base(i) , type(type) , owner(owner) - , evaluator(self) + , evaluator(*i) , ownsNamespace(false) , names(globals) { @@ -111,7 +111,7 @@ DENG2_PIMPL(Context) { delete names; } - self.reset(); + self().reset(); } /// Returns the topmost control flow information. diff --git a/doomsday/sdk/libcore/src/scriptsys/evaluator.cpp b/doomsday/sdk/libcore/src/scriptsys/evaluator.cpp index 0fb83731b9..00dbf76aa0 100644 --- a/doomsday/sdk/libcore/src/scriptsys/evaluator.cpp +++ b/doomsday/sdk/libcore/src/scriptsys/evaluator.cpp @@ -136,7 +136,7 @@ DENG2_PIMPL(Evaluator) // Begin a new evaluation operation. current = expression; - expression->push(self); + expression->push(self()); // Clear the result stack. clearResults(); @@ -149,16 +149,16 @@ DENG2_PIMPL(Evaluator) names = top.names(); /*qDebug() << "Evaluator: Evaluating latest scoped expression" << top.expression << "in" << (top.scope? names->asText() : "null scope");*/ - pushResult(top.expression->evaluate(self), top.scope); + pushResult(top.expression->evaluate(self()), top.scope); } // During function call evaluation the process's context changes. We should // now be back at the level we started from. - DENG2_ASSERT(&self.process().context() == &context); + DENG2_ASSERT(&self().process().context() == &context); // Exactly one value should remain in the result stack: the result of the // evaluated expression. - DENG2_ASSERT(self.hasResult()); + DENG2_ASSERT(self().hasResult()); clearNames(); current = NULL; diff --git a/doomsday/sdk/libcore/src/scriptsys/process.cpp b/doomsday/sdk/libcore/src/scriptsys/process.cpp index e5942946f4..fdc9e59381 100644 --- a/doomsday/sdk/libcore/src/scriptsys/process.cpp +++ b/doomsday/sdk/libcore/src/scriptsys/process.cpp @@ -65,7 +65,7 @@ DENG2_PIMPL(Process) state = Stopped; clearStack(); - self.pushContext(new Context(Context::BaseProcess, thisPublic, externalGlobals)); + self().pushContext(new Context(Context::BaseProcess, thisPublic, externalGlobals)); workingPath = "/"; } diff --git a/doomsday/sdk/libcore/src/widgets/widget.cpp b/doomsday/sdk/libcore/src/widgets/widget.cpp index 4fcb316938..593f6adb76 100644 --- a/doomsday/sdk/libcore/src/widgets/widget.cpp +++ b/doomsday/sdk/libcore/src/widgets/widget.cpp @@ -90,24 +90,24 @@ DENG2_PIMPL(Widget) #ifdef _DEBUG // Can't have double ownership. - if (self.parent()) + if (self().parent()) { - if (self.parent()->hasRoot()) + if (self().parent()->hasRoot()) { - DENG2_ASSERT(!self.parent()->root().isInTree(*child)); + DENG2_ASSERT(!self().parent()->root().isInTree(*child)); } else { - DENG2_ASSERT(!self.parent()->isInTree(*child)); + DENG2_ASSERT(!self().parent()->isInTree(*child)); } } else { - DENG2_ASSERT(!self.isInTree(*child)); + DENG2_ASSERT(!self().isInTree(*child)); } #endif - child->d->parent = &self; + child->d->parent = thisPublic; switch (behavior) { @@ -137,7 +137,7 @@ DENG2_PIMPL(Widget) } DENG2_FOR_EACH_OBSERVER(ParentChangeAudience, i, child->audienceForParentChange()) { - i->widgetParentChanged(*child, 0, &self); + i->widgetParentChanged(*child, 0, thisPublic); } } @@ -175,7 +175,7 @@ DENG2_PIMPL(Widget) // previous parent. return nullptr; } - if (dir == Backward && func(self)) + if (dir == Backward && func(self())) { return thisPublic; } diff --git a/doomsday/sdk/libgui/src/audio/sound.cpp b/doomsday/sdk/libgui/src/audio/sound.cpp index caf1e533e2..70eee0faac 100644 --- a/doomsday/sdk/libgui/src/audio/sound.cpp +++ b/doomsday/sdk/libgui/src/audio/sound.cpp @@ -45,9 +45,9 @@ DENG2_PIMPL(Sound) { DENG2_FOR_PUBLIC_AUDIENCE2(Change, i) { - i->soundPropertyChanged(self); + i->soundPropertyChanged(self()); } - self.update(); + self().update(); } DENG2_PIMPL_AUDIENCE(Play) diff --git a/doomsday/sdk/libgui/src/glwindow.cpp b/doomsday/sdk/libgui/src/glwindow.cpp index 1f7b02a23b..7978085f55 100644 --- a/doomsday/sdk/libgui/src/glwindow.cpp +++ b/doomsday/sdk/libgui/src/glwindow.cpp @@ -60,9 +60,9 @@ DENG2_PIMPL(GLWindow) ~Impl() { - self.makeCurrent(); + self().makeCurrent(); glDeinit(); - self.doneCurrent(); + self().doneCurrent(); if (thisPublic == mainWindow) { @@ -74,12 +74,12 @@ DENG2_PIMPL(GLWindow) void glInit() { GLInfo::glInit(); - self.setState(Ready); + self().setState(Ready); } void glDeinit() { - self.setState(NotReady); + self().setState(NotReady); readyNotified = false; readyPending = false; if (timerQuery) @@ -98,12 +98,12 @@ DENG2_PIMPL(GLWindow) readyPending = false; - self.makeCurrent(); + self().makeCurrent(); DENG2_ASSERT(QOpenGLContext::currentContext() != nullptr); // Print some information. - QSurfaceFormat const fmt = self.format(); + QSurfaceFormat const fmt = self().format(); LOG_GL_NOTE("OpenGL %i.%i supported%s") << fmt.majorVersion() << fmt.minorVersion() @@ -112,14 +112,14 @@ DENG2_PIMPL(GLWindow) : " (Core)") : ""); // Everybody can perform GL init now. - DENG2_FOR_PUBLIC_AUDIENCE2(Init, i) i->windowInit(self); + DENG2_FOR_PUBLIC_AUDIENCE2(Init, i) i->windowInit(self()); readyNotified = true; - self.doneCurrent(); + self().doneCurrent(); // Now we can paint. - mainCall.enqueue([this] () { self.update(); }); + mainCall.enqueue([this] () { self().update(); }); } bool timerQueryReady() const diff --git a/doomsday/sdk/libgui/src/graphics/atlas.cpp b/doomsday/sdk/libgui/src/graphics/atlas.cpp index 0178316e84..3623ee6d03 100644 --- a/doomsday/sdk/libgui/src/graphics/atlas.cpp +++ b/doomsday/sdk/libgui/src/graphics/atlas.cpp @@ -60,7 +60,7 @@ DENG2_PIMPL(Atlas) ~Impl() { allocator.reset(); - self.cancelDeferred(); + self().cancelDeferred(); } inline bool usingDeferredMode() const @@ -203,11 +203,11 @@ DENG2_PIMPL(Atlas) painter.drawImage(0, h - 1, srcImg, 0, sh - 1, 1, 1); painter.drawImage(w - 1, h - 1, srcImg, sw - 1, sh - 1, 1, 1); - self.commit(bordered, rect.topLeft); + self().commit(bordered, rect.topLeft); } else { - self.commit(image, noBorders.topLeft); + self().commit(image, noBorders.topLeft); } } } @@ -265,7 +265,7 @@ DENG2_PIMPL(Atlas) DENG2_FOR_PUBLIC_AUDIENCE2(Reposition, i) { - i->atlasContentRepositioned(self); + i->atlasContentRepositioned(self()); } } diff --git a/doomsday/sdk/libgui/src/graphics/drawable.cpp b/doomsday/sdk/libgui/src/graphics/drawable.cpp index 51504109bd..88713e093f 100644 --- a/doomsday/sdk/libgui/src/graphics/drawable.cpp +++ b/doomsday/sdk/libgui/src/graphics/drawable.cpp @@ -49,7 +49,7 @@ DENG2_PIMPL(Drawable) Impl(Public *i) : Base(i) { - self += defaultProgram; + self() += defaultProgram; } ~Impl() diff --git a/doomsday/sdk/libgui/src/graphics/glframebuffer.cpp b/doomsday/sdk/libgui/src/graphics/glframebuffer.cpp index ab70e73696..d7a3d8a5f5 100644 --- a/doomsday/sdk/libgui/src/graphics/glframebuffer.cpp +++ b/doomsday/sdk/libgui/src/graphics/glframebuffer.cpp @@ -323,7 +323,7 @@ DENG2_OBSERVES(Asset, Deletion) void release() { - self.setState(NotReady); + self().setState(NotReady); if (fbo) { releaseRenderBuffers(); @@ -363,7 +363,7 @@ DENG2_OBSERVES(Asset, Deletion) void replace(GLenum attachment, GLTexture &newTexture) { - DENG2_ASSERT(self.isReady()); // must already be inited + DENG2_ASSERT(self().isReady()); // must already be inited DENG2_ASSERT(bufTextures[attachmentToId(attachment)] != 0); // must have an attachment already GLInfo::EXT_framebuffer_object()->glBindFramebufferEXT(GL_FRAMEBUFFER, fbo); @@ -374,7 +374,7 @@ DENG2_OBSERVES(Asset, Deletion) void replaceWithNewRenderBuffer(Flags const &attachment) { - DENG2_ASSERT(self.isReady()); // must already be inited + DENG2_ASSERT(self().isReady()); // must already be inited if (attachment == DepthStencil) // this supported only { GLInfo::EXT_framebuffer_object()->glBindFramebufferEXT(GL_FRAMEBUFFER, fbo); @@ -387,7 +387,7 @@ DENG2_OBSERVES(Asset, Deletion) void replaceWithExistingRenderBuffer(Flags const &attachment, GLuint renderBufId) { - DENG2_ASSERT(self.isReady()); // must already be inited + DENG2_ASSERT(self().isReady()); // must already be inited auto id = flagsToAttachmentId(attachment); @@ -408,7 +408,7 @@ DENG2_OBSERVES(Asset, Deletion) { if (isDefault()) { - self.setState(Ready); + self().setState(Ready); return; } @@ -427,7 +427,7 @@ DENG2_OBSERVES(Asset, Deletion) status == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT? "No images attached" : QString("Unsupported (0x%1)").arg(status, 0, 16)); } - self.setState(Ready); + self().setState(Ready); GLState::current().target().glBind(); LIBGUI_ASSERT_GL_OK(); diff --git a/doomsday/sdk/libgui/src/graphics/glprogram.cpp b/doomsday/sdk/libgui/src/graphics/glprogram.cpp index fd0af55b01..75cdb09e37 100644 --- a/doomsday/sdk/libgui/src/graphics/glprogram.cpp +++ b/doomsday/sdk/libgui/src/graphics/glprogram.cpp @@ -89,7 +89,7 @@ DENG2_PIMPL(GLProgram) void releaseButRetainBindings() { - self.setState(NotReady); + self().setState(NotReady); detachAllShaders(); if (name) { @@ -239,7 +239,7 @@ DENG2_PIMPL(GLProgram) DENG2_ASSERT(active.contains(changed)); if (!u->isSampler()) { - u->applyInProgram(self); + u->applyInProgram(self()); } } @@ -248,7 +248,7 @@ DENG2_PIMPL(GLProgram) // Update the sampler uniforms. for (int unit = 0; unit < textures.size(); ++unit) { - int loc = self.glUniformLocation(textures[unit]->name()); + int loc = self().glUniformLocation(textures[unit]->name()); if (loc >= 0) { LIBGUI_GL.glUniform1i(loc, unit); @@ -304,7 +304,7 @@ DENG2_PIMPL(GLProgram) void uniformDeleted(GLUniform &uniform) { - self.unbind(uniform); + self().unbind(uniform); } void addBinding(GLUniform const *uniform) diff --git a/doomsday/sdk/libgui/src/graphics/glshader.cpp b/doomsday/sdk/libgui/src/graphics/glshader.cpp index c2b15ab1f7..ae82f1ef1f 100644 --- a/doomsday/sdk/libgui/src/graphics/glshader.cpp +++ b/doomsday/sdk/libgui/src/graphics/glshader.cpp @@ -59,7 +59,7 @@ DENG2_PIMPL(GLShader) LIBGUI_GL.glDeleteShader(name); name = 0; } - self.setState(Asset::NotReady); + self().setState(Asset::NotReady); } }; diff --git a/doomsday/sdk/libgui/src/graphics/glstate.cpp b/doomsday/sdk/libgui/src/graphics/glstate.cpp index 2740b8c009..5e13a5315f 100644 --- a/doomsday/sdk/libgui/src/graphics/glstate.cpp +++ b/doomsday/sdk/libgui/src/graphics/glstate.cpp @@ -207,7 +207,7 @@ DENG2_PIMPL(GLState) switch (prop) { case internal::CullMode: - switch (self.cull()) + switch (self().cull()) { case gl::None: LIBGUI_GL.glDisable(GL_CULL_FACE); @@ -224,36 +224,36 @@ DENG2_PIMPL(GLState) break; case internal::DepthTest: - if (self.depthTest()) + if (self().depthTest()) LIBGUI_GL.glEnable(GL_DEPTH_TEST); else LIBGUI_GL.glDisable(GL_DEPTH_TEST); break; case internal::DepthFunc: - LIBGUI_GL.glDepthFunc(glComp(self.depthFunc())); + LIBGUI_GL.glDepthFunc(glComp(self().depthFunc())); break; case internal::DepthWrite: - if (self.depthWrite()) + if (self().depthWrite()) LIBGUI_GL.glDepthMask(GL_TRUE); else LIBGUI_GL.glDepthMask(GL_FALSE); break; case internal::AlphaTest: - if (self.alphaTest()) + if (self().alphaTest()) LIBGUI_GL.glEnable(GL_ALPHA_TEST); else LIBGUI_GL.glDisable(GL_ALPHA_TEST); break; case internal::AlphaLimit: - LIBGUI_GL.glAlphaFunc(GL_GREATER, self.alphaLimit()); + LIBGUI_GL.glAlphaFunc(GL_GREATER, self().alphaLimit()); break; case internal::Blend: - if (self.blend()) + if (self().blend()) LIBGUI_GL.glEnable(GL_BLEND); else LIBGUI_GL.glDisable(GL_BLEND); @@ -261,13 +261,13 @@ DENG2_PIMPL(GLState) case internal::BlendFuncSrc: case internal::BlendFuncDest: - //glBlendFunc(glBFunc(self.srcBlendFunc()), glBFunc(self.destBlendFunc())); - LIBGUI_GL.glBlendFuncSeparate(glBFunc(self.srcBlendFunc()), glBFunc(self.destBlendFunc()), + //glBlendFunc(glBFunc(self().srcBlendFunc()), glBFunc(self().destBlendFunc())); + LIBGUI_GL.glBlendFuncSeparate(glBFunc(self().srcBlendFunc()), glBFunc(self().destBlendFunc()), GL_ONE, GL_ONE); break; case internal::BlendOp: - switch (self.blendOp()) + switch (self().blendOp()) { case gl::Add: LIBGUI_GL.glBlendEquation(GL_FUNC_ADD); @@ -283,7 +283,7 @@ DENG2_PIMPL(GLState) case internal::ColorMask: { - gl::ColorMask const mask = self.colorMask(); + gl::ColorMask const mask = self().colorMask(); LIBGUI_GL.glColorMask((mask & gl::WriteRed) != 0, (mask & gl::WriteGreen) != 0, (mask & gl::WriteBlue) != 0, @@ -297,22 +297,22 @@ DENG2_PIMPL(GLState) case internal::ScissorWidth: case internal::ScissorHeight: { - if (self.scissor() || self.target().hasActiveRect()) + if (self().scissor() || self().target().hasActiveRect()) { LIBGUI_GL.glEnable(GL_SCISSOR_TEST); Rectangleui origScr; - if (self.scissor()) + if (self().scissor()) { - origScr = self.scissorRect(); + origScr = self().scissorRect(); } else { - origScr = Rectangleui::fromSize(self.target().size()); + origScr = Rectangleui::fromSize(self().target().size()); } - Rectangleui const scr = self.target().scaleToActiveRect(origScr); - LIBGUI_GL.glScissor(scr.left(), self.target().size().y - scr.bottom(), + Rectangleui const scr = self().target().scaleToActiveRect(origScr); + LIBGUI_GL.glScissor(scr.left(), self().target().size().y - scr.bottom(), scr.width(), scr.height()); } else @@ -327,10 +327,10 @@ DENG2_PIMPL(GLState) case internal::ViewportWidth: case internal::ViewportHeight: { - Rectangleui const vp = self.target().scaleToActiveRect(self.viewport()); + Rectangleui const vp = self().target().scaleToActiveRect(self().viewport()); //qDebug() << "glViewport" << vp.asText(); - LIBGUI_GL.glViewport(vp.left(), self.target().size().y - vp.bottom(), + LIBGUI_GL.glViewport(vp.left(), self().target().size().y - vp.bottom(), vp.width(), vp.height()); break; } diff --git a/doomsday/sdk/libgui/src/graphics/gltexture.cpp b/doomsday/sdk/libgui/src/graphics/gltexture.cpp index 4e36a48255..4f65641680 100644 --- a/doomsday/sdk/libgui/src/graphics/gltexture.cpp +++ b/doomsday/sdk/libgui/src/graphics/gltexture.cpp @@ -91,7 +91,7 @@ DENG2_PIMPL(GLTexture) size = Size(); texTarget = GL_TEXTURE_2D; flags |= ParamsChanged; - self.setState(NotReady); + self().setState(NotReady); } bool isCube() const diff --git a/doomsday/sdk/libgui/src/graphics/gltextureframebuffer.cpp b/doomsday/sdk/libgui/src/graphics/gltextureframebuffer.cpp index e1f73433b3..3ff1728159 100644 --- a/doomsday/sdk/libgui/src/graphics/gltextureframebuffer.cpp +++ b/doomsday/sdk/libgui/src/graphics/gltextureframebuffer.cpp @@ -72,7 +72,7 @@ DENG2_PIMPL(GLTextureFramebuffer) { color.clear(); depthStencil.clear(); - self.deinit(); + self().deinit(); resolvedFbo.deinit(); texFboState.setState(NotReady); @@ -166,14 +166,14 @@ DENG2_PIMPL(GLTextureFramebuffer) if (isMultisampled()) { - self.configure(size, ColorDepthStencil, sampleCount()); + self().configure(size, ColorDepthStencil, sampleCount()); resolvedFbo.configure(&color, &depthStencil); } else { try { - self.configure(&color, &depthStencil); + self().configure(&color, &depthStencil); resolvedFbo.setState(NotReady); } catch (ConfigError const &er) @@ -184,7 +184,7 @@ DENG2_PIMPL(GLTextureFramebuffer) "(depth & stencil will be used for rendering but " "are inaccessible in shaders): ") << er.asText(); - self.configure(size, ColorDepthStencil); + self().configure(size, ColorDepthStencil); resolvedFbo.configure(Color, color); } catch (ConfigError const &er) @@ -195,7 +195,7 @@ DENG2_PIMPL(GLTextureFramebuffer) "(only depth used for rendering, depth & stencil " "inaccessible in shaders): ") << er.asText(); - self.configure(Color, color, Depth); + self().configure(Color, color, Depth); resolvedFbo.setState(NotReady); } catch (ConfigError const &er) @@ -203,14 +203,14 @@ DENG2_PIMPL(GLTextureFramebuffer) LOG_GL_WARNING("Using final framebuffer configuration fallback 3 " "(only depth used for rendering, depth & stencil " "inaccessible in shaders): ") << er.asText(); - self.configure(size, ColorDepth); + self().configure(size, ColorDepth); resolvedFbo.configure(GLFramebuffer::Color, color); } } } } - self.clear(ColorDepthStencil); + self().clear(ColorDepthStencil); if (resolvedFbo.isReady()) resolvedFbo.clear(ColorDepthStencil); LIBGUI_ASSERT_GL_OK(); diff --git a/doomsday/sdk/libgui/src/graphics/gluniform.cpp b/doomsday/sdk/libgui/src/graphics/gluniform.cpp index 376096ecba..d31df3df05 100644 --- a/doomsday/sdk/libgui/src/graphics/gluniform.cpp +++ b/doomsday/sdk/libgui/src/graphics/gluniform.cpp @@ -92,7 +92,7 @@ DENG2_PIMPL(GLUniform) ~Impl() { - DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->uniformDeleted(self); + DENG2_FOR_PUBLIC_AUDIENCE2(Deletion, i) i->uniformDeleted(self()); switch (type) { @@ -177,13 +177,13 @@ DENG2_PIMPL(GLUniform) { DENG2_FOR_PUBLIC_AUDIENCE2(ValueChange, i) { - i->uniformValueChanged(self); + i->uniformValueChanged(self()); } } void assetBeingDeleted(Asset &asset) { - if (self.isSampler()) + if (self().isSampler()) { if (value.tex == &asset) { diff --git a/doomsday/sdk/libgui/src/graphics/imagefile.cpp b/doomsday/sdk/libgui/src/graphics/imagefile.cpp index cf42df0263..1af8841371 100644 --- a/doomsday/sdk/libgui/src/graphics/imagefile.cpp +++ b/doomsday/sdk/libgui/src/graphics/imagefile.cpp @@ -51,7 +51,7 @@ DENG2_PIMPL(ImageFile) } if (filter == HeightMapToNormals || filter == Multiply) { - ImageFile *sub = new ImageFile(filter, self); + ImageFile *sub = new ImageFile(filter, self()); filtered.insert(filter, sub); return sub; } @@ -60,7 +60,7 @@ DENG2_PIMPL(ImageFile) ImageFile &filterSource() { - return self.Node::parent()->as(); + return self().Node::parent()->as(); } static String filterTypeToText(BuiltInFilter filter) diff --git a/doomsday/sdk/libgui/src/graphics/modeldrawable.cpp b/doomsday/sdk/libgui/src/graphics/modeldrawable.cpp index b5ec81009a..618459e8a5 100644 --- a/doomsday/sdk/libgui/src/graphics/modeldrawable.cpp +++ b/doomsday/sdk/libgui/src/graphics/modeldrawable.cpp @@ -781,7 +781,7 @@ DENG2_PIMPL(ModelDrawable) // Last minute notification in case some additional setup is needed. DENG2_FOR_PUBLIC_AUDIENCE2(AboutToGLInit, i) { - i->modelAboutToGLInit(self); + i->modelAboutToGLInit(self()); } glData.glInit(sourcePath); diff --git a/doomsday/sdk/libgui/src/graphics/multiatlas.cpp b/doomsday/sdk/libgui/src/graphics/multiatlas.cpp index dc030aea97..34b8780071 100644 --- a/doomsday/sdk/libgui/src/graphics/multiatlas.cpp +++ b/doomsday/sdk/libgui/src/graphics/multiatlas.cpp @@ -59,7 +59,7 @@ DENG2_PIMPL(MultiAtlas) if (atlas->isEmpty()) return atlas; } // Make a new atlas. - Atlas *blank = factory.makeAtlas(self); + Atlas *blank = factory.makeAtlas(self()); DENG2_ASSERT(blank->flags().testFlag(Atlas::DeferredAllocations)); atlases.prepend(blank); return blank; diff --git a/doomsday/sdk/libgui/src/graphics/texturebank.cpp b/doomsday/sdk/libgui/src/graphics/texturebank.cpp index 2a6358aa03..bf83d4dcac 100644 --- a/doomsday/sdk/libgui/src/graphics/texturebank.cpp +++ b/doomsday/sdk/libgui/src/graphics/texturebank.cpp @@ -66,7 +66,7 @@ DENG2_PIMPL(TextureBank) ~Impl() { // Get rid of items before the reverse lookup hash is destroyed. - self.clear(); + self().clear(); } }; diff --git a/doomsday/sdk/libgui/src/guiapp.cpp b/doomsday/sdk/libgui/src/guiapp.cpp index d1804db1ee..01e69d7084 100644 --- a/doomsday/sdk/libgui/src/guiapp.cpp +++ b/doomsday/sdk/libgui/src/guiapp.cpp @@ -39,7 +39,7 @@ DENG2_PIMPL(GuiApp) Impl(Public *i) : Base(i) { - loop.audienceForIteration() += self; + loop.audienceForIteration() += self(); } }; diff --git a/doomsday/sdk/libgui/src/persistentglwindow.cpp b/doomsday/sdk/libgui/src/persistentglwindow.cpp index 4a538247ed..a1e9cb313f 100644 --- a/doomsday/sdk/libgui/src/persistentglwindow.cpp +++ b/doomsday/sdk/libgui/src/persistentglwindow.cpp @@ -479,12 +479,12 @@ DENG2_PIMPL(PersistentGLWindow) setMain(thisPublic); } - self.setMinimumSize(QSize(MIN_WIDTH, MIN_HEIGHT)); + self().setMinimumSize(QSize(MIN_WIDTH, MIN_HEIGHT)); } ~Impl() { - self.saveToConfig(); + self().saveToConfig(); } /** @@ -582,7 +582,7 @@ DENG2_PIMPL(PersistentGLWindow) */ void applyToWidget(State const &newState) { - bool trapped = self.eventHandler().isMouseTrapped(); + bool trapped = self().eventHandler().isMouseTrapped(); // If the display mode needs to change, we will have to defer the rest // of the state changes so that everything catches up after the change. @@ -590,7 +590,7 @@ DENG2_PIMPL(PersistentGLWindow) DisplayMode const *newMode = newState.displayMode(); bool modeChanged = false; - if (!self.isVisible()) + if (!self().isVisible()) { // Update geometry for windowed mode right away. queue << Task(newState.windowRect); @@ -613,7 +613,7 @@ DENG2_PIMPL(PersistentGLWindow) #endif } - if (self.isVisible()) + if (self().isVisible()) { // Possible actions: // @@ -676,7 +676,7 @@ DENG2_PIMPL(PersistentGLWindow) state.fullSize = newState.fullSize; state.flags = newState.flags; - if (self.isVisible()) + if (self().isVisible()) { // Carry out queued operations after dropping back to the event loop. QTimer::singleShot(10, thisPublic, SLOT(performQueuedTasks())); @@ -706,17 +706,17 @@ DENG2_PIMPL(PersistentGLWindow) { case Task::ShowNormal: LOG_GL_VERBOSE("Showing window as normal"); - self.showNormal(); + self().showNormal(); break; case Task::ShowMaximized: LOG_GL_VERBOSE("Showing window as maximized"); - self.showMaximized(); + self().showMaximized(); break; case Task::ShowFullscreen: LOG_GL_VERBOSE("Showing window as fullscreen"); - self.showFullScreen(); + self().showFullScreen(); break; case Task::SetGeometry: @@ -726,7 +726,7 @@ DENG2_PIMPL(PersistentGLWindow) next.rect = centeredRect(next.rect.size()); } LOG_GL_VERBOSE("Setting window geometry to ") << next.rect.asText(); - self.setGeometry(next.rect.left(), next.rect.top(), + self().setGeometry(next.rect.left(), next.rect.top(), next.rect.width(), next.rect.height()); state.windowRect = next.rect; break; @@ -740,12 +740,12 @@ DENG2_PIMPL(PersistentGLWindow) #ifdef MACOSX // Pull the window again over the shield after the mode change. LOGDEV_GL_VERBOSE("Raising window over shield"); - DisplayMode_Native_Raise(self.nativeHandle()); + DisplayMode_Native_Raise(self().nativeHandle()); #endif break; case Task::TrapMouse: - self.eventHandler().trapMouse(); + self().eventHandler().trapMouse(); break; } @@ -756,7 +756,7 @@ DENG2_PIMPL(PersistentGLWindow) // The queue is now empty; all modifications to state have been applied. DENG2_FOR_PUBLIC_AUDIENCE2(AttributeChange, i) { - i->windowAttributesChanged(self); + i->windowAttributesChanged(self()); } } @@ -767,13 +767,13 @@ DENG2_PIMPL(PersistentGLWindow) { State st(id); - st.windowRect = self.windowRect(); + st.windowRect = self().windowRect(); st.fullSize = state.fullSize; st.colorDepthBits = DisplayMode_Current()->depth; st.flags = - (self.isMaximized()? State::Maximized : State::None) | - (self.isFullScreen()? State::Fullscreen : State::None) | + (self().isMaximized()? State::Maximized : State::None) | + (self().isFullScreen()? State::Fullscreen : State::None) | (state.isCentered()? State::Centered : State::None); return st; diff --git a/doomsday/sdk/libgui/src/text/nativefont.cpp b/doomsday/sdk/libgui/src/text/nativefont.cpp index 5278e25566..d3cfa2c03f 100644 --- a/doomsday/sdk/libgui/src/text/nativefont.cpp +++ b/doomsday/sdk/libgui/src/text/nativefont.cpp @@ -42,17 +42,17 @@ namespace de void prepare() { - if (!self.isReady()) + if (!self().isReady()) { - self.commit(); + self().commit(); cachedText.clear(); - self.setState(Ready); + self().setState(Ready); } } void markNotReady() { - self.setState(NotReady); + self().setState(NotReady); cachedText.clear(); } }; diff --git a/doomsday/sdk/libshell/src/abstractlineeditor.cpp b/doomsday/sdk/libshell/src/abstractlineeditor.cpp index f91df794cc..546d97b640 100644 --- a/doomsday/sdk/libshell/src/abstractlineeditor.cpp +++ b/doomsday/sdk/libshell/src/abstractlineeditor.cpp @@ -74,13 +74,13 @@ DENG2_PIMPL(AbstractLineEditor) void rewrapLater() { wraps->clear(); - self.contentChanged(); + self().contentChanged(); } void rewrapNow() { updateWraps(); - self.contentChanged(); + self().contentChanged(); } /** @@ -89,15 +89,15 @@ DENG2_PIMPL(AbstractLineEditor) */ void updateWraps() { - wraps->wrapTextToWidth(text, de::max(1, self.maximumWidth())); + wraps->wrapTextToWidth(text, de::max(1, self().maximumWidth())); if (wraps->height() > 0) { - self.numberOfLinesChanged(wraps->height()); + self().numberOfLinesChanged(wraps->height()); } else { - self.numberOfLinesChanged(1); + self().numberOfLinesChanged(1); } } @@ -148,7 +148,7 @@ DENG2_PIMPL(AbstractLineEditor) if (!span.isFinal) span.range.end--; if (cursor > span.range.end) cursor = span.range.end; - self.cursorMoved(); + self().cursorMoved(); return true; } @@ -201,7 +201,7 @@ DENG2_PIMPL(AbstractLineEditor) if (cursor > 0) { --cursor; - self.cursorMoved(); + self().cursorMoved(); return true; } return false; @@ -214,7 +214,7 @@ DENG2_PIMPL(AbstractLineEditor) if (cursor < text.size()) { ++cursor; - self.cursorMoved(); + self().cursorMoved(); return true; } return false; @@ -240,7 +240,7 @@ DENG2_PIMPL(AbstractLineEditor) { acceptCompletion(); cursor = wordJumpLeft(cursor); - self.cursorMoved(); + self().cursorMoved(); } void doWordRight() @@ -261,7 +261,7 @@ DENG2_PIMPL(AbstractLineEditor) cursor++; } - self.cursorMoved(); + self().cursorMoved(); } void doHome() @@ -269,7 +269,7 @@ DENG2_PIMPL(AbstractLineEditor) acceptCompletion(); cursor = lineSpan(lineCursorPos().y).range.start; - self.cursorMoved(); + self().cursorMoved(); } void doEnd() @@ -278,7 +278,7 @@ DENG2_PIMPL(AbstractLineEditor) WrappedLine const span = lineSpan(lineCursorPos().y); cursor = span.range.end - (span.isFinal? 0 : 1); - self.cursorMoved(); + self().cursorMoved(); } void killEndOfLine() @@ -373,7 +373,7 @@ DENG2_PIMPL(AbstractLineEditor) //rewrapNow(); suggesting = true; // Notify immediately. - self.autoCompletionBegan(base); + self().autoCompletionBegan(base); completionNotified = true; return true; } @@ -384,7 +384,7 @@ DENG2_PIMPL(AbstractLineEditor) if (!completionNotified) { // Time to notify now. - self.autoCompletionBegan(wordBehindPos(completion.pos)); + self().autoCompletionBegan(wordBehindPos(completion.pos)); completionNotified = true; return true; } @@ -444,7 +444,7 @@ DENG2_PIMPL(AbstractLineEditor) resetCompletion(); - self.autoCompletionEnded(true); + self().autoCompletionEnded(true); } bool rejectCompletion() @@ -458,7 +458,7 @@ DENG2_PIMPL(AbstractLineEditor) resetCompletion(); rewrapNow(); - self.autoCompletionEnded(false); + self().autoCompletionEnded(false); return cursor != oldCursor; // cursor was moved as part of the rejection } diff --git a/doomsday/sdk/libshell/src/choicewidget.cpp b/doomsday/sdk/libshell/src/choicewidget.cpp index a39e335ddf..414f04bc6e 100644 --- a/doomsday/sdk/libshell/src/choicewidget.cpp +++ b/doomsday/sdk/libshell/src/choicewidget.cpp @@ -38,14 +38,14 @@ DENG2_PIMPL(ChoiceWidget) menu->clear(); foreach (String item, items) { - menu->appendItem(new Action(item, &self, SLOT(updateSelectionFromMenu()))); + menu->appendItem(new Action(item, thisPublic, SLOT(updateSelectionFromMenu()))); } menu->setCursor(selection); } void updateLabel() { - self.setLabel(prompt + items[selection], self.attribs()); + self().setLabel(prompt + items[selection], self().attribs()); } }; diff --git a/doomsday/sdk/libshell/src/logwidget.cpp b/doomsday/sdk/libshell/src/logwidget.cpp index 000ddfdc75..b901940790 100644 --- a/doomsday/sdk/libshell/src/logwidget.cpp +++ b/doomsday/sdk/libshell/src/logwidget.cpp @@ -123,7 +123,7 @@ DENG2_PIMPL(LogWidget) if (visibleOffset != off) { visibleOffset = off; - emit self.scrollPositionChanged(off); + emit self().scrollPositionChanged(off); } } }; diff --git a/doomsday/sdk/libshell/src/menuwidget.cpp b/doomsday/sdk/libshell/src/menuwidget.cpp index c8944b6bf9..323cff18c9 100644 --- a/doomsday/sdk/libshell/src/menuwidget.cpp +++ b/doomsday/sdk/libshell/src/menuwidget.cpp @@ -88,7 +88,7 @@ DENG2_PIMPL(MenuWidget) { foreach (Item i, items) { - self.removeAction(*i.action); + self().removeAction(*i.action); } items.clear(); updateSize(); @@ -116,7 +116,7 @@ DENG2_PIMPL(MenuWidget) void removeItem(int pos) { - self.removeAction(*items[pos].action); + self().removeAction(*items[pos].action); items.removeAt(pos); updateSize(); } diff --git a/doomsday/tools/shell/src/errorlogdialog.cpp b/doomsday/tools/shell/src/errorlogdialog.cpp index b3b70574ea..06dd336572 100644 --- a/doomsday/tools/shell/src/errorlogdialog.cpp +++ b/doomsday/tools/shell/src/errorlogdialog.cpp @@ -32,7 +32,7 @@ DENG2_PIMPL(ErrorLogDialog) QObject::connect(buttons, SIGNAL(accepted()), thisPublic, SLOT(accept())); layout->addWidget(buttons, 0); - self.setLayout(layout); + self().setLayout(layout); } }; diff --git a/doomsday/tools/shell/src/folderselection.cpp b/doomsday/tools/shell/src/folderselection.cpp index 65c8b17c47..1a44ce5906 100644 --- a/doomsday/tools/shell/src/folderselection.cpp +++ b/doomsday/tools/shell/src/folderselection.cpp @@ -35,15 +35,15 @@ DENG2_PIMPL(FolderSelection) { /* // What's up with the extra spacing? - QPalette pal = self.palette(); - pal.setColor(self.backgroundRole(), Qt::red); - self.setPalette(pal); - self.setAutoFillBackground(true); + QPalette pal = self().palette(); + pal.setColor(self().backgroundRole(), Qt::red); + self().setPalette(pal); + self().setAutoFillBackground(true); */ QHBoxLayout *layout = new QHBoxLayout; layout->setContentsMargins(0, 0, 0, 0); - self.setLayout(layout); + self().setLayout(layout); if (!extraLabel.isEmpty()) { diff --git a/doomsday/tools/shell/src/linkwindow.cpp b/doomsday/tools/shell/src/linkwindow.cpp index 8d05b55471..35c5383b6d 100644 --- a/doomsday/tools/shell/src/linkwindow.cpp +++ b/doomsday/tools/shell/src/linkwindow.cpp @@ -115,7 +115,7 @@ DENG2_PIMPL(LinkWindow) void updateStyle() { - if (self.isConnected()) + if (self().isConnected()) { console->root().canvas().setBackgroundColor(Qt::white); console->root().canvas().setForegroundColor(Qt::black); @@ -132,14 +132,14 @@ DENG2_PIMPL(LinkWindow) QString txt; if (link) { - if (self.isConnected() && !link->address().isNull()) + if (self().isConnected() && !link->address().isNull()) { txt = tr("%1:%2") .arg(link->address().isLocal()? "localhost" : link->address().host().toString()) .arg(link->address().port()); } - else if (self.isConnected() && link->address().isNull()) + else if (self().isConnected() && link->address().isNull()) { txt = tr("Looking up host..."); } @@ -149,9 +149,9 @@ DENG2_PIMPL(LinkWindow) void disconnected() { - self.setTitle(tr("Disconnected")); + self().setTitle(tr("Disconnected")); console->root().setOverlaidMessage(tr("Disconnected")); - self.statusBar()->clearMessage(); + self().statusBar()->clearMessage(); stopAction->setDisabled(true); #ifdef MENU_IN_LINK_WINDOW disconnectAction->setDisabled(true); diff --git a/doomsday/tools/shell/src/localserverdialog.cpp b/doomsday/tools/shell/src/localserverdialog.cpp index 55f0b750ae..6bd0745522 100644 --- a/doomsday/tools/shell/src/localserverdialog.cpp +++ b/doomsday/tools/shell/src/localserverdialog.cpp @@ -57,15 +57,15 @@ DENG2_PIMPL(LocalServerDialog) Impl(Public &i) : Base(i), portChanged(false) { #ifdef WIN32 - self.setWindowFlags(self.windowFlags() & ~Qt::WindowContextHelpButtonHint); + self().setWindowFlags(self().windowFlags() & ~Qt::WindowContextHelpButtonHint); #endif QSettings st; - self.setWindowTitle(tr("Start Local Server")); + self().setWindowTitle(tr("Start Local Server")); QVBoxLayout *mainLayout = new QVBoxLayout; - self.setLayout(mainLayout); + self().setLayout(mainLayout); QTabWidget *tabs = new QTabWidget; mainLayout->addWidget(tabs, 1); @@ -154,7 +154,7 @@ DENG2_PIMPL(LocalServerDialog) runtime->setPath(DoomsdayInfo::defaultServerRuntimeFolder().toString()); } form->addRow(tr("Runtime folder:"), runtime); - QObject::connect(runtime, SIGNAL(selected()), &self, SLOT(validate())); + QObject::connect(runtime, SIGNAL(selected()), thisPublic, SLOT(validate())); options = new QTextEdit; options->setTabChangesFocus(true); @@ -168,8 +168,8 @@ DENG2_PIMPL(LocalServerDialog) mainLayout->addWidget(bbox); yes = bbox->addButton(tr("&Start Server"), QDialogButtonBox::YesRole); QPushButton* no = bbox->addButton(tr("&Cancel"), QDialogButtonBox::RejectRole); - QObject::connect(yes, SIGNAL(clicked()), &self, SLOT(accept())); - QObject::connect(no, SIGNAL(clicked()), &self, SLOT(reject())); + QObject::connect(yes, SIGNAL(clicked()), thisPublic, SLOT(accept())); + QObject::connect(no, SIGNAL(clicked()), thisPublic, SLOT(reject())); //QObject::connect(opt, SIGNAL(clicked()), &self, SLOT(configureGameOptions())); yes->setDefault(true); } diff --git a/doomsday/tools/shell/src/opendialog.cpp b/doomsday/tools/shell/src/opendialog.cpp index faa60fa56d..3f1b7b7a42 100644 --- a/doomsday/tools/shell/src/opendialog.cpp +++ b/doomsday/tools/shell/src/opendialog.cpp @@ -52,11 +52,11 @@ DENG2_PIMPL(OpenDialog) history = st.value("OpenDialog/history", QStringList() << "localhost").toStringList(); tidyUpHistory(); - self.setWindowTitle(tr("Open Connection")); - self.setWindowFlags(self.windowFlags() & ~Qt::WindowContextHelpButtonHint); + self().setWindowTitle(tr("Open Connection")); + self().setWindowFlags(self().windowFlags() & ~Qt::WindowContextHelpButtonHint); QVBoxLayout *mainLayout = new QVBoxLayout; - self.setLayout(mainLayout); + self().setLayout(mainLayout); mainLayout->setSizeConstraint(QLayout::SetFixedSize); QFormLayout *form = new QFormLayout; @@ -80,15 +80,15 @@ DENG2_PIMPL(OpenDialog) localCount = new QLabel; form->addRow(0, localCount); QObject::connect(&GuiShellApp::app().serverFinder(), SIGNAL(updated()), - &self, SLOT(updateLocalList())); + thisPublic, SLOT(updateLocalList())); // Buttons. QDialogButtonBox *bbox = new QDialogButtonBox; mainLayout->addWidget(bbox); QPushButton* yes = bbox->addButton(tr("&Connect"), QDialogButtonBox::YesRole); QPushButton* no = bbox->addButton(tr("&Cancel"), QDialogButtonBox::RejectRole); - QObject::connect(yes, SIGNAL(clicked()), &self, SLOT(accept())); - QObject::connect(no, SIGNAL(clicked()), &self, SLOT(reject())); + QObject::connect(yes, SIGNAL(clicked()), thisPublic, SLOT(accept())); + QObject::connect(no, SIGNAL(clicked()), thisPublic, SLOT(reject())); yes->setDefault(true); } diff --git a/doomsday/tools/shell/src/optionspage.cpp b/doomsday/tools/shell/src/optionspage.cpp index 5319dfdae2..d6f880fbbd 100644 --- a/doomsday/tools/shell/src/optionspage.cpp +++ b/doomsday/tools/shell/src/optionspage.cpp @@ -63,7 +63,7 @@ DENG2_PIMPL(OptionsPage) game = gameId; gameOptions = shell::DoomsdayInfo::gameOptions(game); - base = new QWidget(&self); + base = new QWidget(thisPublic); base->setMaximumWidth(320); layout = new QFormLayout(base); @@ -228,7 +228,7 @@ DENG2_PIMPL(OptionsPage) } } - emit self.commandsSubmitted(commands); + emit self().commandsSubmitted(commands); } }; diff --git a/doomsday/tools/shell/src/preferences.cpp b/doomsday/tools/shell/src/preferences.cpp index cb3eaff3b4..9e1a05571d 100644 --- a/doomsday/tools/shell/src/preferences.cpp +++ b/doomsday/tools/shell/src/preferences.cpp @@ -26,10 +26,10 @@ DENG2_PIMPL(Preferences) Impl(Public &i) : Base(i), consoleFont(defaultConsoleFont()) { #ifndef MACOSX - self.setWindowModality(Qt::ApplicationModal); + self().setWindowModality(Qt::ApplicationModal); #endif #ifdef WIN32 - self.setWindowFlags(self.windowFlags() & ~Qt::WindowContextHelpButtonHint); + self().setWindowFlags(self().windowFlags() & ~Qt::WindowContextHelpButtonHint); #endif QSettings st; @@ -38,10 +38,10 @@ DENG2_PIMPL(Preferences) consoleFont.fromString(st.value("Preferences/consoleFont").toString()); } - self.setWindowTitle(tr("Preferences")); + self().setWindowTitle(tr("Preferences")); QVBoxLayout *mainLayout = new QVBoxLayout; - self.setLayout(mainLayout); + self().setLayout(mainLayout); mainLayout->addStretch(1); @@ -128,8 +128,8 @@ DENG2_PIMPL(Preferences) mainLayout->addWidget(bbox); QPushButton *yes = bbox->addButton(tr("&OK"), QDialogButtonBox::YesRole); QPushButton *no = bbox->addButton(tr("&Cancel"), QDialogButtonBox::RejectRole); - QObject::connect(yes, SIGNAL(clicked()), &self, SLOT(accept())); - QObject::connect(no, SIGNAL(clicked()), &self, SLOT(reject())); + QObject::connect(yes, SIGNAL(clicked()), thisPublic, SLOT(accept())); + QObject::connect(no, SIGNAL(clicked()), thisPublic, SLOT(reject())); yes->setDefault(true); #endif }