diff --git a/doomsday/client/include/ui/canvas.h b/doomsday/client/include/ui/canvas.h index 0383afd783..2bf6a6b794 100644 --- a/doomsday/client/include/ui/canvas.h +++ b/doomsday/client/include/ui/canvas.h @@ -29,6 +29,7 @@ struct image_s; // see image.h #include +#include #ifdef Q_WS_X11 //# define LIBDENG_CANVAS_TRACK_WITH_MOUSE_MOVE_EVENTS @@ -175,8 +176,7 @@ protected slots: #endif private: - struct Instance; - Instance* d; + DENG2_PRIVATE(d) }; #endif // LIBDENG_CANVAS_H diff --git a/doomsday/client/include/ui/canvaswindow.h b/doomsday/client/include/ui/canvaswindow.h index 2178349920..7e25641b5f 100644 --- a/doomsday/client/include/ui/canvaswindow.h +++ b/doomsday/client/include/ui/canvaswindow.h @@ -86,8 +86,7 @@ public slots: static void initCanvasAfterRecreation(Canvas& canvas); private: - struct Instance; - Instance* d; + DENG2_PRIVATE(d) }; #endif // CANVASWINDOW_H diff --git a/doomsday/client/include/updater.h b/doomsday/client/include/updater.h index 2a46fecfe7..7d8f40d582 100644 --- a/doomsday/client/include/updater.h +++ b/doomsday/client/include/updater.h @@ -31,6 +31,7 @@ #ifdef __cplusplus +#include #include #include @@ -67,8 +68,7 @@ public slots: void checkNowShowingProgress(); private: - struct Instance; - Instance* d; + DENG2_PRIVATE(d) }; /** diff --git a/doomsday/client/include/uri.hh b/doomsday/client/include/uri.hh index 7884c73887..eb2755319b 100644 --- a/doomsday/client/include/uri.hh +++ b/doomsday/client/include/uri.hh @@ -314,8 +314,7 @@ public: void operator << (Reader &from); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; Q_DECLARE_OPERATORS_FOR_FLAGS(Uri::PrintFlags) diff --git a/doomsday/client/src/updater/downloaddialog.cpp b/doomsday/client/src/updater/downloaddialog.cpp index 0c72327cf1..5769b92cb0 100644 --- a/doomsday/client/src/updater/downloaddialog.cpp +++ b/doomsday/client/src/updater/downloaddialog.cpp @@ -38,9 +38,8 @@ static DownloadDialog* downloadInProgress; -struct DownloadDialog::Instance +DENG2_PIMPL(DownloadDialog) { - DownloadDialog* self; QNetworkAccessManager* network; bool downloading; QPushButton* install; @@ -54,11 +53,11 @@ struct DownloadDialog::Instance QNetworkReply* reply; de::String redirected; - Instance(DownloadDialog* d, de::String downloadUri, de::String fallbackUri) - : self(d), downloading(false), uri(downloadUri), uri2(fallbackUri), fileReady(false), reply(0) + Instance(Public *d, de::String downloadUri, de::String fallbackUri) + : Base(d), downloading(false), uri(downloadUri), uri2(fallbackUri), fileReady(false), reply(0) { QVBoxLayout* mainLayout = new QVBoxLayout; - self->setLayout(mainLayout); + self.setLayout(mainLayout); bar = new QProgressBar; bar->setTextVisible(false); @@ -69,8 +68,8 @@ struct DownloadDialog::Instance install = bbox->addButton(tr("Install"), QDialogButtonBox::AcceptRole); install->setEnabled(false); QPushButton* cancel = bbox->addButton(QDialogButtonBox::Cancel); - QObject::connect(install, SIGNAL(clicked()), self, SLOT(accept())); - QObject::connect(cancel, SIGNAL(clicked()), self, SLOT(reject())); + QObject::connect(install, SIGNAL(clicked()), thisPublic, SLOT(accept())); + QObject::connect(cancel, SIGNAL(clicked()), thisPublic, SLOT(reject())); hostText = new QLabel; updateLocation(uri); @@ -84,8 +83,8 @@ struct DownloadDialog::Instance mainLayout->addWidget(bbox); - network = new QNetworkAccessManager(self); - QObject::connect(network, SIGNAL(finished(QNetworkReply*)), self, SLOT(finished(QNetworkReply*))); + network = new QNetworkAccessManager(thisPublic); + QObject::connect(network, SIGNAL(finished(QNetworkReply*)), thisPublic, SLOT(finished(QNetworkReply*))); startDownload(); } @@ -104,19 +103,19 @@ struct DownloadDialog::Instance savedFilePath = UpdaterSettings().downloadPath() / path.fileName(); reply = network->get(QNetworkRequest(uri)); - QObject::connect(reply, SIGNAL(metaDataChanged()), self, SLOT(replyMetaDataChanged())); - QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)), self, SLOT(progress(qint64,qint64))); + QObject::connect(reply, SIGNAL(metaDataChanged()), thisPublic, SLOT(replyMetaDataChanged())); + QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)), thisPublic, SLOT(progress(qint64,qint64))); LOG_INFO("Downloading %s, saving as: %s") << uri.toString() << savedFilePath; // Global state flag. - downloadInProgress = self; + downloadInProgress = thisPublic; } void setProgressText(de::String text) { progText->setText("" + text + ""); - self->resize(self->sizeHint()); + self.resize(self.sizeHint()); } }; diff --git a/doomsday/client/src/updater/downloaddialog.h b/doomsday/client/src/updater/downloaddialog.h index b55f761d19..09aae699e2 100644 --- a/doomsday/client/src/updater/downloaddialog.h +++ b/doomsday/client/src/updater/downloaddialog.h @@ -61,8 +61,7 @@ public slots: void finished(QNetworkReply*); private: - struct Instance; - Instance* d; + DENG2_PRIVATE(d) }; #endif // __cplusplus diff --git a/doomsday/client/src/updater/updateavailabledialog.h b/doomsday/client/src/updater/updateavailabledialog.h index 34738a7d41..aaec9fb2ac 100644 --- a/doomsday/client/src/updater/updateavailabledialog.h +++ b/doomsday/client/src/updater/updateavailabledialog.h @@ -50,8 +50,7 @@ public slots: void checkAgain(); private: - struct Instance; - Instance* d; + DENG2_PRIVATE(d) }; #endif // LIBDENG_UPDATEAVAILABLEDIALOG_H diff --git a/doomsday/client/src/updater/updater.cpp b/doomsday/client/src/updater/updater.cpp index c08ff327c7..c58a190711 100644 --- a/doomsday/client/src/updater/updater.cpp +++ b/doomsday/client/src/updater/updater.cpp @@ -121,9 +121,8 @@ static void switchBackToFullscreen(bool wasFull) } } -struct Updater::Instance +DENG2_PIMPL(Updater) { - Updater* self; QNetworkAccessManager* network; DownloadDialog* download; bool alwaysShowNotification; @@ -137,8 +136,8 @@ struct Updater::Instance QString latestPackageUri2; // fallback location QString latestLogUri; - Instance(Updater* up) - : self(up), + Instance(Public *up) + : Base(up), network(0), download(0), availableDlg(0), @@ -146,7 +145,7 @@ struct Updater::Instance backToFullscreen(false), savingSuggested(false) { - network = new QNetworkAccessManager(self); + network = new QNetworkAccessManager(thisPublic); // Delete a package installed earlier? UpdaterSettings st; @@ -239,7 +238,7 @@ struct Updater::Instance if(!settingsDlg) { settingsDlg = new UpdaterSettingsDialog(Window_Widget(Window_Main())); - QObject::connect(settingsDlg, SIGNAL(finished(int)), self, SLOT(settingsDialogClosed(int))); + QObject::connect(settingsDlg, SIGNAL(finished(int)), thisPublic, SLOT(settingsDialogClosed(int))); } else { @@ -322,7 +321,7 @@ struct Updater::Instance void execAvailableDialog(bool wasFull) { - QObject::connect(availableDlg, SIGNAL(checkAgain()), self, SLOT(recheck())); + QObject::connect(availableDlg, SIGNAL(checkAgain()), thisPublic, SLOT(recheck())); if(availableDlg->exec()) { @@ -330,7 +329,7 @@ struct Updater::Instance LOG_MSG("Download and install."); download = new DownloadDialog(latestPackageUri, latestPackageUri2); - QObject::connect(download, SIGNAL(finished(int)), self, SLOT(downloadCompleted(int))); + QObject::connect(download, SIGNAL(finished(int)), thisPublic, SLOT(downloadCompleted(int))); download->show(); } else diff --git a/doomsday/client/src/updater/updatersettingsdialog.h b/doomsday/client/src/updater/updatersettingsdialog.h index 4459c31485..118888cb08 100644 --- a/doomsday/client/src/updater/updatersettingsdialog.h +++ b/doomsday/client/src/updater/updatersettingsdialog.h @@ -23,6 +23,7 @@ #ifndef LIBDENG_UPDATERSETTINGSDIALOG_H #define LIBDENG_UPDATERSETTINGSDIALOG_H +#include #include "updaterdialog.h" class UpdaterSettingsDialog : public UpdaterDialog @@ -44,8 +45,7 @@ public slots: void pathActivated(int index); private: - struct Instance; - Instance* d; + DENG2_PRIVATE(d) }; #endif // LIBDENG_UPDATERSETTINGSDIALOG_H diff --git a/doomsday/libdeng2/include/de/core/app.h b/doomsday/libdeng2/include/de/core/app.h index 55031107f3..dddd93d705 100644 --- a/doomsday/libdeng2/include/de/core/app.h +++ b/doomsday/libdeng2/include/de/core/app.h @@ -252,8 +252,7 @@ class DENG2_PUBLIC App : DENG2_OBSERVES(Clock, TimeChange) virtual NativePath appDataPath() const = 0; private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; Q_DECLARE_OPERATORS_FOR_FLAGS(App::SubsystemInitFlags) diff --git a/doomsday/libdeng2/include/de/core/commandline.h b/doomsday/libdeng2/include/de/core/commandline.h index 61f3a5f747..89eeb501cf 100644 --- a/doomsday/libdeng2/include/de/core/commandline.h +++ b/doomsday/libdeng2/include/de/core/commandline.h @@ -205,8 +205,7 @@ class DENG2_PUBLIC CommandLine bool execute() const; private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/core/config.h b/doomsday/libdeng2/include/de/core/config.h index a9978bc30d..8c68bcf9fa 100644 --- a/doomsday/libdeng2/include/de/core/config.h +++ b/doomsday/libdeng2/include/de/core/config.h @@ -103,8 +103,7 @@ class DENG2_PUBLIC Config Record &names(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/core/library.h b/doomsday/libdeng2/include/de/core/library.h index aef37067d7..7bb3882b6f 100644 --- a/doomsday/libdeng2/include/de/core/library.h +++ b/doomsday/libdeng2/include/de/core/library.h @@ -202,8 +202,7 @@ class DENG2_PUBLIC Library } private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/core/logbuffer.h b/doomsday/libdeng2/include/de/core/logbuffer.h index bc0e2dd124..6ed96db724 100644 --- a/doomsday/libdeng2/include/de/core/logbuffer.h +++ b/doomsday/libdeng2/include/de/core/logbuffer.h @@ -170,8 +170,7 @@ public slots: void flush(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) /// The globally available application buffer. static LogBuffer *_appBuffer; diff --git a/doomsday/libdeng2/include/de/core/system.h b/doomsday/libdeng2/include/de/core/system.h index d73fcb2998..6eb4f748ea 100644 --- a/doomsday/libdeng2/include/de/core/system.h +++ b/doomsday/libdeng2/include/de/core/system.h @@ -75,8 +75,7 @@ class DENG2_PUBLIC System : DENG2_OBSERVES(Clock, TimeChange) virtual void timeChanged(Clock const &); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; Q_DECLARE_OPERATORS_FOR_FLAGS(System::Flags) diff --git a/doomsday/libdeng2/include/de/core/textapp.h b/doomsday/libdeng2/include/de/core/textapp.h index d6c514c19e..526d65a6bf 100644 --- a/doomsday/libdeng2/include/de/core/textapp.h +++ b/doomsday/libdeng2/include/de/core/textapp.h @@ -55,8 +55,7 @@ class DENG2_PUBLIC TextApp : public QCoreApplication, public App NativePath appDataPath() const; private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/core/unixinfo.h b/doomsday/libdeng2/include/de/core/unixinfo.h index 27f6a0eb2a..0b5dd158b8 100644 --- a/doomsday/libdeng2/include/de/core/unixinfo.h +++ b/doomsday/libdeng2/include/de/core/unixinfo.h @@ -74,8 +74,7 @@ class UnixInfo bool defaults(String const &key, String &value) const; private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/data/archive.h b/doomsday/libdeng2/include/de/data/archive.h index 706603e788..f3cc940c56 100644 --- a/doomsday/libdeng2/include/de/data/archive.h +++ b/doomsday/libdeng2/include/de/data/archive.h @@ -318,8 +318,7 @@ class DENG2_PUBLIC Archive : public IWritable PathTree const &index() const; private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/data/info.h b/doomsday/libdeng2/include/de/data/info.h index 1b6317bc9d..ee5f0f3b0a 100644 --- a/doomsday/libdeng2/include/de/data/info.h +++ b/doomsday/libdeng2/include/de/data/info.h @@ -233,8 +233,7 @@ class Info bool findValueForKey(String const &key, String &value) const; private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/data/lockable.h b/doomsday/libdeng2/include/de/data/lockable.h index 67b658db2b..2721f28e9c 100644 --- a/doomsday/libdeng2/include/de/data/lockable.h +++ b/doomsday/libdeng2/include/de/data/lockable.h @@ -55,9 +55,7 @@ class DENG2_PUBLIC Lockable void assertLocked() const; private: - /// Pointer to the internal mutex data. - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/data/pathtree.h b/doomsday/libdeng2/include/de/data/pathtree.h index d27e727b3b..9c1f4dfbc9 100644 --- a/doomsday/libdeng2/include/de/data/pathtree.h +++ b/doomsday/libdeng2/include/de/data/pathtree.h @@ -240,8 +240,7 @@ class DENG2_PUBLIC PathTree Nodes &childNodes(NodeType type); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; public: diff --git a/doomsday/libdeng2/include/de/data/reader.h b/doomsday/libdeng2/include/de/data/reader.h index e4c1e742b9..f804881085 100644 --- a/doomsday/libdeng2/include/de/data/reader.h +++ b/doomsday/libdeng2/include/de/data/reader.h @@ -285,8 +285,7 @@ class DENG2_PUBLIC Reader } private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/data/record.h b/doomsday/libdeng2/include/de/data/record.h index 758cd1bddc..3a5785c91f 100644 --- a/doomsday/libdeng2/include/de/data/record.h +++ b/doomsday/libdeng2/include/de/data/record.h @@ -334,8 +334,7 @@ class DENG2_PUBLIC Record : public ISerializable, public LogEntry::Arg::Base, void variableBeingDeleted(Variable &variable); private: - struct Instance; - Instance * d; + DENG2_PRIVATE(d) }; /// Converts the record into a human-readable text representation. diff --git a/doomsday/libdeng2/include/de/data/stringpool.h b/doomsday/libdeng2/include/de/data/stringpool.h index fdfd1d11f7..34431adcc5 100644 --- a/doomsday/libdeng2/include/de/data/stringpool.h +++ b/doomsday/libdeng2/include/de/data/stringpool.h @@ -241,8 +241,7 @@ class DENG2_PUBLIC StringPool : public ISerializable #endif private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/data/writer.h b/doomsday/libdeng2/include/de/data/writer.h index ed049956cc..82f60e1302 100644 --- a/doomsday/libdeng2/include/de/data/writer.h +++ b/doomsday/libdeng2/include/de/data/writer.h @@ -215,8 +215,7 @@ class DENG2_PUBLIC Writer } private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/filesys/archivefeed.h b/doomsday/libdeng2/include/de/filesys/archivefeed.h index 18fbf53a0b..01f9c45b47 100644 --- a/doomsday/libdeng2/include/de/filesys/archivefeed.h +++ b/doomsday/libdeng2/include/de/filesys/archivefeed.h @@ -76,8 +76,7 @@ class ArchiveFeed : public Feed String const &basePath() const; private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/filesys/filesystem.h b/doomsday/libdeng2/include/de/filesys/filesystem.h index c5d085778e..4248ccd4e7 100644 --- a/doomsday/libdeng2/include/de/filesys/filesystem.h +++ b/doomsday/libdeng2/include/de/filesys/filesystem.h @@ -242,8 +242,7 @@ class DENG2_PUBLIC FileSystem : public System void timeChanged(Clock const &); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; // Alias. diff --git a/doomsday/libdeng2/include/de/legacy/legacycore.h b/doomsday/libdeng2/include/de/legacy/legacycore.h index 0e97fa9c3e..b10e3acaf9 100644 --- a/doomsday/libdeng2/include/de/legacy/legacycore.h +++ b/doomsday/libdeng2/include/de/legacy/legacycore.h @@ -146,9 +146,7 @@ public slots: void callback(); private: - // Private instance data. - struct Instance; - Instance *d; + DENG2_PRIVATE(d) /// Globally available. static LegacyCore *_appCore; diff --git a/doomsday/libdeng2/include/de/legacy/legacynetwork.h b/doomsday/libdeng2/include/de/legacy/legacynetwork.h index d2a4d9595f..86842f4e8b 100644 --- a/doomsday/libdeng2/include/de/legacy/legacynetwork.h +++ b/doomsday/libdeng2/include/de/legacy/legacynetwork.h @@ -79,8 +79,7 @@ class DENG2_PUBLIC LegacyNetwork Socket *takeSocket(int socket); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/libdeng2.h b/doomsday/libdeng2/include/de/libdeng2.h index a84ec260dd..65a84fb4b5 100644 --- a/doomsday/libdeng2/include/de/libdeng2.h +++ b/doomsday/libdeng2/include/de/libdeng2.h @@ -221,6 +221,13 @@ typedef ClassName Public; \ struct ClassName::Instance : public de::Private +/** + * Macro for publicly declaring a pointer to the private implementation. + */ +#define DENG2_PRIVATE(Var) \ + struct Instance; \ + Instance *Var; + #if defined(__cplusplus) namespace de { @@ -231,8 +238,10 @@ namespace de { template struct Private { Type &self; + Type *thisPublic; typedef Private Base; - Private(Type &i) : self(i) {} + Private(Type &i) : self(i), thisPublic(&i) {} + Private(Type *i) : self(*i), thisPublic(i) {} }; template diff --git a/doomsday/libdeng2/include/de/net/address.h b/doomsday/libdeng2/include/de/net/address.h index b627fb5787..4f372012d8 100644 --- a/doomsday/libdeng2/include/de/net/address.h +++ b/doomsday/libdeng2/include/de/net/address.h @@ -101,8 +101,7 @@ class DENG2_PUBLIC Address : public LogEntry::Arg::Base LogEntry::Arg::Type logEntryArgType() const { return LogEntry::Arg::STRING; } private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; DENG2_PUBLIC QTextStream &operator << (QTextStream &os, Address const &address); diff --git a/doomsday/libdeng2/include/de/net/beacon.h b/doomsday/libdeng2/include/de/net/beacon.h index 2e31736f04..6c3bc93572 100644 --- a/doomsday/libdeng2/include/de/net/beacon.h +++ b/doomsday/libdeng2/include/de/net/beacon.h @@ -92,8 +92,7 @@ protected slots: void finished(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/net/listensocket.h b/doomsday/libdeng2/include/de/net/listensocket.h index c5eb0067ee..b76350cd43 100644 --- a/doomsday/libdeng2/include/de/net/listensocket.h +++ b/doomsday/libdeng2/include/de/net/listensocket.h @@ -70,8 +70,7 @@ protected slots: void acceptNewConnection(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/net/socket.h b/doomsday/libdeng2/include/de/net/socket.h index 3335ffcce1..2600e5246c 100644 --- a/doomsday/libdeng2/include/de/net/socket.h +++ b/doomsday/libdeng2/include/de/net/socket.h @@ -239,8 +239,7 @@ private slots: void send(IByteArray const &packet, duint channel); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) /** * ListenSocket creates instances of Socket so it needs to use diff --git a/doomsday/libdeng2/include/de/scriptsys/function.h b/doomsday/libdeng2/include/de/scriptsys/function.h index e003b153c3..e743d2462c 100644 --- a/doomsday/libdeng2/include/de/scriptsys/function.h +++ b/doomsday/libdeng2/include/de/scriptsys/function.h @@ -214,8 +214,7 @@ class DENG2_PUBLIC Function : public Counted, public ISerializable, DENG2_OBSERV ~Function(); // Counted private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/scriptsys/scriptsystem.h b/doomsday/libdeng2/include/de/scriptsys/scriptsystem.h index fff332f596..8e990b9b9e 100644 --- a/doomsday/libdeng2/include/de/scriptsys/scriptsystem.h +++ b/doomsday/libdeng2/include/de/scriptsys/scriptsystem.h @@ -61,8 +61,7 @@ class DENG2_PUBLIC ScriptSystem : public System void timeChanged(Clock const &); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/widgets/animation.h b/doomsday/libdeng2/include/de/widgets/animation.h index 90b1ef3fd7..e7091b0ab0 100644 --- a/doomsday/libdeng2/include/de/widgets/animation.h +++ b/doomsday/libdeng2/include/de/widgets/animation.h @@ -162,8 +162,7 @@ class DENG2_PUBLIC Animation : public ISerializable static Time currentTime(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) static Clock const *_clock; }; diff --git a/doomsday/libdeng2/include/de/widgets/rootwidget.h b/doomsday/libdeng2/include/de/widgets/rootwidget.h index fcbc99ab00..dd08bb8036 100644 --- a/doomsday/libdeng2/include/de/widgets/rootwidget.h +++ b/doomsday/libdeng2/include/de/widgets/rootwidget.h @@ -96,8 +96,7 @@ class DENG2_PUBLIC RootWidget : public Widget void draw(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/widgets/rule.h b/doomsday/libdeng2/include/de/widgets/rule.h index fd38fca1ff..2012c63b32 100644 --- a/doomsday/libdeng2/include/de/widgets/rule.h +++ b/doomsday/libdeng2/include/de/widgets/rule.h @@ -140,8 +140,7 @@ class DENG2_PUBLIC Rule : public Counted, public DENG2_AUDIENCE_INTERFACE(RuleIn void ruleInvalidated(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) static bool _invalidRulesExist; }; diff --git a/doomsday/libdeng2/include/de/widgets/rulerectangle.h b/doomsday/libdeng2/include/de/widgets/rulerectangle.h index 4e8128e2dd..86d10ea884 100644 --- a/doomsday/libdeng2/include/de/widgets/rulerectangle.h +++ b/doomsday/libdeng2/include/de/widgets/rulerectangle.h @@ -103,8 +103,7 @@ class DENG2_PUBLIC RuleRectangle : DENG2_OBSERVES(Clock, TimeChange) void timeChanged(Clock const &); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libdeng2/include/de/widgets/widget.h b/doomsday/libdeng2/include/de/widgets/widget.h index df7cd92885..e0f2362a50 100644 --- a/doomsday/libdeng2/include/de/widgets/widget.h +++ b/doomsday/libdeng2/include/de/widgets/widget.h @@ -131,8 +131,7 @@ class DENG2_PUBLIC Widget static void setFocusCycle(WidgetList const &order); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libgui/include/de/gui/guiapp.h b/doomsday/libgui/include/de/gui/guiapp.h index 1b5b84bb11..8b764b7302 100644 --- a/doomsday/libgui/include/de/gui/guiapp.h +++ b/doomsday/libgui/include/de/gui/guiapp.h @@ -72,8 +72,7 @@ protected slots: void refresh(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace de diff --git a/doomsday/libshell/include/de/shell/choicewidget.h b/doomsday/libshell/include/de/shell/choicewidget.h index ab08fa8322..44c19c5a4a 100644 --- a/doomsday/libshell/include/de/shell/choicewidget.h +++ b/doomsday/libshell/include/de/shell/choicewidget.h @@ -70,8 +70,7 @@ protected slots: void menuClosed(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/commandlinewidget.h b/doomsday/libshell/include/de/shell/commandlinewidget.h index 0c52bf42ae..e7dcae80da 100644 --- a/doomsday/libshell/include/de/shell/commandlinewidget.h +++ b/doomsday/libshell/include/de/shell/commandlinewidget.h @@ -41,8 +41,7 @@ class LIBSHELL_PUBLIC CommandLineWidget : public LineEditWidget void commandEntered(de::String command); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/dialogwidget.h b/doomsday/libshell/include/de/shell/dialogwidget.h index cdb59b53e7..3f248fe063 100644 --- a/doomsday/libshell/include/de/shell/dialogwidget.h +++ b/doomsday/libshell/include/de/shell/dialogwidget.h @@ -75,8 +75,7 @@ public slots: void rejected(int result); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/inputdialog.h b/doomsday/libshell/include/de/shell/inputdialog.h index 5995684944..09adf0f5d7 100644 --- a/doomsday/libshell/include/de/shell/inputdialog.h +++ b/doomsday/libshell/include/de/shell/inputdialog.h @@ -69,8 +69,7 @@ class InputDialog : public de::shell::DialogWidget int result() const; private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/labelwidget.h b/doomsday/libshell/include/de/shell/labelwidget.h index 028d9ca304..6d5b470097 100644 --- a/doomsday/libshell/include/de/shell/labelwidget.h +++ b/doomsday/libshell/include/de/shell/labelwidget.h @@ -81,8 +81,7 @@ class LIBSHELL_PUBLIC LabelWidget : public TextWidget void draw(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/lineeditwidget.h b/doomsday/libshell/include/de/shell/lineeditwidget.h index ec1c32e538..fad8fbcf30 100644 --- a/doomsday/libshell/include/de/shell/lineeditwidget.h +++ b/doomsday/libshell/include/de/shell/lineeditwidget.h @@ -101,8 +101,7 @@ class LIBSHELL_PUBLIC LineEditWidget : public TextWidget void enterPressed(de::String text); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/link.h b/doomsday/libshell/include/de/shell/link.h index dde09b0797..df95956e23 100644 --- a/doomsday/libshell/include/de/shell/link.h +++ b/doomsday/libshell/include/de/shell/link.h @@ -113,8 +113,7 @@ protected slots: void packetsReady(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/localserver.h b/doomsday/libshell/include/de/shell/localserver.h index b6626efef4..5241c1e553 100644 --- a/doomsday/libshell/include/de/shell/localserver.h +++ b/doomsday/libshell/include/de/shell/localserver.h @@ -57,8 +57,7 @@ class LIBSHELL_PUBLIC LocalServer Link *openLink(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/logwidget.h b/doomsday/libshell/include/de/shell/logwidget.h index 83494b6447..f0c79c652f 100644 --- a/doomsday/libshell/include/de/shell/logwidget.h +++ b/doomsday/libshell/include/de/shell/logwidget.h @@ -49,8 +49,7 @@ public slots: void scrollToBottom(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/menuwidget.h b/doomsday/libshell/include/de/shell/menuwidget.h index fc3bd3e483..02ad034874 100644 --- a/doomsday/libshell/include/de/shell/menuwidget.h +++ b/doomsday/libshell/include/de/shell/menuwidget.h @@ -127,8 +127,7 @@ public slots: void closed(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/protocol.h b/doomsday/libshell/include/de/shell/protocol.h index a617162df0..c67c259f3f 100644 --- a/doomsday/libshell/include/de/shell/protocol.h +++ b/doomsday/libshell/include/de/shell/protocol.h @@ -125,8 +125,7 @@ class LIBSHELL_PUBLIC MapOutlinePacket : public Packet static Packet *fromBlock(Block const &block); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; /** diff --git a/doomsday/libshell/include/de/shell/serverfinder.h b/doomsday/libshell/include/de/shell/serverfinder.h index 9febda5380..02aa28e850 100644 --- a/doomsday/libshell/include/de/shell/serverfinder.h +++ b/doomsday/libshell/include/de/shell/serverfinder.h @@ -72,8 +72,7 @@ protected slots: void updated(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/libshell/include/de/shell/textcanvas.h b/doomsday/libshell/include/de/shell/textcanvas.h index 9b6f17c963..c28d9536a3 100644 --- a/doomsday/libshell/include/de/shell/textcanvas.h +++ b/doomsday/libshell/include/de/shell/textcanvas.h @@ -216,8 +216,7 @@ class LIBSHELL_PUBLIC TextCanvas virtual void setCursorPosition(Vector2i const &pos); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; Q_DECLARE_OPERATORS_FOR_FLAGS(TextCanvas::Char::Attribs) diff --git a/doomsday/libshell/include/de/shell/textwidget.h b/doomsday/libshell/include/de/shell/textwidget.h index b852fbfedd..d64dc736f7 100644 --- a/doomsday/libshell/include/de/shell/textwidget.h +++ b/doomsday/libshell/include/de/shell/textwidget.h @@ -124,8 +124,7 @@ class LIBSHELL_PUBLIC TextWidget : public QObject, public Widget bool handleEvent(Event const &event); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; } // namespace shell diff --git a/doomsday/server/include/shelluser.h b/doomsday/server/include/shelluser.h index 7b4a4cdba6..f5d213f533 100644 --- a/doomsday/server/include/shelluser.h +++ b/doomsday/server/include/shelluser.h @@ -61,8 +61,7 @@ protected slots: void handleIncomingPackets(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // SERVER_SHELLUSER_H diff --git a/doomsday/server/src/shelluser.cpp b/doomsday/server/src/shelluser.cpp index c1442eb065..91abb54e2a 100644 --- a/doomsday/server/src/shelluser.cpp +++ b/doomsday/server/src/shelluser.cpp @@ -1,7 +1,7 @@ /** @file shelluser.cpp Remote user of a shell connection. * - * @authors Copyright © 2013 Jaakko Keränen - * @authors Copyright © 2013 Daniel Swanson + * @authors Copyright © 2013 Jaakko Keränen + * @authors Copyright © 2013 Daniel Swanson * * @par License * GPL: http://www.gnu.org/licenses/gpl.html diff --git a/doomsday/tools/shell/shell-gui/src/folderselection.h b/doomsday/tools/shell/shell-gui/src/folderselection.h index e99ae0b233..ae6e36ce8d 100644 --- a/doomsday/tools/shell/shell-gui/src/folderselection.h +++ b/doomsday/tools/shell/shell-gui/src/folderselection.h @@ -49,8 +49,7 @@ public slots: void selectFolder(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // FOLDERSELECTION_H diff --git a/doomsday/tools/shell/shell-gui/src/guishellapp.h b/doomsday/tools/shell/shell-gui/src/guishellapp.h index 45ac8a975b..541b0ce465 100644 --- a/doomsday/tools/shell/shell-gui/src/guishellapp.h +++ b/doomsday/tools/shell/shell-gui/src/guishellapp.h @@ -56,8 +56,7 @@ protected slots: void windowClosed(LinkWindow *window); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // GUISHELLAPP_H diff --git a/doomsday/tools/shell/shell-gui/src/linkwindow.h b/doomsday/tools/shell/shell-gui/src/linkwindow.h index 1b721baaf4..f1d8afaaad 100644 --- a/doomsday/tools/shell/shell-gui/src/linkwindow.h +++ b/doomsday/tools/shell/shell-gui/src/linkwindow.h @@ -61,8 +61,7 @@ protected slots: void askForPassword(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // LINKWINDOW_H diff --git a/doomsday/tools/shell/shell-gui/src/localserverdialog.h b/doomsday/tools/shell/shell-gui/src/localserverdialog.h index 9cc79e5173..04383f7bc8 100644 --- a/doomsday/tools/shell/shell-gui/src/localserverdialog.h +++ b/doomsday/tools/shell/shell-gui/src/localserverdialog.h @@ -41,8 +41,7 @@ protected slots: void validate(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // LOCALSERVERGUIDIALOG_H diff --git a/doomsday/tools/shell/shell-gui/src/opendialog.h b/doomsday/tools/shell/shell-gui/src/opendialog.h index f44eb6603f..acabbddf65 100644 --- a/doomsday/tools/shell/shell-gui/src/opendialog.h +++ b/doomsday/tools/shell/shell-gui/src/opendialog.h @@ -25,8 +25,7 @@ protected slots: void textEdited(QString); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // OPENDIALOG_H diff --git a/doomsday/tools/shell/shell-gui/src/preferences.h b/doomsday/tools/shell/shell-gui/src/preferences.h index 39b51ab349..6bf128c23e 100644 --- a/doomsday/tools/shell/shell-gui/src/preferences.h +++ b/doomsday/tools/shell/shell-gui/src/preferences.h @@ -39,8 +39,7 @@ public slots: void validate(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // PREFERENCES_H diff --git a/doomsday/tools/shell/shell-gui/src/qtguiapp.cpp b/doomsday/tools/shell/shell-gui/src/qtguiapp.cpp index 5890ed2b22..3689ed258c 100644 --- a/doomsday/tools/shell/shell-gui/src/qtguiapp.cpp +++ b/doomsday/tools/shell/shell-gui/src/qtguiapp.cpp @@ -25,12 +25,12 @@ using namespace de; -struct QtGuiApp::Instance +DENG2_PIMPL(QtGuiApp) { LogBuffer logBuffer; Clock clock; - Instance() + Instance(Public *i) : Base(i) { LogBuffer::setAppBuffer(logBuffer); Clock::setAppClock(&clock); @@ -45,7 +45,7 @@ struct QtGuiApp::Instance }; QtGuiApp::QtGuiApp(int &argc, char **argv) - : QApplication(argc, argv), d(new Instance) + : QApplication(argc, argv), d(new Instance(this)) {} QtGuiApp::~QtGuiApp() diff --git a/doomsday/tools/shell/shell-gui/src/qtguiapp.h b/doomsday/tools/shell/shell-gui/src/qtguiapp.h index 305595e3e5..3aa219f23d 100644 --- a/doomsday/tools/shell/shell-gui/src/qtguiapp.h +++ b/doomsday/tools/shell/shell-gui/src/qtguiapp.h @@ -20,6 +20,7 @@ #define QTGUIAPP_H #include +#include class QtGuiApp : public QApplication { @@ -32,8 +33,7 @@ class QtGuiApp : public QApplication bool notify(QObject *receiver, QEvent *event); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // QTGUIAPP_H diff --git a/doomsday/tools/shell/shell-gui/src/qtrootwidget.h b/doomsday/tools/shell/shell-gui/src/qtrootwidget.h index 565cc1ede9..c874b01a4e 100644 --- a/doomsday/tools/shell/shell-gui/src/qtrootwidget.h +++ b/doomsday/tools/shell/shell-gui/src/qtrootwidget.h @@ -61,8 +61,7 @@ protected slots: void cursorBlink(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // QTROOTWIDGET_H diff --git a/doomsday/tools/shell/shell-gui/src/qttextcanvas.h b/doomsday/tools/shell/shell-gui/src/qttextcanvas.h index f83449f3e6..a1a22672a7 100644 --- a/doomsday/tools/shell/shell-gui/src/qttextcanvas.h +++ b/doomsday/tools/shell/shell-gui/src/qttextcanvas.h @@ -70,8 +70,7 @@ class QtTextCanvas : public de::shell::TextCanvas void show(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // QTTEXTCANVAS_H diff --git a/doomsday/tools/shell/shell-gui/src/statuswidget.h b/doomsday/tools/shell/shell-gui/src/statuswidget.h index 7d4a33a725..4b38bd2a17 100644 --- a/doomsday/tools/shell/shell-gui/src/statuswidget.h +++ b/doomsday/tools/shell/shell-gui/src/statuswidget.h @@ -45,8 +45,7 @@ public slots: void linkDisconnected(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // STATUSWIDGET_H diff --git a/doomsday/tools/shell/shell-text/src/cursesapp.h b/doomsday/tools/shell/shell-text/src/cursesapp.h index 88e666cdb4..d39bba161a 100644 --- a/doomsday/tools/shell/shell-text/src/cursesapp.h +++ b/doomsday/tools/shell/shell-text/src/cursesapp.h @@ -38,8 +38,7 @@ protected slots: void refresh(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // CURSESAPP_H diff --git a/doomsday/tools/shell/shell-text/src/cursestextcanvas.h b/doomsday/tools/shell/shell-text/src/cursestextcanvas.h index 3d1eadb93c..5f6c783bbf 100644 --- a/doomsday/tools/shell/shell-text/src/cursestextcanvas.h +++ b/doomsday/tools/shell/shell-text/src/cursestextcanvas.h @@ -32,8 +32,7 @@ class CursesTextCanvas : public de::shell::TextCanvas void show(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // CURSESTEXTCANVAS_H diff --git a/doomsday/tools/shell/shell-text/src/localserverdialog.h b/doomsday/tools/shell/shell-text/src/localserverdialog.h index ff6fc8d6e2..80ea06b7e6 100644 --- a/doomsday/tools/shell/shell-text/src/localserverdialog.h +++ b/doomsday/tools/shell/shell-text/src/localserverdialog.h @@ -37,8 +37,7 @@ class LocalServerDialog : public de::shell::InputDialog void finish(int result); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // LOCALSERVERDIALOG_H diff --git a/doomsday/tools/shell/shell-text/src/shellapp.h b/doomsday/tools/shell/shell-text/src/shellapp.h index 0782a8b626..8f8b582a2f 100644 --- a/doomsday/tools/shell/shell-text/src/shellapp.h +++ b/doomsday/tools/shell/shell-text/src/shellapp.h @@ -48,8 +48,7 @@ public slots: void menuClosed(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // SHELLAPP_H diff --git a/doomsday/tools/shell/shell-text/src/statuswidget.h b/doomsday/tools/shell/shell-text/src/statuswidget.h index 97a9d5217d..065f76d84a 100644 --- a/doomsday/tools/shell/shell-text/src/statuswidget.h +++ b/doomsday/tools/shell/shell-text/src/statuswidget.h @@ -47,8 +47,7 @@ public slots: void linkDisconnected(); private: - struct Instance; - Instance *d; + DENG2_PRIVATE(d) }; #endif // STATUSWIDGET_H