File indexing completed on 2024-12-01 08:07:19

0001 /*
0002     SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #include "preferencesdata.h"
0007 
0008 namespace Latte {
0009 namespace Data {
0010 
0011 const bool Preferences::BADGE3DSTYLE;
0012 const bool Preferences::LAYOUTSINFORMATIONWINDOW;
0013 const bool Preferences::AUTOSTART;
0014 const bool Preferences::BORDERLESSMAXIMIZED;
0015 const bool Preferences::ISAVAILABLEGEOMETRYBROADCASTEDTOPLASMA;
0016 const bool Preferences::METAPRESSFORAPPLAUNCHER;
0017 const bool Preferences::METAHOLDFORBADGES;
0018 const int Preferences::PARABOLICSPREAD;
0019 const int Preferences::SCREENSDELAY;
0020 const float Preferences::THICKNESSMARGININFLUENCE = 1.0f;
0021 const Settings::MouseSensitivity Preferences::MOUSESENSITIVITY;
0022 
0023 Preferences::Preferences()
0024 {
0025 }
0026 
0027 Preferences::Preferences(Preferences &&o)
0028     : badgeStyle3D(o.badgeStyle3D),
0029       layoutsInformationWindow(o.layoutsInformationWindow),
0030       autostart(o.autostart),
0031       borderlessMaximized(o.borderlessMaximized),
0032       contextMenuAlwaysActions(o.contextMenuAlwaysActions),
0033       isAvailableGeometryBroadcastedToPlasma(o.isAvailableGeometryBroadcastedToPlasma),
0034       metaPressForAppLauncher(o.metaPressForAppLauncher),
0035       metaHoldForBadges(o.metaHoldForBadges),
0036       mouseSensitivity(o.mouseSensitivity),
0037       parabolicSpread(o.parabolicSpread),
0038       thicknessMarginInfluence(o.thicknessMarginInfluence),
0039       screensDelay(o.screensDelay)
0040 {
0041 }
0042 
0043 Preferences::Preferences(const Preferences &o)
0044     : badgeStyle3D(o.badgeStyle3D),
0045       layoutsInformationWindow(o.layoutsInformationWindow),
0046       autostart(o.autostart),
0047       borderlessMaximized(o.borderlessMaximized),
0048       contextMenuAlwaysActions(o.contextMenuAlwaysActions),
0049       isAvailableGeometryBroadcastedToPlasma(o.isAvailableGeometryBroadcastedToPlasma),
0050       metaPressForAppLauncher(o.metaPressForAppLauncher),
0051       metaHoldForBadges(o.metaHoldForBadges),
0052       mouseSensitivity(o.mouseSensitivity),
0053       parabolicSpread(o.parabolicSpread),
0054       thicknessMarginInfluence(o.thicknessMarginInfluence),
0055       screensDelay(o.screensDelay)
0056 {
0057 }
0058 
0059 Preferences &Preferences::operator=(const Preferences &rhs)
0060 {
0061     badgeStyle3D = rhs.badgeStyle3D;
0062     layoutsInformationWindow = rhs.layoutsInformationWindow;
0063     autostart = rhs.autostart;
0064     borderlessMaximized = rhs.borderlessMaximized;
0065     contextMenuAlwaysActions = rhs.contextMenuAlwaysActions;
0066     isAvailableGeometryBroadcastedToPlasma = rhs.isAvailableGeometryBroadcastedToPlasma;
0067     metaPressForAppLauncher = rhs.metaPressForAppLauncher;
0068     metaHoldForBadges = rhs.metaHoldForBadges;
0069     mouseSensitivity = rhs.mouseSensitivity;
0070     parabolicSpread = rhs.parabolicSpread;
0071     thicknessMarginInfluence = rhs.thicknessMarginInfluence;
0072     screensDelay = rhs.screensDelay;
0073 
0074     return (*this);
0075 }
0076 
0077 Preferences &Preferences::operator=(Preferences &&rhs)
0078 {
0079     badgeStyle3D = rhs.badgeStyle3D;
0080     layoutsInformationWindow = rhs.layoutsInformationWindow;
0081     autostart = rhs.autostart;
0082     borderlessMaximized = rhs.borderlessMaximized;
0083     contextMenuAlwaysActions = rhs.contextMenuAlwaysActions;
0084     isAvailableGeometryBroadcastedToPlasma = rhs.isAvailableGeometryBroadcastedToPlasma;
0085     metaPressForAppLauncher = rhs.metaPressForAppLauncher;
0086     metaHoldForBadges = rhs.metaHoldForBadges;
0087     mouseSensitivity = rhs.mouseSensitivity;
0088     parabolicSpread = rhs.parabolicSpread;
0089     thicknessMarginInfluence = rhs.thicknessMarginInfluence;
0090     screensDelay = rhs.screensDelay;
0091 
0092     return (*this);
0093 }
0094 
0095 bool Preferences::operator==(const Preferences &rhs) const
0096 {
0097     return (badgeStyle3D == rhs.badgeStyle3D)
0098             && (layoutsInformationWindow == rhs.layoutsInformationWindow)
0099             && (autostart == rhs.autostart)
0100             && (borderlessMaximized == rhs.borderlessMaximized)
0101             && (contextMenuAlwaysActions == rhs.contextMenuAlwaysActions)
0102             && (isAvailableGeometryBroadcastedToPlasma == rhs.isAvailableGeometryBroadcastedToPlasma)
0103             && (metaPressForAppLauncher == rhs.metaPressForAppLauncher)
0104             && (metaHoldForBadges == rhs.metaHoldForBadges)
0105             && (mouseSensitivity == rhs.mouseSensitivity)
0106             && (parabolicSpread == rhs.parabolicSpread)
0107             && (thicknessMarginInfluence == rhs.thicknessMarginInfluence)
0108             && (screensDelay == rhs.screensDelay);
0109 }
0110 
0111 bool Preferences::operator!=(const Preferences &rhs) const
0112 {
0113     return !(*this == rhs);
0114 }
0115 
0116 bool Preferences::inDefaultValues() const
0117 {
0118     return (badgeStyle3D == BADGE3DSTYLE)
0119             && (layoutsInformationWindow == LAYOUTSINFORMATIONWINDOW)
0120             && (autostart == AUTOSTART)
0121             && (borderlessMaximized == BORDERLESSMAXIMIZED)
0122             && (contextMenuAlwaysActions == Data::ContextMenu::ACTIONSALWAYSVISIBLE)
0123             && (isAvailableGeometryBroadcastedToPlasma == ISAVAILABLEGEOMETRYBROADCASTEDTOPLASMA)
0124             && (metaPressForAppLauncher == METAPRESSFORAPPLAUNCHER)
0125             && (metaHoldForBadges == METAHOLDFORBADGES)
0126             && (mouseSensitivity == MOUSESENSITIVITY)
0127             && (parabolicSpread == PARABOLICSPREAD)
0128             && (thicknessMarginInfluence == THICKNESSMARGININFLUENCE)
0129             && (screensDelay == SCREENSDELAY);
0130 }
0131 
0132 void Preferences::setToDefaults()
0133 {
0134     badgeStyle3D = BADGE3DSTYLE;
0135     layoutsInformationWindow = LAYOUTSINFORMATIONWINDOW;
0136     autostart = AUTOSTART;
0137     borderlessMaximized = BORDERLESSMAXIMIZED;
0138     contextMenuAlwaysActions = Data::ContextMenu::ACTIONSALWAYSVISIBLE;
0139     isAvailableGeometryBroadcastedToPlasma = ISAVAILABLEGEOMETRYBROADCASTEDTOPLASMA;
0140     metaPressForAppLauncher = METAPRESSFORAPPLAUNCHER;
0141     metaHoldForBadges = METAHOLDFORBADGES;
0142     mouseSensitivity = MOUSESENSITIVITY;
0143     parabolicSpread = PARABOLICSPREAD;
0144     thicknessMarginInfluence = THICKNESSMARGININFLUENCE;
0145     screensDelay = SCREENSDELAY;
0146 }
0147 
0148 
0149 }
0150 }