• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

netwm.h

Go to the documentation of this file.
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 
00027 #ifndef   netwm_h
00028 #define   netwm_h
00029 
00030 #include <kdeui_export.h>
00031 #include <QtGui/QWidget>
00032 #ifdef Q_WS_X11
00033 #include <X11/Xlib.h>
00034 #include <X11/Xutil.h>
00035 #include <X11/Xatom.h>
00036 #include <fixx11h.h>
00037 
00038 #include "netwm_def.h"
00039 
00040 // forward declaration
00041 struct NETRootInfoPrivate;
00042 struct NETWinInfoPrivate;
00043 template <class Z> class NETRArray;
00044 
00045 
00058 class KDEUI_EXPORT NETRootInfo : public NET {
00059 public:
00063     // update also NETRootInfoPrivate::properties[] size when extending this
00064     enum { PROTOCOLS, WINDOW_TYPES, STATES, PROTOCOLS2, ACTIONS,
00065         PROPERTIES_SIZE };
00066 
00098     NETRootInfo(Display *display, Window supportWindow, const char *wmName,
00099         const unsigned long properties[], int properties_size,
00100                 int screen = -1, bool doActivate = true);
00101 
00102 
00123     NETRootInfo(Display *display, const unsigned long properties[], int properties_size,
00124                 int screen = -1, bool doActivate = true);
00125 
00132     NETRootInfo(Display *display, unsigned long properties, int screen = -1,
00133         bool doActivate = true);
00134 
00140     NETRootInfo(const NETRootInfo &rootinfo);
00141 
00145     virtual ~NETRootInfo();
00146 
00152     Display *x11Display() const;
00153 
00159     Window rootWindow() const;
00160 
00166     Window supportWindow() const;
00167 
00173     const char *wmName() const;
00174 
00180     int screenNumber() const;
00181 
00187     bool isSupported( NET::Property property ) const;
00191     bool isSupported( NET::Property2 property ) const;
00195     bool isSupported( NET::WindowType type ) const;
00199     bool isSupported( NET::State state ) const;
00200 
00204     bool isSupported( NET::Action action ) const;
00205 
00215     const unsigned long* supportedProperties() const;
00216 
00221     const unsigned long* passedProperties() const;
00222 
00230     const Window *clientList() const;
00231 
00239     int clientListCount() const;
00240 
00249     const Window *clientListStacking() const;
00250 
00258     int clientListStackingCount() const;
00259 
00274     NETSize desktopGeometry(int desktop) const;
00275 
00287     NETPoint desktopViewport(int desktop) const;
00288 
00296     NETRect workArea(int desktop) const;
00297 
00305     const char *desktopName(int desktop) const;
00306 
00314     const Window *virtualRoots( ) const;
00315 
00323     int virtualRootsCount() const;
00324 
00328     NET::Orientation desktopLayoutOrientation() const;
00329 
00334     QSize desktopLayoutColumnsRows() const;
00335 
00339     NET::DesktopLayoutCorner desktopLayoutCorner() const;
00340 
00352     int numberOfDesktops( bool ignore_viewport = false ) const;
00353 
00365     int currentDesktop( bool ignore_viewport = false ) const;
00366 
00372     Window activeWindow() const;
00373 
00382     void activate();
00383 
00391     void setClientList(const Window *windows, unsigned int count);
00392 
00401     void setClientListStacking(const Window *windows, unsigned int count);
00402 
00413     void setCurrentDesktop(int desktop, bool ignore_viewport = false);
00414 
00429     void setDesktopGeometry(int desktop, const NETSize &geometry);
00430 
00442     void setDesktopViewport(int desktop, const NETPoint &viewport);
00443 
00453     void setNumberOfDesktops(int numberOfDesktops);
00454 
00466     void setDesktopName(int desktop, const char *desktopName);
00467 
00478     void setActiveWindow(Window window, NET::RequestSource src,
00479         Time timestamp, Window active_window);
00480 
00487     void setActiveWindow(Window window);
00488 
00496     void setWorkArea(int desktop, const NETRect &workArea);
00497 
00505     void setVirtualRoots(const Window *windows, unsigned int count);
00506 
00511     void setDesktopLayout(NET::Orientation orientation, int columns, int rows,
00512         NET::DesktopLayoutCorner corner);
00513 
00517     void setShowingDesktop( bool showing );
00521     bool showingDesktop() const;
00522 
00527     const NETRootInfo &operator=(const NETRootInfo &rootinfo);
00528 
00536     void closeWindowRequest(Window window);
00537 
00553     void moveResizeRequest(Window window, int x_root, int y_root,
00554                Direction direction);
00555 
00569     void moveResizeWindowRequest(Window window, int flags, int x, int y, int width, int height );
00570 
00574     void restackRequest(Window window, RequestSource source, Window above, int detail, Time timestamp);
00575 
00580     void sendPing( Window window, Time timestamp );
00581 
00589     void takeActivity( Window window, Time timestamp, long flags );
00590 
00605     void event( XEvent* event, unsigned long* properties, int properties_size );
00606 
00618     unsigned long event(XEvent *event);
00619 
00620 
00621 protected:
00628     virtual void addClient(Window window) { Q_UNUSED(window); }
00629 
00636     virtual void removeClient(Window window) { Q_UNUSED(window); }
00637 
00645     virtual void changeNumberOfDesktops(int numberOfDesktops) { Q_UNUSED(numberOfDesktops); }
00646 
00656     virtual void changeDesktopGeometry(int desktop, const NETSize &geom) { Q_UNUSED(desktop); Q_UNUSED(geom); }
00657 
00667     virtual void changeDesktopViewport(int desktop, const NETPoint &viewport) { Q_UNUSED(desktop); Q_UNUSED(viewport); }
00668 
00676     virtual void changeCurrentDesktop(int desktop) { Q_UNUSED(desktop); }
00677 
00684     virtual void closeWindow(Window window) { Q_UNUSED(window); }
00685 
00699     virtual void moveResize(Window window, int x_root, int y_root,
00700                     unsigned long direction) { Q_UNUSED(window); Q_UNUSED(x_root); Q_UNUSED(y_root); Q_UNUSED(direction); }
00701 
00708     virtual void gotPing( Window window, Time timestamp ) { Q_UNUSED(window); Q_UNUSED(timestamp); }
00719     virtual void changeActiveWindow(Window window,NET::RequestSource src,
00720         Time timestamp, Window active_window ) { Q_UNUSED(window); Q_UNUSED(src); Q_UNUSED(timestamp); Q_UNUSED(active_window);}
00721 
00734     virtual void moveResizeWindow(Window window, int flags, int x, int y, int width, int height) { Q_UNUSED(window); Q_UNUSED(flags); Q_UNUSED(x); Q_UNUSED(y); Q_UNUSED(width); Q_UNUSED(height); }
00735 
00747     virtual void restackWindow(Window window, RequestSource source,
00748            Window above, int detail, Time timestamp) { Q_UNUSED(window); Q_UNUSED(source); Q_UNUSED(above); Q_UNUSED(detail); Q_UNUSED(timestamp); }
00756     virtual void gotTakeActivity(Window window, Time timestamp, long flags ) { Q_UNUSED(window); Q_UNUSED(timestamp); Q_UNUSED(flags); }
00757 
00765     virtual void changeShowingDesktop(bool showing) { Q_UNUSED(showing); }
00766 
00767 private:
00768     void update( const unsigned long[] );
00769     void setSupported();
00770     void setDefaultProperties();
00771     void updateSupportedProperties( Atom atom );
00772 
00773 protected:
00777     virtual void virtual_hook( int id, void* data );
00778 private:
00779     NETRootInfoPrivate *p; // krazy:exclude=dpointer (implicitly shared)
00780 };
00781 
00795 class KDEUI_EXPORT NETWinInfo : public NET {
00796 public:
00800     // update also NETWinInfoPrivate::properties[] size when extending this
00801     enum { PROTOCOLS, PROTOCOLS2,
00802         PROPERTIES_SIZE };
00825     NETWinInfo(Display *display, Window window, Window rootWindow,
00826                const unsigned long properties[], int properties_size,
00827            Role role = Client);
00828 
00835     NETWinInfo(Display *display, Window window,
00836            Window rootWindow, unsigned long properties,
00837            Role role = Client);
00838 
00844     NETWinInfo(const NETWinInfo & wininfo);
00845 
00849     virtual ~NETWinInfo();
00850 
00855     const NETWinInfo &operator=(const NETWinInfo &wintinfo);
00856 
00864     bool hasNETSupport() const;
00865 
00870     const unsigned long* passedProperties() const;
00871 
00877     NETRect iconGeometry() const;
00878 
00885     unsigned long state() const;
00886 
00891     NETExtendedStrut extendedStrut() const;
00892 
00899     NETStrut strut() const;
00900 
00914     WindowType windowType( unsigned long supported_types ) const;
00915 
00921     bool hasWindowType() const;
00922 
00928     const char *name() const;
00929 
00935     const char *visibleName() const;
00936 
00946     const char *iconName() const;
00947 
00957     const char *visibleIconName() const;
00958 
00972     int desktop( bool ignore_viewport = false ) const;
00973 
00979     int pid() const;
00980 
00986     Bool handledIcons() const;
00987 
00994     MappingState mappingState() const;
00995 
01005     void setIcon(NETIcon icon, Bool replace = True);
01006 
01012     void setIconGeometry(NETRect geometry);
01013 
01019     void setExtendedStrut(const NETExtendedStrut& extended_strut );
01020 
01027     void setStrut(NETStrut strut);
01028 
01037     void setState(unsigned long state, unsigned long mask);
01038 
01045     void setWindowType(WindowType type);
01046 
01052     void setName(const char *name);
01053 
01060     void setVisibleName(const char *visibleName);
01061 
01067     void setIconName(const char *name);
01068 
01075     void setVisibleIconName(const char *name);
01076 
01089     void setDesktop(int desktop, bool ignore_viewport = false);
01090 
01096     void setPid(int pid);
01097 
01103     void setHandledIcons(Bool handled);
01104 
01110     void setFrameExtents(NETStrut strut);
01111 
01123     NETIcon icon(int width = -1, int height = -1) const;
01124 
01132     void setUserTime( Time time );
01133 
01137     Time userTime() const;
01138 
01142     void setStartupId( const char* startup_id );
01143 
01147     const char* startupId() const;
01148 
01152     void setOpacity( unsigned long opacity );
01153 
01157     unsigned long opacity() const;
01158 
01162     void setAllowedActions( unsigned long actions );
01163 
01167     unsigned long allowedActions() const;
01168 
01173     Window transientFor() const;
01174 
01178     Window groupLeader() const;
01179 
01184     const char* windowClassClass() const;
01185 
01190     const char* windowClassName() const;
01191 
01195     const char* windowRole() const;
01196 
01200     const char* clientMachine() const;
01201 
01210     void kdeGeometry(NETRect &frame, NETRect &window);
01211 
01225     void event( XEvent* event, unsigned long* properties, int properties_size );
01226 
01238     unsigned long event(XEvent *event);
01239 
01246     static const int OnAllDesktops;
01247 
01248 protected:
01256     virtual void changeDesktop(int desktop) { Q_UNUSED(desktop); }
01257 
01267     virtual void changeState(unsigned long state, unsigned long mask) { Q_UNUSED(state); Q_UNUSED(mask); }
01268 
01269 private:
01270     void update( const unsigned long[] );
01271     void updateWMState();
01272     void setIconInternal(NETRArray<NETIcon>& icons, int& icon_count, Atom property, NETIcon icon, Bool replace);
01273     NETIcon iconInternal(NETRArray<NETIcon>& icons, int icon_count, int width, int height) const;
01274 
01275 protected:
01279     virtual void virtual_hook( int id, void* data );
01280 private:
01281     NETWinInfoPrivate *p; // krazy:exclude=dpointer (implicitly shared)
01282 };
01283 
01284 
01285 //#define KWIN_FOCUS
01286 
01287 #endif
01288 #endif // netwm_h

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal