• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • windowmanagement
kwindowsystem.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Matthias Ettrich (ettrich@kde.org)
3  Copyright (C) 2007 Lubos Lunak (l.lunak@kde.org)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 /*
21  * kwindowsystem.h. Part of the KDE project.
22  */
23 
24 #ifndef KWINDOWSYSTEM_H
25 #define KWINDOWSYSTEM_H
26 
27 #include <kdeui_export.h>
28 #include <QtCore/QObject>
29 #include <QtGui/QWidgetList> //For WId
30 #include <netwm_def.h>
31 #include <kwindowinfo.h>
32 
33 class KWindowSystemPrivate;
34 
55 class KDEUI_EXPORT KWindowSystem : public QObject, public NET
56 {
57  Q_OBJECT
58 
59 public:
63  static KWindowSystem* self();
64 
83  static const QList<WId>& windows();
84 
90  static bool hasWId(WId id);
91 
102  static KWindowInfo windowInfo( WId win, unsigned long properties, unsigned long properties2 = 0 );
103 
110  static QList<WId> stackingOrder();
111 
117  static WId activeWindow();
118 
145  static void activateWindow( WId win, long time = 0 );
146 
159  static void forceActiveWindow( WId win, long time = 0 );
160 
170  static void demandAttention( WId win, bool set = true );
171 
176  static bool compositingActive();
177 
182  static int currentDesktop();
183 
188  static int numberOfDesktops();
189 
195  static void setCurrentDesktop( int desktop );
196 
205  static void setOnAllDesktops( WId win, bool b );
206 
213  static void setOnDesktop( WId win, int desktop);
214 
226  static void setMainWindow( QWidget* subwindow, WId mainwindow );
227 #ifdef Q_WS_X11
228 
234  static WId transientFor( WId window );
235 
240  static WId groupLeader( WId window );
241 #endif
242 
258  static QPixmap icon( WId win, int width = -1, int height = -1, bool scale = false );
259 
268  enum IconSource { NETWM = 1,
269  WMHints = 2,
270  ClassHint = 4,
271  XApp = 8
272  };
287  static QPixmap icon( WId win, int width, int height, bool scale, int flags );
288 
295  static void setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon );
302  static void setType( WId win, NET::WindowType windowType );
314  static void setState( WId win, unsigned long state );
315 
327  static void clearState( WId win, unsigned long state );
328 
337  static void minimizeWindow( WId win, bool animation = true );
338 
347  static void unminimizeWindow( WId win, bool animation = true );
348 
355  static void raiseWindow( WId win );
356 
363  static void lowerWindow( WId win );
364 
370  static bool icccmCompliantMappingState();
371 
379  static QRect workArea( int desktop = - 1 );
380 
381 
392  static QRect workArea( const QList<WId> &excludes, int desktop = -1);
393 
399  static QString desktopName( int desktop );
400 
406  static void setDesktopName( int desktop, const QString& name );
407 
411  static bool showingDesktop();
412 
421  static void setUserTime( WId win, long time );
443  static void setExtendedStrut( WId win, int left_width, int left_start, int left_end,
444  int right_width, int right_start, int right_end, int top_width, int top_start, int top_end,
445  int bottom_width, int bottom_start, int bottom_end );
446 
458  static void setStrut( WId win, int left, int right, int top, int bottom );
462  static bool allowedActionsSupported();
467  static QString readNameProperty( WId window, unsigned long atom );
468 
478  static void doNotManage( const QString& title );
479 
497  static void allowExternalProcessWindowActivation( int pid = -1 );
498 
503  static void setBlockingCompositing( WId window, bool active );
504 
505 #ifdef Q_WS_X11
506 
510  static bool mapViewport();
515  static int viewportToDesktop( const QPoint& pos );
520  static int viewportWindowToDesktop( const QRect& r );
525  static QPoint desktopToViewport( int desktop, bool absolute );
532  static QPoint constrainViewportRelativePosition( const QPoint& pos );
533 #endif
534 
535 Q_SIGNALS:
536 
541  void currentDesktopChanged( int desktop);
542 
547  void windowAdded(WId id);
548 
553  void windowRemoved(WId id);
554 
559  void activeWindowChanged(WId id);
560 
564  void desktopNamesChanged();
565 
570  void numberOfDesktopsChanged(int num);
571 
575  void workAreaChanged();
576 
582  void strutChanged();
583 
588  void stackingOrderChanged();
589 
600  void windowChanged(WId id, const unsigned long* properties );
601 
611  void windowChanged(WId id, unsigned int properties);
612 
617  void windowChanged(WId id);
618 
622  void showingDesktopChanged( bool showing );
623 
636  void compositingChanged( bool enabled );
637 
638 protected:
639  virtual void connectNotify( const char* signal );
640 
641 private:
642  friend class KWindowSystemStaticContainer;
643 
644  KWindowSystem() {}
645 
646  enum { INFO_BASIC=1, // desktop info, not per-window
647  INFO_WINDOWS=2 }; // also per-window info
648 
649  static void init(int);
650 
651  friend class KWindowSystemPrivate;
652  static KWindowSystemPrivate* s_d_func();
653 };
654 
655 #endif
QWidget
KWindowSystem
Convenience access to certain properties and features of the window manager.
Definition: kwindowsystem.h:55
KStandardAction::name
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
KWindowInfo
Information about a window.
Definition: kwindowinfo.h:35
QPoint
KWindowSystem::IconSource
IconSource
Masks specifying from which sources to read an icon.
Definition: kwindowsystem.h:268
QRect
NET::WindowType
WindowType
Window type.
Definition: netwm_def.h:305
QObject
QString
QList< WId >
QPixmap
QObject::connectNotify
virtual void connectNotify(const char *signal)
NET
Base namespace class.
Definition: netwm_def.h:283
KStandardGuiItem::properties
KGuiItem properties()
Returns the 'Properties' gui item.
Definition: kstandardguiitem.cpp:299
netwm_def.h
kdeui_export.h
kwindowinfo.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal