[gens-qt4] Added "typedef BaseClass super;" to all derived classes.
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Sat, 5 Sep 2015 15:24:50 +0000 (11:24 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Sat, 5 Sep 2015 15:24:50 +0000 (11:24 -0400)
This makes it easier to access functions in the direct superclass.

Other changes:
- Added Q_DISABLE_COPY() where appropriate.
- Removed extraneous semicolons from Q_DISABLE_COPY().
  - Also Q_DECLARE_PRIVATE() and Q_DECLARE_PUBLIC().
- GensWindow: Added 'parent' and 'flags' parameters to the constructor.
  - TODO: Set flags to a preset value, like other windows?
- EmuThread:
  - Added a parent parameter to the constructor.
  - Moved isStopRequested() out of the class declaration.
    - Similar to IdleThread.

93 files changed:
src/gens-qt4/Audio/GensPortAudio.hpp
src/gens-qt4/Config/ConfigStore.cpp
src/gens-qt4/Config/ConfigStore.hpp
src/gens-qt4/Config/CtrlConfig.cpp
src/gens-qt4/Config/CtrlConfig.hpp
src/gens-qt4/Config/PathConfig.cpp
src/gens-qt4/Config/PathConfig.hpp
src/gens-qt4/Config/RecentRoms.cpp
src/gens-qt4/Config/RecentRoms.hpp
src/gens-qt4/ConfigHandler.cpp
src/gens-qt4/ConfigHandler.hpp
src/gens-qt4/EmuManager.cpp
src/gens-qt4/EmuManager.hpp
src/gens-qt4/EmuManager_str.cpp
src/gens-qt4/EmuThread.cpp
src/gens-qt4/EmuThread.hpp
src/gens-qt4/GensQApplication.cpp
src/gens-qt4/GensQApplication.hpp
src/gens-qt4/GensQApplication_win32.cpp
src/gens-qt4/IdleThread.cpp
src/gens-qt4/IdleThread.hpp
src/gens-qt4/Input/KeyHandlerQt.cpp
src/gens-qt4/Input/KeyHandlerQt.hpp
src/gens-qt4/RomDB/McdRomDB.cpp
src/gens-qt4/RomDB/McdRomDB.hpp
src/gens-qt4/SigHandler.hpp
src/gens-qt4/VBackend/FpsManager.cpp
src/gens-qt4/VBackend/FpsManager.hpp
src/gens-qt4/VBackend/GLBackend.cpp
src/gens-qt4/VBackend/GLBackend.hpp
src/gens-qt4/VBackend/GLShader.cpp
src/gens-qt4/VBackend/GLShader.hpp
src/gens-qt4/VBackend/GLShaderFastBlur.cpp
src/gens-qt4/VBackend/GLShaderFastBlur.hpp
src/gens-qt4/VBackend/GLShaderManager.cpp
src/gens-qt4/VBackend/GLShaderManager.hpp
src/gens-qt4/VBackend/GLShaderPaused.cpp
src/gens-qt4/VBackend/GLShaderPaused.hpp
src/gens-qt4/VBackend/GLTex2D.cpp
src/gens-qt4/VBackend/GLTex2D.hpp
src/gens-qt4/VBackend/GensQGLWidget.hpp
src/gens-qt4/VBackend/GensQGLWidget_p.hpp
src/gens-qt4/VBackend/VBackend.cpp
src/gens-qt4/VBackend/VBackend.hpp
src/gens-qt4/cdrom/FindCdromBase.cpp
src/gens-qt4/cdrom/FindCdromBase.hpp
src/gens-qt4/cdrom/FindCdromDrives.cpp
src/gens-qt4/cdrom/FindCdromDrives.hpp
src/gens-qt4/cdrom/FindCdromUDisks.cpp
src/gens-qt4/cdrom/FindCdromUDisks.hpp
src/gens-qt4/cdrom/FindCdromUDisks2.cpp
src/gens-qt4/cdrom/FindCdromUDisks2.hpp
src/gens-qt4/cdrom/FindCdromUnix.cpp
src/gens-qt4/cdrom/FindCdromUnix.hpp
src/gens-qt4/cdrom/FindCdromWin32.cpp
src/gens-qt4/cdrom/FindCdromWin32.hpp
src/gens-qt4/widgets/GensColorButton.cpp
src/gens-qt4/widgets/GensColorButton.hpp
src/gens-qt4/widgets/GensColorComboBox.cpp
src/gens-qt4/widgets/GensColorComboBox.hpp
src/gens-qt4/widgets/GensCtrlCfgWidget.cpp
src/gens-qt4/widgets/GensCtrlCfgWidget.hpp
src/gens-qt4/widgets/GensCtrlKeyWidget.cpp
src/gens-qt4/widgets/GensCtrlKeyWidget.hpp
src/gens-qt4/widgets/GensCtrlKeyWidget_p.hpp
src/gens-qt4/widgets/GensKeySequenceWidget.cpp
src/gens-qt4/widgets/GensKeySequenceWidget.hpp
src/gens-qt4/widgets/GensKeySequenceWidget_p.hpp
src/gens-qt4/widgets/GensLineEdit.cpp
src/gens-qt4/widgets/GensLineEdit.hpp
src/gens-qt4/widgets/GensZipDirItem.cpp
src/gens-qt4/widgets/GensZipDirItem.hpp
src/gens-qt4/widgets/GensZipDirModel.cpp
src/gens-qt4/widgets/GensZipDirModel.hpp
src/gens-qt4/widgets/RecentRomsMenu.cpp
src/gens-qt4/widgets/RecentRomsMenu.hpp
src/gens-qt4/windows/AboutDialog.cpp
src/gens-qt4/windows/AboutDialog.hpp
src/gens-qt4/windows/CtrlConfigWindow.cpp
src/gens-qt4/windows/CtrlConfigWindow.hpp
src/gens-qt4/windows/GeneralConfigWindow.cpp
src/gens-qt4/windows/GeneralConfigWindow.hpp
src/gens-qt4/windows/GeneralConfigWindow_p.hpp
src/gens-qt4/windows/GeneralConfigWindow_slots.cpp
src/gens-qt4/windows/GensMenuShortcuts.cpp
src/gens-qt4/windows/GensMenuShortcuts.hpp
src/gens-qt4/windows/GensMenuShortcuts_p.hpp
src/gens-qt4/windows/GensWindow.cpp
src/gens-qt4/windows/GensWindow.hpp
src/gens-qt4/windows/McdControlWindow.cpp
src/gens-qt4/windows/McdControlWindow.hpp
src/gens-qt4/windows/ZipSelectDialog.cpp
src/gens-qt4/windows/ZipSelectDialog.hpp

index 82059c1..b6a9ea2 100644 (file)
@@ -46,6 +46,10 @@ class GensPortAudio : public ABackend
                GensPortAudio();
                ~GensPortAudio();
 
+       private:
+               typedef ABackend super;
+
+       public:
                inline bool isOpen(void) const { return m_open; }
 
                void open(void);
index cd63c40..8c4c1bc 100644 (file)
@@ -73,7 +73,7 @@ class ConfigStorePrivate
 
        private:
                ConfigStore *const q_ptr;
-               Q_DECLARE_PUBLIC(ConfigStore);
+               Q_DECLARE_PUBLIC(ConfigStore)
        private:
                Q_DISABLE_COPY(ConfigStorePrivate)
 
@@ -288,7 +288,7 @@ void ConfigStorePrivate::InvokeQtMethod(QObject *object, int method_idx, const Q
 /** ConfigStore **/
 
 ConfigStore::ConfigStore(QObject *parent)
-       : QObject(parent)
+       : super(parent)
        , d_ptr(new ConfigStorePrivate(this))
 {
        // Initialize defaults and load user settings.
index 4f2075c..2683f7f 100644 (file)
@@ -56,6 +56,7 @@ class ConfigStore : public QObject
                ~ConfigStore();
 
        private:
+               typedef QObject super;
                ConfigStorePrivate *const d_ptr;
                Q_DECLARE_PRIVATE(ConfigStore)
        private:
index 15b0637..2a3e445 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -39,8 +39,7 @@ using LibGensKeys::KeyManager;
 // ARRAY_SIZE()
 #include "libgens/macros/common.h"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class CtrlConfigPrivate
 {
@@ -49,6 +48,8 @@ class CtrlConfigPrivate
        private:
                CtrlConfigPrivate() { }
                ~CtrlConfigPrivate() { }
+
+       private:
                Q_DISABLE_COPY(CtrlConfigPrivate)
 
        public:
index cafe06f..63ded89 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -34,8 +34,7 @@ class QSettings;
 // LibGensKeys.
 #include "libgenskeys/KeyManager.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class CtrlConfig
 {
@@ -44,7 +43,9 @@ class CtrlConfig
        private:
                CtrlConfig() { }
                ~CtrlConfig() { }
-               Q_DISABLE_COPY(CtrlConfig);
+
+       private:
+               Q_DISABLE_COPY(CtrlConfig)
 
        public:
                /**
index cba60e8..10d87f0 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -37,8 +37,7 @@
 #define DIR_SENSITIVITY Qt::CaseSensitive
 #endif
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class PathConfigPrivate
 {
@@ -288,7 +287,7 @@ QString PathConfigPrivate::toAbsolutePath(const QString &path) const
 /** PathConfig **/
 
 PathConfig::PathConfig(QObject *parent)
-       : QObject(parent)
+       : super(parent)
        , d_ptr(new PathConfigPrivate(this))
 { }
 
index c57d357..c4965d9 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -29,8 +29,7 @@
 #include <QtCore/QString>
 #include <QtCore/QSettings>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class PathConfigPrivate;
 
@@ -43,6 +42,7 @@ class PathConfig : public QObject
                virtual ~PathConfig();
        
        private:
+               typedef QObject super;
                PathConfigPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(PathConfig)
        private:
@@ -72,8 +72,7 @@ class PathConfig : public QObject
                 * Configuration path.
                 * TODO: Add support for plugin configuration paths.
                 */
-               enum ConfigPath
-               {
+               enum ConfigPath {
                        GCPATH_CONFIG           = 0,    // Same as cfgPath.
                        GCPATH_SAVESTATES       = 1,    // Savestates.
                        GCPATH_SRAM             = 2,    // Cartridge SRAM.
index faf9e7f..3c3a715 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 #define FILENAME_CASE_SENSITIVE Qt::CaseSensitive
 #endif
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 /** Static RecentRoms members. **/
 const int RecentRoms::MAX_ROMS = 9;
 
 RecentRoms::RecentRoms(QObject *parent)
-       : QObject(parent)
+       : super(parent)
 { }
 
 /**
index 9ef1fb9..0f7ea67 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -32,11 +32,9 @@ class QSettings;
 // LibGens includes.
 #include "libgens/Rom.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
-struct RecentRom_t
-{
+struct RecentRom_t {
        QString filename;       // ROM filename.
        QString z_filename;     // Internal filename for multi-file archives.
        LibGens::Rom::MDP_SYSTEM_ID sysId;      // System ID.
@@ -50,6 +48,8 @@ class RecentRoms : public QObject
                RecentRoms(QObject *parent = 0);
 
        private:
+               typedef QObject super;
+       private:
                Q_DISABLE_COPY(RecentRoms)
 
        public:
@@ -99,6 +99,7 @@ class RecentRoms : public QObject
                void updated(void);
 
        protected:
+               // TODO: Move to a private class?
                QList<RecentRom_t> m_lstRoms;
 };
 
index f96b042..526e761 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * ConfigHandler.hpp: General configuration signal handler.                *
  *                                                                         *
- * Copyright (c) 2008-2011 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 #include <QtCore/QString>
 #include <QtCore/QVariant>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 ConfigHandler::ConfigHandler(QObject *parent)
-       : QObject(parent)
+       : super(parent)
 {
        // Initialize the external programs.
        extprgUnRAR_changed_slot(gqt4_cfg->get(QLatin1String("External_Programs/UnRAR")));
index 6340587..c88ec86 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * ConfigHandler.hpp: General configuration signal handler.                *
  *                                                                         *
- * Copyright (c) 2008-2011 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -28,8 +28,7 @@
 // PathConfig.
 #include "Config/PathConfig.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 // General configuration signal handler.
 class ConfigHandler : public QObject
@@ -38,7 +37,12 @@ class ConfigHandler : public QObject
        
        public:
                ConfigHandler(QObject *parent = 0);
-       
+
+       private:
+               typedef QObject super;
+       private:
+               Q_DISABLE_COPY(ConfigHandler)
+
        public slots:
                void extprgUnRAR_changed_slot(const QVariant &extprgUnRAR);
 
index 520a6e7..9e8bff0 100644 (file)
@@ -77,7 +77,7 @@ using LibGens::EmuContextFactory;
 namespace GensQt4 {
 
 EmuManager::EmuManager(QObject *parent, VBackend *vBackend)
-       : QObject(parent)
+       : super(parent)
        , m_keyManager(nullptr)
        , m_vBackend(vBackend)
        , m_romClosedFb(nullptr)
index 3eecf7a..961429f 100644 (file)
@@ -55,6 +55,12 @@ class EmuManager : public QObject
                EmuManager(QObject *parent = 0, VBackend *vBackend = 0);
                ~EmuManager();
 
+       private:
+               typedef QObject super;
+       private:
+               Q_DISABLE_COPY(EmuManager)
+
+       public:
                int openRom(void);
                int openRom(const QString &filename, const QString &z_filename = QString());
                int loadRom(LibGens::Rom *rom);
index ecf20bd..6db2454 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                            *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                         *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                                *
- * Copyright (c) 2008-2011 by David Korth.                                    *
+ * Copyright (c) 2008-2015 by David Korth.                                    *
  *                                                                            *
  * This program is free software; you can redistribute it and/or modify       *
  * it under the terms of the GNU General Public License as published by       *
 
 #include "EmuManager.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 /**
- * LgRegionCodeStr(): Get a string identifying a given LibGens region code.
+ * Get a string identifying a given LibGens region code.
  * @param region Region code.
  * @return Region code string, or empty string on error.
  */
 QString EmuManager::LgRegionCodeStr(LibGens::SysVersion::RegionCode_t region)
 {
-       switch (region)
-       {
+       switch (region) {
                case LibGens::SysVersion::REGION_AUTO:          return tr("Auto-Detect");
                case LibGens::SysVersion::REGION_JP_NTSC:       return tr("Japan (NTSC)");
                case LibGens::SysVersion::REGION_ASIA_PAL:      return tr("Asia (PAL)");
@@ -42,71 +40,60 @@ QString EmuManager::LgRegionCodeStr(LibGens::SysVersion::RegionCode_t region)
                case LibGens::SysVersion::REGION_EU_PAL:        return tr("Europe (PAL)");
                default:        return QString();
        }
-       
+
        // Should not get here...
        return QString();
 }
 
-
 /**
- * LgRegionCodeStrMD(): Get a string identifying a given region code. (MD hex code)
+ * Get a string identifying a given region code. (MD hex code)
  * @param region Region. (1, 2, 4, 8)
  * @return Region code string, or empty string on error.
  */
 QString EmuManager::LgRegionCodeStrMD(int region)
 {
-       switch (region & 0xF)
-       {
+       switch (region & 0xF) {
                case 0x1:       return tr("Japan (NTSC)");
                case 0x2:       return tr("Asia (PAL)");
                case 0x4:       return tr("USA (NTSC)");
                case 0x8:       return tr("Europe (PAL)");
                default:        return QString();
        }
-       
+
        // Should not get here...
        return QString();
 }
 
-
 /**
- * SysName(): Get the system name for the specified system ID and region.
+ * Get the system name for the specified system ID and region.
  * @param sysID System ID.
  * @param region Region.
  * @return System name, or empty string on error.
  */
 QString EmuManager::SysName(LibGens::Rom::MDP_SYSTEM_ID sysId, LibGens::SysVersion::RegionCode_t region)
 {
-       switch (sysId)
-       {
+       switch (sysId) {
                case LibGens::Rom::MDP_SYSTEM_MD:
                        // Genesis / Mega Drive.
-                       if (region == LibGens::SysVersion::REGION_US_NTSC)
-                       {
+                       if (region == LibGens::SysVersion::REGION_US_NTSC) {
                                //: MD ROM region is US/NTSC. System name should be the equivalent of "Genesis".
                                return tr("Genesis", "rom-region");
-                       }
-                       else
-                       {
+                       } else {
                                //: MD ROM region is not US/NTSC. System name should be the equivalent of "Mega Drive".
                                return tr("Mega Drive", "rom-region");
                        }
-               
+
                case LibGens::Rom::MDP_SYSTEM_MCD:
-                       if (region == LibGens::SysVersion::REGION_US_NTSC)
-                       {
+                       if (region == LibGens::SysVersion::REGION_US_NTSC) {
                                //: MCD disc region is US/NTSC. System name should be the equivalent of "Sega CD".
                                return tr("Sega CD", "rom-region");
-                       }
-                       else
-                       {
+                       } else {
                                //: MCD disc region is not US/NTSC. System name should be the equivalent of "Mega CD".
                                return tr("Mega CD", "rom-region");
                        }
-               
+
                case LibGens::Rom::MDP_SYSTEM_32X:
-                       switch (region)
-                       {
+                       switch (region) {
                                default:
                                case LibGens::SysVersion::REGION_US_NTSC:
                                        //: 32X ROM is US/NTSC. System name should be the equivalent of "Sega 32X".
@@ -119,139 +106,132 @@ QString EmuManager::SysName(LibGens::Rom::MDP_SYSTEM_ID sysId, LibGens::SysVersi
                                        //: 32X ROM is JP or ASIA. System name should be the equivalent of "Super 32X".
                                        return tr("Super 32X", "rom-region");
                        }
-               
+
                case LibGens::Rom::MDP_SYSTEM_MCD32X:
-                       if (region == LibGens::SysVersion::REGION_US_NTSC)
-                       {
+                       if (region == LibGens::SysVersion::REGION_US_NTSC) {
                                //: Sega CD 32X disc region is US/NTSC. System name should be the equivalent of "Sega CD 32X".
                                return tr("Sega CD 32X", "rom-region");
-                       }
-                       else
-                       {
+                       } else {
                                //: Sega CD 32X disc region is US/NTSC. System name should be the equivalent of "Mega CD 32X".
                                return tr("Mega CD 32X", "rom-region");
                        }
-               
+
                case LibGens::Rom::MDP_SYSTEM_SMS:
                        //: Master System. (No localized names yet...)
                        return tr("Master System", "rom-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_GG:
                        //: Game Gear. (No localized names yet...)
                        return tr("Game Gear", "rom-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_SG1000:
                        //: SG-1000. (No localized names yet...)
                        return tr("SG-1000", "rom-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_PICO:
                        //: Pico. (No localized names yet...)
                        return tr("Pico", "rom-region");
-               
+
                default:
                        return QString();
        }
-       
+
        // Should not get here...
        return QString();
 }
 
-
 /**
- * SysName_l(): Get the localized system name for the specified system ID.
+ * Get the localized system name for the specified system ID.
  * @param sysID System ID.
  * @return Localized system name, or empty string on error.
  */
 QString EmuManager::SysName_l(LibGens::Rom::MDP_SYSTEM_ID sysId)
 {
-       switch (sysId)
-       {
+       switch (sysId) {
                case LibGens::Rom::MDP_SYSTEM_MD:
                        //: Localized name of Sega Genesis.
                        return tr("Genesis", "local-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_MCD:
                        //: Localized name of Sega CD.
                        return tr("Sega CD", "local-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_32X:
                        //: Localized name of Sega 32X.
                        return tr("Sega 32X", "local-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_MCD32X:
                        //: Localized name of Sega CD 32X.
                        return tr("Sega CD 32X", "local-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_SMS:
                        //: Localized name of Master System.
                        return tr("Master System", "local-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_GG:
                        //: Localized name of Game Gear.
                        return tr("Game Gear", "local-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_SG1000:
                        //: Localized name of SG-1000.
                        return tr("SG-1000", "local-region");
-               
+
                case LibGens::Rom::MDP_SYSTEM_PICO:
                        //: Localized name of Pico.
                        return tr("Pico", "local-region");
-               
+
                default:
                        return QString();
        }
-       
+
        // Should not get here...
        return QString();
 }
 
-
 /**
- * RomFormat(): Get the ROM format name for the specified ROM format ID.
+ * Get the ROM format name for the specified ROM format ID.
  * @param romFormat ROM format ID.
  * @return ROM format name, or empty string on error.
  */
 QString EmuManager::RomFormat(LibGens::Rom::RomFormat romFormat)
 {
-       switch (romFormat)
-       {
+       switch (romFormat) {
                case LibGens::Rom::RFMT_BINARY:
                        //: Plain binary ROM dump.
                        return tr("Binary", "rom-format");
-               
+
                case LibGens::Rom::RFMT_SMD:
                        //: Interleaved ROM dump from a Super Magic Drive.
                        return tr("Super Magic Drive", "rom-format");
-               
+
                case LibGens::Rom::RFMT_SMD_SPLIT:
                        //: Split interleaved ROM dump from a Super Magic Drive.
                        return tr("Super Magic Drive (split)", "rom-format");
-               
+
                case LibGens::Rom::RFMT_MGD:
                        //: Interleaved ROM dump from a Multi Game Doctor.
                        return tr("Multi Game Doctor", "rom-format");
-               
+
                case LibGens::Rom::RFMT_CD_CUE:
                        //: CD-ROM cue sheet. (Used for BIN/CUE.)
                        return tr("CD-ROM cue sheet", "rom-format");
-               
+
                case LibGens::Rom::RFMT_CD_ISO_2048:
                case LibGens::Rom::RFMT_CD_ISO_2352:
                        //: Standard ISO-9660 CD-ROM disc image.
                        return tr("ISO-9660 CD-ROM image (%1-byte sectors)", "rom-format")
                                .arg(romFormat == LibGens::Rom::RFMT_CD_ISO_2048 ? 2048 : 2352);
-               
+
                case LibGens::Rom::RFMT_CD_BIN_2048:
                case LibGens::Rom::RFMT_CD_BIN_2352:
                        //: BIN portion of BIN/CUE CD-ROM disc image.
                        return tr("Raw CD-ROM image (%1-byte sectors)", "rom-format")
                                .arg(romFormat == LibGens::Rom::RFMT_CD_BIN_2048 ? 2048 : 2352);
-               
+
                default:
                        return QString();
        }
-       
+
        // Should not get here...
        return QString();
 }
index ed7b232..b0f17b5 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2010 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 #include "EmuThread.hpp"
 #include "gqt4_main.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
-EmuThread::EmuThread()
+EmuThread::EmuThread(QObject *parent)
+       : super(parent)
 {
        m_stop = false;
        m_doFastFrame = false;
index d957ab7..ffa62ae 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2010 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 #include <QtCore/QWaitCondition>
 #include <QtCore/QMutex>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class EmuThread : public QThread
 {
        Q_OBJECT
-       
+
        public:
-               EmuThread();
+               EmuThread(QObject *parent = 0);
                ~EmuThread();
-               
-               inline bool isStopRequested(void)
-               {
-                       m_mutex.lock();
-                       bool ret = m_stop;
-                       m_mutex.unlock();
-                       return ret;
-               }
-       
+
+       private:
+               typedef QThread super;
+       private:
+               Q_DISABLE_COPY(EmuThread)
+
+       public:
+               inline bool isStopRequested(void);
+
        signals:
                void frameDone(bool wasFastFrame);
-       
+
        public slots:
                void resume(bool doFastFrame = false);
                void stop(void);
-       
+
        protected:
                void run(void);
                QWaitCondition m_wait;
                QMutex m_mutex;
-               
+
                bool m_stop;
                bool m_doFastFrame;
 };
 
+/**
+ * Check if a stop is requested.
+ * @return True if a stop is requested; false otherwise.
+ */
+inline bool EmuThread::isStopRequested(void)
+{
+       m_mutex.lock();
+       bool ret = m_stop;
+       m_mutex.unlock();
+       return ret;
+}
+
 }
 
 #endif /* __GENS_QT4_EMUTHREAD_HPP__ */
index e7f6ecf..ddd5754 100644 (file)
@@ -176,21 +176,21 @@ void GensQApplicationPrivate::setGensTranslation(const QString &locale)
  *******************************/
 
 GensQApplication::GensQApplication(int &argc, char **argv)
-       : QApplication(argc, argv)
+       : super(argc, argv)
        , d(new GensQApplicationPrivate(this))
 {
        d->gqaInit();
 }
 
 GensQApplication::GensQApplication(int &argc, char **argv, bool GUIenabled)
-       : QApplication(argc, argv, GUIenabled)
+       : super(argc, argv, GUIenabled)
        , d(new GensQApplicationPrivate(this))
 {
        d->gqaInit();
 }
 
 GensQApplication::GensQApplication(int &argc, char **argv, Type type)
-       : QApplication(argc, argv, type)
+       : super(argc, argv, type)
        , d(new GensQApplicationPrivate(this))
 {
        d->gqaInit();
@@ -296,7 +296,7 @@ QIcon GensQApplication::StandardIcon(QStyle::StandardPixmap standardIcon,
                                const QStyleOption *option,
                                const QWidget *widget)
 {
-       QStyle *style = QApplication::style();
+       QStyle *style = super::style();
        QIcon icon;
        const char *xdg_icon = nullptr;
 
index 23c6c86..f426f83 100644 (file)
@@ -48,6 +48,14 @@ class GensQApplication : public QApplication
                GensQApplication(int &argc, char **argv, Type type);
                virtual ~GensQApplication();
 
+       private:
+               typedef QApplication super;
+               friend class GensQApplicationPrivate;
+               GensQApplicationPrivate *const d;
+       private:
+               Q_DISABLE_COPY(GensQApplication)
+
+       public:
                /**
                 * Check if the current thread is the GUI thread.
                 * @return True if it is; false if it isn't.
@@ -106,11 +114,6 @@ class GensQApplication : public QApplication
 #endif /* HAVE_SIGACTION */
        
        private:
-               friend class GensQApplicationPrivate;
-               GensQApplicationPrivate *const d;
-
-               Q_DISABLE_COPY(GensQApplication)
-
 #ifdef Q_OS_WIN32
                /**
                 * Set the Qt font to match the system font.
index 090aad4..38d165d 100644 (file)
@@ -128,7 +128,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
 namespace GensQt4 {
 
 /**
- * winEventFilter(): Win32 event filter.
+ * Win32 event filter.
  * @param msg Win32 message.
  * @param result Return value for the window procedure.
  * @return True if we're handling the message; false if we should let Qt handle the message.
@@ -153,7 +153,7 @@ bool GensQApplication::winEventFilter(MSG *msg, long *result)
 }
 
 /**
- * SetFont_Win32(): Set the Qt font to match the system font.
+ * Set the Qt font to match the system font.
  */
 void GensQApplication::SetFont_Win32(void)
 {
@@ -189,7 +189,7 @@ void GensQApplication::SetFont_Win32(void)
                        nFontSize, -1, ncm.lfMessageFont.lfItalic);
 
        // Set the Qt application font.
-       QApplication::setFont(qAppFont);
+       super::setFont(qAppFont);
 }
 
 }
index 2b9f52c..4493da6 100644 (file)
@@ -33,7 +33,7 @@
 namespace GensQt4 {
 
 IdleThread::IdleThread(QObject *parent)
-       : QThread(parent)
+       : super(parent)
 {
        m_stop = false;
 
index db7856c..a73ffc3 100644 (file)
@@ -5,7 +5,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2011 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 // Crazy Effect class.
 #include "libgens/Effects/CrazyEffect.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class IdleThread : public QThread
 {
        Q_OBJECT
-       
+
        public:
                IdleThread(QObject *parent = 0);
                ~IdleThread();
-               
-               bool isStopRequested(void);
-       
+
+       private:
+               typedef QThread super;
+       private:
+               Q_DISABLE_COPY(IdleThread)
+
+       public:
+               inline bool isStopRequested(void);
+
        signals:
                void frameDone(void);
-       
+
        public slots:
                void resume(void);
                void stop(void);
-       
+
        protected:
                void run(void);
-       
+
        private:
                QWaitCondition m_wait;
                QMutex m_mutex;
                bool m_stop;
-               
+
                LibGens::CrazyEffect *m_crazyEffect;
 };
 
-
 /**
- * isStopRequested(): Check if a stop is requested.
+ * Check if a stop is requested.
  * @return True if a stop is requested; false otherwise.
  */
 inline bool IdleThread::isStopRequested(void)
index 21f3478..7654061 100644 (file)
@@ -54,7 +54,7 @@ namespace GensQt4 {
  * NOTE: This class does NOT delete keyManager on shutdown!
  */
 KeyHandlerQt::KeyHandlerQt(QObject *parent, LibGensKeys::KeyManager *keyManager)
-       : QObject(parent)
+       : super(parent)
        , m_keyManager(keyManager)
 { }
 
index 3227e28..5005785 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2010 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -40,11 +40,17 @@ namespace GensQt4 {
 class KeyHandlerQt : public QObject
 {
        Q_OBJECT
-       
+
        public:
                KeyHandlerQt(QObject *parent = 0, LibGensKeys::KeyManager *keyManager = 0);
                ~KeyHandlerQt();
 
+       private:
+               typedef QObject super;
+       private:
+               Q_DISABLE_COPY(KeyHandlerQt)
+
+       public:
                LibGensKeys::KeyManager *keyManager(void) const;
                void setKeyManager(LibGensKeys::KeyManager *keyManager);
 
@@ -53,7 +59,7 @@ class KeyHandlerQt : public QObject
                static GensKey_t NativeModifierToKeyVal(QKeyEvent *event);
 
                /**
-                * KeyValMToQtKey(): Convert a GensKey_t to a Qt key value, with GensKey modifiers.
+                * Convert a GensKey_t to a Qt key value, with GensKey modifiers.
                 * @param keyM Gens keycode, with modifiers.
                 * @return Qt key value, or 0 on error.
                 */
@@ -69,6 +75,8 @@ class KeyHandlerQt : public QObject
                void mouseReleaseEvent(QMouseEvent *event);
 
        private:
+               // TODO: Move to a private class?
+
                // Key Manager.
                LibGensKeys::KeyManager *m_keyManager;
 
index ec8a7c2..eae9016 100644 (file)
@@ -38,7 +38,7 @@ class McdRomDBPrivate
                ~McdRomDBPrivate() { }
 
        private:
-               Q_DISABLE_COPY(McdRomDBPrivate);
+               Q_DISABLE_COPY(McdRomDBPrivate)
 
        public:
                /**
index 42d299b..46722e2 100644 (file)
@@ -31,7 +31,8 @@
 
 namespace GensQt4 {
 
-class McdRomDB : public QObject {
+class McdRomDB : public QObject
+{
        Q_OBJECT
 
        // Static class.
@@ -42,7 +43,9 @@ class McdRomDB : public QObject {
                ~McdRomDB();
 
        private:
-               Q_DISABLE_COPY(McdRomDB);
+               typedef QObject super;
+       private:
+               Q_DISABLE_COPY(McdRomDB)
 
        public:
                // Region codes.
index ea4fc2c..b09c732 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville                       *
  * Copyright (c) 2003-2004 by Stéphane Akhoun                              *
- * Copyright (c) 2008-2009 by David Korth                                  *
+ * Copyright (c) 2008-2015 by David Korth                                  *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 // LibGens includes
 #include "libgens/Util/gens_siginfo.h"
 
-namespace GensQt4
-{
+// Q_DISABLE_COPY()
+#include <QtCore/qglobal.h>
+
+namespace GensQt4 {
 
 // Forward declaration of GensQApplication.
 class GensQApplication;
@@ -45,12 +47,14 @@ class SigHandler
        public:
                static void Init(void);
                static void End(void);
-       
+
        private:
                // Static class; prevent instantiation.
                SigHandler() { }
                ~SigHandler() { }
-               
+       private:
+               Q_DISABLE_COPY(SigHandler)
+
 #ifdef HAVE_SIGACTION
                static const gens_signal_t *GetSigInfo(int signum, int si_code);
                static void SignalHandler(int signum, siginfo_t *info, void *context);
index bd729d1..dc04184 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2012 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 // ARRAY_SIZE(x)
 #include "libgens/macros/common.h"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 FpsManager::FpsManager(QObject *parent)
-       : QObject(parent)
+       : super(parent)
        , m_fpsAvg(0.0)
        , m_fpsPtr(0)
 {
        // Reset the FPS array.
-       for (int i = 0; i < ARRAY_SIZE(m_fps); i++)
+       for (int i = 0; i < ARRAY_SIZE(m_fps); i++) {
                m_fps[i] = -1.0;
+       }
 }
 
 /**
@@ -49,8 +49,9 @@ void FpsManager::reset(void)
        m_fpsPtr = 0;
 
        // Reset the FPS array.
-       for (int i = 0; i < ARRAY_SIZE(m_fps); i++)
+       for (int i = 0; i < ARRAY_SIZE(m_fps); i++) {
                m_fps[i] = -1.0;
+       }
 
        // Average FPS has been updated.
        emit updated(m_fpsAvg);
@@ -75,10 +76,11 @@ void FpsManager::push(double fps)
                }
        }
 
-       if (count <= 0)
+       if (count <= 0) {
                m_fpsAvg = 0.0;
-       else
+       } else {
                m_fpsAvg = (sum / (double)count);
+       }
 
        // Average FPS has been updated.
        emit updated(m_fpsAvg);
index 8139abc..9728537 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2012 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 
 #include <QtCore/QObject>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FpsManager : public QObject
 {
        Q_OBJECT
-       
+
        public:
                FpsManager(QObject *parent = 0);
-       
+
        private:
-               Q_DISABLE_COPY(FpsManager);
-       
+               typedef QObject super;
+       private:
+               Q_DISABLE_COPY(FpsManager)
+
        public:
                /**
                 * Reset the FPS manager.
                 */
                void reset(void);
-               
+
                /**
                 * Push an FPS value.
                 * @param fps FPS value.
                 */
                void push(double fps);
-               
+
                /**
                 * Get the current average FPS.
                 * @return Current average FPS.
                 */
                double get(void);
-       
+
        signals:
                /**
                 * The FPS manager has been updated.
                 * @param fps New average FPS.
                 */
                void updated(double fps);
-       
+
        private:
+               // TODO: Make this a private class?
                double m_fps[8];
                double m_fpsAvg;        // Average fps.
                int m_fpsPtr;           // Pointer to next fps slot to use.
index 47c59a9..d549060 100644 (file)
@@ -56,7 +56,7 @@ namespace GensQt4 {
  * Initialize the common OpenGL backend.
  */
 GLBackend::GLBackend(QWidget *parent, KeyHandlerQt *keyHandler)
-       : VBackend(parent, keyHandler)
+       : super(parent, keyHandler)
        
        // TODO: Have GensQGLWidget set the window size.
        , m_winSize(320, 240)
@@ -1053,7 +1053,7 @@ void GLBackend::glb_clearPreviewTex(void)
 void GLBackend::osd_show_preview(int duration, const QImage& img)
 {
        // Call the base function first.
-       VBackend::osd_show_preview(duration, img);
+       super::osd_show_preview(duration, img);
 
        // Delete the preview texture to force a refresh.
        glb_clearPreviewTex();
@@ -1169,7 +1169,7 @@ void GLBackend::bilinearFilter_changed_slot(const QVariant &newBilinearFilter)
        }
 
        // Call VBackend's bilinearFilter_changed_slot().
-       VBackend::bilinearFilter_changed_slot(newBilinearFilter);
+       super::bilinearFilter_changed_slot(newBilinearFilter);
 }
 
 
@@ -1189,7 +1189,7 @@ void GLBackend::pauseTint_changed_slot(const QVariant &newPauseTint)
        }
 
        // Call VBackend's pauseTint_changed_slot().
-       VBackend::pauseTint_changed_slot(newPauseTint);
+       super::pauseTint_changed_slot(newPauseTint);
 }
 
 
@@ -1214,7 +1214,7 @@ void GLBackend::stretchMode_changed_slot(const QVariant &newStretchMode)
        recalcStretchRectF(stretch);
 
        // Call VBackend's stretchMode_changed_slot().
-       VBackend::stretchMode_changed_slot(newStretchMode);
+       super::stretchMode_changed_slot(newStretchMode);
 }
 
 }
index 7b92a4e..6d3d1c6 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
  ***************************************************************************/
 
 /**
- * GLCommon is intended to be used as a private member
+ * GLBackend is intended to be used as a private member
  * of a class that inherits from VBackend.
  */
 
-#ifndef __GENS_QT4_VBACKEND_GLCOMMON_HPP__
-#define __GENS_QT4_VBACKEND_GLCOMMON_HPP__
+#ifndef __GENS_QT4_VBACKEND_GLBACKEND_HPP__
+#define __GENS_QT4_VBACKEND_GLBACKEND_HPP__
 
 #include <gens-qt4/config.gens-qt4.h>
 
@@ -52,8 +52,7 @@
 #include <QtGui/QWidget>
 #include <QtGui/QColor>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GLBackend : public VBackend
 {
@@ -63,6 +62,12 @@ class GLBackend : public VBackend
                GLBackend(QWidget *parent, KeyHandlerQt *keyHandler = 0);
                virtual ~GLBackend();
 
+       private:
+               typedef VBackend super;
+       private:
+               Q_DISABLE_COPY(GLBackend)
+
+       public:
 #ifdef HAVE_GLEW
                /**
                 * Get a list of the OpenGL extensions in use.
@@ -208,4 +213,4 @@ inline void GLBackend::glb_setColor(const QColor& color)
 
 }
 
-#endif /* __GENS_QT4_VBACKEND_GLCOMMON_HPP__ */
+#endif /* __GENS_QT4_VBACKEND_GLBACKEND_HPP__ */
index a8cc9cf..f1aa33e 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GLShader.cpp: OpenGL Shader. (Base Class)                               *
  *                                                                         *
- * Copyright (c) 2010-2011 by David Korth.                                 *
+ * Copyright (c) 2010-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 
 #include "GLShader.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 GLShader::GLShader()
 {
        // Clear all the variables.
        m_shaderType = ST_NONE;
-       
+
 #ifdef HAVE_GLEW
        // OpenGL shader variables.
        m_ARB_program = 0;
@@ -40,15 +39,13 @@ GLShader::~GLShader()
        end();
 }
 
-
 /**
- * end(): Shut down the shader.
+ * Shut down the shader.
  * This must be run from within a valid GL context!
  */
 void GLShader::end(void)
 {
-       switch (m_shaderType)
-       {
+       switch (m_shaderType) {
                case ST_GL_ARB_FRAGMENT_PROGRAM:
 #ifdef ENABLE_ATI_TEXT_FRAGMENT_SHADER
                case ST_GL_ATI_TEXT_FRAGMENT_SHADER:
@@ -57,25 +54,23 @@ void GLShader::end(void)
                        if (m_ARB_program > 0)
                                glDeleteProgramsARB(1, &m_ARB_program);
                        break;
-               
+
                case ST_GL_ATI_FRAGMENT_SHADER:
                        if (m_ATI_fragment_shader > 0)
                                glDeleteFragmentShaderATI(m_ATI_fragment_shader);
                        break;
-               
+
                default:
                        break;
        }
 }
 
-
 /**
- * enable(): Enable the shader.
+ * Enable the shader.
  */
 void GLShader::enable(void)
 {
-       switch (shaderType())
-       {
+       switch (shaderType()) {
                case ST_GL_ARB_FRAGMENT_PROGRAM:
 #ifdef ENABLE_ATI_TEXT_FRAGMENT_SHADER
                case ST_GL_ATI_TEXT_FRAGMENT_SHADER:
@@ -83,7 +78,7 @@ void GLShader::enable(void)
                {
                        if (m_ARB_program == 0)
                                break;
-                       
+
 #ifdef ENABLE_ATI_TEXT_FRAGMENT_SHADER
                        const GLenum prgType = (shaderType() == ST_GL_ARB_FRAGMENT_PROGRAM
                                                ? GL_FRAGMENT_PROGRAM_ARB
@@ -92,34 +87,32 @@ void GLShader::enable(void)
 #else /* !ENABLE_ATI_TEXT_FRAGMENT_SHADER */
                        const GLenum prgType = GL_FRAGMENT_PROGRAM_ARB;
 #endif /* ENABLE_ATI_TEXT_FRAGMENT_SHADER */
-                       
+
                        // Enable the shader.
                        glEnable(prgType);
                        glBindProgramARB(prgType, m_ARB_program);
                        break;
                }
-               
+
                case ST_GL_ATI_FRAGMENT_SHADER:
                        if (m_ATI_fragment_shader == 0)
                                break;
-                       
+
                        glEnable(GL_FRAGMENT_SHADER_ATI);
                        glBindFragmentShaderATI(m_ATI_fragment_shader);
                        break;
-               
+
                default:
                        break;
        }
 }
 
-
 /**
- * disable(): Disable the shader.
+ * Disable the shader.
  */
 void GLShader::disable(void)
 {
-       switch (shaderType())
-       {
+       switch (shaderType()) {
                case ST_GL_ARB_FRAGMENT_PROGRAM:
 #ifdef ENABLE_ATI_TEXT_FRAGMENT_SHADER
                case ST_GL_ATI_TEXT_FRAGMENT_SHADER:
@@ -127,7 +120,7 @@ void GLShader::disable(void)
                {
                        if (m_ARB_program <= 0)
                                break;
-                       
+
 #ifdef ENABLE_ATI_TEXT_FRAGMENT_SHADER
                        const GLenum prgType = (shaderType() == ST_GL_ARB_FRAGMENT_PROGRAM
                                                ? GL_FRAGMENT_PROGRAM_ARB
@@ -136,12 +129,11 @@ void GLShader::disable(void)
 #else /* !ENABLE_ATI_TEXT_FRAGMENT_SHADER */
                        const GLenum prgType = GL_FRAGMENT_PROGRAM_ARB;
 #endif /* ENABLE_ATI_TEXT_FRAGMENT_SHADER */
-                       
+
                        // Disable the shader.
                        glDisable(prgType);
 #ifdef ENABLE_ATI_TEXT_FRAGMENT_SHADER
-                       if (shaderType() == ST_GL_ATI_TEXT_FRAGMENT_SHADER)
-                       {
+                       if (shaderType() == ST_GL_ATI_TEXT_FRAGMENT_SHADER) {
                                // HACK: at least the Mac OS X 10.5 PPC Radeon drivers are broken and
                                // without this disable the texture units while the program is still
                                // running (10.4 PPC seems to work without this though).
@@ -152,14 +144,14 @@ void GLShader::disable(void)
 #endif /* ENABLE_ATI_TEXT_FRAGMENT_SHADER */
                        break;
                }
-               
+
                case ST_GL_ATI_FRAGMENT_SHADER:
                        if (m_ATI_fragment_shader == 0)
                                break;
-                       
+
                        glDisable(GL_FRAGMENT_SHADER_ATI);
                        break;
-               
+
                default:
                        break;
        }
index 2dcb141..924ae93 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GLShader.hpp: OpenGL Shader. (Base Class)                               *
  *                                                                         *
- * Copyright (c) 2010-2011 by David Korth.                                 *
+ * Copyright (c) 2010-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 #include <GL/glew.h>
 #endif
 
+// Q_DISABLE_COPY()
+#include <QtCore/qglobal.h>
+
 // Disabled for now due to problems with Mac OS X 10.5.7 PPC.
 // (Radeon 9000 series video card)
 //#define ENABLE_ATI_TEXT_FRAGMENT_SHADER
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GLShader
 {
        public:
                GLShader();
                virtual ~GLShader();
-               
+
+       private:
+               Q_DISABLE_COPY(GLShader)
+
+       public:
                /**
-                * init(): Initialize the shader.
+                * Initialize the shader.
                 * This must be run from within a valid GL context!
                 */
                virtual void init(void) = 0;
-               
+
                /**
-                * end(): Shut down the shader.
+                * Shut down the shader.
                 * This must be run from within a valid GL context!
                 */
                virtual void end(void);
-               
+
                /** TODO: Separate enable() / disable(), or a single setEnabled()? **/
-               
+
                /**
-                * enable(): Enable the shader.
+                * Enable the shader.
                 */
                virtual void enable(void);
-               
+
                /**
-                * disable(): Disable the shader.
+                * Disable the shader.
                 */
                void disable(void);
-               
-               enum GLShaderType
-               {
+
+               enum GLShaderType {
                        ST_NONE                         = 0,
                        ST_GL_ARB_FRAGMENT_PROGRAM,
                        ST_GL_ATI_FRAGMENT_SHADER,
@@ -77,34 +82,34 @@ class GLShader
                        
                        ST_MAX
                };
-               
+
                /**
-                * shaderType(): Determine the type of shader.
+                * Determine the type of shader.
                 * @return Shader type.
                 */
                GLShaderType shaderType(void) const
                        { return m_shaderType; }
-       
+
        protected:
                /** Shader type. **/
                void setShaderType(GLShaderType newShaderType)
                        { m_shaderType = newShaderType; }
-               
+
 #ifdef HAVE_GLEW
                /** OpenGL shader variables. **/
                // (GLEW is required.)
-               
+
                /**
                 * m_ARB_program: ID of either GL_ARB_vertex_program or GL_ARB_fragment_program.
                 */
                GLuint m_ARB_program;
-               
+
                /**
                 * m_ATI_fragment_shader: ID of GL_ATI_fragment_shader.
                 */
                GLuint m_ATI_fragment_shader;
 #endif /* HAVE_GLEW */
-       
+
        private:
                /** Shader type. **/
                GLShaderType m_shaderType;
index 90b2b67..7918981 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GLShaderFastBlur.cpp: OpenGL Shader. (Fast Blur)                        *
  *                                                                         *
- * Copyright (c) 2010-2011 by David Korth.                                 *
+ * Copyright (c) 2010-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -27,8 +27,7 @@
 // C includes.
 #include <string.h>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 #ifdef HAVE_GLEW
 /** Shaders. **/
@@ -56,12 +55,11 @@ void GLShaderFastBlur::init()
 {
 #ifdef HAVE_GLEW
        GLenum err;
-       
-       if (GLEW_ARB_fragment_program || GLEW_VERSION_2_0)
-       {
+
+       if (GLEW_ARB_fragment_program || GLEW_VERSION_2_0) {
                // GL_ARB_fragment_program is supported.
                // Load the Paused effect fragment program.
-               
+
                // TODO: Check for errors!
                glGenProgramsARB(1, &m_ARB_program);
                glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_ARB_program);
@@ -69,24 +67,20 @@ void GLShaderFastBlur::init()
                glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
                                        strlen(ms_GL_ARB_fragment_program),
                                        ms_GL_ARB_fragment_program);
-               
+
                err = glGetError();
-               if (err == GL_NO_ERROR)
-               {
+               if (err == GL_NO_ERROR) {
                        // Fragment program loaded.
                        setShaderType(ST_GL_ARB_FRAGMENT_PROGRAM);
-               }
-               else
-               {
+               } else {
                        // An error occured while loading the fragment program.
                        // TODO: Remove the extra newline at the end of err_str.
                        const char *err_str = (const char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB);
                        LOG_MSG(video, LOG_MSG_LEVEL_ERROR,
                                "Error creating Fast Blur effect ARB FP: %s", (err_str ? err_str : "(unknown)"));
-                       
+
                        // Delete the fragment program.
-                       if (m_ARB_program > 0)
-                       {
+                       if (m_ARB_program > 0) {
                                glDeleteProgramsARB(1, &m_ARB_program);
                                m_ARB_program = 0;
                                setShaderType(ST_NONE);
@@ -98,7 +92,7 @@ void GLShaderFastBlur::init()
 
 
 /**
- * enable(): Enable the shader.
+ * Enable the shader.
  */
 void GLShaderFastBlur::enable(void)
 {
@@ -106,7 +100,7 @@ void GLShaderFastBlur::enable(void)
                return;
        if (m_ARB_program <= 0)
                return;
-       
+
        // Enable the shader.
        // TODO: Get texture width for the parameter!
        glEnable(GL_FRAGMENT_PROGRAM_ARB);
index 5274dc6..3aeb00a 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GLShaderFastBlur.hpp: OpenGL Shader. (Fast Blur)                        *
  *                                                                         *
- * Copyright (c) 2010-2011 by David Korth.                                 *
+ * Copyright (c) 2010-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 
 #include "GLShader.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GLShaderFastBlur : public GLShader
 {
        public:
+               GLShaderFastBlur() { }
+
+       private:
+               typedef GLShader super;
+       private:
+               Q_DISABLE_COPY(GLShaderFastBlur)
+
+       public:
                /**
-                * init(): Initialize the shader.
+                * Initialize the shader.
                 * This must be run from within a valid GL context!
                 */
                void init(void);
-               
+
                /**
-                * enable(): Enable the shader.
+                * Enable the shader.
                 */
                void enable(void);
-       
+
        private:
                /** Shaders. **/
 #ifdef HAVE_GLEW
index b4cb1b2..b3631c2 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GLShaderManager.cpp: OpenGL Shader Manager.                             *
  *                                                                         *
- * Copyright (c) 2010-2011 by David Korth.                                 *
+ * Copyright (c) 2010-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 // C includes.
 #include <string.h>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 GLShaderManager::GLShaderManager()
 {
        m_init = false;
 }
 
-
 GLShaderManager::~GLShaderManager()
 {
        if (m_init)
                end();
 }
 
-
 /**
- * init(): Initialize the GL Shader Manager.
+ * Initialize the GL Shader Manager.
  * This must be run from within a valid GL context!
  */
 void GLShaderManager::init(void)
 {
 #ifdef HAVE_GLEW
        // NOTE: GLEW must have been initialized previously.
-       
+
        // Initialize shaders.
        m_shader_paused.init();
        m_shader_fastBlur.init();
 #endif /* HAVE_GLEW */
-       
+
        // OpenGL Shader Manager is initialized.
        m_init = true;
 }
 
-
 /**
- * end(): Shut down the GL Shader Manager.
+ * Shut down the GL Shader Manager.
  * This must be run from within a valid GL context!
  */
 void GLShaderManager::end(void)
 {
        if (!m_init)
                return;
-       
+
        // Shut down the OpenGL Shader Manager.
-       
+
 #ifdef HAVE_GLEW
        // Shut down the shaders.
        m_shader_paused.end();
@@ -80,10 +76,9 @@ void GLShaderManager::end(void)
 #endif /* HAVE_GLEW */
 }
 
-
 #ifdef HAVE_GLEW
 /**
- * GLExtsInUse(): Get a list of the OpenGL extensions in use.
+ * Get a list of the OpenGL extensions in use.
  * @return List of OpenGL extensions in use.
  */
 QStringList GLShaderManager::GLExtsInUse(void)
@@ -98,17 +93,17 @@ QStringList GLShaderManager::GLExtsInUse(void)
 #endif
        else if (GLEW_ATI_fragment_shader)
                exts.append(QLatin1String("GL_ATI_fragment_shader"));
-       
+
        // TODO: Other GL extensions.
 #if 0
        if (GLEW_ARB_vertex_program)
                exts.append(QLatin1String("GL_ARB_vertex_program"));
-       
+
        if (GLEW_ARB_vertex_shader)
                exts.append(QLatin1String("GL_ARB_vertex_shader"));
        else if (GLEW_EXT_vertex_shader)
                exts.append(QLatin1String("GL_EXT_vertex_shader"));
-       
+
        if (GLEW_ARB_fragment_shader)
                exts.append(QLatin1String("GL_ARB_fragment_shader"));
        if (GLEW_ARB_fragment_shader)
@@ -118,19 +113,17 @@ QStringList GLShaderManager::GLExtsInUse(void)
        if (GLEW_ARB_shader_objects)
                exts.append(QLatin1String("GL_ARB_shader_objects"));
 #endif
-       
+
        // Return the list of extensions.
        return exts;
 }
 #endif /* HAVE_GLEW */
 
-
 /** Set Shader functions. **/
 
-
 #ifdef HAVE_GLEW
 /**
- * setPaused(): Set the Paused shader.
+ * Set the Paused shader.
  * @param enabled True to enable; false to disable.
  */
 void GLShaderManager::setPaused(bool newEnabled)
@@ -142,9 +135,8 @@ void GLShaderManager::setPaused(bool newEnabled)
                m_shader_paused.disable();
 }
 
-
 /**
- * setFastBlur(): Set the Fast Blur shader.
+ * Set the Fast Blur shader.
  * @param enabled True to enable; false to disable.
  */
 void GLShaderManager::setFastBlur(bool newEnabled)
index 901f5bd..daf048d 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GLShaderManager.hpp: OpenGL Shader Manager.                             *
  *                                                                         *
- * Copyright (c) 2010-2011 by David Korth.                                 *
+ * Copyright (c) 2010-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 #include "GLShaderPaused.hpp"
 #include "GLShaderFastBlur.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GLShaderManager
 {
        public:
                GLShaderManager();
                ~GLShaderManager();
-               
+
+       private:
+               Q_DISABLE_COPY(GLShaderManager)
+
+       public:
                /**
-                * init(): Initialize the GL Shader Manager.
+                * Initialize the GL Shader Manager.
                 * This must be run from within a valid GL context!
                 */
                void init(void);
-               
+
                /**
-                * end(): Shut down the GL Shader Manager.
+                * Shut down the GL Shader Manager.
                 * This must be run from within a valid GL context!
                 */
                void end(void);
-               
+
                inline bool isInit(void) const
                        { return m_init; }
-               
+
 #ifdef HAVE_GLEW
                /**
-                * GLExtsInUse(): Get a list of the OpenGL extensions in use.
+                * Get a list of the OpenGL extensions in use.
                 * @return List of OpenGL extensions in use.
                 */
                static QStringList GLExtsInUse(void);
 #endif /* HAVE_GLEW */
-               
+
                /** Query available shaders. **/
 #ifdef HAVE_GLEW
                inline bool hasPaused(void) const
@@ -80,7 +83,7 @@ class GLShaderManager
                inline bool hasFastBlur(void) const
                        { return false; }
 #endif /* HAVE_GLEW */
-               
+
                /** Set Shader functions. **/
 #ifdef HAVE_GLEW
                void setPaused(bool enabled);
@@ -96,10 +99,10 @@ class GLShaderManager
                void setFastBlur(bool enabled)
                        { ((void)enabled); }
 #endif /* HAVE_GLEW */
-       
+
        protected:
                bool m_init;    // True if the GL Shader Manager is initialized.
-               
+
 #ifdef HAVE_GLEW
                /** OpenGL shaders. **/
                GLShaderPaused m_shader_paused;
index 8b5f53e..e2b9877 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GLShaderPaused.cpp: OpenGL Shader. (Paused Effect)                      *
  *                                                                         *
- * Copyright (c) 2010-2011 by David Korth.                                 *
+ * Copyright (c) 2010-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -27,8 +27,7 @@
 // C includes.
 #include <string.h>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 #ifdef HAVE_GLEW
 /** Shaders. **/
@@ -77,12 +76,12 @@ void GLShaderPaused::init()
 {
 #ifdef HAVE_GLEW
        GLenum err;
-       
+
        if (GLEW_ARB_fragment_program || GLEW_VERSION_2_0)
        {
                // GL_ARB_fragment_program is supported.
                // Load the Paused effect fragment program.
-               
+
                // TODO: Check for errors!
                glGenProgramsARB(1, &m_ARB_program);
                glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_ARB_program);
@@ -90,24 +89,20 @@ void GLShaderPaused::init()
                glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
                                        strlen(ms_GL_ARB_fragment_program),
                                        ms_GL_ARB_fragment_program);
-               
+
                err = glGetError();
-               if (err == GL_NO_ERROR)
-               {
+               if (err == GL_NO_ERROR) {
                        // Fragment program loaded.
                        setShaderType(ST_GL_ARB_FRAGMENT_PROGRAM);
-               }
-               else
-               {
+               } else {
                        // An error occured while loading the fragment program.
                        // TODO: Remove the extra newline at the end of err_str.
                        const char *err_str = (const char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB);
                        LOG_MSG(video, LOG_MSG_LEVEL_ERROR,
                                "Error creating Paused effect ARB FP: %s", (err_str ? err_str : "(unknown)"));
-                       
+
                        // Delete the fragment program.
-                       if (m_ARB_program > 0)
-                       {
+                       if (m_ARB_program > 0) {
                                glDeleteProgramsARB(1, &m_ARB_program);
                                m_ARB_program = 0;
                                setShaderType(ST_NONE);
@@ -121,7 +116,7 @@ void GLShaderPaused::init()
                // Load the fragment shaders.
                // TODO: Combine with ARB fragment programs code above.
                // The code is the same, but it uses different values and strings.
-               
+
                // Load the Paused effect fragment shader.
                // TODO: Check for errors!
                glGenProgramsARB(1, &m_ARB_program);
@@ -130,24 +125,20 @@ void GLShaderPaused::init()
                glProgramStringARB(GL_TEXT_FRAGMENT_SHADER_ATI, GL_PROGRAM_FORMAT_ASCII_ARB,
                                        strlen(ms_GL_ATI_text_fragment_shader),
                                        ms_GL_ATI_text_fragment_shader);
-               
+
                err = glGetError();
-               if (err == GL_NO_ERROR)
-               {
+               if (err == GL_NO_ERROR) {
                        // Fragment program loaded.
                        setShaderType(ST_GL_ATI_TEXT_FRAGMENT_SHADER);
-               }
-               else
-               {
+               } else {
                        // An error occured while loading the fragment program.
                        // TODO: Remove the extra newline at the end of err_str.
                        const char *err_str = (const char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB);
                        LOG_MSG(video, LOG_MSG_LEVEL_ERROR,
                                "Error creating Paused effect ATI TEXT FS: %s", (err_str ? err_str : "(unknown)"));
-                       
+
                        // Delete the fragment program.
-                       if (m_ARB_program > 0)
-                       {
+                       if (m_ARB_program > 0) {
                                glDeleteProgramsARB(1, &m_ARB_program);
                                m_ARB_program = 0;
                                setShaderType(ST_NONE);
@@ -161,28 +152,28 @@ void GLShaderPaused::init()
                m_ATI_fragment_shader = glGenFragmentShadersATI(1);
                glBindFragmentShaderATI(m_ATI_fragment_shader);
                glBeginFragmentShaderATI();
-               
+
                // Constants.
                static const float RGBtoGrayscale[4] = {0.299f, 0.587f, 0.114f, 0.0f};
                glSetFragmentShaderConstantATI(GL_CON_0_ATI, RGBtoGrayscale);
-               
+
                // SampleMap r0, t0.str;
                glSampleMapATI(GL_REG_0_ATI, GL_TEXTURE0_ARB, GL_SWIZZLE_STR_ATI);
-               
+
                // DOT3 r0.rgb, r0, c0;
                glColorFragmentOp2ATI(GL_DOT3_ATI,
                                GL_REG_0_ATI, (GL_RED_BIT_ATI | GL_GREEN_BIT_ATI | GL_BLUE_BIT_ATI), GL_NONE,
                                GL_REG_0_ATI, GL_NONE, GL_NONE,
                                GL_CON_0_ATI, GL_NONE, GL_NONE);
-               
+
                // ADD r0.b.sat, r0.b, r0.b;
                glColorFragmentOp2ATI(GL_ADD_ATI,
                                GL_REG_0_ATI, GL_BLUE_BIT_ATI, GL_SATURATE_BIT_ATI,
                                GL_REG_0_ATI, GL_BLUE_BIT_ATI, GL_NONE,
                                GL_REG_0_ATI, GL_BLUE_BIT_ATI, GL_NONE);
-               
+
                glEndFragmentShaderATI();
-               
+
                // Set the shader type.
                setShaderType(ST_GL_ATI_FRAGMENT_SHADER);
        }
@@ -190,5 +181,3 @@ void GLShaderPaused::init()
 }
 
 }
-
-
index a14686f..b1cca55 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GLShaderPaused.hpp: OpenGL Shader. (Paused Effect)                      *
  *                                                                         *
- * Copyright (c) 2010-2011 by David Korth.                                 *
+ * Copyright (c) 2010-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 
 #include "GLShader.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GLShaderPaused : public GLShader
 {
        public:
+               GLShaderPaused() { }
+
+       private:
+               typedef GLShader super;
+       private:
+               Q_DISABLE_COPY(GLShaderPaused)
+
+       public:
                /**
-                * init(): Initialize the shader.
+                * Initialize the shader.
                 * This must be run from within a valid GL context!
                 */
                void init(void);
-       
+
        private:
                /** Shaders. **/
 #ifdef HAVE_GLEW
index a6e9370..a33c1e3 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2011 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -33,8 +33,7 @@
 // LOG_MSG() subsystem.
 #include "libgens/macros/log_msg.h"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 GLTex2D::GLTex2D()
 {
@@ -54,24 +53,21 @@ GLTex2D::GLTex2D(const QImage& img)
        m_pow2_h = 0.0;
        m_img_w = 0;
        m_img_h = 0;
-       
+
        // Set the image.
        setImage(img);
 }
 
-
 GLTex2D::~GLTex2D()
 {
-       if (m_tex > 0)
-       {
+       if (m_tex > 0) {
                glDeleteTextures(1, &m_tex);
                m_tex = 0;
        }
 }
 
-
 /**
- * setImage(): Set the texture image from a QImage.
+ * Set the texture image from a QImage.
  * @param img QImage.
  */
 void GLTex2D::setImage(const QImage& img)
index 6a082ec..91e9ce0 100644 (file)
@@ -54,8 +54,7 @@
 // Qt includes.
 #include <QtGui/QImage>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GLTex2D
 {
@@ -64,44 +63,47 @@ class GLTex2D
                GLTex2D(const QImage& img);
                ~GLTex2D();
                
+       private:
+               Q_DISABLE_COPY(GLTex2D)
+
+       public:
                void setImage(const QImage& img);
-               
+
                inline GLuint tex(void) const
                        { return m_tex; }
-               
+
                // Pow2-adjusted image size.
                inline GLdouble pow2_w(void) const
                        { return m_pow2_w; }
                inline GLdouble pow2_h(void) const
                        { return m_pow2_h; }
-               
+
                // Original image size.
                inline int img_w(void) const
                        { return m_img_w; }
                inline int img_h(void) const
                        { return m_img_h; }
-       
+
        private:
                GLuint m_tex;
-               
+
                // Pow2-adjusted image size.
                GLdouble m_pow2_w;
                GLdouble m_pow2_h;
-               
+
                // Original image size.
                int m_img_w;
                int m_img_h;
-               
+
                // Image format.
                GLenum m_format;
                GLenum m_type;
                int m_components;
-               
+
                // Find the next highest power of two. (signed integers)
                // http://en.wikipedia.org/wiki/Power_of_two#Algorithm_to_find_the_next-highest_power_of_two
                template <class T>
-               static inline T next_pow2s(T k)
-               {
+               static inline T next_pow2s(T k) {
                        k--;
                        for (int i = 1; i < (int)(sizeof(T)*CHAR_BIT); i <<= 1)
                                k = k | k >> i;
index 8112571..a50d65a 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -37,8 +37,7 @@ class QVBoxLayout;
 // Key Handler.
 #include "Input/KeyHandlerQt.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensQGLWidgetPrivate;
 
@@ -50,25 +49,30 @@ class GensQGLWidget : public GLBackend
                GensQGLWidget(QWidget *parent = 0, KeyHandlerQt *keyHandler = 0);
                virtual ~GensQGLWidget();
                
+       private:
+               typedef GLBackend super;
+               friend class GensQGLWidgetPrivate;
+               GensQGLWidgetPrivate *d;
+       private:
+               Q_DISABLE_COPY(GensQGLWidget)
+
+       public:
                void vbUpdate_int(void);
-               
+
                /**
-                * sizeHint(): Qt size hint.
+                * Qt size hint.
                 * TODO: Return something other than 320x240 depending on renderer?
                 * @return Preferred widget size.
                 */
                QSize sizeHint(void) const { return QSize(320, 240); }
-       
+
        protected slots:
                void fastBlur_changed_slot(const QVariant &newFastBlur);                // bool
                void bilinearFilter_changed_slot(const QVariant &newBilinearFilter);    // bool
                void pauseTint_changed_slot(const QVariant &newPauseTint);              // bool
-       
+
        private:
-               friend class GensQGLWidgetPrivate;
-               GensQGLWidgetPrivate *d;
-               Q_DISABLE_COPY(GensQGLWidget);
-               
+               // TODO: Move to a private class?
                QVBoxLayout *m_layout;
 };
 
index cd5c7fd..446012a 100644 (file)
@@ -5,7 +5,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2011 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -37,17 +37,24 @@ namespace GensQt4
 class GensQGLWidgetPrivate : public QGLWidget
 {
        Q_OBJECT
-       
+
        public:
                GensQGLWidgetPrivate(GensQGLWidget *q);
-       
+
+       private:
+               typedef QGLWidget super;
+       private:
+               friend class GensQGLWidget;
+               GensQGLWidget *const q;
+               Q_DISABLE_COPY(GensQGLWidgetPrivate)
+
        protected:
                // Keyboard handler functions.
                void keyPressEvent(QKeyEvent *event)
                        { q->m_keyHandler->keyPressEvent(event); }
                void keyReleaseEvent(QKeyEvent *event)
                        { q->m_keyHandler->keyReleaseEvent(event); }
-               
+
                // Mouse handler functions.
                void mouseMoveEvent(QMouseEvent *event)
                        { q->m_keyHandler->mouseMoveEvent(event); }
@@ -55,19 +62,15 @@ class GensQGLWidgetPrivate : public QGLWidget
                        { q->m_keyHandler->mousePressEvent(event); }
                void mouseReleaseEvent(QMouseEvent *event)
                        { q->m_keyHandler->mouseReleaseEvent(event); }
-               
+
                // QGLWidget protected functions.
                void initializeGL(void);
                void resizeGL(int width, int height);
                void paintGL(void);
-       
-       private:
-               GensQGLWidget *q;
-               Q_DISABLE_COPY(GensQGLWidgetPrivate);
 };
 
 inline GensQGLWidgetPrivate::GensQGLWidgetPrivate(GensQGLWidget *q)
-       : QGLWidget(QGLFormat(QGL::NoAlphaChannel | QGL::NoDepthBuffer), q)
+       : super(QGLFormat(QGL::NoAlphaChannel | QGL::NoDepthBuffer), q)
        , q(q)
 {
        // Accept keyboard focus.
index 88211c1..0d1855c 100644 (file)
@@ -46,7 +46,7 @@ using LibGens::MdFb;
 namespace GensQt4 {
 
 VBackend::VBackend(QWidget *parent, KeyHandlerQt *keyHandler)
-       : QWidget(parent)
+       : super(parent)
 
        // No source framebuffer initially.
        , m_srcFb(nullptr)
index 65d540a..70dbbd4 100644 (file)
@@ -76,12 +76,17 @@ class VBackend : public QWidget
                VBackend(QWidget *parent = 0, KeyHandlerQt *keyHandler = 0);
                virtual ~VBackend();
 
+       private:
+               typedef QWidget super;
+       private:
+               Q_DISABLE_COPY(VBackend)
+
+       public:
                void setVbDirty(void)
                        { m_vbDirty = true; }
                void setMdScreenDirty(void)
                        { m_mdScreenDirty = true; }
 
-       // Video Backend update function.
        public:
                /**
                 * Video Backend update function.
index 56ed612..23c8275 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromBase.cpp: Find CD-ROM drives: OS-specific base class.          *
  *                                                                         *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 
 #include "FindCdromBase.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 FindCdromBase::FindCdromBase(QObject *parent)
-       : QObject(parent)
+       : super(parent)
 { }
 
 FindCdromBase::~FindCdromBase()
index 4cde823..292ad84 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromBase.hpp: Find CD-ROM drives: OS-specific base class.          *
  *                                                                         *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -27,8 +27,7 @@
 #include <QtCore/QStringList>
 #include <QtGui/QIcon>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromBase : public QObject
 {
@@ -38,6 +37,12 @@ class FindCdromBase : public QObject
                FindCdromBase(QObject *parent = 0);
                virtual ~FindCdromBase();
 
+       private:
+               typedef QObject super;
+       private:
+               Q_DISABLE_COPY(FindCdromBase)
+
+       public:
                /**
                 * Determine if this CD-ROM backend is usable.
                 * @return True if this CD-ROM backend is usable; false if not.
index 9dd4a81..1ae8a05 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromDrives.cpp: Find CD-ROM drives: Manager class.                 *
  *                                                                         *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -45,8 +45,7 @@
 #include "cdrom/FindCdromUnix.hpp"
 #endif
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromDrivesPrivate
 {
@@ -56,7 +55,7 @@ class FindCdromDrivesPrivate
 
        private:
                FindCdromDrives *const q_ptr;
-               Q_DECLARE_PUBLIC(FindCdromDrives);
+               Q_DECLARE_PUBLIC(FindCdromDrives)
        private:
                Q_DISABLE_COPY(FindCdromDrivesPrivate)
 
@@ -318,7 +317,7 @@ QIcon FindCdromDrivesPrivate::GetDiscTypeIcon(CD_DiscType_t discType)
 /** FindCdromDrives **/
 
 FindCdromDrives::FindCdromDrives(QObject *parent)
-       : QObject(parent)
+       : super(parent)
        , d_ptr(new FindCdromDrivesPrivate(this))
 {
        // Rescan disc drives.
index 7bac6ee..c5c2a1f 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromDrives.hpp: Find CD-ROM drives: Manager class.                 *
  *                                                                         *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -33,9 +33,7 @@
 #include <QtCore/QStringList>
 #include <QtGui/QIcon>
 
-
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromDrivesPrivate;
 
@@ -48,10 +46,11 @@ class FindCdromDrives : public QObject
                ~FindCdromDrives();
 
        private:
+               typedef QObject super;
                FindCdromDrivesPrivate *const d_ptr;
-               Q_DECLARE_PRIVATE(FindCdromDrives);
+               Q_DECLARE_PRIVATE(FindCdromDrives)
        private:
-               Q_DISABLE_COPY(FindCdromDrives);
+               Q_DISABLE_COPY(FindCdromDrives)
 
        public:
                /**
index b154f9a..310b47e 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromUDisks.cpp: Find CD-ROM drives: UDisks1 version.               *
  *                                                                         *
- * Copyright (c) 2011-2013 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -44,8 +44,7 @@ using std::auto_ptr;
 // LOG_MSG() subsystem.
 #include "libgens/macros/log_msg.h"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromUDisksPrivate
 {
@@ -77,7 +76,7 @@ FindCdromUDisksPrivate::~FindCdromUDisksPrivate()
 
 
 FindCdromUDisks::FindCdromUDisks(QObject *parent)
-       : FindCdromBase(parent)
+       : super(parent)
        , d(new FindCdromUDisksPrivate(this))
 {
        // Connect to UDisks over D-BUS.
index aca2d1e..86be6a4 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromUDisks.hpp: Find CD-ROM drives: UDisks1 version.               *
  *                                                                         *
- * Copyright (c) 2011-2013 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -27,8 +27,7 @@
 // QtDBus includes.
 #include <QtDBus/QDBusObjectPath>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromUDisksPrivate;
 
@@ -41,8 +40,10 @@ class FindCdromUDisks : public FindCdromBase
                virtual ~FindCdromUDisks();
 
        private:
+               typedef FindCdromBase super;
                friend class FindCdromUDisksPrivate;
                FindCdromUDisksPrivate *const d;
+       private:
                Q_DISABLE_COPY(FindCdromUDisks)
 
        public:
index 728bafa..5f65404 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromUDisks2.cpp: Find CD-ROM drives: UDisks2 version.              *
  *                                                                         *
- * Copyright (c) 2011-2013 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -47,8 +47,7 @@ using std::auto_ptr;
 // LOG_MSG() subsystem.
 #include "libgens/macros/log_msg.h"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromUDisks2Private
 {
@@ -126,7 +125,7 @@ FindCdromUDisks2Private::~FindCdromUDisks2Private()
 
 
 FindCdromUDisks2::FindCdromUDisks2(QObject *parent)
-       : FindCdromBase(parent)
+       : super(parent)
        , d(new FindCdromUDisks2Private(this))
 {
        // We should have a UDisk2 Object Manager connection.
index 041c3d7..2eb2ff2 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromUDisks2.hpp: Find CD-ROM drives: UDisks2 version.              *
  *                                                                         *
- * Copyright (c) 2011-2013 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -27,8 +27,7 @@
 // QtDBus includes.
 #include <QtDBus/QDBusObjectPath>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromUDisks2Private;
 
@@ -41,8 +40,10 @@ class FindCdromUDisks2 : public FindCdromBase
                virtual ~FindCdromUDisks2();
 
        private:
+               typedef FindCdromBase super;
                friend class FindCdromUDisks2Private;
                FindCdromUDisks2Private *const d;
+       private:
                Q_DISABLE_COPY(FindCdromUDisks2)
 
        public:
index f5c8294..48fd3ea 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                     *
  * FindCdromUnix.cpp: Find CD-ROM drives: UNIX fallback.                      *
  *                                                                            *
- * Copyright (c) 2011-2013 by David Korth.                                    *
+ * Copyright (c) 2011-2015 by David Korth.                                    *
  *                                                                            *
  * This program is free software; you can redistribute it and/or modify       *
  * it under the terms of the GNU General Public License as published by       *
@@ -38,9 +38,7 @@
 #include <QtCore/QDir>
 #include <QtCore/QStringList>
 
-
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromUnixPrivate
 {
@@ -71,7 +69,7 @@ const char *const FindCdromUnixPrivate::UnixDevNames[] =
  ****************************/
 
 FindCdromUnix::FindCdromUnix(QObject *parent)
-       : FindCdromBase(parent)
+       : super(parent)
 { }
 
 /**
index 938990e..f038070 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromUnix.hpp: Find CD-ROM drives: UNIX fallback.                   *
  *                                                                         *
- * Copyright (c) 2011-2013 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -24,8 +24,7 @@
 
 #include "FindCdromBase.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromUnix : public FindCdromBase
 {
@@ -35,7 +34,9 @@ class FindCdromUnix : public FindCdromBase
                FindCdromUnix(QObject *parent = 0);
 
        private:
-               Q_DISABLE_COPY(FindCdromUnix);
+               typedef FindCdromBase super;
+       private:
+               Q_DISABLE_COPY(FindCdromUnix)
 
        public:
                /**
index a89989c..f06433c 100644 (file)
@@ -56,7 +56,7 @@ class FindCdromWin32Private
        private:
                FindCdromWin32Private() { }
                ~FindCdromWin32Private() { }
-               Q_DISABLE_COPY(FindCdromWin32Private);
+               Q_DISABLE_COPY(FindCdromWin32Private)
 
        public:
                static HICON GetShilIcon(int iIcon, int iImageList);
@@ -116,7 +116,7 @@ HICON FindCdromWin32Private::GetShilIcon(int iIcon, int iImageList)
 /** FindCdromWin32 **/
 
 FindCdromWin32::FindCdromWin32(QObject *parent)
-       : FindCdromBase(parent)
+       : super(parent)
 { }
 
 /**
index 4a6986a..6001bfc 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * FindCdromWin32.hpp: Find CD-ROM drives: Win32 version.                  *
  *                                                                         *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -24,8 +24,7 @@
 
 #include "FindCdromBase.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class FindCdromWin32 : public FindCdromBase
 {
@@ -35,7 +34,9 @@ class FindCdromWin32 : public FindCdromBase
                FindCdromWin32(QObject *parent = 0);
 
        private:
-               Q_DISABLE_COPY(FindCdromWin32);
+               typedef FindCdromBase super;
+       private:
+               Q_DISABLE_COPY(FindCdromWin32)
 
        public:
                /**
index a206964..39f7ac8 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensColorButton.cpp: QButton class with background color support.       *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 
 #include "GensColorButton.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 // Stylesheet for QPushButton background color.
 const char *GensColorButton::ms_sCssBtnColors =
        "QPushButton { background-color: %1; color: %2; }";
 
 /**
- * setBgColor(): Set the background color.
+ * Set the background color.
  * @param newBgColor New background color. (If an invalid color is specified, unsets the background color.)
  */
 void GensColorButton::setBgColor(const QColor& newBgColor)
 {
        if (m_bgColor == newBgColor || (!m_bgColor.isValid() && !newBgColor.isValid()))
                return;
-       
+
        m_bgColor = newBgColor;
-       if (!m_bgColor.isValid())
-       {
+       if (!m_bgColor.isValid()) {
                this->setStyleSheet(QString());
                return;
        }
-       
+
        // Create a stylesheet with the new background color.
        QColor colorText = TextColor_For_BgColor(m_bgColor);
        this->setStyleSheet(QString::fromLatin1(ms_sCssBtnColors)
index 2cf16ef..c266553 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensColorButton.hpp: QButton class with background color support.       *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -25,8 +25,7 @@
 #include <QtGui/QPushButton>
 #include <QtGui/QColor>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensColorButton : public QPushButton
 {
@@ -35,41 +34,49 @@ class GensColorButton : public QPushButton
        
        public:
                GensColorButton(QWidget *parent = 0)
-                       : QPushButton(parent) { }
+                       : super(parent) { }
                GensColorButton(const QString& text, QWidget *parent = 0)
-                       : QPushButton(text, parent) { }
+                       : super(text, parent) { }
                GensColorButton(const QIcon& icon, const QString& text, QWidget *parent = 0)
-                       : QPushButton(icon, text, parent) { }
-               
+                       : super(icon, text, parent) { }
+
+       private:
+               typedef QPushButton super;
+       private:
+               Q_DISABLE_COPY(GensColorButton)
+
+       public:
                /**
-                * bgColor(): Get the current background color.
+                * Get the current background color.
                 * @return Background color.
                 */
                QColor bgColor(void);
-               
+
                /**
-                * setBgColor(): Set the background color.
+                * Set the background color.
                 * @param newBgColor New background color. (If an invalid color is specified, unsets the background color.)
                 */
                void setBgColor(const QColor& newBgColor);
-               
+
                /**
-                * unsetBgColor(): Unset the background color.
+                * Unset the background color.
                 */
                void unsetBgColor(void);
        
        protected:
+               // TODO: Move to a private class?
+
                /**
-                * TextColor_For_BgColor(): Get the text color for a given background color.
+                * Get the text color for a given background color.
                 * If the luminance is < 128, this returns white.
                 * Otherwise, this returns black.
                 * @return Text color for the given background color.
                 */
                static QColor TextColor_For_BgColor(const QColor& color);
-               
+
                // Stylesheet for QPushButton background color.
                static const char *ms_sCssBtnColors;
-               
+
                QColor m_bgColor;
 };
 
index 80f8120..e26a9f6 100644 (file)
@@ -3,7 +3,7 @@
  * GensColorComboBox.cpp: QComboBox class with color support.              *
  * Adds convenience functions to add color selection entries.              *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 // Qt includes.
 #include <QtGui/QPainter>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 /**
- * addItem(): Add an item to the GensColorComboBox.
+ * Add an item to the GensColorComboBox.
  * @param color Color.
  * @param text Text.
  */
@@ -40,31 +39,29 @@ void GensColorComboBox::addItem(const QColor& color, const QString& text)
        QSize size = this->iconSize();
        QPixmap pxm(size);
        pxm.fill(color);
-       
+
        // Draw a black rectangle outline.
        // TODO: Use a darkened version of the color like Mac OS X's NSColorWell?
        QPainter painter(&pxm);
        painter.setPen(QColor(Qt::black));
        painter.drawRect(0, 0, size.width()-1, size.height()-1);
-       
+
        // Convert the QPixmap to a QIcon and add the item.
        QIcon icon(pxm);
-       this->QComboBox::addItem(icon, text, color);
+       super::addItem(icon, text, color);
 }
 
-
 /**
- * addItem(): Add an item to the GensColorComboBox.
+ * Add an item to the GensColorComboBox.
  * @param color Standard color.
  */
 void GensColorComboBox::addItem(Qt::GlobalColor color)
 {
        QString text;
-       
+
        // http://doc.qt.nokia.com/4.7/qt.html#GlobalColor-enum
        // TODO: Add options for VGA colors instead of Qt standard colors?
-       switch (color)
-       {
+       switch (color) {
                case Qt::white:         text = tr("White"); break;
                case Qt::black:         text = tr("Black"); break;
                case Qt::red:           text = tr("Red"); break;
@@ -86,14 +83,14 @@ void GensColorComboBox::addItem(Qt::GlobalColor color)
                default:
                        break;
        }
-       
+
        QColor qcolor(color);
        addItem(color, text);
 }
 
 
 /**
- * itemColor(): Get the color of the specified item.
+ * Get the color of the specified item.
  * @param i Item index.
  * @return QColor, or invalid QColor on error.
  */
@@ -101,11 +98,11 @@ QColor GensColorComboBox::itemColor(int i)
 {
        if (i < 0 || i >= this->count())
                return QColor();
-       
+
        QVariant data = this->itemData(i);
        if (!data.isValid())
                return QColor();
-       
+
        return data.value<QColor>();
 }
 
index 698b8bb..b0ff437 100644 (file)
@@ -3,7 +3,7 @@
  * GensColorComboBox.hpp: QComboBox class with color support.              *
  * Adds convenience functions to add color selection entries.              *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -26,8 +26,7 @@
 #include <QtGui/QComboBox>
 #include <QtGui/QColor>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensColorComboBox : public QComboBox
 {
@@ -35,11 +34,17 @@ class GensColorComboBox : public QComboBox
        
        public:
                GensColorComboBox(QWidget *parent = 0)
-                       : QComboBox(parent) { }
-               
+                       : super(parent) { }
+
+       private:
+               typedef QComboBox super;
+       private:
+               Q_DISABLE_COPY(GensColorComboBox)
+
+       public:
                void addItem(const QColor& color, const QString& text);
                void addItem(Qt::GlobalColor color);
-               
+
                QColor itemColor(int i);
 };
 
index 2a37f6f..794a9aa 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensCtrlCfgWidget.hpp: Controller configuration widget.                 *
  *                                                                         *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -48,8 +48,7 @@ using LibGens::IoManager;
 // Controller configuration.
 #include "Config/CtrlConfig.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensCtrlCfgWidgetPrivate
 {
@@ -393,7 +392,7 @@ void GensCtrlCfgWidgetPrivate::clearAllButtons(void)
  ********************************/
 
 GensCtrlCfgWidget::GensCtrlCfgWidget(QWidget* parent)
-       : QWidget(parent)
+       : super(parent)
        , d_ptr(new GensCtrlCfgWidgetPrivate(this))
 {
        // Initialize the private members.
index 786e4b7..440bfb2 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensCtrlCfgWidget.hpp: Controller configuration widget.                 *
  *                                                                         *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -32,8 +32,7 @@
 #include <QtGui/QWidget>
 #include <QtCore/QVector>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensCtrlCfgWidgetPrivate;
 
@@ -46,6 +45,7 @@ class GensCtrlCfgWidget : public QWidget
                virtual ~GensCtrlCfgWidget();
 
        private:
+               typedef QWidget super;
                GensCtrlCfgWidgetPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(GensCtrlCfgWidget)
        private:
index 700c124..9667d03 100644 (file)
@@ -252,7 +252,7 @@ void GensCtrlKeyWidgetPrivate::updateShortcutDisplay(void)
  ********************************/
 
 GensCtrlKeyWidget::GensCtrlKeyWidget(QWidget *parent, QLabel *label)
-       : QWidget(parent)
+       : super(parent)
        , d_ptr(new GensCtrlKeyWidgetPrivate(this, label))
 {
        // Initialize the private members.
@@ -297,7 +297,7 @@ void GensCtrlKeyWidget::changeEvent(QEvent *event)
        }
 
        // Pass the event to the base class.
-       this->QWidget::changeEvent(event);
+       super::changeEvent(event);
 }
 
 /**
@@ -362,12 +362,11 @@ void GensCtrlKeyWidget::labelDestroyed(void)
        d->lblDisplay = nullptr;
 }
 
-
 /**
  * Return the currently selected GensKey_t.
  * @return Currently selected GensKey_t.
  */
-GensKey_t GensCtrlKeyWidget::key() const
+GensKey_t GensCtrlKeyWidget::key(void) const
 {
        Q_D(const GensCtrlKeyWidget);
        return d->gensKey;
index 753b4c2..d5e99d4 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (c) 1998 Mark Donohoe <donohoe@kde.org>                       *
  * Copyright (c) 2001 Ellis Whitehead <ellis@kde.org>                      *
  * Copyright (c) 2007 Andreas Hartmetz <ahartmetz@gmail.com>               *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -33,8 +33,7 @@
 #include <QtGui/QWidget>
 class QLabel;
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensCtrlKeyWidgetPrivate;
 
@@ -47,6 +46,7 @@ class GensCtrlKeyWidget : public QWidget
                virtual ~GensCtrlKeyWidget();
 
        private:
+               typedef QWidget super;
                GensCtrlKeyWidgetPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(GensCtrlKeyWidget)
        private:
@@ -64,7 +64,7 @@ class GensCtrlKeyWidget : public QWidget
                /**
                 * Return the currently selected GensKey_t.
                 */
-               GensKey_t key() const;
+               GensKey_t key(void) const;
 
        signals:
                void keyChanged(GensKey_t key);
index 110d774..bb5f4e1 100644 (file)
@@ -7,7 +7,7 @@
  * Copyright (c) 1998 Mark Donohoe <donohoe@kde.org>                       *
  * Copyright (c) 2001 Ellis Whitehead <ellis@kde.org>                      *
  * Copyright (c) 2007 Andreas Hartmetz <ahartmetz@gmail.com>               *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -29,8 +29,7 @@
 
 #include <QtGui/QPushButton>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensCtrlKeyWidgetPrivate;
 
@@ -44,9 +43,10 @@ class GensCtrlKeyButton : public QPushButton
                virtual ~GensCtrlKeyButton() { }
 
        private:
+               typedef QPushButton super;
                GensCtrlKeyWidgetPrivate *const d;
        private:
-               Q_DISABLE_COPY(GensCtrlKeyButton);
+               Q_DISABLE_COPY(GensCtrlKeyButton)
 
        protected:
                // Reimplemented for internal reasons.
index 74cbc76..6bccfd5 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (c) 1998 Mark Donohoe <donohoe@kde.org>                       *
  * Copyright (c) 2001 Ellis Whitehead <ellis@kde.org>                      *
  * Copyright (c) 2007 Andreas Hartmetz <ahartmetz@gmail.com>               *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -41,9 +41,7 @@
 // GensQApplication::IconFromTheme()
 #include "../GensQApplication.hpp"
 
-
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensKeySequenceWidgetPrivate
 {
@@ -321,7 +319,7 @@ void GensKeySequenceWidgetPrivate::updateShortcutDisplay(void)
  ************************************/
 
 GensKeySequenceWidget::GensKeySequenceWidget(QWidget *parent)
-       : QWidget(parent)
+       : super(parent)
        , d_ptr(new GensKeySequenceWidgetPrivate(this))
 {
        // Initialize the private members.
@@ -359,7 +357,7 @@ void GensKeySequenceWidget::changeEvent(QEvent *event)
        }
 
        // Pass the event to the base class.
-       this->QWidget::changeEvent(event);
+       super::changeEvent(event);
 }
 
 /**
index 1a1a00b..0a715a8 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (c) 1998 Mark Donohoe <donohoe@kde.org>                       *
  * Copyright (c) 2001 Ellis Whitehead <ellis@kde.org>                      *
  * Copyright (c) 2007 Andreas Hartmetz <ahartmetz@gmail.com>               *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -29,8 +29,7 @@
 #include <QtGui/QWidget>
 #include <QtGui/QKeySequence>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensKeySequenceWidgetPrivate;
 
@@ -43,6 +42,7 @@ class GensKeySequenceWidget : public QWidget
                virtual ~GensKeySequenceWidget();
 
        private:
+               typedef QWidget super;
                GensKeySequenceWidgetPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(GensKeySequenceWidget)
        private:
index 550e31b..baa0388 100644 (file)
@@ -7,7 +7,7 @@
  * Copyright (c) 1998 Mark Donohoe <donohoe@kde.org>                       *
  * Copyright (c) 2001 Ellis Whitehead <ellis@kde.org>                      *
  * Copyright (c) 2007 Andreas Hartmetz <ahartmetz@gmail.com>               *
- * Copyright (c) 2011-2014 by David Korth.                                 *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -29,8 +29,7 @@
 
 #include <QtGui/QPushButton>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensKeySequenceWidgetPrivate;
 
@@ -44,8 +43,9 @@ class GensKeySequenceButton : public QPushButton
                virtual ~GensKeySequenceButton() { };
 
        private:
+               typedef QPushButton super;
                GensKeySequenceWidgetPrivate *const d;
-               Q_DISABLE_COPY(GensKeySequenceButton);
+               Q_DISABLE_COPY(GensKeySequenceButton)
 
        public:
                // Reimplemented. [NOTE: NOT VIRTUAL!]
index 84d1e65..97cd0b1 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensQLineEdit.hpp: QLineEdit class with indicator icon.                 *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * Based on Lineedit with a clear button.                                  *
  * http://labs.qt.nokia.com/2007/06/06/lineedit-with-a-clear-button/       *
 #include <QtGui/QLabel>
 #include <QtGui/QStyle>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 GensLineEdit::GensLineEdit(QWidget *parent)
-       : QLineEdit(parent)
+       : super(parent)
 {
        m_label = new QLabel(this);
        m_label->setMinimumSize(18, 16);
index 9931955..6ff9d8e 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensQLineEdit.hpp: QLineEdit class with indicator icon.                 *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * Based on Lineedit with a clear button.                                  *
  * http://labs.qt.nokia.com/2007/06/06/lineedit-with-a-clear-button/       *
 class QLabel;
 class QFocusEvent;
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensLineEdit : public QLineEdit
 {
        Q_OBJECT
-       
+
        Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
-       
+
        public:
                GensLineEdit(QWidget *parent = 0);
-               
+
+       private:
+               typedef QLineEdit super;
+       private:
+               Q_DISABLE_COPY(GensLineEdit)
+
+       public:
                QIcon icon(void) const { return m_icon; }
                void setIcon(const QIcon& icon);
-       
+
        signals:
                void focusIn(void);
                void focusOut(void);
-       
+
        protected:
                void resizeEvent(QResizeEvent *);
-               
+
                void focusInEvent(QFocusEvent *event)
                {
                        this->QLineEdit::focusInEvent(event);
                        emit focusIn();
                }
+
                void focusOutEvent(QFocusEvent *event)
                {
                        this->QLineEdit::focusOutEvent(event);
                        emit focusOut();
                }
-       
+
        private:
+               // TODO: Move to a private class?
                QLabel *m_label;
                QIcon m_icon;
 };
index 2742489..506efcb 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensZipDirItem.cpp: Zip Directory tree item.                            *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -23,8 +23,7 @@
 
 #include "GensZipDirItem.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 GensZipDirItem::GensZipDirItem(GensZipDirItem *parent)
 {
@@ -104,7 +103,7 @@ bool GensZipDirItem::setData(int column, const QVariant& value)
 }
 
 /**
- * sort(): Sort the data item.
+ * Sort the data item.
  * @param column Column to sort by.
  * @param order Sort order.
  */
@@ -113,10 +112,11 @@ void GensZipDirItem::sort(int column, Qt::SortOrder order)
        // Sort the child items.
        // NOTE: We're ignoring the column argument for now.
        // We're always sorting by display filename.
-       if (order == Qt::AscendingOrder)
+       if (order == Qt::AscendingOrder) {
                qSort(m_childItems.begin(), m_childItems.end(), SortFilenameLessThan);
-       else
+       } else {
                qSort(m_childItems.begin(), m_childItems.end(), SortFilenameGreaterThan);
+       }
 
        // Sort child items of child items.
        foreach (GensZipDirItem *item, m_childItems)
index 8eb2950..896c21b 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensZipDirItem.hpp: Zip Directory tree item.                            *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
 // TODO: Use MDP's mdp_z_entry_t instead of LibGens::Decompressor.
 #include "libgens/Decompressor/Decompressor.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensZipDirItem
 {
        public:
                GensZipDirItem(GensZipDirItem *parent = 0);
                ~GensZipDirItem();
-               
+
+       private:
+               Q_DISABLE_COPY(GensZipDirItem)
+
+       public:
                GensZipDirItem *child(int number)
                        { return m_childItems.value(number); }
                int childCount(void) const
                        { return m_childItems.size(); }
                int childNumber(void) const;
-               
+
                int columnCount(void) const
                        { return 3; }   // Three data columns. (Icon is separate.)
                QVariant data(int column) const;
-               
+
                GensZipDirItem *parent(void)
                        { return m_parentItem; }
-               
+
                bool insertChildren(int position, int count, int columns);
                bool removeChildren(int position, int count);
                bool setData(int column, const QVariant& value);
-               
+
                const QIcon& icon(void) const
                        { return m_itemData.icon; }
                bool setIcon(const QIcon& icon)
@@ -67,37 +70,38 @@ class GensZipDirItem
                        m_itemData.icon = icon;
                        return true;
                }
-               
+
                const mdp_z_entry_t *getZEntry(void) const
                        { return m_itemData.z_entry; }
                void setZEntry(const mdp_z_entry_t *z_entry)
                        { m_itemData.z_entry = z_entry; }
-               
+
                void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
-       
+
        protected:
-               struct zdata
-               {
+               // TODO: Move to a private class?
+               struct zdata {
                        QString disp_filename;
                        QString full_filename;
                        int filesize;
                        QIcon icon;
-                       
+
                        const mdp_z_entry_t *z_entry;
                };
-               
+
                QList<GensZipDirItem*> m_childItems;
                GensZipDirItem *m_parentItem;
                zdata m_itemData;
-               
+
                static inline bool SortFilenameLessThan(const GensZipDirItem *z1, const GensZipDirItem *z2)
                {
                        // If one item is a directory and one isn't, the directory comes first.
-                       if (z1->childCount() && !z2->childCount())
+                       if (z1->childCount() && !z2->childCount()) {
                                return true;
-                       else if (!z1->childCount() && z2->childCount())
+                       } else if (!z1->childCount() && z2->childCount()) {
                                return false;
-                       
+                       }
+
                        // Both are directories, or both are files.
 #if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
                        return (z1->data(0).toString().toLower() < z2->data(0).toString().toLower());
@@ -105,15 +109,16 @@ class GensZipDirItem
                        return (z1->data(0).toString() < z2->data(0).toString());
 #endif
                }
-               
+
                static inline bool SortFilenameGreaterThan(const GensZipDirItem *z1, const GensZipDirItem *z2)
                {
                        // If one item is a directory and one isn't, the directory comes last.
-                       if (z1->childCount() && !z2->childCount())
+                       if (z1->childCount() && !z2->childCount()) {
                                return false;
-                       else if (!z1->childCount() && z2->childCount())
+                       } else if (!z1->childCount() && z2->childCount()) {
                                return true;
-                       
+                       }
+
                        // Both are directories, or both are files.
 #if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
                        return (z1->data(0).toString().toLower() > z2->data(0).toString().toLower());
index c4881cd..c70d471 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensZipDirModel.cpp: Zip Directory tree model.                          *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -28,8 +28,7 @@
 #include <QtGui/QStyle>
 
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensZipDirModelPrivate
 {
@@ -76,7 +75,7 @@ GensZipDirItem *GensZipDirModelPrivate::getItem(const QModelIndex& index) const
 /** GensZipDirModel **/
 
 GensZipDirModel::GensZipDirModel(QObject *parent)
-       : QAbstractItemModel(parent)
+       : super(parent)
        , d_ptr(new GensZipDirModelPrivate(this))
 { }
 
index 2bc9839..2e3e8cb 100644 (file)
@@ -2,7 +2,7 @@
  * gens-qt4: Gens Qt4 UI.                                                  *
  * GensZipDirModel.hpp: Zip Directory tree model.                          *
  *                                                                         *
- * Copyright (c) 2011 by David Korth.                                      *
+ * Copyright (c) 2011-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -34,8 +34,7 @@
 // GensZipDirItem.
 #include "GensZipDirItem.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GensZipDirModelPrivate;
 
@@ -48,6 +47,7 @@ class GensZipDirModel : public QAbstractItemModel
                virtual ~GensZipDirModel();
 
        private:
+               typedef QAbstractItemModel super;
                GensZipDirModelPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(GensZipDirModel)
        private:
index e00193f..2afa34e 100644 (file)
@@ -192,7 +192,7 @@ void RecentRomsMenuPrivate::update(void)
 /** RecentRomsMenu **/
 
 RecentRomsMenu::RecentRomsMenu(QWidget* parent, const RecentRoms* recentRoms)
-       : QMenu(parent)
+       : super(parent)
        , d_ptr(new RecentRomsMenuPrivate(this, recentRoms))
 {
        // Initialize RecentRomsMenuPrivate.
@@ -201,7 +201,7 @@ RecentRomsMenu::RecentRomsMenu(QWidget* parent, const RecentRoms* recentRoms)
 }
 
 RecentRomsMenu::RecentRomsMenu(const QString &title, QWidget *parent, const RecentRoms *recentRoms)
-       : QMenu(title, parent)
+       : super(title, parent)
        , d_ptr(new RecentRomsMenuPrivate(this, recentRoms))
 {
        // Initialize RecentRomsMenuPrivate.
index 2688631..00c0bbc 100644 (file)
@@ -43,6 +43,7 @@ class RecentRomsMenu : public QMenu
                virtual ~RecentRomsMenu();
 
        private:
+               typedef QMenu super;
                RecentRomsMenuPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(RecentRomsMenu)
        private:
index 45927b5..a3cefde 100644 (file)
@@ -700,7 +700,7 @@ QString AboutDialogPrivate::GetSysCodePageInfo(void)
  * Initialize the About Dialog.
  */
 AboutDialog::AboutDialog(QWidget *parent)
-       : QDialog(parent,
+       : super(parent,
                Qt::Dialog |
                Qt::WindowTitleHint |
                Qt::WindowSystemMenuHint |
@@ -779,7 +779,7 @@ void AboutDialog::changeEvent(QEvent *event)
        }
 
        // Pass the event to the base class.
-       QDialog::changeEvent(event);
+       super::changeEvent(event);
 }
 
 }
index 3e32a6b..6fb6d77 100644 (file)
@@ -41,6 +41,7 @@ class AboutDialog : public QDialog
                virtual ~AboutDialog();
 
        private:
+               typedef QDialog super;
                AboutDialogPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(AboutDialog)
        private:
index 0127938..5e54f64 100644 (file)
@@ -531,7 +531,7 @@ IoManager::IoType_t CtrlConfigWindowPrivate::cboDeviceIoType(int index)
  * Initialize the Controller Configuration window.
  */
 CtrlConfigWindow::CtrlConfigWindow(QWidget *parent)
-       : QMainWindow(parent,
+       : super(parent,
                Qt::Dialog |
                Qt::WindowTitleHint |
                Qt::WindowSystemMenuHint |
@@ -676,12 +676,12 @@ void CtrlConfigWindow::keyPressEvent(QKeyEvent *event)
 
                        default:
                                // Pass the event to the base class.
-                               this->QMainWindow::keyPressEvent(event);
+                               super::keyPressEvent(event);
                                return;
                }
        } else {
                // Pass the event to the base class.
-               this->QMainWindow::keyPressEvent(event);
+               super::keyPressEvent(event);
        }
 }
 
@@ -707,7 +707,7 @@ void CtrlConfigWindow::changeEvent(QEvent *event)
        }
 
        // Pass the event to the base class.
-       this->QMainWindow::changeEvent(event);
+       super::changeEvent(event);
 }
 
 
index 5b5db29..2f5b942 100644 (file)
@@ -47,6 +47,7 @@ class CtrlConfigWindow : public QMainWindow
                virtual ~CtrlConfigWindow();
 
        private:
+               typedef QMainWindow super;
                CtrlConfigWindowPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(CtrlConfigWindow)
        private:
index a650f29..3d7bda0 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                            *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                         *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                                *
- * Copyright (c) 2008-2014 by David Korth.                                    *
+ * Copyright (c) 2008-2015 by David Korth.                                    *
  *                                                                            *
  * This program is free software; you can redistribute it and/or modify       *
  * it under the terms of the GNU General Public License as published by       *
@@ -54,7 +54,7 @@ namespace GensQt4 {
  * Initialize the General Configuration window.
  */
 GeneralConfigWindow::GeneralConfigWindow(QWidget *parent)
-       : QMainWindow(parent,
+       : super(parent,
                Qt::Dialog |
                Qt::WindowTitleHint |
                Qt::WindowSystemMenuHint |
@@ -259,12 +259,12 @@ void GeneralConfigWindow::keyPressEvent(QKeyEvent *event)
 
                                default:
                                        // Pass the event to the base class.
-                                       this->QMainWindow::keyPressEvent(event);
+                                       super::keyPressEvent(event);
                                        return;
                        }
                } else {
                        // Pass the event to the base class.
-                       this->QMainWindow::keyPressEvent(event);
+                       super::keyPressEvent(event);
                }
        } else {
                // Changes are applied immediately.
@@ -296,7 +296,7 @@ void GeneralConfigWindow::changeEvent(QEvent *event)
        }
 
        // Pass the event to the base class.
-       QMainWindow::changeEvent(event);
+       super::changeEvent(event);
 }
 
 /**
index 9062bc4..89f140b 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -27,8 +27,7 @@
 // Qt includes.
 #include <QtGui/QMainWindow>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class GeneralConfigWindowPrivate;
 
@@ -44,10 +43,11 @@ class GeneralConfigWindow : public QMainWindow
                virtual ~GeneralConfigWindow();
 
        private:
+               typedef QMainWindow super;
                GeneralConfigWindowPrivate *const d_ptr;
-               Q_DECLARE_PRIVATE(GeneralConfigWindow);
+               Q_DECLARE_PRIVATE(GeneralConfigWindow)
        private:
-               Q_DISABLE_COPY(GeneralConfigWindow);
+               Q_DISABLE_COPY(GeneralConfigWindow)
 
        protected:
                virtual QSize sizeHint(void) const override
index 75a1490..67c505f 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -36,8 +36,7 @@ class QLineEdit;
 #include "gqt4_main.hpp"
 
 #include "ui_GeneralConfigWindow.h"
-namespace GensQt4
-{
+namespace GensQt4 {
 
 static inline void SetValByPath_bool(const char *path, bool value)
        { gqt4_cfg->set(QLatin1String(path), value); }
index 528cead..4914e3f 100644 (file)
@@ -5,7 +5,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -25,8 +25,7 @@
 #include "GeneralConfigWindow.hpp"
 #include "GeneralConfigWindow_p.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 /**
  * Apply the configuration changes.
index ecf534e..85a153f 100644 (file)
@@ -146,7 +146,7 @@ void GensMenuShortcutsPrivate::addAction(QAction* action)
 /** GensMenuShortcuts **/
 
 GensMenuShortcuts::GensMenuShortcuts(QObject *parent)
-       : QObject(parent)
+       : super(parent)
        , d_ptr(new GensMenuShortcutsPrivate(this))
 { }
 
index 473a005..d561b20 100644 (file)
@@ -49,10 +49,11 @@ class GensMenuShortcuts : public QObject
                virtual ~GensMenuShortcuts();
 
        private:
+               typedef QObject super;
                GensMenuShortcutsPrivate *const d_ptr;
-               Q_DECLARE_PRIVATE(GensMenuShortcuts);
+               Q_DECLARE_PRIVATE(GensMenuShortcuts)
        private:
-               Q_DISABLE_COPY(GensMenuShortcuts);
+               Q_DISABLE_COPY(GensMenuShortcuts)
 
        public:
                /**
index da50a98..4a8e3a8 100644 (file)
@@ -49,7 +49,7 @@ class GensMenuShortcutsPrivate
                GensMenuShortcuts *const q_ptr;
                Q_DECLARE_PUBLIC(GensMenuShortcuts)
        private:
-               Q_DISABLE_COPY(GensMenuShortcutsPrivate);
+               Q_DISABLE_COPY(GensMenuShortcutsPrivate)
 
        public:
                /**
index cd2b3d9..a314ecb 100644 (file)
@@ -173,8 +173,8 @@ void GensWindowPrivate::checkIdleThread(void)
 /**
  * Initialize the Gens window.
  */
-GensWindow::GensWindow()
-       : QMainWindow()
+GensWindow::GensWindow(QWidget *parent, Qt::WindowFlags flags)
+       : super(parent, flags)
        , d_ptr(new GensWindowPrivate(this))
 {
        Q_D(GensWindow);
@@ -385,7 +385,7 @@ void GensWindow::changeEvent(QEvent *event)
        }
 
        // Pass the event to the base class.
-       QMainWindow::changeEvent(event);
+       super::changeEvent(event);
 }
 
 /**
index adf735d..b6c0daf 100644 (file)
@@ -52,10 +52,11 @@ class GensWindow : public QMainWindow
        Q_OBJECT
        
        public:
-               GensWindow();
+               GensWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
                virtual ~GensWindow();
 
        private:
+               typedef QMainWindow super;
                GensWindowPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(GensWindow)
        private:
index 42ff32b..a4dad04 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -37,8 +37,7 @@
 #include "cdrom/FindCdromDrives.hpp"
 
 #include "ui_McdControlWindow.h"
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class McdControlWindowPrivate
 {
@@ -146,7 +145,9 @@ void McdControlWindowPrivate::addDriveEntry(const QString &deviceName, int index
  * Initialize the General Configuration window.
  */
 McdControlWindow::McdControlWindow(QWidget *parent)
-       : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+       : super(parent,
+               Qt::WindowTitleHint |
+               Qt::WindowSystemMenuHint)
        , d_ptr(new McdControlWindowPrivate(this))
 {
        Q_D(McdControlWindow);
@@ -214,7 +215,7 @@ void McdControlWindow::changeEvent(QEvent *event)
        }
 
        // Pass the event to the base class.
-       QDialog::changeEvent(event);
+       super::changeEvent(event);
 }
 
 /**
index 908465c..e8ce676 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -27,8 +27,7 @@
 // Qt includes.
 #include <QtGui/QDialog>
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class McdControlWindowPrivate;
 
@@ -44,6 +43,7 @@ class McdControlWindow : public QDialog
                virtual ~McdControlWindow();
 
        private:
+               typedef QDialog super;
                McdControlWindowPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(McdControlWindow)
        private:
index b83b31e..26ccda6 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -30,8 +30,7 @@
 #include "widgets/GensZipDirModel.hpp"
 
 #include "ui_ZipSelectDialog.h"
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class ZipSelectDialogPrivate
 {
@@ -74,7 +73,9 @@ ZipSelectDialogPrivate::~ZipSelectDialogPrivate()
  * Initialize the Multi-File Archive Selection Dialog.
  */
 ZipSelectDialog::ZipSelectDialog(QWidget *parent)
-       : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
+       : super(parent,
+               Qt::WindowTitleHint |
+               Qt::WindowSystemMenuHint)
        , d_ptr(new ZipSelectDialogPrivate(this))
 {
        Q_D(ZipSelectDialog);
@@ -112,7 +113,7 @@ void ZipSelectDialog::changeEvent(QEvent *event)
        }
 
        // Pass the event to the base class.
-       QDialog::changeEvent(event);
+       super::changeEvent(event);
 }
 
 /**
@@ -182,7 +183,7 @@ void ZipSelectDialog::accept(void)
        d->z_entry_sel = d->dirModel->getZEntry(indexList[0]);
 
        // Call the base accept() function.
-       QDialog::accept();
+       super::accept();
 }
 
 /**
index 817930c..f8b2501 100644 (file)
@@ -4,7 +4,7 @@
  *                                                                         *
  * Copyright (c) 1999-2002 by Stéphane Dallongeville.                      *
  * Copyright (c) 2003-2004 by Stéphane Akhoun.                             *
- * Copyright (c) 2008-2014 by David Korth.                                 *
+ * Copyright (c) 2008-2015 by David Korth.                                 *
  *                                                                         *
  * This program is free software; you can redistribute it and/or modify it *
  * under the terms of the GNU General Public License as published by the   *
@@ -31,8 +31,7 @@
 // TODO: Use MDP's mdp_z_entry_t instead of LibGens::Decompressor.
 #include "libgens/Decompressor/Decompressor.hpp"
 
-namespace GensQt4
-{
+namespace GensQt4 {
 
 class ZipSelectDialogPrivate;
 
@@ -45,6 +44,7 @@ class ZipSelectDialog : public QDialog
                virtual ~ZipSelectDialog();
 
        private:
+               typedef QDialog super;
                ZipSelectDialogPrivate *const d_ptr;
                Q_DECLARE_PRIVATE(ZipSelectDialog)
        private: