KShutdown – graphical shutdown utility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
3.8KB

  1. /****************************************************************************
  2. **
  3. ** DCOP Skeleton generated by dcopidl2cpp from kshutdowniface.kidl
  4. **
  5. ** WARNING! All changes made in this file will be lost!
  6. **
  7. *****************************************************************************/
  8. #include "kshutdowniface.h"
  9. #include <kdatastream.h>
  10. #include <tqasciidict.h>
  11. static const int KShutdownIface_fhash = 13;
  12. static const char* const KShutdownIface_ftable[12][3] = {
  13. { "ASYNC", "cancel()", "cancel()" },
  14. { "bool", "shutDown()", "shutDown()" },
  15. { "bool", "shutdown()", "shutdown()" },
  16. { "bool", "reboot()", "reboot()" },
  17. { "bool", "lockScreen()", "lockScreen()" },
  18. { "bool", "logout()", "logout()" },
  19. { "ASYNC", "configure()", "configure()" },
  20. { "TQString", "getStatusInfo()", "getStatusInfo()" },
  21. { "void", "makeInvisible()", "makeInvisible()" },
  22. { "ASYNC", "makeVisible()", "makeVisible()" },
  23. { "ASYNC", "setTestMode(bool)", "setTestMode(bool yes)" },
  24. { 0, 0, 0 }
  25. };
  26. static const int KShutdownIface_ftable_hiddens[11] = {
  27. 0,
  28. 0,
  29. 0,
  30. 0,
  31. 0,
  32. 0,
  33. 0,
  34. 0,
  35. 0,
  36. 0,
  37. 0,
  38. };
  39. bool KShutdownIface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
  40. {
  41. static TQAsciiDict<int>* fdict = 0;
  42. if ( !fdict ) {
  43. fdict = new TQAsciiDict<int>( KShutdownIface_fhash, true, false );
  44. for ( int i = 0; KShutdownIface_ftable[i][1]; i++ )
  45. fdict->insert( KShutdownIface_ftable[i][1], new int( i ) );
  46. }
  47. int* fp = fdict->find( fun );
  48. switch ( fp?*fp:-1) {
  49. case 0: { // void cancel()
  50. replyType = KShutdownIface_ftable[0][0];
  51. cancel( );
  52. } break;
  53. case 1: { // bool shutDown()
  54. replyType = KShutdownIface_ftable[1][0];
  55. TQDataStream _replyStream( replyData, IO_WriteOnly );
  56. _replyStream << shutDown( );
  57. } break;
  58. case 2: { // bool shutdown()
  59. replyType = KShutdownIface_ftable[2][0];
  60. TQDataStream _replyStream( replyData, IO_WriteOnly );
  61. _replyStream << shutdown( );
  62. } break;
  63. case 3: { // bool reboot()
  64. replyType = KShutdownIface_ftable[3][0];
  65. TQDataStream _replyStream( replyData, IO_WriteOnly );
  66. _replyStream << reboot( );
  67. } break;
  68. case 4: { // bool lockScreen()
  69. replyType = KShutdownIface_ftable[4][0];
  70. TQDataStream _replyStream( replyData, IO_WriteOnly );
  71. _replyStream << lockScreen( );
  72. } break;
  73. case 5: { // bool logout()
  74. replyType = KShutdownIface_ftable[5][0];
  75. TQDataStream _replyStream( replyData, IO_WriteOnly );
  76. _replyStream << logout( );
  77. } break;
  78. case 6: { // void configure()
  79. replyType = KShutdownIface_ftable[6][0];
  80. configure( );
  81. } break;
  82. case 7: { // TQString getStatusInfo()
  83. replyType = KShutdownIface_ftable[7][0];
  84. TQDataStream _replyStream( replyData, IO_WriteOnly );
  85. _replyStream << getStatusInfo( );
  86. } break;
  87. case 8: { // void makeInvisible()
  88. replyType = KShutdownIface_ftable[8][0];
  89. makeInvisible( );
  90. } break;
  91. case 9: { // void makeVisible()
  92. replyType = KShutdownIface_ftable[9][0];
  93. makeVisible( );
  94. } break;
  95. case 10: { // void setTestMode(bool)
  96. bool arg0;
  97. TQDataStream arg( data, IO_ReadOnly );
  98. if (arg.atEnd()) return false;
  99. arg >> arg0;
  100. replyType = KShutdownIface_ftable[10][0];
  101. setTestMode(arg0 );
  102. } break;
  103. default:
  104. return DCOPObject::process( fun, data, replyType, replyData );
  105. }
  106. return true;
  107. }
  108. QCStringList KShutdownIface::interfaces()
  109. {
  110. QCStringList ifaces = DCOPObject::interfaces();
  111. ifaces += "KShutdownIface";
  112. return ifaces;
  113. }
  114. QCStringList KShutdownIface::functions()
  115. {
  116. QCStringList funcs = DCOPObject::functions();
  117. for ( int i = 0; KShutdownIface_ftable[i][2]; i++ ) {
  118. if (KShutdownIface_ftable_hiddens[i])
  119. continue;
  120. TQCString func = KShutdownIface_ftable[i][0];
  121. func += ' ';
  122. func += KShutdownIface_ftable[i][2];
  123. funcs << func;
  124. }
  125. return funcs;
  126. }