SVN_SILENT Standardize coding style on client.* and workspace.*

svn path=/trunk/KDE/kdebase/workspace/; revision=898612
This commit is contained in:
Lucas Murray 2008-12-18 13:50:57 +00:00
parent 5f3b538cde
commit 038667db7a
4 changed files with 1567 additions and 1549 deletions

File diff suppressed because it is too large Load diff

206
client.h
View file

@ -46,6 +46,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/extensions/sync.h>
#endif
// TODO: Cleanup the order of things in this .h file
class QProcess;
class QTimer;
class KStartupInfoData;
@ -62,7 +64,7 @@ class Client
{
Q_OBJECT
public:
Client( Workspace *ws );
Client( Workspace* ws );
Window wrapperId() const;
Window decorationId() const;
@ -71,10 +73,10 @@ class Client
bool isTransient() const;
bool groupTransient() const;
bool wasOriginallyGroupTransient() const;
ClientList mainClients() const; // call once before loop , is not indirect
ClientList allMainClients() const; // call once before loop , is indirect
ClientList mainClients() const; // Call once before loop , is not indirect
ClientList allMainClients() const; // Call once before loop , is indirect
bool hasTransient( const Client* c, bool indirect ) const;
const ClientList& transients() const; // is not indirect
const ClientList& transients() const; // Is not indirect
void checkTransient( Window w );
Client* findModal( bool allow_itself = false );
const Group* group() const;
@ -88,16 +90,18 @@ class Client
void updateWindowRules();
void updateFullscreenMonitors( NETFullscreenMonitors topology );
// returns true for "special" windows and false for windows which are "normal"
// (normal=window which has a border, can be moved by the user, can be closed, etc.)
// true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
// false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
/**
* Returns true for "special" windows and false for windows which are "normal"
* (normal=window which has a border, can be moved by the user, can be closed, etc.)
* true for Desktop, Dock, Splash, Override and TopMenu (and Toolbar??? - for now)
* false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
*/
bool isSpecialWindow() const;
bool hasNETSupport() const;
QSize minSize() const;
QSize maxSize() const;
virtual QPoint clientPos() const; // inside of geometry()
virtual QPoint clientPos() const; // Inside of geometry()
virtual QSize clientSize() const;
bool windowEvent( XEvent* e );
@ -110,12 +114,13 @@ class Client
void releaseWindow( bool on_shutdown = false );
void destroyClient();
enum Sizemode // how to resize the window in order to obey constains (mainly aspect ratios)
/// How to resize the window in order to obey constains (mainly aspect ratios)
enum Sizemode
{
SizemodeAny,
SizemodeFixedW, // try not to affect width
SizemodeFixedH, // try not to affect height
SizemodeMax // try not to make it larger in either direction
SizemodeFixedW, ///< Try not to affect width
SizemodeFixedH, ///< Try not to affect height
SizemodeMax ///< Try not to make it larger in either direction
};
QSize adjustedSize( const QSize&, Sizemode mode = SizemodeAny ) const;
QSize adjustedSize() const;
@ -129,13 +134,13 @@ class Client
virtual int desktop() const;
void setDesktop( int );
void setOnAllDesktops( bool set );
// !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
bool isShown( bool shaded_is_shown ) const;
bool isHiddenInternal() const; // for compositing
bool isShade() const; // true only for ShadeNormal
ShadeMode shadeMode() const; // prefer isShade()
/// Is not minimized and not hidden. I.e. normally visible on some virtual desktop.
bool isShown( bool shaded_is_shown ) const;
bool isHiddenInternal() const; // For compositing
bool isShade() const; // True only for ShadeNormal
ShadeMode shadeMode() const; // Prefer isShade()
void setShade( ShadeMode mode );
bool isShadeable() const;
@ -153,7 +158,7 @@ class Client
bool isFullScreenable( bool fullscreen_hack = false ) const;
bool isActiveFullScreen() const;
bool userCanSetFullScreen() const;
QRect geometryFSRestore() const { return geom_fs_restore; } // only for session saving
QRect geometryFSRestore() const { return geom_fs_restore; } // Only for session saving
int fullScreenMode() const { return fullscreen_mode; } // only for session saving
bool noBorder() const;
@ -178,16 +183,16 @@ class Client
void setModal( bool modal );
bool isModal() const;
// auxiliary functions, depend on the windowType
// Auxiliary functions, depend on the windowType
bool wantsTabFocus() const;
bool wantsInput() const;
bool isResizable() const;
bool isMovable() const;
bool isMovableAcrossScreens() const;
bool isCloseable() const; // may be closed by the user (may have a close button)
bool isCloseable() const; ///< May be closed by the user (May have a close button)
void takeActivity( int flags, bool handled, allowed_t ); // takes ActivityFlags as arg (in utils.h)
void takeActivity( int flags, bool handled, allowed_t ); // Takes ActivityFlags as arg (in utils.h)
void takeFocus( allowed_t );
void demandAttention( bool set = true );
@ -199,15 +204,15 @@ class Client
void repaintDecoration();
void updateShape();
void setGeometry( int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet );
void setGeometry( const QRect& r, ForceGeometry_t force = NormalGeometrySet );
void move( int x, int y, ForceGeometry_t force = NormalGeometrySet );
void move( const QPoint & p, ForceGeometry_t force = NormalGeometrySet );
// plainResize() simply resizes
void move( const QPoint& p, ForceGeometry_t force = NormalGeometrySet );
/// plainResize() simply resizes
void plainResize( int w, int h, ForceGeometry_t force = NormalGeometrySet );
void plainResize( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
// resizeWithChecks() resizes according to gravity, and checks workarea position
/// resizeWithChecks() resizes according to gravity, and checks workarea position
void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet );
void resizeWithChecks( const QSize& s, ForceGeometry_t force = NormalGeometrySet );
void keepInArea( QRect area, bool partial = false );
@ -221,17 +226,17 @@ class Client
KShortcut shortcut() const;
void setShortcut( const QString& cut );
bool performMouseCommand( Options::MouseCommand, const QPoint &globalPos, bool handled = false );
bool performMouseCommand( Options::MouseCommand, const QPoint& globalPos, bool handled = false );
QRect adjustedClientArea( const QRect& desktop, const QRect& area ) const;
Colormap colormap() const;
// updates visibility depending on being shaded, virtual desktop, etc.
/// Updates visibility depending on being shaded, virtual desktop, etc.
void updateVisibility();
// hides a client - basically like minimize, but without effects, it's simply hidden
/// Hides a client - Basically like minimize, but without effects, it's simply hidden
void hideClient( bool hide );
bool hiddenPreview() const; // window is mapped in order to get a window pixmap
bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap
virtual void setupCompositing();
virtual void finishCompositing();
@ -247,8 +252,9 @@ class Client
void NETMoveResize( int x_root, int y_root, NET::Direction direction );
void NETMoveResizeWindow( int flags, int x, int y, int width, int height );
void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp, bool send_event = false );
void restackWindow( Window above, int detail, NET::RequestSource source, Time timestamp,
bool send_event = false );
void gotPing( Time timestamp );
void checkWorkspacePosition();
@ -257,7 +263,7 @@ class Client
bool hasUserTimeSupport() const;
bool ignoreFocusStealing() const;
// does 'delete c;'
/// Does 'delete c;'
static void deleteClient( Client* c, allowed_t );
static bool belongToSameApplication( const Client* c1, const Client* c2, bool active_hack = false );
@ -284,7 +290,7 @@ class Client
{
return moveResizeMode && mode != PositionCenter;
}
// Decorations <-> Effects
QList<QRect> shadowQuads( ShadowType type ) const;
double shadowOpacity( ShadowType type ) const;
@ -302,22 +308,22 @@ class Client
friend class Bridge; // FRAME
virtual void processMousePressEvent( QMouseEvent* e );
private: // TODO cleanup the order of things in the .h file
// use Workspace::createClient()
virtual ~Client(); // use destroyClient() or releaseWindow()
private:
// Use Workspace::createClient()
virtual ~Client(); ///< Use destroyClient() or releaseWindow()
Position mousePosition( const QPoint& ) const;
void updateCursor();
// transparent stuff
// Transparent stuff
void drawbound( const QRect& geom );
void clearbound();
void doDrawbound( const QRect& geom, bool clear );
// handlers for X11 events
// Handlers for X11 events
bool mapRequestEvent( XMapRequestEvent* e );
void unmapNotifyEvent( XUnmapEvent*e );
void destroyNotifyEvent( XDestroyWindowEvent*e );
void unmapNotifyEvent( XUnmapEvent* e );
void destroyNotifyEvent( XDestroyWindowEvent* e );
void configureRequestEvent( XConfigureRequestEvent* e );
virtual void propertyNotifyEvent( XPropertyEvent* e );
void clientMessageEvent( XClientMessageEvent* e );
@ -347,14 +353,14 @@ class Client
void delayedSetShortcut();
private:
void exportMappingState( int s ); // ICCCM 4.1.3.1, 4.1.4 , NETWM 2.5.1
bool isManaged() const; // returns false if this client is not yet managed
void exportMappingState( int s ); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1
bool isManaged() const; ///< Returns false if this client is not yet managed
void updateAllowedActions( bool force = false );
QSize sizeForClientSize( const QSize&, Sizemode mode = SizemodeAny, bool noframe = false ) const;
QRect fullscreenMonitorsArea( NETFullscreenMonitors topology ) const;
void changeMaximize( bool horizontal, bool vertical, bool adjust );
void checkMaximizeGeometry();
int checkFullScreenHack( const QRect& geom ) const; // 0 - none, 1 - one xinerama screen, 2 - full area
int checkFullScreenHack( const QRect& geom ) const; // 0 - None, 1 - One xinerama screen, 2 - Full area
void updateFullScreenHack( const QRect& geom );
void getWmNormalHints();
void getMotifHints();
@ -397,7 +403,7 @@ class Client
static void sendClientMessage( Window w, Atom a, Atom protocol,
long data1 = 0, long data2 = 0, long data3 = 0 );
void embedClient( Window w, const XWindowAttributes &attr );
void embedClient( Window w, const XWindowAttributes& attr );
void detectNoBorder();
void destroyDecoration();
void updateFrameExtents();
@ -415,7 +421,7 @@ class Client
bool session ) const;
Time readUserCreationTime() const;
void startupIdChanged();
Window client;
Window wrapper;
KDecoration* decoration;
@ -433,14 +439,14 @@ class Client
QPoint invertedMoveOffset;
QRect moveResizeGeom;
QRect initialMoveResizeGeom;
XSizeHints xSizeHint;
XSizeHints xSizeHint;
void sendSyntheticConfigureNotify();
enum MappingState
{
Withdrawn, // not handled, as per ICCCM WithdrawnState
Mapped, // the frame is mapped
Unmapped, // the frame is not mapped
Kept // the frame should be unmapped, but is kept (for compositing)
Withdrawn, ///< Not handled, as per ICCCM WithdrawnState
Mapped, ///< The frame is mapped
Unmapped, ///< The frame is not mapped
Kept ///< The frame should be unmapped, but is kept (For compositing)
};
MappingState mapping_state;
void readTransient();
@ -454,31 +460,31 @@ class Client
Client* transient_for;
Window transient_for_id;
Window original_transient_for_id;
ClientList transients_list; // SELI make this ordered in stacking order?
ClientList transients_list; // SELI TODO: Make this ordered in stacking order?
ShadeMode shade_mode;
uint active :1;
uint deleting : 1; // true when doing cleanup and destroying the client
uint keep_above : 1; // NET::KeepAbove (was stays_on_top)
uint skip_taskbar :1;
uint original_skip_taskbar :1; // unaffected by KWin
uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
uint Ptakeactivity : 1; // does it support _NET_WM_TAKE_ACTIVITY
uint Pcontexthelp : 1; // does the window understand the ContextHelp protocol?
uint Pping : 1; // does it support _NET_WM_PING?
uint input :1; // does the window want input in its wm_hints
uint active : 1;
uint deleting : 1; ///< True when doing cleanup and destroying the client
uint keep_above : 1; ///< NET::KeepAbove (was stays_on_top)
uint skip_taskbar : 1;
uint original_skip_taskbar : 1; ///< Unaffected by KWin
uint Pdeletewindow : 1; ///< Does the window understand the DeleteWindow protocol?
uint Ptakefocus : 1;///< Does the window understand the TakeFocus protocol?
uint Ptakeactivity : 1; ///< Does it support _NET_WM_TAKE_ACTIVITY
uint Pcontexthelp : 1; ///< Does the window understand the ContextHelp protocol?
uint Pping : 1; ///< Does it support _NET_WM_PING?
uint input : 1; ///< Does the window want input in its wm_hints
uint skip_pager : 1;
uint motif_may_resize : 1;
uint motif_may_move :1;
uint motif_may_move : 1;
uint motif_may_close : 1;
uint keep_below : 1; // NET::KeepBelow
uint keep_below : 1; ///< NET::KeepBelow
uint minimized : 1;
uint hidden : 1; // forcibly hidden by calling hide()
uint modal : 1; // NET::Modal
uint hidden : 1; ///< Forcibly hidden by calling hide()
uint modal : 1; ///< NET::Modal
uint noborder : 1;
uint app_noborder : 1; // the app requested no border using something (window type, motif hints)
uint urgency : 1; // XWMHints, UrgencyHint
uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client
uint app_noborder : 1; ///< The app requested no border using something (window type, motif hints)
uint urgency : 1; ///< XWMHints, UrgencyHint
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
uint demands_attention : 1;
WindowRules client_rules;
void getWMHints();
@ -487,9 +493,13 @@ class Client
QPixmap icon_pix;
QPixmap miniicon_pix;
QCursor cursor;
// FullScreenHack - non-NETWM fullscreen (noborder,size of desktop)
// DON'T reorder - saved to config files !!!
enum FullScreenMode { FullScreenNone, FullScreenNormal, FullScreenHack };
// DON'T reorder - Saved to config files !!!
enum FullScreenMode
{
FullScreenNone,
FullScreenNormal,
FullScreenHack ///< Non-NETWM fullscreen (noborder and size of desktop)
};
FullScreenMode fullscreen_mode;
MaximizeMode max_mode;
QRect geom_restore;
@ -510,8 +520,13 @@ class Client
Time user_time;
unsigned long allowed_actions;
QSize client_size;
int block_geometry_updates; // >0 - new geometry is remembered, but not actually set
enum PendingGeometry_t { PendingGeometryNone, PendingGeometryNormal, PendingGeometryForced };
int block_geometry_updates; // > 0 = New geometry is remembered, but not actually set
enum PendingGeometry_t
{
PendingGeometryNone,
PendingGeometryNormal,
PendingGeometryForced
};
PendingGeometry_t pending_geometry_update;
QRect geom_before_block;
bool shade_geometry_change;
@ -524,7 +539,7 @@ class Client
bool sync_resize_pending;
int border_left, border_right, border_top, border_bottom;
QRegion _mask;
static bool check_active_modal; // see Client::checkActiveModal()
static bool check_active_modal; ///< \see Client::checkActiveModal()
KShortcut _shortcut;
int sm_stacking_order;
friend struct FetchNameInternalPredicate;
@ -536,7 +551,9 @@ class Client
friend bool performTransiencyCheck();
};
// helper for Client::blockGeometryUpdates() being called in pairs (true/false)
/**
* Helper for Client::blockGeometryUpdates() being called in pairs (true/false)
*/
class GeometryUpdatesBlocker
{
public:
@ -544,23 +561,27 @@ class GeometryUpdatesBlocker
: cl( c ) { cl->blockGeometryUpdates( true ); }
~GeometryUpdatesBlocker()
{ cl->blockGeometryUpdates( false ); }
private:
Client* cl;
};
// NET WM Protocol handler class
/**
* NET WM Protocol handler class
*/
class WinInfo : public NETWinInfo2
{
private:
typedef KWin::Client Client; // because of NET::Client
typedef KWin::Client Client; // Because of NET::Client
public:
WinInfo( Client* c, Display * display, Window window,
Window rwin, const unsigned long pr[], int pr_size );
Window rwin, const unsigned long pr[], int pr_size );
virtual void changeDesktop(int desktop);
virtual void changeFullscreenMonitors(NETFullscreenMonitors topology);
virtual void changeState( unsigned long state, unsigned long mask );
void disable();
private:
Client * m_client;
};
@ -590,7 +611,7 @@ inline bool Client::groupTransient() const
return transient_for_id == rootWindow();
}
// needed because verifyTransientFor() may set transient_for_id to root window,
// Needed because verifyTransientFor() may set transient_for_id to root window,
// if the original value has a problem (window doesn't exist, etc.)
inline bool Client::wasOriginallyGroupTransient() const
{
@ -617,8 +638,7 @@ inline Group* Client::group()
return in_group;
}
inline
bool Client::isMinimized() const
inline bool Client::isMinimized() const
{
return minimized;
}
@ -628,26 +648,22 @@ inline bool Client::isActive() const
return active;
}
inline
bool Client::isShown( bool shaded_is_shown ) const
inline bool Client::isShown( bool shaded_is_shown ) const
{
return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden;
}
inline
bool Client::isHiddenInternal() const
inline bool Client::isHiddenInternal() const
{
return hidden;
}
inline
bool Client::isShade() const
inline bool Client::isShade() const
{
return shade_mode == ShadeNormal;
}
inline
ShadeMode Client::shadeMode() const
inline ShadeMode Client::shadeMode() const
{
return shade_mode;
}
@ -747,7 +763,7 @@ inline void Client::setGeometry( const QRect& r, ForceGeometry_t force )
setGeometry( r.x(), r.y(), r.width(), r.height(), force );
}
inline void Client::move( const QPoint & p, ForceGeometry_t force )
inline void Client::move( const QPoint& p, ForceGeometry_t force )
{
move( p.x(), p.y(), force );
}
@ -766,7 +782,7 @@ inline bool Client::hasUserTimeSupport() const
{
return info->userTime() != -1U;
}
inline bool Client::ignoreFocusStealing() const
{
return ignore_focus_stealing;

File diff suppressed because it is too large Load diff

View file

@ -39,6 +39,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/Xlib.h>
// TODO: Cleanup the order of things in this .h file
class QMenu;
class KConfig;
class KActionCollection;
@ -67,21 +69,21 @@ class Workspace : public QObject, public KDecorationDefines
Workspace( bool restore = false );
virtual ~Workspace();
static Workspace * self() { return _self; }
static Workspace* self() { return _self; }
bool workspaceEvent( XEvent * );
bool workspaceEvent( QEvent * );
bool workspaceEvent( XEvent* );
bool workspaceEvent( QEvent* );
KDecoration* createDecoration( KDecorationBridge* bridge );
bool hasClient( const Client * );
bool hasClient( const Client* );
template< typename T > Client* findClient( T predicate ) const;
template< typename T1, typename T2 > void forEachClient( T1 procedure, T2 predicate );
template< typename T > void forEachClient( T procedure );
template< typename T > Unmanaged* findUnmanaged( T predicate ) const;
template< typename T1, typename T2 > void forEachUnmanaged( T1 procedure, T2 predicate );
template< typename T > void forEachUnmanaged( T procedure );
template<typename T> Client* findClient( T predicate ) const;
template<typename T1, typename T2> void forEachClient( T1 procedure, T2 predicate );
template<typename T> void forEachClient( T procedure );
template<typename T> Unmanaged* findUnmanaged( T predicate ) const;
template<typename T1, typename T2> void forEachUnmanaged( T1 procedure, T2 predicate );
template<typename T> void forEachUnmanaged( T procedure );
QRect clientArea( clientAreaOption, const QPoint& p, int desktop ) const;
QRect clientArea( clientAreaOption, const Client* c ) const;
@ -92,7 +94,8 @@ class Workspace : public QObject, public KDecorationDefines
*/
void killWindowId( Window window);
void killWindow() { slotKillWindow(); }
void killWindow()
{ slotKillWindow(); }
bool initializing() const;
@ -101,32 +104,36 @@ class Workspace : public QObject, public KDecorationDefines
* if no client has the focus)
*/
Client* activeClient() const;
// Client that was activated, but it's not yet really activeClient(), because
// we didn't process yet the matching FocusIn event. Used mostly in focus
// stealing prevention code.
/**
* Client that was activated, but it's not yet really activeClient(), because
* we didn't process yet the matching FocusIn event. Used mostly in focus
* stealing prevention code.
*/
Client* mostRecentlyActivatedClient() const;
void activateClient( Client*, bool force = false );
void requestFocus( Client* c, bool force = false );
void takeActivity( Client* c, int flags, bool handled ); // flags are ActivityFlags
void handleTakeActivity( Client* c, Time timestamp, int flags ); // flags are ActivityFlags
bool allowClientActivation( const Client* c, Time time = -1U, bool focus_in = false, bool ignore_desktop = false );
void takeActivity( Client* c, int flags, bool handled ); // Flags are ActivityFlags
void handleTakeActivity( Client* c, Time timestamp, int flags ); // Flags are ActivityFlags
bool allowClientActivation( const Client* c, Time time = -1U, bool focus_in = false,
bool ignore_desktop = false );
void restoreFocus();
void gotFocusIn( const Client* );
void setShouldGetFocus( Client* );
bool fakeRequestedActivity( Client* c );
void unfakeActivity( Client* c );
bool activateNextClient( Client* c );
bool focusChangeEnabled() { return block_focus == 0; }
bool focusChangeEnabled()
{ return block_focus == 0; }
void updateColormap();
/**
* Indicates that the client c is being moved around by the user.
*/
void setClientIsMoving( Client *c );
void setClientIsMoving( Client* c );
void place( Client *c, QRect& area );
void place( Client* c, QRect& area );
void placeSmart( Client* c, const QRect& area );
QPoint adjustClientPosition( Client* c, QPoint pos, bool unrestricted );
@ -137,15 +144,15 @@ class Workspace : public QObject, public KDecorationDefines
void lowerClientRequest( Client* c, NET::RequestSource src, Time timestamp );
void restackClientUnderActive( Client* );
void updateClientLayer( Client* c );
void raiseOrLowerClient( Client * );
void raiseOrLowerClient( Client* );
void restoreSessionStackingOrder( Client* c );
void updateStackingOrder( bool propagate_new_clients = false );
void forceRestacking();
void clientHidden( Client* );
void clientHidden( Client* );
void clientAttentionChanged( Client* c, bool set );
void checkElectricBorder(const QPoint &pos, Time time);
void checkElectricBorder(const QPoint& pos, Time time);
void reserveElectricBorder( ElectricBorder border );
void unreserveElectricBorder( ElectricBorder border );
void reserveElectricBorderSwitching( bool reserve );
@ -159,7 +166,7 @@ class Workspace : public QObject, public KDecorationDefines
*/
int numberOfDesktops() const;
void setNumberOfDesktops( int n );
void calcDesktopLayout(int* x, int* y, Qt::Orientation* orientation) const;
void calcDesktopLayout( int* x, int* y, Qt::Orientation* orientation ) const;
int desktopToRight( int desktop, bool wrap ) const;
int desktopToLeft( int desktop, bool wrap ) const;
int desktopUp( int desktop, bool wrap ) const;
@ -168,21 +175,21 @@ class Workspace : public QObject, public KDecorationDefines
int activeScreen() const;
int numScreens() const;
void checkActiveScreen( const Client* c );
void setActiveScreenMouse( const QPoint &mousepos );
void setActiveScreenMouse( const QPoint& mousepos );
QRect screenGeometry( int screen ) const;
int screenNumber( const QPoint &pos ) const;
int screenNumber( const QPoint& pos ) const;
// for TabBox
// Tab box
Client* currentTabBoxClient() const;
ClientList currentTabBoxClientList() const;
int currentTabBoxDesktop() const;
QList< int > currentTabBoxDesktopList() const;
void setTabBoxClient(Client*);
void setTabBoxDesktop(int);
Client* nextClientFocusChain(Client*) const;
Client* previousClientFocusChain(Client*) const;
Client* nextClientStatic(Client*) const;
Client* previousClientStatic(Client*) const;
QList<int> currentTabBoxDesktopList() const;
void setTabBoxClient( Client* );
void setTabBoxDesktop( int );
Client* nextClientFocusChain( Client* ) const;
Client* previousClientFocusChain( Client* ) const;
Client* nextClientStatic( Client* ) const;
Client* previousClientStatic( Client* ) const;
int nextDesktopFocusChain( int iDesktop ) const;
int previousDesktopFocusChain( int iDesktop ) const;
int nextDesktopStatic( int iDesktop ) const;
@ -191,7 +198,7 @@ class Workspace : public QObject, public KDecorationDefines
void unrefTabBox();
void closeTabBox();
/**
/**
* Returns the list of clients sorted in stacking order, with topmost client
* at the last position
*/
@ -199,14 +206,15 @@ class Workspace : public QObject, public KDecorationDefines
ToplevelList xStackingOrder() const;
ClientList ensureStackingOrder( const ClientList& clients ) const;
Client* topClientOnDesktop( int desktop, int screen, bool unconstrained = false, bool only_normal = true ) const;
Client* topClientOnDesktop( int desktop, int screen, bool unconstrained = false,
bool only_normal = true ) const;
Client* findDesktop( bool topmost, int desktop ) const;
void sendClientToDesktop( Client* c, int desktop, bool dont_activate );
void windowToPreviousDesktop( Client* c );
void windowToNextDesktop( Client* c );
void sendClientToScreen( Client* c, int screen );
// KDE4 remove me - and it's also in the DCOP interface :(
// KDE4 remove me - And it's also in the DCOP interface :(
void showWindowMenuAt( unsigned long id, int x, int y );
void loadEffect( const QString& name );
@ -219,13 +227,13 @@ class Workspace : public QObject, public KDecorationDefines
/**
* Shows the menu operations menu for the client and makes it active if
* it's not already.
* Shows the menu operations menu for the client and makes it active if
* it's not already.
*/
void showWindowMenu( const QRect& pos, Client* cl );
/**
* Backwards compatibility.
*/
void showWindowMenu( const QRect &pos, Client* cl );
/**
* Backwards compatibility.
*/
void showWindowMenu( int x, int y, Client* cl );
void showWindowMenu( QPoint pos, Client* cl );
@ -252,18 +260,18 @@ class Workspace : public QObject, public KDecorationDefines
double decorationShadowBrightness( ShadowType type ) const;
double decorationShadowSaturation( ShadowType type ) const;
// dcop interface
// D-Bus interface
void cascadeDesktop();
void unclutterDesktop();
void doNotManage( const QString & );
QList< int > decorationSupportedColors() const;
void doNotManage( const QString& );
QList<int> decorationSupportedColors() const;
bool setCurrentDesktop( int new_desktop );
void nextDesktop();
void previousDesktop();
void circulateDesktopApplications();
bool compositingActive();
bool waitForCompositingSetup();
void setCurrentScreen( int new_screen );
QString desktopName( int desk ) const;
@ -272,26 +280,31 @@ class Workspace : public QObject, public KDecorationDefines
void resetShowingDesktop( bool keep_hidden );
bool showingDesktop() const;
bool isNotManaged( const QString& title ); // ### setter or getter ?
bool isNotManaged( const QString& title ); // TODO: Setter or getter?
void sendPingToWindow( Window w, Time timestamp ); // called from Client::pingWindow()
void sendTakeActivity( Client* c, Time timestamp, long flags ); // called from Client::takeActivity()
void sendPingToWindow( Window w, Time timestamp ); // Called from Client::pingWindow()
void sendTakeActivity( Client* c, Time timestamp, long flags ); // Called from Client::takeActivity()
void removeClient( Client*, allowed_t ); // only called from Client::destroyClient() or Client::releaseWindow()
void removeClient( Client*, allowed_t ); // Only called from Client::destroyClient() or Client::releaseWindow()
void setActiveClient( Client*, allowed_t );
Group* findGroup( Window leader ) const;
void addGroup( Group* group, allowed_t );
void removeGroup( Group* group, allowed_t );
Group* findClientLeaderGroup( const Client* c ) const;
void removeUnmanaged( Unmanaged*, allowed_t ); // only called from Unmanaged::release()
void removeUnmanaged( Unmanaged*, allowed_t ); // Only called from Unmanaged::release()
void removeDeleted( Deleted*, allowed_t );
void addDeleted( Deleted*, allowed_t );
bool checkStartupNotification( Window w, KStartupInfoId& id, KStartupInfoData& data );
void focusToNull(); // SELI public?
enum FocusChainChange { FocusChainMakeFirst, FocusChainMakeLast, FocusChainUpdate };
void focusToNull(); // SELI TODO: Public?
enum FocusChainChange
{
FocusChainMakeFirst,
FocusChainMakeLast,
FocusChainUpdate
};
void updateFocusChains( Client* c, FocusChainChange change );
bool forcedGlobalMouseGrab() const;
@ -331,14 +344,14 @@ class Workspace : public QObject, public KDecorationDefines
void addRepaint( const QRect& r );
void addRepaint( const QRegion& r );
void addRepaint( int x, int y, int w, int h );
// creates XComposite overlay window, call initOverlay() afterwards
/// Creates XComposite overlay window, call initOverlay() afterwards
bool createOverlay();
// init overlay and the destination window in it
/// Init overlay and the destination window in it
void setupOverlay( Window window );
void showOverlay();
void hideOverlay(); // hides and resets overlay window
void setOverlayShape( const QRegion& reg );
// destroys XComposite overlay window
/// Destroys XComposite overlay window
void destroyOverlay();
Window overlayWindow();
void checkUnredirect( bool force = false );
@ -347,7 +360,8 @@ class Workspace : public QObject, public KDecorationDefines
public slots:
void addRepaintFull();
void refresh();
// keybindings
// Keybindings
void slotSwitchDesktopNext();
void slotSwitchDesktopPrevious();
void slotSwitchDesktopRight();
@ -376,7 +390,7 @@ class Workspace : public QObject, public KDecorationDefines
void slotSwitchToDesktop18() { return slotSwitchToDesktop( 18 ); }
void slotSwitchToDesktop19() { return slotSwitchToDesktop( 19 ); }
void slotSwitchToDesktop20() { return slotSwitchToDesktop( 20 ); }
//void slotSwitchToWindow( int );
//void slotSwitchToWindow( int );
void slotWindowToDesktop( int );
void slotWindowToDesktop1() { return slotWindowToDesktop( 1 ); }
void slotWindowToDesktop2() { return slotWindowToDesktop( 2 ); }
@ -398,7 +412,7 @@ class Workspace : public QObject, public KDecorationDefines
void slotWindowToDesktop18() { return slotWindowToDesktop( 18 ); }
void slotWindowToDesktop19() { return slotWindowToDesktop( 19 ); }
void slotWindowToDesktop20() { return slotWindowToDesktop( 20 ); }
//void slotWindowToListPosition( int );
//void slotWindowToListPosition( int );
void slotSwitchToScreen( int );
void slotSwitchToScreen0() { return slotSwitchToScreen( 0 ); }
void slotSwitchToScreen1() { return slotSwitchToScreen( 1 ); }
@ -534,7 +548,7 @@ class Workspace : public QObject, public KDecorationDefines
bool establishTabBoxGrab();
void removeTabBoxGrab();
void propagateClients( bool propagate_new_clients ); // called only from updateStackingOrder
void propagateClients( bool propagate_new_clients ); // Called only from updateStackingOrder
ClientList constrainedStackingOrder();
void raiseClientWithinApplication( Client* c );
void lowerClientWithinApplication( Client* c );
@ -547,7 +561,7 @@ class Workspace : public QObject, public KDecorationDefines
void updateTopMenuGeometry( Client* c = NULL );
void updateToolWindows( bool also_hide );
// this is the right way to create a new client
/// This is the right way to create a new client
Client* createClient( Window w, bool is_mapped );
void addClient( Client* c, allowed_t );
Unmanaged* createUnmanaged( Window w );
@ -555,28 +569,28 @@ class Workspace : public QObject, public KDecorationDefines
Window findSpecialEventWindow( XEvent* e );
void randomPlacement(Client* c);
void smartPlacement(Client* c);
void cascadePlacement(Client* c, bool re_init = false);
void randomPlacement( Client* c );
void smartPlacement( Client* c );
void cascadePlacement( Client* c, bool re_init = false );
// desktop names and number of desktops
// Desktop names and number of desktops
void loadDesktopSettings();
void saveDesktopSettings();
// mouse emulation
// Mouse emulation
WId getMouseEmulationWindow();
enum MouseEmulation { EmuPress, EmuRelease, EmuMove };
unsigned int sendFakedMouseEvent( const QPoint &pos, WId win, MouseEmulation type, int button, unsigned int state ); // returns the new state
unsigned int sendFakedMouseEvent( const QPoint& pos, WId win, MouseEmulation type, int button, unsigned int state ); // returns the new state
void tabBoxKeyPress( int key );
void tabBoxKeyRelease( const XKeyEvent& ev );
// electric borders
// Electric borders
void destroyElectricBorders();
bool electricBorderEvent(XEvent * e);
void electricBorderSwitchDesktop( ElectricBorder border, const QPoint& pos );
// ------------------
//---------------------------------------------------------------------
void helperDialog( const QString& message, const Client* c );
@ -612,12 +626,12 @@ class Workspace : public QObject, public KDecorationDefines
Client* active_client;
Client* last_active_client;
Client* most_recently_raised; // used _only_ by raiseOrLowerClient()
Client* most_recently_raised; // Used ONLY by raiseOrLowerClient()
Client* movingClient;
Client* pending_take_activity;
int active_screen;
// delay(ed) window focus timer and client
// Delay(ed) window focus timer and client
QTimer* delayFocusTimer;
Client* delayfocus_client;
QPoint focusMousePos;
@ -627,14 +641,14 @@ class Workspace : public QObject, public KDecorationDefines
UnmanagedList unmanaged;
DeletedList deleted;
ClientList unconstrained_stacking_order; // topmost last
ClientList stacking_order; // topmost last
ClientList unconstrained_stacking_order; // Topmost last
ClientList stacking_order; // Topmost last
bool force_restacking;
mutable ToplevelList x_stacking; // from XQueryTree()
mutable ToplevelList x_stacking; // From XQueryTree()
mutable bool x_stacking_dirty;
QVector< ClientList > focus_chain; // currently ative last
ClientList global_focus_chain; // this one is only for things like tabbox's MRU
ClientList should_get_focus; // last is most recent
QVector< ClientList > focus_chain; // Currently ative last
ClientList global_focus_chain; // This one is only for things like tabbox's MRU
ClientList should_get_focus; // Last is most recent
ClientList attention_chain;
bool showing_desktop;
@ -650,9 +664,9 @@ class Workspace : public QObject, public KDecorationDefines
bool control_grab;
bool tab_grab;
//KKeyNative walkThroughDesktopsKeycode, walkBackThroughDesktopsKeycode;
//KKeyNative walkThroughDesktopListKeycode, walkBackThroughDesktopListKeycode;
//KKeyNative walkThroughWindowsKeycode, walkBackThroughWindowsKeycode;
//KKeyNative walkThroughDesktopsKeycode, walkBackThroughDesktopsKeycode;
//KKeyNative walkThroughDesktopListKeycode, walkBackThroughDesktopListKeycode;
//KKeyNative walkThroughWindowsKeycode, walkBackThroughWindowsKeycode;
KShortcut cutWalkThroughDesktops, cutWalkThroughDesktopsReverse;
KShortcut cutWalkThroughDesktopList, cutWalkThroughDesktopListReverse;
KShortcut cutWalkThroughWindows, cutWalkThroughWindowsReverse;
@ -664,56 +678,56 @@ class Workspace : public QObject, public KDecorationDefines
TabBox* tab_box;
PopupInfo* popupinfo;
QMenu *popup;
QMenu *advanced_popup;
QMenu *trans_popup;
QMenu *desk_popup;
QMenu* popup;
QMenu* advanced_popup;
QMenu* trans_popup;
QMenu* desk_popup;
void modalActionsSwitch( bool enabled );
KActionCollection *keys;
KActionCollection *client_keys;
QAction *mResizeOpAction;
QAction *mMoveOpAction;
QAction *mMaximizeOpAction;
QAction *mShadeOpAction;
QAction *mKeepAboveOpAction;
QAction *mKeepBelowOpAction;
QAction *mFullScreenOpAction;
QAction *mNoBorderOpAction;
QAction *mMinimizeOpAction;
QAction *mCloseOpAction;
KActionCollection* keys;
KActionCollection* client_keys;
QAction* mResizeOpAction;
QAction* mMoveOpAction;
QAction* mMaximizeOpAction;
QAction* mShadeOpAction;
QAction* mKeepAboveOpAction;
QAction* mKeepBelowOpAction;
QAction* mFullScreenOpAction;
QAction* mNoBorderOpAction;
QAction* mMinimizeOpAction;
QAction* mCloseOpAction;
ShortcutDialog* client_keys_dialog;
Client* client_keys_client;
KActionCollection *disable_shortcuts_keys;
KActionCollection* disable_shortcuts_keys;
bool global_shortcuts_disabled;
bool global_shortcuts_disabled_for_client;
PluginMgr *mgr;
PluginMgr* mgr;
RootInfo *rootInfo;
RootInfo* rootInfo;
QWidget* supportWindow;
// swallowing
// Swallowing
QStringList doNotManageList;
// colormap handling
// Colormap handling
Colormap default_colormap;
Colormap installed_colormap;
// Timer to collect requests for 'reconfigure'
// Timer to collect requests for 'reconfigure'
QTimer reconfigureTimer;
QTimer updateToolWindowsTimer;
static Workspace *_self;
static Workspace* _self;
bool workspaceInit;
KStartupInfo* startup;
ElectricBorder electric_current_border;
Window electric_windows[ ELECTRIC_COUNT ];
Window electric_windows[ELECTRIC_COUNT];
int electricLeft;
int electricRight;
int electricTop;
@ -721,27 +735,27 @@ class Workspace : public QObject, public KDecorationDefines
Time electric_time_first;
Time electric_time_last;
QPoint electric_push_point;
int electric_reserved[ ELECTRIC_COUNT ]; // corners/edges used by something
int electric_reserved[ELECTRIC_COUNT]; // Corners/edges used by something
Qt::Orientation layoutOrientation;
int layoutX;
int layoutY;
Placement *initPositioning;
Placement* initPositioning;
QVector< QRect > workarea; // array of workareas for virtual desktops
QVector< QVector< QRect > > screenarea; // array of workareas per xinerama screen for all virtual desktops
QVector<QRect> workarea; // Array of workareas for virtual desktops
QVector< QVector<QRect> > screenarea; // Array of workareas per xinerama screen for all virtual desktops
bool managing_topmenus;
KSelectionOwner* topmenu_selection;
KSelectionWatcher* topmenu_watcher;
ClientList topmenus; // doesn't own them
ClientList topmenus; // Doesn't own them
mutable int topmenu_height;
QWidget* topmenu_space;
int set_active_client_recursion;
int block_stacking_updates; // when >0, stacking updates are temporarily disabled
bool blocked_propagating_new_clients; // propagate also new clients after enabling stacking updates?
int block_stacking_updates; // When > 0, stacking updates are temporarily disabled
bool blocked_propagating_new_clients; // Propagate also new clients after enabling stacking updates?
Window null_focus_window;
bool forced_global_mouse_grab;
friend class StackingUpdatesBlocker;
@ -755,10 +769,10 @@ class Workspace : public QObject, public KDecorationDefines
QRegion repaints_region;
Window overlay; // XComposite overlay window
bool overlay_visible;
bool overlay_shown; // for showOverlay()
bool overlay_shown; // For showOverlay()
QRegion overlay_shape;
QSlider *transSlider;
QPushButton *transButton;
QSlider* transSlider;
QPushButton* transButton;
QTimer unredirectTimer;
bool forceUnredirectCheck;
QList< int > composite_paint_times;
@ -767,7 +781,9 @@ class Workspace : public QObject, public KDecorationDefines
friend bool performTransiencyCheck();
};
// helper for Workspace::blockStackingUpdates() being called in pairs (true/false)
/**
* Helper for Workspace::blockStackingUpdates() being called in pairs (True/false)
*/
class StackingUpdatesBlocker
{
public:
@ -775,28 +791,35 @@ class StackingUpdatesBlocker
: ws( w ) { ws->blockStackingUpdates( true ); }
~StackingUpdatesBlocker()
{ ws->blockStackingUpdates( false ); }
private:
Workspace* ws;
};
// NET WM Protocol handler class
/**
* NET WM Protocol handler class
*/
class RootInfo : public NETRootInfo
{
private:
typedef KWin::Client Client; // because of NET::Client
typedef KWin::Client Client; // Because of NET::Client
public:
RootInfo( Workspace* ws, Display *dpy, Window w, const char *name, unsigned long pr[], int pr_num, int scr= -1);
RootInfo( Workspace* ws, Display* dpy, Window w, const char* name, unsigned long pr[],
int pr_num, int scr= -1 );
protected:
virtual void changeNumberOfDesktops(int n);
virtual void changeCurrentDesktop(int d);
virtual void changeActiveWindow(Window w,NET::RequestSource src, Time timestamp, Window active_window);
virtual void closeWindow(Window w);
virtual void moveResize(Window w, int x_root, int y_root, unsigned long direction);
virtual void moveResizeWindow(Window w, int flags, int x, int y, int width, int height );
virtual void gotPing(Window w, Time timestamp);
virtual void restackWindow(Window w, RequestSource source, Window above, int detail, Time timestamp);
virtual void gotTakeActivity(Window w, Time timestamp, long flags );
virtual void changeNumberOfDesktops( int n );
virtual void changeCurrentDesktop( int d );
virtual void changeActiveWindow( Window w,NET::RequestSource src, Time timestamp, Window active_window );
virtual void closeWindow( Window w );
virtual void moveResize( Window w, int x_root, int y_root, unsigned long direction );
virtual void moveResizeWindow( Window w, int flags, int x, int y, int width, int height );
virtual void gotPing( Window w, Time timestamp );
virtual void restackWindow( Window w, RequestSource source, Window above, int detail, Time timestamp );
virtual void gotTakeActivity( Window w, Time timestamp, long flags );
virtual void changeShowingDesktop( bool showing );
private:
Workspace* workspace;
};
@ -839,34 +862,31 @@ inline void Workspace::removeGroup( Group* group, allowed_t )
inline const ClientList& Workspace::stackingOrder() const
{
// TODO Q_ASSERT( block_stacking_updates == 0 );
// TODO: Q_ASSERT( block_stacking_updates == 0 );
return stacking_order;
}
inline void Workspace::showWindowMenu(QPoint pos, Client* cl)
inline void Workspace::showWindowMenu( QPoint pos, Client* cl )
{
showWindowMenu(QRect(pos, pos), cl);
showWindowMenu( QRect( pos, pos ), cl );
}
inline void Workspace::showWindowMenu(int x, int y, Client* cl)
inline void Workspace::showWindowMenu( int x, int y, Client* cl )
{
showWindowMenu(QRect(QPoint(x, y), QPoint(x, y)), cl);
showWindowMenu( QRect( QPoint( x, y ), QPoint( x, y )), cl );
}
inline
void Workspace::setWasUserInteraction()
inline void Workspace::setWasUserInteraction()
{
was_user_interaction = true;
}
inline
bool Workspace::wasUserInteraction() const
inline bool Workspace::wasUserInteraction() const
{
return was_user_interaction;
}
inline
bool Workspace::managingTopMenus() const
inline bool Workspace::managingTopMenus() const
{
return managing_topmenus;
}
@ -906,27 +926,23 @@ inline Window Workspace::overlayWindow()
return overlay;
}
inline
bool Workspace::rulesUpdatesDisabled() const
inline bool Workspace::rulesUpdatesDisabled() const
{
return rules_updates_disabled;
}
inline
void Workspace::forceRestacking()
inline void Workspace::forceRestacking()
{
force_restacking = true;
StackingUpdatesBlocker blocker( this ); // do restacking if not blocked
StackingUpdatesBlocker blocker( this ); // Do restacking if not blocked
}
inline
void Workspace::updateFocusMousePosition( const QPoint& pos )
inline void Workspace::updateFocusMousePosition( const QPoint& pos )
{
focusMousePos = pos;
}
inline
QPoint Workspace::focusMousePosition() const
inline QPoint Workspace::focusMousePosition() const
{
return focusMousePos;
}
@ -944,18 +960,18 @@ inline Client* Workspace::findClient( T predicate ) const
template< typename T1, typename T2 >
inline void Workspace::forEachClient( T1 procedure, T2 predicate )
{
for ( ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it)
if ( predicate( const_cast< const Client* >( *it)))
for( ClientList::ConstIterator it = clients.constBegin(); it != clients.constEnd(); ++it )
if( predicate( const_cast<const Client*>( *it )))
procedure( *it );
for ( ClientList::ConstIterator it = desktops.constBegin(); it != desktops.constEnd(); ++it)
if ( predicate( const_cast< const Client* >( *it)))
for( ClientList::ConstIterator it = desktops.constBegin(); it != desktops.constEnd(); ++it )
if( predicate( const_cast<const Client*>( *it )))
procedure( *it );
}
template< typename T >
inline void Workspace::forEachClient( T procedure )
{
return forEachClient( procedure, TruePredicate());
return forEachClient( procedure, TruePredicate() );
}
template< typename T >
@ -967,80 +983,73 @@ inline Unmanaged* Workspace::findUnmanaged( T predicate ) const
template< typename T1, typename T2 >
inline void Workspace::forEachUnmanaged( T1 procedure, T2 predicate )
{
for ( UnmanagedList::ConstIterator it = unmanaged.constBegin(); it != unmanaged.constEnd(); ++it)
if ( predicate( const_cast< const Unmanaged* >( *it)))
for( UnmanagedList::ConstIterator it = unmanaged.constBegin(); it != unmanaged.constEnd(); ++it )
if( predicate( const_cast<const Unmanaged*>( *it )))
procedure( *it );
}
template< typename T >
inline void Workspace::forEachUnmanaged( T procedure )
{
return forEachUnmanaged( procedure, TruePredicate());
return forEachUnmanaged( procedure, TruePredicate() );
}
KWIN_COMPARE_PREDICATE( ClientMatchPredicate, Client, const Client*, cl == value );
inline bool Workspace::hasClient( const Client* c )
{
return findClient( ClientMatchPredicate( c ));
}
inline
void Workspace::checkCompositeTimer()
inline void Workspace::checkCompositeTimer()
{
if( !compositeTimer.isActive())
if( !compositeTimer.isActive() )
setCompositeTimer();
}
inline
bool Workspace::hasDecorationShadows() const
inline bool Workspace::hasDecorationShadows() const
{
return mgr->factory()->supports( AbilityCompositingShadow );
}
inline
QList< QList<QImage> > Workspace::decorationShadowTextures()
inline QList< QList<QImage> > Workspace::decorationShadowTextures()
{
if( KDecorationFactoryUnstable* factory = dynamic_cast< KDecorationFactoryUnstable* >( mgr->factory() ))
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowTextures();
return QList< QList<QImage> >();
}
inline
int Workspace::decorationShadowTextureList( ShadowType type ) const
inline int Workspace::decorationShadowTextureList( ShadowType type ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast< KDecorationFactoryUnstable* >( mgr->factory() ))
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowTextureList( type );
return -1;
}
inline
QList<QRect> Workspace::decorationShadowQuads( ShadowType type, QSize size ) const
inline QList<QRect> Workspace::decorationShadowQuads( ShadowType type, QSize size ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast< KDecorationFactoryUnstable* >( mgr->factory() ))
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowQuads( type, size );
return QList<QRect>();
}
inline
double Workspace::decorationShadowOpacity( ShadowType type ) const
inline double Workspace::decorationShadowOpacity( ShadowType type ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast< KDecorationFactoryUnstable* >( mgr->factory() ))
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowOpacity( type );
return 1.0;
}
inline
double Workspace::decorationShadowBrightness( ShadowType type ) const
inline double Workspace::decorationShadowBrightness( ShadowType type ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast< KDecorationFactoryUnstable* >( mgr->factory() ))
if( KDecorationFactoryUnstable* factory = dynamic_cast<KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowBrightness( type );
return 1.0;
}
inline
double Workspace::decorationShadowSaturation( ShadowType type ) const
inline double Workspace::decorationShadowSaturation( ShadowType type ) const
{
if( KDecorationFactoryUnstable* factory = dynamic_cast< KDecorationFactoryUnstable* >( mgr->factory() ))
if( KDecorationFactoryUnstable* factory = dynamic_cast< KDecorationFactoryUnstable*>( mgr->factory() ))
return factory->shadowSaturation( type );
return 1.0;
}