• Skip to content
  • Skip to link menu
KDE 4.2 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 
01117     NETStrut frameExtents() const;
01118 
01130     NETIcon icon(int width = -1, int height = -1) const;
01131 
01139     void setUserTime( Time time );
01140 
01144     Time userTime() const;
01145 
01149     void setStartupId( const char* startup_id );
01150 
01154     const char* startupId() const;
01155 
01159     void setOpacity( unsigned long opacity );
01160 
01164     unsigned long opacity() const;
01165 
01169     void setAllowedActions( unsigned long actions );
01170 
01174     unsigned long allowedActions() const;
01175 
01180     Window transientFor() const;
01181 
01185     Window groupLeader() const;
01186 
01191     const char* windowClassClass() const;
01192 
01197     const char* windowClassName() const;
01198 
01202     const char* windowRole() const;
01203 
01207     const char* clientMachine() const;
01208 
01217     void kdeGeometry(NETRect &frame, NETRect &window);
01218 
01232     void event( XEvent* event, unsigned long* properties, int properties_size );
01233 
01245     unsigned long event(XEvent *event);
01246 
01253     static const int OnAllDesktops;
01254 
01255 protected:
01263     virtual void changeDesktop(int desktop) { Q_UNUSED(desktop); }
01264 
01274     virtual void changeState(unsigned long state, unsigned long mask) { Q_UNUSED(state); Q_UNUSED(mask); }
01275 
01276 private:
01277     void update( const unsigned long[] );
01278     void updateWMState();
01279     void setIconInternal(NETRArray<NETIcon>& icons, int& icon_count, Atom property, NETIcon icon, Bool replace);
01280     NETIcon iconInternal(NETRArray<NETIcon>& icons, int icon_count, int width, int height) const;
01281 
01282 protected:
01286     virtual void virtual_hook( int id, void* data );
01287 private:
01288     NETWinInfoPrivate *p; // krazy:exclude=dpointer (implicitly shared)
01289     friend class NETWinInfo2;
01290 };
01291 
01292 
01299 class KDEUI_EXPORT NETWinInfo2 : public NETWinInfo {
01300 public:
01301     NETWinInfo2(Display *display, Window window, Window rootWindow,
01302                 const unsigned long properties[], int properties_size,
01303                 Role role = Client);
01304 
01305     NETWinInfo2(Display *display, Window window,
01306                 Window rootWindow, unsigned long properties,
01307                 Role role = Client);
01308 
01325     void setFullscreenMonitors(NETFullscreenMonitors topology);
01326 
01332     NETFullscreenMonitors fullscreenMonitors() const;
01333 
01334 protected:
01335     friend class NETWinInfo;
01344     virtual void changeFullscreenMonitors(NETFullscreenMonitors topology) { Q_UNUSED(topology); }
01345 };
01346 
01347 //#define KWIN_FOCUS
01348 
01349 #endif
01350 #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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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