2009-09-15 07:12:54 +00:00
|
|
|
#ifndef oxygenclient_h
|
|
|
|
#define oxygenclient_h
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-08-24 16:14:11 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-09-15 07:12:54 +00:00
|
|
|
// oxygenclient.h
|
2009-08-24 16:14:11 +00:00
|
|
|
// -------------------
|
2009-09-09 00:55:55 +00:00
|
|
|
//
|
2009-08-24 16:14:11 +00:00
|
|
|
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
2009-08-25 04:15:13 +00:00
|
|
|
// Copyright (c) 2003, 2004 David Johnson <david@usermode.org>
|
|
|
|
// Copyright (c) 2006, 2007 Riccardo Iaconelli <ruphy@fsfe.org>
|
2009-08-24 16:14:11 +00:00
|
|
|
//
|
|
|
|
// 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
|
2009-09-09 00:55:55 +00:00
|
|
|
// IN THE SOFTWARE.
|
2009-08-24 16:14:11 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2010-05-02 18:50:01 +00:00
|
|
|
#include "oxygenanimation.h"
|
2009-11-15 03:24:04 +00:00
|
|
|
#include "oxygenclientgroupitemdata.h"
|
2009-09-15 07:12:54 +00:00
|
|
|
#include "oxygenconfiguration.h"
|
2010-05-02 18:50:01 +00:00
|
|
|
#include "oxygendecohelper.h"
|
|
|
|
#include "oxygenfactory.h"
|
2010-05-12 23:34:31 +00:00
|
|
|
#include "oxygenshadowcache.h"
|
2009-12-18 15:20:04 +00:00
|
|
|
#include "oxygentitleanimationdata.h"
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
#include <kcommondecoration.h>
|
2010-02-14 21:59:14 +00:00
|
|
|
#include <QtCore/QBasicTimer>
|
|
|
|
#include <QtCore/QTimerEvent>
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
namespace Oxygen
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
class SizeGrip;
|
|
|
|
class Client : public KCommonDecorationUnstable
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
Q_OBJECT
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//! declare glow intensity property
|
2009-11-17 22:26:36 +00:00
|
|
|
//!Q_PROPERTY( qreal glowIntensity READ glowIntensity WRITE setGlowIntensity )
|
|
|
|
Q_PROPERTY( qreal glowIntensity READ glowIntensityUnbiased WRITE setGlowIntensity )
|
2009-11-17 21:56:04 +00:00
|
|
|
|
2009-09-04 18:58:40 +00:00
|
|
|
public:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-04 18:58:40 +00:00
|
|
|
//! constructor
|
2010-05-02 18:34:08 +00:00
|
|
|
Client(KDecorationBridge *b, Factory *f);
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! destructor
|
2010-05-02 18:34:08 +00:00
|
|
|
virtual ~Client();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//! decoration name
|
2009-08-22 08:24:06 +00:00
|
|
|
virtual QString visibleName() const;
|
2009-10-14 14:37:58 +00:00
|
|
|
|
|
|
|
//! buttons
|
2009-08-22 08:24:06 +00:00
|
|
|
virtual KCommonDecorationButton *createButton(::ButtonType type);
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-18 06:54:42 +00:00
|
|
|
//!@name flags
|
|
|
|
//@{
|
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//! true if decoration has iquired behavior
|
|
|
|
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! true if window is maximized
|
2009-09-18 06:54:42 +00:00
|
|
|
virtual bool isMaximized( void ) const
|
|
|
|
{ return maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows(); }
|
|
|
|
|
2010-02-14 21:59:14 +00:00
|
|
|
|
|
|
|
//! true if animations are used
|
|
|
|
bool useAnimations( void ) const
|
2010-03-08 00:29:00 +00:00
|
|
|
{ return configuration().useAnimations(); }
|
2010-02-14 21:59:14 +00:00
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//! true if glow is animated
|
|
|
|
bool glowIsAnimated( void ) const
|
|
|
|
{ return glowAnimation_.data()->isRunning(); }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! true when decoration is forced active
|
|
|
|
bool isForcedActive( void ) const
|
|
|
|
{ return forceActive_ && clientGroupItems().count() > 1; }
|
|
|
|
|
2009-09-07 17:26:56 +00:00
|
|
|
//! true when separator is to be drawn
|
2009-09-18 01:32:27 +00:00
|
|
|
bool drawSeparator( void ) const
|
|
|
|
{
|
2009-10-15 16:03:30 +00:00
|
|
|
return
|
2009-11-17 21:56:04 +00:00
|
|
|
( glowIsAnimated() || isActive() ) &&
|
2009-10-15 16:03:30 +00:00
|
|
|
configuration().drawSeparator() &&
|
2009-11-07 03:33:53 +00:00
|
|
|
!configuration().hideTitleBar() &&
|
2009-10-15 16:03:30 +00:00
|
|
|
!configuration().drawTitleOutline();
|
2009-09-18 01:32:27 +00:00
|
|
|
}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-18 06:54:42 +00:00
|
|
|
//@}
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! window shape
|
|
|
|
virtual void updateWindowShape();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! initialization
|
|
|
|
virtual void init();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-10 05:13:25 +00:00
|
|
|
// reset
|
|
|
|
virtual void reset( unsigned long changed );
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! return associated configuration
|
2010-05-02 18:34:08 +00:00
|
|
|
const Configuration& configuration( void ) const
|
2009-09-18 06:54:42 +00:00
|
|
|
{ return configuration_; }
|
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//!@name glow animation
|
|
|
|
//@{
|
|
|
|
|
|
|
|
virtual const Animation::Pointer& glowAnimation( void ) const
|
|
|
|
{ return glowAnimation_; }
|
|
|
|
|
|
|
|
void setGlowIntensity( qreal value )
|
|
|
|
{ glowIntensity_ = value; }
|
|
|
|
|
2009-11-17 22:26:36 +00:00
|
|
|
//! unbiased glow intensity
|
|
|
|
qreal glowIntensityUnbiased( void ) const
|
2009-11-17 21:56:04 +00:00
|
|
|
{ return glowIntensity_; }
|
|
|
|
|
2009-11-17 22:26:36 +00:00
|
|
|
//! glow bias
|
|
|
|
static qreal glowBias( void )
|
|
|
|
{ return 0.2; }
|
|
|
|
|
|
|
|
//! true (biased) intensity
|
|
|
|
/*! this is needed to have glow go from either 0.2->1 or 0.8->0 depending on the animation direction */
|
|
|
|
qreal glowIntensity( void ) const
|
|
|
|
{ return glowAnimation().data()->direction() == Animation::Forward ? glowIntensity_ : glowIntensity_-glowBias(); }
|
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! helper class
|
2010-05-02 18:50:01 +00:00
|
|
|
DecoHelper& helper( void ) const
|
2009-10-13 01:45:01 +00:00
|
|
|
{ return factory_->helper(); }
|
|
|
|
|
|
|
|
//! helper class
|
2010-05-02 18:34:08 +00:00
|
|
|
ShadowCache& shadowCache( void ) const
|
2009-10-13 01:45:01 +00:00
|
|
|
{ return factory_->shadowCache(); }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//!@name metrics and color definitions
|
|
|
|
//@{
|
|
|
|
|
|
|
|
//! dimensions
|
|
|
|
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
|
2009-11-15 07:27:49 +00:00
|
|
|
|
|
|
|
//! get title rect for untabbed window
|
|
|
|
virtual QRect defaultTitleRect( bool active = true ) const;
|
2009-10-14 14:37:58 +00:00
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
//! get title bounding rect
|
2009-11-15 03:24:04 +00:00
|
|
|
virtual QRect titleBoundingRect( const QFont& font, const QString& caption ) const
|
|
|
|
{ return titleBoundingRect( font, titleRect(), caption ); }
|
2009-10-14 14:37:58 +00:00
|
|
|
|
|
|
|
//! get title bounding rect
|
2009-11-15 03:24:04 +00:00
|
|
|
virtual QRect titleBoundingRect( const QFont&, QRect, const QString& ) const;
|
2009-10-14 14:37:58 +00:00
|
|
|
|
2009-09-09 17:00:13 +00:00
|
|
|
//! palette background
|
|
|
|
QPalette backgroundPalette( const QWidget*, QPalette ) const;
|
|
|
|
|
2009-09-26 04:57:27 +00:00
|
|
|
//! background
|
|
|
|
QColor backgroundColor( const QWidget* widget, QPalette palette ) const
|
2009-11-15 03:24:04 +00:00
|
|
|
{ return backgroundColor( widget, palette, isActive() || isForcedActive() ); }
|
2009-09-26 04:57:27 +00:00
|
|
|
|
|
|
|
//! background
|
|
|
|
QColor backgroundColor( const QWidget*, QPalette, bool ) const;
|
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//@}
|
|
|
|
|
2010-03-11 15:24:28 +00:00
|
|
|
//! default buttons located on the left
|
|
|
|
virtual QString defaultButtonsLeft() const;
|
|
|
|
|
|
|
|
//! default buttons located on the right
|
|
|
|
virtual QString defaultButtonsRight() const;
|
2009-11-10 23:11:08 +00:00
|
|
|
|
2009-10-17 06:57:17 +00:00
|
|
|
//!@name status change methods (overloaded from KCommonDecorationUnstable)
|
|
|
|
//@{
|
|
|
|
|
|
|
|
//! triggered when window activity is changed
|
|
|
|
virtual void activeChange();
|
|
|
|
|
|
|
|
//! triggered when maximize state changed
|
|
|
|
virtual void maximizeChange();
|
|
|
|
|
|
|
|
//! triggered when window shade is changed
|
|
|
|
virtual void shadeChange();
|
|
|
|
|
|
|
|
//! triggered when window shade is changed
|
|
|
|
virtual void captionChange();
|
|
|
|
|
|
|
|
//@}
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! event filter
|
|
|
|
virtual bool eventFilter( QObject*, QEvent* );
|
2009-10-17 06:57:17 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! resize event
|
|
|
|
virtual void resizeEvent(QResizeEvent *e);
|
2010-07-28 01:07:47 +00:00
|
|
|
|
2010-07-24 21:45:25 +00:00
|
|
|
public slots:
|
2010-07-28 01:07:47 +00:00
|
|
|
|
2010-07-24 21:45:25 +00:00
|
|
|
//! triggers widget update in titleRect only
|
2010-07-28 01:07:47 +00:00
|
|
|
/*! one needs to add the title top margin to avoid some clipping glitches */
|
2010-07-24 21:45:25 +00:00
|
|
|
void updateTitleRect( void )
|
2010-07-28 01:07:47 +00:00
|
|
|
{ widget()->update( titleRect().adjusted( 0, -layoutMetric( LM_TitleEdgeTop ), 0, 0 ) ); }
|
2009-10-17 06:57:17 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2010-05-12 23:34:31 +00:00
|
|
|
//! return shadow cache key associated to this client
|
|
|
|
ShadowCache::Key key( void ) const
|
|
|
|
{
|
|
|
|
ShadowCache::Key key;
|
|
|
|
key.active = isActive() || isForcedActive();
|
|
|
|
key.useOxygenShadows = configuration().useOxygenShadows();
|
|
|
|
key.isShade = isShade();
|
|
|
|
key.hasTitleOutline = configuration().drawTitleOutline();
|
|
|
|
key.hasBorder = ( configuration().frameBorder() > Configuration::BorderNone );
|
|
|
|
return key;
|
|
|
|
}
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! true when decoration is forced active
|
|
|
|
void setForceActive( bool value )
|
|
|
|
{ forceActive_ = value; }
|
|
|
|
|
|
|
|
//!@name event filters
|
|
|
|
//@{
|
|
|
|
|
2009-10-17 06:57:17 +00:00
|
|
|
//! paint
|
|
|
|
virtual void paintEvent( QPaintEvent* );
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! mouse press event
|
|
|
|
virtual bool mousePressEvent( QMouseEvent* );
|
|
|
|
|
|
|
|
//! mouse release event
|
|
|
|
virtual bool mouseReleaseEvent( QMouseEvent* );
|
|
|
|
|
|
|
|
//! mouse move event
|
|
|
|
virtual bool mouseMoveEvent( QMouseEvent* );
|
|
|
|
|
|
|
|
//! drag enter event
|
|
|
|
virtual bool dragEnterEvent( QDragEnterEvent* );
|
|
|
|
|
|
|
|
//! drag move event
|
|
|
|
virtual bool dragMoveEvent( QDragMoveEvent* );
|
|
|
|
|
|
|
|
//! drag leave event
|
|
|
|
virtual bool dragLeaveEvent( QDragLeaveEvent* );
|
|
|
|
|
|
|
|
//! drop event
|
|
|
|
virtual bool dropEvent( QDropEvent* );
|
|
|
|
|
2009-11-15 06:28:40 +00:00
|
|
|
//! timer event
|
|
|
|
virtual void timerEvent( QTimerEvent* );
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//@}
|
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//!@name rendering methods (called in paintEvent)
|
|
|
|
//@{
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! window background
|
|
|
|
virtual void renderWindowBackground( QPainter*, const QRect&, const QWidget*, const QPalette& ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-04 18:58:40 +00:00
|
|
|
//! window border
|
|
|
|
// this draws a "blue" border around active window
|
2009-10-15 16:03:30 +00:00
|
|
|
virtual void renderWindowBorder( QPainter*, const QRect&, const QWidget*, const QPalette& ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-18 01:32:27 +00:00
|
|
|
//! separator
|
|
|
|
virtual void renderSeparator( QPainter*, const QRect&, const QWidget*, const QColor& ) const;
|
|
|
|
|
2009-09-04 18:58:40 +00:00
|
|
|
//! title outline
|
|
|
|
virtual void renderTitleOutline( QPainter*, const QRect&, const QPalette& ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-02 02:52:41 +00:00
|
|
|
//! title text
|
2009-11-14 04:19:09 +00:00
|
|
|
/*! second color, if valid, is for contrast pixel */
|
|
|
|
virtual void renderTitleText( QPainter*, const QRect&, const QColor&, const QColor& = QColor() ) const;
|
2009-10-15 16:03:30 +00:00
|
|
|
|
|
|
|
//! title text
|
2009-11-14 04:19:09 +00:00
|
|
|
/*! second color, if valid, is for contrast pixel */
|
2009-12-13 23:24:36 +00:00
|
|
|
virtual void renderTitleText( QPainter*, const QRect&, const QString&, const QColor&, const QColor& = QColor(), bool elide = true ) const;
|
2009-10-02 02:52:41 +00:00
|
|
|
|
2009-12-18 15:20:04 +00:00
|
|
|
//! title text
|
|
|
|
virtual QPixmap renderTitleText( const QRect&, const QString&, const QColor&, bool elide = true ) const;
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! GroupItem
|
|
|
|
virtual void renderItem( QPainter*, int, const QPalette& );
|
|
|
|
|
|
|
|
//! tabbing target rect
|
|
|
|
virtual void renderTargetRect( QPainter*, const QPalette& );
|
|
|
|
|
2009-10-14 14:28:37 +00:00
|
|
|
//! render float frame
|
|
|
|
virtual void renderFloatFrame( QPainter*, const QRect&, const QPalette& ) const;
|
|
|
|
|
|
|
|
//! render dots
|
|
|
|
virtual void renderDots( QPainter*, const QRect&, const QColor& ) const;
|
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//@}
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! close tab matching give button
|
2010-05-02 18:34:08 +00:00
|
|
|
virtual bool closeItem( const Button* );
|
2009-11-15 03:24:04 +00:00
|
|
|
|
|
|
|
//! index of item matching point
|
|
|
|
int itemClicked( const QPoint& position, bool between = false ) const
|
|
|
|
{ return itemData_.itemAt( position , between ); }
|
|
|
|
|
|
|
|
//! return pixmap corresponding to a given tab, for dragging
|
|
|
|
QPixmap itemDragPixmap( int, const QRect& );
|
|
|
|
|
2009-09-18 01:32:27 +00:00
|
|
|
//! return true when activity change are animated
|
|
|
|
bool animateActiveChange( void ) const
|
2010-02-14 21:59:14 +00:00
|
|
|
{ return ( useAnimations() && !isPreview() ); }
|
2009-09-18 01:32:27 +00:00
|
|
|
|
2009-10-02 02:52:41 +00:00
|
|
|
//! return true when activity change are animated
|
|
|
|
bool animateTitleChange( void ) const
|
|
|
|
{
|
2009-10-15 16:03:30 +00:00
|
|
|
return
|
2010-02-14 21:59:14 +00:00
|
|
|
useAnimations() &&
|
2010-01-06 01:42:38 +00:00
|
|
|
configuration().animateTitleChange() &&
|
2009-10-15 16:03:30 +00:00
|
|
|
!configuration().drawTitleOutline() &&
|
2009-11-07 03:33:53 +00:00
|
|
|
!configuration().hideTitleBar() &&
|
2009-10-15 16:03:30 +00:00
|
|
|
!isPreview();
|
2009-10-02 02:52:41 +00:00
|
|
|
}
|
|
|
|
|
2010-07-28 01:07:47 +00:00
|
|
|
//! true if some title outline is rendered
|
|
|
|
bool hasTitleOutline( void ) const
|
|
|
|
{
|
|
|
|
return
|
|
|
|
clientGroupItems().count() >= 2 ||
|
|
|
|
itemData_.isAnimated() ||
|
|
|
|
( isActive() && configuration().drawTitleOutline() );
|
|
|
|
}
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! calculate mask
|
|
|
|
QRegion calcMask( void ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! text color
|
|
|
|
QColor titlebarTextColor(const QPalette&);
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-18 19:47:53 +00:00
|
|
|
//! text color
|
|
|
|
QColor titlebarTextColor(const QPalette&, bool active);
|
|
|
|
|
2009-11-14 04:19:09 +00:00
|
|
|
//! text color
|
2009-11-15 03:24:04 +00:00
|
|
|
QColor titlebarContrastColor(const QPalette& palette ) const
|
|
|
|
{ return titlebarContrastColor( palette.color( widget()->window()->backgroundRole() ) ); }
|
|
|
|
|
|
|
|
//! text color
|
|
|
|
QColor titlebarContrastColor(const QColor& color ) const
|
|
|
|
{ return helper().calcLightColor( color ); }
|
2009-11-14 04:19:09 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//!@name size grip
|
|
|
|
//@{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! create size grip
|
|
|
|
void createSizeGrip( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! delete size grip
|
|
|
|
void deleteSizeGrip( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
// size grip
|
|
|
|
bool hasSizeGrip( void ) const
|
2009-09-14 23:10:19 +00:00
|
|
|
{ return (bool)sizeGrip_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! size grip
|
2010-05-02 18:34:08 +00:00
|
|
|
SizeGrip& sizeGrip( void ) const
|
2009-09-14 23:10:19 +00:00
|
|
|
{ return *sizeGrip_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
protected slots:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! set target item to -1
|
|
|
|
void clearTargetItem( void );
|
|
|
|
|
|
|
|
//! clear force active flag
|
|
|
|
void clearForceActive( void )
|
|
|
|
{ if( isActive() ) setForceActive( false ); }
|
2010-07-28 01:07:47 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! title bounding rects
|
|
|
|
/*! calculate and return title bounding rects in case of tabbed window */
|
|
|
|
void updateItemBoundingRects( bool alsoUpdate = true );
|
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
private:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-13 01:45:01 +00:00
|
|
|
//! factory
|
2010-05-02 18:34:08 +00:00
|
|
|
Factory* factory_;
|
2009-10-13 01:45:01 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! size grip widget
|
2010-05-02 18:34:08 +00:00
|
|
|
SizeGrip* sizeGrip_;
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
//! configuration
|
2010-05-02 18:34:08 +00:00
|
|
|
Configuration configuration_;
|
2009-10-15 16:03:30 +00:00
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//! glow animation
|
|
|
|
Animation::Pointer glowAnimation_;
|
|
|
|
|
2009-12-18 15:20:04 +00:00
|
|
|
//! title animation data
|
|
|
|
TitleAnimationData::Pointer titleAnimationData_;
|
2009-09-18 01:32:27 +00:00
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//! glow intensity
|
|
|
|
qreal glowIntensity_;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! true when initialized
|
|
|
|
bool initialized_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! true when decoration is forced active
|
|
|
|
bool forceActive_;
|
|
|
|
|
|
|
|
//! mouse button
|
|
|
|
Qt::MouseButton mouseButton_;
|
|
|
|
|
|
|
|
//! tab bounding rects
|
|
|
|
ClientGroupItemDataList itemData_;
|
|
|
|
|
|
|
|
//! index of tab being dragged if any, -1 otherwise
|
|
|
|
int sourceItem_;
|
|
|
|
|
|
|
|
//! drag start point
|
|
|
|
QPoint dragPoint_;
|
|
|
|
|
2009-11-15 06:28:40 +00:00
|
|
|
//! drag start timer.
|
|
|
|
/*!
|
|
|
|
it is needed to activate animations when this was not done via either
|
|
|
|
dragMoveEvent or dragLeaveEvent
|
|
|
|
*/
|
|
|
|
QBasicTimer dragStartTimer_;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-14 15:36:08 +00:00
|
|
|
//!@name utility functions
|
|
|
|
//@{
|
|
|
|
|
|
|
|
// dot
|
|
|
|
void renderDot(QPainter*, const QPointF&, qreal );
|
|
|
|
|
|
|
|
// contrast
|
|
|
|
QColor reduceContrast(const QColor&, const QColor&, double t);
|
|
|
|
|
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
} // namespace Oxygen
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#endif // EXAMPLECLIENT_H
|