Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwinscreenedges/touch.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2009 Lucas Murray <lmurray@undefinedfire.com> | 5 | Copyright (C) 2009 Lucas Murray <lmurray@undefinedfire.com> | ||
6 | Copyright (C) 2020 Cyril Rossi <cyril.rossi@enioka.com> | ||||
6 | 7 | | |||
7 | This program is free software; you can redistribute it and/or modify | 8 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | 10 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | 11 | (at your option) any later version. | ||
11 | 12 | | |||
12 | This program is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 13 Lines | |||||
27 | #include "kwinglobals.h" | 28 | #include "kwinglobals.h" | ||
28 | 29 | | |||
29 | #include "ui_touch.h" | 30 | #include "ui_touch.h" | ||
30 | 31 | | |||
31 | class QShowEvent; | 32 | class QShowEvent; | ||
32 | 33 | | |||
33 | namespace KWin | 34 | namespace KWin | ||
34 | { | 35 | { | ||
36 | class KWinTouchScreenSettings; | ||||
37 | class KWinTouchScreenScriptSettings; | ||||
35 | enum class BuiltInEffect; | 38 | enum class BuiltInEffect; | ||
36 | 39 | | |||
37 | class KWinScreenEdgesConfigForm : public QWidget, public Ui::KWinScreenEdgesConfigForm | 40 | class KWinScreenEdgesConfigForm : public QWidget, public Ui::KWinScreenEdgesConfigForm | ||
38 | { | 41 | { | ||
39 | Q_OBJECT | 42 | Q_OBJECT | ||
40 | 43 | | |||
41 | public: | 44 | public: | ||
42 | explicit KWinScreenEdgesConfigForm(QWidget* parent); | 45 | explicit KWinScreenEdgesConfigForm(QWidget* parent); | ||
43 | }; | 46 | }; | ||
44 | 47 | | |||
45 | class KWinScreenEdgesConfig : public KCModule | 48 | class KWinScreenEdgesConfig : public KCModule | ||
46 | { | 49 | { | ||
47 | Q_OBJECT | 50 | Q_OBJECT | ||
48 | 51 | | |||
49 | public: | 52 | public: | ||
50 | explicit KWinScreenEdgesConfig(QWidget* parent, const QVariantList& args); | 53 | explicit KWinScreenEdgesConfig(QWidget* parent, const QVariantList& args); | ||
51 | ~KWinScreenEdgesConfig() override; | 54 | ~KWinScreenEdgesConfig() override; | ||
52 | 55 | | |||
53 | public Q_SLOTS: | 56 | public Q_SLOTS: | ||
54 | void save() override; | 57 | void save() override; | ||
55 | void load() override; | 58 | void load() override; | ||
56 | void defaults() override; | 59 | void defaults() override; | ||
60 | | ||||
57 | protected: | 61 | protected: | ||
58 | void showEvent(QShowEvent* e) override; | 62 | void showEvent(QShowEvent* e) override; | ||
63 | | ||||
59 | private: | 64 | private: | ||
60 | KWinScreenEdgesConfigForm* m_ui; | 65 | KWinScreenEdgesConfigForm* m_ui; | ||
61 | KSharedConfigPtr m_config; | 66 | KSharedConfigPtr m_config; | ||
62 | QStringList m_scripts; //list of script IDs ordered in the list they are presented in the menu | 67 | QStringList m_scripts; //list of script IDs ordered in the list they are presented in the menu | ||
68 | QHash<QString, KWinTouchScreenScriptSettings*> m_scriptSettings; | ||||
69 | KWinTouchScreenSettings *m_settings; | ||||
63 | 70 | | |||
64 | enum EffectActions { | 71 | enum EffectActions { | ||
65 | PresentWindowsAll = ELECTRIC_ACTION_COUNT, // Start at the end of built in actions | 72 | PresentWindowsAll = ELECTRIC_ACTION_COUNT, // Start at the end of built in actions | ||
66 | PresentWindowsCurrent, | 73 | PresentWindowsCurrent, | ||
67 | PresentWindowsClass, | 74 | PresentWindowsClass, | ||
68 | DesktopGrid, | 75 | DesktopGrid, | ||
69 | Cube, | 76 | Cube, | ||
70 | Cylinder, | 77 | Cylinder, | ||
71 | Sphere, | 78 | Sphere, | ||
72 | TabBox, | 79 | TabBox, | ||
73 | TabBoxAlternative, | 80 | TabBoxAlternative, | ||
74 | EffectCount | 81 | EffectCount | ||
75 | }; | 82 | }; | ||
76 | 83 | | |||
77 | bool effectEnabled(const BuiltInEffect& effect, const KConfigGroup& cfg) const; | 84 | bool effectEnabled(const BuiltInEffect& effect, const KConfigGroup& cfg) const; | ||
78 | 85 | | |||
79 | void monitorAddItem(const QString& item); | 86 | void monitorAddItem(const QString& item); | ||
80 | void monitorItemSetEnabled(int index, bool enabled); | 87 | void monitorItemSetEnabled(int index, bool enabled); | ||
81 | void monitorInit(); | 88 | void monitorInit(); | ||
82 | void monitorLoadAction(ElectricBorder edge, const QString& configName); | 89 | void monitorLoadSettings(); | ||
83 | void monitorLoad(); | 90 | void monitorSaveSettings(); | ||
84 | void monitorSaveAction(int edge, const QString& configName); | | |||
85 | void monitorSave(); | | |||
86 | void monitorDefaults(); | | |||
87 | void monitorShowEvent(); | 91 | void monitorShowEvent(); | ||
88 | void monitorChangeEdge(ElectricBorder border, int index); | 92 | void monitorChangeEdge(ElectricBorder border, int index); | ||
89 | void monitorHideEdge(ElectricBorder border, bool hidden); | 93 | void monitorHideEdge(ElectricBorder border, bool hidden); | ||
90 | QList<int> monitorCheckEffectHasEdge(int index) const; | 94 | QList<int> monitorCheckEffectHasEdge(int index) const; | ||
95 | | ||||
96 | void updateUnmanagedState(); | ||||
97 | | ||||
98 | static ElectricBorderAction electricBorderActionFromString(const QString &string); | ||||
99 | static QString electricBorderActionToString(int action); | ||||
ervin: a -> action also I wonder why it's an int and not ElectricBorderAction | |||||
Sadly it takes the action from Monitor::selectedEdgeItem() which is an int, and also includes values that are not ElectricBorderAction. crossi: Sadly it takes the action from Monitor::selectedEdgeItem() which is an int, and also includes… | |||||
91 | }; | 100 | }; | ||
92 | 101 | | |||
93 | } // namespace | 102 | } // namespace | ||
94 | 103 | | |||
95 | #endif | 104 | #endif |
a -> action also I wonder why it's an int and not ElectricBorderAction