netwm_def.h
00001 /* 00002 00003 Copyright (c) 2000 Troll Tech AS 00004 Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org> 00005 00006 Permission is hereby granted, free of charge, to any person obtaining a 00007 copy of this software and associated documentation files (the "Software"), 00008 to deal in the Software without restriction, including without limitation 00009 the rights to use, copy, modify, merge, publish, distribute, sublicense, 00010 and/or sell copies of the Software, and to permit persons to whom the 00011 Software is furnished to do so, subject to the following conditions: 00012 00013 The above copyright notice and this permission notice shall be included in 00014 all copies or substantial portions of the Software. 00015 00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00019 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00020 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00021 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00022 DEALINGS IN THE SOFTWARE. 00023 00024 */ 00025 00026 #ifndef __netwm_def_h 00027 #define __netwm_def_h 00028 00029 #include <tdelibs_export.h> 00030 00044 struct NETPoint { 00048 NETPoint() : x(0), y(0) { } 00049 00050 /* 00051 Public data member. 00052 **/ 00053 int x, 00054 y; 00055 }; 00056 00057 00071 struct NETSize { 00075 NETSize() : width(0), height(0) { } 00076 00077 /* 00078 Public data member. 00079 **/ 00080 int width, 00081 height; 00082 }; 00083 00094 struct NETRect { 00100 NETPoint pos; 00101 00107 NETSize size; 00108 }; 00109 00110 00122 struct NETIcon { 00126 NETIcon() : data(0) { } 00127 00133 NETSize size; 00134 00140 unsigned char *data; 00141 }; 00142 00143 00153 struct NETExtendedStrut { 00157 NETExtendedStrut() : left_width(0), left_start(0), left_end(0), 00158 right_width(0), right_start(0), right_end(0), top_width(0), top_start(0), top_end(0), 00159 bottom_width(0), bottom_start(0), bottom_end(0) {} 00160 00164 int left_width, left_start, left_end; 00165 00169 int right_width, right_start, right_end; 00170 00174 int top_width, top_start, top_end; 00175 00179 int bottom_width, bottom_start, bottom_end; 00180 00181 }; 00182 00183 00195 struct NETStrut { 00199 NETStrut() : left(0), right(0), top(0), bottom(0) { } 00200 00204 int left; 00205 00209 int right; 00210 00214 int top; 00215 00219 int bottom; 00220 }; 00221 00222 00235 class TDECORE_EXPORT NET { 00236 public: 00247 enum Role { 00248 Client, 00249 WindowManager 00250 }; 00251 00294 enum WindowType { 00295 Unknown = -1, 00296 Normal = 0, 00297 Desktop = 1, 00298 Dock = 2, 00299 Toolbar = 3, 00300 Menu = 4, 00301 Dialog = 5, 00302 Override = 6, 00303 TopMenu = 7, // NON STANDARD 00304 Tool = Toolbar, // This will go away soon, COMPAT (How soon? :) 00305 Utility = 8, 00306 Splash = 9, 00307 DropdownMenu = 10, 00308 PopupMenu = 11, 00309 Tooltip = 12, 00310 Notification = 13, 00311 ComboBox = 14, 00312 DNDIcon = 15 00313 }; 00314 00320 enum WindowTypeMask { 00321 NormalMask = 1<<0, 00322 DesktopMask = 1<<1, 00323 DockMask = 1<<2, 00324 ToolbarMask = 1<<3, 00325 MenuMask = 1<<4, 00326 DialogMask = 1<<5, 00327 OverrideMask = 1<<6, 00328 TopMenuMask = 1<<7, 00329 UtilityMask = 1<<8, 00330 SplashMask = 1<<9, 00331 DropdownMenuMask = 1<<10, 00332 PopupMenuMask = 1<<11, 00333 TooltipMask = 1<<12, 00334 NotificationMask = 1<<13, 00335 ComboBoxMask = 1<<14, 00336 DNDIconMask = 1<<15 00337 }; 00338 00339 // KDE4 move to WindowTypeMask 00340 enum { AllTypesMask = 0LU-1 }; 00341 00346 static bool typeMatchesMask( WindowType type, unsigned long mask ); 00347 00389 enum State { 00390 Modal = 1<<0, 00391 Sticky = 1<<1, 00392 MaxVert = 1<<2, 00393 MaxHoriz = 1<<3, 00394 Max = MaxVert | MaxHoriz, 00395 Shaded = 1<<4, 00396 SkipTaskbar = 1<<5, 00397 KeepAbove = 1<<6, 00398 StaysOnTop = KeepAbove, // NOT STANDARD 00399 SkipPager = 1<<7, 00400 Hidden = 1<<8, 00401 FullScreen = 1<<9, 00402 KeepBelow = 1<<10, 00403 DemandsAttention = 1<<11 00404 }; 00405 00425 enum Direction { 00426 TopLeft = 0, 00427 Top = 1, 00428 TopRight = 2, 00429 Right = 3, 00430 BottomRight = 4, 00431 Bottom = 5, 00432 BottomLeft = 6, 00433 Left = 7, 00434 Move = 8, // movement only 00438 KeyboardSize = 9, // size via keyboard 00442 KeyboardMove = 10, // move via keyboard 00446 MoveResizeCancel = 11 // to ask the WM to stop moving a window 00447 }; 00448 00463 // KDE4 aaarghl, this doesn't map correctly to Xlib #defines 00464 enum MappingState { 00465 Visible, // ie. NormalState 00466 Withdrawn, 00467 Iconic 00468 }; 00469 00474 enum Action { 00475 ActionMove = 1<<0, 00476 ActionResize = 1<<1, 00477 ActionMinimize = 1<<2, 00478 ActionShade = 1<<3, 00479 ActionStick = 1<<4, 00480 ActionMaxVert = 1<<5, 00481 ActionMaxHoriz = 1<<6, 00482 ActionMax = ActionMaxVert | ActionMaxHoriz, 00483 ActionFullScreen = 1<<7, 00484 ActionChangeDesktop = 1<<8, 00485 ActionClose = 1<<9 00486 }; 00487 00534 enum Property { 00535 // root 00536 Supported = 1<<0, 00537 ClientList = 1<<1, 00538 ClientListStacking = 1<<2, 00539 NumberOfDesktops = 1<<3, 00540 DesktopGeometry = 1<<4, 00541 DesktopViewport = 1<<5, 00542 CurrentDesktop = 1<<6, 00543 DesktopNames = 1<<7, 00544 ActiveWindow = 1<<8, 00545 WorkArea = 1<<9, 00546 SupportingWMCheck = 1<<10, 00547 VirtualRoots = 1<<11, 00548 KDESystemTrayWindows = 1<<12, // NOT STANDARD 00549 CloseWindow = 1<<13, 00550 WMMoveResize = 1<<14, 00551 00552 // window 00553 WMName = 1<<15, 00554 WMVisibleName = 1<<16, 00555 WMDesktop = 1<<17, 00556 WMWindowType = 1<<18, 00557 WMState = 1<<19, 00558 WMStrut = 1<<20, 00559 WMIconGeometry = 1<<21, 00560 WMIcon = 1<<22, 00561 WMPid = 1<<23, 00562 WMHandledIcons = 1<<24, 00563 WMPing = 1<<25, 00564 WMKDESystemTrayWinFor = 1<<26, // NOT STANDARD 00565 XAWMState = 1<<27, // NOT STANDARD 00566 WMFrameExtents = 1<<28, 00567 WMKDEFrameStrut = WMFrameExtents, // NOT STANDARD 00568 00569 // Need to be reordered 00570 WMIconName = 1<<29, 00571 WMVisibleIconName = 1<<30, 00572 WMGeometry = 1<<31 00573 }; 00574 00598 enum Property2 { 00599 WM2UserTime = 1<<0, 00600 WM2StartupId = 1<<1, 00601 WM2TransientFor = 1<<2, 00602 WM2GroupLeader = 1<<3, 00603 WM2AllowedActions = 1<<4, 00604 WM2RestackWindow = 1<<5, 00605 WM2MoveResizeWindow = 1<<6, 00606 WM2ExtendedStrut = 1<<7, 00607 WM2TakeActivity = 1<<8, 00608 WM2KDETemporaryRules = 1<<9, // NOT STANDARD 00609 WM2WindowClass = 1<<10, 00610 WM2WindowRole = 1<<11, 00611 WM2ClientMachine = 1<<12, 00612 WM2ShowingDesktop = 1<<13, 00613 WM2FullPlacement = 1<<14, 00614 WM2DesktopLayout = 1<<15 00615 }; 00616 00622 enum { OnAllDesktops = -1 }; 00623 00630 // must match the values for data.l[0] field in _NET_ACTIVE_WINDOW message 00631 enum RequestSource { 00632 FromUnknown, // internal 00633 FromApplication, 00634 FromTool 00635 }; 00636 00640 enum Orientation { 00641 OrientationHorizontal = 0, 00642 OrientationVertical = 1 00643 }; 00644 00648 enum DesktopLayoutCorner { 00649 DesktopLayoutCornerTopLeft = 0, 00650 DesktopLayoutCornerTopRight = 1, 00651 DesktopLayoutCornerBottomLeft = 2, 00652 DesktopLayoutCornerBottomRight = 3 00653 }; 00654 00660 static int timestampCompare( unsigned long time1, unsigned long time2 ); 00666 static int timestampDiff( unsigned long time1_, unsigned long time2_ ); 00667 00668 }; 00669 00670 00671 #endif // __netwm_def_h