• 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
netwm.h
Go to the documentation of this file.
1 /*
2 
3  Copyright (c) 2000 Troll Tech AS
4  Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org>
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 
24 */
25 
26 
27 #ifndef netwm_h
28 #define netwm_h
29 
30 #include <kdeui_export.h>
31 #include <QtGui/QWidget>
32 #ifdef Q_WS_X11
33 #include <X11/Xlib.h>
34 #include <X11/Xutil.h>
35 #include <X11/Xatom.h>
36 #include <fixx11h.h>
37 
38 #include "netwm_def.h"
39 
40 // forward declaration
41 struct NETRootInfoPrivate;
42 struct NETWinInfoPrivate;
43 template <class Z> class NETRArray;
44 
45 
58 class KDEUI_EXPORT NETRootInfo : public NET {
59 public:
63  // update also NETRootInfoPrivate::properties[] size when extending this
64  enum { PROTOCOLS, WINDOW_TYPES, STATES, PROTOCOLS2, ACTIONS,
65  PROPERTIES_SIZE };
66 
98  NETRootInfo(Display *display, Window supportWindow, const char *wmName,
99  const unsigned long properties[], int properties_size,
100  int screen = -1, bool doActivate = true);
101 
102 
124  NETRootInfo(Display *display, const unsigned long properties[], int properties_size,
125  int screen = -1, bool doActivate = true);
126 
133  NETRootInfo(Display *display, unsigned long properties, int screen = -1,
134  bool doActivate = true);
135 
141  NETRootInfo(const NETRootInfo &rootinfo);
142 
146  virtual ~NETRootInfo();
147 
153  Display *x11Display() const;
154 
160  Window rootWindow() const;
161 
167  Window supportWindow() const;
168 
174  const char *wmName() const;
175 
181  int screenNumber() const;
182 
190  void setSupported( NET::Property property, bool on = true );
191 
196  void setSupported( NET::Property2 property, bool on = true );
197 
202  void setSupported( NET::WindowType property, bool on = true );
203 
208  void setSupported( NET::State property, bool on = true );
209 
214  void setSupported( NET::Action property, bool on = true );
215 
221  bool isSupported( NET::Property property ) const;
225  bool isSupported( NET::Property2 property ) const;
229  bool isSupported( NET::WindowType type ) const;
233  bool isSupported( NET::State state ) const;
234 
238  bool isSupported( NET::Action action ) const;
239 
249  const unsigned long* supportedProperties() const;
250 
255  const unsigned long* passedProperties() const;
256 
264  const Window *clientList() const;
265 
273  int clientListCount() const;
274 
283  const Window *clientListStacking() const;
284 
292  int clientListStackingCount() const;
293 
308  NETSize desktopGeometry(int desktop) const;
309 
321  NETPoint desktopViewport(int desktop) const;
322 
330  NETRect workArea(int desktop) const;
331 
339  const char *desktopName(int desktop) const;
340 
348  const Window *virtualRoots( ) const;
349 
357  int virtualRootsCount() const;
358 
362  NET::Orientation desktopLayoutOrientation() const;
363 
368  QSize desktopLayoutColumnsRows() const;
369 
373  NET::DesktopLayoutCorner desktopLayoutCorner() const;
374 
386  int numberOfDesktops( bool ignore_viewport = false ) const;
387 
399  int currentDesktop( bool ignore_viewport = false ) const;
400 
406  Window activeWindow() const;
407 
416  void activate();
417 
425  void setClientList(const Window *windows, unsigned int count);
426 
435  void setClientListStacking(const Window *windows, unsigned int count);
436 
447  void setCurrentDesktop(int desktop, bool ignore_viewport = false);
448 
463  void setDesktopGeometry(int desktop, const NETSize &geometry);
464 
476  void setDesktopViewport(int desktop, const NETPoint &viewport);
477 
487  void setNumberOfDesktops(int numberOfDesktops);
488 
500  void setDesktopName(int desktop, const char *desktopName);
501 
512  void setActiveWindow(Window window, NET::RequestSource src,
513  Time timestamp, Window active_window);
514 
521  void setActiveWindow(Window window);
522 
530  void setWorkArea(int desktop, const NETRect &workArea);
531 
539  void setVirtualRoots(const Window *windows, unsigned int count);
540 
545  void setDesktopLayout(NET::Orientation orientation, int columns, int rows,
546  NET::DesktopLayoutCorner corner);
547 
551  void setShowingDesktop( bool showing );
555  bool showingDesktop() const;
556 
561  const NETRootInfo &operator=(const NETRootInfo &rootinfo);
562 
570  void closeWindowRequest(Window window);
571 
587  void moveResizeRequest(Window window, int x_root, int y_root,
588  Direction direction);
589 
603  void moveResizeWindowRequest(Window window, int flags, int x, int y, int width, int height );
604 
608  void restackRequest(Window window, RequestSource source, Window above, int detail, Time timestamp);
609 
614  void sendPing( Window window, Time timestamp );
615 
623  void takeActivity( Window window, Time timestamp, long flags );
624 
639  void event( XEvent* event, unsigned long* properties, int properties_size );
640 
652  unsigned long event(XEvent *event);
653 
654 
655 protected:
662  virtual void addClient(Window window) { Q_UNUSED(window); }
663 
670  virtual void removeClient(Window window) { Q_UNUSED(window); }
671 
679  virtual void changeNumberOfDesktops(int numberOfDesktops) { Q_UNUSED(numberOfDesktops); }
680 
690  virtual void changeDesktopGeometry(int desktop, const NETSize &geom) { Q_UNUSED(desktop); Q_UNUSED(geom); }
691 
701  virtual void changeDesktopViewport(int desktop, const NETPoint &viewport) { Q_UNUSED(desktop); Q_UNUSED(viewport); }
702 
710  virtual void changeCurrentDesktop(int desktop) { Q_UNUSED(desktop); }
711 
718  virtual void closeWindow(Window window) { Q_UNUSED(window); }
719 
733  virtual void moveResize(Window window, int x_root, int y_root,
734  unsigned long direction) { Q_UNUSED(window); Q_UNUSED(x_root); Q_UNUSED(y_root); Q_UNUSED(direction); }
735 
742  virtual void gotPing( Window window, Time timestamp ) { Q_UNUSED(window); Q_UNUSED(timestamp); }
753  virtual void changeActiveWindow(Window window,NET::RequestSource src,
754  Time timestamp, Window active_window ) { Q_UNUSED(window); Q_UNUSED(src); Q_UNUSED(timestamp); Q_UNUSED(active_window);}
755 
768  virtual void moveResizeWindow(Window window, int flags, int x, int y, int width, int height) { Q_UNUSED(window); Q_UNUSED(flags); Q_UNUSED(x); Q_UNUSED(y); Q_UNUSED(width); Q_UNUSED(height); }
769 
781  virtual void restackWindow(Window window, RequestSource source,
782  Window above, int detail, Time timestamp) { Q_UNUSED(window); Q_UNUSED(source); Q_UNUSED(above); Q_UNUSED(detail); Q_UNUSED(timestamp); }
790  virtual void gotTakeActivity(Window window, Time timestamp, long flags ) { Q_UNUSED(window); Q_UNUSED(timestamp); Q_UNUSED(flags); }
791 
799  virtual void changeShowingDesktop(bool showing) { Q_UNUSED(showing); }
800 
801 private:
802  void update( const unsigned long[] );
803  void setSupported();
804  void setDefaultProperties();
805  void updateSupportedProperties( Atom atom );
806 
807 protected:
811  virtual void virtual_hook( int id, void* data );
812 private:
813  NETRootInfoPrivate *p; // krazy:exclude=dpointer (implicitly shared)
814 };
815 
829 class KDEUI_EXPORT NETWinInfo : public NET {
830 public:
834  // update also NETWinInfoPrivate::properties[] size when extending this
835  enum { PROTOCOLS, PROTOCOLS2,
836  PROPERTIES_SIZE };
859  NETWinInfo(Display *display, Window window, Window rootWindow,
860  const unsigned long properties[], int properties_size,
861  Role role = Client);
862 
869  NETWinInfo(Display *display, Window window,
870  Window rootWindow, unsigned long properties,
871  Role role = Client);
872 
878  NETWinInfo(const NETWinInfo & wininfo);
879 
883  virtual ~NETWinInfo();
884 
889  const NETWinInfo &operator=(const NETWinInfo &wintinfo);
890 
898  bool hasNETSupport() const;
899 
904  const unsigned long* passedProperties() const;
905 
911  NETRect iconGeometry() const;
912 
919  unsigned long state() const;
920 
925  NETExtendedStrut extendedStrut() const;
926 
933  NETStrut strut() const;
934 
948  WindowType windowType( unsigned long supported_types ) const;
949 
955  bool hasWindowType() const;
956 
962  const char *name() const;
963 
969  const char *visibleName() const;
970 
980  const char *iconName() const;
981 
991  const char *visibleIconName() const;
992 
1006  int desktop( bool ignore_viewport = false ) const;
1007 
1013  int pid() const;
1014 
1020  Bool handledIcons() const;
1021 
1028  MappingState mappingState() const;
1029 
1039  void setIcon(NETIcon icon, Bool replace = True);
1040 
1046  void setIconGeometry(NETRect geometry);
1047 
1053  void setExtendedStrut(const NETExtendedStrut& extended_strut );
1054 
1061  void setStrut(NETStrut strut);
1062 
1071  void setState(unsigned long state, unsigned long mask);
1072 
1079  void setWindowType(WindowType type);
1080 
1086  void setName(const char *name);
1087 
1094  void setVisibleName(const char *visibleName);
1095 
1101  void setIconName(const char *name);
1102 
1109  void setVisibleIconName(const char *name);
1110 
1123  void setDesktop(int desktop, bool ignore_viewport = false);
1124 
1130  void setPid(int pid);
1131 
1137  void setHandledIcons(Bool handled);
1138 
1144  void setFrameExtents(NETStrut strut);
1145 
1151  NETStrut frameExtents() const;
1152 
1164  void setFrameOverlap(NETStrut strut);
1165 
1172  NETStrut frameOverlap() const;
1173 
1185  NETIcon icon(int width = -1, int height = -1) const;
1186 
1192  const int* iconSizes() const;
1193 
1201  void setUserTime( Time time );
1202 
1206  Time userTime() const;
1207 
1211  void setStartupId( const char* startup_id );
1212 
1216  const char* startupId() const;
1217 
1221  void setOpacity( unsigned long opacity );
1222 
1226  unsigned long opacity() const;
1227 
1231  void setAllowedActions( unsigned long actions );
1232 
1236  unsigned long allowedActions() const;
1237 
1242  Window transientFor() const;
1243 
1247  Window groupLeader() const;
1248 
1253  const char* windowClassClass() const;
1254 
1259  const char* windowClassName() const;
1260 
1264  const char* windowRole() const;
1265 
1269  const char* clientMachine() const;
1270 
1276  const char* activities() const;
1277 
1278 
1283  void setBlockingCompositing(bool active);
1284 
1289  bool isBlockingCompositing() const;
1290 
1299  void kdeGeometry(NETRect &frame, NETRect &window);
1300 
1314  void event( XEvent* event, unsigned long* properties, int properties_size );
1315 
1327  unsigned long event(XEvent *event);
1328 
1335  static const int OnAllDesktops;
1336 
1337 protected:
1345  virtual void changeDesktop(int desktop) { Q_UNUSED(desktop); }
1346 
1356  virtual void changeState(unsigned long state, unsigned long mask) { Q_UNUSED(state); Q_UNUSED(mask); }
1357 
1358 private:
1359  void update( const unsigned long[] );
1360  void updateWMState();
1361  void setIconInternal(NETRArray<NETIcon>& icons, int& icon_count, Atom property, NETIcon icon, Bool replace);
1362  NETIcon iconInternal(NETRArray<NETIcon>& icons, int icon_count, int width, int height) const;
1363 
1364 protected:
1368  virtual void virtual_hook( int id, void* data );
1369 private:
1370  NETWinInfoPrivate *p; // krazy:exclude=dpointer (implicitly shared)
1371  friend class NETWinInfo2;
1372 };
1373 
1374 
1381 class KDEUI_EXPORT NETWinInfo2 : public NETWinInfo {
1382 public:
1383  NETWinInfo2(Display *display, Window window, Window rootWindow,
1384  const unsigned long properties[], int properties_size,
1385  Role role = Client);
1386 
1387  NETWinInfo2(Display *display, Window window,
1388  Window rootWindow, unsigned long properties,
1389  Role role = Client);
1390 
1407  void setFullscreenMonitors(NETFullscreenMonitors topology);
1408 
1414  NETFullscreenMonitors fullscreenMonitors() const;
1415 
1416 protected:
1417  friend class NETWinInfo;
1426  virtual void changeFullscreenMonitors(NETFullscreenMonitors topology) { Q_UNUSED(topology); }
1427 };
1428 
1429 //#define KWIN_FOCUS
1430 
1431 #endif
1432 #endif // netwm_h
Atom
unsigned long Atom
Definition: kapplication.h:29
NETIcon
Simple icon class for NET classes.
Definition: netwm_def.h:121
NETStrut
Definition: netwm_def.h:194
NETRootInfo::moveResizeWindow
virtual void moveResizeWindow(Window window, int flags, int x, int y, int width, int height)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:768
NETRootInfo::restackWindow
virtual void restackWindow(Window window, RequestSource source, Window above, int detail, Time timestamp)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:781
NET::Property2
Property2
Supported properties.
Definition: netwm_def.h:675
NETRootInfo::gotPing
virtual void gotPing(Window window, Time timestamp)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to receive r...
Definition: netwm.h:742
NETFullscreenMonitors
Simple multiple monitor topology class for NET classes.
Definition: netwm_def.h:234
KStandardAction::name
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
NET::State
State
Window state.
Definition: netwm_def.h:425
NETRootInfo::gotTakeActivity
virtual void gotTakeActivity(Window window, Time timestamp, long flags)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to receive r...
Definition: netwm.h:790
NETExtendedStrut
Partial strut class for NET classes.
Definition: netwm_def.h:152
NETWinInfo2
This class is an extension of the NETWinInfo class, and exists solely for binary compatibility reason...
Definition: netwm.h:1381
NETRootInfo
Common API for root window properties/protocols.
Definition: netwm.h:58
NET::Orientation
Orientation
Orientation.
Definition: netwm_def.h:728
NET::Role
Role
Application role.
Definition: netwm_def.h:290
NETRootInfo::moveResize
virtual void moveResize(Window window, int x_root, int y_root, unsigned long direction)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:733
NETRootInfo::removeClient
virtual void removeClient(Window window)
A Client should subclass NETRootInfo and reimplement this function when it wants to know when a windo...
Definition: netwm.h:670
NET::WindowType
WindowType
Window type.
Definition: netwm_def.h:305
NET::Property
Property
Supported properties.
Definition: netwm_def.h:612
NETRootInfo::changeDesktopGeometry
virtual void changeDesktopGeometry(int desktop, const NETSize &geom)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:690
NETPoint
Simple point class for NET classes.
Definition: netwm_def.h:43
NETWinInfo::changeDesktop
virtual void changeDesktop(int desktop)
A Window Manager should subclass NETWinInfo and reimplement this function when it wants to know when ...
Definition: netwm.h:1345
NETWinInfo::NETWinInfo2
friend class NETWinInfo2
Definition: netwm.h:1371
NETRootInfo::WINDOW_TYPES
Definition: netwm.h:64
NETRootInfo::changeDesktopViewport
virtual void changeDesktopViewport(int desktop, const NETPoint &viewport)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:701
NETRootInfo::closeWindow
virtual void closeWindow(Window window)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:718
NETRootInfo::changeNumberOfDesktops
virtual void changeNumberOfDesktops(int numberOfDesktops)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:679
QSize
fixx11h.h
NETRect
Simple rectangle class for NET classes.
Definition: netwm_def.h:93
KStandardAction::replace
KAction * replace(const QObject *recvr, const char *slot, QObject *parent)
Find and replace matches.
Definition: kstandardaction.cpp:344
NET
Base namespace class.
Definition: netwm_def.h:283
NETRootInfo::changeActiveWindow
virtual void changeActiveWindow(Window window, NET::RequestSource src, Time timestamp, Window active_window)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:753
NETRootInfo::changeCurrentDesktop
virtual void changeCurrentDesktop(int desktop)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:710
Window
NETWinInfo::OnAllDesktops
static const int OnAllDesktops
Sentinel value to indicate that the client wishes to be visible on all desktops.
Definition: netwm.h:1335
KStandardGuiItem::properties
KGuiItem properties()
Returns the 'Properties' gui item.
Definition: kstandardguiitem.cpp:299
NETWinInfo::PROTOCOLS2
Definition: netwm.h:835
NETRootInfo::addClient
virtual void addClient(Window window)
A Client should subclass NETRootInfo and reimplement this function when it wants to know when a windo...
Definition: netwm.h:662
NETRArray
Definition: netwm.h:43
NETWinInfo::changeState
virtual void changeState(unsigned long state, unsigned long mask)
A Window Manager should subclass NETWinInfo and reimplement this function when it wants to know when ...
Definition: netwm.h:1356
netwm_def.h
kdeui_export.h
NET::Action
Action
Actions that can be done with a window (_NET_WM_ALLOWED_ACTIONS).
Definition: netwm_def.h:553
NETWinInfo
Common API for application window properties/protocols.
Definition: netwm.h:829
NETWinInfo2::changeFullscreenMonitors
virtual void changeFullscreenMonitors(NETFullscreenMonitors topology)
A Window Manager should subclass NETWinInfo2 and reimplement this function when it wants to know when...
Definition: netwm.h:1426
NET::DesktopLayoutCorner
DesktopLayoutCorner
Starting corner for desktop layout.
Definition: netwm_def.h:736
NET::RequestSource
RequestSource
Source of the request.
Definition: netwm_def.h:710
NETSize
Simple size class for NET classes.
Definition: netwm_def.h:70
NETRootInfo::changeShowingDesktop
virtual void changeShowingDesktop(bool showing)
A Window Manager should subclass NETRootInfo and reimplement this function when it wants to know when...
Definition: netwm.h:799
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:01 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