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 <tqobject.h> 00016 #include <tqfont.h> 00017 #include <tqpalette.h> 00018 #include <tqstringlist.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 // whether to see Xinerama screens separately for focus (in Alt+Tab, when activating next client) 00129 bool separateScreenFocus; 00130 // whether active Xinerama screen is the one with mouse (or with the active window) 00131 bool activeMouseScreen; 00132 00136 bool xineramaEnabled; 00137 bool xineramaPlacementEnabled; 00138 bool xineramaMovementEnabled; 00139 bool xineramaMaximizeEnabled; 00140 bool xineramaFullscreenEnabled; 00141 00142 // number, or -1 = active screen (Workspace::activeScreen()) 00143 int xineramaPlacementScreen; 00144 00148 enum MoveResizeMode { Transparent, Opaque }; 00149 00150 MoveResizeMode resizeMode; 00151 MoveResizeMode moveMode; 00152 00153 static MoveResizeMode stringToMoveResizeMode( const TQString& 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 // 0 - 4 , see Workspace::allowClientActivation() 00202 int focusStealingPreventionLevel; 00203 00207 TQStringList 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 TQString &name, bool restricted ); 00262 static MouseCommand mouseCommand(const TQString &name, bool restricted ); 00263 static MouseWheelCommand mouseWheelCommand(const TQString &name); 00264 00269 bool showGeometryTip(); 00270 00275 TQColor &shadowColour(bool active=true); 00276 00281 bool shadowWindowType(NET::WindowType t); 00282 00286 bool shadowEnabled(bool active=true); 00287 00291 double shadowOpacity(bool active=true); 00292 00296 int shadowThickness(bool active=true); 00297 00302 int shadowXOffset(bool active=true); 00303 00308 int shadowYOffset(bool active=true); 00309 00310 enum { ElectricDisabled = 0, ElectricMoveOnly = 1, ElectricAlways = 2 }; 00316 int electricBorders(); 00317 00321 int electricBorderDelay(); 00322 00323 bool topMenuEnabled() const { return topmenus; } 00324 bool desktopTopMenu() const { return desktop_topmenu; } 00325 00326 // timeout before non-responding application will be killed after attempt to close 00327 int killPingTimeout; 00328 00329 // Whether to hide utility windows for inactive applications. 00330 bool hideUtilityWindowsForInactive; 00331 00332 //translucency settings 00333 bool useTranslucency; 00334 bool translucentActiveWindows; 00335 uint activeWindowOpacity; 00336 bool translucentInactiveWindows; 00337 uint inactiveWindowOpacity; 00338 bool translucentMovingWindows; 00339 uint movingWindowOpacity; 00340 bool removeShadowsOnResize; 00341 bool removeShadowsOnMove; 00342 bool translucentDocks; 00343 uint dockOpacity; 00344 bool keepAboveAsActive; 00345 bool useTitleMenuSlider; 00346 uint activeWindowShadowSize; 00347 uint inactiveWindowShadowSize; 00348 uint dockShadowSize; 00349 uint menuShadowSize; 00350 bool onlyDecoTranslucent; 00351 bool resetKompmgr; 00352 bool tabboxOutline; 00353 00354 private: 00355 WindowOperation OpTitlebarDblClick; 00356 00357 // mouse bindings 00358 MouseCommand CmdActiveTitlebar1; 00359 MouseCommand CmdActiveTitlebar2; 00360 MouseCommand CmdActiveTitlebar3; 00361 MouseCommand CmdInactiveTitlebar1; 00362 MouseCommand CmdInactiveTitlebar2; 00363 MouseCommand CmdInactiveTitlebar3; 00364 MouseWheelCommand CmdTitlebarWheel; 00365 MouseCommand CmdWindow1; 00366 MouseCommand CmdWindow2; 00367 MouseCommand CmdWindow3; 00368 MouseCommand CmdAll1; 00369 MouseCommand CmdAll2; 00370 MouseCommand CmdAll3; 00371 MouseWheelCommand CmdAllWheel; 00372 uint CmdAllModKey; 00373 00374 int electric_borders; 00375 int electric_border_delay; 00376 bool show_geometry_tip; 00377 bool topmenus; 00378 bool desktop_topmenu; 00379 TQColor shadow_colour; 00380 TQColor shadow_inactive_colour; 00381 bool shadow_docks; 00382 bool shadow_menus; 00383 bool shadow_overrides; 00384 bool shadow_topMenus; 00385 bool shadow_inactive_enabled; 00386 bool shadow_enabled; 00387 double shadow_inactive_opacity; 00388 double shadow_opacity; 00389 int shadow_inactive_thickness; 00390 int shadow_thickness; 00391 int shadow_inactive_x_offset; 00392 int shadow_x_offset; 00393 int shadow_inactive_y_offset; 00394 int shadow_y_offset; 00395 // List of window classes for which not to use focus stealing prevention 00396 TQStringList ignoreFocusStealingClasses; 00397 00398 MouseCommand wheelToMouseCommand( MouseWheelCommand com, int delta ); 00399 }; 00400 00401 extern Options* options; 00402 00403 } // namespace 00404 00405 #endif