2000-03-24 22:23:02 +00:00
|
|
|
/*****************************************************************
|
|
|
|
kwin - the KDE window manager
|
2000-06-22 18:08:35 +00:00
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
******************************************************************/
|
1999-08-19 23:26:42 +00:00
|
|
|
#ifndef OPTIONS_H
|
|
|
|
#define OPTIONS_H
|
|
|
|
|
1999-11-25 12:53:17 +00:00
|
|
|
#include <qobject.h>
|
1999-10-10 03:22:21 +00:00
|
|
|
#include <qfont.h>
|
1999-10-11 02:00:06 +00:00
|
|
|
#include <qpalette.h>
|
2000-10-23 18:27:23 +00:00
|
|
|
#include <qstringlist.h>
|
1999-10-11 02:00:06 +00:00
|
|
|
|
|
|
|
// increment this when you add a color type (mosfet)
|
2000-04-28 15:53:00 +00:00
|
|
|
#define KWINCOLORS 6
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2001-04-20 07:19:03 +00:00
|
|
|
namespace KWinInternal {
|
|
|
|
|
|
|
|
class OptionsPrivate;
|
2001-06-13 15:47:54 +00:00
|
|
|
// NOTE: this class has to keep binary compatibility, just like other
|
|
|
|
// KWin classes accessible from the plugins
|
1999-11-25 12:53:17 +00:00
|
|
|
class Options : public QObject {
|
|
|
|
Q_OBJECT
|
1999-08-19 23:26:42 +00:00
|
|
|
public:
|
|
|
|
|
1999-11-25 12:53:17 +00:00
|
|
|
Options();
|
|
|
|
~Options();
|
1999-11-25 16:05:27 +00:00
|
|
|
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
/*!
|
|
|
|
Different focus policies:
|
|
|
|
<ul>
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
<li>ClickToFocus - Clicking into a window activates it. This is
|
|
|
|
also the default.
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
<li>FocusFollowsMouse - Moving the mouse pointer actively onto a
|
2000-06-22 18:08:35 +00:00
|
|
|
normal window activates it. For convenience, the desktop and
|
|
|
|
windows on the dock are excluded. They require clicking.
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
<li>FocusUnderMouse - The window that happens to be under the
|
2000-06-22 18:08:35 +00:00
|
|
|
mouse pointer becomes active. The invariant is: no window can
|
|
|
|
have focus that is not under the mouse. This also means that
|
|
|
|
Alt-Tab won't work properly and popup dialogs are usually
|
|
|
|
unsable with the keyboard. Note that the desktop and windows on
|
|
|
|
the dock are excluded for convenience. They get focus only when
|
|
|
|
clicking on it.
|
|
|
|
|
|
|
|
<li>FocusStrictlyUnderMouse - this is even worse than
|
|
|
|
FocusUnderMouse. Only the window under the mouse pointer is
|
|
|
|
active. If the mouse points nowhere, nothing has the focus. If
|
|
|
|
the mouse points onto the desktop, the desktop has focus. The
|
|
|
|
same holds for windows on the dock.
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-12-22 04:49:43 +00:00
|
|
|
Note that FocusUnderMouse and FocusStrictlyUnderMouse are not
|
1999-08-19 23:26:42 +00:00
|
|
|
particulary useful. They are only provided for old-fashined
|
|
|
|
die-hard UNIX people ;-)
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
</ul>
|
|
|
|
*/
|
1999-12-22 04:49:43 +00:00
|
|
|
enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse };
|
1999-08-19 23:26:42 +00:00
|
|
|
FocusPolicy focusPolicy;
|
1999-11-25 12:53:17 +00:00
|
|
|
|
2000-06-28 13:20:42 +00:00
|
|
|
|
2000-07-09 20:29:53 +00:00
|
|
|
/**
|
|
|
|
Whether clicking on a window raises it in FocusFollowsMouse
|
|
|
|
mode or not.
|
|
|
|
*/
|
|
|
|
bool clickRaise;
|
|
|
|
|
|
|
|
/**
|
|
|
|
whether autoraise is enabled FocusFollowsMouse mode or not.
|
|
|
|
*/
|
|
|
|
bool autoRaise;
|
2000-07-12 12:46:58 +00:00
|
|
|
|
2000-07-09 20:29:53 +00:00
|
|
|
/**
|
|
|
|
autoraise interval
|
|
|
|
*/
|
|
|
|
int autoRaiseInterval;
|
|
|
|
|
2001-01-14 20:16:04 +00:00
|
|
|
/**
|
|
|
|
Whether shade hover is enabled or not
|
|
|
|
*/
|
|
|
|
bool shadeHover;
|
|
|
|
|
|
|
|
/**
|
|
|
|
shade hover interval
|
|
|
|
*/
|
|
|
|
int shadeHoverInterval;
|
|
|
|
|
1999-10-10 03:22:21 +00:00
|
|
|
/**
|
2000-06-22 18:08:35 +00:00
|
|
|
Different Alt-Tab-Styles:
|
|
|
|
<ul>
|
2000-06-28 13:20:42 +00:00
|
|
|
|
2000-06-22 18:08:35 +00:00
|
|
|
<li> KDE - the recommended KDE style. Alt-Tab opens a nice icon
|
|
|
|
box that makes it easy to select the window you want to tab
|
|
|
|
to. The order automatically adjusts to the most recently used
|
|
|
|
windows. Note that KDE style does not work with the
|
|
|
|
FocusUnderMouse and FocusStrictlyUnderMouse focus
|
|
|
|
policies. Choose ClickToFocus or FocusFollowsMouse instead.
|
2000-06-28 13:20:42 +00:00
|
|
|
|
2000-06-22 18:08:35 +00:00
|
|
|
<li> CDE - the old-fashion CDE style. Alt-Tab cycles between
|
|
|
|
the windows in static order. The current window gets raised,
|
|
|
|
the previous window gets lowered.
|
2000-06-28 13:20:42 +00:00
|
|
|
|
2000-06-22 18:08:35 +00:00
|
|
|
</ul>
|
1999-10-10 03:22:21 +00:00
|
|
|
*/
|
2000-06-22 18:08:35 +00:00
|
|
|
enum AltTabStyle { KDE, CDE };
|
|
|
|
AltTabStyle altTabStyle;
|
2000-06-28 13:20:42 +00:00
|
|
|
|
2001-06-03 09:04:03 +00:00
|
|
|
/**
|
|
|
|
* Xinerama options
|
|
|
|
*/
|
|
|
|
bool xineramaEnabled;
|
|
|
|
bool xineramaPlacementEnabled;
|
|
|
|
bool xineramaMovementEnabled;
|
|
|
|
bool xineramaMaximizeEnabled;
|
2000-06-28 13:20:42 +00:00
|
|
|
|
2001-01-11 23:41:07 +00:00
|
|
|
/**
|
|
|
|
Number of desktop rowsd
|
2001-01-14 20:16:04 +00:00
|
|
|
*/
|
2001-01-11 23:41:07 +00:00
|
|
|
int desktopRows;
|
2000-10-26 09:38:09 +00:00
|
|
|
|
|
|
|
|
2000-06-22 18:08:35 +00:00
|
|
|
/**
|
|
|
|
MoveResizeMode, either Tranparent or Opaque.
|
|
|
|
*/
|
|
|
|
enum MoveResizeMode { Transparent, Opaque };
|
1999-10-10 03:22:21 +00:00
|
|
|
|
1999-09-27 16:02:44 +00:00
|
|
|
MoveResizeMode resizeMode;
|
|
|
|
MoveResizeMode moveMode;
|
1999-08-19 23:26:42 +00:00
|
|
|
|
2000-08-22 10:35:22 +00:00
|
|
|
/**
|
|
|
|
* Can maximized windows be moved or resized
|
|
|
|
*/
|
|
|
|
bool moveResizeMaximizedWindows;
|
|
|
|
|
1999-11-16 08:53:02 +00:00
|
|
|
/**
|
|
|
|
* Placement policies. How workspace decides the way windows get positioned
|
|
|
|
* on the screen. The better the policy, the heavier the resource use.
|
|
|
|
* Normally you don't have to worry. What the WM adds to the startup time
|
|
|
|
* is nil compared to the creation of the window itself in the memory
|
|
|
|
*/
|
1999-11-20 06:27:07 +00:00
|
|
|
enum PlacementPolicy { Random, Smart, Cascade };
|
1999-11-16 08:53:02 +00:00
|
|
|
PlacementPolicy placement;
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
bool focusPolicyIsReasonable() {
|
1999-10-10 03:22:21 +00:00
|
|
|
return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse;
|
1999-08-19 23:26:42 +00:00
|
|
|
}
|
|
|
|
|
2000-06-22 18:08:35 +00:00
|
|
|
/**
|
|
|
|
* Basic color types that should be recognized by all decoration styles.
|
|
|
|
* Not all styles have to implement all the colors, but for the ones that
|
|
|
|
* are implemented you should retrieve them here.
|
|
|
|
*/
|
|
|
|
// increment KWINCOLORS if you add something (mosfet)
|
|
|
|
enum ColorType{TitleBar=0, TitleBlend, Font, ButtonBg, Frame, Handle};
|
|
|
|
|
1999-10-10 03:22:21 +00:00
|
|
|
/**
|
|
|
|
* Return the color for the given decoration.
|
|
|
|
*/
|
|
|
|
const QColor& color(ColorType type, bool active=true);
|
1999-10-11 02:00:06 +00:00
|
|
|
/**
|
|
|
|
* Return a colorgroup using the given decoration color as the background
|
|
|
|
*/
|
|
|
|
const QColorGroup& colorGroup(ColorType type, bool active=true);
|
1999-10-10 03:22:21 +00:00
|
|
|
/**
|
|
|
|
* Return the active or inactive decoration font.
|
|
|
|
*/
|
2000-07-12 12:46:58 +00:00
|
|
|
const QFont& font(bool active=true, bool small = false);
|
2000-07-09 20:29:53 +00:00
|
|
|
|
1999-11-20 06:27:07 +00:00
|
|
|
/**
|
2000-07-09 20:29:53 +00:00
|
|
|
* whether we animate the shading of windows to titlebar or not
|
1999-11-20 06:27:07 +00:00
|
|
|
*/
|
2000-07-09 20:29:53 +00:00
|
|
|
bool animateShade;
|
|
|
|
|
1999-11-25 23:12:32 +00:00
|
|
|
/**
|
2000-07-09 20:29:53 +00:00
|
|
|
* the size of the zone that triggers snapping on desktop borders
|
1999-11-25 23:12:32 +00:00
|
|
|
*/
|
2000-07-09 20:29:53 +00:00
|
|
|
int borderSnapZone;
|
|
|
|
|
1999-11-25 23:12:32 +00:00
|
|
|
/**
|
2000-07-09 20:29:53 +00:00
|
|
|
* the number of animation steps (would this be general?)
|
1999-11-25 23:12:32 +00:00
|
|
|
*/
|
2000-07-09 20:29:53 +00:00
|
|
|
int windowSnapZone;
|
2000-10-26 09:38:09 +00:00
|
|
|
|
|
|
|
|
2000-11-02 08:33:00 +00:00
|
|
|
/**
|
2000-11-02 18:15:39 +00:00
|
|
|
* snap only when windows will overlap
|
2000-11-02 08:33:00 +00:00
|
|
|
*/
|
2000-11-02 18:15:39 +00:00
|
|
|
bool snapOnlyWhenOverlapping;
|
2000-11-02 08:33:00 +00:00
|
|
|
|
2000-09-25 15:30:51 +00:00
|
|
|
/**
|
|
|
|
* whether we animate the minimization of windows or not
|
|
|
|
*/
|
|
|
|
bool animateMinimize;
|
2000-10-26 09:38:09 +00:00
|
|
|
|
2000-09-25 15:30:51 +00:00
|
|
|
/**
|
|
|
|
* Animation speed (0 .. 10 )
|
|
|
|
*/
|
|
|
|
int animateMinimizeSpeed;
|
2000-03-24 22:23:02 +00:00
|
|
|
|
|
|
|
|
2000-10-23 18:27:23 +00:00
|
|
|
/**
|
|
|
|
* List of window classes to ignore PPosition size hint
|
|
|
|
*/
|
|
|
|
QStringList ignorePositionClasses;
|
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
// mouse bindings
|
2000-03-24 22:23:02 +00:00
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
enum WindowOperation{
|
|
|
|
MaximizeOp = 5000,
|
|
|
|
RestoreOp,
|
|
|
|
IconifyOp,
|
|
|
|
MoveOp,
|
|
|
|
ResizeOp,
|
|
|
|
CloseOp,
|
|
|
|
StickyOp,
|
|
|
|
ShadeOp,
|
2000-06-28 13:20:42 +00:00
|
|
|
StaysOnTopOp,
|
1999-11-29 02:06:41 +00:00
|
|
|
OperationsOp,
|
2001-01-14 20:16:04 +00:00
|
|
|
ToggleStoreSettingsOp,
|
2001-02-27 07:19:52 +00:00
|
|
|
HMaximizeOp,
|
|
|
|
VMaximizeOp,
|
|
|
|
LowerOp,
|
1999-11-29 02:06:41 +00:00
|
|
|
NoOp
|
|
|
|
};
|
|
|
|
|
|
|
|
WindowOperation operationTitlebarDblClick() { return OpTitlebarDblClick; }
|
2000-03-24 22:23:02 +00:00
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
enum MouseCommand {
|
|
|
|
MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
|
|
|
|
MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
|
|
|
|
MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
|
2001-06-07 18:17:24 +00:00
|
|
|
MouseMove, MouseResize,
|
2001-04-02 08:31:58 +00:00
|
|
|
MouseShade,
|
|
|
|
MouseNothing
|
1999-11-29 02:06:41 +00:00
|
|
|
};
|
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
MouseCommand commandActiveTitlebar1() { return CmdActiveTitlebar1; }
|
1999-11-29 02:06:41 +00:00
|
|
|
MouseCommand commandActiveTitlebar2() { return CmdActiveTitlebar2; }
|
|
|
|
MouseCommand commandActiveTitlebar3() { return CmdActiveTitlebar3; }
|
|
|
|
MouseCommand commandInactiveTitlebar1() { return CmdInactiveTitlebar1; }
|
|
|
|
MouseCommand commandInactiveTitlebar2() { return CmdInactiveTitlebar2; }
|
|
|
|
MouseCommand commandInactiveTitlebar3() { return CmdInactiveTitlebar3; }
|
|
|
|
MouseCommand commandWindow1() { return CmdWindow1; }
|
|
|
|
MouseCommand commandWindow2() { return CmdWindow2; }
|
|
|
|
MouseCommand commandWindow3() { return CmdWindow3; }
|
|
|
|
MouseCommand commandAll1() { return CmdAll1; }
|
|
|
|
MouseCommand commandAll2() { return CmdAll2; }
|
|
|
|
MouseCommand commandAll3() { return CmdAll3; }
|
2001-06-07 18:17:24 +00:00
|
|
|
uint keyCmdAllModKey() { return CmdAllModKey; }
|
1999-11-29 02:06:41 +00:00
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
static WindowOperation windowOperation(const QString &name );
|
|
|
|
static MouseCommand mouseCommand(const QString &name);
|
2001-05-03 08:06:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns true if the style should use custom button positions
|
|
|
|
* @see #titleButtonsLeft
|
|
|
|
* @see #titleButtonsRight
|
|
|
|
*/
|
|
|
|
bool customButtonPositions();
|
|
|
|
/**
|
|
|
|
* If @ref customButtonPositions returns true, titleButtonsLeft
|
|
|
|
* returns which buttons should be on the left side of the titlebar from left
|
|
|
|
* to right. Characters in the returned string have this meaning :
|
|
|
|
* @li 'M' menu button
|
|
|
|
* @li 'S' sticky button
|
|
|
|
* @li 'H' quickhelp button
|
|
|
|
* @li 'I' iconify ( minimize ) button
|
|
|
|
* @li 'A' maximize button
|
|
|
|
* @li 'X' close button
|
|
|
|
* @li '_' spacer
|
|
|
|
*
|
|
|
|
* The default ( which is also returned if customButtonPositions returns false )
|
|
|
|
* is "MS".
|
|
|
|
*/
|
|
|
|
QString titleButtonsLeft();
|
|
|
|
/**
|
|
|
|
* If @ref customButtonPositions returns true, titleButtonsRight
|
|
|
|
* returns which buttons should be on the right side of the titlebar from left
|
|
|
|
* to right. Characters in the return string have the same meaning like
|
|
|
|
* in @ref titleButtonsLeft .
|
|
|
|
*
|
|
|
|
* The default ( which is also returned if customButtonPositions returns false )
|
|
|
|
* is "HIAX".
|
|
|
|
*/
|
|
|
|
QString titleButtonsRight();
|
1999-11-29 02:06:41 +00:00
|
|
|
|
2001-07-01 10:10:17 +00:00
|
|
|
/**
|
|
|
|
* @returns true if the style should use tooltips for window buttons
|
|
|
|
*/
|
2001-07-02 12:40:14 +00:00
|
|
|
bool showTooltips();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns true if window button tooltips should use a fade-in effect
|
|
|
|
* @see #animateTooltips
|
|
|
|
* @see #showTooltips
|
|
|
|
*/
|
|
|
|
bool fadeTooltips();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns true if window button tooltips should use an animated effect.
|
|
|
|
* When this is true, tooltips should use a animated scroll effect. If
|
|
|
|
* fadeToolTips is also true, tooltips should be faded-in instead.
|
|
|
|
* @see #fadeTooltips
|
|
|
|
* @see #showTooltips
|
|
|
|
*/
|
|
|
|
bool animateTooltips();
|
|
|
|
|
2001-08-27 05:42:32 +00:00
|
|
|
/**
|
|
|
|
* @returns true if electric borders are enabled. With electric borders
|
|
|
|
* you can change desktop by moving the mouse pointer towards the edge
|
|
|
|
* of the screen
|
|
|
|
*/
|
|
|
|
bool electricBorders();
|
1999-11-25 12:53:17 +00:00
|
|
|
|
2001-09-06 19:44:06 +00:00
|
|
|
/**
|
|
|
|
* @returns the activation delay for electric borders in milliseconds.
|
|
|
|
*/
|
|
|
|
int electricBorderDelay();
|
|
|
|
|
1999-11-25 12:53:17 +00:00
|
|
|
public slots:
|
1999-10-10 03:22:21 +00:00
|
|
|
void reload();
|
1999-11-25 16:05:27 +00:00
|
|
|
|
2000-01-23 23:33:29 +00:00
|
|
|
signals:
|
2001-04-22 05:39:17 +00:00
|
|
|
void resetPlugin();
|
2000-01-23 23:33:29 +00:00
|
|
|
void resetClients();
|
2000-03-24 22:23:02 +00:00
|
|
|
|
1999-10-10 03:22:21 +00:00
|
|
|
protected:
|
2000-07-12 12:46:58 +00:00
|
|
|
QFont activeFont, inactiveFont, activeFontSmall, inactiveFontSmall;
|
1999-11-20 06:27:07 +00:00
|
|
|
|
|
|
|
private:
|
2000-07-09 20:29:53 +00:00
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
WindowOperation OpTitlebarDblClick;
|
|
|
|
|
|
|
|
// mouse bindings
|
|
|
|
MouseCommand CmdActiveTitlebar1;
|
|
|
|
MouseCommand CmdActiveTitlebar2;
|
|
|
|
MouseCommand CmdActiveTitlebar3;
|
|
|
|
MouseCommand CmdInactiveTitlebar1;
|
|
|
|
MouseCommand CmdInactiveTitlebar2;
|
|
|
|
MouseCommand CmdInactiveTitlebar3;
|
|
|
|
MouseCommand CmdWindow1;
|
|
|
|
MouseCommand CmdWindow2;
|
|
|
|
MouseCommand CmdWindow3;
|
|
|
|
MouseCommand CmdAll1;
|
|
|
|
MouseCommand CmdAll2;
|
|
|
|
MouseCommand CmdAll3;
|
2001-06-07 18:17:24 +00:00
|
|
|
uint CmdAllModKey;
|
|
|
|
|
2001-04-20 07:19:03 +00:00
|
|
|
OptionsPrivate* d;
|
1999-08-19 23:26:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern Options* options;
|
|
|
|
|
2001-04-20 07:19:03 +00:00
|
|
|
}; // namespace
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
#endif
|