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
remotes/origin/Plasma/5.0
Nikhil Marathe 16 years ago
parent 60cd673a56
commit c4206d4195
  1. 4
      tiling.cpp
  2. 28
      tilinglayoutfactory.cpp
  3. 12
      tilinglayoutfactory.h

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

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

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

Loading…
Cancel
Save