File indexing completed on 2025-01-18 10:14:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef _SMLIB_H_
0032 #define _SMLIB_H_
0033
0034 #include <X11/SM/SM.h>
0035 #include <X11/ICE/ICElib.h>
0036
0037
0038
0039
0040
0041
0042 typedef IcePointer SmPointer;
0043
0044
0045
0046
0047
0048
0049 typedef struct _SmcConn *SmcConn;
0050 typedef struct _SmsConn *SmsConn;
0051
0052
0053
0054
0055
0056
0057 typedef struct {
0058 int length;
0059 SmPointer value;
0060 } SmPropValue;
0061
0062 typedef struct {
0063 char *name;
0064 char *type;
0065 int num_vals;
0066 SmPropValue *vals;
0067 } SmProp;
0068
0069
0070
0071
0072
0073
0074
0075 typedef enum {
0076 SmcClosedNow,
0077 SmcClosedASAP,
0078 SmcConnectionInUse
0079 } SmcCloseStatus;
0080
0081
0082
0083
0084
0085
0086
0087 typedef void (*SmcSaveYourselfProc) (
0088 SmcConn ,
0089 SmPointer ,
0090 int ,
0091 Bool ,
0092 int ,
0093 Bool
0094 );
0095
0096 typedef void (*SmcSaveYourselfPhase2Proc) (
0097 SmcConn ,
0098 SmPointer
0099 );
0100
0101 typedef void (*SmcInteractProc) (
0102 SmcConn ,
0103 SmPointer
0104 );
0105
0106 typedef void (*SmcDieProc) (
0107 SmcConn ,
0108 SmPointer
0109 );
0110
0111 typedef void (*SmcShutdownCancelledProc) (
0112 SmcConn ,
0113 SmPointer
0114 );
0115
0116 typedef void (*SmcSaveCompleteProc) (
0117 SmcConn ,
0118 SmPointer
0119 );
0120
0121 typedef void (*SmcPropReplyProc) (
0122 SmcConn ,
0123 SmPointer ,
0124 int ,
0125 SmProp **
0126 );
0127
0128
0129
0130
0131
0132
0133 typedef struct {
0134
0135 struct {
0136 SmcSaveYourselfProc callback;
0137 SmPointer client_data;
0138 } save_yourself;
0139
0140 struct {
0141 SmcDieProc callback;
0142 SmPointer client_data;
0143 } die;
0144
0145 struct {
0146 SmcSaveCompleteProc callback;
0147 SmPointer client_data;
0148 } save_complete;
0149
0150 struct {
0151 SmcShutdownCancelledProc callback;
0152 SmPointer client_data;
0153 } shutdown_cancelled;
0154
0155 } SmcCallbacks;
0156
0157 #define SmcSaveYourselfProcMask (1L << 0)
0158 #define SmcDieProcMask (1L << 1)
0159 #define SmcSaveCompleteProcMask (1L << 2)
0160 #define SmcShutdownCancelledProcMask (1L << 3)
0161
0162
0163
0164
0165
0166
0167
0168 typedef Status (*SmsRegisterClientProc) (
0169 SmsConn ,
0170 SmPointer ,
0171 char *
0172 );
0173
0174 typedef void (*SmsInteractRequestProc) (
0175 SmsConn ,
0176 SmPointer ,
0177 int
0178 );
0179
0180 typedef void (*SmsInteractDoneProc) (
0181 SmsConn ,
0182 SmPointer ,
0183 Bool
0184 );
0185
0186 typedef void (*SmsSaveYourselfRequestProc) (
0187 SmsConn ,
0188 SmPointer ,
0189 int ,
0190 Bool ,
0191 int ,
0192 Bool ,
0193 Bool
0194 );
0195
0196 typedef void (*SmsSaveYourselfPhase2RequestProc) (
0197 SmsConn ,
0198 SmPointer
0199 );
0200
0201 typedef void (*SmsSaveYourselfDoneProc) (
0202 SmsConn ,
0203 SmPointer ,
0204 Bool
0205 );
0206
0207 typedef void (*SmsCloseConnectionProc) (
0208 SmsConn ,
0209 SmPointer ,
0210 int ,
0211 char **
0212 );
0213
0214 typedef void (*SmsSetPropertiesProc) (
0215 SmsConn ,
0216 SmPointer ,
0217 int ,
0218 SmProp **
0219 );
0220
0221 typedef void (*SmsDeletePropertiesProc) (
0222 SmsConn ,
0223 SmPointer ,
0224 int ,
0225 char **
0226 );
0227
0228 typedef void (*SmsGetPropertiesProc) (
0229 SmsConn ,
0230 SmPointer
0231 );
0232
0233
0234
0235
0236
0237
0238 typedef struct {
0239
0240 struct {
0241 SmsRegisterClientProc callback;
0242 SmPointer manager_data;
0243 } register_client;
0244
0245 struct {
0246 SmsInteractRequestProc callback;
0247 SmPointer manager_data;
0248 } interact_request;
0249
0250 struct {
0251 SmsInteractDoneProc callback;
0252 SmPointer manager_data;
0253 } interact_done;
0254
0255 struct {
0256 SmsSaveYourselfRequestProc callback;
0257 SmPointer manager_data;
0258 } save_yourself_request;
0259
0260 struct {
0261 SmsSaveYourselfPhase2RequestProc callback;
0262 SmPointer manager_data;
0263 } save_yourself_phase2_request;
0264
0265 struct {
0266 SmsSaveYourselfDoneProc callback;
0267 SmPointer manager_data;
0268 } save_yourself_done;
0269
0270 struct {
0271 SmsCloseConnectionProc callback;
0272 SmPointer manager_data;
0273 } close_connection;
0274
0275 struct {
0276 SmsSetPropertiesProc callback;
0277 SmPointer manager_data;
0278 } set_properties;
0279
0280 struct {
0281 SmsDeletePropertiesProc callback;
0282 SmPointer manager_data;
0283 } delete_properties;
0284
0285 struct {
0286 SmsGetPropertiesProc callback;
0287 SmPointer manager_data;
0288 } get_properties;
0289
0290 } SmsCallbacks;
0291
0292
0293 #define SmsRegisterClientProcMask (1L << 0)
0294 #define SmsInteractRequestProcMask (1L << 1)
0295 #define SmsInteractDoneProcMask (1L << 2)
0296 #define SmsSaveYourselfRequestProcMask (1L << 3)
0297 #define SmsSaveYourselfP2RequestProcMask (1L << 4)
0298 #define SmsSaveYourselfDoneProcMask (1L << 5)
0299 #define SmsCloseConnectionProcMask (1L << 6)
0300 #define SmsSetPropertiesProcMask (1L << 7)
0301 #define SmsDeletePropertiesProcMask (1L << 8)
0302 #define SmsGetPropertiesProcMask (1L << 9)
0303
0304
0305
0306 typedef Status (*SmsNewClientProc) (
0307 SmsConn ,
0308 SmPointer ,
0309 unsigned long * ,
0310 SmsCallbacks * ,
0311 char **
0312 );
0313
0314
0315
0316
0317
0318
0319
0320 typedef void (*SmcErrorHandler) (
0321 SmcConn ,
0322 Bool ,
0323 int ,
0324 unsigned long ,
0325 int ,
0326 int ,
0327 SmPointer
0328 );
0329
0330 typedef void (*SmsErrorHandler) (
0331 SmsConn ,
0332 Bool ,
0333 int ,
0334 unsigned long ,
0335 int ,
0336 int ,
0337 SmPointer
0338 );
0339
0340
0341
0342
0343
0344
0345
0346 _XFUNCPROTOBEGIN
0347
0348 extern SmcConn SmcOpenConnection (
0349 char * ,
0350 SmPointer ,
0351 int ,
0352 int ,
0353 unsigned long ,
0354 SmcCallbacks * ,
0355 const char * ,
0356 char ** ,
0357 int ,
0358 char *
0359 );
0360
0361 extern SmcCloseStatus SmcCloseConnection (
0362 SmcConn ,
0363 int ,
0364 char **
0365 );
0366
0367 extern void SmcModifyCallbacks (
0368 SmcConn ,
0369 unsigned long ,
0370 SmcCallbacks *
0371 );
0372
0373 extern void SmcSetProperties (
0374 SmcConn ,
0375 int ,
0376 SmProp **
0377 );
0378
0379 extern void SmcDeleteProperties (
0380 SmcConn ,
0381 int ,
0382 char **
0383 );
0384
0385 extern Status SmcGetProperties (
0386 SmcConn ,
0387 SmcPropReplyProc ,
0388 SmPointer
0389 );
0390
0391 extern Status SmcInteractRequest (
0392 SmcConn ,
0393 int ,
0394 SmcInteractProc ,
0395 SmPointer
0396 );
0397
0398 extern void SmcInteractDone (
0399 SmcConn ,
0400 Bool
0401 );
0402
0403 extern void SmcRequestSaveYourself (
0404 SmcConn ,
0405 int ,
0406 Bool ,
0407 int ,
0408 Bool ,
0409 Bool
0410 );
0411
0412 extern Status SmcRequestSaveYourselfPhase2 (
0413 SmcConn ,
0414 SmcSaveYourselfPhase2Proc ,
0415 SmPointer
0416 );
0417
0418 extern void SmcSaveYourselfDone (
0419 SmcConn ,
0420 Bool
0421 );
0422
0423 extern int SmcProtocolVersion (
0424 SmcConn
0425 );
0426
0427 extern int SmcProtocolRevision (
0428 SmcConn
0429 );
0430
0431 extern char *SmcVendor (
0432 SmcConn
0433 );
0434
0435 extern char *SmcRelease (
0436 SmcConn
0437 );
0438
0439 extern char *SmcClientID (
0440 SmcConn
0441 );
0442
0443 extern IceConn SmcGetIceConnection (
0444 SmcConn
0445 );
0446
0447 extern Status SmsInitialize (
0448 const char * ,
0449 const char * ,
0450 SmsNewClientProc ,
0451 SmPointer ,
0452 IceHostBasedAuthProc ,
0453 int ,
0454 char *
0455 );
0456
0457 extern char *SmsClientHostName (
0458 SmsConn
0459 );
0460
0461 extern char *SmsGenerateClientID (
0462 SmsConn
0463 );
0464
0465 extern Status SmsRegisterClientReply (
0466 SmsConn ,
0467 char *
0468 );
0469
0470 extern void SmsSaveYourself (
0471 SmsConn ,
0472 int ,
0473 Bool ,
0474 int ,
0475 Bool
0476 );
0477
0478 extern void SmsSaveYourselfPhase2 (
0479 SmsConn
0480 );
0481
0482 extern void SmsInteract (
0483 SmsConn
0484 );
0485
0486 extern void SmsDie (
0487 SmsConn
0488 );
0489
0490 extern void SmsSaveComplete (
0491 SmsConn
0492 );
0493
0494 extern void SmsShutdownCancelled (
0495 SmsConn
0496 );
0497
0498 extern void SmsReturnProperties (
0499 SmsConn ,
0500 int ,
0501 SmProp **
0502 );
0503
0504 extern void SmsCleanUp (
0505 SmsConn
0506 );
0507
0508 extern int SmsProtocolVersion (
0509 SmsConn
0510 );
0511
0512 extern int SmsProtocolRevision (
0513 SmsConn
0514 );
0515
0516 extern char *SmsClientID (
0517 SmsConn
0518 );
0519
0520 extern IceConn SmsGetIceConnection (
0521 SmsConn
0522 );
0523
0524 extern SmcErrorHandler SmcSetErrorHandler (
0525 SmcErrorHandler
0526 );
0527
0528 extern SmsErrorHandler SmsSetErrorHandler (
0529 SmsErrorHandler
0530 );
0531
0532 extern void SmFreeProperty (
0533 SmProp *
0534 );
0535
0536 extern void SmFreeReasons (
0537 int ,
0538 char **
0539 );
0540
0541 _XFUNCPROTOEND
0542
0543 #endif