00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KWIN_OPTIONS_H
00023 #define KWIN_OPTIONS_H
00024
00025 #include <QObject>
00026 #include <QFont>
00027 #include <QPalette>
00028 #include <kdecoration.h>
00029
00030 #include "placement.h"
00031 #include "utils.h"
00032
00033 namespace KWin
00034 {
00035
00036 class Client;
00037 class CompositingPrefs;
00038
00039 class Options : public KDecorationOptions
00040 {
00041 public:
00042
00043 Options();
00044 ~Options();
00045
00046 virtual unsigned long updateSettings();
00047
00079 enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse };
00080 FocusPolicy focusPolicy;
00081
00082
00087 bool clickRaise;
00088
00092 bool autoRaise;
00093
00097 int autoRaiseInterval;
00098
00102 bool delayFocus;
00103
00107 int delayFocusInterval;
00108
00112 bool shadeHover;
00113
00117 int shadeHoverInterval;
00118
00136 enum AltTabStyle { KDE, CDE };
00137 AltTabStyle altTabStyle;
00138
00139
00140 bool separateScreenFocus;
00141
00142 bool activeMouseScreen;
00143
00147 bool xineramaEnabled;
00148 bool xineramaPlacementEnabled;
00149 bool xineramaMovementEnabled;
00150 bool xineramaMaximizeEnabled;
00151 bool xineramaFullscreenEnabled;
00152
00153
00154 int xineramaPlacementScreen;
00155
00159 enum MoveResizeMode { Transparent, Opaque };
00160
00161 MoveResizeMode resizeMode;
00162 MoveResizeMode moveMode;
00163
00164 static MoveResizeMode stringToMoveResizeMode( const QString& s );
00165 static const char* moveResizeModeToString( MoveResizeMode mode );
00166
00167 Placement::Policy placement;
00168
00169 bool focusPolicyIsReasonable()
00170 {
00171 return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse;
00172 }
00173
00177 int borderSnapZone;
00178
00182 int windowSnapZone;
00183
00184
00188 bool snapOnlyWhenOverlapping;
00189
00190 bool showDesktopIsMinimizeAll;
00191
00195 bool rollOverDesktops;
00196
00197
00198 int focusStealingPreventionLevel;
00199
00203 QStringList ignorePositionClasses;
00204
00205 bool checkIgnoreFocusStealing( const Client* c );
00206
00207 WindowOperation operationTitlebarDblClick() { return OpTitlebarDblClick; }
00208
00209 enum MouseCommand
00210 {
00211 MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
00212 MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
00213 MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
00214 MouseMove, MouseUnrestrictedMove,
00215 MouseActivateRaiseAndMove, MouseActivateRaiseAndUnrestrictedMove,
00216 MouseResize, MouseUnrestrictedResize,
00217 MouseShade, MouseSetShade, MouseUnsetShade,
00218 MouseMaximize, MouseRestore, MouseMinimize,
00219 MouseNextDesktop, MousePreviousDesktop,
00220 MouseAbove, MouseBelow,
00221 MouseOpacityMore, MouseOpacityLess,
00222 MouseNothing
00223 };
00224
00225 enum MouseWheelCommand
00226 {
00227 MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
00228 MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
00229 MouseWheelChangeOpacity,
00230 MouseWheelNothing
00231 };
00232
00233 MouseCommand operationTitlebarMouseWheel( int delta )
00234 {
00235 return wheelToMouseCommand( CmdTitlebarWheel, delta );
00236 }
00237 MouseCommand operationWindowMouseWheel( int delta )
00238 {
00239 return wheelToMouseCommand( CmdAllWheel, delta );
00240 }
00241
00242 MouseCommand commandActiveTitlebar1() { return CmdActiveTitlebar1; }
00243 MouseCommand commandActiveTitlebar2() { return CmdActiveTitlebar2; }
00244 MouseCommand commandActiveTitlebar3() { return CmdActiveTitlebar3; }
00245 MouseCommand commandInactiveTitlebar1() { return CmdInactiveTitlebar1; }
00246 MouseCommand commandInactiveTitlebar2() { return CmdInactiveTitlebar2; }
00247 MouseCommand commandInactiveTitlebar3() { return CmdInactiveTitlebar3; }
00248 MouseCommand commandWindow1() { return CmdWindow1; }
00249 MouseCommand commandWindow2() { return CmdWindow2; }
00250 MouseCommand commandWindow3() { return CmdWindow3; }
00251 MouseCommand commandAll1() { return CmdAll1; }
00252 MouseCommand commandAll2() { return CmdAll2; }
00253 MouseCommand commandAll3() { return CmdAll3; }
00254 uint keyCmdAllModKey() { return CmdAllModKey; }
00255
00256
00257 static WindowOperation windowOperation(const QString &name, bool restricted );
00258 static MouseCommand mouseCommand(const QString &name, bool restricted );
00259 static MouseWheelCommand mouseWheelCommand(const QString &name);
00260
00264 bool showGeometryTip();
00265
00266 enum { ElectricDisabled = 0, ElectricMoveOnly = 1, ElectricAlways = 2 };
00272 int electricBorders();
00273
00277 int electricBorderDelay();
00278
00279 bool topMenuEnabled() const { return topmenus; }
00280 bool desktopTopMenu() const { return desktop_topmenu; }
00281
00282
00283 int killPingTimeout;
00284
00285
00286 bool hideUtilityWindowsForInactive;
00287
00288
00289 bool useCompositing;
00290 CompositingType compositingMode;
00291 HiddenPreviews hiddenPreviews;
00292
00293 uint refreshRate;
00294
00295 int smoothScale;
00296
00297
00298
00299 bool xrenderSmoothScale;
00300
00301 enum GLMode { GLTFP, GLSHM, GLFallback };
00302 GLMode glMode;
00303 bool glDirect;
00304 bool glVSync;
00305 bool glStrictBinding;
00306
00307 private:
00308 WindowOperation OpTitlebarDblClick;
00309
00310
00311 MouseCommand CmdActiveTitlebar1;
00312 MouseCommand CmdActiveTitlebar2;
00313 MouseCommand CmdActiveTitlebar3;
00314 MouseCommand CmdInactiveTitlebar1;
00315 MouseCommand CmdInactiveTitlebar2;
00316 MouseCommand CmdInactiveTitlebar3;
00317 MouseWheelCommand CmdTitlebarWheel;
00318 MouseCommand CmdWindow1;
00319 MouseCommand CmdWindow2;
00320 MouseCommand CmdWindow3;
00321 MouseCommand CmdAll1;
00322 MouseCommand CmdAll2;
00323 MouseCommand CmdAll3;
00324 MouseWheelCommand CmdAllWheel;
00325 uint CmdAllModKey;
00326
00327 int electric_borders;
00328 int electric_border_delay;
00329 bool show_geometry_tip;
00330 bool topmenus;
00331 bool desktop_topmenu;
00332
00333 QStringList ignoreFocusStealingClasses;
00334
00335 MouseCommand wheelToMouseCommand( MouseWheelCommand com, int delta );
00336 void reloadCompositingSettings(const CompositingPrefs& prefs);
00337 };
00338
00339 extern Options* options;
00340
00341 }
00342
00343 #endif