Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
/*
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2005 Sandro Giessl <sandro@giessl.com>
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KCOMMONDECORATION_H
|
|
|
|
#define KCOMMONDECORATION_H
|
|
|
|
|
2005-07-28 14:59:42 +00:00
|
|
|
#include <Q3Button>
|
2005-03-23 12:42:34 +00:00
|
|
|
#include "kdecoration.h"
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
|
|
|
class KDecorationBridge;
|
|
|
|
class KDecorationFactory;
|
|
|
|
|
|
|
|
enum ButtonType {
|
|
|
|
HelpButton=0,
|
|
|
|
MaxButton,
|
|
|
|
MinButton,
|
|
|
|
CloseButton,
|
|
|
|
MenuButton,
|
|
|
|
OnAllDesktopsButton,
|
|
|
|
AboveButton,
|
|
|
|
BelowButton,
|
|
|
|
ShadeButton,
|
|
|
|
NumButtons
|
|
|
|
};
|
|
|
|
|
|
|
|
class KCommonDecorationButton;
|
|
|
|
|
|
|
|
class KCommonDecorationButtonPrivate;
|
|
|
|
class KCommonDecorationPrivate;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class eases development of decorations by implementing parts of KDecoration
|
|
|
|
* which are error prone and common for most decorations.
|
|
|
|
* It takes care of the window layout, button/action handling, and window mask creation.
|
|
|
|
*/
|
2005-03-13 11:54:17 +00:00
|
|
|
class KWIN_EXPORT KCommonDecoration : public KDecoration
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
KCommonDecoration(KDecorationBridge* bridge, KDecorationFactory* factory);
|
|
|
|
virtual ~KCommonDecoration();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used to calculate the decoration layout. The basic layout looks like this:
|
|
|
|
*
|
|
|
|
* Window:
|
|
|
|
* _______________________________________________________________
|
|
|
|
* | LM_TitleEdgeTop |
|
|
|
|
* |_______________________________________________________________|
|
|
|
|
* | LM_TitleEdgeLeft | [title] | LM_TitleEdgeRight |
|
|
|
|
* |__________________|________________________|___________________|
|
|
|
|
* | LM_TitleEdgeBottom |
|
|
|
|
* |_______________________________________________________________|
|
|
|
|
* | | | |
|
|
|
|
* | | | |
|
|
|
|
* | | | |
|
|
|
|
* |LM_BorderLeft LM_BorderRight|
|
|
|
|
* |_|___________________________________________________________|_|
|
|
|
|
* | LM_BorderBottom |
|
|
|
|
* |_______________________________________________________________|
|
|
|
|
*
|
|
|
|
* Title:
|
|
|
|
* ___________________________________________________________________________________
|
2005-03-26 13:09:52 +00:00
|
|
|
* | LM_ButtonMarginTop | | LM_ButtonMarginTop |
|
|
|
|
* |________________________________| |_________________________________|
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
* | [Buttons] | LM_TitleBorderLeft | LM_TitleHeight | LM_TitleBorderRight | [Buttons] |
|
|
|
|
* |___________|____________________|________________|_____________________|___________|
|
|
|
|
*
|
|
|
|
* Buttons:
|
|
|
|
* _____________________________________________________________________________________________
|
|
|
|
* | button | spacing | button | spacing | explicit spacer | spacing | ... | spacing | button |
|
|
|
|
* |________|_________|________|_________|_________________|_________|________|_________|________|
|
|
|
|
*
|
|
|
|
* @see layoutMetric()
|
|
|
|
*/
|
|
|
|
enum LayoutMetric
|
|
|
|
{
|
|
|
|
LM_BorderLeft,
|
|
|
|
LM_BorderRight,
|
|
|
|
LM_BorderBottom,
|
|
|
|
LM_TitleHeight,
|
|
|
|
LM_TitleBorderLeft,
|
|
|
|
LM_TitleBorderRight,
|
|
|
|
LM_TitleEdgeLeft,
|
|
|
|
LM_TitleEdgeRight,
|
|
|
|
LM_TitleEdgeTop,
|
|
|
|
LM_TitleEdgeBottom,
|
|
|
|
LM_ButtonWidth,
|
|
|
|
LM_ButtonHeight,
|
|
|
|
LM_ButtonSpacing,
|
2005-03-26 13:09:52 +00:00
|
|
|
LM_ExplicitButtonSpacer,
|
|
|
|
LM_ButtonMarginTop
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum DecorationBehaviour
|
|
|
|
{
|
|
|
|
DB_MenuClose, ///< Close window on double clicking the menu
|
2005-03-21 15:47:39 +00:00
|
|
|
DB_WindowMask, ///< Set a mask on the window
|
|
|
|
DB_ButtonHide ///< Hide buttons when there is not enough space in the titlebar
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum WindowCorner
|
|
|
|
{
|
|
|
|
WC_TopLeft,
|
|
|
|
WC_TopRight,
|
|
|
|
WC_BottomLeft,
|
|
|
|
WC_BottomRight
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the decoration used in the decoration preview.
|
|
|
|
*/
|
|
|
|
virtual QString visibleName() const = 0;
|
|
|
|
/**
|
|
|
|
* The default title button order on the left.
|
|
|
|
* @see KDecoration::titleButtonsLeft()
|
|
|
|
* @see KDecoration::titleButtonsRight()
|
|
|
|
*/
|
|
|
|
virtual QString defaultButtonsLeft() const = 0;
|
|
|
|
/**
|
|
|
|
* The default title button order on the left.
|
|
|
|
* @see KDecoration::titleButtonsLeft()
|
|
|
|
* @see KDecoration::titleButtonsRight()
|
|
|
|
*/
|
|
|
|
virtual QString defaultButtonsRight() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This controls whether some specific behaviour should be enabled or not.
|
|
|
|
* @see DecorationBehaviour
|
|
|
|
*/
|
|
|
|
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This controls the layout of the decoration in various ways. It is
|
|
|
|
* possible to have a different layout for different window states.
|
|
|
|
* @param lm The layout element.
|
|
|
|
* @param respectWindowState Whether window states should be taken into account or a "default" state should be assumed.
|
|
|
|
* @param button For LM_ButtonWidth and LM_ButtonHeight, the button.
|
|
|
|
*/
|
2005-03-26 13:09:52 +00:00
|
|
|
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton *button = 0) const;
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new title bar button. KCommonDecoration takes care of memory management.
|
|
|
|
* @return a pointer to the button, or 0 if the button should not be created.
|
|
|
|
*/
|
|
|
|
virtual KCommonDecorationButton *createButton(ButtonType type) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the mask for the specific window corner.
|
|
|
|
*/
|
|
|
|
virtual QRegion cornerShape(WindowCorner corner);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This updates the window mask using the information provided by
|
|
|
|
* cornerShape(). Edges which are aligned to screen corners are not
|
|
|
|
* shaped for better usability (remember to paint these areas in paintEvent(), too).
|
|
|
|
* You normally don't want/need to reimplement updateWindowShape().
|
|
|
|
* @see cornerShape()
|
|
|
|
*/
|
|
|
|
virtual void updateWindowShape();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw the window decoration.
|
|
|
|
*/
|
|
|
|
virtual void paintEvent(QPaintEvent *e) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is used to update the painting of the title bar after the caption has been changed.
|
|
|
|
* Reimplement for a more efficient implementation (default calls update() on the whole decoration).
|
|
|
|
*/
|
|
|
|
virtual void updateCaption();
|
|
|
|
|
|
|
|
int buttonsLeftWidth() const;
|
|
|
|
int buttonsRightWidth() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TODO: remove?
|
|
|
|
*/
|
|
|
|
void updateLayout() const;
|
|
|
|
/**
|
|
|
|
* Makes sure all buttons are repainted.
|
|
|
|
*/
|
|
|
|
void updateButtons() const;
|
2005-03-14 09:33:29 +00:00
|
|
|
/**
|
|
|
|
* Manually call reset() on each button.
|
|
|
|
*/
|
|
|
|
void resetButtons() const;
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience method.
|
|
|
|
* @returns true if the window type is NET::Toolbar, NET::Utility, or NET::Menu
|
|
|
|
*/
|
|
|
|
bool isToolWindow() const;
|
2005-03-21 23:45:54 +00:00
|
|
|
/**
|
|
|
|
* Convenience method.
|
|
|
|
* @returns the title rect.
|
|
|
|
*/
|
2005-03-22 00:15:29 +00:00
|
|
|
QRect titleRect() const;
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Handles widget and layout creation, call the base implementation when subclassing this member.
|
|
|
|
*/
|
|
|
|
virtual void init();
|
|
|
|
/**
|
|
|
|
* Handles SettingButtons, call the base implementation when subclassing this member.
|
|
|
|
*/
|
|
|
|
virtual void reset( unsigned long changed );
|
|
|
|
virtual void borders( int& left, int& right, int& top, int& bottom ) const;
|
|
|
|
virtual void show();
|
2005-06-19 08:19:36 +00:00
|
|
|
virtual void resize(const QSize& s);
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
virtual QSize minimumSize() const;
|
|
|
|
virtual void maximizeChange();
|
|
|
|
virtual void desktopChange();
|
|
|
|
virtual void shadeChange();
|
|
|
|
virtual void iconChange();
|
|
|
|
virtual void activeChange();
|
|
|
|
virtual void captionChange();
|
|
|
|
public slots:
|
|
|
|
void keepAboveChange(bool above);
|
|
|
|
void keepBelowChange(bool below);
|
|
|
|
void slotMaximize();
|
|
|
|
void slotShade();
|
|
|
|
void slotKeepAbove();
|
|
|
|
void slotKeepBelow();
|
|
|
|
void menuButtonPressed();
|
|
|
|
void menuButtonReleased();
|
|
|
|
public:
|
|
|
|
virtual Position mousePosition(const QPoint &point) const;
|
|
|
|
|
|
|
|
virtual bool eventFilter( QObject* o, QEvent* e );
|
|
|
|
virtual void resizeEvent(QResizeEvent *e);
|
|
|
|
virtual void mouseDoubleClickEvent(QMouseEvent *e);
|
2005-05-06 15:20:49 +00:00
|
|
|
virtual void wheelEvent(QWheelEvent *e);
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void resetLayout();
|
|
|
|
|
|
|
|
void moveWidget(int x, int y, QWidget *w) const;
|
|
|
|
void resizeWidget(int w, int h, QWidget *w) const;
|
|
|
|
|
2005-07-28 14:59:42 +00:00
|
|
|
typedef QVector <KCommonDecorationButton*> ButtonContainer; ///< If the entry is 0, it's a spacer.
|
2005-03-21 16:33:59 +00:00
|
|
|
int buttonContainerWidth(const ButtonContainer &btnContainer, bool countHidden = false) const;
|
2005-03-21 15:47:39 +00:00
|
|
|
void addButtons(ButtonContainer &btnContainer, const QString& buttons, bool isLeft);
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
|
|
|
KCommonDecorationButton *m_button[NumButtons];
|
|
|
|
|
|
|
|
ButtonContainer m_buttonsLeft;
|
|
|
|
ButtonContainer m_buttonsRight;
|
|
|
|
|
|
|
|
QWidget *m_previewWidget;
|
|
|
|
|
2005-03-26 16:26:31 +00:00
|
|
|
// button hiding for small windows
|
|
|
|
void calcHiddenButtons();
|
|
|
|
int btnHideMinWidth;
|
|
|
|
int btnHideLastWidth;
|
2005-03-21 16:33:59 +00:00
|
|
|
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
bool closing; // for menu doubleclick closing...
|
|
|
|
|
|
|
|
KCommonDecorationPrivate *d;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Title bar buttons of KCommonDecoration need to inherit this class.
|
|
|
|
*/
|
2005-07-28 14:59:42 +00:00
|
|
|
class KWIN_EXPORT KCommonDecorationButton : public Q3Button
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
{
|
|
|
|
friend class KCommonDecoration;
|
|
|
|
|
|
|
|
public:
|
|
|
|
KCommonDecorationButton(ButtonType type, KCommonDecoration *parent, const char *name);
|
2005-03-14 11:54:49 +00:00
|
|
|
virtual ~KCommonDecorationButton();
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
2005-03-14 09:33:29 +00:00
|
|
|
/**
|
|
|
|
* These flags specify what has changed, e.g. the reason for a reset().
|
|
|
|
*/
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ManualReset = 1 << 0, ///< The button might want to do a full reset for some reason...
|
|
|
|
SizeChange = 1 << 1, ///< The button size changed @see setSize()
|
|
|
|
ToggleChange = 1 << 2, ///< The button toggle state has changed @see setToggleButton()
|
|
|
|
StateChange = 1 << 3, ///< The button has been set pressed or not... @see setOn()
|
2005-03-19 15:44:10 +00:00
|
|
|
IconChange = 1 << 4, ///< The window icon has been changed
|
|
|
|
DecorationReset = 1 << 5 ///< E.g. when decoration colors have changed
|
2005-03-14 09:33:29 +00:00
|
|
|
};
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
/**
|
|
|
|
* Initialize the button after size change etc.
|
|
|
|
*/
|
2005-03-14 11:54:49 +00:00
|
|
|
virtual void reset(unsigned long changed) = 0;
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
/**
|
|
|
|
* @returns the KCommonDecoration the button belongs to.
|
|
|
|
*/
|
2005-03-21 23:45:54 +00:00
|
|
|
KCommonDecoration *decoration() const;
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
/**
|
|
|
|
* @returns the button type.
|
|
|
|
* @see ButtonType
|
|
|
|
*/
|
2005-03-21 23:45:54 +00:00
|
|
|
ButtonType type() const;
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
2005-03-21 15:47:39 +00:00
|
|
|
/**
|
|
|
|
* Whether the button is left of the titlebar or not.
|
|
|
|
*/
|
2005-03-21 23:45:54 +00:00
|
|
|
bool isLeft() const;
|
2005-03-21 15:47:39 +00:00
|
|
|
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
/**
|
|
|
|
* Set which mouse buttons the button should honor. Used e.g. to prevent accidental right mouse clicks.
|
|
|
|
*/
|
|
|
|
void setRealizeButtons(int btns);
|
|
|
|
/**
|
|
|
|
* Set the button size.
|
|
|
|
*/
|
|
|
|
void setSize(const QSize &s);
|
|
|
|
/**
|
|
|
|
* Set/update the button's tool tip
|
|
|
|
*/
|
|
|
|
void setTipText(const QString &tip);
|
|
|
|
/**
|
|
|
|
* The mouse button that has been clicked last time.
|
|
|
|
*/
|
2005-07-28 14:59:42 +00:00
|
|
|
Qt::ButtonState lastMousePress() const { return m_lastMouse; }
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
|
|
|
QSize sizeHint() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void setToggleButton(bool toggle);
|
|
|
|
void setOn(bool on);
|
2005-03-21 15:47:39 +00:00
|
|
|
void setLeft(bool left);
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
void mousePressEvent(QMouseEvent *e);
|
|
|
|
void mouseReleaseEvent(QMouseEvent *e);
|
|
|
|
|
|
|
|
private:
|
|
|
|
KCommonDecoration *m_decoration;
|
|
|
|
ButtonType m_type;
|
|
|
|
int m_realizeButtons;
|
|
|
|
QSize m_size;
|
2005-07-28 14:59:42 +00:00
|
|
|
Qt::ButtonState m_lastMouse;
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
|
2005-03-21 15:47:39 +00:00
|
|
|
bool m_isLeft;
|
|
|
|
|
Import KCommonDecoration/KCommonDecorationButton. They ease development of decorations
by implementing parts of KDecoration which are error prone and common for most decorations.
Plastik will be ported to it. It should be possible to port at least Web, System++, RISC OS,
Quartz, Laptop, KStep, KDE 2, CDE easily - I will have a look at this some time. Perhaps also
Redmond, Modern System, Keramik, IceWM, Glow. I'm sure they will gain maintainability...
I'm open to discussions on the API...
CCMAIL: kwin@kde.org
svn path=/trunk/kdebase/kwin/; revision=396767
2005-03-11 20:10:46 +00:00
|
|
|
KCommonDecorationButtonPrivate *d;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KCOMMONDECORATION_H
|