• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • 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 
00124     NETRootInfo(Display *display, const unsigned long properties[], int properties_size,
00125                 int screen = -1, bool doActivate = true);
00126 
00133     NETRootInfo(Display *display, unsigned long properties, int screen = -1,
00134         bool doActivate = true);
00135 
00141     NETRootInfo(const NETRootInfo &rootinfo);
00142 
00146     virtual ~NETRootInfo();
00147 
00153     Display *x11Display() const;
00154 
00160     Window rootWindow() const;
00161 
00167     Window supportWindow() const;
00168 
00174     const char *wmName() const;
00175 
00181     int screenNumber() const;
00182 
00190     void setSupported( NET::Property property, bool on = true );
00191 
00196     void setSupported( NET::Property2 property, bool on = true );
00197 
00202     void setSupported( NET::WindowType property, bool on = true );
00203 
00208     void setSupported( NET::State property, bool on = true );
00209 
00214     void setSupported( NET::Action property, bool on = true );
00215 
00221     bool isSupported( NET::Property property ) const;
00225     bool isSupported( NET::Property2 property ) const;
00229     bool isSupported( NET::WindowType type ) const;
00233     bool isSupported( NET::State state ) const;
00234 
00238     bool isSupported( NET::Action action ) const;
00239 
00249     const unsigned long* supportedProperties() const;
00250 
00255     const unsigned long* passedProperties() const;
00256 
00264     const Window *clientList() const;
00265 
00273     int clientListCount() const;
00274 
00283     const Window *clientListStacking() const;
00284 
00292     int clientListStackingCount() const;
00293 
00308     NETSize desktopGeometry(int desktop) const;
00309 
00321     NETPoint desktopViewport(int desktop) const;
00322 
00330     NETRect workArea(int desktop) const;
00331 
00339     const char *desktopName(int desktop) const;
00340 
00348     const Window *virtualRoots( ) const;
00349 
00357     int virtualRootsCount() const;
00358 
00362     NET::Orientation desktopLayoutOrientation() const;
00363 
00368     QSize desktopLayoutColumnsRows() const;
00369 
00373     NET::DesktopLayoutCorner desktopLayoutCorner() const;
00374 
00386     int numberOfDesktops( bool ignore_viewport = false ) const;
00387 
00399     int currentDesktop( bool ignore_viewport = false ) const;
00400 
00406     Window activeWindow() const;
00407 
00416     void activate();
00417 
00425     void setClientList(const Window *windows, unsigned int count);
00426 
00435     void setClientListStacking(const Window *windows, unsigned int count);
00436 
00447     void setCurrentDesktop(int desktop, bool ignore_viewport = false);
00448 
00463     void setDesktopGeometry(int desktop, const NETSize &geometry);
00464 
00476     void setDesktopViewport(int desktop, const NETPoint &viewport);
00477 
00487     void setNumberOfDesktops(int numberOfDesktops);
00488 
00500     void setDesktopName(int desktop, const char *desktopName);
00501 
00512     void setActiveWindow(Window window, NET::RequestSource src,
00513         Time timestamp, Window active_window);
00514 
00521     void setActiveWindow(Window window);
00522 
00530     void setWorkArea(int desktop, const NETRect &workArea);
00531 
00539     void setVirtualRoots(const Window *windows, unsigned int count);
00540 
00545     void setDesktopLayout(NET::Orientation orientation, int columns, int rows,
00546         NET::DesktopLayoutCorner corner);
00547 
00551     void setShowingDesktop( bool showing );
00555     bool showingDesktop() const;
00556 
00561     const NETRootInfo &operator=(const NETRootInfo &rootinfo);
00562 
00570     void closeWindowRequest(Window window);
00571 
00587     void moveResizeRequest(Window window, int x_root, int y_root,
00588                Direction direction);
00589 
00603     void moveResizeWindowRequest(Window window, int flags, int x, int y, int width, int height );
00604 
00608     void restackRequest(Window window, RequestSource source, Window above, int detail, Time timestamp);
00609 
00614     void sendPing( Window window, Time timestamp );
00615 
00623     void takeActivity( Window window, Time timestamp, long flags );
00624 
00639     void event( XEvent* event, unsigned long* properties, int properties_size );
00640 
00652     unsigned long event(XEvent *event);
00653 
00654 
00655 protected:
00662     virtual void addClient(Window window) { Q_UNUSED(window); }
00663 
00670     virtual void removeClient(Window window) { Q_UNUSED(window); }
00671 
00679     virtual void changeNumberOfDesktops(int numberOfDesktops) { Q_UNUSED(numberOfDesktops); }
00680 
00690     virtual void changeDesktopGeometry(int desktop, const NETSize &geom) { Q_UNUSED(desktop); Q_UNUSED(geom); }
00691 
00701     virtual void changeDesktopViewport(int desktop, const NETPoint &viewport) { Q_UNUSED(desktop); Q_UNUSED(viewport); }
00702 
00710     virtual void changeCurrentDesktop(int desktop) { Q_UNUSED(desktop); }
00711 
00718     virtual void closeWindow(Window window) { Q_UNUSED(window); }
00719 
00733     virtual void moveResize(Window window, int x_root, int y_root,
00734                     unsigned long direction) { Q_UNUSED(window); Q_UNUSED(x_root); Q_UNUSED(y_root); Q_UNUSED(direction); }
00735 
00742     virtual void gotPing( Window window, Time timestamp ) { Q_UNUSED(window); Q_UNUSED(timestamp); }
00753     virtual void changeActiveWindow(Window window,NET::RequestSource src,
00754         Time timestamp, Window active_window ) { Q_UNUSED(window); Q_UNUSED(src); Q_UNUSED(timestamp); Q_UNUSED(active_window);}
00755 
00768     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); }
00769 
00781     virtual void restackWindow(Window window, RequestSource source,
00782            Window above, int detail, Time timestamp) { Q_UNUSED(window); Q_UNUSED(source); Q_UNUSED(above); Q_UNUSED(detail); Q_UNUSED(timestamp); }
00790     virtual void gotTakeActivity(Window window, Time timestamp, long flags ) { Q_UNUSED(window); Q_UNUSED(timestamp); Q_UNUSED(flags); }
00791 
00799     virtual void changeShowingDesktop(bool showing) { Q_UNUSED(showing); }
00800 
00801 private:
00802     void update( const unsigned long[] );
00803     void setSupported();
00804     void setDefaultProperties();
00805     void updateSupportedProperties( Atom atom );
00806 
00807 protected:
00811     virtual void virtual_hook( int id, void* data );
00812 private:
00813     NETRootInfoPrivate *p; // krazy:exclude=dpointer (implicitly shared)
00814 };
00815 
00829 class KDEUI_EXPORT NETWinInfo : public NET {
00830 public:
00834     // update also NETWinInfoPrivate::properties[] size when extending this
00835     enum { PROTOCOLS, PROTOCOLS2,
00836         PROPERTIES_SIZE };
00859     NETWinInfo(Display *display, Window window, Window rootWindow,
00860                const unsigned long properties[], int properties_size,
00861            Role role = Client);
00862 
00869     NETWinInfo(Display *display, Window window,
00870            Window rootWindow, unsigned long properties,
00871            Role role = Client);
00872 
00878     NETWinInfo(const NETWinInfo & wininfo);
00879 
00883     virtual ~NETWinInfo();
00884 
00889     const NETWinInfo &operator=(const NETWinInfo &wintinfo);
00890 
00898     bool hasNETSupport() const;
00899 
00904     const unsigned long* passedProperties() const;
00905 
00911     NETRect iconGeometry() const;
00912 
00919     unsigned long state() const;
00920 
00925     NETExtendedStrut extendedStrut() const;
00926 
00933     NETStrut strut() const;
00934 
00948     WindowType windowType( unsigned long supported_types ) const;
00949 
00955     bool hasWindowType() const;
00956 
00962     const char *name() const;
00963 
00969     const char *visibleName() const;
00970 
00980     const char *iconName() const;
00981 
00991     const char *visibleIconName() const;
00992 
01006     int desktop( bool ignore_viewport = false ) const;
01007 
01013     int pid() const;
01014 
01020     Bool handledIcons() const;
01021 
01028     MappingState mappingState() const;
01029 
01039     void setIcon(NETIcon icon, Bool replace = True);
01040 
01046     void setIconGeometry(NETRect geometry);
01047 
01053     void setExtendedStrut(const NETExtendedStrut& extended_strut );
01054 
01061     void setStrut(NETStrut strut);
01062 
01071     void setState(unsigned long state, unsigned long mask);
01072 
01079     void setWindowType(WindowType type);
01080 
01086     void setName(const char *name);
01087 
01094     void setVisibleName(const char *visibleName);
01095 
01101     void setIconName(const char *name);
01102 
01109     void setVisibleIconName(const char *name);
01110 
01123     void setDesktop(int desktop, bool ignore_viewport = false);
01124 
01130     void setPid(int pid);
01131 
01137     void setHandledIcons(Bool handled);
01138 
01144     void setFrameExtents(NETStrut strut);
01145 
01151     NETStrut frameExtents() const;
01152 
01164     void setFrameOverlap(NETStrut strut);
01165 
01172     NETStrut frameOverlap() const;
01173 
01185     NETIcon icon(int width = -1, int height = -1) const;
01186     
01192     const int* iconSizes() const;
01193 
01201     void setUserTime( Time time );
01202 
01206     Time userTime() const;
01207 
01211     void setStartupId( const char* startup_id );
01212 
01216     const char* startupId() const;
01217 
01221     void setOpacity( unsigned long opacity );
01222 
01226     unsigned long opacity() const;
01227 
01231     void setAllowedActions( unsigned long actions );
01232 
01236     unsigned long allowedActions() const;
01237 
01242     Window transientFor() const;
01243 
01247     Window groupLeader() const;
01248 
01253     const char* windowClassClass() const;
01254 
01259     const char* windowClassName() const;
01260 
01264     const char* windowRole() const;
01265 
01269     const char* clientMachine() const;
01270 
01276     const char* activities() const;
01277 
01286     void kdeGeometry(NETRect &frame, NETRect &window);
01287 
01301     void event( XEvent* event, unsigned long* properties, int properties_size );
01302 
01314     unsigned long event(XEvent *event);
01315 
01322     static const int OnAllDesktops;
01323 
01324 protected:
01332     virtual void changeDesktop(int desktop) { Q_UNUSED(desktop); }
01333 
01343     virtual void changeState(unsigned long state, unsigned long mask) { Q_UNUSED(state); Q_UNUSED(mask); }
01344 
01345 private:
01346     void update( const unsigned long[] );
01347     void updateWMState();
01348     void setIconInternal(NETRArray<NETIcon>& icons, int& icon_count, Atom property, NETIcon icon, Bool replace);
01349     NETIcon iconInternal(NETRArray<NETIcon>& icons, int icon_count, int width, int height) const;
01350 
01351 protected:
01355     virtual void virtual_hook( int id, void* data );
01356 private:
01357     NETWinInfoPrivate *p; // krazy:exclude=dpointer (implicitly shared)
01358     friend class NETWinInfo2;
01359 };
01360 
01361 
01368 class KDEUI_EXPORT NETWinInfo2 : public NETWinInfo {
01369 public:
01370     NETWinInfo2(Display *display, Window window, Window rootWindow,
01371                 const unsigned long properties[], int properties_size,
01372                 Role role = Client);
01373 
01374     NETWinInfo2(Display *display, Window window,
01375                 Window rootWindow, unsigned long properties,
01376                 Role role = Client);
01377 
01394     void setFullscreenMonitors(NETFullscreenMonitors topology);
01395 
01401     NETFullscreenMonitors fullscreenMonitors() const;
01402 
01403 protected:
01404     friend class NETWinInfo;
01413     virtual void changeFullscreenMonitors(NETFullscreenMonitors topology) { Q_UNUSED(topology); }
01414 };
01415 
01416 //#define KWIN_FOCUS
01417 
01418 #endif
01419 #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
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
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