1 /*
2  *  SPDX-License-Identifier: GPL-2.0-or-later
3  *
4  *  SPDX-FileCopyrightText: 2001 Michael v.Ostheim <MvOstheim@web.de>
5  */
6 
7 #ifndef KGAMMA_H_
8 #define KGAMMA_H_
9 
10 #include <KCModule>
11 // Added by qt3to4:
12 #include <QList>
13 
14 class GammaCtrl;
15 class QCheckBox;
16 class QComboBox;
17 class QProcess;
18 class XVidExtWrap;
19 
20 class KGamma : public KCModule
21 {
22     Q_OBJECT
23 public:
24     KGamma(QWidget *parent_P, const QVariantList &args);
25     ~KGamma() override;
26 
27     void load() override;
28     void save() override;
29     void defaults() override;
30     int buttons();
31     QString quickHelp() const override;
32 
33 protected: // Protected methods
34     /** The user interface */
35     void setupUI();
36     /** Decides if to load settings from user or system config */
37     bool loadSettings();
38     /** Load settings from kgammarc */
39     bool loadUserSettings();
40     /** Load settings from XF86Config */
41     bool loadSystemSettings();
42     /** Validate the loaded gamma values */
43     bool validateGammaValues();
44 
45 private Q_SLOTS:
46     /** Called if the user changesd something */
Changed()47     void Changed()
48     {
49         Q_EMIT changed(true);
50     }
51     /** Called if the user marked or unmarked the XF86Config checkbox */
52     void changeConfig();
53     /** Called if the user marked or unmarked the sync screen checkbox */
54     void SyncScreens();
55     /** Called if the user chooses a new screen */
56     void changeScreen(int sn);
57 
58 private:
59     bool saved, GammaCorrection;
60     int ScreenCount, currentScreen;
61     QStringList rgamma, ggamma, bgamma;
62     QList<int> assign;
63     QList<float> rbak, gbak, bbak;
64     GammaCtrl *gctrl, *rgctrl, *ggctrl, *bgctrl;
65     QCheckBox *xf86cfgbox, *syncbox;
66     QComboBox *screenselect;
67     QProcess *rootProcess;
68     XVidExtWrap *xv;
69 };
70 
71 #endif
72