15#include <tqvaluelist.h> 
   17#include <kmanagerselection.h> 
   19#include <tdeshortcutdialog.h> 
   24const 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;
 
   28const long ClientWinMask = KeyPressMask | KeyReleaseMask |
 
   29                          ButtonPressMask | ButtonReleaseMask |
 
   33                  EnterWindowMask | LeaveWindowMask |
 
   37                  SubstructureRedirectMask;
 
   39const TQPoint invalidPoint( INT_MIN, INT_MIN );
 
   45typedef TQValueList< Client* > ClientList;
 
   46typedef TQValueList< const Client* > ConstClientList;
 
   48typedef TQValueList< Group* > GroupList;
 
   49typedef TQValueList< const Group* > ConstGroupList;
 
   51extern Options* options;
 
   57    DesktopLayer = FirstLayer,
 
   67inline void operator++( Layer& lay )
 
   69    lay = 
static_cast< Layer 
>( lay + 1 );
 
   75    ActivityFocus = 1 << 0, 
 
   76    ActivityFocusForce = 1 << 1, 
 
   77    ActivityRaise = 1 << 2 
 
   84enum allowed_t { Allowed };
 
   87enum ForceGeometry_t { NormalGeometrySet, ForceGeometrySet };
 
  125enum 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;
 
  147const 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)
 
  176class 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;
 
  195template< 
typename T >
 
  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;
 
  213TQCString getStringProperty(WId w, Atom prop, 
char separator=0);
 
  217bool 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; }; \ 
  246KWIN_CHECK_PREDICATE( TruePredicate, cl == cl  );
 
  248template< 
typename T >
 
  249Client* 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)))
 
  260int timestampCompare( Time time1, Time time2 ) 
 
  262    return NET::timestampCompare( time1, time2 );
 
  266Time timestampDiff( Time time1, Time time2 ) 
 
  268    return NET::timestampDiff( time1, time2 );
 
  271bool isLocalMachine( 
const TQCString& host );
 
  273void 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 ); }