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         void updateXineramaSettings();
00037 
00069         enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse };
00070         FocusPolicy focusPolicy;
00071 
00072 
00077         bool clickRaise;
00078 
00082         bool autoRaise;
00083 
00087         int autoRaiseInterval;
00088 
00092         bool delayFocus;
00093 
00097         int delayFocusInterval;
00098 
00102         bool shadeHover;
00103 
00107         int shadeHoverInterval;
00108 
00126         enum AltTabStyle { KDE, CDE };
00127         AltTabStyle altTabStyle;
00128         
00129         // whether to see Xinerama screens separately for focus (in Alt+Tab, when activating next client)
00130         bool separateScreenFocus;
00131         // whether active Xinerama screen is the one with mouse (or with the active window)
00132         bool activeMouseScreen;
00133 
00137         bool xineramaEnabled;
00138         bool xineramaPlacementEnabled;
00139         bool xineramaMovementEnabled;
00140         bool xineramaMaximizeEnabled;
00141         bool xineramaFullscreenEnabled;
00142         
00143         // number, or -1 = active screen (Workspace::activeScreen())
00144         int xineramaPlacementScreen;
00145 
00149         enum MoveResizeMode { Transparent, Opaque };
00150 
00151         MoveResizeMode resizeMode;
00152         MoveResizeMode moveMode;
00153         
00154         static MoveResizeMode stringToMoveResizeMode( const QString& s );
00155         static const char* moveResizeModeToString( MoveResizeMode mode );
00156 
00157         Placement::Policy placement;
00158 
00159         bool focusPolicyIsReasonable() 
00160             {
00161             return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse;
00162             }
00163 
00167         bool animateShade;
00168 
00172         int borderSnapZone;
00173 
00177         int windowSnapZone;
00178 
00179 
00183         bool snapOnlyWhenOverlapping;
00184 
00188         bool  animateMinimize;
00189 
00193         int animateMinimizeSpeed;
00194         
00195         bool showDesktopIsMinimizeAll;
00196 
00200         bool rollOverDesktops;
00201 
00202         // 0 - 4 , see Workspace::allowClientActivation()
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 
00270         bool showGeometryTip();
00271 
00272         enum { ElectricDisabled = 0, ElectricMoveOnly = 1, ElectricAlways = 2 };
00278         int electricBorders();
00279 
00283         int electricBorderDelay();
00284         
00285         bool topMenuEnabled() const { return topmenus; }
00286         bool desktopTopMenu() const { return desktop_topmenu; }
00287         
00288         // timeout before non-responding application will be killed after attempt to close
00289         int killPingTimeout;
00290         
00291         // Whether to hide utility windows for inactive applications.
00292         bool hideUtilityWindowsForInactive;
00293 
00294         //translucency settings
00295         bool useTranslucency;
00296         bool translucentActiveWindows;
00297         uint activeWindowOpacity;
00298         bool translucentInactiveWindows;
00299         uint inactiveWindowOpacity;
00300         bool translucentMovingWindows;
00301         uint movingWindowOpacity;
00302         bool removeShadowsOnResize;
00303         bool removeShadowsOnMove;
00304         bool translucentDocks;
00305         uint dockOpacity;
00306         bool keepAboveAsActive;
00307         bool useTitleMenuSlider;
00308         uint activeWindowShadowSize;
00309         uint inactiveWindowShadowSize;
00310         uint dockShadowSize;
00311         bool onlyDecoTranslucent;
00312         bool resetKompmgr;
00313         bool tabboxOutline;
00314 
00315     private:
00316         WindowOperation OpTitlebarDblClick;
00317 
00318     // mouse bindings
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         // List of window classes for which not to use focus stealing prevention
00341         QStringList ignoreFocusStealingClasses;
00342 
00343         MouseCommand wheelToMouseCommand( MouseWheelCommand com, int delta );
00344     };
00345 
00346 extern Options* options;
00347 
00348 } // namespace
00349 
00350 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys