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 };
114 static bool available() {
return twin_shape_version > 0; }
115 static int version() {
return twin_shape_version; }
116 static bool hasShape( WId w);
117 static int shapeEvent();
120 static int twin_shape_version;
121 static int twin_shape_event;
126 const int ShapeInput = 2;
132 static void readFlags( WId w,
bool& noborder,
bool& resize,
bool& move,
133 bool& minimize,
bool& maximize,
bool& close );
143 MWM_HINTS_FUNCTIONS = (1L << 0),
144 MWM_HINTS_DECORATIONS = (1L << 1),
146 MWM_FUNC_ALL = (1L << 0),
147 MWM_FUNC_RESIZE = (1L << 1),
148 MWM_FUNC_MOVE = (1L << 2),
149 MWM_FUNC_MINIMIZE = (1L << 3),
150 MWM_FUNC_MAXIMIZE = (1L << 4),
151 MWM_FUNC_CLOSE = (1L << 5)
155 class KWinSelectionOwner
156 :
public TDESelectionOwner
160 KWinSelectionOwner(
int screen );
162 virtual bool genericReply( Atom target, Atom property, Window requestor );
163 virtual void replyTargets( Atom property, Window requestor );
164 virtual void getAtoms();
166 Atom make_selection_atom(
int screen );
167 static Atom xa_version;
174 template<
typename T >
175 class TemporaryAssign
178 TemporaryAssign(
const T& var,
const T& value )
179 : variable( var ), orig( var )
181 const_cast< T&
>( variable ) = value;
185 const_cast< T&
>( variable ) = orig;
192 TQCString getStringProperty(WId w, Atom prop,
char separator=0);
195 void ungrabXServer();
196 bool grabbedXServer();
200 #define UrgencyHint XUrgencyHint
204 #define KWIN_CHECK_PREDICATE( name, check ) \
207 inline bool operator()( const Client* cl ) { return check; }; \
210 #define KWIN_COMPARE_PREDICATE( name, type, check ) \
213 typedef type type_helper; \
214 inline name( const type_helper& compare_value ) : value( compare_value ) {}; \
215 inline bool operator()( const Client* cl ) { return check; }; \
216 const type_helper& value; \
219 #define KWIN_PROCEDURE( name, action ) \
222 inline void operator()( Client* cl ) { action; }; \
225 KWIN_CHECK_PREDICATE( TruePredicate, cl == cl );
227 template<
typename T >
228 Client* findClientInList(
const ClientList& list, T predicate )
230 for ( ClientList::ConstIterator it = list.begin(); it != list.end(); ++it)
232 if ( predicate( const_cast< const Client* >( *it)))
239 int timestampCompare( Time time1, Time time2 )
241 return NET::timestampCompare( time1, time2 );
245 Time timestampDiff( Time time1, Time time2 )
247 return NET::timestampDiff( time1, time2 );
250 bool isLocalMachine(
const TQCString& host );
252 void checkNonExistentClients();
257 :
public TDEShortcutDialog
261 ShortcutDialog(
const TDEShortcut& cut );
262 virtual void accept();
265 void dialogDone(
bool ok );
267 virtual void done(
int r ) { TDEShortcutDialog::done( r ); emit dialogDone( r == Accepted ); }