kdecore Library API Documentation

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 
00042 struct NETPoint {
00046     NETPoint() : x(0), y(0) { }
00047 
00048     /*
00049        Public data member.
00050     **/
00051     int x, 
00052       y;   
00053 };
00054 
00055 
00069 struct NETSize {
00073     NETSize() : width(0), height(0) { }
00074 
00075     /*
00076        Public data member.
00077     **/
00078     int width,  
00079       height;   
00080 };
00081 
00092 struct NETRect {
00098     NETPoint pos;
00099 
00105     NETSize size;
00106 };
00107 
00108 
00120 struct NETIcon {
00124     NETIcon() : data(0) { }
00125 
00131     NETSize size;
00132 
00138     unsigned char *data;
00139 };
00140 
00141 
00151 struct NETExtendedStrut {
00155     NETExtendedStrut() : left_width(0), left_start(0), left_end(0),
00156         right_width(0), right_start(0), right_end(0), top_width(0), top_start(0), top_end(0),
00157         bottom_width(0), bottom_start(0), bottom_end(0) {}
00158 
00162     int left_width, left_start, left_end;
00163 
00167     int right_width, right_start, right_end;
00168 
00172     int top_width, top_start, top_end;
00173 
00177     int bottom_width, bottom_start, bottom_end;
00178     
00179 };
00180 
00181 
00193 struct NETStrut {
00197     NETStrut() : left(0), right(0), top(0), bottom(0) { }
00198 
00202     int left;
00203 
00207     int right;
00208 
00212     int top;
00213 
00217     int bottom;
00218 };
00219 
00220 
00233 class NET {
00234 public:
00245     enum Role {
00246     Client,
00247     WindowManager
00248     };
00249 
00280     enum WindowType {
00281     Unknown  = -1,
00282     Normal   = 0,
00283     Desktop  = 1,
00284     Dock     = 2,
00285     Toolbar  = 3,
00286         Menu     = 4,
00287     Dialog   = 5,
00288     Override = 6, // NON STANDARD
00289         TopMenu  = 7, // NON STANDARD
00290     Tool     = Toolbar, // This will go away soon, COMPAT (How soon? :)
00291     Utility  = 8,   
00292     Splash   = 9    
00293     };
00294     
00300     enum WindowTypeMask {
00301     NormalMask   = 1<<0,
00302     DesktopMask  = 1<<1,
00303     DockMask     = 1<<2,
00304     ToolbarMask  = 1<<3,
00305     MenuMask     = 1<<4,
00306     DialogMask   = 1<<5,
00307     OverrideMask = 1<<6,
00308         TopMenuMask  = 1<<7,
00309     UtilityMask  = 1<<8,
00310     SplashMask   = 1<<9
00311     };
00312 
00313     // KDE4 move to WindowTypeMask
00314     enum { AllTypesMask = -1LU };
00315 
00320     static bool typeMatchesMask( WindowType type, unsigned long mask );
00321 
00363     enum State {
00364     Modal        = 1<<0,
00365     Sticky       = 1<<1,
00366     MaxVert      = 1<<2,
00367     MaxHoriz     = 1<<3,
00368     Max = MaxVert | MaxHoriz,
00369     Shaded       = 1<<4,
00370     SkipTaskbar  = 1<<5,
00371     KeepAbove    = 1<<6,    
00372     StaysOnTop   = KeepAbove,   // NOT STANDARD
00373     SkipPager    = 1<<7,
00374     Hidden       = 1<<8,    
00375     FullScreen   = 1<<9,    
00376     KeepBelow    = 1<<10,   
00377         DemandsAttention = 1<<11  
00378     };
00379 
00399     enum Direction {
00400     TopLeft      = 0,
00401     Top          = 1,
00402     TopRight     = 2,
00403     Right        = 3,
00404     BottomRight  = 4,
00405     Bottom       = 5,
00406     BottomLeft   = 6,
00407     Left         = 7,
00408     Move         = 8,  // movement only
00412     KeyboardSize = 9,  // size via keyboard
00416     KeyboardMove = 10  // move via keyboard
00417     };
00418 
00433     // KDE4 aaarghl, this doesn't map correctly to Xlib #defines
00434     enum MappingState {
00435     Visible, // ie. NormalState
00436     Withdrawn,
00437     Iconic
00438     };
00439 
00444     enum Action {
00445         ActionMove           = 1<<0,
00446         ActionResize         = 1<<1,
00447         ActionMinimize       = 1<<2,
00448         ActionShade          = 1<<3,
00449         ActionStick          = 1<<4,
00450         ActionMaxVert        = 1<<5,
00451         ActionMaxHoriz       = 1<<6,
00452         ActionMax            = ActionMaxVert | ActionMaxHoriz,
00453         ActionFullScreen     = 1<<7,
00454         ActionChangeDesktop  = 1<<8,
00455         ActionClose          = 1<<9
00456     };
00457     
00504     enum Property {
00505     // root
00506     Supported             = 1<<0,
00507     ClientList            = 1<<1,
00508     ClientListStacking    = 1<<2,
00509     NumberOfDesktops      = 1<<3,
00510     DesktopGeometry       = 1<<4,
00511     DesktopViewport       = 1<<5,
00512     CurrentDesktop        = 1<<6,
00513     DesktopNames          = 1<<7,
00514     ActiveWindow          = 1<<8,
00515     WorkArea              = 1<<9,
00516     SupportingWMCheck     = 1<<10,
00517     VirtualRoots          = 1<<11,
00518     KDESystemTrayWindows  = 1<<12, // NOT STANDARD
00519     CloseWindow           = 1<<13,
00520     WMMoveResize          = 1<<14,
00521 
00522     // window
00523     WMName                = 1<<15,
00524     WMVisibleName         = 1<<16,
00525     WMDesktop             = 1<<17,
00526     WMWindowType          = 1<<18,
00527     WMState               = 1<<19,
00528     WMStrut               = 1<<20,
00529     WMIconGeometry        = 1<<21,
00530     WMIcon                = 1<<22,
00531     WMPid                 = 1<<23,
00532     WMHandledIcons        = 1<<24,
00533     WMPing                = 1<<25,
00534     WMKDESystemTrayWinFor = 1<<26, // NOT STANDARD
00535     XAWMState             = 1<<27, // NOT STANDARD
00536     WMKDEFrameStrut       = 1<<28, // NOT STANDARD
00537 
00538     // Need to be reordered
00539     WMIconName            = 1<<29,
00540     WMVisibleIconName     = 1<<30,
00541     WMGeometry        = 1<<31
00542     };
00543     
00566     enum Property2 {
00567         WM2UserTime            = 1<<0,
00568         WM2StartupId           = 1<<1,
00569         WM2TransientFor        = 1<<2,
00570         WM2GroupLeader         = 1<<3,
00571         WM2AllowedActions      = 1<<4,
00572         WM2RestackWindow       = 1<<5,
00573         WM2MoveResizeWindow    = 1<<6,
00574         WM2ExtendedStrut       = 1<<7,
00575         WM2TakeActivity        = 1<<8,
00576         WM2KDETemporaryRules   = 1<<9,  // NOT STANDARD
00577         WM2WindowClass         = 1<<10, 
00578         WM2WindowRole          = 1<<11, 
00579         WM2ClientMachine       = 1<<12  
00580     };
00581 
00587     enum { OnAllDesktops = -1 };
00588     
00595     // must match the values for data.l[0] field in _NET_ACTIVE_WINDOW message
00596     enum RequestSource {
00597         FromUnknown, // internal
00598         FromApplication,
00599         FromTool
00600     };
00601 };
00602 
00603 
00604 #endif // __netwm_def_h
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Feb 18 15:10:01 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003