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 "kdelibs_export.h"
00027 
00028 #ifdef Q_OS_UNIX
00029 
00030 #include <netwm_def.h>
00031 class NETWinInfo;
00032 
00061 class KDECORE_EXPORT KWin
00062 {
00063 public:
00064 
00092     static void activateWindow( WId win, long time = 0 );
00093 
00108     static void forceActiveWindow( WId win, long time = 0 );
00113     static void setActiveWindow( WId win ) KDE_DEPRECATED;
00114 
00126     static void demandAttention( WId win, bool set = true );
00127 
00138     static void setUserTime( WId win, long time );
00139 
00143     static void invokeContextHelp();
00144 
00145 
00155     static void setSystemTrayWindowFor( WId trayWin, WId forWin );
00156 
00157     class WindowInfo;
00158     class WindowInfoPrivate;
00171     static WindowInfo windowInfo( WId win, unsigned long properties = 0, unsigned long properties2 = 0 );
00172 
00180     static WId transientFor( WId window );
00181 
00187     static WId groupLeader( WId window );
00188 
00205     static QPixmap icon( WId win, int width = -1, int height = -1, bool scale = false );
00206 
00215     enum IconSource { NETWM = 1, 
00216               WMHints = 2, 
00217               ClassHint = 4, 
00218               XApp = 8 
00219     };
00235     static QPixmap icon( WId win, int width, int height, bool scale, int flags );
00236 
00243     static void  setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon );
00244 
00255     static void setType( WId win, NET::WindowType windowType );
00256 
00268     static void setState( WId win, unsigned long state );
00269 
00281     static void clearState( WId win, unsigned long  state );
00282 
00291     static void setOnAllDesktops( WId win, bool b );
00292 
00299     static void setOnDesktop( WId win, int desktop);
00300 
00322     static void setExtendedStrut( WId win, int left_width, int left_start, int left_end,
00323         int right_width, int right_start, int right_end, int top_width, int top_start, int top_end,
00324         int bottom_width, int bottom_start, int bottom_end );
00325 
00336     static void setStrut( WId win, int left, int right, int top, int bottom );
00341     static int currentDesktop();
00342 
00348     static int numberOfDesktops();
00349 
00355     static void setCurrentDesktop( int desktop );
00356 
00365     static void iconifyWindow( WId win, bool animation = true  );
00366 
00375     static void deIconifyWindow( WId win, bool animation = true );
00376 
00384     static void raiseWindow( WId win );
00385 
00393     static void lowerWindow( WId win );
00394 
00400     static bool icccmCompliantMappingState();
00401 
00406     static bool allowedActionsSupported();
00407 
00413     static QString readNameProperty( WId window, unsigned long atom );
00414 
00418     struct KDECORE_EXPORT Info
00419     {
00421     WId win;
00423     long unsigned int state;
00425     bool isMinimized() const;
00426     bool isIconified() const;
00427     NET::MappingState mappingState;
00429     NETStrut strut;
00431     NET::WindowType windowType;
00433     QString visibleName;
00435     QString name;
00437     int desktop;
00439     bool onAllDesktops;
00441     pid_t pid;
00443     QRect geometry;
00445     QRect frameGeometry;
00446 
00447     QString visibleNameWithState() const;
00448     };
00449 
00454     static Info info( WId win ) KDE_DEPRECATED;
00455 
00456 #ifdef KDE_NO_COMPAT
00457 private:
00458 #endif
00459 
00463     static void appStarted() KDE_DEPRECATED;
00464 };
00465 
00466 
00471 class KDECORE_EXPORT KWin::WindowInfo
00472 {
00473 public:
00477     WindowInfo( WId window, unsigned long properties, unsigned long properties2 );
00478     WindowInfo(); // to make QValueList and others happy
00479     ~WindowInfo();
00486     bool valid( bool withdrawn_is_valid = false ) const;
00490     WId win() const;
00495     unsigned long state() const;
00501     bool hasState( unsigned long s ) const { return ( state() & s ) == s; }
00509     bool isMinimized() const;
00516     NET::MappingState mappingState() const;
00521     NETExtendedStrut extendedStrut() const;
00527     NETStrut strut() const;
00533     NET::WindowType windowType( int supported_types ) const;
00539     QString visibleName() const;
00549     QString visibleNameWithState() const;
00555     QString name() const;
00562     QString visibleIconName() const;
00573     QString visibleIconNameWithState() const;
00580     QString iconName() const;
00585     bool isOnCurrentDesktop() const;
00590     bool isOnDesktop( int desktop ) const;
00596     bool onAllDesktops() const;
00602     int desktop() const;
00607     QRect geometry() const;
00612     QRect frameGeometry() const;
00618     WId transientFor() const;
00623     WId groupLeader() const;
00624 
00631     QCString windowClassClass() const;
00632 
00639     QCString windowClassName() const;
00640 
00646     QCString windowRole() const;
00647 
00653     QCString clientMachine() const;
00654 
00660     bool actionSupported( NET::Action action ) const;
00661 
00662     WindowInfo( const WindowInfo& );
00663     WindowInfo& operator=( const WindowInfo& );
00664 private:
00665     WindowInfoPrivate* d;
00666 };
00667 
00668 #endif //Q_OS_UNIX
00669 
00670 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 30 10:09:41 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003