options.h

00001 /*****************************************************************
00002  KWin - the KDE window manager
00003  This file is part of the KDE project.
00004 
00005 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
00006 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
00007 
00008 You can Freely distribute this program under the GNU General Public
00009 License. See the file "COPYING" for the exact licensing terms.
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 
00131         bool xineramaEnabled;
00132         bool xineramaPlacementEnabled;
00133         bool xineramaMovementEnabled;
00134         bool xineramaMaximizeEnabled;
00135         bool xineramaFullscreenEnabled;
00136 
00140         enum MoveResizeMode { Transparent, Opaque };
00141 
00142         MoveResizeMode resizeMode;
00143         MoveResizeMode moveMode;
00144         
00145         static MoveResizeMode stringToMoveResizeMode( const QString& s );
00146         static const char* moveResizeModeToString( MoveResizeMode mode );
00147 
00148         Placement::Policy placement;
00149 
00150         bool focusPolicyIsReasonable() 
00151             {
00152             return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse;
00153             }
00154 
00158         bool animateShade;
00159 
00163         int borderSnapZone;
00164 
00168         int windowSnapZone;
00169 
00170 
00174         bool snapOnlyWhenOverlapping;
00175 
00179         bool  animateMinimize;
00180 
00184         int animateMinimizeSpeed;
00185         
00186         bool showDesktopIsMinimizeAll;
00187 
00191         bool rollOverDesktops;
00192 
00193         // 0 - 4 , see Workspace::allowClientActivation()
00194         int focusStealingPreventionLevel;
00195 
00199         QStringList ignorePositionClasses;
00200         
00201         bool checkIgnoreFocusStealing( const Client* c );
00202 
00203         WindowOperation operationTitlebarDblClick() { return OpTitlebarDblClick; }
00204 
00205         enum MouseCommand 
00206             {
00207             MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
00208             MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
00209             MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
00210             MouseMove, MouseUnrestrictedMove,
00211             MouseActivateRaiseAndMove, MouseActivateRaiseAndUnrestrictedMove,
00212             MouseResize, MouseUnrestrictedResize,
00213             MouseShade, MouseSetShade, MouseUnsetShade,
00214             MouseMaximize, MouseRestore, MouseMinimize,
00215             MouseNextDesktop, MousePreviousDesktop,
00216             MouseAbove, MouseBelow,
00217             MouseOpacityMore, MouseOpacityLess,
00218             MouseNothing
00219             };
00220             
00221         enum MouseWheelCommand
00222             {
00223             MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
00224             MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
00225             MouseWheelChangeOpacity,
00226             MouseWheelNothing
00227             };
00228 
00229         MouseCommand operationTitlebarMouseWheel( int delta )
00230             {
00231             return wheelToMouseCommand( CmdTitlebarWheel, delta );
00232             }
00233         MouseCommand operationWindowMouseWheel( int delta )
00234             {
00235             return wheelToMouseCommand( CmdAllWheel, delta );
00236             }
00237 
00238         MouseCommand commandActiveTitlebar1() { return CmdActiveTitlebar1; }
00239         MouseCommand commandActiveTitlebar2() { return CmdActiveTitlebar2; }
00240         MouseCommand commandActiveTitlebar3() { return CmdActiveTitlebar3; }
00241         MouseCommand commandInactiveTitlebar1() { return CmdInactiveTitlebar1; }
00242         MouseCommand commandInactiveTitlebar2() { return CmdInactiveTitlebar2; }
00243         MouseCommand commandInactiveTitlebar3() { return CmdInactiveTitlebar3; }
00244         MouseCommand commandWindow1() { return CmdWindow1; }
00245         MouseCommand commandWindow2() { return CmdWindow2; }
00246         MouseCommand commandWindow3() { return CmdWindow3; }
00247         MouseCommand commandAll1() { return CmdAll1; }
00248         MouseCommand commandAll2() { return CmdAll2; }
00249         MouseCommand commandAll3() { return CmdAll3; }
00250         uint keyCmdAllModKey() { return CmdAllModKey; }
00251 
00252 
00253         static WindowOperation windowOperation(const QString &name, bool restricted );
00254         static MouseCommand mouseCommand(const QString &name, bool restricted );
00255         static MouseWheelCommand mouseWheelCommand(const QString &name);
00256 
00261         bool showGeometryTip();
00262 
00263         enum { ElectricDisabled = 0, ElectricMoveOnly = 1, ElectricAlways = 2 };
00269         int electricBorders();
00270 
00274         int electricBorderDelay();
00275         
00276         bool topMenuEnabled() const { return topmenus; }
00277         bool desktopTopMenu() const { return desktop_topmenu; }
00278         
00279         // timeout before non-responding application will be killed after attempt to close
00280         int killPingTimeout;
00281         
00282         // Whether to hide utility windows for inactive applications.
00283         bool hideUtilityWindowsForInactive;
00284 
00285         //translucency settings
00286         bool useTranslucency;
00287         bool translucentActiveWindows;
00288         uint activeWindowOpacity;
00289         bool translucentInactiveWindows;
00290         uint inactiveWindowOpacity;
00291         bool translucentMovingWindows;
00292         uint movingWindowOpacity;
00293         bool removeShadowsOnResize;
00294         bool removeShadowsOnMove;
00295         bool translucentDocks;
00296         uint dockOpacity;
00297         bool keepAboveAsActive;
00298         bool useTitleMenuSlider;
00299         uint activeWindowShadowSize;
00300         uint inactiveWindowShadowSize;
00301         uint dockShadowSize;
00302         bool onlyDecoTranslucent;
00303         bool resetKompmgr;
00304 
00305     private:
00306         WindowOperation OpTitlebarDblClick;
00307 
00308     // mouse bindings
00309         MouseCommand CmdActiveTitlebar1;
00310         MouseCommand CmdActiveTitlebar2;
00311         MouseCommand CmdActiveTitlebar3;
00312         MouseCommand CmdInactiveTitlebar1;
00313         MouseCommand CmdInactiveTitlebar2;
00314         MouseCommand CmdInactiveTitlebar3;
00315         MouseWheelCommand CmdTitlebarWheel;
00316         MouseCommand CmdWindow1;
00317         MouseCommand CmdWindow2;
00318         MouseCommand CmdWindow3;
00319         MouseCommand CmdAll1;
00320         MouseCommand CmdAll2;
00321         MouseCommand CmdAll3;
00322         MouseWheelCommand CmdAllWheel;
00323         uint CmdAllModKey;
00324 
00325         int electric_borders;
00326         int electric_border_delay;
00327         bool show_geometry_tip;
00328         bool topmenus;
00329         bool desktop_topmenu;
00330         // List of window classes for which not to use focus stealing prevention
00331         QStringList ignoreFocusStealingClasses;
00332 
00333         MouseCommand wheelToMouseCommand( MouseWheelCommand com, int delta );
00334     };
00335 
00336 extern Options* options;
00337 
00338 } // namespace
00339 
00340 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys