Renamed all layouts to <name>Layout rather than just <name>L, First and Last follow the same convention

svn path=/trunk/KDE/kdebase/workspace/; revision=1123124
This commit is contained in:
Nikhil Marathe 2010-05-05 11:43:26 +00:00
parent 60cd673a56
commit c4206d4195
3 changed files with 22 additions and 22 deletions

View file

@ -98,7 +98,7 @@ void Workspace::createTile( Client *c )
if( !tilingLayouts.value(c->desktop()) )
{
tilingLayouts[c->desktop()] = TilingLayoutFactory::createLayout( TilingLayoutFactory::DefaultL, this );
tilingLayouts[c->desktop()] = TilingLayoutFactory::createLayout( TilingLayoutFactory::DefaultLayout, this );
}
tilingLayouts[c->desktop()]->addTile( t );
tilingLayouts[c->desktop()]->commit();
@ -224,7 +224,7 @@ void Workspace::notifyWindowDesktopChanged( Client *c, int old_desktop )
// TODO: copied from createTile(), move this into separate method?
if( !tilingLayouts.value( c->desktop() ) )
{
tilingLayouts[c->desktop()] = TilingLayoutFactory::createLayout( TilingLayoutFactory::DefaultL, this );
tilingLayouts[c->desktop()] = TilingLayoutFactory::createLayout( TilingLayoutFactory::DefaultLayout, this );
}
if( t )

View file

@ -35,10 +35,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// w is the workspace pointer
#define ADD_LAYOUT( lay ) \
case lay##L:\
case lay##Layout:\
kDebug(1212) << #lay;\
layout = new lay( w );\
layout->setLayoutType( lay##L );\
layout->setLayoutType( lay##Layout );\
Notify::raise( Notify::TilingLayoutChanged, \
i18n( "Layout changed to %1", i18n(#lay) ) ); \
break
@ -48,13 +48,13 @@ namespace KWin
TilingLayout* TilingLayoutFactory::createLayout( int type, Workspace *w )
{
Q_ASSERT( type != First && type != Last );
Q_ASSERT( type != FirstLayout && type != LastLayout );
TilingLayout *layout;
/* For new layouts, make a case entry here */
switch( type )
{
case DefaultL: // NOTE: fall through makes first layout default
case DefaultLayout: // NOTE: fall through makes first layout default
layout = createLayout( indexToLayoutIndex( options->tilingLayout ), w );
break;
@ -78,18 +78,18 @@ TilingLayout* TilingLayoutFactory::cycleLayout( TilingLayout *curr, bool next )
{
type++;
if( type >= Last )
type = First + 1;
if( type >= LastLayout )
type = FirstLayout + 1;
}
else
{
type--;
if( type <= First )
type = Last - 1;
if( type <= FirstLayout )
type = LastLayout - 1;
}
QList<Tile *> tiles = curr->tiles(); //root->flatten();
QList<Tile *> tiles = curr->tiles();
TilingLayout *l = createLayout( type, curr->workspace() );
@ -115,11 +115,11 @@ TilingLayout* TilingLayoutFactory::cycleLayout( TilingLayout *curr, bool next )
*/
int TilingLayoutFactory::indexToLayoutIndex( int index )
{
int layout = DefaultL + index + 1;
if( layout >= Last )
layout = DefaultL + 1;
if( layout <= First )
layout = Last - 1;
int layout = DefaultLayout + index + 1;
if( layout >= LastLayout )
layout = DefaultLayout + 1;
if( layout <= FirstLayout )
layout = LastLayout - 1;
return layout;
}
} // end namespace

View file

@ -34,16 +34,16 @@ class TilingLayoutFactory
* Remember to suffix an L for now
*/
enum Layouts {
First, // special, do not modify/move
DefaultL,
FirstLayout, // special, do not modify/move
DefaultLayout,
/* Actual layouts */
SpiralL,
ColumnsL,
FloatingL,
SpiralLayout,
ColumnsLayout,
FloatingLayout,
/* Put your layout above this line ^^^ */
Last // special, do not modify/move
LastLayout // special, do not modify/move
};
static TilingLayout* createLayout( int type, Workspace * );