File indexing completed on 2024-05-19 16:31:48

0001 /*
0002  *  SPDX-License-Identifier: GPL-2.0-or-later
0003  *
0004  *  SPDX-FileCopyrightText: 2001 Michael v.Ostheim <MvOstheim@web.de>
0005  */
0006 
0007 #ifndef KGAMMA_H_
0008 #define KGAMMA_H_
0009 
0010 #include <KCModule>
0011 // Added by qt3to4:
0012 #include <QList>
0013 
0014 class GammaCtrl;
0015 class QCheckBox;
0016 class QComboBox;
0017 class QProcess;
0018 class XVidExtWrap;
0019 
0020 class KGamma : public KCModule
0021 {
0022     Q_OBJECT
0023 public:
0024     KGamma(QWidget *parent_P, const QVariantList &args);
0025     ~KGamma() override;
0026 
0027     void load() override;
0028     void save() override;
0029     void defaults() override;
0030     int buttons();
0031     QString quickHelp() const override;
0032 
0033 protected: // Protected methods
0034     /** The user interface */
0035     void setupUI();
0036     /** Decides if to load settings from user or system config */
0037     bool loadSettings();
0038     /** Load settings from kgammarc */
0039     bool loadUserSettings();
0040     /** Load settings from XF86Config */
0041     bool loadSystemSettings();
0042     /** Validate the loaded gamma values */
0043     bool validateGammaValues();
0044 
0045 private Q_SLOTS:
0046     /** Called if the user changesd something */
0047     void Changed()
0048     {
0049         Q_EMIT changed(true);
0050     }
0051     /** Called if the user marked or unmarked the XF86Config checkbox */
0052     void changeConfig();
0053     /** Called if the user marked or unmarked the sync screen checkbox */
0054     void SyncScreens();
0055     /** Called if the user chooses a new screen */
0056     void changeScreen(int sn);
0057 
0058 private:
0059     bool saved, GammaCorrection;
0060     int ScreenCount, currentScreen;
0061     QStringList rgamma, ggamma, bgamma;
0062     QList<int> assign;
0063     QList<float> rbak, gbak, bbak;
0064     GammaCtrl *gctrl, *rgctrl, *ggctrl, *bgctrl;
0065     QCheckBox *xf86cfgbox, *syncbox;
0066     QComboBox *screenselect;
0067     QProcess *rootProcess;
0068     XVidExtWrap *xv;
0069 };
0070 
0071 #endif