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