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

KDE's Doxygen guidelines are available online.