netwm_def.h
/*
Copyright (c) 2000 Troll Tech AS
Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef __netwm_def_h
#define __netwm_def_h
#include <kdelibs_export.h>
struct NETPoint {
NETPoint() : x(0), y(0) { }
/*
Public data member.
**/
int x,
y;
};
struct NETSize {
NETSize() : width(0), height(0) { }
/*
Public data member.
**/
int width,
height;
};
struct NETRect {
NETPoint pos;
NETSize size;
};
struct NETIcon {
NETIcon() : data(0) { }
NETSize size;
unsigned char *data;
};
struct NETExtendedStrut {
NETExtendedStrut() : left_width(0), left_start(0), left_end(0),
right_width(0), right_start(0), right_end(0), top_width(0), top_start(0), top_end(0),
bottom_width(0), bottom_start(0), bottom_end(0) {}
int left_width, left_start, left_end;
int right_width, right_start, right_end;
int top_width, top_start, top_end;
int bottom_width, bottom_start, bottom_end;
};
struct NETStrut {
NETStrut() : left(0), right(0), top(0), bottom(0) { }
int left;
int right;
int top;
int bottom;
};
class KDECORE_EXPORT NET {
public:
enum Role {
Client,
WindowManager
};
enum WindowType {
Unknown = -1,
Normal = 0,
Desktop = 1,
Dock = 2,
Toolbar = 3,
Menu = 4,
Dialog = 5,
Override = 6,
TopMenu = 7, // NON STANDARD
Tool = Toolbar, // This will go away soon, COMPAT (How soon? :)
Utility = 8,
Splash = 9,
DropdownMenu = 10,
PopupMenu = 11,
Tooltip = 12,
Notification = 13,
ComboBox = 14,
DNDIcon = 15
};
enum WindowTypeMask {
NormalMask = 1<<0,
DesktopMask = 1<<1,
DockMask = 1<<2,
ToolbarMask = 1<<3,
MenuMask = 1<<4,
DialogMask = 1<<5,
OverrideMask = 1<<6,
TopMenuMask = 1<<7,
UtilityMask = 1<<8,
SplashMask = 1<<9,
DropdownMenuMask = 1<<10,
PopupMenuMask = 1<<11,
TooltipMask = 1<<12,
NotificationMask = 1<<13,
ComboBoxMask = 1<<14,
DNDIconMask = 1<<15
};
// KDE4 move to WindowTypeMask
enum { AllTypesMask = 0LU-1 };
static bool typeMatchesMask( WindowType type, unsigned long mask );
enum State {
Modal = 1<<0,
Sticky = 1<<1,
MaxVert = 1<<2,
MaxHoriz = 1<<3,
Max = MaxVert | MaxHoriz,
Shaded = 1<<4,
SkipTaskbar = 1<<5,
KeepAbove = 1<<6,
StaysOnTop = KeepAbove, // NOT STANDARD
SkipPager = 1<<7,
Hidden = 1<<8,
FullScreen = 1<<9,
KeepBelow = 1<<10,
DemandsAttention = 1<<11
};
enum Direction {
TopLeft = 0,
Top = 1,
TopRight = 2,
Right = 3,
BottomRight = 4,
Bottom = 5,
BottomLeft = 6,
Left = 7,
Move = 8, // movement only
KeyboardSize = 9, // size via keyboard
KeyboardMove = 10, // move via keyboard
MoveResizeCancel = 11 // to ask the WM to stop moving a window
};
// KDE4 aaarghl, this doesn't map correctly to Xlib #defines
enum MappingState {
Visible, // ie. NormalState
Withdrawn,
Iconic
};
enum Action {
ActionMove = 1<<0,
ActionResize = 1<<1,
ActionMinimize = 1<<2,
ActionShade = 1<<3,
ActionStick = 1<<4,
ActionMaxVert = 1<<5,
ActionMaxHoriz = 1<<6,
ActionMax = ActionMaxVert | ActionMaxHoriz,
ActionFullScreen = 1<<7,
ActionChangeDesktop = 1<<8,
ActionClose = 1<<9
};
enum Property {
// root
Supported = 1<<0,
ClientList = 1<<1,
ClientListStacking = 1<<2,
NumberOfDesktops = 1<<3,
DesktopGeometry = 1<<4,
DesktopViewport = 1<<5,
CurrentDesktop = 1<<6,
DesktopNames = 1<<7,
ActiveWindow = 1<<8,
WorkArea = 1<<9,
SupportingWMCheck = 1<<10,
VirtualRoots = 1<<11,
KDESystemTrayWindows = 1<<12, // NOT STANDARD
CloseWindow = 1<<13,
WMMoveResize = 1<<14,
// window
WMName = 1<<15,
WMVisibleName = 1<<16,
WMDesktop = 1<<17,
WMWindowType = 1<<18,
WMState = 1<<19,
WMStrut = 1<<20,
WMIconGeometry = 1<<21,
WMIcon = 1<<22,
WMPid = 1<<23,
WMHandledIcons = 1<<24,
WMPing = 1<<25,
WMKDESystemTrayWinFor = 1<<26, // NOT STANDARD
XAWMState = 1<<27, // NOT STANDARD
WMFrameExtents = 1<<28,
WMKDEFrameStrut = WMFrameExtents, // NOT STANDARD
// Need to be reordered
WMIconName = 1<<29,
WMVisibleIconName = 1<<30,
WMGeometry = 1<<31
};
enum Property2 {
WM2UserTime = 1<<0,
WM2StartupId = 1<<1,
WM2TransientFor = 1<<2,
WM2GroupLeader = 1<<3,
WM2AllowedActions = 1<<4,
WM2RestackWindow = 1<<5,
WM2MoveResizeWindow = 1<<6,
WM2ExtendedStrut = 1<<7,
WM2TakeActivity = 1<<8,
WM2KDETemporaryRules = 1<<9, // NOT STANDARD
WM2WindowClass = 1<<10,
WM2WindowRole = 1<<11,
WM2ClientMachine = 1<<12,
WM2ShowingDesktop = 1<<13,
WM2DesktopLayout = 1<<15
};
enum { OnAllDesktops = -1 };
// must match the values for data.l[0] field in _NET_ACTIVE_WINDOW message
enum RequestSource {
FromUnknown, // internal
FromApplication,
FromTool
};
enum Orientation {
OrientationHorizontal = 0,
OrientationVertical = 1
};
enum DesktopLayoutCorner {
DesktopLayoutCornerTopLeft = 0,
DesktopLayoutCornerTopRight = 1,
DesktopLayoutCornerBottomLeft = 2,
DesktopLayoutCornerBottomRight = 3
};
static int timestampCompare( unsigned long time1, unsigned long time2 );
static int timestampDiff( unsigned long time1_, unsigned long time2_ );
};
#endif // __netwm_def_h
NETIcon
Simple icon class for NET classes.
Definition: netwm_def.h:122
NETStrut
Definition: netwm_def.h:195
NETStrut::bottom
int bottom
Bottom border of the strut.
Definition: netwm_def.h:219
NETExtendedStrut::bottom_width
int bottom_width
Bottom border of the strut, width and range.
Definition: netwm_def.h:179
NET::Property2
Property2
Supported properties.
Definition: netwm_def.h:598
NETIcon::data
unsigned char * data
Image data for the icon.
Definition: netwm_def.h:140
NETStrut::right
int right
Right border of the strut.
Definition: netwm_def.h:209
NETPoint::y
int y
y coordinate
Definition: netwm_def.h:53
NETStrut::NETStrut
NETStrut()
Constructor to initialize this struct to 0,0,0,0.
Definition: netwm_def.h:199
NET::State
State
Window state.
Definition: netwm_def.h:389
NETPoint::NETPoint
NETPoint()
Constructor to initialize this point to 0,0.
Definition: netwm_def.h:48
NETExtendedStrut
Partial strut class for NET classes.
Definition: netwm_def.h:153
NETStrut::left
int left
Left border of the strut.
Definition: netwm_def.h:204
NET::Orientation
Orientation
Orientation.
Definition: netwm_def.h:639
NET::Direction
Direction
Direction for WMMoveResize.
Definition: netwm_def.h:425
NETIcon::NETIcon
NETIcon()
Constructor to initialize this icon to 0x0 with data=0.
Definition: netwm_def.h:126
NET::MappingState
MappingState
Client window mapping state.
Definition: netwm_def.h:464
NET::Role
Role
Application role.
Definition: netwm_def.h:247
NETRect::size
NETSize size
Size of the rectangle.
Definition: netwm_def.h:107
NET::WindowType
WindowType
Window type.
Definition: netwm_def.h:294
NETPoint::x
int x
x coordinate.
Definition: netwm_def.h:53
NETIcon::size
NETSize size
Size of the icon.
Definition: netwm_def.h:133
NET::Property
Property
Supported properties.
Definition: netwm_def.h:534
NETRect::pos
NETPoint pos
Position of the rectangle.
Definition: netwm_def.h:100
NETPoint
Simple point class for NET classes.
Definition: netwm_def.h:44
NETExtendedStrut::top_width
int top_width
Top border of the strut, width and range.
Definition: netwm_def.h:174
NETExtendedStrut::NETExtendedStrut
NETExtendedStrut()
Constructor to initialize this struct to 0,0,0,0.
Definition: netwm_def.h:157
NETRect
Simple rectangle class for NET classes.
Definition: netwm_def.h:94
NET
Base namespace class.
Definition: netwm_def.h:235
NETSize::NETSize
NETSize()
Constructor to initialize this size to 0x0.
Definition: netwm_def.h:75
NETSize::width
int width
Width.
Definition: netwm_def.h:80
NETExtendedStrut::right_width
int right_width
Right border of the strut, width and range.
Definition: netwm_def.h:169
NET::Action
Action
Actions that can be done with a window (_NET_WM_ALLOWED_ACTIONS).
Definition: netwm_def.h:474
NETSize::height
int height
Height.
Definition: netwm_def.h:80
NETExtendedStrut::left_width
int left_width
Left border of the strut, width and range.
Definition: netwm_def.h:164
NET::WindowTypeMask
WindowTypeMask
Values for WindowType when they should be OR'ed together, e.g.
Definition: netwm_def.h:320
NET::DesktopLayoutCorner
DesktopLayoutCorner
Starting corner for desktop layout.
Definition: netwm_def.h:647
NETStrut::top
int top
Top border of the strut.
Definition: netwm_def.h:214
NET::RequestSource
RequestSource
Source of the request.
Definition: netwm_def.h:630
NETSize
Simple size class for NET classes.
Definition: netwm_def.h:71

KDE Home | KDE Accessibility Home | Description of Access Keys