您最多能選擇 25 個主題 主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
kkbswitch/kkbswitch/kbswitchintf_skel.cpp

75 行
2.2 KiB

/****************************************************************************
**
** DCOP Skeleton created by dcopidl2cpp from kbswitchintf.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/
#include "./kbswitchintf.h"
#include <kdatastream.h>
static const char* const KBSwitchIntf_ftable[5][3] = {
{ "int", "getNumKbdGroups()", "getNumKbdGroups()" },
{ "ASYNC", "selectNextGroup()", "selectNextGroup()" },
{ "ASYNC", "selectGroup(int)", "selectGroup(int groupno)" },
{ "TQStringList", "getGroupNames()", "getGroupNames()" },
{ 0, 0, 0 }
};
static const int KBSwitchIntf_ftable_hiddens[4] = {
0,
0,
0,
0,
};
bool KBSwitchIntf::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
if ( fun == KBSwitchIntf_ftable[0][1] ) { // int getNumKbdGroups()
replyType = KBSwitchIntf_ftable[0][0];
TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << getNumKbdGroups( );
} else if ( fun == KBSwitchIntf_ftable[1][1] ) { // void selectNextGroup()
replyType = KBSwitchIntf_ftable[1][0];
selectNextGroup( );
} else if ( fun == KBSwitchIntf_ftable[2][1] ) { // void selectGroup(int)
int arg0;
TQDataStream arg( data, IO_ReadOnly );
arg >> arg0;
replyType = KBSwitchIntf_ftable[2][0];
selectGroup(arg0 );
} else if ( fun == KBSwitchIntf_ftable[3][1] ) { // TQStringList getGroupNames()
replyType = KBSwitchIntf_ftable[3][0];
TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << getGroupNames( );
} else {
return DCOPObject::process( fun, data, replyType, replyData );
}
return true;
}
QCStringList KBSwitchIntf::interfaces()
{
QCStringList ifaces = DCOPObject::interfaces();
ifaces += "KBSwitchIntf";
return ifaces;
}
QCStringList KBSwitchIntf::functions()
{
QCStringList funcs = DCOPObject::functions();
for ( int i = 0; KBSwitchIntf_ftable[i][2]; i++ ) {
if (KBSwitchIntf_ftable_hiddens[i])
continue;
TQCString func = KBSwitchIntf_ftable[i][0];
func += ' ';
func += KBSwitchIntf_ftable[i][2];
funcs << func;
}
return funcs;
}