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
41
enum CompositingType {
47
enum clientAreaOption {
48
PlacementArea, // geometry where a window will be initially placed after being mapped
49
MovementArea, // ??? window movement snapping area? ignore struts
50
MaximizeArea, // geometry to which a window will be maximized
51
MaximizeFullArea, // like MaximizeArea, but ignore struts - used e.g. for topmenu
52
FullScreenArea, // area for fullscreen windows
53
// these below don't depend on xinerama settings
54
WorkArea, // whole workarea (all screens together)
55
FullArea, // whole area (all screens together), ignore struts
56
ScreenArea // one whole screen, ignore struts
75
QuickTileRight = 1<<1,
77
QuickTileBottom = 1<<3,
78
QuickTileHorizontal = QuickTileLeft|QuickTileRight,
79
QuickTileVertical = QuickTileTop|QuickTileBottom,
80
QuickTileMaximize = QuickTileLeft|QuickTileRight|QuickTileTop|QuickTileBottom
83
Q_DECLARE_FLAGS(QuickTileMode, QuickTileFlag)
85
// TODO: Hardcoding is bad, need to add some way of registering global actions to these.
86
// When designing the new system we must keep in mind that we have conditional actions
87
// such as "only when moving windows" desktop switching that the current global action
88
// system doesn't support.
89
enum ElectricBorderAction {
90
ElectricActionNone, // No special action, not set, desktop switch or an effect
91
ElectricActionDashboard, // Launch the Plasma dashboard
92
ElectricActionShowDesktop, // Show desktop or restore
93
ElectricActionLockScreen, // Lock screen
94
ElectricActionPreventScreenLocking,
98
// DesktopMode and WindowsMode are based on the order in which the desktop
99
// or window were viewed.
100
// DesktopListMode lists them in the order created.
102
TabBoxDesktopMode, // Focus chain of desktops
103
TabBoxDesktopListMode, // Static desktop order
104
TabBoxWindowsMode, // Primary window switching mode
105
TabBoxWindowsAlternativeMode // Secondary window switching mode
109
KWIN_EXPORT Display* display()
111
return QX11Info::display();
115
KWIN_EXPORT Window rootWindow()
117
return QX11Info::appRootWindow();
121
KWIN_EXPORT Window xTime()
123
return QX11Info::appTime();
127
KWIN_EXPORT int displayWidth()
129
return XDisplayWidth(display(), DefaultScreen(display()));
133
KWIN_EXPORT int displayHeight()
135
return XDisplayHeight(display(), DefaultScreen(display()));
139
class KWIN_EXPORT Extensions
143
static bool shapeAvailable() {
144
return shape_version > 0;
146
static bool shapeInputAvailable();
147
static int shapeNotifyEvent();
148
static bool hasShape(Window w);
149
static bool randrAvailable() {
152
static int randrNotifyEvent();
153
static bool damageAvailable() {
156
static int damageNotifyEvent();
157
static bool compositeAvailable() {
158
return composite_version > 0;
160
static bool compositeOverlayAvailable();
161
static bool renderAvailable() {
162
return render_version > 0;
164
static bool fixesAvailable() {
165
return fixes_version > 0;
167
static bool fixesRegionAvailable();
168
static bool glxAvailable() {
171
static bool syncAvailable() {
174
static bool nonNativePixmaps() {
175
return non_native_pixmaps;
177
static int syncAlarmNotifyEvent();
178
static void fillExtensionsData(const char**& extensions, int& nextensions, int*&majors, int*& error_bases);
180
static void addData(const char* name);
181
static int shape_version;
182
static int shape_event_base;
183
static bool has_randr;
184
static int randr_event_base;
185
static bool has_damage;
186
static int damage_event_base;
187
static int composite_version;
188
static int render_version;
189
static int fixes_version;
191
static bool has_sync;
192
static int sync_event_base;
193
static const char* data_extensions[ 32 ];
194
static int data_nextensions;
195
static int data_opcodes[ 32 ];
196
static int data_error_bases[ 32 ];
197
static bool non_native_pixmaps;
202
Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::QuickTileMode)