1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
/*
*
* Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <tqlayout.h>
#include <dcopclient.h>
#include <kapplication.h>
#include <kglobal.h>
#include <klocale.h>
#include <kconfig.h>
#include <kgenericfactory.h>
#include <kaboutdata.h>
#include <kdialog.h>
#include "mouse.h"
#include "windows.h"
#include "main.h"
extern "C"
{
KDE_EXPORT KCModule *create_kwinfocus(TQWidget *parent, const char *name)
{
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalogue("kcmkwm");
KConfig *c = new KConfig("kwinrc", false, true);
return new KFocusConfig(true, c, parent, name);
}
KDE_EXPORT KCModule *create_kwinactions(TQWidget *parent, const char *name)
{
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalogue("kcmkwm");
return new KActionsOptions( parent, name);
}
KDE_EXPORT KCModule *create_kwinmoving(TQWidget *parent, const char *name)
{
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalogue("kcmkwm");
KConfig *c = new KConfig("kwinrc", false, true);
return new KMovingConfig(true, c, parent, name);
}
KDE_EXPORT KCModule *create_kwinadvanced(TQWidget *parent, const char *name)
{
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalogue("kcmkwm");
KConfig *c = new KConfig("kwinrc", false, true);
return new KAdvancedConfig(true, c, parent, name);
}
KDE_EXPORT KCModule *create_kwintranslucency(TQWidget *parent, const char *name)
{
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalogue("kcmkwm");
KConfig *c = new KConfig("kwinrc", false, true);
return new KTranslucencyConfig(true, c, parent, name);
}
KDE_EXPORT KCModule *create_kwinoptions ( TQWidget *parent, const char* name)
{
//CT there's need for decision: kwm or kwin?
KGlobal::locale()->insertCatalogue("kcmkwm");
return new KWinOptions( parent, name);
}
}
KWinOptions::KWinOptions(TQWidget *parent, const char *name)
: KCModule(parent, name)
{
mConfig = new KConfig("kwinrc", false, true);
TQVBoxLayout *layout = new TQVBoxLayout(this);
tab = new TQTabWidget(this);
layout->addWidget(tab);
mFocus = new KFocusConfig(false, mConfig, this, "KWin Focus Config");
mFocus->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mFocus, i18n("&Focus"));
connect(mFocus, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool)));
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "KWin TitleBar Actions");
mTitleBarActions->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mTitleBarActions, i18n("&Titlebar Actions"));
connect(mTitleBarActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool)));
mWindowActions = new KWindowActionsConfig(false, mConfig, this, "KWin Window Actions");
mWindowActions->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mWindowActions, i18n("Window Actio&ns"));
connect(mWindowActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool)));
mMoving = new KMovingConfig(false, mConfig, this, "KWin Moving");
mMoving->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mMoving, i18n("&Moving"));
connect(mMoving, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool)));
mAdvanced = new KAdvancedConfig(false, mConfig, this, "KWin Advanced");
mAdvanced->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mAdvanced, i18n("Ad&vanced"));
connect(mAdvanced, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool)));
mTranslucency = new KTranslucencyConfig(false, mConfig, this, "KWin Translucency");
mTranslucency->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mTranslucency, i18n("&Translucency"));
connect(mTranslucency, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool)));
KAboutData *about =
new KAboutData(I18N_NOOP("kcmkwinoptions"), I18N_NOOP("Window Behavior Configuration Module"),
0, 0, KAboutData::License_GPL,
I18N_NOOP("(c) 1997 - 2002 KWin and KControl Authors"));
about->addAuthor("Matthias Ettrich",0,"ettrich@kde.org");
about->addAuthor("Waldo Bastian",0,"bastian@kde.org");
about->addAuthor("Cristian Tibirna",0,"tibirna@kde.org");
about->addAuthor("Matthias Kalle Dalheimer",0,"kalle@kde.org");
about->addAuthor("Daniel Molkentin",0,"molkentin@kde.org");
about->addAuthor("Wynn Wilkes",0,"wynnw@caldera.com");
about->addAuthor("Pat Dowler",0,"dowler@pt1B1106.FSH.UVic.CA");
about->addAuthor("Bernd Wuebben",0,"wuebben@kde.org");
about->addAuthor("Matthias Hoelzer-Kluepfel",0,"hoelzer@kde.org");
setAboutData(about);
}
KWinOptions::~KWinOptions()
{
delete mConfig;
}
void KWinOptions::load()
{
mConfig->reparseConfiguration();
mFocus->load();
mTitleBarActions->load();
mWindowActions->load();
mMoving->load();
mAdvanced->load();
mTranslucency->load();
emit KCModule::changed( false );
}
void KWinOptions::save()
{
mFocus->save();
mTitleBarActions->save();
mWindowActions->save();
mMoving->save();
mAdvanced->save();
mTranslucency->save();
emit KCModule::changed( false );
// Send signal to kwin
mConfig->sync();
if ( !kapp->dcopClient()->isAttached() )
kapp->dcopClient()->attach();
kapp->dcopClient()->send("kwin*", "", "reconfigure()", "");
}
void KWinOptions::defaults()
{
mFocus->defaults();
mTitleBarActions->defaults();
mWindowActions->defaults();
mMoving->defaults();
mAdvanced->defaults();
mTranslucency->defaults();
}
TQString KWinOptions::quickHelp() const
{
return i18n("<h1>Window Behavior</h1> Here you can customize the way windows behave when being"
" moved, resized or clicked on. You can also specify a focus policy as well as a placement"
" policy for new windows."
" <p>Please note that this configuration will not take effect if you do not use"
" KWin as your window manager. If you do use a different window manager, please refer to its documentation"
" for how to customize window behavior.");
}
void KWinOptions::moduleChanged(bool state)
{
emit KCModule::changed(state);
}
KActionsOptions::KActionsOptions(TQWidget *parent, const char *name)
: KCModule(parent, name)
{
mConfig = new KConfig("kwinrc", false, true);
TQVBoxLayout *layout = new TQVBoxLayout(this);
tab = new TQTabWidget(this);
layout->addWidget(tab);
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "KWin TitleBar Actions");
mTitleBarActions->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mTitleBarActions, i18n("&Titlebar Actions"));
connect(mTitleBarActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool)));
mWindowActions = new KWindowActionsConfig(false, mConfig, this, "KWin Window Actions");
mWindowActions->layout()->setMargin( KDialog::marginHint() );
tab->addTab(mWindowActions, i18n("Window Actio&ns"));
connect(mWindowActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool)));
}
KActionsOptions::~KActionsOptions()
{
delete mConfig;
}
void KActionsOptions::load()
{
mTitleBarActions->load();
mWindowActions->load();
emit KCModule::changed( false );
}
void KActionsOptions::save()
{
mTitleBarActions->save();
mWindowActions->save();
emit KCModule::changed( false );
// Send signal to kwin
mConfig->sync();
if ( !kapp->dcopClient()->isAttached() )
kapp->dcopClient()->attach();
kapp->dcopClient()->send("kwin*", "", "reconfigure()", "");
}
void KActionsOptions::defaults()
{
mTitleBarActions->defaults();
mWindowActions->defaults();
}
void KActionsOptions::moduleChanged(bool state)
{
emit KCModule::changed(state);
}
#include "main.moc"
|