KDecoration Class Reference
This is the base class for a decoration object. More...
#include <kdecoration.h>
Inheritance diagram for KDecoration:

Public Slots | |
void | closeWindow () |
void | maximize (MaximizeMode mode) |
void | minimize () |
void | showContextHelp () |
void | setDesktop (int desktop) |
void | toggleOnAllDesktops () |
void | titlebarDblClickOperation () |
void | setShade (bool set) |
void | setKeepAbove (bool set) |
void | setKeepBelow (bool set) |
Public Member Functions | |
KDecoration (KDecorationBridge *bridge, KDecorationFactory *factory) | |
virtual | ~KDecoration () |
bool | isActive () const |
bool | isCloseable () const |
bool | isMaximizable () const |
MaximizeMode | maximizeMode () const |
bool | isMinimizable () const |
bool | providesContextHelp () const |
int | desktop () const |
bool | isOnAllDesktops () const |
bool | isModal () const |
bool | isShadeable () const |
bool | isShade () const |
bool | isSetShade () const |
bool | keepAbove () const |
bool | keepBelow () const |
bool | isMovable () const |
bool | isResizable () const |
NET::WindowType | windowType (unsigned long supported_types) const |
QIconSet | icon () const |
QString | caption () const |
void | showWindowMenu (QPoint pos) |
void | performWindowOperation (WindowOperation op) |
void | setMask (const QRegion ®, int mode=0) |
void | clearMask () |
bool | isPreview () const |
QRect | geometry () const |
QRect | iconGeometry () const |
QRegion | unobscuredRegion (const QRegion &r) const |
QWidget * | workspaceWidget () const |
int | width () const |
int | height () const |
void | processMousePressEvent (QMouseEvent *e) |
virtual void | init ()=0 |
virtual Position | mousePosition (const QPoint &p) const=0 |
virtual void | borders (int &left, int &right, int &top, int &bottom) const=0 |
virtual void | resize (const QSize &s)=0 |
virtual QSize | minimumSize () const=0 |
virtual void | activeChange ()=0 |
virtual void | captionChange ()=0 |
virtual void | iconChange ()=0 |
virtual void | maximizeChange ()=0 |
virtual void | desktopChange ()=0 |
virtual void | shadeChange ()=0 |
virtual bool | drawbound (const QRect &geom, bool clear) |
virtual bool | animateMinimize (bool minimize) |
virtual bool | windowDocked (Position side) |
virtual void | reset (unsigned long changed) |
void | setMainWidget (QWidget *) |
void | createMainWidget (WFlags flags=0) |
QWidget * | initialParentWidget () const |
WFlags | initialWFlags () const |
void | helperShowHide (bool show) |
QWidget * | widget () |
const QWidget * | widget () const |
KDecorationFactory * | factory () const |
void | grabXServer () |
void | ungrabXServer () |
Static Public Member Functions | |
const KDecorationOptions * | options () |
Detailed Description
This is the base class for a decoration object.It provides functions that give various information about the decorated window, and also provides pure virtual functions for controlling the decoration that every decoration should implement.
Definition at line 272 of file kdecoration.h.
Constructor & Destructor Documentation
|
Constructs a KDecoration object. Both the arguments are passed from KDecorationFactory. Note that the initialization code of the decoration should be done in the init() method. Definition at line 40 of file kdecoration.cpp. |
|
Destroys the KDecoration.
Definition at line 48 of file kdecoration.cpp. References factory(). |
Member Function Documentation
|
Returns the KDecorationOptions object, which is used to access configuration settings for the decoration.
Definition at line 54 of file kdecoration.cpp. |
|
Returns true if the decorated window is currently active.
Definition at line 83 of file kdecoration.cpp. |
|
Returns true if the decoration window can be closed by the user.
Definition at line 88 of file kdecoration.cpp. |
|
Returns true if the decorated window can be maximized.
Definition at line 93 of file kdecoration.cpp. |
|
Returns the current maximization mode of the decorated window. Note that only fully maximized windows should be treated as "maximized" (e.g. if the maximize button has only two states). Definition at line 98 of file kdecoration.cpp. References KDecorationDefines::MaximizeMode. |
|
Returns true if the decorated window can be minimized by the user.
Definition at line 103 of file kdecoration.cpp. |
|
Return true if the decorated window can show context help (i.e. the decoration should provide the context help button). Definition at line 108 of file kdecoration.cpp. |
|
Returns the number of the virtual desktop the decorated window is currently on (including NET::OnAllDesktops for being on all desktops).
Definition at line 113 of file kdecoration.cpp. Referenced by isOnAllDesktops(). |
|
Convenience function that returns true if the window is on all virtual desktops.
Definition at line 741 of file kdecoration.h. References desktop(). Referenced by toggleOnAllDesktops(). |
|
Returns true if the decoration window is modal (usually a modal dialog).
Definition at line 118 of file kdecoration.cpp. |
|
Returns true if the decorated window can be shaded.
Definition at line 123 of file kdecoration.cpp. |
|
Returns true if the decorated window is currently shaded. If the window is e.g. hover unshaded, it's not considered to be shaded.
Definition at line 128 of file kdecoration.cpp. |
|
Returns true if the decorated window was set to be shaded. This function returns also true if the window is e.g. hover unshaded, so it doesn't always correspond to the actual window state.
Definition at line 133 of file kdecoration.cpp. |
|
Returns true if the decorated window should be kept above other windows.
Definition at line 138 of file kdecoration.cpp. |
|
Returns true if the decorated window should be kept below other windows.
Definition at line 143 of file kdecoration.cpp. |
|
Returns true if the decorated window can be moved by the user.
Definition at line 148 of file kdecoration.cpp. |
|
Returns true if the decorated window can be resized by the user.
Definition at line 153 of file kdecoration.cpp. |
|
This function returns the window type of the decorated window. The argument to this function is a mask of all window types the decoration knows about (as the list of valid window types is extended over time, and fallback types are specified in order to support older code). For a description of all window types, see the definition of the NET::WindowType type. Note that some window types never have decorated windows. An example of usage:
Definition at line 158 of file kdecoration.cpp. |
|
Returns an icon set with the decorated window's icon.
Definition at line 163 of file kdecoration.cpp. |
|
Returns the decorated window's caption that should be shown in the titlebar.
Definition at line 168 of file kdecoration.cpp. |
|
This function invokes the window operations menu. IMPORTANT: As a result of this function, the decoration object that called it may be destroyed after the function returns. This means that the decoration object must either return immediately after calling showWindowMenu(), or it must use KDecorationFactory::exists() to check it's still valid. For example, the code handling clicks on the menu button should look similarly like this:
Definition at line 178 of file kdecoration.cpp. |
|
This function performs the given window operation. This function may destroy the current decoration object, just like showWindowMenu(). Definition at line 183 of file kdecoration.cpp. |
|
If the decoration is non-rectangular, this function needs to be called to set the shape of the decoration.
Definition at line 188 of file kdecoration.cpp. |
|
This convenience function resets the shape mask.
Definition at line 193 of file kdecoration.cpp. |
|
If this function returns true, the decorated window is used as a preview e.g. in the configuration module. In such case, the decoration can e.g. show some information in the window area. Definition at line 198 of file kdecoration.cpp. |
|
Returns the geometry of the decoration.
Definition at line 203 of file kdecoration.cpp. Referenced by height(), setMainWidget(), and width(). |
|
Returns the icon geometry for the window, i.e. the geometry of the taskbar entry. This is used mainly for window minimize animations. Note that the geometry may be null. Definition at line 208 of file kdecoration.cpp. |
|
Returns the intersection of the given region with the region left unobscured by the windows stacked above the current one. You can use this function to, for example, try to keep the titlebar visible if there is an hole available. The region returned is in the coordinate space of the decoration.
Definition at line 213 of file kdecoration.cpp. |
|
Returns the main workspace widget. The main purpose of this function is to allow painting the minimize animation or the transparent move bound on it. Definition at line 218 of file kdecoration.cpp. |
|
Convenience function that returns the width of the decoration.
Definition at line 746 of file kdecoration.h. References geometry(). |
|
Convenience function that returns the height of the decoration.
Definition at line 751 of file kdecoration.h. References geometry(). |
|
This function is the default handler for mouse events. All mouse events that are not handled by the decoration itself should be passed to it in order to make work operations like window resizing by dragging borders etc. Definition at line 173 of file kdecoration.cpp. |
|
This function is called immediately after the decoration object is created. Due to some technical reasons, initialization should be done here instead of in the constructor. |
|
This function should return mouse cursor position in the decoration. Positions at the edge will result in window resizing with mouse button pressed, center position will result in moving. Definition at line 310 of file kdecoration.cpp. References KDecorationDefines::Position, and widget(). |
|
This function should return the distance from each window side to the inner window. The sizes may depend on the state of the decorated window, such as whether it's shaded. Decorations often turn off their bottom border when the window is shaded, and turn off their left/right/bottom borders when the window is maximized and moving and resizing of maximized windows is disabled. This function mustn't do any repaints or resizes. Also, if the sizes returned by this function don't match the real values, this may result in drawing errors or other problems.
|
|
This method is called by kwin when the style should resize the decoration window. The usual implementation is to resize the main widget of the decoration to the given size.
|
|
This function should return the minimum required size for the decoration. Note that the returned size shouldn't be too large, because it will be used to keep the decorated window at least as large. |
|
This function is called whenever the window either becomes or stops being active. Use isActive() to find out the current state. Referenced by KWinInternal::Client::setActive(). |
|
This function is called whenever the caption changes. Use caption() to get it. |
|
This function is called whenever the window icon changes. Use icon() to get it. |
|
This function is called whenever the maximalization state of the window changes. Use maximizeMode() to get the current state. |
|
This function is called whenever the desktop for the window changes. Use desktop() or isOnAllDesktops() to find out the current desktop on which the window is. |
|
This function is called whenever the window is shaded or unshaded. Use isShade() to get the current state. |
|
This function may be reimplemented to provide custom bound drawing for transparent moving or resizing of the window. False should be returned if the default implementation should be used.
Definition at line 276 of file kdecoration.cpp. |
|
This function may be reimplemented to provide custom minimize/restore animations The reimplementation is allowed to perform X server grabs if necessary (only using the functions provided by this API, no direct Xlib calls), but no futher event processing is allowed (i.e. no kapp->processEvents()). False should be returned if the default implementation should be used. Note that you should not use this function to force disabling of the animation.
Definition at line 281 of file kdecoration.cpp. |
|
This function is called to reset the decoration on settings changes. It is usually invoked by calling KDecorationFactory::resetDecorations().
Definition at line 296 of file kdecoration.cpp. |
|
This should be the first function called in init() to specify the main widget of the decoration. The widget should be created with parent specified by initialParentWidget() and flags specified by initialWFlags(). Definition at line 65 of file kdecoration.cpp. References geometry(), and widget(). Referenced by createMainWidget(). |
|
Convenience functions that creates and sets a main widget as necessary. In such case, it's usually needed to install an event filter on the main widget to receive important events on it.
Definition at line 59 of file kdecoration.cpp. References initialParentWidget(), initialWFlags(), and setMainWidget(). |
|
The parent widget that should be used for the main widget.
Definition at line 73 of file kdecoration.cpp. Referenced by createMainWidget(). |
|
The flags that should be used when creating the main widget. It is possible to add more flags when creating the main widget, but only flags that affect widget drawing are allowed. Window type flags like WX11BypassWM or WStyle_NoBorder are forbidden. Definition at line 78 of file kdecoration.cpp. Referenced by createMainWidget(). |
|
This function is only allowed to be called once from animateMinimize(). It can be used if the window should be shown or hidden at a specific time during the animation. It is forbidden to use this function for other purposes. Definition at line 291 of file kdecoration.cpp. |
|
Returns the main widget for the decoration.
Definition at line 726 of file kdecoration.h. Referenced by mousePosition(), and setMainWidget(). |
|
Returns the main widget for the decoration.
Definition at line 731 of file kdecoration.h. |
|
Returns the factory that created this decoration.
Definition at line 736 of file kdecoration.h. Referenced by ~KDecoration(). |
|
Performs X server grab. It is safe to call it several times in a row. Definition at line 300 of file kdecoration.cpp. |
|
Ungrabs X server (if the number of ungrab attempts matches the number of grab attempts).
Definition at line 305 of file kdecoration.cpp. |
|
This function can be called by the decoration to request closing of the decorated window. Note that closing the window also involves destroying the decoration. IMPORTANT: This function may destroy the current decoration object, just like showWindowMenu(). Definition at line 223 of file kdecoration.cpp. |
|
Set the maximize mode of the decorated window.
Definition at line 228 of file kdecoration.cpp. |
|
Minimize the decorated window.
Definition at line 233 of file kdecoration.cpp. |
|
Start showing context help in the window (i.e. the mouse will enter the what's this mode). Definition at line 238 of file kdecoration.cpp. |
|
This function toggles the on-all-desktops state of the decorated window.
Definition at line 248 of file kdecoration.cpp. References isOnAllDesktops(). |
|
This function performs the operation configured as titlebar double click operation.
Definition at line 256 of file kdecoration.cpp. |
|
Shades or unshades the decorated window.
Definition at line 261 of file kdecoration.cpp. |
|
Sets or reset keeping this window above others.
Definition at line 266 of file kdecoration.cpp. |
|
Sets or reset keeping this window below others.
Definition at line 271 of file kdecoration.cpp. |
The documentation for this class was generated from the following files: