sm.h

00001 /*****************************************************************
00002  KWin - the KDE window manager
00003  This file is part of the KDE project.
00004 
00005 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
00006 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
00007 
00008 You can Freely distribute this program under the GNU General Public
00009 License. See the file "COPYING" for the exact licensing terms.
00010 ******************************************************************/
00011 
00012 #ifndef KWIN_SM_H
00013 #define KWIN_SM_H
00014 
00015 #include <X11/SM/SMlib.h>
00016 #include <kapplication.h>
00017 #include <netwm_def.h>
00018 
00019 class QSocketNotifier;
00020 
00021 namespace KWinInternal
00022 {
00023 
00024 struct SessionInfo
00025     {
00026     QCString sessionId;
00027     QCString windowRole;
00028     QCString wmCommand;
00029     QCString wmClientMachine;
00030     QCString resourceName;
00031     QCString resourceClass;
00032 
00033     QRect geometry;
00034     QRect restore;
00035     QRect fsrestore;
00036     int maximized;
00037     int fullscreen;
00038     int desktop;
00039     bool minimized;
00040     bool onAllDesktops;
00041     bool shaded;
00042     bool keepAbove;
00043     bool keepBelow;
00044     bool skipTaskbar;
00045     bool skipPager;
00046     bool userNoBorder;
00047     NET::WindowType windowType;
00048     QString shortcut;
00049     bool active; // means 'was active in the saved session'
00050     };
00051 
00052 
00053 enum SMSavePhase
00054     {
00055     SMSavePhase0,     // saving global state in "phase 0"
00056     SMSavePhase2,     // saving window state in phase 2
00057     SMSavePhase2Full  // complete saving in phase2, there was no phase 0
00058     };
00059     
00060 class SessionSaveDoneHelper
00061     : public QObject
00062     {
00063     Q_OBJECT
00064     public:
00065         SessionSaveDoneHelper();
00066         virtual ~SessionSaveDoneHelper();
00067         SmcConn connection() const { return conn; }
00068         void saveDone();
00069         void close();
00070     private slots:
00071         void processData();
00072     private:
00073         QSocketNotifier* notifier;
00074         SmcConn conn;
00075     };
00076 
00077 
00078 class SessionManaged
00079     : public KSessionManaged
00080     {
00081     public:
00082         virtual bool saveState( QSessionManager& sm );
00083         virtual bool commitData( QSessionManager& sm );
00084     };
00085 
00086 } // namespace
00087 
00088 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys