00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __netwm_def_h
00027 #define __netwm_def_h
00028
00029 #include <kdelibs_export.h>
00030
00044 struct NETPoint {
00048 NETPoint() : x(0), y(0) { }
00049
00050
00051
00052
00053 int x,
00054 y;
00055 };
00056
00057
00071 struct NETSize {
00075 NETSize() : width(0), height(0) { }
00076
00077
00078
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 KDECORE_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,
00304 Tool = Toolbar,
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
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,
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,
00438 KeyboardSize = 9,
00442 KeyboardMove = 10,
00446 MoveResizeCancel = 11
00447 };
00448
00463
00464 enum MappingState {
00465 Visible,
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
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,
00549 CloseWindow = 1<<13,
00550 WMMoveResize = 1<<14,
00551
00552
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,
00565 XAWMState = 1<<27,
00566 WMFrameExtents = 1<<28,
00567 WMKDEFrameStrut = WMFrameExtents,
00568
00569
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,
00609 WM2WindowClass = 1<<10,
00610 WM2WindowRole = 1<<11,
00611 WM2ClientMachine = 1<<12,
00612 WM2ShowingDesktop = 1<<13,
00613 WM2DesktopLayout = 1<<15
00614 };
00615
00621 enum { OnAllDesktops = -1 };
00622
00629
00630 enum RequestSource {
00631 FromUnknown,
00632 FromApplication,
00633 FromTool
00634 };
00635
00639 enum Orientation {
00640 OrientationHorizontal = 0,
00641 OrientationVertical = 1
00642 };
00643
00647 enum DesktopLayoutCorner {
00648 DesktopLayoutCornerTopLeft = 0,
00649 DesktopLayoutCornerTopRight = 1,
00650 DesktopLayoutCornerBottomLeft = 2,
00651 DesktopLayoutCornerBottomRight = 3
00652 };
00653
00659 static int timestampCompare( unsigned long time1, unsigned long time2 );
00665 static int timestampDiff( unsigned long time1_, unsigned long time2_ );
00666
00667 };
00668
00669
00670 #endif // __netwm_def_h