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

KWinLibraries

kwinglobals.h

Go to the documentation of this file.
00001 /********************************************************************
00002  KWin - the KDE window manager
00003  This file is part of the KDE project.
00004 
00005 Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
00006 
00007 This program is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011 
00012 This program is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 *********************************************************************/
00020 
00021 #ifndef KWIN_LIB_KWINGLOBALS_H
00022 #define KWIN_LIB_KWINGLOBALS_H
00023 
00024 #include <QtGui/QX11Info>
00025 #include <QtCore/QPoint>
00026 #include <QtGui/QRegion>
00027 
00028 #include <kdemacros.h>
00029 
00030 #include <X11/Xlib.h>
00031 #include <fixx11h.h>
00032 
00033 #include <kwinconfig.h>
00034 
00035 #define KWIN_EXPORT KDE_EXPORT
00036 
00037 namespace KWin
00038 {
00039 
00040 
00041 enum CompositingType
00042 {
00043     NoCompositing = 0,
00044     OpenGLCompositing,
00045     XRenderCompositing
00046 };
00047 
00048 enum clientAreaOption
00049 {
00050     PlacementArea,         // geometry where a window will be initially placed after being mapped
00051     MovementArea,          // ???  window movement snapping area?  ignore struts
00052     MaximizeArea,          // geometry to which a window will be maximized
00053     MaximizeFullArea,      // like MaximizeArea, but ignore struts - used e.g. for topmenu
00054     FullScreenArea,        // area for fullscreen windows
00055     // these below don't depend on xinerama settings
00056     WorkArea,              // whole workarea (all screens together)
00057     FullArea,              // whole area (all screens together), ignore struts
00058     ScreenArea             // one whole screen, ignore struts
00059 };
00060 
00061 enum ElectricBorder
00062 {
00063     ElectricTop,
00064     ElectricTopRight,
00065     ElectricRight,
00066     ElectricBottomRight,
00067     ElectricBottom,
00068     ElectricBottomLeft,
00069     ElectricLeft,
00070     ElectricTopLeft,
00071     ELECTRIC_COUNT,
00072     ElectricNone
00073 };
00074 
00075 // DesktopMode and WindowsMode are based on the order in which the desktop
00076 //  or window were viewed.
00077 // DesktopListMode lists them in the order created.
00078 enum TabBoxMode { TabBoxDesktopMode, TabBoxDesktopListMode, TabBoxWindowsMode };
00079 
00080 inline
00081 KWIN_EXPORT Display* display()
00082     {
00083     return QX11Info::display();
00084     }
00085 
00086 inline
00087 KWIN_EXPORT Window rootWindow()
00088     {
00089     return QX11Info::appRootWindow();
00090     }
00091 
00092 inline
00093 KWIN_EXPORT Window xTime()
00094     {
00095     return QX11Info::appTime();
00096     }
00097 
00098 inline
00099 KWIN_EXPORT int displayWidth()
00100     {
00101     return XDisplayWidth( display(), DefaultScreen( display()));
00102     }
00103 
00104 inline
00105 KWIN_EXPORT int displayHeight()
00106     {
00107     return XDisplayHeight( display(), DefaultScreen( display()));
00108     }
00109 
00111 class KWIN_EXPORT Extensions
00112     {
00113     public:
00114         static void init();
00115         static bool shapeAvailable() { return shape_version > 0; }
00116         static bool shapeInputAvailable();
00117         static int shapeNotifyEvent();
00118         static bool hasShape( Window w );
00119         static bool randrAvailable() { return has_randr; }
00120         static int randrNotifyEvent();
00121         static bool damageAvailable() { return has_damage; }
00122         static int damageNotifyEvent();
00123         static bool compositeAvailable() { return composite_version > 0; }
00124         static bool compositeOverlayAvailable();
00125         static bool renderAvailable() { return render_version > 0; }
00126         static bool fixesAvailable() { return fixes_version > 0; }
00127         static bool fixesRegionAvailable();
00128         static bool glxAvailable() { return has_glx; }
00129         static bool syncAvailable() { return has_sync; }
00130         static int syncAlarmNotifyEvent();
00131         static void fillExtensionsData( const char**& extensions, int& nextensions, int*&majors, int*& error_bases );
00132     private:
00133         static void addData( const char* name );
00134         static int shape_version;
00135         static int shape_event_base;
00136         static bool has_randr;
00137         static int randr_event_base;
00138         static bool has_damage;
00139         static int damage_event_base;
00140         static int composite_version;
00141         static int render_version;
00142         static int fixes_version;
00143         static bool has_glx;
00144         static bool has_sync;
00145         static int sync_event_base;
00146         static const char* data_extensions[ 32 ];
00147         static int data_nextensions;
00148         static int data_opcodes[ 32 ];
00149         static int data_error_bases[ 32 ];
00150     };
00151 
00152 } // namespace
00153 
00154 #endif

KWinLibraries

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference 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