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 
00189         bool rollOverDesktops;
00190 
00191         // 0 - 4 , see Workspace::allowClientActivation()
00192         int focusStealingPreventionLevel;
00193 
00197         QStringList ignorePositionClasses;
00198         
00199         bool checkIgnoreFocusStealing( const Client* c );
00200 
00201         WindowOperation operationTitlebarDblClick() { return OpTitlebarDblClick; }
00202 
00203         enum MouseCommand 
00204             {
00205             MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
00206             MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
00207             MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
00208             MouseMove, MouseUnrestrictedMove,
00209             MouseActivateRaiseAndMove, MouseActivateRaiseAndUnrestrictedMove,
00210             MouseResize, MouseUnrestrictedResize,
00211             MouseShade, MouseSetShade, MouseUnsetShade,
00212             MouseMaximize, MouseRestore, MouseMinimize,
00213             MouseNextDesktop, MousePreviousDesktop,
00214             MouseAbove, MouseBelow,
00215             MouseOpacityMore, MouseOpacityLess,
00216             MouseNothing
00217             };
00218             
00219         enum MouseWheelCommand
00220             {
00221             MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
00222             MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
00223             MouseWheelChangeOpacity,
00224             MouseWheelNothing
00225             };
00226 
00227         MouseCommand operationTitlebarMouseWheel( int delta )
00228             {
00229             return wheelToMouseCommand( CmdTitlebarWheel, delta );
00230             }
00231         MouseCommand operationWindowMouseWheel( int delta )
00232             {
00233             return wheelToMouseCommand( CmdAllWheel, delta );
00234             }
00235 
00236         MouseCommand commandActiveTitlebar1() { return CmdActiveTitlebar1; }
00237         MouseCommand commandActiveTitlebar2() { return CmdActiveTitlebar2; }
00238         MouseCommand commandActiveTitlebar3() { return CmdActiveTitlebar3; }
00239         MouseCommand commandInactiveTitlebar1() { return CmdInactiveTitlebar1; }
00240         MouseCommand commandInactiveTitlebar2() { return CmdInactiveTitlebar2; }
00241         MouseCommand commandInactiveTitlebar3() { return CmdInactiveTitlebar3; }
00242         MouseCommand commandWindow1() { return CmdWindow1; }
00243         MouseCommand commandWindow2() { return CmdWindow2; }
00244         MouseCommand commandWindow3() { return CmdWindow3; }
00245         MouseCommand commandAll1() { return CmdAll1; }
00246         MouseCommand commandAll2() { return CmdAll2; }
00247         MouseCommand commandAll3() { return CmdAll3; }
00248         uint keyCmdAllModKey() { return CmdAllModKey; }
00249 
00250 
00251         static WindowOperation windowOperation(const QString &name, bool restricted );
00252         static MouseCommand mouseCommand(const QString &name, bool restricted );
00253         static MouseWheelCommand mouseWheelCommand(const QString &name);
00254 
00259         bool showGeometryTip();
00260 
00261         enum { ElectricDisabled = 0, ElectricMoveOnly = 1, ElectricAlways = 2 };
00267         int electricBorders();
00268 
00272         int electricBorderDelay();
00273         
00274         bool topMenuEnabled() const { return topmenus; }
00275         bool desktopTopMenu() const { return desktop_topmenu; }
00276         
00277         // timeout before non-responding application will be killed after attempt to close
00278         int killPingTimeout;
00279         
00280         // Whether to hide utility windows for inactive applications.
00281         bool hideUtilityWindowsForInactive;
00282 
00283         //translucency settings
00284         bool useTranslucency;
00285         bool translucentActiveWindows;
00286         uint activeWindowOpacity;
00287         bool translucentInactiveWindows;
00288         uint inactiveWindowOpacity;
00289         bool translucentMovingWindows;
00290         uint movingWindowOpacity;
00291         bool removeShadowsOnResize;
00292         bool removeShadowsOnMove;
00293         bool translucentDocks;
00294         uint dockOpacity;
00295         bool keepAboveAsActive;
00296         bool useTitleMenuSlider;
00297         uint activeWindowShadowSize;
00298         uint inactiveWindowShadowSize;
00299         uint dockShadowSize;
00300         bool onlyDecoTranslucent;
00301         bool resetKompmgr;
00302 
00303     private:
00304         WindowOperation OpTitlebarDblClick;
00305 
00306     // mouse bindings
00307         MouseCommand CmdActiveTitlebar1;
00308         MouseCommand CmdActiveTitlebar2;
00309         MouseCommand CmdActiveTitlebar3;
00310         MouseCommand CmdInactiveTitlebar1;
00311         MouseCommand CmdInactiveTitlebar2;
00312         MouseCommand CmdInactiveTitlebar3;
00313         MouseWheelCommand CmdTitlebarWheel;
00314         MouseCommand CmdWindow1;
00315         MouseCommand CmdWindow2;
00316         MouseCommand CmdWindow3;
00317         MouseCommand CmdAll1;
00318         MouseCommand CmdAll2;
00319         MouseCommand CmdAll3;
00320         MouseWheelCommand CmdAllWheel;
00321         uint CmdAllModKey;
00322 
00323         int electric_borders;
00324         int electric_border_delay;
00325         bool show_geometry_tip;
00326         bool topmenus;
00327         bool desktop_topmenu;
00328         // List of window classes for which not to use focus stealing prevention
00329         QStringList ignoreFocusStealingClasses;
00330 
00331         MouseCommand wheelToMouseCommand( MouseWheelCommand com, int delta );
00332     };
00333 
00334 extern Options* options;
00335 
00336 } // namespace
00337 
00338 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys