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 
00320     static void setExtendedStrut( WId win, int left_width, int left_start, int left_end,
00321         int right_width, int right_start, int right_end, int top_width, int top_start, int top_end,
00322         int bottom_width, int bottom_start, int bottom_end );
00323 
00334     static void setStrut( WId win, int left, int right, int top, int bottom );
00339     static int currentDesktop();
00340 
00346     static int numberOfDesktops();
00347 
00353     static void setCurrentDesktop( int desktop );
00354 
00363     static void iconifyWindow( WId win, bool animation = true  );
00364 
00373     static void deIconifyWindow( WId win, bool animation = true );
00374 
00382     static void raiseWindow( WId win );
00383 
00391     static void lowerWindow( WId win );
00392 
00398     static bool icccmCompliantMappingState();
00399 
00404     static bool allowedActionsSupported();
00405 
00411     static QString readNameProperty( WId window, unsigned long atom );
00412 
00416     struct Info
00417     {
00419     WId win;
00421     long unsigned int state;
00423     bool isMinimized() const;
00424     bool isIconified() const;
00425     NET::MappingState mappingState;
00427     NETStrut strut;
00429     NET::WindowType windowType;
00431     QString visibleName;
00433     QString name;
00435     int desktop;
00437     bool onAllDesktops;
00439     pid_t pid;
00441     QRect geometry;
00443     QRect frameGeometry;
00444 
00445     QString visibleNameWithState() const;
00446     };
00447 
00452     static Info info( WId win ) KDE_DEPRECATED;
00453 
00454 #ifdef KDE_NO_COMPAT
00455 private:
00456 #endif
00457 
00461     static void appStarted() KDE_DEPRECATED;
00462 };
00463 
00464 
00469 class KWin::WindowInfo
00470 {
00471 public:
00475     WindowInfo( WId window, unsigned long properties, unsigned long properties2 );
00476     WindowInfo(); // to make QValueList and others happy
00477     ~WindowInfo();
00484     bool valid( bool withdrawn_is_valid = false ) const;
00488     WId win() const;
00493     unsigned long state() const;
00499     bool hasState( unsigned long s ) const { return ( state() & s ) == s; }
00507     bool isMinimized() const;
00514     NET::MappingState mappingState() const;
00519     NETExtendedStrut extendedStrut() const;
00525     NETStrut strut() const;
00531     NET::WindowType windowType( int supported_types ) const;
00537     QString visibleName() const;
00547     QString visibleNameWithState() const;
00553     QString name() const;
00560     QString visibleIconName() const;
00571     QString visibleIconNameWithState() const;
00578     QString iconName() const;
00583     bool isOnCurrentDesktop() const;
00588     bool isOnDesktop( int desktop ) const;
00594     bool onAllDesktops() const;
00600     int desktop() const;
00605     QRect geometry() const;
00610     QRect frameGeometry() const;
00616     WId transientFor() const;
00621     WId groupLeader() const;
00622 
00629     QCString windowClassClass() const;
00630 
00637     QCString windowClassName() const;
00638 
00644     QCString windowRole() const;
00645 
00651     QCString clientMachine() const;
00652 
00658     bool actionSupported( NET::Action action ) const;
00659 
00660     WindowInfo( const WindowInfo& );
00661     WindowInfo& operator=( const WindowInfo& );
00662 private:
00663     WindowInfoPrivate* d;
00664 };
00665 
00666 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Jan 15 13:32:32 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003