SmXSMP.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*
  24. * (c) Copyright 1995 Digital Equipment Corporation.
  25. * (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
  26. * (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
  27. * (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
  28. * (c) Copyright 1993, 1994, 1995 Novell, Inc.
  29. * (c) Copyright 1995 FUJITSU LIMITED.
  30. * (c) Copyright 1995 Hitachi.
  31. *
  32. * $XConsortium: SmXSMP.h /main/16 1996/02/13 11:02:37 barstow $
  33. */
  34. /*************************************<+>*************************************
  35. *****************************************************************************
  36. **
  37. ** File: SmXSMP.h
  38. **
  39. ** Project: DT Session Manager (dtsession)
  40. **
  41. *****************************************************************************
  42. *************************************<+>*************************************/
  43. #ifndef _smxsmp_h
  44. #define _smxsmp_h
  45. #include <X11/Intrinsic.h>
  46. #include <X11/SM/SMlib.h>
  47. #include <X11/ICE/ICEutil.h>
  48. /*
  49. * Constants for the Save_Session ToolTalk message
  50. */
  51. #define DEFAULT_SAVE_TYPE SmSaveGlobal
  52. #define DEFAULT_SHUTDOWN False
  53. #define DEFAULT_INTERACT_STYLE SmInteractStyleAny
  54. #define DEFAULT_FAST True
  55. #define DEFAULT_GLOBAL True
  56. typedef struct _PropertyRec {
  57. SmProp prop;
  58. struct _PropertyRec *next;
  59. } PropertyRec, *PropertyRecPtr;
  60. typedef struct _ClientRec {
  61. SmsConn smConn;
  62. IceConn iceConn;
  63. char * clientId;
  64. char * clientHost;
  65. int restartHint;
  66. int screenNum;
  67. PropertyRecPtr props;
  68. Boolean active;
  69. Boolean saveYourselfDone;
  70. Boolean saveYourselfP2Requested;
  71. Boolean interactRequested;
  72. struct _ClientRec * next;
  73. } ClientRec, *ClientRecPtr;
  74. typedef struct {
  75. Boolean global;
  76. Boolean shutdown;
  77. Boolean clientInteracting;
  78. Boolean inProgress;
  79. Boolean doneSuccess;
  80. Boolean saveComplete;
  81. Boolean shutdownCanceled;
  82. int interactStyle;
  83. int interactCount;
  84. int numClientIds;
  85. char * clientIds;
  86. int * workspaceNums;
  87. ClientRecPtr interactClient;
  88. } SaveStateRec;
  89. typedef struct _XSMPClientDBRec {
  90. char * clientId;
  91. char * clientHost;
  92. char * program;
  93. char * cwd;
  94. int screenNum;
  95. char ** restartCommand;
  96. char ** cloneCommand;
  97. char ** discardCommand;
  98. char ** environment;
  99. int restartHint;
  100. struct _XSMPClientDBRec * next;
  101. } XSMPClientDBRec, *XSMPClientDBRecPtr;
  102. typedef struct _ProxyClientDBRec {
  103. char * clientHost;
  104. char ** command;
  105. int screenNum;
  106. } ProxyClientDBRec, *ProxyClientDBRecPtr;
  107. typedef struct {
  108. IceListenObj * listenObjs;
  109. int numTransports;
  110. IceAuthDataEntry * authDataEntries;
  111. SaveStateRec saveState;
  112. XSMPClientDBRecPtr xsmpDbList;
  113. char * dbVersion;
  114. char * dbSessionId;
  115. } XSMPSettings, *XSMPSettingPtr;
  116. /*
  117. * Failure modes during the initializatin of XSMP
  118. */
  119. typedef enum {
  120. XSMP_FAILURE_SMS_INITIALIZE,
  121. XSMP_FAILURE_ICE_LISTEN,
  122. XSMP_FAILURE_AUTHENTICATION,
  123. XSMP_FAILURE_ICE_ADD_WATCH,
  124. XSMP_FAILURE_ICE_COMPOSE_IDS,
  125. XSMP_FAILURE_MALLOC
  126. } XSMPFailure;
  127. /*
  128. * Public variable declarations
  129. */
  130. extern XSMPSettings smXSMP;
  131. extern ClientRecPtr connectedList;
  132. extern char SM_SESSION_MANAGER[];
  133. extern char SM_VENDOR_NAME[];
  134. extern char SM_RELEASE_NAME[];
  135. extern char SM_CLIENT_ID[];
  136. extern Atom XaSmClientId;
  137. /*
  138. * Public function declarations
  139. */
  140. extern Boolean InitXSMP ( );
  141. void SaveYourselfReqProc (
  142. SmsConn smsConn,
  143. SmPointer managerData,
  144. int saveType,
  145. Bool shutdown,
  146. int interactStyle,
  147. Bool fast,
  148. Bool global);
  149. void CloseDownClient (
  150. ClientRecPtr client );
  151. void XSMPExit ();
  152. #endif /*_smxsmp_h*/