netwm.h Source File (kdecore Library)

| # kdecore Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# netwm.h

    00001 /*
    00002
    00003   Copyright (c) 2000 Troll Tech AS
    00004
    00005   Permission is hereby granted, free of charge, to any person obtaining a
    00006   copy of this software and associated documentation files (the "Software"),
    00007   to deal in the Software without restriction, including without limitation
    00008   the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00009   and/or sell copies of the Software, and to permit persons to whom the
    00010   Software is furnished to do so, subject to the following conditions:
    00011
    00012   The above copyright notice and this permission notice shall be included in
    00013   all copies or substantial portions of the Software.
    00014
    00015   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    00016   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00017   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
    00018   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00019   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00020   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00021   DEALINGS IN THE SOFTWARE.
    00022
    00023 */
    00024
    00025
    00026 #ifndef   __net_wm_h
    00027 #define   __net_wm_h
    00028
    00029 #include <qwidget.h>
    00030 #ifdef Q_WS_X11
    00031 #include <X11/Xlib.h>
    00032 #include <X11/Xutil.h>
    00033 #include <X11/Xatom.h>
    00034
    00035 #include "netwm_def.h"
    00036
    00037 // forward declaration
    00038 struct NETRootInfoPrivate;
    00039 struct NETWinInfoPrivate;
    00040
    00041
    00055 class NETRootInfo : public NET {
    00056 public:
    00082     NETRootInfo(Display *display, Window supportWindow, const char *wmName,
    00083                 unsigned long properties, int screen = -1, bool doActivate = true);
    00084
    00102     NETRootInfo(Display *display, unsigned long properties, int screen = -1,
    00103                 bool doActivate = true);
    00104
    00110     NETRootInfo(const NETRootInfo &rootinfo);
    00111
    00115     virtual ~NETRootInfo();
    00116
    00122     Display *x11Display() const;
    00123
    00129     Window rootWindow() const;
    00130
    00136     Window supportWindow() const;
    00137
    00143     const char *wmName() const;
    00144
    00150     int screenNumber() const;
    00151
    00159     unsigned long supported() const;
    00160
    00168     const Window *clientList() const;
    00169
    00177     int clientListCount() const;
    00178
    00187     const Window *clientListStacking() const;
    00188
    00196     int clientListStackingCount() const;
    00197
    00205     const Window *kdeSystemTrayWindows() const;
    00206
    00214     int kdeSystemTrayWindowsCount() const;
    00215
    00226     NETSize desktopGeometry(int desktop) const;
    00227
    00235     NETPoint desktopViewport(int desktop) const;
    00236
    00244     NETRect workArea(int desktop) const;
    00245
    00253     const char *desktopName(int desktop) const;
    00254
    00262     const Window *virtualRoots( ) const;
    00263
    00271     int virtualRootsCount() const;
    00272
    00278     int numberOfDesktops() const;
    00279
    00285     int currentDesktop() const;
    00286
    00292     Window activeWindow() const;
    00293
    00302     void activate();
    00303
    00311     void setClientList(Window *windows, unsigned int count);
    00312
    00321     void setClientListStacking(Window *windows, unsigned int count);
    00322
    00330     void setKDESystemTrayWindows(Window *windows, unsigned int count);
    00331
    00337     void setCurrentDesktop(int desktop);
    00338
    00349     void setDesktopGeometry(int desktop, const NETSize &geometry);
    00350
    00358     void setDesktopViewport(int desktop, const NETPoint &viewport);
    00359
    00365     void setNumberOfDesktops(int numberOfDesktops);
    00366
    00374     void setDesktopName(int desktop, const char *desktopName);
    00375
    00381     void setActiveWindow(Window window);
    00382
    00390     void setWorkArea(int desktop, const NETRect &workArea);
    00391
    00399     void setVirtualRoots(Window *windows, unsigned int count);
    00400
    00405     const NETRootInfo &operator=(const NETRootInfo &rootinfo);
    00406
    00414     void closeWindowRequest(Window window);
    00415
    00430     void moveResizeRequest(Window window, int x_root, int y_root,
    00431                            Direction direction);
    00432
    00442     unsigned long event(XEvent *event);
    00443
    00444
    00445 protected:
    00452     // virtual void addClient(Window window) { }
    00453     virtual void addClient(Window) { }
    00454
    00461     // virtual void removeClient(Window window) { }
    00462     virtual void removeClient(Window) { }
    00463
    00471     // virtual void addSystemTrayWin(Window window) { }
    00472     virtual void addSystemTrayWin(Window) { }
    00473
    00481     // virtual void removeSystemTrayWin(Window window) { }
    00482     virtual void removeSystemTrayWin(Window) { }
    00483
    00491     // virtual void changeNumberOfDesktops(int numberOfDesktops) { }
    00492     virtual void changeNumberOfDesktops(int) { }
    00493
    00503     // virtual void changeDesktopGeometry(int desktop, const NETSize &geom) { }
    00504     virtual void changeDesktopGeometry(int, const NETSize &) { }
    00505
    00515     // virtual void changeDesktopViewport(int desktop, const NETPoint &viewport) { }
    00516     virtual void changeDesktopViewport(int, const NETPoint &) { }
    00517
    00525     // virtual void changeCurrentDesktop(int desktop) { }
    00526     virtual void changeCurrentDesktop(int) { }
    00527
    00535     // virtual void changeActiveWindow(Window window) { }
    00536     virtual void changeActiveWindow(Window) { }
    00537
    00544     // virtual void closeWindow(Window window) { }
    00545     virtual void closeWindow(Window) { }
    00546
    00560     // virtual void moveResize(Window window, int x_root, int y_root,
    00561     //                      unsigned long direction) { }
    00562     virtual void moveResize(Window, int, int, unsigned long) { }
    00563
    00564
    00565 private:
    00566     void update(unsigned long);
    00567     void setSupported(unsigned long);
    00568     Role role;
    00569
    00570 protected:
    00571     virtual void virtual_hook( int id, void* data );
    00572 private:
    00573     NETRootInfoPrivate *p;
    00574 };
    00575
    00576
    00591 class NETWinInfo : public NET {
    00592 public:
    00610     NETWinInfo(Display *display, Window window,
    00611                Window rootWindow, unsigned long properties,
    00612                Role role = Client);
    00613
    00619     NETWinInfo(const NETWinInfo & wininfo);
    00620
    00624     virtual ~NETWinInfo();
    00625
    00633     unsigned long properties() const;
    00634
    00640     NETRect iconGeometry() const;
    00641
    00648     unsigned long state() const;
    00649
    00655     NETStrut strut() const;
    00656
    00663     WindowType windowType() const;
    00664
    00670     const char *name() const;
    00671
    00677     const char *visibleName() const;
    00678
    00684     const char *iconName() const;
    00685
    00691     const char *visibleIconName() const;
    00692
    00700     int desktop() const;
    00701
    00707     int pid() const;
    00708
    00714     Bool handledIcons() const;
    00715
    00722     Window kdeSystemTrayWinFor() const;
    00723
    00730     MappingState mappingState() const;
    00731
    00741     void setIcon(NETIcon icon, Bool replace = True);
    00742
    00748     void setIconGeometry(NETRect geometry);
    00749
    00755     void setStrut(NETStrut strut);
    00756
    00765     void setState(unsigned long state, unsigned long mask);
    00766
    00773     void setWindowType(WindowType type);
    00774
    00780     void setName(const char *name);
    00781
    00788     void setVisibleName(const char *visibleName);
    00789
    00795     void setIconName(const char *name);
    00796
    00803     void setVisibleIconName(const char *name);
    00804
    00812     void setDesktop(int desktop);
    00813
    00819     void setPid(int pid);
    00820
    00826     void setHandledIcons(Bool handled);
    00827
    00833     void setKDESystemTrayWinFor(Window window);
    00834
    00841     void setKDEFrameStrut(NETStrut strut);
    00842
    00854     NETIcon icon(int width = -1, int height = -1) const;
    00855
    00864     void kdeGeometry(NETRect &frame, NETRect &window);
    00865
    00875     unsigned long event(XEvent *event);
    00876
    00883     static const int OnAllDesktops;
    00884
    00885
    00886 protected:
    00894     // virtual void changeDesktop(int desktop) { }
    00895     virtual void changeDesktop(int) { }
    00896
    00906     virtual void changeState(unsigned long /*state*/, unsigned long /*mask*/) { }
    00907
    00908 private:
    00909     void update(unsigned long);
    00910     Role role;
    00911
    00912 protected:
    00913     virtual void virtual_hook( int id, void* data );
    00914 private:
    00915     NETWinInfoPrivate *p;
    00916 };
    00917
    00918
    00919 #endif
    00920 #endif // __net_wm_h

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:47:01 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001