#ifndef OPTIONS_H #define OPTIONS_H #include #include // increment this when you add a color type (mosfet) #define KWINCOLORS 8 class Options { public: /*! Different focus policies: */ enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStricklyUnderMouse }; FocusPolicy focusPolicy; enum MoveResizeMode { Transparent, Opaque }; /** * 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, ButtonFg, ButtonBg, ButtonBlend, Frame, Handle}; MoveResizeMode resizeMode; MoveResizeMode moveMode; /** * 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 */ enum PlacementPolicy { Random, Smart, Cascade }; PlacementPolicy placement; bool focusPolicyIsReasonable() { return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse; } /** * Return the color for the given decoration. */ const QColor& color(ColorType type, bool active=true); /** * Return a colorgroup using the given decoration color as the background */ const QColorGroup& colorGroup(ColorType type, bool active=true); /** * Return the active or inactive decoration font. */ const QFont& font(bool active=true); /** * 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; }; // When restarting is implemented this should get called (mosfet). void reload(); Options(); ~Options(); protected: QFont activeFont, inactiveFont; QColor colors[KWINCOLORS*2]; QColorGroup *cg[KWINCOLORS*2]; private: bool animate_shade; int anim_steps; }; extern Options* options; #endif