kcommondecoration.cpp
79 int KCommonDecoration::layoutMetric(LayoutMetric lm, bool, const KCommonDecorationButton *) const
201 for (ButtonContainer::const_iterator it = m_buttonsLeft.begin(); it != m_buttonsLeft.end(); ++it) {
219 int y = r_y + layoutMetric(LM_TitleEdgeTop) + layoutMetric(LM_ButtonMarginTop) + layoutMetric(LM_RightButtonsMarginTop);
224 for (ButtonContainer::const_iterator it = m_buttonsRight.begin(); it != m_buttonsRight.end(); ++it) {
270 m_previewWidget = new TQLabel(i18n("%1 is the name of window decoration style", "<center><b>%1 preview</b></center>").arg(visibleName() ), widget());
284 btnHideMinWidth = buttonContainerWidth(m_buttonsLeft,true) + buttonContainerWidth(m_buttonsRight,true) +
301 int KCommonDecoration::buttonContainerWidth(const ButtonContainer &btnContainer, bool countHidden) const
308 for (ButtonContainer::const_iterator it = btnContainer.begin(); it != btnContainer.end(); ++it) {
331 kde_wm_system_modal_notification = XInternAtom(tqt_xdisplay(), "_TDE_WM_MODAL_SYS_NOTIFICATION", False);
332 result = XGetWindowProperty(tqt_xdisplay(), windowId(), kde_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data);
340 void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString& s, bool isLeft)
465 btn->setSize(TQSize(layoutMetric(LM_ButtonWidth, true, btn),layoutMetric(LM_ButtonHeight, true, btn)) );
482 KCommonDecorationButton* btnArray[] = { m_button[HelpButton], m_button[ShadeButton], m_button[BelowButton],
597 m_button[AboveButton]->setTipText( above?i18n("Do not keep above others"):i18n("Keep above others") );
614 m_button[BelowButton]->setTipText( below?i18n("Do not keep below others"):i18n("Keep below others") );
716 int tb = layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight)+layoutMetric(LM_TitleEdgeBottom);
725 int tb = layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight)+layoutMetric(LM_TitleEdgeBottom);
894 r_x2-titleEdgeRight-buttonsRightWidth()-titleBorderRight-(r_x+titleEdgeLeft+buttonsLeftWidth()+titleBorderLeft),
899 KCommonDecorationButton::KCommonDecorationButton(ButtonType type, KCommonDecoration *parent, const char *name)
Title bar buttons of KCommonDecoration need to inherit this class.
Definition: kcommondecoration.h:293
virtual void reset(unsigned long changed)=0
Initialize the button after size change etc.
@ ManualReset
The button might want to do a full reset for some reason...
Definition: kcommondecoration.h:308
void setTipText(const TQString &tip)
Set/update the button's tool tip.
Definition: kcommondecoration.cpp:954
KCommonDecoration * decoration() const
Definition: kcommondecoration.cpp:914
void setRealizeButtons(int btns)
Set which mouse buttons the button should honor.
Definition: kcommondecoration.cpp:934
bool isLeft() const
Whether the button is left of the titlebar or not.
Definition: kcommondecoration.cpp:924
This class eases development of decorations by implementing parts of KDecoration which are error pron...
Definition: kcommondecoration.h:60
virtual void borders(int &left, int &right, int &top, int &bottom) const
This function should return the distance from each window side to the inner window.
Definition: kcommondecoration.cpp:150
virtual TQRegion cornerShape(WindowCorner corner)
Definition: kcommondecoration.cpp:139
virtual void maximizeChange()
This function is called whenever the maximalization state of the window changes.
Definition: kcommondecoration.cpp:536
virtual TQString defaultButtonsRight() const =0
The default title button order on the left.
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const
This controls whether some specific behaviour should be enabled or not.
Definition: kcommondecoration.cpp:63
virtual TQString visibleName() const =0
The name of the decoration used in the decoration preview.
void updateButtons() const
Makes sure all buttons are repainted.
Definition: kcommondecoration.cpp:242
virtual TQSize minimumSize() const
This function should return the minimum required size for the decoration.
Definition: kcommondecoration.cpp:525
virtual void activeChange()
This function is called whenever the window either becomes or stops being active.
Definition: kcommondecoration.cpp:581
virtual KCommonDecorationButton * createButton(ButtonType type)=0
Create a new title bar button.
@ DB_ButtonHide
Hide buttons when there is not enough space in the titlebar.
Definition: kcommondecoration.h:124
virtual void init()
Handles widget and layout creation, call the base implementation when subclassing this member.
Definition: kcommondecoration.cpp:114
virtual TQString defaultButtonsLeft() const =0
The default title button order on the left.
virtual void shadeChange()
This function is called whenever the window is shaded or unshaded.
Definition: kcommondecoration.cpp:560
virtual void iconChange()
This function is called whenever the window icon changes.
Definition: kcommondecoration.cpp:572
virtual void updateCaption()
This is used to update the painting of the title bar after the caption has been changed.
Definition: kcommondecoration.cpp:144
virtual void updateWindowShape()
This updates the window mask using the information provided by cornerShape().
Definition: kcommondecoration.cpp:795
virtual void captionChange()
This function is called whenever the caption changes.
Definition: kcommondecoration.cpp:587
virtual void reset(unsigned long changed)
Handles SettingButtons, call the base implementation when subclassing this member.
Definition: kcommondecoration.cpp:131
virtual void resize(const TQSize &s)
This method is called by twin when the style should resize the decoration window.
Definition: kcommondecoration.cpp:520
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState=true, const KCommonDecorationButton *button=0) const
This controls the layout of the decoration in various ways.
Definition: kcommondecoration.cpp:79
virtual void desktopChange()
This function is called whenever the desktop for the window changes.
Definition: kcommondecoration.cpp:549
virtual Position mousePosition(const TQPoint &point) const
This function should return mouse cursor position in the decoration.
Definition: kcommondecoration.cpp:730
void processMousePressEvent(TQMouseEvent *e)
This function is the default handler for mouse events.
Definition: kdecoration.cpp:174
static const KDecorationOptions * options()
Returns the KDecorationOptions object, which is used to access configuration settings for the decorat...
Definition: kdecoration.cpp:55
bool isMinimizable() const
Returns true if the decorated window can be minimized by the user.
Definition: kdecoration.cpp:104
void closeWindow()
This function can be called by the decoration to request closing of the decorated window.
Definition: kdecoration.cpp:234
MaximizeMode maximizeMode() const
Returns the current maximization mode of the decorated window.
Definition: kdecoration.cpp:99
bool keepAbove() const
Returns true if the decorated window should be kept above other windows.
Definition: kdecoration.cpp:139
bool isPreview() const
If this function returns true, the decorated window is used as a preview e.g.
Definition: kdecoration.cpp:204
bool isShadeable() const
Returns true if the decorated window can be shaded.
Definition: kdecoration.cpp:124
bool isSetShade() const
Returns true if the decorated window was set to be shaded.
Definition: kdecoration.cpp:134
void showWindowMenu(const TQRect &pos)
This function invokes the window operations menu.
Definition: kdecoration.cpp:179
bool keepBelow() const
Returns true if the decorated window should be kept below other windows.
Definition: kdecoration.cpp:144
WId windowId() const
Returns the handle of the window that is being decorated.
Definition: kdecoration.cpp:229
bool isMaximizable() const
Returns true if the decorated window can be maximized.
Definition: kdecoration.cpp:94
int height() const
Convenience function that returns the height of the decoration.
Definition: kdecoration.h:885
void setKeepAbove(bool set)
Sets or reset keeping this window above others.
Definition: kdecoration.cpp:287
void createMainWidget(TQt::WFlags flags=0)
Convenience functions that creates and sets a main widget as necessary.
Definition: kdecoration.cpp:60
KDecorationFactory * factory() const
Returns the factory that created this decoration.
Definition: kdecoration.h:870
void setKeepBelow(bool set)
Sets or reset keeping this window below others.
Definition: kdecoration.cpp:292
void titlebarDblClickOperation()
This function performs the operation configured as titlebar double click operation.
Definition: kdecoration.cpp:272
bool providesContextHelp() const
Return true if the decorated window can show context help (i.e.
Definition: kdecoration.cpp:109
int desktop() const
Returns the number of the virtual desktop the decorated window is currently on (including NET::OnAllD...
Definition: kdecoration.cpp:114
bool isCloseable() const
Returns true if the decoration window can be closed by the user.
Definition: kdecoration.cpp:89
void keepBelowChanged(bool)
This signal is emitted whenever the window's keep-below state changes.
void keepAboveChanged(bool)
This signal is emitted whenever the window's keep-above state changes.
bool isOnAllDesktops() const
Convenience function that returns true if the window is on all virtual desktops.
Definition: kdecoration.h:875
void setMask(const TQRegion ®, int mode=0)
If the decoration is non-rectangular, this function needs to be called to set the shape of the decora...
Definition: kdecoration.cpp:194
void titlebarMouseWheelOperation(int delta)
This function performs the operation configured as titlebar wheel mouse operation.
Definition: kdecoration.cpp:277
void toggleOnAllDesktops()
This function toggles the on-all-desktops state of the decorated window.
Definition: kdecoration.cpp:264
NET::WindowType windowType(unsigned long supported_types) const
This function returns the window type of the decorated window.
Definition: kdecoration.cpp:159
int width() const
Convenience function that returns the width of the decoration.
Definition: kdecoration.h:880