00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./KWinInterface.h"
00010
00011 #include <kdatastream.h>
00012 #include <qasciidict.h>
00013
00014
00015 static const int KWinInterface_fhash = 17;
00016 static const char* const KWinInterface_ftable[14][3] = {
00017 { "ASYNC", "cascadeDesktop()", "cascadeDesktop()" },
00018 { "ASYNC", "unclutterDesktop()", "unclutterDesktop()" },
00019 { "ASYNC", "reconfigure()", "reconfigure()" },
00020 { "ASYNC", "killWindow()", "killWindow()" },
00021 { "void", "refresh()", "refresh()" },
00022 { "void", "doNotManage(QString)", "doNotManage(QString)" },
00023 { "void", "showWindowMenuAt(unsigned long int,int,int)", "showWindowMenuAt(unsigned long int winId,int x,int y)" },
00024 { "void", "setDesktopLayout(int,int,int)", "setDesktopLayout(int orientation,int x,int y)" },
00025 { "bool", "setCurrentDesktop(int)", "setCurrentDesktop(int)" },
00026 { "int", "currentDesktop()", "currentDesktop()" },
00027 { "void", "nextDesktop()", "nextDesktop()" },
00028 { "void", "previousDesktop()", "previousDesktop()" },
00029 { "void", "circulateDesktopApplications()", "circulateDesktopApplications()" },
00030 { 0, 0, 0 }
00031 };
00032 static const int KWinInterface_ftable_hiddens[13] = {
00033 0,
00034 0,
00035 0,
00036 0,
00037 0,
00038 0,
00039 0,
00040 0,
00041 0,
00042 0,
00043 0,
00044 0,
00045 0,
00046 };
00047
00048 bool KWinInterface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00049 {
00050 static QAsciiDict<int>* fdict = 0;
00051 if ( !fdict ) {
00052 fdict = new QAsciiDict<int>( KWinInterface_fhash, true, false );
00053 for ( int i = 0; KWinInterface_ftable[i][1]; i++ )
00054 fdict->insert( KWinInterface_ftable[i][1], new int( i ) );
00055 }
00056 int* fp = fdict->find( fun );
00057 switch ( fp?*fp:-1) {
00058 case 0: {
00059 replyType = KWinInterface_ftable[0][0];
00060 cascadeDesktop( );
00061 } break;
00062 case 1: {
00063 replyType = KWinInterface_ftable[1][0];
00064 unclutterDesktop( );
00065 } break;
00066 case 2: {
00067 replyType = KWinInterface_ftable[2][0];
00068 reconfigure( );
00069 } break;
00070 case 3: {
00071 replyType = KWinInterface_ftable[3][0];
00072 killWindow( );
00073 } break;
00074 case 4: {
00075 replyType = KWinInterface_ftable[4][0];
00076 refresh( );
00077 } break;
00078 case 5: {
00079 QString arg0;
00080 QDataStream arg( data, IO_ReadOnly );
00081 arg >> arg0;
00082 replyType = KWinInterface_ftable[5][0];
00083 doNotManage(arg0 );
00084 } break;
00085 case 6: {
00086 unsigned long int arg0;
00087 int arg1;
00088 int arg2;
00089 QDataStream arg( data, IO_ReadOnly );
00090 arg >> arg0;
00091 arg >> arg1;
00092 arg >> arg2;
00093 replyType = KWinInterface_ftable[6][0];
00094 showWindowMenuAt(arg0, arg1, arg2 );
00095 } break;
00096 case 7: {
00097 int arg0;
00098 int arg1;
00099 int arg2;
00100 QDataStream arg( data, IO_ReadOnly );
00101 arg >> arg0;
00102 arg >> arg1;
00103 arg >> arg2;
00104 replyType = KWinInterface_ftable[7][0];
00105 setDesktopLayout(arg0, arg1, arg2 );
00106 } break;
00107 case 8: {
00108 int arg0;
00109 QDataStream arg( data, IO_ReadOnly );
00110 arg >> arg0;
00111 replyType = KWinInterface_ftable[8][0];
00112 QDataStream _replyStream( replyData, IO_WriteOnly );
00113 _replyStream << setCurrentDesktop(arg0 );
00114 } break;
00115 case 9: {
00116 replyType = KWinInterface_ftable[9][0];
00117 QDataStream _replyStream( replyData, IO_WriteOnly );
00118 _replyStream << currentDesktop( );
00119 } break;
00120 case 10: {
00121 replyType = KWinInterface_ftable[10][0];
00122 nextDesktop( );
00123 } break;
00124 case 11: {
00125 replyType = KWinInterface_ftable[11][0];
00126 previousDesktop( );
00127 } break;
00128 case 12: {
00129 replyType = KWinInterface_ftable[12][0];
00130 circulateDesktopApplications( );
00131 } break;
00132 default:
00133 return DCOPObject::process( fun, data, replyType, replyData );
00134 }
00135 return true;
00136 }
00137
00138 QCStringList KWinInterface::interfaces()
00139 {
00140 QCStringList ifaces = DCOPObject::interfaces();
00141 ifaces += "KWinInterface";
00142 return ifaces;
00143 }
00144
00145 QCStringList KWinInterface::functions()
00146 {
00147 QCStringList funcs = DCOPObject::functions();
00148 for ( int i = 0; KWinInterface_ftable[i][2]; i++ ) {
00149 if (KWinInterface_ftable_hiddens[i])
00150 continue;
00151 QCString func = KWinInterface_ftable[i][0];
00152 func += ' ';
00153 func += KWinInterface_ftable[i][2];
00154 funcs << func;
00155 }
00156 return funcs;
00157 }
00158
00159 void KWinInterface::dcopResetAllClients()
00160 {
00161 QByteArray data;
00162 emitDCOPSignal( "dcopResetAllClients()", data );
00163 }
00164
00165