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 <kwindowsystem_export.h>
11 #include <QFlags>
12 
26 struct NETPoint {
30  NETPoint() : x(0), y(0) { }
31 
32  /*
33  Public data member.
34  **/
35  int x,
36  y;
37 };
38 
52 struct NETSize {
56  NETSize() : width(0), height(0) { }
57 
58  /*
59  Public data member.
60  **/
61  int width,
62  height;
63 };
64 
75 struct NETRect {
82 
89 };
90 
102 struct NETIcon {
106  NETIcon() : data(nullptr) { }
107 
114 
120  unsigned char *data;
121 };
122 
136  NETExtendedStrut() : left_width(0), left_start(0), left_end(0),
137  right_width(0), right_start(0), right_end(0), top_width(0), top_start(0), top_end(0),
138  bottom_width(0), bottom_start(0), bottom_end(0) {}
139 
143  int left_width, left_start, left_end;
144 
148  int right_width, right_start, right_end;
149 
153  int top_width, top_start, top_end;
154 
158  int bottom_width, bottom_start, bottom_end;
159 
160 };
161 
173 struct NETStrut {
177  NETStrut() : left(0), right(0), top(0), bottom(0) { }
178 
182  int left;
183 
187  int right;
188 
192  int top;
193 
197  int bottom;
198 };
199 
217  NETFullscreenMonitors() : top(-1), bottom(0), left(0), right(0) { }
218 
222  int top;
223 
227  int bottom;
228 
232  int left;
233 
237  int right;
238 
245  bool isSet() const
246  {
247  return (top != -1);
248  }
249 };
250 
263 class KWINDOWSYSTEM_EXPORT NET
264 {
265 public:
271  enum Role {
279  WindowManager
280  };
281 
286  enum WindowType {
290  Unknown = -1,
294  Normal = 0,
301  Desktop = 1,
305  Dock = 2,
309  Toolbar = 3,
313  Menu = 4,
317  Dialog = 5,
318  // cannot deprecate to compiler: used both by clients & manager, later needs to keep supporting it for now
319  // KF6: remove
323  Override = 6, // NON STANDARD
328  TopMenu = 7, // NON STANDARD
332  Utility = 8,
336  Splash = 9,
340  DropdownMenu = 10,
344  PopupMenu = 11,
348  Tooltip = 12,
352  Notification = 13,
356  ComboBox = 14,
360  DNDIcon = 15,
365  OnScreenDisplay = 16, // NON STANDARD
370  CriticalNotification = 17, // NON STANDARD
371  };
372 
379  NormalMask = 1u << 0,
380  DesktopMask = 1u << 1,
381  DockMask = 1u << 2,
382  ToolbarMask = 1u << 3,
383  MenuMask = 1u << 4,
384  DialogMask = 1u << 5,
385  OverrideMask = 1u << 6,
386  TopMenuMask = 1u << 7,
387  UtilityMask = 1u << 8,
388  SplashMask = 1u << 9,
389  DropdownMenuMask = 1u << 10,
390  PopupMenuMask = 1u << 11,
391  TooltipMask = 1u << 12,
392  NotificationMask = 1u << 13,
393  ComboBoxMask = 1u << 14,
394  DNDIconMask = 1u << 15,
395  OnScreenDisplayMask = 1u << 16,
396  CriticalNotificationMask = 1u << 17,
397  AllTypesMask = 0U - 1
398  };
402  Q_DECLARE_FLAGS(WindowTypes, WindowTypeMask)
403 
404 
408  static bool typeMatchesMask(WindowType type, WindowTypes mask);
409 
427  enum State {
433  Modal = 1u << 0,
439  Sticky = 1u << 1,
443  MaxVert = 1u << 2,
447  MaxHoriz = 1u << 3,
451  Max = MaxVert | MaxHoriz,
455  Shaded = 1u << 4,
459  SkipTaskbar = 1u << 5,
464  KeepAbove = 1u << 6,
465 #if KWINDOWSYSTEM_ENABLE_DEPRECATED_SINCE(5, 0)
466 
469  StaysOnTop = KeepAbove, // NOT STANDARD
470 #endif
471 
474  SkipPager = 1u << 7,
479  Hidden = 1u << 8,
484  FullScreen = 1u << 9,
488  KeepBelow = 1u << 10,
494  DemandsAttention = 1u << 11,
500  SkipSwitcher = 1u << 12,
506  Focused = 1u << 13,
507  };
511  Q_DECLARE_FLAGS(States, State)
512 
513 
532  enum Direction {
533  TopLeft = 0,
534  Top = 1,
535  TopRight = 2,
536  Right = 3,
537  BottomRight = 4,
538  Bottom = 5,
539  BottomLeft = 6,
540  Left = 7,
541  Move = 8, // movement only
542  KeyboardSize = 9, // size via keyboard
543  KeyboardMove = 10, // move via keyboard
544  MoveResizeCancel = 11 // to ask the WM to stop moving a window
545  };
546 
557  Visible = 1, //NormalState,
561  Withdrawn = 0, //WithdrawnState,
567  Iconic = 3 // IconicState
568  };
569 
574  enum Action {
575  ActionMove = 1u << 0,
576  ActionResize = 1u << 1,
577  ActionMinimize = 1u << 2,
578  ActionShade = 1u << 3,
579  ActionStick = 1u << 4,
580  ActionMaxVert = 1u << 5,
581  ActionMaxHoriz = 1u << 6,
582  ActionMax = ActionMaxVert | ActionMaxHoriz,
583  ActionFullScreen = 1u << 7,
584  ActionChangeDesktop = 1u << 8,
585  ActionClose = 1u << 9
586  };
590  Q_DECLARE_FLAGS(Actions, Action)
591 
592 
638  enum Property {
639  // root
640  Supported = 1u << 0,
641  ClientList = 1u << 1,
642  ClientListStacking = 1u << 2,
643  NumberOfDesktops = 1u << 3,
644  DesktopGeometry = 1u << 4,
645  DesktopViewport = 1u << 5,
646  CurrentDesktop = 1u << 6,
647  DesktopNames = 1u << 7,
648  ActiveWindow = 1u << 8,
649  WorkArea = 1u << 9,
650  SupportingWMCheck = 1u << 10,
651  VirtualRoots = 1u << 11,
652  //
653  CloseWindow = 1u << 13,
654  WMMoveResize = 1u << 14,
655 
656  // window
657  WMName = 1u << 15,
658  WMVisibleName = 1u << 16,
659  WMDesktop = 1u << 17,
660  WMWindowType = 1u << 18,
661  WMState = 1u << 19,
662  WMStrut = 1u << 20,
663  WMIconGeometry = 1u << 21,
664  WMIcon = 1u << 22,
665  WMPid = 1u << 23,
666  WMHandledIcons = 1u << 24,
667  WMPing = 1u << 25,
668  XAWMState = 1u << 27,
669  WMFrameExtents = 1u << 28,
670 
671  // Need to be reordered
672  WMIconName = 1u << 29,
673  WMVisibleIconName = 1u << 30,
674  WMGeometry = 1u << 31,
675  WMAllProperties = ~0u
676  };
680  Q_DECLARE_FLAGS(Properties, Property)
681 
682 
716  enum Property2 {
717  WM2UserTime = 1u << 0,
718  WM2StartupId = 1u << 1,
719  WM2TransientFor = 1u << 2,
720  WM2GroupLeader = 1u << 3,
721  WM2AllowedActions = 1u << 4,
722  WM2RestackWindow = 1u << 5,
723  WM2MoveResizeWindow = 1u << 6,
724  WM2ExtendedStrut = 1u << 7,
725  WM2KDETemporaryRules = 1u << 8, // NOT STANDARD
726  WM2WindowClass = 1u << 9,
727  WM2WindowRole = 1u << 10,
728  WM2ClientMachine = 1u << 11,
729  WM2ShowingDesktop = 1u << 12,
730  WM2Opacity = 1u << 13,
731  WM2DesktopLayout = 1u << 14,
732  WM2FullPlacement = 1u << 15,
733  WM2FullscreenMonitors = 1u << 16,
734  WM2FrameOverlap = 1u << 17, // NOT STANDARD
735  WM2Activities = 1u << 18, // NOT STANDARD @since 4.6
736  WM2BlockCompositing = 1u << 19, // NOT STANDARD @since 4.7, STANDARD @since 5.17
737  WM2KDEShadow = 1u << 20, // NOT Standard @since 4.7
738  WM2Urgency = 1u << 21, // @since 5.3
739  WM2Input = 1u << 22, // @since 5.3
740  WM2Protocols = 1u << 23, // @since 5.3
741  WM2InitialMappingState = 1u << 24, // @since 5.5
742  WM2IconPixmap = 1u << 25, // @since 5.7
743  WM2OpaqueRegion = 1u << 25, // @since 5.7
744  WM2DesktopFileName = 1u << 26, // NOT STANDARD @since 5.28
745  WM2GTKFrameExtents = 1u << 27, // NOT STANDARD @since 5.65
746  WM2AppMenuServiceName = 1u << 28, // NOT STANDARD @since 5.69
747  WM2AppMenuObjectPath = 1u << 29, // NOT STANDARD @since 5.69
748  WM2AllProperties = ~0u
749  };
753  Q_DECLARE_FLAGS(Properties2, Property2)
754 
755 
759  enum { OnAllDesktops = -1 };
760 
764  // must match the values for data.l[0] field in _NET_ACTIVE_WINDOW message
769  FromUnknown = 0, // internal
773  FromApplication = 1,
777  FromTool = 2
778  };
779 
783  enum Orientation {
784  OrientationHorizontal = 0,
785  OrientationVertical = 1
786  };
787 
792  DesktopLayoutCornerTopLeft = 0,
793  DesktopLayoutCornerTopRight = 1,
794  DesktopLayoutCornerBottomLeft = 2,
795  DesktopLayoutCornerBottomRight = 3
796  };
797 
805  enum Protocol {
806  NoProtocol = 0,
807  TakeFocusProtocol = 1 << 0,
808  DeleteWindowProtocol = 1 << 1,
809  PingProtocol = 1 << 2,
810  SyncRequestProtocol = 1 << 3,
811  ContextHelpProtocol = 1 << 4
812  };
816  Q_DECLARE_FLAGS(Protocols, Protocol)
817 
818 
822  static int timestampCompare(unsigned long time1, unsigned long time2);
827  static int timestampDiff(unsigned long time1, unsigned long time2);
828 
829 };
830 
831 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Properties)
832 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Properties2)
833 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::WindowTypes)
834 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::States)
835 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Actions)
836 Q_DECLARE_OPERATORS_FOR_FLAGS(NET::Protocols)
837 
838 #endif // netwm_def_h
Simple icon class for NET classes.
Definition: netwm_def.h:102
Protocol
Protocols supported by the client.
Definition: netwm_def.h:805
int bottom
Bottom border of the strut.
Definition: netwm_def.h:197
int bottom_width
Bottom border of the strut, width and range.
Definition: netwm_def.h:158
Property2
Supported properties.
Definition: netwm_def.h:716
unsigned char * data
Image data for the icon.
Definition: netwm_def.h:120
Simple multiple monitor topology class for NET classes.
Definition: netwm_def.h:212
int right
Right border of the strut.
Definition: netwm_def.h:187
int y
y coordinate
Definition: netwm_def.h:35
Left
NETStrut()
Constructor to initialize this struct to 0,0,0,0.
Definition: netwm_def.h:177
State
Window state.
Definition: netwm_def.h:427
NETPoint()
Constructor to initialize this point to 0,0.
Definition: netwm_def.h:30
Partial strut class for NET classes.
Definition: netwm_def.h:132
int bottom
Monitor index whose bottom border defines the bottom edge of the topology.
Definition: netwm_def.h:227
int left
Left border of the strut.
Definition: netwm_def.h:182
Orientation
Orientation.
Definition: netwm_def.h:783
Direction
Direction for WMMoveResize.
Definition: netwm_def.h:532
NETIcon()
Constructor to initialize this icon to 0x0 with data=0.
Definition: netwm_def.h:106
MappingState
Client window mapping state.
Definition: netwm_def.h:553
Role
Application role.
Definition: netwm_def.h:271
int right
Monitor index whose right border defines the right edge of the topology.
Definition: netwm_def.h:237
NETSize size
Size of the rectangle.
Definition: netwm_def.h:88
WindowType
Window type.
Definition: netwm_def.h:286
int x
x coordinate.
Definition: netwm_def.h:35
NETSize size
Size of the icon.
Definition: netwm_def.h:113
Property
Supported properties.
Definition: netwm_def.h:638
bool isSet() const
Convenience check to make sure that we are not holding the initial (invalid) values.
Definition: netwm_def.h:245
NETPoint pos
Position of the rectangle.
Definition: netwm_def.h:81
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:222
int top_width
Top border of the strut, width and range.
Definition: netwm_def.h:153
NETExtendedStrut()
Constructor to initialize this struct to 0,0,0,0.
Definition: netwm_def.h:136
int left
Monitor index whose left border defines the left edge of the topology.
Definition: netwm_def.h:232
Right
Simple rectangle class for NET classes.
Definition: netwm_def.h:75
Base namespace class.
Definition: netwm_def.h:263
NETSize()
Constructor to initialize this size to 0x0.
Definition: netwm_def.h:56
Top
int width
Width.
Definition: netwm_def.h:61
int right_width
Right border of the strut, width and range.
Definition: netwm_def.h:148
NETFullscreenMonitors()
Constructor to initialize this struct to -1,0,0,0 (an initialized, albeit invalid, topology).
Definition: netwm_def.h:217
Action
Actions that can be done with a window (_NET_WM_ALLOWED_ACTIONS).
Definition: netwm_def.h:574
int left_width
Left border of the strut, width and range.
Definition: netwm_def.h:143
indicates that the application is a client application.
Definition: netwm_def.h:275
WindowTypeMask
Values for WindowType when they should be OR&#39;ed together, e.g.
Definition: netwm_def.h:378
DesktopLayoutCorner
Starting corner for desktop layout.
Definition: netwm_def.h:791
int top
Top border of the strut.
Definition: netwm_def.h:192
RequestSource
Source of the request.
Definition: netwm_def.h:765
Simple size class for NET classes.
Definition: netwm_def.h:52
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 22:41:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.