KWindowSystem

netwm_def.h
1 /*
2  SPDX-FileCopyrightText: 2000 Troll Tech AS
3  SPDX-FileCopyrightText: 2003 Lubos Lunak <[email protected]>
4 
5  SPDX-License-Identifier: MIT
6 */
7 
8 #ifndef netwm_def_h
9 #define netwm_def_h
10 #include <QFlags>
11 #include <QRect>
12 #include <kwindowsystem_export.h>
13 
14 /**
15  Simple point class for NET classes.
16 
17  This class is a convenience class defining a point x, y. The existence of
18  this class is to keep the implementation from being dependent on a
19  separate framework/library.
20 
21  NETPoint is only used by the NET API. Usually QPoint is the
22  appropriate class for representing a point.
23 
24  @author Bradley T. Hughes <[email protected]>
25 **/
26 
27 struct NETPoint {
28  /**
29  Constructor to initialize this point to 0,0.
30  **/
32  : x(0)
33  , y(0)
34  {
35  }
36 
37  NETPoint(const QPoint &p)
38  : x(p.x())
39  , y(p.y())
40  {
41  }
42 
43  QPoint toPoint() const
44  {
45  return {x, y};
46  }
47 
48  /*
49  Public data member.
50  **/
51  int x, ///< x coordinate.
52  y; ///< y coordinate
53 };
54 
55 /**
56  Simple size class for NET classes.
57 
58  This class is a convenience class defining a size width by height. The
59  existence of this class is to keep the implementation from being dependent
60  on a separate framework/library.
61 
62  NETSize is only used by the NET API. Usually QSize is the
63  appropriate class for representing a size.
64 
65  @author Bradley T. Hughes <[email protected]>
66 **/
67 
68 struct NETSize {
69  /**
70  Constructor to initialize this size to 0x0
71  **/
73  : width(0)
74  , height(0)
75  {
76  }
77 
78  NETSize(const QSize &size)
79  : width(size.width())
80  , height(size.height())
81  {
82  }
83 
84  QSize toSize() const
85  {
86  return {width, height};
87  }
88  /*
89  Public data member.
90  **/
91  int width; ///< Width.
92  int height; ///< Height.
93 };
94 
95 /**
96  Simple rectangle class for NET classes.
97 
98  This class is a convenience class defining a rectangle as a point x,y with a
99  size width by height. The existence of this class is to keep the implementation
100  from being dependent on a separate framework/library;
101 
102  NETRect is only used by the NET API. Usually QRect is the
103  appropriate class for representing a rectangle.
104 **/
105 struct NETRect {
106  NETRect()
107  {
108  }
109 
110  NETRect(const QRect &rect)
111  : pos(rect.topLeft())
112  , size(rect.size())
113  {
114  }
115 
116  QRect toRect() const
117  {
118  return QRect(pos.x, pos.y, size.width, size.height);
119  }
120 
121  /**
122  Position of the rectangle.
123 
124  @see NETPoint
125  **/
127 
128  /**
129  Size of the rectangle.
130 
131  @see NETSize
132  **/
134 };
135 
136 /**
137  Simple icon class for NET classes.
138 
139  This class is a convenience class defining an icon of size width by height.
140  The existence of this class is to keep the implementation from being
141  dependent on a separate framework/library.
142 
143  NETIcon is only used by the NET API. Usually QIcon is the
144  appropriate class for representing an icon.
145 **/
146 
147 struct NETIcon {
148  /**
149  Constructor to initialize this icon to 0x0 with data=0
150  **/
152  : data(nullptr)
153  {
154  }
155 
156  /**
157  Size of the icon.
158 
159  @see NETSize
160  **/
162 
163  /**
164  Image data for the icon. This is an array of 32bit packed CARDINAL ARGB
165  with high byte being A, low byte being B. First two bytes are width, height.
166  Data is in rows, left to right and top to bottom.
167  **/
168  unsigned char *data;
169 };
170 
171 /**
172  Partial strut class for NET classes.
173 
174  This class is a convenience class defining a strut with left, right, top and
175  bottom border values, and ranges for them. The existence of this class is to
176  keep the implementation from being dependent on a separate framework/library.
177  See the _NET_WM_STRUT_PARTIAL property in the NETWM spec.
178 **/
179 
181  /**
182  Constructor to initialize this struct to 0,0,0,0
183  **/
185  : left_width(0)
186  , left_start(0)
187  , left_end(0)
188  , right_width(0)
189  , right_start(0)
190  , right_end(0)
191  , top_width(0)
192  , top_start(0)
193  , top_end(0)
194  , bottom_width(0)
195  , bottom_start(0)
196  , bottom_end(0)
197  {
198  }
199 
200  /**
201  Left border of the strut, width and range.
202  **/
203  int left_width, left_start, left_end;
204 
205  /**
206  Right border of the strut, width and range.
207  **/
208  int right_width, right_start, right_end;
209 
210  /**
211  Top border of the strut, width and range.
212  **/
213  int top_width, top_start, top_end;
214 
215  /**
216  Bottom border of the strut, width and range.
217  **/
218  int bottom_width, bottom_start, bottom_end;
219 };
220 
221 /**
222  @deprecated use NETExtendedStrut
223 
224  Simple strut class for NET classes.
225 
226  This class is a convenience class defining a strut with left, right, top and
227  bottom border values. The existence of this class is to keep the implementation
228  from being dependent on a separate framework/library. See the _NET_WM_STRUT
229  property in the NETWM spec.
230 **/
231 
232 struct NETStrut {
233  /**
234  Constructor to initialize this struct to 0,0,0,0
235  **/
237  : left(0)
238  , right(0)
239  , top(0)
240  , bottom(0)
241  {
242  }
243 
244  /**
245  Left border of the strut.
246  **/
247  int left;
248 
249  /**
250  Right border of the strut.
251  **/
252  int right;
253 
254  /**
255  Top border of the strut.
256  **/
257  int top;
258 
259  /**
260  Bottom border of the strut.
261  **/
262  int bottom;
263 };
264 
265 /**
266  Simple multiple monitor topology class for NET classes.
267 
268  This class is a convenience class, defining a multiple monitor topology
269  for fullscreen applications that wish to be present on more than one
270  monitor/head. As per the _NET_WM_FULLSCREEN_MONITORS hint in the EWMH spec,
271  this topology consists of 4 monitor indices such that the bounding rectangle
272  is defined by the top edge of the top monitor, the bottom edge of the bottom
273  monitor, the left edge of the left monitor, and the right edge of the right
274  monitor. See the _NET_WM_FULLSCREEN_MONITORS hint in the EWMH spec.
275 **/
276 
278  /**
279  Constructor to initialize this struct to -1,0,0,0 (an initialized,
280  albeit invalid, topology).
281  **/
283  : top(-1)
284  , bottom(0)
285  , left(0)
286  , right(0)
287  {
288  }
289 
290  /**
291  Monitor index whose top border defines the top edge of the topology.
292  **/
293  int top;
294 
295  /**
296  Monitor index whose bottom border defines the bottom edge of the topology.
297  **/
298  int bottom;
299 
300  /**
301  Monitor index whose left border defines the left edge of the topology.
302  **/
303  int left;
304 
305  /**
306  Monitor index whose right border defines the right edge of the topology.
307  **/
308  int right;
309 
310  /**
311  Convenience check to make sure that we are not holding the initial (invalid)
312  values. Note that we don't want to call this isValid() because we're not
313  actually validating the monitor topology here, but merely that our initial
314  values were overwritten at some point by real (non-negative) monitor indices.
315  **/
316  bool isSet() const
317  {
318  return (top != -1);
319  }
320 };
321 
322 /**
323  Base namespace class.
324 
325  The NET API is an implementation of the NET Window Manager Specification.
326 
327  This class is the base class for the NETRootInfo and NETWinInfo classes, which
328  are used to retrieve and modify the properties of windows. To keep
329  the namespace relatively clean, all enums are defined here.
330 
331  @see http://www.freedesktop.org/standards/wm-spec/
332  **/
333 
334 class KWINDOWSYSTEM_EXPORT NET
335 {
336 public:
337  /**
338  Application role. This is used internally to determine how several action
339  should be performed (if at all).
340  **/
341 
342  enum Role {
343  /**
344  indicates that the application is a client application.
345  **/
347  /**
348  indicates that the application is a window manager application.
349  **/
351  };
352 
353  /**
354  Window type.
355  **/
356 
357  enum WindowType {
358  /**
359  indicates that the window did not define a window type.
360  **/
361  Unknown = -1,
362  /**
363  indicates that this is a normal, top-level window
364  **/
365  Normal = 0,
366  /**
367  indicates a desktop feature. This can include a single window
368  containing desktop icons with the same dimensions as the screen, allowing
369  the desktop environment to have full control of the desktop, without the
370  need for proxying root window clicks.
371  **/
372  Desktop = 1,
373  /**
374  indicates a dock or panel feature
375  **/
376  Dock = 2,
377  /**
378  indicates a toolbar window
379  **/
380  Toolbar = 3,
381  /**
382  indicates a pinnable (torn-off) menu window
383  **/
384  Menu = 4,
385  /**
386  indicates that this is a dialog window
387  **/
388  Dialog = 5,
389  // cannot deprecate to compiler: used both by clients & manager, later needs to keep supporting it for now
390  // KF6: remove
391  /**
392  @deprecated has unclear meaning and is KDE-only
393  **/
394  Override = 6, // NON STANDARD
395  /**
396  indicates a toplevel menu (AKA macmenu). This is a KDE extension to the
397  _NET_WM_WINDOW_TYPE mechanism.
398  **/
399  TopMenu = 7, // NON STANDARD
400  /**
401  indicates a utility window
402  **/
403  Utility = 8,
404  /**
405  indicates that this window is a splash screen window.
406  **/
407  Splash = 9,
408  /**
409  indicates a dropdown menu (from a menubar typically)
410  **/
411  DropdownMenu = 10,
412  /**
413  indicates a popup menu (a context menu typically)
414  **/
415  PopupMenu = 11,
416  /**
417  indicates a tooltip window
418  **/
419  Tooltip = 12,
420  /**
421  indicates a notification window
422  **/
423  Notification = 13,
424  /**
425  indicates that the window is a list for a combobox
426  **/
427  ComboBox = 14,
428  /**
429  indicates a window that represents the dragged object during DND operation
430  **/
431  DNDIcon = 15,
432  /**
433  indicates an On Screen Display window (such as volume feedback)
434  @since 5.6
435  **/
436  OnScreenDisplay = 16, // NON STANDARD
437  /**
438  indicates a critical notification (such as battery is running out)
439  @since 5.58
440  **/
441  CriticalNotification = 17, // NON STANDARD
442  /**
443  * indicates that this window is an applet.
444  */
445  AppletPopup = 18, // NON STANDARD
446  };
447 
448  /**
449  Values for WindowType when they should be OR'ed together, e.g.
450  for the properties argument of the NETRootInfo constructor.
451  @see WindowTypes
452  **/
454  NormalMask = 1u << 0, ///< @see Normal
455  DesktopMask = 1u << 1, ///< @see Desktop
456  DockMask = 1u << 2, ///< @see Dock
457  ToolbarMask = 1u << 3, ///< @see Toolbar
458  MenuMask = 1u << 4, ///< @see Menu
459  DialogMask = 1u << 5, ///< @see Dialog
460  OverrideMask = 1u << 6, ///< @see Override
461  TopMenuMask = 1u << 7, ///< @see TopMenu
462  UtilityMask = 1u << 8, ///< @see Utility
463  SplashMask = 1u << 9, ///< @see Splash
464  DropdownMenuMask = 1u << 10, ///< @see DropdownMenu
465  PopupMenuMask = 1u << 11, ///< @see PopupMenu
466  TooltipMask = 1u << 12, ///< @see Tooltip
467  NotificationMask = 1u << 13, ///< @see Notification
468  ComboBoxMask = 1u << 14, ///< @see ComboBox
469  DNDIconMask = 1u << 15, ///< @see DNDIcon
470  OnScreenDisplayMask = 1u << 16, ///< NON STANDARD @see OnScreenDisplay @since 5.6
471  CriticalNotificationMask = 1u << 17, ///< NON STANDARD @see CriticalNotification @since 5.58
472  AppletPopupMask = 1u << 18, ///< NON STANDARD @see AppletPopup
473  AllTypesMask = 0U - 1, ///< All window types.
474  };
475  /**
476  * Stores a combination of #WindowTypeMask values.
477  */
478  Q_DECLARE_FLAGS(WindowTypes, WindowTypeMask)
479 
480  /**
481  * Returns true if the given window type matches the mask given
482  * using WindowTypeMask flags.
483  */
484  static bool typeMatchesMask(WindowType type, WindowTypes mask);
485 
486  /**
487  Window state.
488 
489  To set the state of a window, you'll typically do something like:
490  \code
491  KWindowSystem::setState( winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher );
492  \endcode
493 
494  for example to not show the window on the taskbar, desktop pager, or window switcher.
495  winId() is a function of QWidget()
496 
497  Note that KeepAbove (StaysOnTop) and KeepBelow are meant as user preference and
498  applications should avoid setting these states themselves.
499 
500  @see States
501  **/
502 
503  enum State {
504  /**
505  indicates that this is a modal dialog box. The WM_TRANSIENT_FOR hint
506  MUST be set to indicate which window the dialog is a modal for, or set to
507  the root window if the dialog is a modal for its window group.
508  **/
509  Modal = 1u << 0,
510  /**
511  indicates that the Window Manager SHOULD keep the window's position
512  fixed on the screen, even when the virtual desktop scrolls. Note that this is
513  different from being kept on all desktops.
514  **/
515  Sticky = 1u << 1,
516  /**
517  indicates that the window is vertically maximized.
518  **/
519  MaxVert = 1u << 2,
520  /**
521  indicates that the window is horizontally maximized.
522  **/
523  MaxHoriz = 1u << 3,
524  /**
525  convenience value. Equal to MaxVert | MaxHoriz.
526  **/
527  Max = MaxVert | MaxHoriz,
528  /**
529  indicates that the window is shaded (rolled-up).
530  **/
531  Shaded = 1u << 4,
532  /**
533  indicates that a window should not be included on a taskbar.
534  **/
535  SkipTaskbar = 1u << 5,
536  /**
537  indicates that a window should on top of most windows (but below fullscreen
538  windows).
539  **/
540  KeepAbove = 1u << 6,
541 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0)
542  /**
543  @deprecated Since 5.0. This is an obsolete name for KeepAbove.
544  **/
545  StaysOnTop KWINDOWSYSTEM_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use KeepAbove") = KeepAbove, // NOT STANDARD
546 #endif
547  /**
548  indicates that a window should not be included on a pager.
549  **/
550  SkipPager = 1u << 7,
551  /**
552  indicates that a window should not be visible on the screen (e.g. when minimised).
553  Only the window manager is allowed to change it.
554  **/
555  Hidden = 1u << 8,
556  /**
557  indicates that a window should fill the entire screen and have no window
558  decorations.
559  **/
560  FullScreen = 1u << 9,
561  /**
562  indicates that a window should be below most windows (but above any desktop windows).
563  **/
564  KeepBelow = 1u << 10,
565  /**
566  there was an attempt to activate this window, but the window manager prevented
567  this. E.g. taskbar should mark such window specially to bring user's attention to
568  this window. Only the window manager is allowed to change it.
569  **/
570  DemandsAttention = 1u << 11,
571  /**
572  indicates that a window should not be included on a switcher.
573 
574  @since 5.45
575  **/
576  SkipSwitcher = 1u << 12,
577  /**
578  indicates that a client should render as though it has focus
579  Only the window manager is allowed to change it.
580  @since 5.58
581  **/
582  Focused = 1u << 13,
583  };
584  /**
585  * Stores a combination of #State values.
586  */
587  Q_DECLARE_FLAGS(States, State)
588 
589  /**
590  Direction for WMMoveResize.
591 
592  When a client wants the Window Manager to start a WMMoveResize, it should
593  specify one of:
594 
595  @li TopLeft
596  @li Top
597  @li TopRight
598  @li Right
599  @li BottomRight
600  @li Bottom
601  @li BottomLeft
602  @li Left
603  @li Move (for movement only)
604  @li KeyboardSize (resizing via keyboard)
605  @li KeyboardMove (movement via keyboard)
606  **/
607 
608  enum Direction {
609  TopLeft = 0,
610  Top = 1,
611  TopRight = 2,
612  Right = 3,
613  BottomRight = 4,
614  Bottom = 5,
615  BottomLeft = 6,
616  Left = 7,
617  Move = 8, // movement only
618  KeyboardSize = 9, // size via keyboard
619  KeyboardMove = 10, // move via keyboard
620  MoveResizeCancel = 11, // to ask the WM to stop moving a window
621  };
622 
623  /**
624  Client window mapping state. The class automatically watches the mapping
625  state of the client windows, and uses the mapping state to determine how
626  to set/change different properties. Note that this is very lowlevel
627  and you most probably don't want to use this state.
628  **/
630  /**
631  indicates the client window is visible to the user.
632  **/
633  Visible = 1, // NormalState,
634  /**
635  indicates that neither the client window nor its icon is visible.
636  **/
637  Withdrawn = 0, // WithdrawnState,
638  /**
639  indicates that the client window is not visible, but its icon is.
640  This can be when the window is minimized or when it's on a
641  different virtual desktop. See also NET::Hidden.
642  **/
643  Iconic = 3, // IconicState
644  };
645 
646  /**
647  Actions that can be done with a window (_NET_WM_ALLOWED_ACTIONS).
648  @see Actions
649  **/
650  enum Action {
651  ActionMove = 1u << 0,
652  ActionResize = 1u << 1,
653  ActionMinimize = 1u << 2,
654  ActionShade = 1u << 3,
655  ActionStick = 1u << 4,
656  ActionMaxVert = 1u << 5,
657  ActionMaxHoriz = 1u << 6,
658  ActionMax = ActionMaxVert | ActionMaxHoriz,
659  ActionFullScreen = 1u << 7,
660  ActionChangeDesktop = 1u << 8,
661  ActionClose = 1u << 9,
662  };
663  /**
664  * Stores a combination of #Action values.
665  */
666  Q_DECLARE_FLAGS(Actions, Action)
667 
668  /**
669  Supported properties. Clients and Window Managers must define which
670  properties/protocols it wants to support.
671 
672  Root/Desktop window properties and protocols:
673 
674  @li Supported
675  @li ClientList
676  @li ClientListStacking
677  @li NumberOfDesktops
678  @li DesktopGeometry
679  @li DesktopViewport
680  @li CurrentDesktop
681  @li DesktopNames
682  @li ActiveWindow
683  @li WorkArea
684  @li SupportingWMCheck
685  @li VirtualRoots
686  @li CloseWindow
687  @li WMMoveResize
688 
689  Client window properties and protocols:
690 
691  @li WMName
692  @li WMVisibleName
693  @li WMDesktop
694  @li WMWindowType
695  @li WMState
696  @li WMStrut (obsoleted by WM2ExtendedStrut)
697  @li WMGeometry
698  @li WMFrameExtents
699  @li WMIconGeometry
700  @li WMIcon
701  @li WMIconName
702  @li WMVisibleIconName
703  @li WMHandledIcons
704  @li WMPid
705  @li WMPing
706 
707  ICCCM properties (provided for convenience):
708 
709  @li XAWMState
710 
711  @see Properties
712  **/
713 
714  enum Property {
715  // root
716  Supported = 1u << 0,
717  ClientList = 1u << 1,
718  ClientListStacking = 1u << 2,
719  NumberOfDesktops = 1u << 3,
720  DesktopGeometry = 1u << 4,
721  DesktopViewport = 1u << 5,
722  CurrentDesktop = 1u << 6,
723  DesktopNames = 1u << 7,
724  ActiveWindow = 1u << 8,
725  WorkArea = 1u << 9,
726  SupportingWMCheck = 1u << 10,
727  VirtualRoots = 1u << 11,
728  //
729  CloseWindow = 1u << 13,
730  WMMoveResize = 1u << 14,
731 
732  // window
733  WMName = 1u << 15,
734  WMVisibleName = 1u << 16,
735  WMDesktop = 1u << 17,
736  WMWindowType = 1u << 18,
737  WMState = 1u << 19,
738  WMStrut = 1u << 20,
739  WMIconGeometry = 1u << 21,
740  WMIcon = 1u << 22,
741  WMPid = 1u << 23,
742  WMHandledIcons = 1u << 24,
743  WMPing = 1u << 25,
744  XAWMState = 1u << 27,
745  WMFrameExtents = 1u << 28,
746 
747  // Need to be reordered
748  WMIconName = 1u << 29,
749  WMVisibleIconName = 1u << 30,
750  WMGeometry = 1u << 31,
751  WMAllProperties = ~0u,
752  };
753  /**
754  * Stores a combination of #Property values.
755  */
756  Q_DECLARE_FLAGS(Properties, Property)
757 
758  /**
759  Supported properties. This enum is an extension to NET::Property,
760  because them enum is limited only to 32 bits.
761 
762  Client window properties and protocols:
763 
764  @li WM2UserTime
765  @li WM2StartupId
766  @li WM2TransientFor mainwindow for the window (WM_TRANSIENT_FOR)
767  @li WM2GroupLeader group leader (window_group in WM_HINTS)
768  @li WM2AllowedActions
769  @li WM2RestackWindow
770  @li WM2MoveResizeWindow
771  @li WM2ExtendedStrut
772  @li WM2TemporaryRules internal, for kstart
773  @li WM2WindowClass WM_CLASS
774  @li WM2WindowRole WM_WINDOW_ROLE
775  @li WM2ClientMachine WM_CLIENT_MACHINE
776  @li WM2ShowingDesktop
777  @li WM2Opacity _NET_WM_WINDOW_OPACITY
778  @li WM2DesktopLayout _NET_DESKTOP_LAYOUT
779  @li WM2FullPlacement _NET_WM_FULL_PLACEMENT
780  @li WM2FullscreenMonitors _NET_WM_FULLSCREEN_MONITORS
781  @li WM2Urgency urgency hint in WM_HINTS (see ICCCM 4.1.2.4)
782  @li WM2Input input hint (input in WM_HINTS, see ICCCM 4.1.2.4)
783  @li WM2Protocols see NET::Protocol
784  @li WM2InitialMappingState initial state hint of WM_HINTS (see ICCCM 4.1.2.4)
785  @li WM2IconPixmap icon pixmap and mask in WM_HINTS (see ICCCM 4.1.2.4)
786  @li WM2OpaqueRegion
787  @li WM2DesktopFileName the base name of the desktop file name or the full path to the desktop file
788  @li WM2GTKFrameExtents extents of the shadow drawn by the client
789  @li WM2GTKApplicationId _GTK_APPLICATION_ID
790 
791  @see Properties2
792  **/
793  enum Property2 {
794  WM2UserTime = 1u << 0,
795  WM2StartupId = 1u << 1,
796  WM2TransientFor = 1u << 2,
797  WM2GroupLeader = 1u << 3,
798  WM2AllowedActions = 1u << 4,
799  WM2RestackWindow = 1u << 5,
800  WM2MoveResizeWindow = 1u << 6,
801  WM2ExtendedStrut = 1u << 7,
802  WM2KDETemporaryRules = 1u << 8, // NOT STANDARD
803  WM2WindowClass = 1u << 9,
804  WM2WindowRole = 1u << 10,
805  WM2ClientMachine = 1u << 11,
806  WM2ShowingDesktop = 1u << 12,
807  WM2Opacity = 1u << 13,
808  WM2DesktopLayout = 1u << 14,
809  WM2FullPlacement = 1u << 15,
810  WM2FullscreenMonitors = 1u << 16,
811  WM2FrameOverlap = 1u << 17, // NOT STANDARD
812  WM2Activities = 1u << 18, // NOT STANDARD @since 4.6
813  WM2BlockCompositing = 1u << 19, // NOT STANDARD @since 4.7, STANDARD @since 5.17
814  WM2KDEShadow = 1u << 20, // NOT Standard @since 4.7
815  WM2Urgency = 1u << 21, // @since 5.3
816  WM2Input = 1u << 22, // @since 5.3
817  WM2Protocols = 1u << 23, // @since 5.3
818  WM2InitialMappingState = 1u << 24, // @since 5.5
819  WM2IconPixmap = 1u << 25, // @since 5.7
820  WM2OpaqueRegion = 1u << 25, // @since 5.7
821  WM2DesktopFileName = 1u << 26, // NOT STANDARD @since 5.28
822  WM2GTKFrameExtents = 1u << 27, // NOT STANDARD @since 5.65
823  WM2AppMenuServiceName = 1u << 28, // NOT STANDARD @since 5.69
824  WM2AppMenuObjectPath = 1u << 29, // NOT STANDARD @since 5.69
825  WM2GTKApplicationId = 1u << 30, // NOT STANDARD @since 5.91
826  WM2AllProperties = ~0u,
827  };
828  /**
829  * Stores a combination of #Property2 values.
830  */
831  Q_DECLARE_FLAGS(Properties2, Property2)
832 
833  /**
834  Sentinel value to indicate that the client wishes to be visible on
835  all desktops.
836  **/
837  enum {
838  OnAllDesktops = -1,
839  };
840 
841  /**
842  Source of the request.
843  **/
844  // must match the values for data.l[0] field in _NET_ACTIVE_WINDOW message
846  /**
847  @internal indicates that the source of the request is unknown
848  **/
849  FromUnknown = 0, // internal
850  /**
851  indicates that the request comes from a normal application
852  **/
853  FromApplication = 1,
854  /**
855  indicated that the request comes from pager or similar tool
856  **/
857  FromTool = 2,
858  };
859 
860  /**
861  Orientation.
862  **/
863  enum Orientation {
864  OrientationHorizontal = 0,
865  OrientationVertical = 1,
866  };
867 
868  /**
869  Starting corner for desktop layout.
870  **/
872  DesktopLayoutCornerTopLeft = 0,
873  DesktopLayoutCornerTopRight = 1,
874  DesktopLayoutCornerBottomLeft = 2,
875  DesktopLayoutCornerBottomRight = 3,
876  };
877 
878  /**
879  * Protocols supported by the client.
880  * See ICCCM 4.1.2.7.
881  *
882  * @see Protocols
883  * @since 5.3
884  **/
885  enum Protocol {
886  NoProtocol = 0,
887  TakeFocusProtocol = 1 << 0, ///< WM_TAKE_FOCUS
888  DeleteWindowProtocol = 1 << 1, ///< WM_DELETE_WINDOW
889  PingProtocol = 1 << 2, ///< _NET_WM_PING from EWMH
890  SyncRequestProtocol = 1 << 3, ///< _NET_WM_SYNC_REQUEST from EWMH
891  ContextHelpProtocol = 1 << 4, ///< _NET_WM_CONTEXT_HELP, NON STANDARD!
892  };
893  /**
894  * Stores a combination of #Protocol values.
895  */
896  Q_DECLARE_FLAGS(Protocols, Protocol)
897 
898  /**
899  Compares two X timestamps, taking into account wrapping and 64bit architectures.
900  Return value is like with strcmp(), 0 for equal, -1 for time1 < time2, 1 for time1 > time2.
901  */
902  static int timestampCompare(unsigned long time1, unsigned long time2);
903  /**
904  Returns a difference of two X timestamps, time2 - time1, where time2 must be later than time1,
905  as returned by timestampCompare().
906  */
907  static int timestampDiff(unsigned long time1, unsigned long time2);
908 };
909 
910 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Properties)
911 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Properties2)
912 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::WindowTypes)
913 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::States)
914 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Actions)
915 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Protocols)
916 
917 #endif // netwm_def_h
int x
x coordinate.
Definition: netwm_def.h:51
NETIcon()
Constructor to initialize this icon to 0x0 with data=0.
Definition: netwm_def.h:151
@ Client
indicates that the application is a client application.
Definition: netwm_def.h:346
Property2
Supported properties.
Definition: netwm_def.h:793
QPoint topLeft() const const
QSize size() const const
int right
Right border of the strut.
Definition: netwm_def.h:252
unsigned char * data
Image data for the icon.
Definition: netwm_def.h:168
int left
Monitor index whose left border defines the left edge of the topology.
Definition: netwm_def.h:303
int left
Left border of the strut.
Definition: netwm_def.h:247
RequestSource
Source of the request.
Definition: netwm_def.h:845
Simple rectangle class for NET classes.
Definition: netwm_def.h:105
@ WindowManager
indicates that the application is a window manager application.
Definition: netwm_def.h:350
MappingState
Client window mapping state.
Definition: netwm_def.h:629
NETStrut()
Constructor to initialize this struct to 0,0,0,0.
Definition: netwm_def.h:236
Simple multiple monitor topology class for NET classes.
Definition: netwm_def.h:277
bool isSet() const
Convenience check to make sure that we are not holding the initial (invalid) values.
Definition: netwm_def.h:316
int bottom
Bottom border of the strut.
Definition: netwm_def.h:262
NETFullscreenMonitors()
Constructor to initialize this struct to -1,0,0,0 (an initialized, albeit invalid,...
Definition: netwm_def.h:282
int top_width
Top border of the strut, width and range.
Definition: netwm_def.h:213
NETSize size
Size of the rectangle.
Definition: netwm_def.h:133
Protocol
Protocols supported by the client.
Definition: netwm_def.h:885
Simple point class for NET classes.
Definition: netwm_def.h:27
Simple icon class for NET classes.
Definition: netwm_def.h:147
NETSize size
Size of the icon.
Definition: netwm_def.h:161
Simple size class for NET classes.
Definition: netwm_def.h:68
NETPoint pos
Position of the rectangle.
Definition: netwm_def.h:126
NETSize()
Constructor to initialize this size to 0x0.
Definition: netwm_def.h:72
int y
y coordinate
Definition: netwm_def.h:52
NETExtendedStrut()
Constructor to initialize this struct to 0,0,0,0.
Definition: netwm_def.h:184
NETPoint()
Constructor to initialize this point to 0,0.
Definition: netwm_def.h:31
int left_width
Left border of the strut, width and range.
Definition: netwm_def.h:203
int right_width
Right border of the strut, width and range.
Definition: netwm_def.h:208
Partial strut class for NET classes.
Definition: netwm_def.h:180
Role
Application role.
Definition: netwm_def.h:342
int bottom
Monitor index whose bottom border defines the bottom edge of the topology.
Definition: netwm_def.h:298
int height
Height.
Definition: netwm_def.h:92
int top
Top border of the strut.
Definition: netwm_def.h:257
Property
Supported properties.
Definition: netwm_def.h:714
Orientation
Orientation.
Definition: netwm_def.h:863
Base namespace class.
Definition: netwm_def.h:334
DesktopLayoutCorner
Starting corner for desktop layout.
Definition: netwm_def.h:871
int top
Monitor index whose top border defines the top edge of the topology.
Definition: netwm_def.h:293
int right
Monitor index whose right border defines the right edge of the topology.
Definition: netwm_def.h:308
WindowType
Window type.
Definition: netwm_def.h:357
int bottom_width
Bottom border of the strut, width and range.
Definition: netwm_def.h:218
int width
Width.
Definition: netwm_def.h:91
WindowTypeMask
Values for WindowType when they should be OR'ed together, e.g.
Definition: netwm_def.h:453
Direction
Direction for WMMoveResize.
Definition: netwm_def.h:608
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat May 28 2022 04:09:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.