QMap -> QHash
svn path=/branches/work/kwin_composite/; revision=642532
This commit is contained in:
parent
5d4178c40c
commit
d4a58f4152
17 changed files with 59 additions and 84 deletions
|
@ -479,7 +479,7 @@ void EffectsHandler::activateWindow( EffectWindow* c )
|
|||
|
||||
void EffectsHandler::registerEffect( const QString& name, EffectFactory* factory )
|
||||
{
|
||||
QMap<QString, EffectFactory*>::const_iterator factories_iterator = effect_factories.find(name);
|
||||
QHash<QString, EffectFactory*>::const_iterator factories_iterator = effect_factories.find(name);
|
||||
if( factories_iterator != effect_factories.end() )
|
||||
{
|
||||
kDebug( 1212 ) << "EffectsHandler::registerEffect : Effect name already registered : " << name << endl;
|
||||
|
@ -506,7 +506,7 @@ void EffectsHandler::loadEffect( const QString& name )
|
|||
}
|
||||
}
|
||||
|
||||
QMap<QString, EffectFactory*>::const_iterator factories_iterator = effect_factories.find(name);
|
||||
QHash<QString, EffectFactory*>::const_iterator factories_iterator = effect_factories.find(name);
|
||||
if( factories_iterator != effect_factories.end() )
|
||||
{
|
||||
kDebug( 1212 ) << "EffectsHandler::loadEffect : Loading effect : " << name << endl;
|
||||
|
|
|
@ -177,7 +177,7 @@ class EffectsHandler
|
|||
QVector< EffectPair > loaded_effects;
|
||||
typedef QPair< Effect*, Window > InputWindowPair;
|
||||
QList< InputWindowPair > input_windows;
|
||||
QMap< QString, EffectFactory* > effect_factories;
|
||||
QHash< QString, EffectFactory* > effect_factories;
|
||||
int current_paint_screen;
|
||||
int current_paint_window;
|
||||
int current_draw_window;
|
||||
|
|
|
@ -15,7 +15,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
|||
#include <scene_xrender.h>
|
||||
#include <scene_opengl.h>
|
||||
|
||||
#include <QMap>
|
||||
#include <QHash>
|
||||
#include <QPixmap>
|
||||
#include <QRect>
|
||||
#include <QRegion>
|
||||
|
@ -66,8 +66,8 @@ class BoxSwitchEffect
|
|||
QSize item_max_size; // maximum item display size (including highlight)
|
||||
int highlight_margin; // TODO graphical background, highlight
|
||||
|
||||
QMap< int, ItemInfo > desktops;
|
||||
QMap< EffectWindow*, ItemInfo > windows;
|
||||
QHash< int, ItemInfo > desktops;
|
||||
QHash< EffectWindow*, ItemInfo > windows;
|
||||
|
||||
int selected_desktop;
|
||||
ClientList tab_clients;
|
||||
|
|
|
@ -39,7 +39,7 @@ class DialogParentEffect
|
|||
bool hasModalWindow( Toplevel* t );
|
||||
private:
|
||||
// The progress of the fading.
|
||||
QMap<EffectWindow*, float> effectStrength;
|
||||
QHash<EffectWindow*, float> effectStrength;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -32,7 +32,7 @@ class FadeEffect
|
|||
private:
|
||||
int fade_in_speed, fade_out_speed; // TODO make these configurable
|
||||
class WindowInfo;
|
||||
QMap< const EffectWindow*, WindowInfo > windows;
|
||||
QHash< const EffectWindow*, WindowInfo > windows;
|
||||
};
|
||||
|
||||
class FadeEffect::WindowInfo
|
||||
|
|
|
@ -27,7 +27,7 @@ class FallApartEffect
|
|||
virtual void windowClosed( EffectWindow* c );
|
||||
virtual void windowDeleted( EffectWindow* c );
|
||||
private:
|
||||
QMap< const EffectWindow*, double > windows;
|
||||
QHash< const EffectWindow*, double > windows;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -36,7 +36,7 @@ class MinimizeAnimationEffect
|
|||
virtual void windowUnminimized( EffectWindow* c );
|
||||
|
||||
private:
|
||||
QMap< EffectWindow*, float > mAnimationProgress;
|
||||
QHash< EffectWindow*, float > mAnimationProgress;
|
||||
int mActiveAnimations;
|
||||
};
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ void PresentWindowsEffect::windowInputMouseEvent( Window w, QEvent* e )
|
|||
|
||||
// Find out which window (if any) was clicked and activate it
|
||||
QPoint pos = static_cast< QMouseEvent* >( e )->pos();
|
||||
for( QMap<Toplevel*, WindowData>::iterator it = mWindowData.begin();
|
||||
for( QHash<Toplevel*, WindowData>::iterator it = mWindowData.begin();
|
||||
it != mWindowData.end(); ++it )
|
||||
{
|
||||
if( it.value().area.contains(pos) )
|
||||
|
|
|
@ -72,7 +72,7 @@ class PresentWindowsEffect
|
|||
QRect area;
|
||||
float scale;
|
||||
};
|
||||
QMap<Toplevel*, WindowData> mWindowData;
|
||||
QHash<Toplevel*, WindowData> mWindowData;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -28,7 +28,7 @@ class ScaleInEffect
|
|||
virtual void windowAdded( EffectWindow* c );
|
||||
virtual void windowClosed( EffectWindow* c );
|
||||
private:
|
||||
QMap< const EffectWindow*, double > windows;
|
||||
QHash< const EffectWindow*, double > windows;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -72,7 +72,7 @@ void ShakyMoveEffect::windowClosed( EffectWindow* c )
|
|||
// TODO use time provided with prePaintWindow() instead
|
||||
void ShakyMoveEffect::tick()
|
||||
{
|
||||
for( QMap< const EffectWindow*, int >::Iterator it = windows.begin();
|
||||
for( QHash< const EffectWindow*, int >::Iterator it = windows.begin();
|
||||
it != windows.end();
|
||||
++it )
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ class ShakyMoveEffect
|
|||
private slots:
|
||||
void tick();
|
||||
private:
|
||||
QMap< const EffectWindow*, int > windows;
|
||||
QHash< const EffectWindow*, int > windows;
|
||||
QTimer timer;
|
||||
};
|
||||
|
||||
|
|
105
layers.cpp
105
layers.cpp
|
@ -119,8 +119,7 @@ void Workspace::updateStackingOrder( bool propagate_new_clients )
|
|||
if( changed || propagate_new_clients )
|
||||
{
|
||||
propagateClients( propagate_new_clients );
|
||||
if( active_client )
|
||||
active_client->updateMouseGrab();
|
||||
addRepaintFull();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,26 +191,24 @@ void Workspace::propagateClients( bool propagate_new_clients )
|
|||
doesn't accept focus it's excluded.
|
||||
*/
|
||||
// TODO misleading name for this method
|
||||
Client* Workspace::topClientOnDesktop( int desktop, bool unconstrained, bool only_normal ) const
|
||||
Client* Workspace::topClientOnDesktop( int desktop, bool unconstrained ) const
|
||||
{
|
||||
// TODO Q_ASSERT( block_stacking_updates == 0 );
|
||||
ClientList list;
|
||||
if( !unconstrained )
|
||||
list = stacking_order;
|
||||
else
|
||||
list = unconstrained_stacking_order;
|
||||
for( int i = list.size() - 1;
|
||||
i >= 0;
|
||||
--i )
|
||||
{
|
||||
if( list.at( i )->isOnDesktop( desktop ) && list.at( i )->isShown( false ))
|
||||
{
|
||||
if( !only_normal )
|
||||
return list.at( i );
|
||||
if( list.at( i )->wantsTabFocus() && !list.at( i )->isSpecialWindow())
|
||||
return list.at( i );
|
||||
}
|
||||
list = stacking_order;
|
||||
}
|
||||
else
|
||||
{
|
||||
list = unconstrained_stacking_order;
|
||||
}
|
||||
for ( int i = list.size() - 1; i>=0; i-- )
|
||||
{
|
||||
if ( list.at( i )->isOnDesktop( desktop ) && !list.at( i )->isSpecialWindow()
|
||||
&& list.at( i )->isShown( false ) && list.at( i )->wantsTabFocus())
|
||||
return list.at( i );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -401,27 +398,20 @@ void Workspace::restackClientUnderActive( Client* c )
|
|||
return;
|
||||
}
|
||||
|
||||
// put in the stacking order below _all_ windows belonging to the active application
|
||||
assert( unconstrained_stacking_order.contains( active_client ));
|
||||
if( Client::belongToSameApplication( active_client, c ))
|
||||
{ // put it below the active window if it's the same app
|
||||
unconstrained_stacking_order.removeAll( c );
|
||||
unconstrained_stacking_order.insert( unconstrained_stacking_order.find( active_client ), c );
|
||||
}
|
||||
else
|
||||
{ // put in the stacking order below _all_ windows belonging to the active application
|
||||
for( ClientList::Iterator it = unconstrained_stacking_order.begin();
|
||||
it != unconstrained_stacking_order.end();
|
||||
++it )
|
||||
{ // TODO ignore topmenus?
|
||||
if( Client::belongToSameApplication( active_client, *it ))
|
||||
for( ClientList::Iterator it = unconstrained_stacking_order.begin();
|
||||
it != unconstrained_stacking_order.end();
|
||||
++it )
|
||||
{ // TODO ignore topmenus?
|
||||
if( Client::belongToSameApplication( active_client, *it ))
|
||||
{
|
||||
if( *it != c )
|
||||
{
|
||||
if( *it != c )
|
||||
{
|
||||
unconstrained_stacking_order.removeAll( c );
|
||||
unconstrained_stacking_order.insert( it, c );
|
||||
}
|
||||
break;
|
||||
unconstrained_stacking_order.removeAll( c );
|
||||
unconstrained_stacking_order.insert( it, c );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert( unconstrained_stacking_order.contains( c ));
|
||||
|
@ -431,23 +421,16 @@ void Workspace::restackClientUnderActive( Client* c )
|
|||
{ // do for every virtual desktop to handle the case of onalldesktop windows
|
||||
if( c->wantsTabFocus() && c->isOnDesktop( desktop ) && focus_chain[ desktop ].contains( active_client ))
|
||||
{
|
||||
if( Client::belongToSameApplication( active_client, c ))
|
||||
{ // put it after the active window if it's the same app
|
||||
focus_chain[ desktop ].removeAll( c );
|
||||
focus_chain[ desktop ].insert( focus_chain[ desktop ].find( active_client ), c );
|
||||
}
|
||||
else
|
||||
{ // put it in focus_chain[currentDesktop()] after all windows belonging to the active applicationa
|
||||
focus_chain[ desktop ].removeAll( c );
|
||||
for( int i = focus_chain[ desktop ].size() - 1;
|
||||
i >= 0;
|
||||
--i )
|
||||
// also put in focus_chain[currentDesktop()] after all windows belonging to the active applicationa
|
||||
focus_chain[ desktop ].removeAll( c );
|
||||
for ( int i = focus_chain[ desktop ].size() - 1;
|
||||
i >= 0;
|
||||
--i )
|
||||
{
|
||||
if( Client::belongToSameApplication( active_client, focus_chain[ desktop ].at( i ) ))
|
||||
{
|
||||
if( Client::belongToSameApplication( active_client, focus_chain[ desktop ].at( i )))
|
||||
{
|
||||
focus_chain[ desktop ].insert( i, c );
|
||||
break;
|
||||
}
|
||||
focus_chain[ desktop ].insert( i, c );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -455,23 +438,15 @@ void Workspace::restackClientUnderActive( Client* c )
|
|||
// the same for global_focus_chain
|
||||
if( c->wantsTabFocus() && global_focus_chain.contains( active_client ))
|
||||
{
|
||||
if( Client::belongToSameApplication( active_client, c ))
|
||||
global_focus_chain.removeAll( c );
|
||||
for ( int i = global_focus_chain.size() - 1;
|
||||
i >= 0;
|
||||
--i )
|
||||
{
|
||||
global_focus_chain.removeAll( c );
|
||||
global_focus_chain.insert( global_focus_chain.find( active_client ), c );
|
||||
}
|
||||
else
|
||||
{
|
||||
global_focus_chain.removeAll( c );
|
||||
for ( int i = global_focus_chain.size() - 1;
|
||||
i >= 0;
|
||||
--i )
|
||||
if( Client::belongToSameApplication( active_client, global_focus_chain.at( i ) ))
|
||||
{
|
||||
if( Client::belongToSameApplication( active_client, global_focus_chain.at( i ) ))
|
||||
{
|
||||
global_focus_chain.insert( i, c );
|
||||
break;
|
||||
}
|
||||
global_focus_chain.insert( i, c );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ SceneOpenGL::SceneOpenGL( Workspace* ws )
|
|||
|
||||
SceneOpenGL::~SceneOpenGL()
|
||||
{
|
||||
for( QMap< Toplevel*, Window >::Iterator it = windows.begin();
|
||||
for( QHash< Toplevel*, Window >::Iterator it = windows.begin();
|
||||
it != windows.end();
|
||||
++it )
|
||||
(*it).free();
|
||||
|
|
|
@ -79,7 +79,7 @@ class SceneOpenGL
|
|||
static bool supports_npot_textures;
|
||||
static bool supports_fbo;
|
||||
static bool supports_saturation;
|
||||
QMap< Toplevel*, Window > windows;
|
||||
QHash< Toplevel*, Window > windows;
|
||||
#ifdef HAVE_XSHM
|
||||
static XShmSegmentInfo shm;
|
||||
#endif
|
||||
|
|
|
@ -97,7 +97,7 @@ SceneXrender::~SceneXrender()
|
|||
XRenderFreePicture( display(), front );
|
||||
XRenderFreePicture( display(), buffer );
|
||||
wspace->destroyOverlay();
|
||||
for( QMap< Toplevel*, Window >::Iterator it = windows.begin();
|
||||
for( QHash< Toplevel*, Window >::Iterator it = windows.begin();
|
||||
it != windows.end();
|
||||
++it )
|
||||
(*it).free();
|
||||
|
|
|
@ -48,7 +48,7 @@ class SceneXrender
|
|||
static Picture buffer;
|
||||
static ScreenPaintData screen_paint;
|
||||
class Window;
|
||||
QMap< Toplevel*, Window > windows;
|
||||
QHash< Toplevel*, Window > windows;
|
||||
};
|
||||
|
||||
class SceneXrender::Window
|
||||
|
|
Loading…
Reference in a new issue