From 6482ac8053992b508ab49a7f143d0382f2180271 Mon Sep 17 00:00:00 2001 From: Christopher Molnar Date: Sat, 12 Feb 2000 00:25:21 +0000 Subject: [PATCH] Added kwininface:logout code. Still needs revisions - Chris M. svn path=/trunk/kdebase/kwin/; revision=40506 --- main.cpp | 32 +++++++++++++++++++++++++++++++- main.h | 8 +++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 726959dbdd..a89996dcbe 100644 --- a/main.cpp +++ b/main.cpp @@ -2,6 +2,7 @@ #include "options.h" #include "atoms.h" #include "workspace.h" +#include #include #include #include @@ -101,6 +102,29 @@ Application::~Application() delete options; } +void kwiniface::logout() +{ +exit (0); +} + +bool kwiniface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData) +{ + fprintf(stderr,"Logout Call Recieved\n"); + if ( fun == "logout()" ) + { + replyType = "void"; + logout(); + return TRUE; + } + else + { + + return FALSE; + } +} + + + bool Application::x11EventFilter( XEvent *e ) { switch ( e->type ) { @@ -151,5 +175,11 @@ int main( int argc, char * argv[] ) Application a; fcntl(ConnectionNumber(qt_xdisplay()), F_SETFD, 1); - return a.exec(); + DCOPClient *client = kapp->dcopClient(); + client->attach(); + client->registerAs("kwin"); + + + return a.exec(); + } diff --git a/main.h b/main.h index a814100f99..3314a66615 100644 --- a/main.h +++ b/main.h @@ -3,6 +3,13 @@ #include #include "workspace.h" +#include + +class kwiniface : virtual public DCOPObject +{ +K_DCOP + virtual void logout(); +}; typedef QValueList WorkspaceList; class Application : public KApplication @@ -19,5 +26,4 @@ private: }; - #endif