Do not introduce such generic indentifiers like None or Styled

into KWin's global namespace. Morever None already kind of clashes with X's None.
CCMAIL: kde@martin-graesslin.com


svn path=/trunk/KDE/kdebase/workspace/; revision=1170588
This commit is contained in:
Luboš Luňák 2010-09-01 14:15:06 +00:00
parent daec4364bd
commit d467d26530
10 changed files with 27 additions and 27 deletions

View file

@ -1664,7 +1664,7 @@ EffectFrameImpl::EffectFrameImpl( EffectFrameStyle style, bool staticSize, QPoin
, m_alignment( alignment )
, m_shader( NULL )
{
if( m_style == Styled )
if( m_style == EffectFrameStyled )
{
m_frame.setImagePath( "widgets/background" );
m_frame.setCacheAllRenderedFrames( true );
@ -1743,7 +1743,7 @@ void EffectFrameImpl::setGeometry( const QRect& geometry, bool force )
return;
}
if( m_style == Styled )
if( m_style == EffectFrameStyled )
{
qreal left, top, right, bottom;
m_frame.getMargins( left, top, right, bottom ); // m_geometry is the inner geometry

View file

@ -41,7 +41,7 @@ KWIN_EFFECT( boxswitch, BoxSwitchEffect )
BoxSwitchEffect::BoxSwitchEffect()
: mActivated( 0 )
, mMode( 0 )
, thumbnailFrame( effects->effectFrame( Styled ) )
, thumbnailFrame( effects->effectFrame( EffectFrameStyled ) )
, selected_window( 0 )
, painting_desktop( 0 )
, animation( false )
@ -698,7 +698,7 @@ void BoxSwitchEffect::calculateItemSizes()
EffectWindow* w = ordered_windows.at( i );
windows[ w ] = new ItemInfo();
windows[ w ]->iconFrame = effects->effectFrame( Unstyled, false );
windows[ w ]->iconFrame = effects->effectFrame( EffectFrameUnstyled, false );
windows[ w ]->iconFrame->setAlignment( Qt::AlignTop | Qt::AlignLeft );
windows[ w ]->iconFrame->setIcon( w->icon() );
@ -736,7 +736,7 @@ void BoxSwitchEffect::calculateItemSizes()
EffectWindow* w = original_windows.at( i );
windows[ w ] = new ItemInfo();
windows[ w ]->iconFrame = effects->effectFrame( Unstyled, false );
windows[ w ]->iconFrame = effects->effectFrame( EffectFrameUnstyled, false );
windows[ w ]->iconFrame->setAlignment( Qt::AlignTop | Qt::AlignLeft );
windows[ w ]->iconFrame->setIcon( w->icon() );

View file

@ -53,7 +53,7 @@ CoverSwitchEffect::CoverSwitchEffect()
, scaleFactor( 0.0 )
, direction( Left )
, selected_window( 0 )
, captionFrame( effects->effectFrame( Styled ) )
, captionFrame( effects->effectFrame( EffectFrameStyled ) )
, primaryTabBox( false )
, secondaryTabBox( false )
{

View file

@ -56,7 +56,7 @@ CubeEffect::CubeEffect()
, cubeOpacity( 1.0 )
, opacityDesktopOnly( true )
, displayDesktopName( false )
, desktopNameFrame( effects->effectFrame( Styled ) )
, desktopNameFrame( effects->effectFrame( EffectFrameStyled ) )
, reflection( true )
, rotating( false )
, desktopChangedWhileRotating( false )

View file

@ -1192,7 +1192,7 @@ void DesktopGridEffect::setup()
font.setPointSize( 12 );
for( int i = 0; i < effects->numberOfDesktops(); i++ )
{
EffectFrame* frame = effects->effectFrame( Unstyled, false );
EffectFrame* frame = effects->effectFrame( EffectFrameUnstyled, false );
frame->setFont( font );
frame->setText( effects->desktopName( i+1 ));
frame->setAlignment( desktopNameAlignment );
@ -1437,7 +1437,7 @@ void DesktopGridEffect::desktopsAdded( int old )
font.setPointSize( 12 );
for( int i = old; i < desktop; i++ )
{
EffectFrame* frame = effects->effectFrame( Unstyled, false );
EffectFrame* frame = effects->effectFrame( EffectFrameUnstyled, false );
frame->setFont( font );
frame->setText( effects->desktopName( i+1 ));
frame->setAlignment( desktopNameAlignment );

View file

@ -44,7 +44,7 @@ FlipSwitchEffect::FlipSwitchEffect()
, m_stop( false )
, m_animation( false )
, m_hasKeyboardGrab( false )
, m_captionFrame( effects->effectFrame( Styled ) )
, m_captionFrame( effects->effectFrame( EffectFrameStyled ) )
{
reconfigure( ReconfigureAll );

View file

@ -53,7 +53,7 @@ PresentWindowsEffect::PresentWindowsEffect()
, m_mode( ModeCurrentDesktop )
, m_managerWindow( NULL )
, m_highlightedWindow( NULL )
, m_filterFrame( effects->effectFrame( Styled, false ) )
, m_filterFrame( effects->effectFrame( EffectFrameStyled, false ) )
{
m_atomDesktop = XInternAtom( display(), "_KDE_PRESENT_WINDOWS_DESKTOP", False );
m_atomWindows = XInternAtom( display(), "_KDE_PRESENT_WINDOWS_GROUP", False );
@ -377,12 +377,12 @@ void PresentWindowsEffect::windowAdded( EffectWindow *w )
m_windowData[w].visible = isVisibleWindow( w );
m_windowData[w].opacity = 0.0;
m_windowData[w].highlight = 0.0;
m_windowData[w].textFrame = effects->effectFrame( Unstyled, false );
m_windowData[w].textFrame = effects->effectFrame( EffectFrameUnstyled, false );
QFont font;
font.setBold( true );
font.setPointSize( 12 );
m_windowData[w].textFrame->setFont( font );
m_windowData[w].iconFrame = effects->effectFrame( Unstyled, false );
m_windowData[w].iconFrame = effects->effectFrame( EffectFrameUnstyled, false );
m_windowData[w].iconFrame->setAlignment( Qt::AlignRight | Qt::AlignBottom );
m_windowData[w].iconFrame->setIcon( w->icon() );
if( isSelectableWindow( w ))
@ -1550,12 +1550,12 @@ void PresentWindowsEffect::setActive( bool active, bool closingTab )
if( w->isOnCurrentDesktop() && !w->isMinimized() )
m_windowData[w].opacity = 1.0;
m_windowData[w].highlight = 1.0;
m_windowData[w].textFrame = effects->effectFrame( Unstyled, false );
m_windowData[w].textFrame = effects->effectFrame( EffectFrameUnstyled, false );
QFont font;
font.setBold( true );
font.setPointSize( 12 );
m_windowData[w].textFrame->setFont( font );
m_windowData[w].iconFrame = effects->effectFrame( Unstyled, false );
m_windowData[w].iconFrame = effects->effectFrame( EffectFrameUnstyled, false );
m_windowData[w].iconFrame->setAlignment( Qt::AlignRight | Qt::AlignBottom );
m_windowData[w].iconFrame->setIcon( w->icon() );
}

View file

@ -205,9 +205,9 @@ enum DataRole
*/
enum EffectFrameStyle
{
None, ///< Displays no frame around the contents.
Unstyled, ///< Displays a basic box around the contents.
Styled ///< Displays a Plasma-styled frame around the contents.
EffectFrameNone, ///< Displays no frame around the contents.
EffectFrameUnstyled, ///< Displays a basic box around the contents.
EffectFrameStyled ///< Displays a Plasma-styled frame around the contents.
};
/**

View file

@ -1926,7 +1926,7 @@ SceneOpenGL::EffectFrame::EffectFrame( EffectFrameImpl* frame )
, m_selectionTexture( NULL )
, m_unstyledVBO( NULL )
{
if( m_effectFrame->style() == Unstyled && !m_unstyledTexture )
if( m_effectFrame->style() == EffectFrameUnstyled && !m_unstyledTexture )
{
updateUnstyledTexture();
}
@ -2020,7 +2020,7 @@ void SceneOpenGL::EffectFrame::render( QRegion region, double opacity, double fr
glPushMatrix();
// Render the actual frame
if( m_effectFrame->style() == Unstyled )
if( m_effectFrame->style() == EffectFrameUnstyled )
{
if( !m_unstyledVBO )
{
@ -2135,7 +2135,7 @@ void SceneOpenGL::EffectFrame::render( QRegion region, double opacity, double fr
m_unstyledVBO->render( region, GL_TRIANGLES );
m_unstyledTexture->unbind();
}
else if( m_effectFrame->style() == Styled )
else if( m_effectFrame->style() == EffectFrameStyled )
{
if( !m_texture ) // Lazy creation
updateTexture();
@ -2248,7 +2248,7 @@ void SceneOpenGL::EffectFrame::render( QRegion region, double opacity, double fr
void SceneOpenGL::EffectFrame::updateTexture()
{
delete m_texture;
if( m_effectFrame->style() == Styled )
if( m_effectFrame->style() == EffectFrameStyled )
{
QPixmap pixmap = m_effectFrame->frame().framePixmap();
m_texture = new Texture( pixmap.handle(), pixmap.size(), pixmap.depth() );
@ -2279,7 +2279,7 @@ void SceneOpenGL::EffectFrame::updateTextTexture()
image.fill( Qt::transparent );
QPainter p( &image );
p.setFont( m_effectFrame->font() );
if( m_effectFrame->style() == Styled )
if( m_effectFrame->style() == EffectFrameStyled )
p.setPen( m_effectFrame->styledTextColor() );
else // TODO: What about no frame? Custom color setting required
p.setPen( Qt::white );

View file

@ -914,10 +914,10 @@ void SceneXrender::EffectFrame::render( QRegion region, double opacity, double f
}
// Render the actual frame
if( m_effectFrame->style() == Unstyled )
if( m_effectFrame->style() == EffectFrameUnstyled )
xRenderRoundBox( effects->xrenderBufferPicture(), m_effectFrame->geometry().adjusted( -5, -5, 5, 5 ),
5, QColor( 0, 0, 0, int( opacity * frameOpacity * 255 )));
else if( m_effectFrame->style() == Styled )
else if( m_effectFrame->style() == EffectFrameStyled )
{
if( !m_picture ) // Lazy creation
{
@ -971,7 +971,7 @@ void SceneXrender::EffectFrame::render( QRegion region, double opacity, double f
void SceneXrender::EffectFrame::updatePicture()
{
delete m_picture;
if( m_effectFrame->style() == Styled )
if( m_effectFrame->style() == EffectFrameStyled )
m_picture = new XRenderPicture( m_effectFrame->frame().framePixmap() );
}
@ -1003,7 +1003,7 @@ void SceneXrender::EffectFrame::updateTextPicture()
pixmap.fill( Qt::transparent );
QPainter p( &pixmap );
p.setFont( m_effectFrame->font() );
if( m_effectFrame->style() == Styled )
if( m_effectFrame->style() == EffectFrameStyled )
{
p.setPen( m_effectFrame->styledTextColor() );
}