1 /********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
5 Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *********************************************************************/
21 #ifndef KWIN_LIB_KWINGLOBALS_H
22 #define KWIN_LIB_KWINGLOBALS_H
24 #include <QtGui/QX11Info>
25 #include <QtCore/QPoint>
26 #include <QtGui/QRegion>
28 #include <kdemacros.h>
33 #include <kwinconfig.h>
35 #define KWIN_EXPORT KDE_EXPORT
50 PlacementArea
, // geometry where a window will be initially placed after being mapped
51 MovementArea
, // ??? window movement snapping area? ignore struts
52 MaximizeArea
, // geometry to which a window will be maximized
53 MaximizeFullArea
, // like MaximizeArea, but ignore struts - used e.g. for topmenu
54 FullScreenArea
, // area for fullscreen windows
55 // these below don't depend on xinerama settings
56 WorkArea
, // whole workarea (all screens together)
57 FullArea
, // whole area (all screens together), ignore struts
58 ScreenArea
// one whole screen, ignore struts
75 // DesktopMode and WindowsMode are based on the order in which the desktop
76 // or window were viewed.
77 // DesktopListMode lists them in the order created.
78 enum TabBoxMode
{ TabBoxDesktopMode
, TabBoxDesktopListMode
, TabBoxWindowsMode
};
81 KWIN_EXPORT Display
* display()
83 return QX11Info::display();
87 KWIN_EXPORT Window
rootWindow()
89 return QX11Info::appRootWindow();
93 KWIN_EXPORT Window
xTime()
95 return QX11Info::appTime();
99 KWIN_EXPORT
int displayWidth()
101 return XDisplayWidth( display(), DefaultScreen( display()));
105 KWIN_EXPORT
int displayHeight()
107 return XDisplayHeight( display(), DefaultScreen( display()));
111 class KWIN_EXPORT Extensions
115 static bool shapeAvailable() { return shape_version
> 0; }
116 static bool shapeInputAvailable();
117 static int shapeNotifyEvent();
118 static bool hasShape( Window w
);
119 static bool randrAvailable() { return has_randr
; }
120 static int randrNotifyEvent();
121 static bool damageAvailable() { return has_damage
; }
122 static int damageNotifyEvent();
123 static bool compositeAvailable() { return composite_version
> 0; }
124 static bool compositeOverlayAvailable();
125 static bool renderAvailable() { return render_version
> 0; }
126 static bool fixesAvailable() { return fixes_version
> 0; }
127 static bool fixesRegionAvailable();
128 static bool glxAvailable() { return has_glx
; }
129 static bool syncAvailable() { return has_sync
; }
130 static int syncAlarmNotifyEvent();
131 static void fillExtensionsData( const char**& extensions
, int& nextensions
, int*&majors
, int*& error_bases
);
133 static void addData( const char* name
);
134 static int shape_version
;
135 static int shape_event_base
;
136 static bool has_randr
;
137 static int randr_event_base
;
138 static bool has_damage
;
139 static int damage_event_base
;
140 static int composite_version
;
141 static int render_version
;
142 static int fixes_version
;
144 static bool has_sync
;
145 static int sync_event_base
;
146 static const char* data_extensions
[ 32 ];
147 static int data_nextensions
;
148 static int data_opcodes
[ 32 ];
149 static int data_error_bases
[ 32 ];