15 #include <tqvaluelist.h> 17 #include <kmanagerselection.h> 18 #include <netwm_def.h> 19 #include <tdeshortcutdialog.h> 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 };
120 ActiveTopLeft = ActiveTop | ActiveLeft,
121 ActiveTopRight = ActiveTop | ActiveRight,
122 ActiveBottomLeft = ActiveBottom | ActiveLeft,
123 ActiveBottomRight = ActiveBottom | ActiveRight,
128 enum ActiveMaximizingMode
138 static bool available() {
return twin_shape_version > 0; }
139 static int version() {
return twin_shape_version; }
140 static bool hasShape( WId w);
141 static int shapeEvent();
144 static int twin_shape_version;
145 static int twin_shape_event;
150 const int ShapeInput = 2;
156 static void readFlags( WId w,
bool& noborder,
bool& resize,
bool& move,
157 bool& minimize,
bool& maximize,
bool& close );
167 MWM_HINTS_FUNCTIONS = (1L << 0),
168 MWM_HINTS_DECORATIONS = (1L << 1),
170 MWM_FUNC_ALL = (1L << 0),
171 MWM_FUNC_RESIZE = (1L << 1),
172 MWM_FUNC_MOVE = (1L << 2),
173 MWM_FUNC_MINIMIZE = (1L << 3),
174 MWM_FUNC_MAXIMIZE = (1L << 4),
175 MWM_FUNC_CLOSE = (1L << 5)
179 class KWinSelectionOwner
180 :
public TDESelectionOwner
184 KWinSelectionOwner(
int screen );
186 virtual bool genericReply( Atom target, Atom property, Window requestor );
187 virtual void replyTargets( Atom property, Window requestor );
188 virtual void getAtoms();
190 Atom make_selection_atom(
int screen );
191 static Atom xa_version;
198 template<
typename T >
199 class TemporaryAssign
202 TemporaryAssign(
const T& var,
const T& value )
203 : variable( var ), orig( var )
205 const_cast< T&
>( variable ) = value;
209 const_cast< T&
>( variable ) = orig;
216 TQCString getStringProperty(WId w, Atom prop,
char separator=0);
219 void ungrabXServer();
220 bool grabbedXServer();
224 #define UrgencyHint XUrgencyHint 228 #define KWIN_CHECK_PREDICATE( name, check ) \ 231 inline bool operator()( const Client* cl ) { return check; }; \ 234 #define KWIN_COMPARE_PREDICATE( name, type, check ) \ 237 typedef type type_helper; \ 238 inline name( const type_helper& compare_value ) : value( compare_value ) {}; \ 239 inline bool operator()( const Client* cl ) { return check; }; \ 240 const type_helper& value; \ 243 #define KWIN_PROCEDURE( name, action ) \ 246 inline void operator()( Client* cl ) { action; }; \ 249 KWIN_CHECK_PREDICATE( TruePredicate, cl == cl );
251 template<
typename T >
252 Client* findClientInList(
const ClientList& list, T predicate )
254 for ( ClientList::ConstIterator it = list.begin(); it != list.end(); ++it)
256 if ( predicate( const_cast< const Client* >( *it)))
263 int timestampCompare( Time time1, Time time2 )
265 return NET::timestampCompare( time1, time2 );
269 Time timestampDiff( Time time1, Time time2 )
271 return NET::timestampDiff( time1, time2 );
274 bool isLocalMachine(
const TQCString& host );
276 void checkNonExistentClients();
281 :
public TDEShortcutDialog
285 ShortcutDialog(
const TDEShortcut& cut );
286 virtual void accept();
289 void dialogDone(
bool ok );
291 virtual void done(
int r ) { TDEShortcutDialog::done( r ); emit dialogDone( r == Accepted ); }