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
00187 int centerSnapZone;
00188
00189
00193 bool snapOnlyWhenOverlapping;
00194
00195 bool showDesktopIsMinimizeAll;
00196
00200 bool rollOverDesktops;
00201
00202
00203 int focusStealingPreventionLevel;
00204
00208 QStringList ignorePositionClasses;
00209
00210 bool checkIgnoreFocusStealing( const Client* c );
00211
00212 WindowOperation operationTitlebarDblClick() { return OpTitlebarDblClick; }
00213
00214 enum MouseCommand
00215 {
00216 MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
00217 MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
00218 MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
00219 MouseMove, MouseUnrestrictedMove,
00220 MouseActivateRaiseAndMove, MouseActivateRaiseAndUnrestrictedMove,
00221 MouseResize, MouseUnrestrictedResize,
00222 MouseShade, MouseSetShade, MouseUnsetShade,
00223 MouseMaximize, MouseRestore, MouseMinimize,
00224 MouseNextDesktop, MousePreviousDesktop,
00225 MouseAbove, MouseBelow,
00226 MouseOpacityMore, MouseOpacityLess,
00227 MouseNothing
00228 };
00229
00230 enum MouseWheelCommand
00231 {
00232 MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
00233 MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
00234 MouseWheelChangeOpacity,
00235 MouseWheelNothing
00236 };
00237
00238 MouseCommand operationTitlebarMouseWheel( int delta )
00239 {
00240 return wheelToMouseCommand( CmdTitlebarWheel, delta );
00241 }
00242 MouseCommand operationWindowMouseWheel( int delta )
00243 {
00244 return wheelToMouseCommand( CmdAllWheel, delta );
00245 }
00246
00247 MouseCommand commandActiveTitlebar1() { return CmdActiveTitlebar1; }
00248 MouseCommand commandActiveTitlebar2() { return CmdActiveTitlebar2; }
00249 MouseCommand commandActiveTitlebar3() { return CmdActiveTitlebar3; }
00250 MouseCommand commandInactiveTitlebar1() { return CmdInactiveTitlebar1; }
00251 MouseCommand commandInactiveTitlebar2() { return CmdInactiveTitlebar2; }
00252 MouseCommand commandInactiveTitlebar3() { return CmdInactiveTitlebar3; }
00253 MouseCommand commandWindow1() { return CmdWindow1; }
00254 MouseCommand commandWindow2() { return CmdWindow2; }
00255 MouseCommand commandWindow3() { return CmdWindow3; }
00256 MouseCommand commandAll1() { return CmdAll1; }
00257 MouseCommand commandAll2() { return CmdAll2; }
00258 MouseCommand commandAll3() { return CmdAll3; }
00259 uint keyCmdAllModKey() { return CmdAllModKey; }
00260
00261
00262 static WindowOperation windowOperation(const QString &name, bool restricted );
00263 static MouseCommand mouseCommand(const QString &name, bool restricted );
00264 static MouseWheelCommand mouseWheelCommand(const QString &name);
00265
00269 bool showGeometryTip();
00270
00271 enum { ElectricDisabled = 0, ElectricMoveOnly = 1, ElectricAlways = 2 };
00277 int electricBorders();
00278
00282 int electricBorderDelay();
00283
00284 bool topMenuEnabled() const { return topmenus; }
00285 bool desktopTopMenu() const { return desktop_topmenu; }
00286
00287
00288 int killPingTimeout;
00289
00290
00291 bool hideUtilityWindowsForInactive;
00292
00293
00294 bool useCompositing;
00295 CompositingType compositingMode;
00296 HiddenPreviews hiddenPreviews;
00297 bool unredirectFullscreen;
00298 bool disableCompositingChecks;
00299
00300 uint refreshRate;
00301
00302 int smoothScale;
00303
00304
00305
00306 bool xrenderSmoothScale;
00307
00308 enum GLMode { GLTFP, GLSHM, GLFallback };
00309 GLMode glMode;
00310 bool glDirect;
00311 bool glVSync;
00312 bool glStrictBinding;
00313 double animationTimeFactor() const;
00314
00315 private:
00316 WindowOperation OpTitlebarDblClick;
00317
00318
00319 MouseCommand CmdActiveTitlebar1;
00320 MouseCommand CmdActiveTitlebar2;
00321 MouseCommand CmdActiveTitlebar3;
00322 MouseCommand CmdInactiveTitlebar1;
00323 MouseCommand CmdInactiveTitlebar2;
00324 MouseCommand CmdInactiveTitlebar3;
00325 MouseWheelCommand CmdTitlebarWheel;
00326 MouseCommand CmdWindow1;
00327 MouseCommand CmdWindow2;
00328 MouseCommand CmdWindow3;
00329 MouseCommand CmdAll1;
00330 MouseCommand CmdAll2;
00331 MouseCommand CmdAll3;
00332 MouseWheelCommand CmdAllWheel;
00333 uint CmdAllModKey;
00334
00335 int electric_borders;
00336 int electric_border_delay;
00337 bool show_geometry_tip;
00338 bool topmenus;
00339 bool desktop_topmenu;
00340
00341 QStringList ignoreFocusStealingClasses;
00342 int animationSpeed;
00343
00344 MouseCommand wheelToMouseCommand( MouseWheelCommand com, int delta );
00345 void reloadCompositingSettings(const CompositingPrefs& prefs);
00346 };
00347
00348 extern Options* options;
00349
00350 }
00351
00352 #endif