@ -25,13 +25,13 @@
# include <klocale.h>
# include <kdebug.h>
# include < qbitmap.h>
# include < qlabel.h>
# include < qpainter.h>
# include < qtooltip.h>
# include < qapplication.h>
# include < qimage.h>
# include < qpopupmenu.h>
# include < t qbitmap.h>
# include < t qlabel.h>
# include < t qpainter.h>
# include < t qtooltip.h>
# include < t qapplication.h>
# include < t qimage.h>
# include < t qpopupmenu.h>
# include <kwin.h>
# include <kprocess.h>
@ -48,7 +48,7 @@
CrystalFactory * factory = NULL ;
bool CrystalFactory : : initialized_ = false ;
Qt: : AlignmentFlags CrystalFactory : : titlealign_ = Qt: : AlignHCenter ;
T Qt: : AlignmentFlags CrystalFactory : : titlealign_ = T Qt: : AlignHCenter ;
extern " C " KDecorationFactory * create_factory ( )
@ -60,17 +60,17 @@ extern "C" KDecorationFactory* create_factory()
/*****************
* Tooltip class for the titlebar
* */
class CCrystalTooltip : public QToolTip
class CCrystalTooltip : public T QToolTip
{
private :
CrystalClient * client ;
public :
CCrystalTooltip ( QWidget * widget , CrystalClient * vc ) : QToolTip( widget ) , client ( vc ) { }
virtual void maybeTip ( const QPoint& p )
CCrystalTooltip ( T QWidget * widget , CrystalClient * vc ) : T QToolTip( widget ) , client ( vc ) { }
virtual void maybeTip ( const T QPoint& p )
{
if ( client - > titlebar_ - > geometry( ) . contains( p ) )
if ( client - > titlebar_ - > tq geometry( ) . tq contains( p ) )
{
tip ( client - > titlebar_ - > geometry( ) , client - > caption ( ) ) ;
tip ( client - > titlebar_ - > tq geometry( ) , client - > caption ( ) ) ;
}
}
} ;
@ -87,7 +87,7 @@ CrystalFactory::CrystalFactory()
readConfig ( ) ;
initialized_ = true ;
if ( transparency ) image_holder = new QImageHolder( active . userdefinedPicture , inactive . userdefinedPicture ) ;
if ( transparency ) image_holder = new T QImageHolder( active . userdefinedPicture , inactive . userdefinedPicture ) ;
else image_holder = NULL ;
CreateButtonImages ( ) ;
}
@ -117,9 +117,9 @@ bool CrystalFactory::reset(unsigned long /*changed*/)
if ( transparency )
{
if ( ! image_holder ) image_holder = new QImageHolder( active . userdefinedPicture , inactive . userdefinedPicture ) ;
if ( ! image_holder ) image_holder = new T QImageHolder( active . userdefinedPicture , inactive . userdefinedPicture ) ;
image_holder - > setUserdefinedPictures ( active . userdefinedPicture , inactive . userdefinedPicture ) ;
image_holder - > repaint( true ) ;
image_holder - > tq repaint( true ) ;
} else {
if ( image_holder ) delete image_holder ;
image_holder = NULL ;
@ -141,7 +141,7 @@ bool CrystalFactory::supports(Ability ability)
}
}
void setupOverlay ( WND_CONFIG * cfg , int mode , QString filename )
void setupOverlay ( WND_CONFIG * cfg , int mode , T QString filename )
{
cfg - > overlay . resize ( 0 , 0 ) ;
switch ( mode )
@ -149,27 +149,27 @@ void setupOverlay(WND_CONFIG *cfg,int mode,QString filename)
case 0 : break ;
case 1 : {
cfg - > overlay . resize ( 0 , 0 ) ;
QImage img = QImage( ( uchar * ) lighting_overlay_data , 1 , 60 , 32 , NULL , 0 , QImage: : LittleEndian ) ;
T QImage img = T QImage( ( uchar * ) lighting_overlay_data , 1 , 60 , 32 , NULL , 0 , T QImage: : LittleEndian ) ;
img . setAlphaBuffer ( true ) ;
cfg - > overlay . convertFromImage ( img . smoothScale ( 256 , : : factory - > titlesize ) ) ;
break ;
}
case 2 : {
cfg - > overlay . resize ( 0 , 0 ) ;
QImage img = QImage( ( uchar * ) glass_overlay_data , 20 , 64 , 32 , NULL , 0 , QImage: : LittleEndian ) ;
T QImage img = T QImage( ( uchar * ) glass_overlay_data , 20 , 64 , 32 , NULL , 0 , T QImage: : LittleEndian ) ;
img . setAlphaBuffer ( true ) ;
cfg - > overlay . convertFromImage ( img . smoothScale ( 256 , : : factory - > titlesize ) ) ;
break ;
}
case 3 : {
cfg - > overlay . resize ( 0 , 0 ) ;
QImage img = QImage( ( uchar * ) steel_overlay_data , 28 , 64 , 32 , NULL , 0 , QImage: : LittleEndian ) ;
T QImage img = T QImage( ( uchar * ) steel_overlay_data , 28 , 64 , 32 , NULL , 0 , T QImage: : LittleEndian ) ;
img . setAlphaBuffer ( true ) ;
cfg - > overlay . convertFromImage ( img . smoothScale ( 256 , : : factory - > titlesize ) ) ;
break ;
}
case 4 : {
QImage img ;
T QImage img ;
if ( img . load ( filename ) )
{
img . setAlphaBuffer ( true ) ;
@ -185,12 +185,12 @@ bool CrystalFactory::readConfig()
// create a config object
KConfig config ( " kwincrystalrc " ) ;
config . setGroup ( " General " ) ;
QColor c ;
T QColor c ;
QString value = config . readEntry ( " TitleAlignment " , " AlignHCenter " ) ;
if ( value = = " AlignLeft " ) titlealign_ = Qt: : AlignLeft ;
else if ( value = = " AlignHCenter " ) titlealign_ = Qt: : AlignHCenter ;
else if ( value = = " AlignRight " ) titlealign_ = Qt: : AlignRight ;
T QString value = config . readEntry ( " TitleAlignment " , " AlignHCenter " ) ;
if ( value = = " AlignLeft " ) titlealign_ = T Qt: : AlignLeft ;
else if ( value = = " AlignHCenter " ) titlealign_ = T Qt: : AlignHCenter ;
else if ( value = = " AlignRight " ) titlealign_ = T Qt: : AlignRight ;
drawcaption = ( bool ) config . readBoolEntry ( " DrawCaption " , true ) ;
textshadow = ( bool ) config . readBoolEntry ( " TextShadow " , true ) ;
@ -205,23 +205,23 @@ bool CrystalFactory::readConfig()
inactive . amount = ( double ) config . readNumEntry ( " InactiveShade " , - 30 ) / 100.0 ;
active . outlineMode = ( int ) config . readNumEntry ( " ActiveFrame " , 1 ) ;
inactive . outlineMode = ( int ) config . readNumEntry ( " InactiveFrame " , 1 ) ;
c = QColor( 160 , 160 , 160 ) ;
c = T QColor( 160 , 160 , 160 ) ;
active . frameColor = config . readColorEntry ( " FrameColor1 " , & c ) ;
c = QColor( 128 , 128 , 128 ) ;
c = T QColor( 128 , 128 , 128 ) ;
inactive . frameColor = config . readColorEntry ( " FrameColor2 " , & c ) ;
active . inlineMode = ( int ) config . readNumEntry ( " ActiveInline " , 0 ) ;
inactive . inlineMode = ( int ) config . readNumEntry ( " InactiveInline " , 0 ) ;
c = QColor( 160 , 160 , 160 ) ;
c = T QColor( 160 , 160 , 160 ) ;
active . inlineColor = config . readColorEntry ( " InlineColor1 " , & c ) ;
c = QColor( 160 , 160 , 160 ) ;
c = T QColor( 160 , 160 , 160 ) ;
inactive . inlineColor = config . readColorEntry ( " InlineColor2 " , & c ) ;
active . blur = config . readNumEntry ( " ActiveBlur " , 0 ) ;
inactive . blur = config . readNumEntry ( " InactiveBlur " , 0 ) ;
active . userdefinedPicture = QImage( ) ;
inactive . userdefinedPicture = QImage( ) ;
active . userdefinedPicture = T QImage( ) ;
inactive . userdefinedPicture = T QImage( ) ;
if ( ( bool ) config . readBoolEntry ( " ActiveUserdefined " , false ) )
{
active . userdefinedPicture . load ( config . readEntry ( " ActiveUserdefinedPicture " ) ) ;
@ -234,19 +234,19 @@ bool CrystalFactory::readConfig()
borderwidth = config . readNumEntry ( " Borderwidth " , 5 ) ;
titlesize = config . readNumEntry ( " Titlebarheight " , 21 ) ;
buttonColor_normal = QColor( 255 , 255 , 255 ) ;
buttonColor_normal = T QColor( 255 , 255 , 255 ) ;
buttonColor_normal = config . readColorEntry ( " ButtonColor " , & buttonColor_normal ) ;
buttonColor_hovered = config . readColorEntry ( " ButtonColor2 " , & buttonColor_normal ) ;
buttonColor_pressed = config . readColorEntry ( " ButtonColor3 " , & buttonColor_normal ) ;
minColor_normal = QColor( 255 , 255 , 255 ) ;
minColor_normal = T QColor( 255 , 255 , 255 ) ;
minColor_normal = config . readColorEntry ( " MinColor " , & buttonColor_normal ) ;
minColor_hovered = config . readColorEntry ( " MinColor2 " , & buttonColor_normal ) ;
minColor_pressed = config . readColorEntry ( " MinColor3 " , & buttonColor_normal ) ;
maxColor_normal = QColor( 255 , 255 , 255 ) ;
maxColor_normal = T QColor( 255 , 255 , 255 ) ;
maxColor_normal = config . readColorEntry ( " MaxColor " , & buttonColor_normal ) ;
maxColor_hovered = config . readColorEntry ( " MaxColor2 " , & buttonColor_normal ) ;
maxColor_pressed = config . readColorEntry ( " MaxColor3 " , & buttonColor_normal ) ;
closeColor_normal = QColor( 255 , 255 , 255 ) ;
closeColor_normal = T QColor( 255 , 255 , 255 ) ;
closeColor_normal = config . readColorEntry ( " CloseColor " , & closeColor_normal ) ;
closeColor_hovered = config . readColorEntry ( " CloseColor2 " , & closeColor_normal ) ;
closeColor_pressed = config . readColorEntry ( " CloseColor3 " , & closeColor_normal ) ;
@ -257,8 +257,8 @@ bool CrystalFactory::readConfig()
animateHover = config . readBoolEntry ( " AnimateHover " , true ) ;
tintButtons = config . readBoolEntry ( " TintButtons " , false ) ;
menuImage = config . readBoolEntry ( " MenuImage " , true ) ;
repaintMode= config . readNumEntry ( " RepaintMode " , 1 ) ;
repaintTime= config . readNumEntry ( " RepaintTime " , 200 ) ;
tq repaintMode= config . readNumEntry ( " RepaintMode " , 1 ) ;
tq repaintTime= config . readNumEntry ( " RepaintTime " , 200 ) ;
buttontheme = config . readNumEntry ( " ButtonTheme " , 8 ) ;
@ -269,7 +269,7 @@ bool CrystalFactory::readConfig()
logoStretch = config . readNumEntry ( " LogoStretch " , 0 ) ;
logoActive = config . readBoolEntry ( " LogoActive " , 0 ) ;
logoDistance = config . readNumEntry ( " LogoDistance " , 0 ) ;
QString filename = config . readEntry ( " LogoFile " , " " ) ;
T QString filename = config . readEntry ( " LogoFile " , " " ) ;
if ( ! filename . isNull ( ) & & logoEnabled ! = 1 )
{
if ( logo . load ( filename ) )
@ -289,7 +289,7 @@ void CrystalFactory::CreateButtonImages()
{
if ( buttonImages [ i ] ) buttonImages [ i ] - > reset ( ) ; else
buttonImages [ i ] = new ButtonImage ;
if ( ! tintButtons ) buttonImages [ i ] - > setColors ( Qt: : white , Qt: : white , Qt: : white ) ;
if ( ! tintButtons ) buttonImages [ i ] - > setColors ( T Qt: : white , T Qt: : white , T Qt: : white ) ;
else switch ( i )
{
case ButtonImageMin :
@ -759,50 +759,50 @@ void CrystalClient::init()
// for flicker-free redraws
widget ( ) - > setBackgroundMode ( NoBackground ) ;
// setup layout
main layout = new QGridLayout( widget ( ) , 4 , 3 ) ; // 4x3 grid
title layout = new QHBoxLayout( ) ;
titlebar_ = new QSpacerItem( 1 , : : factory - > titlesize - 1 , QSizePolicy: : Expanding ,
QSizePolicy: : Fixed ) ;
// setup tq layout
main tq layout = new T QGridLayout( widget ( ) , 4 , 3 ) ; // 4x3 grid
title tq layout = new T QHBoxLayout( ) ;
titlebar_ = new T QSpacerItem( 1 , : : factory - > titlesize - 1 , T QSizePolicy: : Expanding ,
T QSizePolicy: : Fixed ) ;
main layout- > setResizeMode ( QLayout: : FreeResize ) ;
main layout- > setRowSpacing ( 0 , ( : : factory - > buttontheme = = 5 ) ? 0 : 1 ) ;
main layout- > setRowSpacing ( 3 , : : factory - > borderwidth * 1 ) ;
main tq layout- > setResizeMode ( T QLayout: : FreeResize ) ;
main tq layout- > setRowSpacing ( 0 , ( : : factory - > buttontheme = = 5 ) ? 0 : 1 ) ;
main tq layout- > setRowSpacing ( 3 , : : factory - > borderwidth * 1 ) ;
main layout- > setColSpacing ( 2 , borderSpacing ( ) ) ;
main layout- > setColSpacing ( 0 , borderSpacing ( ) ) ;
main layout- > addLayout ( title layout, 1 , 1 ) ;
main tq layout- > setColSpacing ( 2 , borderSpacing ( ) ) ;
main tq layout- > setColSpacing ( 0 , borderSpacing ( ) ) ;
main tq layout- > addLayout ( title tq layout, 1 , 1 ) ;
if ( isPreview ( ) ) {
char c [ 512 ] ;
sprintf ( c , " <center><b>Crystal %s Preview</b><br>Built: %s</center> " , VERSION , __DATE__ ) ;
main layout- > addItem ( new QSpacerItem( 1 , 1 , QSizePolicy: : Expanding , QSizePolicy: : Fixed ) , 0 , 1 ) ;
main layout- > addItem ( new QSpacerItem( 1 , : : factory - > borderwidth , QSizePolicy: : Expanding , QSizePolicy: : Expanding ) , 3 , 1 ) ;
main layout- > addWidget ( new QLabel( i18n ( c ) , widget ( ) ) , 2 , 1 ) ;
main tq layout- > addItem ( new T QSpacerItem( 1 , 1 , T QSizePolicy: : Expanding , T QSizePolicy: : Fixed ) , 0 , 1 ) ;
main tq layout- > addItem ( new T QSpacerItem( 1 , : : factory - > borderwidth , T QSizePolicy: : Expanding , T QSizePolicy: : Expanding ) , 3 , 1 ) ;
main tq layout- > addWidget ( new T QLabel( i18n ( c ) , widget ( ) ) , 2 , 1 ) ;
} else {
main layout- > addItem ( new QSpacerItem( 0 , 0 ) , 2 , 1 ) ;
main tq layout- > addItem ( new T QSpacerItem( 0 , 0 ) , 2 , 1 ) ;
}
main layout- > setRowStretch ( 2 , 10 ) ;
main layout- > setColStretch ( 1 , 10 ) ;
main tq layout- > setRowStretch ( 2 , 10 ) ;
main tq layout- > setColStretch ( 1 , 10 ) ;
updateMask ( ) ;
for ( int n = 0 ; n < ButtonTypeCount ; n + + ) button [ n ] = 0 ;
addButtons ( title layout, options ( ) - > titleButtonsLeft ( ) ) ;
title layout- > addItem ( titlebar_ ) ;
addButtons ( title tq layout, options ( ) - > titleButtonsLeft ( ) ) ;
title tq layout- > addItem ( titlebar_ ) ;
{
CrystalButton * lastbutton = addButtons ( title layout, options ( ) - > titleButtonsRight ( ) ) ;
CrystalButton * lastbutton = addButtons ( title tq layout, options ( ) - > titleButtonsRight ( ) ) ;
if ( lastbutton ) lastbutton - > setFirstLast ( false , true ) ;
}
if ( : : factory - > captiontooltip ) new CCrystalTooltip ( widget ( ) , this ) ;
connect ( this , SIGNAL( keepAboveChanged ( bool ) ) , SLOT( keepAboveChange ( bool ) ) ) ;
connect ( this , SIGNAL( keepBelowChanged ( bool ) ) , SLOT( keepBelowChange ( bool ) ) ) ;
connect ( this , TQT_ SIGNAL( keepAboveChanged ( bool ) ) , TQT_ SLOT( keepAboveChange ( bool ) ) ) ;
connect ( this , TQT_ SIGNAL( keepBelowChanged ( bool ) ) , TQT_ SLOT( keepBelowChange ( bool ) ) ) ;
if ( : : factory - > transparency ) connect ( : : factory - > image_holder , SIGNAL( repaintNeeded( ) ) , this , SLOT( Repaint ( ) ) ) ;
if ( : : factory - > transparency ) connect ( & timer , SIGNAL( timeout ( ) ) , this , SLOT( Repaint ( ) ) ) ;
if ( : : factory - > transparency ) connect ( : : factory - > image_holder , TQT_ SIGNAL( tq repaintNeeded( ) ) , this , TQT_ SLOT( Repaint ( ) ) ) ;
if ( : : factory - > transparency ) connect ( & timer , TQT_ SIGNAL( timeout ( ) ) , this , TQT_ SLOT( Repaint ( ) ) ) ;
updateLayout ( ) ;
}
@ -811,53 +811,53 @@ void CrystalClient::updateMask()
{
if ( ( : : factory - > roundCorners = = 0 ) | | ( ! options ( ) - > moveResizeMaximizedWindows ( ) & & maximizeMode ( ) & MaximizeFull ) )
{
setMask ( QRegion( widget ( ) - > rect ( ) ) ) ;
setMask ( T QRegion( widget ( ) - > rect ( ) ) ) ;
return ;
}
int cornersFlag = : : factory - > roundCorners ;
int r ( width ( ) ) ;
int b ( height ( ) ) ;
QRegion mask;
T QRegion tq mask;
mask= QRegion( widget ( ) - > rect ( ) ) ;
tq mask= T QRegion( widget ( ) - > rect ( ) ) ;
// Remove top-left corner.
if ( cornersFlag & TOP_LEFT ) {
mask - = QRegion( 0 , 0 , 5 , 1 ) ;
mask - = QRegion( 0 , 1 , 3 , 1 ) ;
mask - = QRegion( 0 , 2 , 2 , 1 ) ;
mask - = QRegion( 0 , 3 , 1 , 2 ) ;
tq mask - = T QRegion( 0 , 0 , 5 , 1 ) ;
tq mask - = T QRegion( 0 , 1 , 3 , 1 ) ;
tq mask - = T QRegion( 0 , 2 , 2 , 1 ) ;
tq mask - = T QRegion( 0 , 3 , 1 , 2 ) ;
}
// Remove top-right corner.
if ( cornersFlag & TOP_RIGHT ) {
mask - = QRegion( r - 5 , 0 , 5 , 1 ) ;
mask - = QRegion( r - 3 , 1 , 3 , 1 ) ;
mask - = QRegion( r - 2 , 2 , 2 , 1 ) ;
mask - = QRegion( r - 1 , 3 , 1 , 2 ) ;
tq mask - = T QRegion( r - 5 , 0 , 5 , 1 ) ;
tq mask - = T QRegion( r - 3 , 1 , 3 , 1 ) ;
tq mask - = T QRegion( r - 2 , 2 , 2 , 1 ) ;
tq mask - = T QRegion( r - 1 , 3 , 1 , 2 ) ;
}
// Remove bottom-left corner.
if ( cornersFlag & BOT_LEFT ) {
mask - = QRegion( 0 , b - 5 , 1 , 3 ) ;
mask - = QRegion( 0 , b - 3 , 2 , 1 ) ;
mask - = QRegion( 0 , b - 2 , 3 , 1 ) ;
mask - = QRegion( 0 , b - 1 , 5 , 1 ) ;
tq mask - = T QRegion( 0 , b - 5 , 1 , 3 ) ;
tq mask - = T QRegion( 0 , b - 3 , 2 , 1 ) ;
tq mask - = T QRegion( 0 , b - 2 , 3 , 1 ) ;
tq mask - = T QRegion( 0 , b - 1 , 5 , 1 ) ;
}
// Remove bottom-right corner.
if ( cornersFlag & BOT_RIGHT ) {
mask - = QRegion( r - 5 , b - 1 , 5 , 1 ) ;
mask - = QRegion( r - 3 , b - 2 , 3 , 1 ) ;
mask - = QRegion( r - 2 , b - 3 , 2 , 1 ) ;
mask - = QRegion( r - 1 , b - 5 , 1 , 2 ) ;
tq mask - = T QRegion( r - 5 , b - 1 , 5 , 1 ) ;
tq mask - = T QRegion( r - 3 , b - 2 , 3 , 1 ) ;
tq mask - = T QRegion( r - 2 , b - 3 , 2 , 1 ) ;
tq mask - = T QRegion( r - 1 , b - 5 , 1 , 2 ) ;
}
setMask ( mask) ;
setMask ( tq mask) ;
}
CrystalButton * CrystalClient : : addButtons ( QBoxLayout * layout, const QString& s )
CrystalButton * CrystalClient : : addButtons ( T QBoxLayout * tq layout, const T QString& s )
{
ButtonImage * bitmap ;
QString tip ;
T QString tip ;
CrystalButton * lastone = NULL ;
if ( s . length ( ) > 0 )
@ -869,7 +869,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
case ' M ' : // Menu button
if ( ! button [ ButtonMenu ] ) {
button [ ButtonMenu ] = current = new CrystalButton ( this , " menu " , i18n ( " Menu " ) , ButtonMenu , : : factory - > buttonImages [ ButtonImageMenu ] ) ;
connect ( button [ ButtonMenu ] , SIGNAL( pressed ( ) ) , this , SLOT( menuButtonPressed ( ) ) ) ;
connect ( button [ ButtonMenu ] , TQT_ SIGNAL( pressed ( ) ) , this , TQT_ SLOT( menuButtonPressed ( ) ) ) ;
}
break ;
@ -883,7 +883,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
tip = i18n ( " On All Desktops " ) ;
}
button [ ButtonSticky ] = current = new CrystalButton ( this , " sticky " , tip , ButtonSticky , bitmap ) ;
connect ( button [ ButtonSticky ] , SIGNAL( clicked ( ) ) , this , SLOT( toggleOnAllDesktops ( ) ) ) ;
connect ( button [ ButtonSticky ] , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( toggleOnAllDesktops ( ) ) ) ;
}
break ;
@ -891,7 +891,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ( providesContextHelp ( ) ) {
button [ ButtonHelp ] = current =
new CrystalButton ( this , " help " , i18n ( " Help " ) , ButtonHelp , : : factory - > buttonImages [ ButtonImageHelp ] ) ;
connect ( button [ ButtonHelp ] , SIGNAL( clicked ( ) ) , this , SLOT( showContextHelp ( ) ) ) ;
connect ( button [ ButtonHelp ] , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( showContextHelp ( ) ) ) ;
}
break ;
@ -899,7 +899,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ( ( ! button [ ButtonMin ] ) & & isMinimizable ( ) ) {
button [ ButtonMin ] = current =
new CrystalButton ( this , " iconify " , i18n ( " Minimize " ) , ButtonMin , : : factory - > buttonImages [ ButtonImageMin ] ) ;
connect ( button [ ButtonMin ] , SIGNAL( clicked ( ) ) , this , SLOT( minButtonPressed ( ) ) ) ;
connect ( button [ ButtonMin ] , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( minButtonPressed ( ) ) ) ;
}
break ;
@ -907,7 +907,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ( ! button [ ButtonAbove ] ) {
button [ ButtonAbove ] = current =
new CrystalButton ( this , " above " , i18n ( " Keep Above Others " ) , ButtonAbove , : : factory - > buttonImages [ keepAbove ( ) ? ButtonImageUnAbove : ButtonImageAbove ] ) ;
connect ( button [ ButtonAbove ] , SIGNAL( clicked ( ) ) , this , SLOT( aboveButtonPressed ( ) ) ) ;
connect ( button [ ButtonAbove ] , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( aboveButtonPressed ( ) ) ) ;
}
break ;
@ -915,7 +915,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ( ( ! button [ ButtonBelow ] ) ) {
button [ ButtonBelow ] = current =
new CrystalButton ( this , " below " , i18n ( " Keep Below Others " ) , ButtonBelow , : : factory - > buttonImages [ keepBelow ( ) ? ButtonImageUnBelow : ButtonImageBelow ] ) ;
connect ( button [ ButtonBelow ] , SIGNAL( clicked ( ) ) , this , SLOT( belowButtonPressed ( ) ) ) ;
connect ( button [ ButtonBelow ] , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( belowButtonPressed ( ) ) ) ;
}
break ;
@ -923,7 +923,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ( ( ! button [ ButtonShade ] ) & & isShadeable ( ) ) {
button [ ButtonShade ] = current =
new CrystalButton ( this , " shade " , i18n ( " Shade " ) , ButtonShade , : : factory - > buttonImages [ ButtonImageShade ] ) ;
connect ( button [ ButtonShade ] , SIGNAL( clicked ( ) ) , this , SLOT( shadeButtonPressed ( ) ) ) ;
connect ( button [ ButtonShade ] , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( shadeButtonPressed ( ) ) ) ;
}
break ;
@ -940,7 +940,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
}
button [ ButtonMax ] = current =
new CrystalButton ( this , " maximize " , tip , ButtonMax , bitmap ) ;
connect ( button [ ButtonMax ] , SIGNAL( clicked ( ) ) , this , SLOT( maxButtonPressed ( ) ) ) ;
connect ( button [ ButtonMax ] , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( maxButtonPressed ( ) ) ) ;
}
break ;
@ -948,20 +948,20 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ( isCloseable ( ) ) {
button [ ButtonClose ] = current =
new CrystalButton ( this , " close " , i18n ( " Close " ) , ButtonClose , : : factory - > buttonImages [ ButtonImageClose ] ) ;
connect ( button [ ButtonClose ] , SIGNAL( clicked ( ) ) , this , SLOT( closeButtonPressed ( ) ) ) ;
connect ( button [ ButtonClose ] , TQT_ SIGNAL( clicked ( ) ) , this , TQT_ SLOT( closeButtonPressed ( ) ) ) ;
}
break ;
case ' _ ' : // Spacer item
layout- > addSpacing ( 4 ) ;
tq layout- > addSpacing ( 4 ) ;
current = NULL ;
break ;
}
if ( current )
{
layout- > addWidget ( current ) ;
if ( layout- > findWidget( current ) = = 0 ) current - > setFirstLast ( true , false ) ;
tq layout- > addWidget ( current ) ;
if ( tq layout- > tq findWidget( current ) = = 0 ) current - > setFirstLast ( true , false ) ;
}
lastone = current ;
}
@ -972,12 +972,12 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
void CrystalClient : : activeChange ( )
{
Repaint ( ) ;
if ( isActive ( ) ) : : factory - > clients . at ( : : factory - > clients . find( this ) ) ;
if ( isActive ( ) ) : : factory - > clients . at ( : : factory - > clients . tq find( this ) ) ;
}
void CrystalClient : : captionChange ( )
{
if ( : : factory - > drawcaption ) widget ( ) - > repaint( titlebar_ - > geometry( ) , false ) ;
if ( : : factory - > drawcaption ) widget ( ) - > tq repaint( titlebar_ - > tq geometry( ) , false ) ;
}
void CrystalClient : : desktopChange ( )
@ -985,8 +985,8 @@ void CrystalClient::desktopChange()
bool d = isOnAllDesktops ( ) ;
if ( button [ ButtonSticky ] ) {
button [ ButtonSticky ] - > setBitmap ( : : factory - > buttonImages [ d ? ButtonImageSticky : ButtonImageUnSticky ] ) ;
QToolTip: : remove ( button [ ButtonSticky ] ) ;
QToolTip: : add ( button [ ButtonSticky ] , d ? i18n ( " Not on all desktops " ) : i18n ( " On All Desktops " ) ) ;
T QToolTip: : remove ( button [ ButtonSticky ] ) ;
T QToolTip: : add ( button [ ButtonSticky ] , d ? i18n ( " Not on all desktops " ) : i18n ( " On All Desktops " ) ) ;
}
}
@ -1002,8 +1002,8 @@ void CrystalClient::maximizeChange()
bool m = ( maximizeMode ( ) = = MaximizeFull ) ;
if ( button [ ButtonMax ] ) {
button [ ButtonMax ] - > setBitmap ( : : factory - > buttonImages [ m ? ButtonImageRestore : ButtonImageMax ] ) ;
QToolTip: : remove ( button [ ButtonMax ] ) ;
QToolTip: : add ( button [ ButtonMax ] , m ? i18n ( " Restore " ) : i18n ( " Maximize " ) ) ;
T QToolTip: : remove ( button [ ButtonMax ] ) ;
T QToolTip: : add ( button [ ButtonMax ] , m ? i18n ( " Restore " ) : i18n ( " Maximize " ) ) ;
}
if ( ! options ( ) - > moveResizeMaximizedWindows ( ) )
@ -1018,17 +1018,17 @@ void CrystalClient::updateLayout()
{
if ( FullMax )
{
main layout- > setColSpacing ( 0 , 0 ) ;
main layout- > setColSpacing ( 2 , 0 ) ;
main tq layout- > setColSpacing ( 0 , 0 ) ;
main tq layout- > setColSpacing ( 2 , 0 ) ;
} else {
main layout- > setColSpacing ( 2 , borderSpacing ( ) ) ;
main layout- > setColSpacing ( 0 , borderSpacing ( ) ) ;
main tq layout- > setColSpacing ( 2 , borderSpacing ( ) ) ;
main tq layout- > setColSpacing ( 0 , borderSpacing ( ) ) ;
}
main layout- > setRowSpacing ( 0 , ( FullMax | | : : factory - > buttontheme = = 5 ) ? 0 : 1 ) ;
main tq layout- > setRowSpacing ( 0 , ( FullMax | | : : factory - > buttontheme = = 5 ) ? 0 : 1 ) ;
for ( int i = 0 ; i < ButtonTypeCount ; i + + ) if ( button [ i ] )
button [ i ] - > resetSize ( FullMax ) ;
widget ( ) - > layout( ) - > activate ( ) ;
widget ( ) - > tq layout( ) - > activate ( ) ;
}
int CrystalClient : : borderSpacing ( )
@ -1067,17 +1067,17 @@ void CrystalClient::borders(int &l, int &r, int &t, int &b) const
}
}
void CrystalClient : : resize ( const QSize & size )
void CrystalClient : : resize ( const T QSize & size )
{
widget ( ) - > resize ( size ) ;
}
QSize CrystalClient : : minimumSize( ) const
T QSize CrystalClient : : tq minimumSize( ) const
{
return widget ( ) - > minimumSize( ) ;
return widget ( ) - > tq minimumSize( ) ;
}
KDecoration : : Position CrystalClient : : mousePosition ( const QPoint & point ) const
KDecoration : : Position CrystalClient : : mousePosition ( const T QPoint & point ) const
{
const int corner = 20 ;
Position pos ;
@ -1111,33 +1111,33 @@ KDecoration::Position CrystalClient::mousePosition(const QPoint &point) const
return pos ;
}
bool CrystalClient : : eventFilter ( QObject * obj , QEvent * e )
bool CrystalClient : : eventFilter ( T QObject * obj , T QEvent * e )
{
if ( obj ! = widget( ) ) return false ;
if ( TQT_BASE_OBJECT( obj) ! = TQT_BASE_OBJECT( widget( ) ) ) return false ;
switch ( e - > type ( ) ) {
case QEvent: : MouseButtonDblClick :
mouseDoubleClickEvent ( static_cast < QMouseEvent * > ( e ) ) ;
case T QEvent: : MouseButtonDblClick :
mouseDoubleClickEvent ( TQT_TQMOUSEEVENT ( e ) ) ;
return true ;
case QEvent: : MouseButtonPress :
processMousePressEvent ( static_cast < QMouseEvent * > ( e ) ) ;
case T QEvent: : MouseButtonPress :
processMousePressEvent ( TQT_TQMOUSEEVENT ( e ) ) ;
return true ;
case QEvent: : Paint :
paintEvent ( static_cast < QPaintEvent * > ( e ) ) ;
case T QEvent: : Paint :
paintEvent ( TQT_TQPAINTEVENT ( e ) ) ;
return true ;
case QEvent: : Wheel :
mouseWheelEvent ( static_cast < QWheelEvent * > ( e ) ) ;
case T QEvent: : Wheel :
mouseWheelEvent ( TQT_TQWHEELEVENT ( e ) ) ;
return true ;
case QEvent: : Resize :
resizeEvent ( static_cast < QResizeEvent * > ( e ) ) ;
case T QEvent: : Resize :
resizeEvent ( TQT_TQRESIZEEVENT ( e ) ) ;
return true ;
case QEvent: : Show :
showEvent ( static_cast < QShowEvent * > ( e ) ) ;
case T QEvent: : Show :
showEvent ( TQT_TQSHOWEVENT ( e ) ) ;
return true ;
case QEvent: : Move :
moveEvent ( static_cast < QMoveEvent * > ( e ) ) ;
case T QEvent: : Move :
moveEvent ( TQT_TQMOVEEVENT ( e ) ) ;
return true ;
default : return false ;
}
@ -1147,53 +1147,53 @@ bool CrystalClient::eventFilter(QObject *obj, QEvent *e)
void CrystalClient : : ClientWindows ( Window * v_frame , Window * v_wrapper , Window * v_client )
{
Window root = 0 , frame = 0 , wrapper = 0 , client = 0 , parent= 0 , * children= NULL ;
Window root = 0 , frame = 0 , wrapper = 0 , client = 0 , tq parent= 0 , * tq children= NULL ;
uint numc ;
if ( v_frame ) * v_frame = 0 ;
if ( v_wrapper ) * v_wrapper = 0 ;
if ( v_client ) * v_client = 0 ;
// Our Deco is the child of a frame, get our parent
if ( XQueryTree ( qt_xdisplay ( ) , widget ( ) - > winId ( ) , & root , & frame , & children, & numc ) = = 0 )
// Our Deco is the child of a frame, get our tq parent
if ( XQueryTree ( qt_xdisplay ( ) , widget ( ) - > winId ( ) , & root , & frame , & tq children, & numc ) = = 0 )
return ;
if ( children! = NULL ) XFree ( children) ;
children= NULL ;
if ( tq children! = NULL ) XFree ( tq children) ;
tq children= NULL ;
// frame has two children, us and a wrapper, get the wrapper
if ( XQueryTree ( qt_xdisplay ( ) , frame , & root , & parent, & children, & numc ) = = 0 )
// frame has two tq children, us and a wrapper, get the wrapper
if ( XQueryTree ( qt_xdisplay ( ) , frame , & root , & tq parent, & tq children, & numc ) = = 0 )
return ;
for ( uint i = 0 ; i < numc ; i + + )
{
if ( children[ i ] ! = widget ( ) - > winId ( ) ) wrapper = children[ i ] ;
if ( tq children[ i ] ! = widget ( ) - > winId ( ) ) wrapper = tq children[ i ] ;
}
if ( children! = NULL ) XFree ( children) ;
children= NULL ;
if ( tq children! = NULL ) XFree ( tq children) ;
tq children= NULL ;
// wrapper has only one child, which is the client. We want this!!
if ( XQueryTree ( qt_xdisplay ( ) , wrapper , & root , & parent, & children, & numc ) = = 0 )
if ( XQueryTree ( qt_xdisplay ( ) , wrapper , & root , & tq parent, & tq children, & numc ) = = 0 )
return ;
if ( numc = = 1 ) client = children[ 0 ] ;
if ( children! = NULL ) XFree ( children) ;
children= NULL ;
if ( numc = = 1 ) client = tq children[ 0 ] ;
if ( tq children! = NULL ) XFree ( tq children) ;
tq children= NULL ;
if ( v_client ) * v_client = client ;
if ( v_wrapper ) * v_wrapper = wrapper ;
if ( v_frame ) * v_frame = frame ;
}
void CrystalClient : : mouseDoubleClickEvent ( QMouseEvent * e )
void CrystalClient : : mouseDoubleClickEvent ( T QMouseEvent * e )
{
if ( /*(titlebar_-> geometry().contains(e->pos()))&&*/( e - > button ( ) = = LeftButton ) ) titlebarDblClickOperation ( ) ;
if ( /*(titlebar_-> tq geometry().tq contains(e->pos()))&&*/( e - > button ( ) = = Qt : : LeftButton ) ) titlebarDblClickOperation ( ) ;
else {
QMouseEvent me ( QEvent: : MouseButtonPress , e - > pos ( ) , e - > button ( ) , e - > state ( ) ) ;
T QMouseEvent me ( T QEvent: : MouseButtonPress , e - > pos ( ) , e - > button ( ) , e - > state ( ) ) ;
processMousePressEvent ( & me ) ;
}
}
void CrystalClient : : mouseWheelEvent ( QWheelEvent * e )
void CrystalClient : : mouseWheelEvent ( T QWheelEvent * e )
{
if ( : : factory - > wheelTask )
{
QPtrList < CrystalClient > * l = & ( : : factory - > clients ) ;
T QPtrList < CrystalClient > * l = & ( : : factory - > clients ) ;
if ( l - > current ( ) = = NULL ) for ( unsigned int i = 0 ; i < l - > count ( ) ; i + + ) if ( ( l - > at ( i ) ) - > isActive ( ) ) break ;
@ -1229,34 +1229,34 @@ void CrystalClient::mouseWheelEvent(QWheelEvent *e)
}
}
void CrystalClient : : paintEvent ( QPaintEvent* )
void CrystalClient : : paintEvent ( T QPaintEvent* )
{
if ( ! CrystalFactory : : initialized ( ) ) return ;
QColorGroup group ;
QPainter painter ( widget ( ) ) ;
T QColorGroup group ;
T QPainter painter ( widget ( ) ) ;
// draw the titlebar
group = options ( ) - > colorGroup( KDecoration : : ColorTitleBar , isActive ( ) ) ;
group = options ( ) - > tq colorGroup( KDecoration : : ColorTitleBar , isActive ( ) ) ;
WND_CONFIG * wndcfg = ( isActive ( ) ? & : : factory - > active : & : : factory - > inactive ) ;
if ( : : factory - > transparency & & : : factory - > trackdesktop )
: : factory - > image_holder - > repaint( false ) ; // If other desktop than the last, regrab the root image
QPixmap * background = : : factory - > transparency ? : : factory - > image_holder - > image ( isActive ( ) ) : NULL ;
: : factory - > image_holder - > tq repaint( false ) ; // If other desktop than the last, regrab the root image
T QPixmap * background = : : factory - > transparency ? : : factory - > image_holder - > image ( isActive ( ) ) : NULL ;
int drawFrame ;
{
QRect r ;
QPoint p = widget ( ) - > mapToGlobal ( QPoint( 0 , 0 ) ) ;
T QRect r ;
T QPoint p = widget ( ) - > mapToGlobal ( T QPoint( 0 , 0 ) ) ;
int bl , br , bt , bb ;
borders ( bl , br , bt , bb ) ;
QPixmap pufferPixmap ;
T QPixmap pufferPixmap ;
pufferPixmap . resize ( widget ( ) - > width ( ) , bt ) ;
QPainter pufferPainter ( & pufferPixmap ) ;
T QPainter pufferPainter ( & pufferPixmap ) ;
r = QRect( p . x ( ) , p . y ( ) , widget ( ) - > width ( ) , bt ) ;
if ( background & & ! background - > isNull ( ) ) pufferPainter . drawPixmap ( QPoint( 0 , 0 ) , * background , r ) ;
r = T QRect( p . x ( ) , p . y ( ) , widget ( ) - > width ( ) , bt ) ;
if ( background & & ! background - > isNull ( ) ) pufferPainter . drawPixmap ( T QPoint( 0 , 0 ) , * background , r ) ;
else
{
pufferPainter . fillRect ( widget ( ) - > rect ( ) , group . background ( ) ) ;
@ -1271,8 +1271,8 @@ void CrystalClient::paintEvent(QPaintEvent*)
// draw title text
pufferPainter . setFont ( options ( ) - > font ( isActive ( ) , false ) ) ;
QColor color = options ( ) - > color ( KDecoration : : ColorFont , isActive ( ) ) ;
r = titlebar_ - > geometry( ) ;
T QColor color = options ( ) - > color ( KDecoration : : ColorFont , isActive ( ) ) ;
r = titlebar_ - > tq geometry( ) ;
r . moveBy ( 0 , - 1 ) ;
int logowidth = : : factory - > logo . width ( ) + : : factory - > logoDistance ;
if ( : : factory - > logoEnabled ! = 1 & & ( isActive ( ) | | ! : : factory - > logoActive ) )
@ -1280,7 +1280,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
r . setWidth ( r . width ( ) - logowidth ) ;
if ( : : factory - > logoEnabled = = 0 ) r . moveLeft ( r . left ( ) + logowidth ) ;
}
QFontMetrics metrics ( options ( ) - > font ( isActive ( ) , false ) ) ;
T QFontMetrics metrics ( options ( ) - > font ( isActive ( ) , false ) ) ;
int textwidth = metrics . width ( caption ( ) ) ;
int textalign = CrystalFactory : : titleAlign ( ) ;
if ( textwidth > r . width ( ) )
@ -1313,7 +1313,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
}
} else if ( : : factory - > logoEnabled ! = 1 & & ( isActive ( ) | | ! : : factory - > logoActive ) ) {
int x = 0 ;
r = titlebar_ - > geometry( ) ;
r = titlebar_ - > tq geometry( ) ;
if ( : : factory - > logoEnabled = = 0 ) x = r . left ( ) ;
if ( : : factory - > logoEnabled = = 2 ) x = r . right ( ) - : : factory - > logo . width ( ) ;
pufferPainter . drawPixmap ( x , ( : : factory - > titlesize - : : factory - > logo . height ( ) ) / 2 , : : factory - > logo ) ;
@ -1332,24 +1332,24 @@ void CrystalClient::paintEvent(QPaintEvent*)
if ( background & & ! background - > isNull ( ) )
{ // Draw the side and bottom of the window with transparency
// Left
r = QRect( p . x ( ) + drawFrame , p . y ( ) + bt , bl - drawFrame , widget ( ) - > height ( ) - bt - drawFrame ) ;
painter . drawPixmap ( QPoint( drawFrame , bt ) , * background , r ) ;
r = T QRect( p . x ( ) + drawFrame , p . y ( ) + bt , bl - drawFrame , widget ( ) - > height ( ) - bt - drawFrame ) ;
painter . drawPixmap ( T QPoint( drawFrame , bt ) , * background , r ) ;
// Right
r = QRect( widget ( ) - > width ( ) - br + p . x ( ) , p . y ( ) + bt , br - drawFrame , widget ( ) - > height ( ) - bt - drawFrame ) ;
painter . drawPixmap ( QPoint( widget ( ) - > width ( ) - br , bt ) , * background , r ) ;
r = T QRect( widget ( ) - > width ( ) - br + p . x ( ) , p . y ( ) + bt , br - drawFrame , widget ( ) - > height ( ) - bt - drawFrame ) ;
painter . drawPixmap ( T QPoint( widget ( ) - > width ( ) - br , bt ) , * background , r ) ;
// Bottom
r = QRect( p . x ( ) + bl , p . y ( ) + widget ( ) - > height ( ) - bb , widget ( ) - > width ( ) - bl - br , bb - drawFrame ) ;
painter . drawPixmap ( QPoint( bl , widget ( ) - > height ( ) - bb ) , * background , r ) ;
r = T QRect( p . x ( ) + bl , p . y ( ) + widget ( ) - > height ( ) - bb , widget ( ) - > width ( ) - bl - br , bb - drawFrame ) ;
painter . drawPixmap ( T QPoint( bl , widget ( ) - > height ( ) - bb ) , * background , r ) ;
} else {
r = QRect( drawFrame , bt , bl - drawFrame , widget ( ) - > height ( ) - bt - drawFrame ) ;
r = T QRect( drawFrame , bt , bl - drawFrame , widget ( ) - > height ( ) - bt - drawFrame ) ;
painter . fillRect ( r , group . background ( ) ) ;
r = QRect( widget ( ) - > width ( ) - br , bt , br - drawFrame , widget ( ) - > height ( ) - bt - drawFrame ) ;
r = T QRect( widget ( ) - > width ( ) - br , bt , br - drawFrame , widget ( ) - > height ( ) - bt - drawFrame ) ;
painter . fillRect ( r , group . background ( ) ) ;
r = QRect( bl , widget ( ) - > height ( ) - bb , widget ( ) - > width ( ) - bl - br , bb - drawFrame ) ;
r = T QRect( bl , widget ( ) - > height ( ) - bb , widget ( ) - > width ( ) - bl - br , bb - drawFrame ) ;
painter . fillRect ( r , group . background ( ) ) ;
}
}
@ -1383,14 +1383,14 @@ void CrystalClient::paintEvent(QPaintEvent*)
// And notify image_holder that we need an update asap
if ( : : factory ) if ( : : factory - > image_holder )
// UnInit image_holder, on next Repaint it will be Init'ed again.
QTimer: : singleShot ( 500 , : : factory - > image_holder , SLOT( CheckSanity ( ) ) ) ;
T QTimer: : singleShot ( 500 , : : factory - > image_holder , TQT_ SLOT( CheckSanity ( ) ) ) ;
}
if ( drawFrame )
{
// outline the frame
QRect r = widget ( ) - > rect ( ) ;
QColor c1 , c2 ;
T QRect r = widget ( ) - > rect ( ) ;
T QColor c1 , c2 ;
c1 = c2 = wndcfg - > frameColor ;
if ( wndcfg - > outlineMode = = 2 ) c1 = c1 . dark ( 140 ) , c2 = c2 . light ( 140 ) ;
if ( wndcfg - > outlineMode = = 3 ) c1 = c1 . light ( 140 ) , c2 = c2 . dark ( 140 ) ;
@ -1409,7 +1409,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
int r = ( width ( ) ) ;
int b = ( height ( ) ) ;
// Draw edge of top-left corner inside the area removed by the mask.
// Draw edge of top-left corner inside the area removed by the tq mask.
if ( cornersFlag & TOP_LEFT ) {
painter . setPen ( c1 ) ;
painter . drawPoint ( 3 , 1 ) ;
@ -1419,7 +1419,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
painter . drawPoint ( 1 , 4 ) ;
}
// Draw edge of top-right corner inside the area removed by the mask.
// Draw edge of top-right corner inside the area removed by the tq mask.
if ( cornersFlag & TOP_RIGHT ) {
painter . setPen ( c1 ) ;
painter . drawPoint ( r - 5 , 1 ) ;
@ -1429,7 +1429,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
painter . drawPoint ( r - 2 , 4 ) ;
}
// Draw edge of bottom-left corner inside the area removed by the mask.
// Draw edge of bottom-left corner inside the area removed by the tq mask.
if ( cornersFlag & BOT_LEFT ) {
painter . setPen ( c2 ) ;
painter . drawPoint ( 1 , b - 5 ) ;
@ -1439,7 +1439,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
painter . drawPoint ( 4 , b - 2 ) ;
}
// Draw edge of bottom-right corner inside the area removed by the mask.
// Draw edge of bottom-right corner inside the area removed by the tq mask.
if ( cornersFlag & BOT_RIGHT ) {
painter . setPen ( c2 ) ;
painter . drawPoint ( r - 2 , b - 5 ) ;
@ -1452,23 +1452,23 @@ void CrystalClient::paintEvent(QPaintEvent*)
}
}
void CrystalClient : : resizeEvent ( QResizeEvent * e )
void CrystalClient : : resizeEvent ( T QResizeEvent * e )
{
if ( widget ( ) - > isShown ( ) )
{
if ( ! : : factory - > transparency ) ;
else if ( : : factory - > repaintMode= = 1 )
else if ( : : factory - > tq repaintMode= = 1 )
{
if ( ! timer . isActive ( ) ) timer . start ( 0 , true ) ;
// Repaint();
}
// repaint only every xxx ms
else if ( : : factory - > repaintMode= = 3 | | ! timer . isActive ( ) )
// tq repaint only every xxx ms
else if ( : : factory - > tq repaintMode= = 3 | | ! timer . isActive ( ) )
{
// Repaint only, when mode!=fade || amount<100
WND_CONFIG * wnd = isActive ( ) ? & : : factory - > active : & : : factory - > inactive ;
if ( wnd - > mode ! = 0 | | wnd - > amount < 100 )
timer . start ( : : factory - > repaintTime, true ) ;
timer . start ( : : factory - > tq repaintTime, true ) ;
}
}
if ( e - > size ( ) ! = e - > oldSize ( ) )
@ -1477,27 +1477,27 @@ void CrystalClient::resizeEvent(QResizeEvent *e)
}
}
void CrystalClient : : moveEvent ( QMoveEvent * )
void CrystalClient : : moveEvent ( T QMoveEvent * )
{
if ( widget ( ) - > isShown ( ) )
{
if ( ! : : factory - > transparency ) return ;
else if ( : : factory - > repaintMode= = 1 )
else if ( : : factory - > tq repaintMode= = 1 )
{
Repaint ( ) ;
}
// repaint every xxx ms, so constant moving does not take too much CPU
else if ( : : factory - > repaintMode= = 3 | | ! timer . isActive ( ) )
// tq repaint every xxx ms, so constant moving does not take too much CPU
else if ( : : factory - > tq repaintMode= = 3 | | ! timer . isActive ( ) )
{
// Repaint only, when mode!=fade || value<100, because otherwise it is a plain color
WND_CONFIG * wnd = isActive ( ) ? & : : factory - > active : & : : factory - > inactive ;
if ( wnd - > mode ! = 0 | | wnd - > amount < 100 )
timer . start ( : : factory - > repaintTime, true ) ;
timer . start ( : : factory - > tq repaintTime, true ) ;
}
}
}
void CrystalClient : : showEvent ( QShowEvent * )
void CrystalClient : : showEvent ( T QShowEvent * )
{
if ( widget ( ) - > isShown ( ) )
Repaint ( ) ;
@ -1505,7 +1505,7 @@ void CrystalClient::showEvent(QShowEvent *)
void CrystalClient : : Repaint ( )
{
widget ( ) - > repaint( false ) ;
widget ( ) - > tq repaint( false ) ;
for ( int n = 0 ; n < ButtonTypeCount ; n + + )
if ( button [ n ] ) button [ n ] - > reset ( ) ;
}
@ -1516,10 +1516,10 @@ void CrystalClient::maxButtonPressed()
{
switch ( button [ ButtonMax ] - > lastMousePress ( ) )
{
case MidButton :
case Qt : : MidButton :
maximize ( maximizeMode ( ) ^ MaximizeVertical ) ;
break ;
case RightButton :
case Qt : : RightButton :
maximize ( maximizeMode ( ) ^ MaximizeHorizontal ) ;
break ;
default :
@ -1532,11 +1532,11 @@ void CrystalClient::minButtonPressed()
{
if ( button [ ButtonMin ] ) {
switch ( button [ ButtonMin ] - > lastMousePress ( ) ) {
case MidButton : {
case Qt : : MidButton : {
performWindowOperation ( LowerOp ) ;
break ;
}
case RightButton :
case Qt : : RightButton :
if ( isShadeable ( ) ) setShade ( ! isShade ( ) ) ;
break ;
default :
@ -1575,7 +1575,7 @@ void CrystalClient::closeButtonPressed()
{
if ( button [ ButtonClose ] )
switch ( button [ ButtonClose ] - > lastMousePress ( ) ) {
case RightButton :
case Qt : : RightButton :
{
Window frame , wrapper , client ;
char param [ 20 ] ;
@ -1600,8 +1600,8 @@ void CrystalClient::shadeButtonPressed()
{
if ( button [ ButtonShade ] ) {
switch ( button [ ButtonShade ] - > lastMousePress ( ) ) {
case MidButton :
case RightButton :
case Qt : : MidButton :
case Qt : : RightButton :
break ;
default :
if ( isShadeable ( ) ) setShade ( ! isShade ( ) ) ;
@ -1613,11 +1613,11 @@ void CrystalClient::menuButtonPressed()
{
if ( ! button [ ButtonMenu ] ) return ;
static QTime* t = 0 ;
static T QTime* t = 0 ;
static CrystalClient * lastClient = 0 ;
if ( t = = 0 )
t = new QTime;
bool dbl = ( lastClient = = this & & t - > elapsed ( ) < = QApplication: : doubleClickInterval ( ) ) ;
t = new T QTime;
bool dbl = ( lastClient = = this & & t - > elapsed ( ) < = T QApplication: : doubleClickInterval ( ) ) ;
lastClient = this ;
t - > start ( ) ;
@ -1632,7 +1632,7 @@ void CrystalClient::menuButtonPressed()
void CrystalClient : : menuPopUp ( )
{
QPoint p ( button [ ButtonMenu ] - > rect ( ) . bottomLeft ( ) . x ( ) ,
T QPoint p ( button [ ButtonMenu ] - > rect ( ) . bottomLeft ( ) . x ( ) ,
button [ ButtonMenu ] - > rect ( ) . bottomLeft ( ) . y ( ) + 2 ) ;
KDecorationFactory * f = factory ( ) ;
showWindowMenu ( button [ ButtonMenu ] - > mapToGlobal ( p ) ) ;