• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KWin

placement.h

Go to the documentation of this file.
00001 /********************************************************************
00002  KWin - the KDE window manager
00003  This file is part of the KDE project.
00004 
00005 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
00006 Copyright (C) 1997 to 2002 Cristian Tibirna <tibirna@kde.org>
00007 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
00008 
00009 This program is free software; you can redistribute it and/or modify
00010 it under the terms of the GNU General Public License as published by
00011 the Free Software Foundation; either version 2 of the License, or
00012 (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program.  If not, see <http://www.gnu.org/licenses/>.
00021 *********************************************************************/
00022 
00023 #ifndef KWIN_PLACEMENT_H
00024 #define KWIN_PLACEMENT_H
00025 
00026 #include <QPoint>
00027 #include <QRect>
00028 #include <QList>
00029 
00030 namespace KWin
00031 {
00032 
00033 class Workspace;
00034 class Client;
00035 
00036 class Placement
00037     {
00038     public:
00039 
00040         Placement(Workspace* w);
00041 
00048         enum Policy
00049             {
00050             NoPlacement, // not really a placement
00051             Default, // special, means to use the global default
00052             Unknown, // special, means the function should use its default
00053             Random,
00054             Smart,
00055             Cascade,
00056             Centered,
00057             ZeroCornered,
00058             UnderMouse, // special
00059             OnMainWindow, // special
00060             Maximizing
00061             };
00062 
00063         void place(Client* c, QRect& area );
00064         
00065         void placeAtRandom            (Client* c, const QRect& area, Policy next = Unknown );
00066         void placeCascaded            (Client* c, QRect& area, Policy next = Unknown );
00067         void placeSmart               (Client* c, const QRect& area, Policy next = Unknown );
00068         void placeMaximizing          (Client* c, QRect& area, Policy next = Unknown );
00069         void placeCentered    (Client* c, const QRect& area, Policy next = Unknown );
00070         void placeZeroCornered(Client* c, const QRect& area, Policy next = Unknown );
00071         void placeDialog      (Client* c, QRect& area, Policy next = Unknown );
00072         void placeUtility     (Client* c, QRect& area, Policy next = Unknown );
00073 
00074         void reinitCascading( int desktop );
00075 
00076         static Policy policyFromString( const QString& policy, bool no_special );
00077         static const char* policyToString( Policy policy );
00078 
00079     private:
00080 
00081         void place(Client* c, QRect& area, Policy policy, Policy nextPlacement = Unknown );
00082         void placeUnderMouse(Client* c, QRect& area, Policy next = Unknown );
00083         void placeOnMainWindow(Client* c, QRect& area, Policy next = Unknown );
00084         QRect checkArea( const Client*c, const QRect& area );
00085 
00086         Placement();
00087 
00088     //CT needed for cascading+
00089         struct DesktopCascadingInfo 
00090             {
00091             QPoint pos;
00092             int col;
00093             int row;
00094             };
00095 
00096         QList<DesktopCascadingInfo> cci;
00097 
00098         Workspace* m_WorkspacePtr;
00099     };
00100 
00101 } // namespace
00102 
00103 #endif

KWin

Skip menu "KWin"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal