1999-08-19 23:26:42 +00:00
|
|
|
#ifndef OPTIONS_H
|
|
|
|
#define OPTIONS_H
|
|
|
|
|
1999-10-10 03:22:21 +00:00
|
|
|
#include <qfont.h>
|
1999-10-11 02:00:06 +00:00
|
|
|
#include <qpalette.h>
|
|
|
|
|
|
|
|
// increment this when you add a color type (mosfet)
|
|
|
|
#define KWINCOLORS 8
|
1999-08-19 23:26:42 +00:00
|
|
|
|
|
|
|
class Options {
|
|
|
|
public:
|
|
|
|
|
|
|
|
/*!
|
|
|
|
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
|
|
|
|
window activates it.
|
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
|
|
|
|
mouse pointer becomes active.
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
<li>FocusStricklyUnderMouse - Only the window under the mouse
|
|
|
|
pointer is active. If the mouse points nowhere, nothing has the
|
|
|
|
focus. In practice, this is the same as FocusUnderMouse, since
|
|
|
|
kdesktop can take the focus.
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
Note that FocusUnderMouse and FocusStricklyUnderMouse are not
|
|
|
|
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>
|
|
|
|
*/
|
|
|
|
enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStricklyUnderMouse };
|
|
|
|
FocusPolicy focusPolicy;
|
1999-09-27 16:02:44 +00:00
|
|
|
|
1999-11-01 23:41:44 +00:00
|
|
|
enum MoveResizeMode { Transparent, Opaque };
|
1999-10-10 03:22:21 +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.
|
|
|
|
*/
|
1999-10-11 02:00:06 +00:00
|
|
|
// increment KWINCOLORS if you add something (mosfet)
|
1999-10-10 03:22:21 +00:00
|
|
|
enum ColorType{TitleBar=0, TitleBlend, Font, ButtonFg, ButtonBg,
|
|
|
|
ButtonBlend, Frame, Handle};
|
|
|
|
|
1999-09-27 16:02:44 +00:00
|
|
|
MoveResizeMode resizeMode;
|
|
|
|
MoveResizeMode moveMode;
|
1999-08-19 23:26:42 +00:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
const QFont& font(bool active=true);
|
1999-11-20 06:27:07 +00:00
|
|
|
/**
|
|
|
|
* Return whether we animate the shading of windows to titlebar or not
|
|
|
|
*/
|
|
|
|
const bool animateShade() { return animate_shade; };
|
|
|
|
/**
|
|
|
|
* Return the number of animation steps (would this be general?)
|
|
|
|
*/
|
|
|
|
const int animSteps() { return anim_steps; };
|
1999-10-10 03:22:21 +00:00
|
|
|
// When restarting is implemented this should get called (mosfet).
|
|
|
|
void reload();
|
|
|
|
|
1999-09-27 16:02:44 +00:00
|
|
|
Options();
|
1999-10-11 02:00:06 +00:00
|
|
|
~Options();
|
1999-10-10 03:22:21 +00:00
|
|
|
protected:
|
|
|
|
QFont activeFont, inactiveFont;
|
1999-10-11 02:00:06 +00:00
|
|
|
QColor colors[KWINCOLORS*2];
|
|
|
|
QColorGroup *cg[KWINCOLORS*2];
|
1999-11-20 06:27:07 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool animate_shade;
|
|
|
|
int anim_steps;
|
1999-08-19 23:26:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern Options* options;
|
|
|
|
|
|
|
|
#endif
|