15 #include <tqvaluelist.h>
17 #include <kmanagerselection.h>
18 #include <netwm_def.h>
19 #include <tdeshortcutdialog.h>
21 namespace KWinInternal
24 const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
25 | NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::TopMenuMask
26 | NET::UtilityMask | NET::SplashMask;
28 const long ClientWinMask = KeyPressMask | KeyReleaseMask |
29 ButtonPressMask | ButtonReleaseMask |
33 EnterWindowMask | LeaveWindowMask |
37 SubstructureRedirectMask;
39 const TQPoint invalidPoint( INT_MIN, INT_MIN );
45 typedef TQValueList< Client* > ClientList;
46 typedef TQValueList< const Client* > ConstClientList;
48 typedef TQValueList< Group* > GroupList;
49 typedef TQValueList< const Group* > ConstGroupList;
51 extern Options* options;
57 DesktopLayer = FirstLayer,
67 inline void operator++( Layer& lay )
69 lay =
static_cast< Layer
>( lay + 1 );
75 ActivityFocus = 1 << 0,
76 ActivityFocusForce = 1 << 1,
77 ActivityRaise = 1 << 2
84 enum allowed_t { Allowed };
87 enum ForceGeometry_t { NormalGeometrySet, ForceGeometrySet };
125 enum ActiveMaximizingMode
135 static bool available() {
return twin_shape_version > 0; }
136 static int version() {
return twin_shape_version; }
137 static bool hasShape( WId w);
138 static int shapeEvent();
141 static int twin_shape_version;
142 static int twin_shape_event;
147 const int ShapeInput = 2;
153 static void readFlags( WId w,
bool& noborder,
bool& resize,
bool& move,
154 bool& minimize,
bool& maximize,
bool& close );
164 MWM_HINTS_FUNCTIONS = (1L << 0),
165 MWM_HINTS_DECORATIONS = (1L << 1),
167 MWM_FUNC_ALL = (1L << 0),
168 MWM_FUNC_RESIZE = (1L << 1),
169 MWM_FUNC_MOVE = (1L << 2),
170 MWM_FUNC_MINIMIZE = (1L << 3),
171 MWM_FUNC_MAXIMIZE = (1L << 4),
172 MWM_FUNC_CLOSE = (1L << 5)
176 class KWinSelectionOwner
177 :
public TDESelectionOwner
181 KWinSelectionOwner(
int screen );
183 virtual bool genericReply( Atom target, Atom property, Window requestor );
184 virtual void replyTargets( Atom property, Window requestor );
185 virtual void getAtoms();
187 Atom make_selection_atom(
int screen );
188 static Atom xa_version;
195 template<
typename T >
196 class TemporaryAssign
199 TemporaryAssign(
const T& var,
const T& value )
200 : variable( var ), orig( var )
202 const_cast< T&
>( variable ) = value;
206 const_cast< T&
>( variable ) = orig;
213 TQCString getStringProperty(WId w, Atom prop,
char separator=0);
216 void ungrabXServer();
217 bool grabbedXServer();
221 #define UrgencyHint XUrgencyHint
225 #define KWIN_CHECK_PREDICATE( name, check ) \
228 inline bool operator()( const Client* cl ) { return check; }; \
231 #define KWIN_COMPARE_PREDICATE( name, type, check ) \
234 typedef type type_helper; \
235 inline name( const type_helper& compare_value ) : value( compare_value ) {}; \
236 inline bool operator()( const Client* cl ) { return check; }; \
237 const type_helper& value; \
240 #define KWIN_PROCEDURE( name, action ) \
243 inline void operator()( Client* cl ) { action; }; \
246 KWIN_CHECK_PREDICATE( TruePredicate, cl == cl );
248 template<
typename T >
249 Client* findClientInList(
const ClientList& list, T predicate )
251 for ( ClientList::ConstIterator it = list.begin(); it != list.end(); ++it)
253 if ( predicate(
const_cast< const Client*
>( *it)))
260 int timestampCompare( Time time1, Time time2 )
262 return NET::timestampCompare( time1, time2 );
266 Time timestampDiff( Time time1, Time time2 )
268 return NET::timestampDiff( time1, time2 );
271 bool isLocalMachine(
const TQCString& host );
273 void checkNonExistentClients();
278 :
public TDEShortcutDialog
282 ShortcutDialog(
const TDEShortcut& cut );
283 virtual void accept();
286 void dialogDone(
bool ok );
288 virtual void done(
int r ) { TDEShortcutDialog::done( r ); emit dialogDone( r == Accepted ); }