kdecore Library API Documentation

kwin.h

00001 /* This file is part of the KDE libraries
00002     Copyright (C) 1999 Matthias Ettrich (ettrich@kde.org)
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017     Boston, MA 02111-1307, USA.
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(); // to make QValueList and others happy
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
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Mar 4 22:43:33 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003