kwin.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KWIN_H
00020 #define KWIN_H
00021
00022 #include <sys/types.h>
00023 #include <qwindowdefs.h>
00024 #include <qstring.h>
00025 #include <qpixmap.h>
00026 #include "kdemacros.h"
00027
00028 #include <netwm_def.h>
00029 class NETWinInfo;
00030
00059 class KWin
00060 {
00061 public:
00062
00090 static void activateWindow( WId win, long time = 0 );
00091
00106 static void forceActiveWindow( WId win, long time = 0 );
00111 static void setActiveWindow( WId win ) KDE_DEPRECATED;
00112
00124 static void demandAttention( WId win, bool set = true );
00125
00136 static void setUserTime( WId win, long time );
00137
00141 static void invokeContextHelp();
00142
00143
00153 static void setSystemTrayWindowFor( WId trayWin, WId forWin );
00154
00155 class WindowInfo;
00156 class WindowInfoPrivate;
00169 static WindowInfo windowInfo( WId win, unsigned long properties = 0, unsigned long properties2 = 0 );
00170
00178 static WId transientFor( WId window );
00179
00185 static WId groupLeader( WId window );
00186
00203 static QPixmap icon( WId win, int width = -1, int height = -1, bool scale = false );
00204
00213 enum IconSource { NETWM = 1,
00214 WMHints = 2,
00215 ClassHint = 4,
00216 XApp = 8
00217 };
00233 static QPixmap icon( WId win, int width, int height, bool scale, int flags );
00234
00241 static void setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon );
00242
00253 static void setType( WId win, NET::WindowType windowType );
00254
00266 static void setState( WId win, unsigned long state );
00267
00279 static void clearState( WId win, unsigned long state );
00280
00289 static void setOnAllDesktops( WId win, bool b );
00290
00297 static void setOnDesktop( WId win, int desktop);
00298
00308 static void setStrut( WId win, int left, int right, int top, int bottom );
00309
00314 static int currentDesktop();
00315
00321 static int numberOfDesktops();
00322
00328 static void setCurrentDesktop( int desktop );
00329
00338 static void iconifyWindow( WId win, bool animation = true );
00339
00348 static void deIconifyWindow( WId win, bool animation = true );
00349
00357 static void raiseWindow( WId win );
00358
00366 static void lowerWindow( WId win );
00367
00373 static bool icccmCompliantMappingState();
00374
00379 static bool allowedActionsSupported();
00380
00386 static QString readNameProperty( WId window, unsigned long atom );
00387
00391 struct Info
00392 {
00394 WId win;
00396 long unsigned int state;
00398 bool isMinimized() const;
00399 bool isIconified() const;
00400 NET::MappingState mappingState;
00402 NETStrut strut;
00404 NET::WindowType windowType;
00406 QString visibleName;
00408 QString name;
00410 int desktop;
00412 bool onAllDesktops;
00414 pid_t pid;
00416 QRect geometry;
00418 QRect frameGeometry;
00419
00420 QString visibleNameWithState() const;
00421 };
00422
00427 static Info info( WId win ) KDE_DEPRECATED;
00428
00429 #ifdef KDE_NO_COMPAT
00430 private:
00431 #endif
00432
00436 static void appStarted() KDE_DEPRECATED;
00437 };
00438
00439
00444 class KWin::WindowInfo
00445 {
00446 public:
00450 WindowInfo( WId window, unsigned long properties, unsigned long properties2 );
00451 WindowInfo();
00452 ~WindowInfo();
00459 bool valid( bool withdrawn_is_valid = false ) const;
00463 WId win() const;
00468 unsigned long state() const;
00474 bool hasState( unsigned long s ) const { return ( state() & s ) == s; }
00482 bool isMinimized() const;
00489 NET::MappingState mappingState() const;
00494 NETStrut strut() const;
00500 NET::WindowType windowType( int supported_types ) const;
00506 QString visibleName() const;
00516 QString visibleNameWithState() const;
00522 QString name() const;
00529 QString visibleIconName() const;
00540 QString visibleIconNameWithState() const;
00547 QString iconName() const;
00552 bool isOnCurrentDesktop() const;
00557 bool isOnDesktop( int desktop ) const;
00563 bool onAllDesktops() const;
00569 int desktop() const;
00574 QRect geometry() const;
00579 QRect frameGeometry() const;
00585 WId transientFor() const;
00590 WId groupLeader() const;
00591
00597 bool actionSupported( NET::Action action ) const;
00598
00599 WindowInfo( const WindowInfo& );
00600 WindowInfo& operator=( const WindowInfo& );
00601 private:
00602 WindowInfoPrivate* d;
00603 };
00604
00605 #endif
This file is part of the documentation for kdecore Library Version 3.2.3.