From 7164dddefde9376d59f8314505bbbb72b3c83ff1 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 5 Jan 2014 12:07:22 +0200 Subject: [PATCH] Disable copy constructors and copy assignment operators --- Common/Gfx/Canvas.h | 5 ++--- Common/Gfx/CanvasD2D.h | 4 +++- Common/Gfx/CanvasGDIP.h | 4 +++- Common/Gfx/FontCollection.h | 5 ++--- Common/Gfx/FontCollectionD2D.h | 5 +++-- Common/Gfx/FontCollectionGDIP.h | 5 +++-- Common/Gfx/TextFormat.h | 4 ++-- Common/Gfx/TextFormatD2D.h | 5 +++-- Common/Gfx/TextFormatGDIP.h | 5 +++-- Common/Gfx/Util/WICBitmapDIB.h | 3 +++ Common/Gfx/Util/WICBitmapLockDIB.h | 3 +++ Common/Gfx/Util/WICBitmapLockGDIP.h | 3 +++ Library/ConfigParser.h | 3 +++ Library/ContextMenu.h | 3 +++ Library/DialogAbout.h | 3 +++ Library/DialogManage.h | 3 +++ Library/Group.h | 3 +++ Library/IfActions.h | 3 +++ Library/Logger.h | 3 +++ Library/Measure.h | 2 ++ Library/MeasureCPU.h | 3 +++ Library/MeasureCalc.h | 3 +++ Library/MeasureDiskSpace.h | 3 +++ Library/MeasureMemory.h | 3 +++ Library/MeasureNet.h | 3 +++ Library/MeasureNetIn.h | 3 +++ Library/MeasureNetOut.h | 3 +++ Library/MeasureNetTotal.h | 3 +++ Library/MeasurePhysicalMemory.h | 3 +++ Library/MeasurePlugin.h | 3 +++ Library/MeasureRegistry.h | 3 +++ Library/MeasureScript.h | 3 +++ Library/MeasureString.h | 3 +++ Library/MeasureTime.h | 3 +++ Library/MeasureUptime.h | 3 +++ Library/MeasureVirtualMemory.h | 3 +++ Library/Meter.h | 2 ++ Library/MeterBar.h | 3 +++ Library/MeterBitmap.h | 3 +++ Library/MeterButton.h | 3 +++ Library/MeterHistogram.h | 3 +++ Library/MeterImage.h | 3 +++ Library/MeterLine.h | 3 +++ Library/MeterRotator.h | 3 +++ Library/MeterRoundLine.h | 3 +++ Library/MeterString.h | 3 +++ Library/MeterWindow.h | 3 +++ Library/Mouse.h | 3 +++ Library/Rainmeter.h | 3 +++ Library/Section.h | 2 ++ Library/SkinRegistry.h | 4 ++++ Library/System.h | 3 +++ Library/TintedImage.h | 3 +++ Library/TrayWindow.h | 3 +++ 54 files changed, 157 insertions(+), 18 deletions(-) diff --git a/Common/Gfx/Canvas.h b/Common/Gfx/Canvas.h index 160c5a83..226ef5fe 100644 --- a/Common/Gfx/Canvas.h +++ b/Common/Gfx/Canvas.h @@ -42,6 +42,8 @@ class __declspec(novtable) Canvas public: virtual ~Canvas(); + Canvas(const Canvas& other) = delete; + // Creates the canvas using the specified rendering engine. May return nullptr. static Canvas* Create(Renderer renderer); @@ -108,9 +110,6 @@ protected: // the default DirectWrite output. Otherwise, the expected result should be similar to that of // non-typographic GDI+. bool m_AccurateText; - -private: - Canvas(const Canvas& other) {} }; } // namespace Gfx diff --git a/Common/Gfx/CanvasD2D.h b/Common/Gfx/CanvasD2D.h index 5e0dea73..bc20f5ee 100644 --- a/Common/Gfx/CanvasD2D.h +++ b/Common/Gfx/CanvasD2D.h @@ -82,7 +82,9 @@ private: CanvasD2D(); ~CanvasD2D(); - CanvasD2D(const CanvasD2D& other) {} + + CanvasD2D(const CanvasD2D& other) = delete; + CanvasD2D& operator=(CanvasD2D other) = delete; bool BeginTargetDraw(); void EndTargetDraw(); diff --git a/Common/Gfx/CanvasGDIP.h b/Common/Gfx/CanvasGDIP.h index 5ba39260..808cc49f 100644 --- a/Common/Gfx/CanvasGDIP.h +++ b/Common/Gfx/CanvasGDIP.h @@ -71,7 +71,9 @@ private: CanvasGDIP(); ~CanvasGDIP(); - CanvasGDIP(const CanvasGDIP& other) {} + + CanvasGDIP(const CanvasGDIP& other) = delete; + CanvasGDIP& operator=(CanvasGDIP other) = delete; void Dispose(); diff --git a/Common/Gfx/FontCollection.h b/Common/Gfx/FontCollection.h index 7c3e5905..6d3e1a45 100644 --- a/Common/Gfx/FontCollection.h +++ b/Common/Gfx/FontCollection.h @@ -29,14 +29,13 @@ class __declspec(novtable) FontCollection public: virtual ~FontCollection(); + FontCollection(const FontCollection& other) = delete; + // Adds a file to the collection. Returns true if the file was successfully added. virtual bool AddFile(const WCHAR* file) = 0; protected: FontCollection(); - -private: - FontCollection(const FontCollection& other) {} }; } // namespace Gfx diff --git a/Common/Gfx/FontCollectionD2D.h b/Common/Gfx/FontCollectionD2D.h index e59cca94..bf056a21 100644 --- a/Common/Gfx/FontCollectionD2D.h +++ b/Common/Gfx/FontCollectionD2D.h @@ -31,6 +31,9 @@ class FontCollectionD2D final : public FontCollection public: virtual ~FontCollectionD2D(); + FontCollectionD2D(const FontCollectionD2D& other) = delete; + FontCollectionD2D& operator=(FontCollectionD2D other) = delete; + virtual bool AddFile(const WCHAR* file) override; protected: @@ -40,8 +43,6 @@ private: friend class CanvasD2D; friend class TextFormatD2D; - FontCollectionD2D(const FontCollectionD2D& other) {} - void Dispose(); bool InitializeCollection(); diff --git a/Common/Gfx/FontCollectionGDIP.h b/Common/Gfx/FontCollectionGDIP.h index 1d82bbad..a35fbdf6 100644 --- a/Common/Gfx/FontCollectionGDIP.h +++ b/Common/Gfx/FontCollectionGDIP.h @@ -33,6 +33,9 @@ class FontCollectionGDIP final : public FontCollection public: virtual ~FontCollectionGDIP(); + FontCollectionGDIP(const FontCollectionGDIP& other) = delete; + FontCollectionGDIP& operator=(FontCollectionGDIP other) = delete; + virtual bool AddFile(const WCHAR* file) override; protected: @@ -42,8 +45,6 @@ private: friend class CanvasGDIP; friend class TextFormatGDIP; - FontCollectionGDIP(const FontCollectionGDIP& other) {} - void Dispose(); Gdiplus::PrivateFontCollection* m_PrivateCollection; diff --git a/Common/Gfx/TextFormat.h b/Common/Gfx/TextFormat.h index 47082166..7b6eea57 100644 --- a/Common/Gfx/TextFormat.h +++ b/Common/Gfx/TextFormat.h @@ -45,6 +45,8 @@ class __declspec(novtable) TextFormat public: virtual ~TextFormat(); + TextFormat(const TextFormat& other) = delete; + // Returns true if this TextFormat object is valid for use in draw operations. virtual bool IsInitialized() const = 0; @@ -69,8 +71,6 @@ protected: TextFormat(); private: - TextFormat(const TextFormat& other) {} - HorizontalAlignment m_HorizontalAlignment; VerticalAlignment m_VerticalAlignment; }; diff --git a/Common/Gfx/TextFormatD2D.h b/Common/Gfx/TextFormatD2D.h index 5e79a7a7..0f78b0cb 100644 --- a/Common/Gfx/TextFormatD2D.h +++ b/Common/Gfx/TextFormatD2D.h @@ -33,6 +33,9 @@ public: TextFormatD2D(); virtual ~TextFormatD2D(); + TextFormatD2D(const TextFormatD2D& other) = delete; + TextFormatD2D& operator=(TextFormatD2D other) = delete; + virtual bool IsInitialized() const override { return m_TextFormat != nullptr; } virtual void SetProperties( @@ -49,8 +52,6 @@ private: friend class Common_Gfx_TextFormatD2D_Test; - TextFormatD2D(const TextFormatD2D& other) {} - void Dispose(); // Creates a new DirectWrite text layout if |str| has changed since last call. Since creating diff --git a/Common/Gfx/TextFormatGDIP.h b/Common/Gfx/TextFormatGDIP.h index d12e20c6..df9bbe1e 100644 --- a/Common/Gfx/TextFormatGDIP.h +++ b/Common/Gfx/TextFormatGDIP.h @@ -33,6 +33,9 @@ public: TextFormatGDIP(); virtual ~TextFormatGDIP(); + TextFormatGDIP(const TextFormatGDIP& other) = delete; + TextFormatGDIP& operator=(TextFormatGDIP other) = delete; + virtual bool IsInitialized() const override { return m_Font != nullptr; } virtual void SetProperties( @@ -47,8 +50,6 @@ public: private: friend class CanvasGDIP; - TextFormatGDIP(const TextFormatGDIP& other) {} - std::unique_ptr m_Font; std::unique_ptr m_FontFamily; Gdiplus::StringFormat m_StringFormat; diff --git a/Common/Gfx/Util/WICBitmapDIB.h b/Common/Gfx/Util/WICBitmapDIB.h index c291f13e..9cf0aeb3 100644 --- a/Common/Gfx/Util/WICBitmapDIB.h +++ b/Common/Gfx/Util/WICBitmapDIB.h @@ -36,6 +36,9 @@ public: WICBitmapDIB(); ~WICBitmapDIB(); + WICBitmapDIB(const WICBitmapDIB& other) = delete; + WICBitmapDIB& operator=(WICBitmapDIB other) = delete; + void Resize(UINT w, UINT h); HBITMAP GetHandle() const { return m_DIBSectionBuffer; } diff --git a/Common/Gfx/Util/WICBitmapLockDIB.h b/Common/Gfx/Util/WICBitmapLockDIB.h index 6a8efefd..5a8789c8 100644 --- a/Common/Gfx/Util/WICBitmapLockDIB.h +++ b/Common/Gfx/Util/WICBitmapLockDIB.h @@ -48,6 +48,9 @@ public: IFACEMETHOD(GetPixelFormat)(WICPixelFormatGUID* pPixelFormat); private: + WICBitmapLockDIB(const WICBitmapLockDIB& other) = delete; + WICBitmapLockDIB& operator=(WICBitmapLockDIB other) = delete; + WICBitmapDIB* m_Bitmap; const WICRect* m_Rect; UINT m_RefCount; diff --git a/Common/Gfx/Util/WICBitmapLockGDIP.h b/Common/Gfx/Util/WICBitmapLockGDIP.h index 13c997e8..07c64733 100644 --- a/Common/Gfx/Util/WICBitmapLockGDIP.h +++ b/Common/Gfx/Util/WICBitmapLockGDIP.h @@ -48,6 +48,9 @@ public: IFACEMETHOD(GetPixelFormat)(WICPixelFormatGUID* pPixelFormat); private: + WICBitmapLockGDIP(const WICBitmapLockGDIP& other) = delete; + WICBitmapLockGDIP& operator=(WICBitmapLockGDIP other) = delete; + Gdiplus::BitmapData m_BitmapData; UINT m_RefCount; }; diff --git a/Library/ConfigParser.h b/Library/ConfigParser.h index d8c6d54a..d37a3a9e 100644 --- a/Library/ConfigParser.h +++ b/Library/ConfigParser.h @@ -42,6 +42,9 @@ public: ConfigParser(); ~ConfigParser(); + ConfigParser(const ConfigParser& other) = delete; + ConfigParser& operator=(ConfigParser other) = delete; + void Initialize(const std::wstring& filename, MeterWindow* meterWindow = nullptr, LPCTSTR skinSection = nullptr, const std::wstring* resourcePath = nullptr); void AddMeasure(Measure* pMeasure); diff --git a/Library/ContextMenu.h b/Library/ContextMenu.h index 497941e2..a13a5bfe 100644 --- a/Library/ContextMenu.h +++ b/Library/ContextMenu.h @@ -29,6 +29,9 @@ class ContextMenu public: ContextMenu(); + ContextMenu(const ContextMenu& other) = delete; + ContextMenu& operator=(ContextMenu other) = delete; + bool IsMenuActive() { return m_MenuActive; } void ShowMenu(POINT pos, MeterWindow* meterWindow); diff --git a/Library/DialogAbout.h b/Library/DialogAbout.h index 6dd16192..d6e31e2f 100644 --- a/Library/DialogAbout.h +++ b/Library/DialogAbout.h @@ -29,6 +29,9 @@ public: DialogAbout(); virtual ~DialogAbout(); + DialogAbout(const DialogAbout& other) = delete; + DialogAbout& operator=(DialogAbout other) = delete; + static Dialog* GetDialog() { return c_Dialog; } static void Open(int tab = 0); diff --git a/Library/DialogManage.h b/Library/DialogManage.h index 96cefecb..1f6709a6 100644 --- a/Library/DialogManage.h +++ b/Library/DialogManage.h @@ -28,6 +28,9 @@ public: DialogManage(); virtual ~DialogManage(); + DialogManage(const DialogManage& other) = delete; + DialogManage& operator=(DialogManage other) = delete; + static Dialog* GetDialog() { return c_Dialog; } static void Open(const WCHAR* tabName, const WCHAR* param1, const WCHAR* param2); diff --git a/Library/Group.h b/Library/Group.h index 25079188..d7464a6a 100644 --- a/Library/Group.h +++ b/Library/Group.h @@ -27,6 +27,9 @@ class __declspec(novtable) Group public: virtual ~Group() {} + Group(const Group& other) = delete; + Group& operator=(Group other) = delete; + bool BelongsToGroup(const std::wstring& group) const; protected: diff --git a/Library/IfActions.h b/Library/IfActions.h index 1ea0ebc7..1243a599 100644 --- a/Library/IfActions.h +++ b/Library/IfActions.h @@ -63,6 +63,9 @@ public: IfActions(); ~IfActions(); + IfActions(const IfActions& other) = delete; + IfActions& operator=(IfActions other) = delete; + void ReadOptions(ConfigParser& parser, const WCHAR* section); void ReadConditionOptions(ConfigParser& parser, const WCHAR* section); void DoIfActions(Measure& measure, double value); diff --git a/Library/Logger.h b/Library/Logger.h index 645da3b3..08db6c12 100644 --- a/Library/Logger.h +++ b/Library/Logger.h @@ -77,6 +77,9 @@ private: Logger(); ~Logger(); + Logger(const Logger& other) = delete; + Logger& operator=(Logger other) = delete; + bool m_LogToFile; std::wstring m_LogFilePath; diff --git a/Library/Measure.h b/Library/Measure.h index 86aff4c5..61a3ba71 100644 --- a/Library/Measure.h +++ b/Library/Measure.h @@ -58,6 +58,8 @@ class __declspec(novtable) Measure : public Section public: virtual ~Measure(); + Measure(const Measure& other) = delete; + void ReadOptions(ConfigParser& parser) { ReadOptions(parser, GetName()); } virtual void Initialize(); diff --git a/Library/MeasureCPU.h b/Library/MeasureCPU.h index c96acf48..26f21402 100644 --- a/Library/MeasureCPU.h +++ b/Library/MeasureCPU.h @@ -29,6 +29,9 @@ public: MeasureCPU(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureCPU(); + MeasureCPU(const MeasureCPU& other) = delete; + MeasureCPU& operator=(MeasureCPU other) = delete; + virtual UINT GetTypeID() { return TypeID(); } static void InitializeStatic(); diff --git a/Library/MeasureCalc.h b/Library/MeasureCalc.h index 179cd40a..ceb386e6 100644 --- a/Library/MeasureCalc.h +++ b/Library/MeasureCalc.h @@ -27,6 +27,9 @@ public: MeasureCalc(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureCalc(); + MeasureCalc(const MeasureCalc& other) = delete; + MeasureCalc& operator=(MeasureCalc other) = delete; + virtual UINT GetTypeID() { return TypeID(); } protected: diff --git a/Library/MeasureDiskSpace.h b/Library/MeasureDiskSpace.h index 5ee267d7..d96546f9 100644 --- a/Library/MeasureDiskSpace.h +++ b/Library/MeasureDiskSpace.h @@ -27,6 +27,9 @@ public: MeasureDiskSpace(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureDiskSpace(); + MeasureDiskSpace(const MeasureDiskSpace& other) = delete; + MeasureDiskSpace& operator=(MeasureDiskSpace other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual const WCHAR* GetStringValue(); diff --git a/Library/MeasureMemory.h b/Library/MeasureMemory.h index f10c068e..ae0798ba 100644 --- a/Library/MeasureMemory.h +++ b/Library/MeasureMemory.h @@ -27,6 +27,9 @@ public: MeasureMemory(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureMemory(); + MeasureMemory(const MeasureMemory& other) = delete; + MeasureMemory& operator=(MeasureMemory other) = delete; + virtual UINT GetTypeID() { return TypeID(); } protected: diff --git a/Library/MeasureNet.h b/Library/MeasureNet.h index 6e639d6f..32fb0a16 100644 --- a/Library/MeasureNet.h +++ b/Library/MeasureNet.h @@ -53,6 +53,9 @@ protected: MeasureNet(MeterWindow* meterWindow, const WCHAR* name, NET type); virtual ~MeasureNet(); + MeasureNet(const MeasureNet& other) = delete; + MeasureNet& operator=(MeasureNet other) = delete; + virtual void ReadOptions(ConfigParser& parser, const WCHAR* section); virtual void UpdateValue(); diff --git a/Library/MeasureNetIn.h b/Library/MeasureNetIn.h index 77456b26..508c3d73 100644 --- a/Library/MeasureNetIn.h +++ b/Library/MeasureNetIn.h @@ -26,6 +26,9 @@ class MeasureNetIn : public MeasureNet public: MeasureNetIn(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureNetIn(); + + MeasureNetIn(const MeasureNetIn& other) = delete; + MeasureNetIn& operator=(MeasureNetIn other) = delete; }; #endif diff --git a/Library/MeasureNetOut.h b/Library/MeasureNetOut.h index 7a619df4..ebd30323 100644 --- a/Library/MeasureNetOut.h +++ b/Library/MeasureNetOut.h @@ -26,6 +26,9 @@ class MeasureNetOut : public MeasureNet public: MeasureNetOut(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureNetOut(); + + MeasureNetOut(const MeasureNetOut& other) = delete; + MeasureNetOut& operator=(MeasureNetOut other) = delete; }; #endif diff --git a/Library/MeasureNetTotal.h b/Library/MeasureNetTotal.h index aab63e81..812a6a37 100644 --- a/Library/MeasureNetTotal.h +++ b/Library/MeasureNetTotal.h @@ -26,6 +26,9 @@ class MeasureNetTotal : public MeasureNet public: MeasureNetTotal(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureNetTotal(); + + MeasureNetTotal(const MeasureNetTotal& other) = delete; + MeasureNetTotal& operator=(MeasureNetTotal other) = delete; }; #endif diff --git a/Library/MeasurePhysicalMemory.h b/Library/MeasurePhysicalMemory.h index 5cf64cf7..fbacd696 100644 --- a/Library/MeasurePhysicalMemory.h +++ b/Library/MeasurePhysicalMemory.h @@ -27,6 +27,9 @@ public: MeasurePhysicalMemory(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasurePhysicalMemory(); + MeasurePhysicalMemory(const MeasurePhysicalMemory& other) = delete; + MeasurePhysicalMemory& operator=(MeasurePhysicalMemory other) = delete; + virtual UINT GetTypeID() { return TypeID(); } protected: diff --git a/Library/MeasurePlugin.h b/Library/MeasurePlugin.h index 33040f50..075cec9c 100644 --- a/Library/MeasurePlugin.h +++ b/Library/MeasurePlugin.h @@ -42,6 +42,9 @@ public: MeasurePlugin(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasurePlugin(); + MeasurePlugin(const MeasurePlugin& other) = delete; + MeasurePlugin& operator=(MeasurePlugin other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual const WCHAR* GetStringValue(); diff --git a/Library/MeasureRegistry.h b/Library/MeasureRegistry.h index a01acc1c..73c0116d 100644 --- a/Library/MeasureRegistry.h +++ b/Library/MeasureRegistry.h @@ -27,6 +27,9 @@ public: MeasureRegistry(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureRegistry(); + MeasureRegistry(const MeasureRegistry& other) = delete; + MeasureRegistry& operator=(MeasureRegistry other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual const WCHAR* GetStringValue(); diff --git a/Library/MeasureScript.h b/Library/MeasureScript.h index c8c5daa4..26396270 100644 --- a/Library/MeasureScript.h +++ b/Library/MeasureScript.h @@ -27,6 +27,9 @@ public: MeasureScript(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureScript(); + MeasureScript(const MeasureScript& other) = delete; + MeasureScript& operator=(MeasureScript other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual const WCHAR* GetStringValue(); diff --git a/Library/MeasureString.h b/Library/MeasureString.h index ecf7c503..e02d1d49 100644 --- a/Library/MeasureString.h +++ b/Library/MeasureString.h @@ -27,6 +27,9 @@ public: MeasureString(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureString(); + MeasureString(const MeasureString& other) = delete; + MeasureString& operator=(MeasureString other) = delete; + virtual const WCHAR* GetStringValue(); virtual UINT GetTypeID() { return TypeID(); } diff --git a/Library/MeasureTime.h b/Library/MeasureTime.h index 2d255377..3b62a9fd 100644 --- a/Library/MeasureTime.h +++ b/Library/MeasureTime.h @@ -27,6 +27,9 @@ public: MeasureTime(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureTime(); + MeasureTime(const MeasureTime& other) = delete; + MeasureTime& operator=(MeasureTime other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual const WCHAR* GetStringValue(); diff --git a/Library/MeasureUptime.h b/Library/MeasureUptime.h index 4ef33f72..f94f1630 100644 --- a/Library/MeasureUptime.h +++ b/Library/MeasureUptime.h @@ -27,6 +27,9 @@ public: MeasureUptime(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureUptime(); + MeasureUptime(const MeasureUptime& other) = delete; + MeasureUptime& operator=(MeasureUptime other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual const WCHAR* GetStringValue(); diff --git a/Library/MeasureVirtualMemory.h b/Library/MeasureVirtualMemory.h index 19f37a0e..31c1265b 100644 --- a/Library/MeasureVirtualMemory.h +++ b/Library/MeasureVirtualMemory.h @@ -27,6 +27,9 @@ public: MeasureVirtualMemory(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeasureVirtualMemory(); + MeasureVirtualMemory(const MeasureVirtualMemory& other) = delete; + MeasureVirtualMemory& operator=(MeasureVirtualMemory other) = delete; + virtual UINT GetTypeID() { return TypeID(); } protected: diff --git a/Library/Meter.h b/Library/Meter.h index a63a2e09..5b0bb243 100644 --- a/Library/Meter.h +++ b/Library/Meter.h @@ -37,6 +37,8 @@ class __declspec(novtable) Meter : public Section public: virtual ~Meter(); + Meter(const Meter& other) = delete; + void ReadOptions(ConfigParser& parser) { ReadOptions(parser, GetName()); parser.ClearStyleTemplate(); } virtual void Initialize(); diff --git a/Library/MeterBar.h b/Library/MeterBar.h index 1ec8953e..16434824 100644 --- a/Library/MeterBar.h +++ b/Library/MeterBar.h @@ -28,6 +28,9 @@ public: MeterBar(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterBar(); + MeterBar(const MeterBar& other) = delete; + MeterBar& operator=(MeterBar other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual void Initialize(); diff --git a/Library/MeterBitmap.h b/Library/MeterBitmap.h index e2715b08..555e1a48 100644 --- a/Library/MeterBitmap.h +++ b/Library/MeterBitmap.h @@ -28,6 +28,9 @@ public: MeterBitmap(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterBitmap(); + MeterBitmap(const MeterBitmap& other) = delete; + MeterBitmap& operator=(MeterBitmap other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual bool HitTest(int x, int y); diff --git a/Library/MeterButton.h b/Library/MeterButton.h index 99511b8b..60995b21 100644 --- a/Library/MeterButton.h +++ b/Library/MeterButton.h @@ -30,6 +30,9 @@ public: MeterButton(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterButton(); + MeterButton(const MeterButton& other) = delete; + MeterButton& operator=(MeterButton other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual void Initialize(); diff --git a/Library/MeterHistogram.h b/Library/MeterHistogram.h index 02ce2fd1..81a6b36e 100644 --- a/Library/MeterHistogram.h +++ b/Library/MeterHistogram.h @@ -28,6 +28,9 @@ public: MeterHistogram(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterHistogram(); + MeterHistogram(const MeterHistogram& other) = delete; + MeterHistogram& operator=(MeterHistogram other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual void Initialize(); diff --git a/Library/MeterImage.h b/Library/MeterImage.h index ee8a616a..bf98bb67 100644 --- a/Library/MeterImage.h +++ b/Library/MeterImage.h @@ -28,6 +28,9 @@ public: MeterImage(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterImage(); + MeterImage(const MeterImage& other) = delete; + MeterImage& operator=(MeterImage other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual void Initialize(); diff --git a/Library/MeterLine.h b/Library/MeterLine.h index bed880d1..cca32e7c 100644 --- a/Library/MeterLine.h +++ b/Library/MeterLine.h @@ -27,6 +27,9 @@ public: MeterLine(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterLine(); + MeterLine(const MeterLine& other) = delete; + MeterLine& operator=(MeterLine other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual void Initialize(); diff --git a/Library/MeterRotator.h b/Library/MeterRotator.h index a43bb5f5..243e12c5 100644 --- a/Library/MeterRotator.h +++ b/Library/MeterRotator.h @@ -28,6 +28,9 @@ public: MeterRotator(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterRotator(); + MeterRotator(const MeterRotator& other) = delete; + MeterRotator& operator=(MeterRotator other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual void Initialize(); diff --git a/Library/MeterRoundLine.h b/Library/MeterRoundLine.h index 131d3dae..5db244e1 100644 --- a/Library/MeterRoundLine.h +++ b/Library/MeterRoundLine.h @@ -27,6 +27,9 @@ public: MeterRoundLine(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterRoundLine(); + MeterRoundLine(const MeterRoundLine& other) = delete; + MeterRoundLine& operator=(MeterRoundLine other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual bool Update(); diff --git a/Library/MeterString.h b/Library/MeterString.h index 296dc97b..df8bdd57 100644 --- a/Library/MeterString.h +++ b/Library/MeterString.h @@ -29,6 +29,9 @@ public: MeterString(MeterWindow* meterWindow, const WCHAR* name); virtual ~MeterString(); + MeterString(const MeterString& other) = delete; + MeterString& operator=(MeterString other) = delete; + virtual UINT GetTypeID() { return TypeID(); } virtual int GetX(bool abs = false); diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 1401cf90..3b210f6e 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -115,6 +115,9 @@ public: MeterWindow(const std::wstring& folderPath, const std::wstring& file); ~MeterWindow(); + MeterWindow(const MeterWindow& other) = delete; + MeterWindow& operator=(MeterWindow other) = delete; + void Initialize(); void DoBang(Bang bang, const std::vector& args); diff --git a/Library/Mouse.h b/Library/Mouse.h index adc9ade6..d6deb23d 100644 --- a/Library/Mouse.h +++ b/Library/Mouse.h @@ -66,6 +66,9 @@ public: Mouse(MeterWindow* meterWindow, Meter* meter = nullptr); ~Mouse(); + Mouse(const Mouse& other) = delete; + Mouse& operator=(Mouse other) = delete; + void ReadOptions(ConfigParser& parser, const WCHAR* section); MOUSECURSOR GetCursorType() const { return m_CursorType; } diff --git a/Library/Rainmeter.h b/Library/Rainmeter.h index ed2a0f8c..727f0932 100644 --- a/Library/Rainmeter.h +++ b/Library/Rainmeter.h @@ -189,6 +189,9 @@ private: Rainmeter(); ~Rainmeter(); + Rainmeter(const Rainmeter& other) = delete; + Rainmeter& operator=(Rainmeter other) = delete; + static LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); void ActivateActiveSkins(); diff --git a/Library/Section.h b/Library/Section.h index 4becf49d..1d22d41a 100644 --- a/Library/Section.h +++ b/Library/Section.h @@ -31,6 +31,8 @@ class __declspec(novtable) Section : public Group public: virtual ~Section(); + Section(const Section& other) = delete; + virtual UINT GetTypeID() = 0; const WCHAR* GetName() const { return m_Name.c_str(); } diff --git a/Library/SkinRegistry.h b/Library/SkinRegistry.h index 3d37fba0..85ecd305 100644 --- a/Library/SkinRegistry.h +++ b/Library/SkinRegistry.h @@ -29,6 +29,10 @@ class SkinRegistry { public: + SkinRegistry() = default; + SkinRegistry(const SkinRegistry& other) = delete; + SkinRegistry& operator=(SkinRegistry other) = delete; + struct Folder { std::wstring name; diff --git a/Library/System.h b/Library/System.h index 292f73d9..28bafb60 100644 --- a/Library/System.h +++ b/Library/System.h @@ -46,6 +46,9 @@ struct MultiMonitorInfo class System { public: + System(const System& other) = delete; + System& operator=(System other) = delete; + static void Initialize(HINSTANCE instance); static void Finalize(); diff --git a/Library/TintedImage.h b/Library/TintedImage.h index ba982514..8d84477a 100644 --- a/Library/TintedImage.h +++ b/Library/TintedImage.h @@ -73,6 +73,9 @@ public: TintedImage(const WCHAR* name = L"ImageName", const WCHAR** optionArray = c_DefaultOptionArray, bool disableTransform = false, MeterWindow* meterWindow = nullptr); ~TintedImage(); + TintedImage(const TintedImage& other) = delete; + TintedImage& operator=(TintedImage other) = delete; + void ReadOptions(ConfigParser& parser, const WCHAR* section, const WCHAR* imagePath = L""); bool IsLoaded() { return (m_Bitmap != nullptr); } diff --git a/Library/TrayWindow.h b/Library/TrayWindow.h index ae7df7cd..63f4f0fa 100644 --- a/Library/TrayWindow.h +++ b/Library/TrayWindow.h @@ -43,6 +43,9 @@ public: TrayWindow(); ~TrayWindow(); + TrayWindow(const TrayWindow& other) = delete; + TrayWindow& operator=(TrayWindow other) = delete; + void Initialize(); void ReadOptions(ConfigParser& parser);