00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef KWIN_OPTIONS_H
00013 #define KWIN_OPTIONS_H
00014
00015 #include <qobject.h>
00016 #include <qfont.h>
00017 #include <qpalette.h>
00018 #include <qstringlist.h>
00019 #include <kdecoration_p.h>
00020
00021 #include "placement.h"
00022
00023 namespace KWinInternal
00024 {
00025
00026 class Client;
00027
00028 class Options : public KDecorationOptions
00029 {
00030 public:
00031
00032 Options();
00033 ~Options();
00034
00035 virtual unsigned long updateSettings();
00036
00068 enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse };
00069 FocusPolicy focusPolicy;
00070
00071
00076 bool clickRaise;
00077
00081 bool autoRaise;
00082
00086 int autoRaiseInterval;
00087
00091 bool delayFocus;
00092
00096 int delayFocusInterval;
00097
00101 bool shadeHover;
00102
00106 int shadeHoverInterval;
00107
00125 enum AltTabStyle { KDE, CDE };
00126 AltTabStyle altTabStyle;
00127
00128
00129 bool separateScreenFocus;
00130
00131 bool activeMouseScreen;
00132
00136 bool xineramaEnabled;
00137 bool xineramaPlacementEnabled;
00138 bool xineramaMovementEnabled;
00139 bool xineramaMaximizeEnabled;
00140 bool xineramaFullscreenEnabled;
00141
00142
00143 int xineramaPlacementScreen;
00144
00148 enum MoveResizeMode { Transparent, Opaque };
00149
00150 MoveResizeMode resizeMode;
00151 MoveResizeMode moveMode;
00152
00153 static MoveResizeMode stringToMoveResizeMode( const QString& s );
00154 static const char* moveResizeModeToString( MoveResizeMode mode );
00155
00156 Placement::Policy placement;
00157
00158 bool focusPolicyIsReasonable()
00159 {
00160 return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse;
00161 }
00162
00166 bool animateShade;
00167
00171 int borderSnapZone;
00172
00176 int windowSnapZone;
00177
00178
00182 bool snapOnlyWhenOverlapping;
00183
00187 bool animateMinimize;
00188
00192 int animateMinimizeSpeed;
00193
00194 bool showDesktopIsMinimizeAll;
00195
00199 bool rollOverDesktops;
00200
00201
00202 int focusStealingPreventionLevel;
00203
00207 QStringList ignorePositionClasses;
00208
00209 bool checkIgnoreFocusStealing( const Client* c );
00210
00211 WindowOperation operationTitlebarDblClick() { return OpTitlebarDblClick; }
00212
00213 enum MouseCommand
00214 {
00215 MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
00216 MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
00217 MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
00218 MouseMove, MouseUnrestrictedMove,
00219 MouseActivateRaiseAndMove, MouseActivateRaiseAndUnrestrictedMove,
00220 MouseResize, MouseUnrestrictedResize,
00221 MouseShade, MouseSetShade, MouseUnsetShade,
00222 MouseMaximize, MouseRestore, MouseMinimize,
00223 MouseNextDesktop, MousePreviousDesktop,
00224 MouseAbove, MouseBelow,
00225 MouseOpacityMore, MouseOpacityLess,
00226 MouseNothing
00227 };
00228
00229 enum MouseWheelCommand
00230 {
00231 MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
00232 MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
00233 MouseWheelChangeOpacity,
00234 MouseWheelNothing
00235 };
00236
00237 MouseCommand operationTitlebarMouseWheel( int delta )
00238 {
00239 return wheelToMouseCommand( CmdTitlebarWheel, delta );
00240 }
00241 MouseCommand operationWindowMouseWheel( int delta )
00242 {
00243 return wheelToMouseCommand( CmdAllWheel, delta );
00244 }
00245
00246 MouseCommand commandActiveTitlebar1() { return CmdActiveTitlebar1; }
00247 MouseCommand commandActiveTitlebar2() { return CmdActiveTitlebar2; }
00248 MouseCommand commandActiveTitlebar3() { return CmdActiveTitlebar3; }
00249 MouseCommand commandInactiveTitlebar1() { return CmdInactiveTitlebar1; }
00250 MouseCommand commandInactiveTitlebar2() { return CmdInactiveTitlebar2; }
00251 MouseCommand commandInactiveTitlebar3() { return CmdInactiveTitlebar3; }
00252 MouseCommand commandWindow1() { return CmdWindow1; }
00253 MouseCommand commandWindow2() { return CmdWindow2; }
00254 MouseCommand commandWindow3() { return CmdWindow3; }
00255 MouseCommand commandAll1() { return CmdAll1; }
00256 MouseCommand commandAll2() { return CmdAll2; }
00257 MouseCommand commandAll3() { return CmdAll3; }
00258 uint keyCmdAllModKey() { return CmdAllModKey; }
00259
00260
00261 static WindowOperation windowOperation(const QString &name, bool restricted );
00262 static MouseCommand mouseCommand(const QString &name, bool restricted );
00263 static MouseWheelCommand mouseWheelCommand(const QString &name);
00264
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 useTranslucency;
00295 bool translucentActiveWindows;
00296 uint activeWindowOpacity;
00297 bool translucentInactiveWindows;
00298 uint inactiveWindowOpacity;
00299 bool translucentMovingWindows;
00300 uint movingWindowOpacity;
00301 bool removeShadowsOnResize;
00302 bool removeShadowsOnMove;
00303 bool translucentDocks;
00304 uint dockOpacity;
00305 bool keepAboveAsActive;
00306 bool useTitleMenuSlider;
00307 uint activeWindowShadowSize;
00308 uint inactiveWindowShadowSize;
00309 uint dockShadowSize;
00310 bool onlyDecoTranslucent;
00311 bool resetKompmgr;
00312
00313 private:
00314 WindowOperation OpTitlebarDblClick;
00315
00316
00317 MouseCommand CmdActiveTitlebar1;
00318 MouseCommand CmdActiveTitlebar2;
00319 MouseCommand CmdActiveTitlebar3;
00320 MouseCommand CmdInactiveTitlebar1;
00321 MouseCommand CmdInactiveTitlebar2;
00322 MouseCommand CmdInactiveTitlebar3;
00323 MouseWheelCommand CmdTitlebarWheel;
00324 MouseCommand CmdWindow1;
00325 MouseCommand CmdWindow2;
00326 MouseCommand CmdWindow3;
00327 MouseCommand CmdAll1;
00328 MouseCommand CmdAll2;
00329 MouseCommand CmdAll3;
00330 MouseWheelCommand CmdAllWheel;
00331 uint CmdAllModKey;
00332
00333 int electric_borders;
00334 int electric_border_delay;
00335 bool show_geometry_tip;
00336 bool topmenus;
00337 bool desktop_topmenu;
00338
00339 QStringList ignoreFocusStealingClasses;
00340
00341 MouseCommand wheelToMouseCommand( MouseWheelCommand com, int delta );
00342 };
00343
00344 extern Options* options;
00345
00346 }
00347
00348 #endif