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 <kdelibs_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 KDECORE_EXPORT NET {
00236 public:
00247     enum Role {
00248     Client,
00249     WindowManager
00250     };
00251 
00279     enum WindowType {
00280     Unknown  = -1,
00281     Normal   = 0,
00282     Desktop  = 1,
00283     Dock     = 2,
00284     Toolbar  = 3,
00285         Menu     = 4,
00286     Dialog   = 5,
00287     Override = 6, 
00288         TopMenu  = 7, // NON STANDARD
00289     Tool     = Toolbar, // This will go away soon, COMPAT (How soon? :)
00290     Utility  = 8,   
00291     Splash   = 9    
00292     };
00293     
00299     enum WindowTypeMask {
00300     NormalMask   = 1<<0,
00301     DesktopMask  = 1<<1,
00302     DockMask     = 1<<2,
00303     ToolbarMask  = 1<<3,
00304     MenuMask     = 1<<4,
00305     DialogMask   = 1<<5,
00306     OverrideMask = 1<<6,
00307         TopMenuMask  = 1<<7,
00308     UtilityMask  = 1<<8,
00309     SplashMask   = 1<<9
00310     };
00311 
00312     // KDE4 move to WindowTypeMask
00313     enum { AllTypesMask = 0LU-1 };
00314 
00319     static bool typeMatchesMask( WindowType type, unsigned long mask );
00320 
00362     enum State {
00363     Modal        = 1<<0,
00364     Sticky       = 1<<1,
00365     MaxVert      = 1<<2,
00366     MaxHoriz     = 1<<3,
00367     Max = MaxVert | MaxHoriz,
00368     Shaded       = 1<<4,
00369     SkipTaskbar  = 1<<5,
00370     KeepAbove    = 1<<6,    
00371     StaysOnTop   = KeepAbove,   // NOT STANDARD
00372     SkipPager    = 1<<7,
00373     Hidden       = 1<<8,    
00374     FullScreen   = 1<<9,    
00375     KeepBelow    = 1<<10,   
00376         DemandsAttention = 1<<11  
00377     };
00378 
00398     enum Direction {
00399     TopLeft      = 0,
00400     Top          = 1,
00401     TopRight     = 2,
00402     Right        = 3,
00403     BottomRight  = 4,
00404     Bottom       = 5,
00405     BottomLeft   = 6,
00406     Left         = 7,
00407     Move         = 8,  // movement only
00411     KeyboardSize = 9,  // size via keyboard
00415     KeyboardMove = 10, // move via keyboard
00419     MoveResizeCancel = 11 // to ask the WM to stop moving a window
00420     };
00421 
00436     // KDE4 aaarghl, this doesn't map correctly to Xlib #defines
00437     enum MappingState {
00438     Visible, // ie. NormalState
00439     Withdrawn,
00440     Iconic
00441     };
00442 
00447     enum Action {
00448         ActionMove           = 1<<0,
00449         ActionResize         = 1<<1,
00450         ActionMinimize       = 1<<2,
00451         ActionShade          = 1<<3,
00452         ActionStick          = 1<<4,
00453         ActionMaxVert        = 1<<5,
00454         ActionMaxHoriz       = 1<<6,
00455         ActionMax            = ActionMaxVert | ActionMaxHoriz,
00456         ActionFullScreen     = 1<<7,
00457         ActionChangeDesktop  = 1<<8,
00458         ActionClose          = 1<<9
00459     };
00460     
00507     enum Property {
00508     // root
00509     Supported             = 1<<0,
00510     ClientList            = 1<<1,
00511     ClientListStacking    = 1<<2,
00512     NumberOfDesktops      = 1<<3,
00513     DesktopGeometry       = 1<<4,
00514     DesktopViewport       = 1<<5,
00515     CurrentDesktop        = 1<<6,
00516     DesktopNames          = 1<<7,
00517     ActiveWindow          = 1<<8,
00518     WorkArea              = 1<<9,
00519     SupportingWMCheck     = 1<<10,
00520     VirtualRoots          = 1<<11,
00521     KDESystemTrayWindows  = 1<<12, // NOT STANDARD
00522     CloseWindow           = 1<<13,
00523     WMMoveResize          = 1<<14,
00524 
00525     // window
00526     WMName                = 1<<15,
00527     WMVisibleName         = 1<<16,
00528     WMDesktop             = 1<<17,
00529     WMWindowType          = 1<<18,
00530     WMState               = 1<<19,
00531     WMStrut               = 1<<20,
00532     WMIconGeometry        = 1<<21,
00533     WMIcon                = 1<<22,
00534     WMPid                 = 1<<23,
00535     WMHandledIcons        = 1<<24,
00536     WMPing                = 1<<25,
00537     WMKDESystemTrayWinFor = 1<<26, // NOT STANDARD
00538     XAWMState             = 1<<27, // NOT STANDARD
00539         WMFrameExtents        = 1<<28, 
00540     WMKDEFrameStrut       = WMFrameExtents, // NOT STANDARD
00541 
00542     // Need to be reordered
00543     WMIconName            = 1<<29,
00544     WMVisibleIconName     = 1<<30,
00545     WMGeometry        = 1<<31
00546     };
00547     
00570     enum Property2 {
00571         WM2UserTime            = 1<<0,
00572         WM2StartupId           = 1<<1,
00573         WM2TransientFor        = 1<<2,
00574         WM2GroupLeader         = 1<<3,
00575         WM2AllowedActions      = 1<<4,
00576         WM2RestackWindow       = 1<<5,
00577         WM2MoveResizeWindow    = 1<<6,
00578         WM2ExtendedStrut       = 1<<7,
00579         WM2TakeActivity        = 1<<8,
00580         WM2KDETemporaryRules   = 1<<9,  // NOT STANDARD
00581         WM2WindowClass         = 1<<10, 
00582         WM2WindowRole          = 1<<11, 
00583         WM2ClientMachine       = 1<<12, 
00584         WM2ShowingDesktop      = 1<<13  
00585     };
00586 
00592     enum { OnAllDesktops = -1 };
00593     
00600     // must match the values for data.l[0] field in _NET_ACTIVE_WINDOW message
00601     enum RequestSource {
00602         FromUnknown, // internal
00603         FromApplication,
00604         FromTool
00605     };
00606     
00612     static int timestampCompare( unsigned long time1, unsigned long time2 );
00618     static int timestampDiff( unsigned long time1_, unsigned long time2_ );
00619 
00620 };
00621 
00622 
00623 #endif // __netwm_def_h
KDE Home | KDE Accessibility Home | Description of Access Keys